	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 26:	{
;
__ll_init:
	PUSH	ESI
	MOV	ESI,DWORD __pstreams
;
; Line 27:		_pstreams[0] = &input_file;
;
	MOV	DWORD [ESI+00H],DWORD _input_file
;
; Line 28:		_pstreams[1] = &output_file;
;
	MOV	DWORD [ESI+04H],DWORD _output_file
;
; Line 29:		_pstreams[2] = &error_file;
;
	MOV	DWORD [ESI+08H],DWORD _error_file
;
; Line 30:		maxfiles = 3;
;
	MOV	DWORD [_maxfiles],03H
;
; Line 31:	}
;
	POP	ESI
	RET
[GLOBAL	__ll_open]
;
; Line 33:	{
;
__ll_open:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 034H
	PUSH	ESI
	LEA	ESI,[EBP+0FFFFFFCCH]
;
; Line 35:		regs.d.eax = flags;
;
	MOV	EAX,DWORD [EBP+0CH]
	MOV	DWORD [ESI+01CH],EAX
;
; Line 36:		regs.h.dx = __nametodta(name,0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	CALL	___nametodta
	ADD	ESP,BYTE 08H
	MOV	WORD [ESI+014H],AX
;
; Line 37:		return __doscall(0x3d,&regs);
;
	PUSH	ESI
	PUSH	BYTE 03DH
	CALL	___doscall
	ADD	ESP,BYTE 08H
L_1:
	POP	ESI
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_creat]
;
; Line 40:	{
;
__ll_creat:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 034H
	PUSH	ESI
	LEA	ESI,[EBP+0FFFFFFCCH]
;
; Line 42:		regs.d.ecx = 0;
;
	MOV	DWORD [ESI+018H],00H
;
; Line 43:		regs.h.dx = __nametodta(name,0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	CALL	___nametodta
	ADD	ESP,BYTE 08H
	MOV	WORD [ESI+014H],AX
;
; Line 44:		return __doscall(0x3c,&regs);
;
	PUSH	ESI
	PUSH	BYTE 03CH
	CALL	___doscall
	ADD	ESP,BYTE 08H
L_2:
	POP	ESI
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_close]
;
; Line 47:	{
;
__ll_close:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 034H
	PUSH	EBX
	MOV	EBX,DWORD [EBP+08H]
;
; Line 49:		if (fd < 5)
;
	CMP	EBX,BYTE 05H
	JGE	SHORT	L_3
;
; Line 50:			return 0;
;
	MOV	EAX,00H
	JMP	L_5
L_3:
;
; Line 51:		regs.h.bx = fd;
;
	MOV	WORD [EBP+0FFFFFFDCH],BX
;
; Line 52:		__doscall(0x3e,&regs);
;
	LEA	EAX,[EBP+0FFFFFFCCH]
	PUSH	EAX
	PUSH	BYTE 03EH
	CALL	___doscall
	ADD	ESP,BYTE 08H
;
; Line 53:		return 0;
;
	MOV	EAX,00H
L_5:
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_getpos]
;
; Line 56:	{
;
__ll_getpos:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 034H
	PUSH	ESI
	LEA	ESI,[EBP+0FFFFFFCCH]
;
; Line 58:		regs.h.bx = fd;
;
	MOV	AX,WORD [EBP+08H]
	MOV	WORD [ESI+010H],AX
;
; Line 59:		regs.h.dx =0;
;
	MOV	WORD [ESI+014H],00H
;
; Line 60:		regs.h.cx = 0;
;
	MOV	WORD [ESI+018H],00H
;
; Line 61:		regs.b.al=1;
;
	MOV	BYTE [ESI+01CH],01H
;
; Line 62:		__doscall(0x42,&regs);
;
	PUSH	ESI
	PUSH	BYTE 042H
	CALL	___doscall
	ADD	ESP,BYTE 08H
;
; Line 63:		if (regs.h.flags & 1)
;
	MOVZX	EAX,WORD [ESI+020H]
	AND	EAX,BYTE 01H
	JE	SHORT	L_6
;
; Line 64:			return -1;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_8
L_6:
;
; Line 65:		return ((regs.h.dx << 16) + regs.h.ax);
;
	MOVZX	EAX,WORD [ESI+014H]
	SAL	EAX,010H
	MOVZX	ECX,WORD [ESI+01CH]
	ADD	EAX,ECX
L_8:
	POP	ESI
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_flags]
;
; Line 68:	{
;
__ll_flags:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	MOV	EBX,DWORD [EBP+08H]
;
; Line 69:		if (flags & 0x0002                   )
;
	MOV	EAX,EBX
	AND	EAX,BYTE 02H
	JE	NEAR	L_9
;
; Line 70:			if (flags & 0x0001                   )
;
	MOV	EAX,EBX
	AND	EAX,BYTE 01H
	JE	SHORT	L_11
;
; Line 71:				return 2;
;
	MOV	EAX,02H
	JMP	L_13
L_11:
;
; Line 73:				return 1;
;
	MOV	EAX,01H
	JMP	L_13
L_12:
	JMP	L_10
L_9:
;
; Line 75:			return 0;
;
	MOV	EAX,00H
L_10:
;
; Line 76:	} 
;
L_13:
	POP	EBX
	POP	EBP
	RET
[GLOBAL	__ll_seek]
;
; Line 79:	{
;
__ll_seek:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 034H
	PUSH	EBX
	PUSH	ESI
	LEA	ESI,[EBP+0FFFFFFCCH]
	MOV	EBX,DWORD [EBP+0CH]
;
; Line 81:		regs.h.bx = fd;
;
	MOV	AX,WORD [EBP+08H]
	MOV	WORD [ESI+010H],AX
;
; Line 82:		regs.h.cx = pos >> 16;
;
	MOV	EAX,EBX
	SAR	EAX,010H
	MOV	WORD [ESI+018H],AX
;
; Line 83:		regs.h.dx = pos & 65535;
;
	MOVZX	EAX,BX
	MOV	WORD [ESI+014H],AX
;
; Line 84:		regs.b.al = origin;
;
	MOV	AL,BYTE [EBP+010H]
	MOV	BYTE [ESI+01CH],AL
;
; Line 85:		__doscall(0x42,&regs);
;
	PUSH	ESI
	PUSH	BYTE 042H
	CALL	___doscall
	ADD	ESP,BYTE 08H
;
; Line 86:		if (regs.h.flags & 1)
;
	MOVZX	EAX,WORD [ESI+020H]
	AND	EAX,BYTE 01H
	JE	SHORT	L_14
;
; Line 87:			return -1;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_16
L_14:
;
; Line 89:		return 0;
;
	MOV	EAX,00H
L_16:
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_rename]
;
; Line 92:	{
;
__ll_rename:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 034H
	PUSH	ESI
	LEA	ESI,[EBP+0FFFFFFCCH]
;
; Line 94:		regs.h.dx = __nametodta(old,0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	CALL	___nametodta
	ADD	ESP,BYTE 08H
	MOV	WORD [ESI+014H],AX
;
; Line 95:		regs.h.di = __nametodta(new,256);
;
	PUSH	DWORD 0100H
	PUSH	DWORD [EBP+0CH]
	CALL	___nametodta
	ADD	ESP,BYTE 08H
	MOV	WORD [ESI+00H],AX
;
; Line 96:		__doscall(0x56,&regs);
;
	PUSH	ESI
	PUSH	BYTE 056H
	CALL	___doscall
	ADD	ESP,BYTE 08H
;
; Line 97:		if (regs.h.flags & 1)
;
	MOVZX	EAX,WORD [ESI+020H]
	AND	EAX,BYTE 01H
	JE	SHORT	L_17
;
; Line 98:			return -1;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_19
L_17:
;
; Line 100:		return 0;
;
	MOV	EAX,00H
L_19:
	POP	ESI
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_remove]
;
; Line 103:	{
;
__ll_remove:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 034H
	PUSH	ESI
	LEA	ESI,[EBP+0FFFFFFCCH]
;
; Line 105:		regs.h.dx = __nametodta(name,0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+08H]
	CALL	___nametodta
	ADD	ESP,BYTE 08H
	MOV	WORD [ESI+014H],AX
;
; Line 106:		__doscall(0x41,&regs);
;
	PUSH	ESI
	PUSH	BYTE 041H
	CALL	___doscall
	ADD	ESP,BYTE 08H
;
; Line 107:		if (regs.h.flags & 1)
;
	MOVZX	EAX,WORD [ESI+020H]
	AND	EAX,BYTE 01H
	JE	SHORT	L_20
;
; Line 108:			return -1;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_22
L_20:
;
; Line 110:		return 0;
;
	MOV	EAX,00H
L_22:
	POP	ESI
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_write]
;
; Line 113:	{
;
__ll_write:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 03CH
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	LEA	ESI,[EBP+0FFFFFFC4H]
	MOV	EDI,DWORD [EBP+08H]
;
; Line 115:		int mod = size%2048,i,tsize = 0;
;
	MOV	EAX,DWORD [EBP+010H]
	AND	EAX,07FFH
	MOV	DWORD [EBP+0FFFFFFF8H],EAX
	MOV	DWORD [EBP+0FFFFFFFCH],00H
	MOV	EBX,00H
	JMP	L_25
L_23:
;
; Line 117:			regs.h.dx = __buftodta((char *)buf+i,2048);
;
	PUSH	DWORD 0800H
	MOV	EAX,DWORD [EBP+0CH]
	ADD	EAX,EBX
	PUSH	EAX
	CALL	___buftodta
	ADD	ESP,BYTE 08H
	MOV	WORD [ESI+014H],AX
;
; Line 118:			regs.h.bx = fd;
;
	MOV	WORD [ESI+010H],DI
;
; Line 119:			regs.h.cx = 2048;
;
	MOV	WORD [ESI+018H],0800H
;
; Line 120:			__doscall(0x40,&regs);
;
	PUSH	ESI
	PUSH	BYTE 040H
	CALL	___doscall
	ADD	ESP,BYTE 08H
;
; Line 121:			if (regs.h.flags & 1)
;
	MOVZX	EAX,WORD [ESI+020H]
	AND	EAX,BYTE 01H
	JE	SHORT	L_27
;
; Line 122:				return -1;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_29
L_27:
;
; Line 123:			tsize += regs.h.ax;
;
	MOVZX	EAX,WORD [ESI+01CH]
	ADD	DWORD [EBP+0FFFFFFFCH],EAX
;
; Line 124:		}
;
;
; Line 116:		for (i=0; i < (size&-2048); i +=2048) {
;
L_24:
	ADD	EBX,0800H
L_25:
	MOV	EAX,DWORD [EBP+010H]
	AND	EAX,0FFFFF800H
	CMP	EBX,EAX
	JL	NEAR	L_23
L_26:
;
; Line 125:		regs.h.dx = __buftodta((char *)buf+i,mod);
;
	PUSH	DWORD [EBP+0FFFFFFF8H]
	MOV	EAX,DWORD [EBP+0CH]
	ADD	EAX,EBX
	PUSH	EAX
	CALL	___buftodta
	ADD	ESP,BYTE 08H
	MOV	WORD [ESI+014H],AX
;
; Line 126:		regs.h.bx = fd;
;
	MOV	WORD [ESI+010H],DI
;
; Line 127:		regs.h.cx = mod;
;
	MOV	AX,WORD [EBP+0FFFFFFF8H]
	MOV	WORD [ESI+018H],AX
;
; Line 128:		__doscall(0x40,&regs);
;
	PUSH	ESI
	PUSH	BYTE 040H
	CALL	___doscall
	ADD	ESP,BYTE 08H
;
; Line 129:		if (regs.h.flags & 1)
;
	MOVZX	EAX,WORD [ESI+020H]
	AND	EAX,BYTE 01H
	JE	SHORT	L_30
;
; Line 130:			return -1;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_29
L_30:
;
; Line 131:		tsize += regs.h.ax;
;
	MOVZX	EAX,WORD [ESI+01CH]
	ADD	DWORD [EBP+0FFFFFFFCH],EAX
;
; Line 132:		return tsize;
;
	MOV	EAX,DWORD [EBP+0FFFFFFFCH]
L_29:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	__ll_read]
;
; Line 135:	{
;
__ll_read:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 03CH
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	LEA	ESI,[EBP+0FFFFFFC4H]
	MOV	EDI,DWORD [EBP+0CH]
;
; Line 137:		int mod = size %2048,i, tsize = 0;
;
	MOV	EAX,DWORD [EBP+010H]
	AND	EAX,07FFH
	MOV	DWORD [EBP+0FFFFFFF8H],EAX
	MOV	DWORD [EBP+0FFFFFFFCH],00H
	MOV	EBX,00H
	JMP	L_34
L_32:
;
; Line 139:			regs.h.dx = 0;
;
	MOV	WORD [ESI+014H],00H
;
; Line 140:			regs.h.bx = fd;
;
	MOV	AX,WORD [EBP+08H]
	MOV	WORD [ESI+010H],AX
;
; Line 141:			regs.h.cx = 2048;
;
	MOV	WORD [ESI+018H],0800H
;
; Line 142:			__doscall(0x3f,&regs);
;
	PUSH	ESI
	PUSH	BYTE 03FH
	CALL	___doscall
	ADD	ESP,BYTE 08H
;
; Line 143:			if (regs.h.flags & 1)
;
	MOVZX	EAX,WORD [ESI+020H]
	AND	EAX,BYTE 01H
	JE	SHORT	L_36
;
; Line 144:				return -1;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_38
L_36:
;
; Line 145:			__dtatobuf((char *)buf+i,2048);
;
	PUSH	DWORD 0800H
	MOV	EAX,EDI
	ADD	EAX,EBX
	PUSH	EAX
	CALL	___dtatobuf
	ADD	ESP,BYTE 08H
;
; Line 146:			tsize += regs.h.ax;
;
	MOVZX	EAX,WORD [ESI+01CH]
	ADD	DWORD [EBP+0FFFFFFFCH],EAX
;
; Line 147:			if (regs.h.ax < 2048)
;
	MOVZX	EAX,WORD [ESI+01CH]
	CMP	EAX,0800H
	JNC	SHORT	L_39
;
; Line 148:				return tsize;
;
	MOV	EAX,DWORD [EBP+0FFFFFFFCH]
	JMP	L_38
L_39:
;
; Line 149:		}
;
;
; Line 138:		for (i=0; i < (size & -2048); i += 2048) {
;
L_33:
	ADD	EBX,0800H
L_34:
	MOV	EAX,DWORD [EBP+010H]
	AND	EAX,0FFFFF800H
	CMP	EBX,EAX
	JL	NEAR	L_32
L_35:
;
; Line 150:		regs.h.dx = 0;
;
	MOV	WORD [ESI+014H],00H
;
; Line 151:		regs.h.bx = fd;
;
	MOV	AX,WORD [EBP+08H]
	MOV	WORD [ESI+010H],AX
;
; Line 152:		regs.h.cx = mod;
;
	MOV	AX,WORD [EBP+0FFFFFFF8H]
	MOV	WORD [ESI+018H],AX
;
; Line 153:		__doscall(0x3f,&regs);
;
	PUSH	ESI
	PUSH	BYTE 03FH
	CALL	___doscall
	ADD	ESP,BYTE 08H
;
; Line 154:		tsize += regs.h.ax;
;
	MOVZX	EAX,WORD [ESI+01CH]
	ADD	DWORD [EBP+0FFFFFFFCH],EAX
;
; Line 155:		if (regs.h.flags & 1)
;
	MOVZX	EAX,WORD [ESI+020H]
	AND	EAX,BYTE 01H
	JE	SHORT	L_41
;
; Line 156:			return -1;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_38
L_41:
;
; Line 157:		__dtatobuf((char *)buf+i,mod);
;
	PUSH	DWORD [EBP+0FFFFFFF8H]
	MOV	EAX,EDI
	ADD	EAX,EBX
	PUSH	EAX
	CALL	___dtatobuf
	ADD	ESP,BYTE 08H
;
; Line 158:		return tsize;
;
	MOV	EAX,DWORD [EBP+0FFFFFFFCH]
L_38:
	POP	EDI
	POP	ESI
	POP	EBX
	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	___doscall]
[EXTERN	___nametodta]
[EXTERN	___buftodta]
[EXTERN	___dtatobuf]

SECTION _DATA
[EXTERN	_maxfiles]
[EXTERN	__pstreams]
