	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	_freopen]
;
; Line 12:	{
;
_freopen:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	MOV	EBX,DWORD [EBP+010H]
;
; Line 13:		if (_basefclose(stream,0))
;
	PUSH	BYTE 00H
	PUSH	EBX
	CALL	__basefclose
	ADD	ESP,BYTE 08H
	TEST	EAX,EAX
	JE	SHORT	L_1
;
; Line 14:			return 0;
;
	MOV	EAX,00H
	JMP	L_3
L_1:
;
; Line 15:		if (!_basefopen(name,mode,stream))
;
	PUSH	EBX
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [EBP+08H]
	CALL	__basefopen
	ADD	ESP,BYTE 0CH
	TEST	EAX,EAX
	JNE	SHORT	L_4
;
; Line 16:			return 0;
;
	MOV	EAX,00H
	JMP	L_3
L_4:
;
; Line 17:		return stream;
;
	MOV	EAX,EBX
L_3:
	POP	EBX
	POP	EBP
	RET


SECTION _TEXT
[EXTERN	__basefopen]
[EXTERN	__basefclose]
