	SECTION _TEXT CLASS=CODE USE32
	SECTION _DATA CLASS=DATA USE32
	SECTION _BSS  CLASS=BSS USE32
	SECTION _CONST  CLASS=CONST USE32
	SECTION _STRING  CLASS=STRING USE32
	SECTION cstartup CLASS=INITDATA USE32
	SECTION crundown CLASS=EXITDATA USE32
	SECTION cppinit  CLASS=CPPINIT USE32
	SECTION cppexit  CLASS=CPPEXIT USE32
	GROUP DGROUP _DATA _BSS _CONST _STRING

SECTION _TEXT
[GLOBAL	__ll_init]
;
; Line 25:	{
;
__ll_init:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 04H
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD _stdin
	MOV	EDI,DWORD __pstreams
;
; Line 27:		_pstreams[0] = &input_file;
;
	MOV	DWORD [EDI+00H],DWORD _input_file
;
; Line 28:		_pstreams[1] = &output_file;
;
	MOV	DWORD [EDI+04H],DWORD _output_file
;
; Line 29:		_pstreams[2] = &error_file;
;
	MOV	DWORD [EDI+08H],DWORD _error_file
;
; Line 30:		maxfiles = 3;
;
	MOV	DWORD [_maxfiles],03H
;
; Line 31:		stdin->fd = GetStdHandle((DWORD)(-10));
;
	PUSH	BYTE 0FFFFFFF6H
	CALL	GetStdHandle
	MOV	ECX,DWORD [ESI+00H]
	MOV	DWORD [ECX+08H],EAX
;
; Line 32:		stdout->fd = GetStdHandle((DWORD)(-11));
;
	PUSH	BYTE 0FFFFFFF5H
	CALL	GetStdHandle
	MOV	ECX,DWORD [_stdout]
	MOV	DWORD [ECX+08H],EAX
;
; Line 33:		stderr->fd = GetStdHandle((DWORD)(-12));
;
	PUSH	BYTE 0FFFFFFF4H
	CALL	GetStdHandle
	MOV	ECX,DWORD [_stderr]
	MOV	DWORD [ECX+08H],EAX
;
; Line 35:		GetConsoleMode((HANDLE) stdin->fd,&mode) ;
;
	LEA	EAX,[EBP+0FFFFFFFCH]
	PUSH	EAX
	MOV	EAX,DWORD [ESI+00H]
	PUSH	DWORD [EAX+08H]
	CALL	GetConsoleMode
;
; Line 36:		SetConsoleMode((HANDLE)stdin->fd, mode & ~(2)) ;
;
	MOV	EAX,DWORD [EBP+0FFFFFFFCH]
	BTR	EAX,01H
	PUSH	EAX
	MOV	EAX,DWORD [ESI+00H]
	PUSH	DWORD [EAX+08H]
	CALL	SetConsoleMode
;
; Line 37:	}
;
	POP	EDI
	POP	ESI
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_open]
;
; Line 39:	{
;
__ll_open:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
;
; Line 40:		HANDLE handle = CreateFileA(name,flags,0,0,(3),(128),0);
;
	PUSH	BYTE 00H
	PUSH	DWORD 080H
	PUSH	BYTE 03H
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [EBP+08H]
	CALL	CreateFileA
	MOV	EBX,EAX
;
; Line 41:		if (handle == ((HANDLE)-1))
;
	CMP	EBX,BYTE 0FFFFFFFFH
	JNE	SHORT	L_1
;
; Line 42:			return 0;
;
	MOV	EAX,00H
	JMP	L_3
L_1:
;
; Line 43:		return handle ;
;
	MOV	EAX,EBX
L_3:
	POP	EBX
	POP	EBP
	RET
[GLOBAL	__ll_creat]
;
; Line 46:	{
;
__ll_creat:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
;
; Line 47:		HANDLE handle = CreateFileA(name,flags,0,0,(2),(128),0);
;
	PUSH	BYTE 00H
	PUSH	DWORD 080H
	PUSH	BYTE 02H
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [EBP+08H]
	CALL	CreateFileA
	MOV	EBX,EAX
;
; Line 48:		if (handle == ((HANDLE)-1))
;
	CMP	EBX,BYTE 0FFFFFFFFH
	JNE	SHORT	L_4
;
; Line 49:			return 0;
;
	MOV	EAX,00H
	JMP	L_6
L_4:
;
; Line 50:		return handle ;
;
	MOV	EAX,EBX
L_6:
	POP	EBX
	POP	EBP
	RET
[GLOBAL	__ll_close]
;
; Line 53:	{
;
__ll_close:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 54:		CloseHandle((HANDLE)fd) ;
;
	PUSH	DWORD [EBP+08H]
	CALL	CloseHandle
;
; Line 55:		return 1 ;
;
	MOV	EAX,01H
L_7:
	POP	EBP
	RET
[GLOBAL	__ll_getpos]
;
; Line 58:	{
;
__ll_getpos:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 59:		return SetFilePointer((HANDLE)fd,0,0,(1)) ;
;
	PUSH	BYTE 01H
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	CALL	SetFilePointer
L_8:
	POP	EBP
	RET
[GLOBAL	__ll_flags]
;
; Line 62:	{
;
__ll_flags:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	MOV	EBX,DWORD [EBP+08H]
;
; Line 63:		if (flags & 0x0002                   )
;
	MOV	EAX,EBX
	AND	EAX,BYTE 02H
	JE	NEAR	L_9
;
; Line 64:			if (flags & 0x0001                   )
;
	MOV	EAX,EBX
	AND	EAX,BYTE 01H
	JE	SHORT	L_11
;
; Line 65:				return (0x80000000L) | (0x40000000L);
;
	MOV	EAX,0C0000000H
	JMP	L_13
L_11:
;
; Line 67:				return (0x40000000L);
;
	MOV	EAX,040000000H
	JMP	L_13
L_12:
	JMP	L_10
L_9:
;
; Line 69:			return (0x80000000L);
;
	MOV	EAX,080000000H
L_10:
;
; Line 70:	} 
;
L_13:
	POP	EBX
	POP	EBP
	RET
[GLOBAL	__ll_seek]
;
; Line 73:	{
;
__ll_seek:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
;
; Line 75:		switch(origin) {
;
	MOV	EAX,DWORD [EBP+010H]
	CMP	EAX,DWORD 00H
	JE	SHORT	L_16
	CMP	EAX,DWORD 01H
	JE	SHORT	L_17
	CMP	EAX,DWORD 02H
	JE	SHORT	L_18
	JMP	L_14
L_16:
;
; Line 77:				type = (0) ;
;
	MOV	EBX,00H
;
; Line 78:				break ;
;
	JMP	L_15
L_17:
;
; Line 80:				type = (1) ;
;
	MOV	EBX,01H
;
; Line 81:				break ;
;
	JMP	L_15
L_18:
;
; Line 83:				type = (2);
;
	MOV	EBX,02H
;
; Line 84:				break ;
;
L_14:
L_15:
;
; Line 86:		type = SetFilePointer((HANDLE)fd,pos,0,type);
;
	PUSH	EBX
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [EBP+08H]
	CALL	SetFilePointer
	MOV	EBX,EAX
;
; Line 87:		if (type == 0xffffffff)
;
	CMP	EBX,BYTE 0FFFFFFFFH
	JNE	SHORT	L_19
;
; Line 88:			return 0;
;
	MOV	EAX,00H
	JMP	L_21
L_19:
;
; Line 89:		return 1 ;
;
	MOV	EAX,01H
L_21:
	POP	EBX
	POP	EBP
	RET
[GLOBAL	__ll_rename]
;
; Line 92:	{
;
__ll_rename:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 93:		return MoveFileA(old,new);
;
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [EBP+08H]
	CALL	MoveFileA
L_22:
	POP	EBP
	RET
[GLOBAL	__ll_remove]
;
; Line 96:	{
;
__ll_remove:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 97:		return DeleteFileA(name) ;
;
	PUSH	DWORD [EBP+08H]
	CALL	DeleteFileA
L_23:
	POP	EBP
	RET
[GLOBAL	__ll_write]
;
; Line 100:	{
;
__ll_write:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 04H
	PUSH	EBX
	PUSH	ESI
	MOV	ESI,DWORD [EBP+010H]
;
; Line 102:		int rv = WriteFile((HANDLE)fd,buf,size,&written,0);
;
	PUSH	BYTE 00H
	LEA	EAX,[EBP+0FFFFFFFCH]
	PUSH	EAX
	PUSH	ESI
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [EBP+08H]
	CALL	WriteFile
	MOV	EBX,EAX
;
; Line 103:		if (!rv)
;
	TEST	EBX,EBX
	JNE	SHORT	L_24
;
; Line 104:			return rv ;
;
	MOV	EAX,EBX
	JMP	L_26
L_24:
;
; Line 105:		if (written != size)
;
	CMP	DWORD [EBP+0FFFFFFFCH],ESI
	JE	SHORT	L_27
;
; Line 106:			return 0;
;
	MOV	EAX,00H
	JMP	L_26
L_27:
;
; Line 107:		return rv ;
;
	MOV	EAX,EBX
L_26:
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_read]
;
; Line 110:	{
;
__ll_read:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 08H
;
; Line 112:		int rv = ReadFile((HANDLE)fd,buf,size,&read,0) ;
;
	PUSH	BYTE 00H
	LEA	EAX,[EBP+0FFFFFFF8H]
	PUSH	EAX
	PUSH	DWORD [EBP+010H]
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [EBP+08H]
	CALL	ReadFile
	MOV	DWORD [EBP+0FFFFFFFCH],EAX
;
; Line 113:		return read ;
;
	MOV	EAX,DWORD [EBP+0FFFFFFF8H]
L_29:
	MOV	ESP,EBP
	POP	EBP
	RET

SECTION _DATA
[GLOBAL	_output_file]

_output_file	DD	00H,020AH,01H
	DB	00H
	DD	00H,00H,00H,00H
	DW	0444CH
[GLOBAL	_input_file]

_input_file	DD	00H,0209H,00H
	DB	00H
	DD	0200H,_inbuf+0,_inbuf+0
	DD	00H
	DW	0444CH
[GLOBAL	_error_file]

_error_file	DD	00H,020AH,01H
	DB	00H
	DD	00H,00H,00H,00H
	DW	0444CH
[GLOBAL	_stdin]

_stdin	DD	_input_file
[GLOBAL	_stdout]

_stdout	DD	_output_file
[GLOBAL	_stderr]

_stderr	DD	_error_file
SECTION _BSS
[GLOBAL	_inbuf]

_inbuf	RESB	0200H

SECTION _TEXT
[EXTERN	CreateFileA]
[EXTERN	CloseHandle]
[EXTERN	SetFilePointer]
[EXTERN	ReadFile]
[EXTERN	WriteFile]
[EXTERN	GetConsoleMode]
[EXTERN	SetConsoleMode]
[EXTERN	GetStdHandle]
[EXTERN	DeleteFileA]
[EXTERN	MoveFileA]

SECTION _DATA
[EXTERN	_maxfiles]
[EXTERN	__pstreams]
