	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	_fseek]
;
; Line 7:	{
;
_fseek:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EBX,DWORD [EBP+010H]
;
; Line 8:		if (stream->token != 0x444c)
;
	MOVSX	EAX,WORD [ESI+01DH]
	CMP	EAX,0444CH
	JE	SHORT	L_1
;
; Line 9:			return (-1)             ;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_3
L_1:
;
; Line 10:		if (!(stream->flags & 0x800			 )) {
;
	MOV	EAX,DWORD [ESI+04H]
	AND	EAX,0800H
	JNE	NEAR	L_4
;
; Line 11:			switch (origin) {
;
	CMP	EBX,DWORD 00H
	JE	SHORT	L_9
	CMP	EBX,DWORD 01H
	JE	SHORT	L_8
	CMP	EBX,DWORD 02H
	JE	SHORT	L_10
	JMP	L_6
L_8:
L_9:
L_10:
;
; Line 15:					if (fflush(stream)) {
;
	PUSH	ESI
	CALL	_fflush
	POP	ECX
	TEST	EAX,EAX
	JE	SHORT	L_12
;
; Line 16:						stream->flags |= 0x0010                   ;
;
	BTS	DWORD [ESI+04H],04H
;
; Line 17:						return (-1)             ;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_3
L_12:
;
; Line 19:					if (_ll_seek(stream->fd,offset,origin)) {
;
	PUSH	EBX
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD [ESI+08H]
	CALL	__ll_seek
	ADD	ESP,BYTE 0CH
	TEST	EAX,EAX
	JE	SHORT	L_14
;
; Line 20:						stream->flags |= 0x0010                   ;
;
	BTS	DWORD [ESI+04H],04H
;
; Line 21:						errno = 40       ;
;
	MOV	DWORD [_errno],028H
;
; Line 22:						return (-1)             ;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_3
L_14:
;
; Line 25:					break;
;
	JMP	L_7
L_6:
;
; Line 27:					return (-1)             ;
;
	MOV	EAX,0FFFFFFFFH
	JMP	L_3
L_7:
;
; Line 29:		}
;
L_4:
;
; Line 30:		return 0;
;
	MOV	EAX,00H
L_3:
	POP	ESI
	POP	EBX
	POP	EBP
	RET


SECTION _TEXT
[EXTERN	__ll_seek]
[EXTERN	_fflush]

SECTION _DATA
[EXTERN	_errno]
