	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	__readbuf]
;
; Line 7:	{
;
__readbuf:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 010H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
;
; Line 9:		if (stream->buffer) {
;
	CMP	DWORD [ESI+011H],BYTE 00H
	JE	SHORT	L_1
;
; Line 11:			stream->curp = stream->buffer;
;
	MOV	EAX,DWORD [ESI+011H]
	MOV	DWORD [ESI+015H],EAX
;
; Line 12:			sz2 = stream->bsize;
;
	MOV	EAX,DWORD [ESI+0DH]
	MOV	DWORD [EBP+0FFFFFFFCH],EAX
;
; Line 13:		}
;
	JMP	L_2
L_1:
;
; Line 16:			stream->curp = &stream->hold;
;
	LEA	EAX,[ESI+0CH]
	MOV	DWORD [ESI+015H],EAX
;
; Line 17:			sz2 = 1;
;
	MOV	DWORD [EBP+0FFFFFFFCH],01H
;
; Line 18:		}
;
L_2:
;
; Line 19:		stream->level = sz = _ll_read(stream->fd,stream->curp,sz2);
;
	PUSH	DWORD [EBP+0FFFFFFFCH]
	PUSH	DWORD [ESI+015H]
	PUSH	DWORD [ESI+08H]
	CALL	__ll_read
	ADD	ESP,BYTE 0CH
	MOV	DWORD [EBP+0FFFFFFF8H],EAX
	MOV	DWORD [ESI+00H],EAX
;
; Line 21:		if (sz < 0) {
;
	CMP	DWORD [EBP+0FFFFFFF8H],BYTE 00H
	JGE	SHORT	L_3
;
; Line 22:			stream->flags |= 0x0010                   ;
;
	BTS	DWORD [ESI+04H],04H
;
; Line 23:			errno = 40       ;
;
	MOV	DWORD [_errno],028H
;
; Line 24:			return (-1)             ;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_5
L_3:
;
; Line 27:		else if (sz == 0) {
;
	CMP	DWORD [EBP+0FFFFFFF8H],BYTE 00H
	JNE	SHORT	L_6
;
; Line 28:			stream->flags |= 0x0020                   ;
;
	BTS	DWORD [ESI+04H],05H
;
; Line 29:			return (-1)             ;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_5
L_6:
;
; Line 32:			if (!(stream->flags & 0x0040                   )) {
;
	MOV	EAX,DWORD [ESI+04H]
	AND	EAX,BYTE 040H
	JNE	NEAR	L_8
;
; Line 34:				unsigned char *p = stream->buffer,*q=p;
;
	MOV	EDI,DWORD [ESI+011H]
	MOV	DWORD [EBP+0FFFFFFF0H],EDI
;
; Line 35:				int len = stream->level;
;
	MOV	EAX,DWORD [ESI+00H]
	MOV	DWORD [EBP+0FFFFFFF4H],EAX
	MOV	EBX,00H
	JMP	L_12
L_10:
;
; Line 38:					if (*p == 0x1a) {
;
	MOVZX	EAX,BYTE [EDI+00H]
	CMP	EAX,BYTE 01AH
	JE	NEAR	L_13
;
; Line 39:						break;
;
L_14:
;
; Line 42:						if (*p == '\r') {
;
	MOVZX	EAX,BYTE [EDI+00H]
	CMP	EAX,BYTE 0DH
	JNE	SHORT	L_16
;
; Line 43:							p++;
;
	INC	EDI
;
; Line 44:						}
;
	JMP	L_17
L_16:
;
; Line 46:							*q++ = *p++;
;
	MOV	EAX,EDI
	INC	EDI
	MOV	ECX,DWORD [EBP+0FFFFFFF0H]
	INC	DWORD [EBP+0FFFFFFF0H]
	MOV	AL,BYTE [EAX+00H]
	MOV	BYTE [ECX+00H],AL
L_17:
;
; Line 47:					}
;
L_15:
;
; Line 37:				for (i=0; i < len; i++)
;
L_11:
	INC	EBX
L_12:
	CMP	EBX,DWORD [EBP+0FFFFFFF4H]
	JL	NEAR	L_10
L_13:
;
; Line 48:				stream->level = q - stream->buffer;
;
	MOV	EAX,DWORD [EBP+0FFFFFFF0H]
	SUB	EAX,DWORD [ESI+011H]
	MOV	DWORD [ESI+00H],EAX
;
; Line 49:			}
;
L_8:
;
; Line 50:		}
;
L_7:
L_4:
;
; Line 51:		return 0;
;
	MOV	EAX,00H
L_5:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
[GLOBAL	_fgetc]
;
; Line 54:	{
;
_fgetc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
;
; Line 56:		if (stream->token != 0x444c) {
;
	MOVSX	EAX,WORD [ESI+01DH]
	CMP	EAX,0444CH
	JE	SHORT	L_18
;
; Line 57:			errno = _dos_errno = 2       ;
;
	MOV	DWORD [__dos_errno],02H
	MOV	DWORD [_errno],02H
;
; Line 58:			return (-1)             ;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_20
L_18:
;
; Line 60:		if (!(stream->flags & 0x0001                   )) {
;
	MOV	EAX,DWORD [ESI+04H]
	AND	EAX,BYTE 01H
	JNE	SHORT	L_21
;
; Line 61:			stream->flags |= 0x0010                   ;
;
	BTS	DWORD [ESI+04H],04H
;
; Line 62:			errno = 14       ;
;
	MOV	DWORD [_errno],0EH
;
; Line 63:			return (-1)             ;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_20
L_21:
;
; Line 65:		if (stream == (_pstreams[0]))
;
	CMP	ESI,DWORD [__pstreams]
	JNE	SHORT	L_23
;
; Line 66:			fflush((_pstreams[1]));
;
	PUSH	DWORD [04H+__pstreams]
	CALL	_fflush
	POP	ECX
L_23:
;
; Line 67:		if (!stream->flags & 0x0080                   ) {
;
	CMP	DWORD [ESI+04H],BYTE 00H
	SETE	AL
	MOVZX	EAX,AL
	AND	EAX,080H
	JE	NEAR	L_25
;
; Line 68:			if (stream->flags & 0x0100                   ) {
;
	MOV	EAX,DWORD [ESI+04H]
	AND	EAX,0100H
	JE	SHORT	L_27
;
; Line 69:				if (fflush(stream))
;
	PUSH	ESI
	CALL	_fflush
	POP	ECX
	TEST	EAX,EAX
	JE	SHORT	L_29
;
; Line 70:					return (-1)             ;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_20
L_29:
;
; Line 71:			}
;
L_27:
;
; Line 72:			stream->flags &= ~0x0100                   ;
;
	BTR	DWORD [ESI+04H],08H
;
; Line 73:			stream->flags |= 0x0080                   ;
;
	BTS	DWORD [ESI+04H],07H
;
; Line 74:			stream->level = 0;
;
	MOV	DWORD [ESI+00H],00H
;
; Line 75:		}
;
L_25:
;
; Line 76:		if (stream->flags & 0x0020                   )
;
	MOV	EAX,DWORD [ESI+04H]
	AND	EAX,BYTE 020H
	JE	SHORT	L_31
;
; Line 77:			return (-1)             ;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_20
L_31:
;
; Line 78:		if (stream->hold) {
;
	CMP	BYTE [ESI+0CH],BYTE 00H
	JE	SHORT	L_33
;
; Line 79:			rv = stream->hold;
;
	MOVZX	EAX,BYTE [ESI+0CH]
	MOV	EBX,EAX
;
; Line 80:			stream->hold = 0;
;
	MOV	BYTE [ESI+0CH],00H
;
; Line 81:			return rv;
;
	MOV	EAX,EBX
	JMP	L_20
L_33:
;
; Line 83:		if (--stream->level <= 0) {
;
	DEC	DWORD [ESI+00H]
	CMP	DWORD [ESI+00H],BYTE 00H
	JG	SHORT	L_35
;
; Line 84:			rv = _readbuf(stream);
;
	PUSH	ESI
	CALL	__readbuf
	POP	ECX
	MOV	EBX,EAX
;
; Line 85:			if (rv)
;
	TEST	EBX,EBX
	JE	SHORT	L_37
;
; Line 86:				return rv;
;
	MOV	EAX,EBX
	JMP	L_20
L_37:
;
; Line 87:		}
;
L_35:
;
; Line 88:		return (unsigned char *)(*stream->curp++);
;
	MOV	EAX,DWORD [ESI+015H]
	INC	DWORD [ESI+015H]
	MOVZX	EAX,BYTE [EAX+00H]
L_20:
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	__fgetc]
;
; Line 91:	{
;
__fgetc:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
;
; Line 92:		stream->level++;
;
	INC	DWORD [ESI+00H]
;
; Line 93:		return fgetc(stream);
;
	PUSH	ESI
	CALL	_fgetc
	POP	ECX
L_39:
	POP	ESI
	POP	EBP
	RET
[GLOBAL	_getc]
;
; Line 98:	{
;
_getc:
	PUSH	EBP
	MOV	EBP,ESP
;
; Line 99:		return getc(stream);
;
	PUSH	DWORD [EBP+08H]
	CALL	_getc
	POP	ECX
L_40:
	POP	EBP
	RET
[GLOBAL	_getchar]
;
; Line 102:	{
;
_getchar:
;
; Line 103:		return getc((_pstreams[0]));
;
	PUSH	DWORD [__pstreams]
	CALL	_getc
	POP	ECX
L_41:
	RET


SECTION _TEXT
[EXTERN	__ll_read]
[EXTERN	_fflush]

SECTION _DATA
[EXTERN	__pstreams]
[EXTERN	__dos_errno]
[EXTERN	_errno]
