	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	_setvbuf]
;
; Line 4:	{
;
_setvbuf:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EBX,DWORD [EBP+010H]
;
; Line 5:		if (stream->token != 0x444c)
;
	MOVSX	EAX,WORD [ESI+01DH]
	CMP	EAX,0444CH
	JE	SHORT	L_1
;
; Line 6:			return 1;
;
	MOV	EAX,01H
	JMP	L_3
L_1:
;
; Line 7:		switch (mode) {
;
	CMP	EBX,DWORD 01H
	JE	SHORT	L_6
	CMP	EBX,DWORD 02H
	JE	SHORT	L_7
	CMP	EBX,DWORD 04H
	JE	SHORT	L_8
	JMP	L_4
L_6:
L_7:
L_8:
;
; Line 11:				break;
;
	JMP	L_5
L_4:
;
; Line 13:				return 1;
;
	MOV	EAX,01H
	JMP	L_3
L_5:
;
; Line 15:		if (fflush(stream))
;
	PUSH	ESI
	CALL	_fflush
	POP	ECX
	TEST	EAX,EAX
	JE	SHORT	L_10
;
; Line 16:			return 1;
;
	MOV	EAX,01H
	JMP	L_3
L_10:
;
; Line 17:		if (stream->flags & 0x0004                   )
;
	MOV	EAX,DWORD [ESI+04H]
	AND	EAX,BYTE 04H
	JE	SHORT	L_12
;
; Line 18:			free(stream->buffer);
;
	PUSH	DWORD [ESI+011H]
	CALL	_free
	POP	ECX
L_12:
;
; Line 19:		stream->flags &= ~(0x0004                    | 0x0008                   );
;
	AND	DWORD [ESI+04H],BYTE 0FFFFFFF3H
;
; Line 20:		stream->buffer = buf;
;
	MOV	EAX,DWORD [EBP+0CH]
	MOV	DWORD [ESI+011H],EAX
;
; Line 21:		stream->bsize = size;
;
	MOV	EAX,DWORD [EBP+014H]
	MOV	DWORD [ESI+0DH],EAX
;
; Line 22:		stream->level = 0;
;
	MOV	DWORD [ESI+00H],00H
;
; Line 23:		switch (mode) {
;
	CMP	EBX,DWORD 01H
	JE	SHORT	L_16
	CMP	EBX,DWORD 02H
	JE	SHORT	L_17
	CMP	EBX,DWORD 04H
	JE	SHORT	L_18
	JMP	L_14
L_16:
;
; Line 25:				break;
;
	JMP	L_15
L_17:
;
; Line 27:				stream->flags |= 0x0008                   ;
;
	BTS	DWORD [ESI+04H],03H
;
; Line 28:				break;
;
	JMP	L_15
L_18:
;
; Line 30:				stream->buffer = 0;
;
	MOV	DWORD [ESI+011H],00H
;
; Line 31:				stream->bsize = 0;
;
	MOV	DWORD [ESI+0DH],00H
;
; Line 32:				break;
;
	JMP	L_15
L_14:
;
; Line 34:				return 1;
;
	MOV	EAX,01H
	JMP	L_3
L_15:
;
; Line 36:		return 0;
;
	MOV	EAX,00H
L_3:
	POP	ESI
	POP	EBX
	POP	EBP
	RET


SECTION _TEXT
[EXTERN	_free]
[EXTERN	_fflush]
