; Listing generated by Microsoft (R) Optimizing Compiler Version 15.00.21022.08 

	TITLE	c:\Develop\DScaler423a\DScaler\avi_file.cpp
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB OLDNAMES

PUBLIC	?fifoDistance@@YAKKKK@Z				; fifoDistance
PUBLIC	??_C@_1BI@NMEBDPPB@?$AAS?$AAe?$AAe?$AAk?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@ ; `string'
PUBLIC	??_C@_1DA@KPLOLPA@?$AAG?$AAe?$AAt?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?5?$AAp?$AAo?$AAi?$AAn?$AAt?$AAe?$AAr?$AA?5?$AAf?$AAa?$AAl?$AAi?$AAe?$AAd?$AA?$AA@ ; `string'
PUBLIC	??_C@_1BI@OFPGBFOH@?$AAR?$AAe?$AAa?$AAd?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@ ; `string'
PUBLIC	??_C@_1HG@MLIBDCGH@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAt?$AAo?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?4?$AA?5?$AAT?$AAh?$AAe@ ; `string'
PUBLIC	??_C@_1CK@PHGDEJPI@?$AAI?$AAn?$AAt?$AAe?$AAr?$AAn?$AAa?$AAl?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@ ; `string'
PUBLIC	??_C@_1DO@KPODBFBA@?$AAR?$AAa?$AAn?$AA?5?$AAo?$AAu?$AAt?$AA?5?$AAo?$AAf?$AA?5?$AAs?$AAu?$AAp?$AAe?$AAr?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?5?$AAe?$AAn?$AAt?$AAr?$AAi?$AAe?$AAs?$AA?$AA@ ; `string'
PUBLIC	??_C@_1DG@FEEGDAEE@?$AAS?$AAe?$AAe?$AAk?$AA?5?$AAt?$AAo?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?5?$AAc?$AAh?$AAu?$AAn?$AAk?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@ ; `string'
PUBLIC	??_C@_1DE@BACJFJHG@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAc?$AAr?$AAe?$AAa?$AAt?$AAe?$AA?5?$AAa?$AAn?$AA?5?$AAe?$AAv?$AAe?$AAn?$AAt?$AA?$AA@ ; `string'
PUBLIC	??_C@_1EI@KICJBJIH@?$AAF?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?5?$AAt?$AAo?$AA?5?$AAc?$AAr?$AAe?$AAa?$AAt?$AAe?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAr@ ; `string'
PUBLIC	??_C@_1JG@NBLJNJKF@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAo?$AAp?$AAe?$AAn?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AAw?$AAr?$AAi?$AAt@ ; `string'
PUBLIC	??_C@_1JE@PEEANHBL@?$AAT?$AAr?$AAi?$AAe?$AAd?$AA?5?$AAt?$AAo?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAa?$AA?5?$AAb?$AAl?$AAo?$AAc?$AAk?$AA?5?$AAo?$AAf?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAt@ ; `string'
EXTRN	__imp__GetLastError@0:PROC
EXTRN	__imp__SetFilePointer@16:PROC
EXTRN	__imp__ReadFile@20:PROC
EXTRN	__imp__WriteFile@20:PROC
EXTRN	__imp__GetCurrentThread@0:PROC
EXTRN	__imp__SetThreadPriority@8:PROC
EXTRN	__imp__GetThreadPriority@4:PROC
EXTRN	__imp__CreateThread@24:PROC
EXTRN	__imp__CreateEventW@16:PROC
EXTRN	__imp__CreateFileW@28:PROC
EXTRN	__imp__ResumeThread@4:PROC
EXTRN	__imp__CloseHandle@4:PROC
EXTRN	__imp__SetEvent@4:PROC
EXTRN	__imp__WaitForSingleObject@8:PROC
;	COMDAT ??_C@_1JE@PEEANHBL@?$AAT?$AAr?$AAi?$AAe?$AAd?$AA?5?$AAt?$AAo?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAa?$AA?5?$AAb?$AAl?$AAo?$AAc?$AAk?$AA?5?$AAo?$AAf?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAt@
CONST	SEGMENT
??_C@_1JE@PEEANHBL@?$AAT?$AAr?$AAi?$AAe?$AAd?$AA?5?$AAt?$AAo?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAa?$AA?5?$AAb?$AAl?$AAo?$AAc?$AAk?$AA?5?$AAo?$AAf?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAt@ DB 'T'
	DB	00H, 'r', 00H, 'i', 00H, 'e', 00H, 'd', 00H, ' ', 00H, 't', 00H
	DB	'o', 00H, ' ', 00H, 'w', 00H, 'r', 00H, 'i', 00H, 't', 00H, 'e'
	DB	00H, ' ', 00H, 'a', 00H, ' ', 00H, 'b', 00H, 'l', 00H, 'o', 00H
	DB	'c', 00H, 'k', 00H, ' ', 00H, 'o', 00H, 'f', 00H, ' ', 00H, 'd'
	DB	00H, 'a', 00H, 't', 00H, 'a', 00H, ' ', 00H, 't', 00H, 'h', 00H
	DB	'a', 00H, 't', 00H, ' ', 00H, 'w', 00H, 'a', 00H, 's', 00H, ' '
	DB	00H, 'l', 00H, 'a', 00H, 'r', 00H, 'g', 00H, 'e', 00H, 'r', 00H
	DB	' ', 00H, 't', 00H, 'h', 00H, 'a', 00H, 'n', 00H, 't', 00H, 'h'
	DB	00H, 'e', 00H, ' ', 00H, 'e', 00H, 'n', 00H, 't', 00H, 'i', 00H
	DB	'r', 00H, 'e', 00H, ' ', 00H, 'F', 00H, 'I', 00H, 'F', 00H, 'O'
	DB	00H, ' ', 00H, 'b', 00H, 'u', 00H, 'f', 00H, 'f', 00H, 'e', 00H
	DB	'r', 00H, 00H, 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_1JG@NBLJNJKF@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAo?$AAp?$AAe?$AAn?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AAw?$AAr?$AAi?$AAt@
CONST	SEGMENT
??_C@_1JG@NBLJNJKF@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAo?$AAp?$AAe?$AAn?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AAw?$AAr?$AAi?$AAt@ DB 'C'
	DB	00H, 'o', 00H, 'u', 00H, 'l', 00H, 'd', 00H, ' ', 00H, 'n', 00H
	DB	'o', 00H, 't', 00H, ' ', 00H, 'o', 00H, 'p', 00H, 'e', 00H, 'n'
	DB	00H, ' ', 00H, 't', 00H, 'h', 00H, 'e', 00H, ' ', 00H, 'f', 00H
	DB	'i', 00H, 'l', 00H, 'e', 00H, ' ', 00H, 'f', 00H, 'o', 00H, 'r'
	DB	00H, ' ', 00H, 'w', 00H, 'r', 00H, 'i', 00H, 't', 00H, 'i', 00H
	DB	'n', 00H, 'g', 00H, '.', 00H, ' ', 00H, 'A', 00H, 'n', 00H, ' '
	DB	00H, 'i', 00H, 'n', 00H, 'v', 00H, 'a', 00H, 'l', 00H, 'i', 00H
	DB	'd', 00H, ' ', 00H, 'p', 00H, 'a', 00H, 't', 00H, 'h', 00H, ' '
	DB	00H, 'm', 00H, 'i', 00H, 'g', 00H, 'h', 00H, 't', 00H, ' ', 00H
	DB	'h', 00H, 'a', 00H, 'v', 00H, 'e', 00H, ' ', 00H, 'b', 00H, 'e'
	DB	00H, 'e', 00H, 'n', 00H, ' ', 00H, 'u', 00H, 's', 00H, 'e', 00H
	DB	'd', 00H, '.', 00H, 00H, 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_1EI@KICJBJIH@?$AAF?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?5?$AAt?$AAo?$AA?5?$AAc?$AAr?$AAe?$AAa?$AAt?$AAe?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAr@
CONST	SEGMENT
??_C@_1EI@KICJBJIH@?$AAF?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?5?$AAt?$AAo?$AA?5?$AAc?$AAr?$AAe?$AAa?$AAt?$AAe?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAr@ DB 'F'
	DB	00H, 'a', 00H, 'i', 00H, 'l', 00H, 'e', 00H, 'd', 00H, ' ', 00H
	DB	't', 00H, 'o', 00H, ' ', 00H, 'c', 00H, 'r', 00H, 'e', 00H, 'a'
	DB	00H, 't', 00H, 'e', 00H, ' ', 00H, 't', 00H, 'h', 00H, 'e', 00H
	DB	' ', 00H, 'w', 00H, 'r', 00H, 'i', 00H, 't', 00H, 'i', 00H, 'n'
	DB	00H, 'g', 00H, ' ', 00H, 't', 00H, 'h', 00H, 'r', 00H, 'e', 00H
	DB	'a', 00H, 'd', 00H, 00H, 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_1DE@BACJFJHG@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAc?$AAr?$AAe?$AAa?$AAt?$AAe?$AA?5?$AAa?$AAn?$AA?5?$AAe?$AAv?$AAe?$AAn?$AAt?$AA?$AA@
CONST	SEGMENT
??_C@_1DE@BACJFJHG@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAc?$AAr?$AAe?$AAa?$AAt?$AAe?$AA?5?$AAa?$AAn?$AA?5?$AAe?$AAv?$AAe?$AAn?$AAt?$AA?$AA@ DB 'C'
	DB	00H, 'o', 00H, 'u', 00H, 'l', 00H, 'd', 00H, ' ', 00H, 'n', 00H
	DB	'o', 00H, 't', 00H, ' ', 00H, 'c', 00H, 'r', 00H, 'e', 00H, 'a'
	DB	00H, 't', 00H, 'e', 00H, ' ', 00H, 'a', 00H, 'n', 00H, ' ', 00H
	DB	'e', 00H, 'v', 00H, 'e', 00H, 'n', 00H, 't', 00H, 00H, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_1DG@FEEGDAEE@?$AAS?$AAe?$AAe?$AAk?$AA?5?$AAt?$AAo?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?5?$AAc?$AAh?$AAu?$AAn?$AAk?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@
CONST	SEGMENT
??_C@_1DG@FEEGDAEE@?$AAS?$AAe?$AAe?$AAk?$AA?5?$AAt?$AAo?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?5?$AAc?$AAh?$AAu?$AAn?$AAk?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@ DB 'S'
	DB	00H, 'e', 00H, 'e', 00H, 'k', 00H, ' ', 00H, 't', 00H, 'o', 00H
	DB	' ', 00H, 'i', 00H, 'n', 00H, 'd', 00H, 'e', 00H, 'x', 00H, ' '
	DB	00H, 'c', 00H, 'h', 00H, 'u', 00H, 'n', 00H, 'k', 00H, ' ', 00H
	DB	'f', 00H, 'a', 00H, 'i', 00H, 'l', 00H, 'e', 00H, 'd', 00H, 00H
	DB	00H						; `string'
CONST	ENDS
;	COMDAT ??_C@_1DO@KPODBFBA@?$AAR?$AAa?$AAn?$AA?5?$AAo?$AAu?$AAt?$AA?5?$AAo?$AAf?$AA?5?$AAs?$AAu?$AAp?$AAe?$AAr?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?5?$AAe?$AAn?$AAt?$AAr?$AAi?$AAe?$AAs?$AA?$AA@
CONST	SEGMENT
??_C@_1DO@KPODBFBA@?$AAR?$AAa?$AAn?$AA?5?$AAo?$AAu?$AAt?$AA?5?$AAo?$AAf?$AA?5?$AAs?$AAu?$AAp?$AAe?$AAr?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?5?$AAe?$AAn?$AAt?$AAr?$AAi?$AAe?$AAs?$AA?$AA@ DB 'R'
	DB	00H, 'a', 00H, 'n', 00H, ' ', 00H, 'o', 00H, 'u', 00H, 't', 00H
	DB	' ', 00H, 'o', 00H, 'f', 00H, ' ', 00H, 's', 00H, 'u', 00H, 'p'
	DB	00H, 'e', 00H, 'r', 00H, ' ', 00H, 'i', 00H, 'n', 00H, 'd', 00H
	DB	'e', 00H, 'x', 00H, ' ', 00H, 'e', 00H, 'n', 00H, 't', 00H, 'r'
	DB	00H, 'i', 00H, 'e', 00H, 's', 00H, 00H, 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_1CK@PHGDEJPI@?$AAI?$AAn?$AAt?$AAe?$AAr?$AAn?$AAa?$AAl?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@
CONST	SEGMENT
??_C@_1CK@PHGDEJPI@?$AAI?$AAn?$AAt?$AAe?$AAr?$AAn?$AAa?$AAl?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@ DB 'I'
	DB	00H, 'n', 00H, 't', 00H, 'e', 00H, 'r', 00H, 'n', 00H, 'a', 00H
	DB	'l', 00H, ' ', 00H, 'w', 00H, 'r', 00H, 'i', 00H, 't', 00H, 'e'
	DB	00H, ' ', 00H, 'e', 00H, 'r', 00H, 'r', 00H, 'o', 00H, 'r', 00H
	DB	00H, 00H					; `string'
CONST	ENDS
;	COMDAT ??_C@_1HG@MLIBDCGH@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAt?$AAo?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?4?$AA?5?$AAT?$AAh?$AAe@
CONST	SEGMENT
??_C@_1HG@MLIBDCGH@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAt?$AAo?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?4?$AA?5?$AAT?$AAh?$AAe@ DB 'C'
	DB	00H, 'o', 00H, 'u', 00H, 'l', 00H, 'd', 00H, ' ', 00H, 'n', 00H
	DB	'o', 00H, 't', 00H, ' ', 00H, 'w', 00H, 'r', 00H, 'i', 00H, 't'
	DB	00H, 'e', 00H, ' ', 00H, 't', 00H, 'o', 00H, ' ', 00H, 't', 00H
	DB	'h', 00H, 'e', 00H, ' ', 00H, 'f', 00H, 'i', 00H, 'l', 00H, 'e'
	DB	00H, '.', 00H, ' ', 00H, 'T', 00H, 'h', 00H, 'e', 00H, ' ', 00H
	DB	'd', 00H, 'i', 00H, 's', 00H, 'k', 00H, ' ', 00H, 'i', 00H, 's'
	DB	00H, ' ', 00H, 'm', 00H, 'o', 00H, 's', 00H, 't', 00H, ' ', 00H
	DB	'l', 00H, 'i', 00H, 'k', 00H, 'e', 00H, 'l', 00H, 'y', 00H, ' '
	DB	00H, 'f', 00H, 'u', 00H, 'l', 00H, 'l', 00H, '.', 00H, 00H, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_1BI@OFPGBFOH@?$AAR?$AAe?$AAa?$AAd?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@
CONST	SEGMENT
??_C@_1BI@OFPGBFOH@?$AAR?$AAe?$AAa?$AAd?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@ DB 'R'
	DB	00H, 'e', 00H, 'a', 00H, 'd', 00H, ' ', 00H, 'f', 00H, 'a', 00H
	DB	'i', 00H, 'l', 00H, 'e', 00H, 'd', 00H, 00H, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_1DA@KPLOLPA@?$AAG?$AAe?$AAt?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?5?$AAp?$AAo?$AAi?$AAn?$AAt?$AAe?$AAr?$AA?5?$AAf?$AAa?$AAl?$AAi?$AAe?$AAd?$AA?$AA@
CONST	SEGMENT
??_C@_1DA@KPLOLPA@?$AAG?$AAe?$AAt?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?5?$AAp?$AAo?$AAi?$AAn?$AAt?$AAe?$AAr?$AA?5?$AAf?$AAa?$AAl?$AAi?$AAe?$AAd?$AA?$AA@ DB 'G'
	DB	00H, 'e', 00H, 't', 00H, ' ', 00H, 'f', 00H, 'i', 00H, 'l', 00H
	DB	'e', 00H, ' ', 00H, 'p', 00H, 'o', 00H, 'i', 00H, 'n', 00H, 't'
	DB	00H, 'e', 00H, 'r', 00H, ' ', 00H, 'f', 00H, 'a', 00H, 'l', 00H
	DB	'i', 00H, 'e', 00H, 'd', 00H, 00H, 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_1BI@NMEBDPPB@?$AAS?$AAe?$AAe?$AAk?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@
CONST	SEGMENT
??_C@_1BI@NMEBDPPB@?$AAS?$AAe?$AAe?$AAk?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@ DB 'S'
	DB	00H, 'e', 00H, 'e', 00H, 'k', 00H, ' ', 00H, 'f', 00H, 'a', 00H
	DB	'i', 00H, 'l', 00H, 'e', 00H, 'd', 00H, 00H, 00H ; `string'
PUBLIC	?fileIsOpen@@YAHPAUAVI_FILE@@@Z			; fileIsOpen
; Function compile flags: /Odtp
; File c:\develop\dscaler423a\dscaler\avi_file.cpp
;	COMDAT ?fileIsOpen@@YAHPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?fileIsOpen@@YAHPAUAVI_FILE@@@Z PROC			; fileIsOpen, COMDAT

; 1049 : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 1050 :     if (!file || file->async.f==INVALID_HANDLE_VALUE)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0c		 je	 SHORT $LN1@fileIsOpen
  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	83 b8 30 01 00
	00 ff		 cmp	 DWORD PTR [eax+304], -1
  00013	75 04		 jne	 SHORT $LN2@fileIsOpen
$LN1@fileIsOpen:

; 1051 :        return FALSE;

  00015	33 c0		 xor	 eax, eax
  00017	eb 05		 jmp	 SHORT $LN3@fileIsOpen
$LN2@fileIsOpen:

; 1052 : 
; 1053 :     return TRUE;

  00019	b8 01 00 00 00	 mov	 eax, 1
$LN3@fileIsOpen:

; 1054 : }

  0001e	5d		 pop	 ebp
  0001f	c3		 ret	 0
?fileIsOpen@@YAHPAUAVI_FILE@@@Z ENDP			; fileIsOpen
_TEXT	ENDS
PUBLIC	?fileTell@@YA_JPAUAVI_FILE@@@Z			; fileTell
; Function compile flags: /Odtp
;	COMDAT ?fileTell@@YA_JPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?fileTell@@YA_JPAUAVI_FILE@@@Z PROC			; fileTell, COMDAT

; 951  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 952  :     if (!file || file->async.f==INVALID_HANDLE_VALUE)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0c		 je	 SHORT $LN1@fileTell
  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	83 b8 30 01 00
	00 ff		 cmp	 DWORD PTR [eax+304], -1
  00013	75 06		 jne	 SHORT $LN2@fileTell
$LN1@fileTell:

; 953  :        return 0;

  00015	33 c0		 xor	 eax, eax
  00017	33 d2		 xor	 edx, edx
  00019	eb 0f		 jmp	 SHORT $LN3@fileTell
$LN2@fileTell:

; 954  : 
; 955  :     return file->async.filePos;

  0001b	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0001e	8b 81 40 01 00
	00		 mov	 eax, DWORD PTR [ecx+320]
  00024	8b 91 44 01 00
	00		 mov	 edx, DWORD PTR [ecx+324]
$LN3@fileTell:

; 956  : }

  0002a	5d		 pop	 ebp
  0002b	c3		 ret	 0
?fileTell@@YA_JPAUAVI_FILE@@@Z ENDP			; fileTell
_TEXT	ENDS
PUBLIC	?fileSeek@@YAHPAUAVI_FILE@@_J@Z			; fileSeek
; Function compile flags: /Odtp
;	COMDAT ?fileSeek@@YAHPAUAVI_FILE@@_J@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
_offset$ = 12						; size = 8
?fileSeek@@YAHPAUAVI_FILE@@_J@Z PROC			; fileSeek, COMDAT

; 934  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 935  :     if (!file || file->async.f==INVALID_HANDLE_VALUE)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0c		 je	 SHORT $LN1@fileSeek
  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	83 b8 30 01 00
	00 ff		 cmp	 DWORD PTR [eax+304], -1
  00013	75 04		 jne	 SHORT $LN2@fileSeek
$LN1@fileSeek:

; 936  :        return FALSE;

  00015	33 c0		 xor	 eax, eax
  00017	eb 1a		 jmp	 SHORT $LN3@fileSeek
$LN2@fileSeek:

; 937  : 
; 938  :     file->async.filePos = offset;

  00019	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0001c	8b 55 0c	 mov	 edx, DWORD PTR _offset$[ebp]
  0001f	89 91 40 01 00
	00		 mov	 DWORD PTR [ecx+320], edx
  00025	8b 45 10	 mov	 eax, DWORD PTR _offset$[ebp+4]
  00028	89 81 44 01 00
	00		 mov	 DWORD PTR [ecx+324], eax

; 939  : 
; 940  :     return TRUE;

  0002e	b8 01 00 00 00	 mov	 eax, 1
$LN3@fileSeek:

; 941  : }

  00033	5d		 pop	 ebp
  00034	c3		 ret	 0
?fileSeek@@YAHPAUAVI_FILE@@_J@Z ENDP			; fileSeek
_TEXT	ENDS
PUBLIC	?fifoTotalSpace@@YAKPAUFIFO@@@Z			; fifoTotalSpace
; Function compile flags: /Odtp
;	COMDAT ?fifoTotalSpace@@YAKPAUFIFO@@@Z
_TEXT	SEGMENT
_fifo$ = 8						; size = 4
?fifoTotalSpace@@YAKPAUFIFO@@@Z PROC			; fifoTotalSpace, COMDAT

; 268  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 269  :     if (!fifo)

  00003	83 7d 08 00	 cmp	 DWORD PTR _fifo$[ebp], 0
  00007	75 04		 jne	 SHORT $LN1@fifoTotalS

; 270  :        return 0;

  00009	33 c0		 xor	 eax, eax
  0000b	eb 09		 jmp	 SHORT $LN2@fifoTotalS
$LN1@fifoTotalS:

; 271  : 
; 272  :     return fifo->size - 1;

  0000d	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  00010	8b 40 38	 mov	 eax, DWORD PTR [eax+56]
  00013	83 e8 01	 sub	 eax, 1
$LN2@fifoTotalS:

; 273  : }

  00016	5d		 pop	 ebp
  00017	c3		 ret	 0
?fifoTotalSpace@@YAKPAUFIFO@@@Z ENDP			; fifoTotalSpace
_TEXT	ENDS
PUBLIC	?fifoDestroy@@YAXPAUFIFO@@@Z			; fifoDestroy
; Function compile flags: /Odtp
;	COMDAT ?fifoDestroy@@YAXPAUFIFO@@@Z
_TEXT	SEGMENT
_fifo$ = 8						; size = 4
?fifoDestroy@@YAXPAUFIFO@@@Z PROC			; fifoDestroy, COMDAT

; 220  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 221  :     if (fifo)

  00003	83 7d 08 00	 cmp	 DWORD PTR _fifo$[ebp], 0
  00007	74 45		 je	 SHORT $LN3@fifoDestro

; 222  :     {
; 223  :         if (fifo->data)

  00009	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  0000c	83 78 3c 00	 cmp	 DWORD PTR [eax+60], 0
  00010	74 30		 je	 SHORT $LN1@fifoDestro

; 224  :         {
; 225  :             free(fifo->data);

  00012	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  00015	8b 51 3c	 mov	 edx, DWORD PTR [ecx+60]
  00018	52		 push	 edx
  00019	e8 00 00 00 00	 call	 _free
  0001e	83 c4 04	 add	 esp, 4

; 226  :             fifo->data = NULL;

  00021	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  00024	c7 40 3c 00 00
	00 00		 mov	 DWORD PTR [eax+60], 0

; 227  : 
; 228  :             DeleteCriticalSection(&fifo->mutex.read);

  0002b	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  0002e	51		 push	 ecx
  0002f	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__DeleteCriticalSection@4

; 229  :             DeleteCriticalSection(&fifo->mutex.write);

  00035	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  00038	83 c2 18	 add	 edx, 24			; 00000018H
  0003b	52		 push	 edx
  0003c	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__DeleteCriticalSection@4
$LN1@fifoDestro:

; 230  :         }
; 231  : 
; 232  :         free(fifo);

  00042	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  00045	50		 push	 eax
  00046	e8 00 00 00 00	 call	 _free
  0004b	83 c4 04	 add	 esp, 4
$LN3@fifoDestro:

; 233  :     }
; 234  : }

  0004e	5d		 pop	 ebp
  0004f	c3		 ret	 0
?fifoDestroy@@YAXPAUFIFO@@@Z ENDP			; fifoDestroy
_TEXT	ENDS
PUBLIC	?fifoCreate@@YAPAUFIFO@@K@Z			; fifoCreate
; Function compile flags: /Odtp
;	COMDAT ?fifoCreate@@YAPAUFIFO@@K@Z
_TEXT	SEGMENT
_fifo$ = -4						; size = 4
_size$ = 8						; size = 4
?fifoCreate@@YAPAUFIFO@@K@Z PROC			; fifoCreate, COMDAT

; 188  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx

; 189  :     FIFO *fifo = NULL;

  00004	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _fifo$[ebp], 0

; 190  : 
; 191  :     fifo = (FIFO *)malloc(sizeof(FIFO));

  0000b	6a 40		 push	 64			; 00000040H
  0000d	e8 00 00 00 00	 call	 _malloc
  00012	83 c4 04	 add	 esp, 4
  00015	89 45 fc	 mov	 DWORD PTR _fifo$[ebp], eax

; 192  :     if (fifo)

  00018	83 7d fc 00	 cmp	 DWORD PTR _fifo$[ebp], 0
  0001c	74 69		 je	 SHORT $LN3@fifoCreate

; 193  :     {
; 194  :         memset(fifo, 0, sizeof(FIFO));

  0001e	6a 40		 push	 64			; 00000040H
  00020	6a 00		 push	 0
  00022	8b 45 fc	 mov	 eax, DWORD PTR _fifo$[ebp]
  00025	50		 push	 eax
  00026	e8 00 00 00 00	 call	 _memset
  0002b	83 c4 0c	 add	 esp, 12			; 0000000cH

; 195  : 
; 196  :         /* One byte is lost to the empty buffer condition start==end */
; 197  :         size++;

  0002e	8b 4d 08	 mov	 ecx, DWORD PTR _size$[ebp]
  00031	83 c1 01	 add	 ecx, 1
  00034	89 4d 08	 mov	 DWORD PTR _size$[ebp], ecx

; 198  : 
; 199  :         fifo->size = size;

  00037	8b 55 fc	 mov	 edx, DWORD PTR _fifo$[ebp]
  0003a	8b 45 08	 mov	 eax, DWORD PTR _size$[ebp]
  0003d	89 42 38	 mov	 DWORD PTR [edx+56], eax

; 200  :         fifo->data = (BYTE *)malloc(size);

  00040	8b 4d 08	 mov	 ecx, DWORD PTR _size$[ebp]
  00043	51		 push	 ecx
  00044	e8 00 00 00 00	 call	 _malloc
  00049	83 c4 04	 add	 esp, 4
  0004c	8b 55 fc	 mov	 edx, DWORD PTR _fifo$[ebp]
  0004f	89 42 3c	 mov	 DWORD PTR [edx+60], eax

; 201  :         if (fifo->data)

  00052	8b 45 fc	 mov	 eax, DWORD PTR _fifo$[ebp]
  00055	83 78 3c 00	 cmp	 DWORD PTR [eax+60], 0
  00059	74 19		 je	 SHORT $LN2@fifoCreate

; 202  :         {
; 203  :             InitializeCriticalSection(&fifo->mutex.read);

  0005b	8b 4d fc	 mov	 ecx, DWORD PTR _fifo$[ebp]
  0005e	51		 push	 ecx
  0005f	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__InitializeCriticalSection@4

; 204  :             InitializeCriticalSection(&fifo->mutex.write);

  00065	8b 55 fc	 mov	 edx, DWORD PTR _fifo$[ebp]
  00068	83 c2 18	 add	 edx, 24			; 00000018H
  0006b	52		 push	 edx
  0006c	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__InitializeCriticalSection@4

; 205  :         } else

  00072	eb 13		 jmp	 SHORT $LN3@fifoCreate
$LN2@fifoCreate:

; 206  :         {
; 207  :             free(fifo);

  00074	8b 45 fc	 mov	 eax, DWORD PTR _fifo$[ebp]
  00077	50		 push	 eax
  00078	e8 00 00 00 00	 call	 _free
  0007d	83 c4 04	 add	 esp, 4

; 208  :             fifo = NULL;

  00080	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _fifo$[ebp], 0
$LN3@fifoCreate:

; 209  :         }
; 210  :     }
; 211  : 
; 212  :     return fifo;

  00087	8b 45 fc	 mov	 eax, DWORD PTR _fifo$[ebp]

; 213  : }

  0008a	8b e5		 mov	 esp, ebp
  0008c	5d		 pop	 ebp
  0008d	c3		 ret	 0
?fifoCreate@@YAPAUFIFO@@K@Z ENDP			; fifoCreate
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ?fifoDistance@@YAKKKK@Z
_TEXT	SEGMENT
_start$ = 8						; size = 4
_end$ = 12						; size = 4
_size$ = 16						; size = 4
?fifoDistance@@YAKKKK@Z PROC				; fifoDistance, COMDAT

; 140  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 141  :     if (end < start)

  00003	8b 45 0c	 mov	 eax, DWORD PTR _end$[ebp]
  00006	3b 45 08	 cmp	 eax, DWORD PTR _start$[ebp]
  00009	73 09		 jae	 SHORT $LN1@fifoDistan

; 142  :        end += size;

  0000b	8b 4d 0c	 mov	 ecx, DWORD PTR _end$[ebp]
  0000e	03 4d 10	 add	 ecx, DWORD PTR _size$[ebp]
  00011	89 4d 0c	 mov	 DWORD PTR _end$[ebp], ecx
$LN1@fifoDistan:

; 143  : 
; 144  :     return end - start;

  00014	8b 45 0c	 mov	 eax, DWORD PTR _end$[ebp]
  00017	2b 45 08	 sub	 eax, DWORD PTR _start$[ebp]

; 145  : }

  0001a	5d		 pop	 ebp
  0001b	c3		 ret	 0
?fifoDistance@@YAKKKK@Z ENDP				; fifoDistance
PUBLIC	?fifoReadableSpace@@YAKPAUFIFO@@@Z		; fifoReadableSpace
; Function compile flags: /Odtp
;	COMDAT ?fifoReadableSpace@@YAKPAUFIFO@@@Z
_TEXT	SEGMENT
_fifo$ = 8						; size = 4
?fifoReadableSpace@@YAKPAUFIFO@@@Z PROC			; fifoReadableSpace, COMDAT

; 242  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 243  :     if (!fifo)

  00003	83 7d 08 00	 cmp	 DWORD PTR _fifo$[ebp], 0
  00007	75 04		 jne	 SHORT $LN1@fifoReadab

; 244  :        return 0;

  00009	33 c0		 xor	 eax, eax
  0000b	eb 1d		 jmp	 SHORT $LN2@fifoReadab
$LN1@fifoReadab:

; 245  : 
; 246  :     return fifoDistance(fifo->start, fifo->end, fifo->size);

  0000d	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  00010	8b 48 38	 mov	 ecx, DWORD PTR [eax+56]
  00013	51		 push	 ecx
  00014	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  00017	8b 42 34	 mov	 eax, DWORD PTR [edx+52]
  0001a	50		 push	 eax
  0001b	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  0001e	8b 51 30	 mov	 edx, DWORD PTR [ecx+48]
  00021	52		 push	 edx
  00022	e8 00 00 00 00	 call	 ?fifoDistance@@YAKKKK@Z	; fifoDistance
  00027	83 c4 0c	 add	 esp, 12			; 0000000cH
$LN2@fifoReadab:

; 247  : }

  0002a	5d		 pop	 ebp
  0002b	c3		 ret	 0
?fifoReadableSpace@@YAKPAUFIFO@@@Z ENDP			; fifoReadableSpace
_TEXT	ENDS
PUBLIC	?fifoAdjustWriteSize@@YAXPAUFIFO@@PAK1@Z	; fifoAdjustWriteSize
; Function compile flags: /Odtp
;	COMDAT ?fifoAdjustWriteSize@@YAXPAUFIFO@@PAK1@Z
_TEXT	SEGMENT
_freeSpace$ = -4					; size = 4
_fifo$ = 8						; size = 4
_end$ = 12						; size = 4
_size$ = 16						; size = 4
?fifoAdjustWriteSize@@YAXPAUFIFO@@PAK1@Z PROC		; fifoAdjustWriteSize, COMDAT

; 165  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx
  00004	56		 push	 esi

; 166  :     DWORD freeSpace;
; 167  : 
; 168  :     /* Get the FIFO buffer's end offset and only use that value for end for the
; 169  :      * rest of the calculations
; 170  :      */
; 171  :     *end = fifo->end;

  00005	8b 45 0c	 mov	 eax, DWORD PTR _end$[ebp]
  00008	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  0000b	8b 51 34	 mov	 edx, DWORD PTR [ecx+52]
  0000e	89 10		 mov	 DWORD PTR [eax], edx

; 172  : 
; 173  :     freeSpace = (fifo->size - 1) -
; 174  :                 fifoDistance(fifo->start, *end, fifo->size);

  00010	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  00013	8b 70 38	 mov	 esi, DWORD PTR [eax+56]
  00016	83 ee 01	 sub	 esi, 1
  00019	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  0001c	8b 51 38	 mov	 edx, DWORD PTR [ecx+56]
  0001f	52		 push	 edx
  00020	8b 45 0c	 mov	 eax, DWORD PTR _end$[ebp]
  00023	8b 08		 mov	 ecx, DWORD PTR [eax]
  00025	51		 push	 ecx
  00026	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  00029	8b 42 30	 mov	 eax, DWORD PTR [edx+48]
  0002c	50		 push	 eax
  0002d	e8 00 00 00 00	 call	 ?fifoDistance@@YAKKKK@Z	; fifoDistance
  00032	83 c4 0c	 add	 esp, 12			; 0000000cH
  00035	2b f0		 sub	 esi, eax
  00037	89 75 fc	 mov	 DWORD PTR _freeSpace$[ebp], esi

; 175  :     if (*size > freeSpace)

  0003a	8b 4d 10	 mov	 ecx, DWORD PTR _size$[ebp]
  0003d	8b 11		 mov	 edx, DWORD PTR [ecx]
  0003f	3b 55 fc	 cmp	 edx, DWORD PTR _freeSpace$[ebp]
  00042	76 09		 jbe	 SHORT $LN2@fifoAdjust

; 176  :     {
; 177  :         /* Strict mode. Non-strict mode would set size to freeSpace. */
; 178  :         *size = 0;

  00044	8b 45 10	 mov	 eax, DWORD PTR _size$[ebp]
  00047	c7 00 00 00 00
	00		 mov	 DWORD PTR [eax], 0
$LN2@fifoAdjust:

; 179  :     }
; 180  : }

  0004d	5e		 pop	 esi
  0004e	8b e5		 mov	 esp, ebp
  00050	5d		 pop	 ebp
  00051	c3		 ret	 0
?fifoAdjustWriteSize@@YAXPAUFIFO@@PAK1@Z ENDP		; fifoAdjustWriteSize
_TEXT	ENDS
PUBLIC	?fifoAdjustReadSize@@YAXPAUFIFO@@PAK1@Z		; fifoAdjustReadSize
; Function compile flags: /Odtp
;	COMDAT ?fifoAdjustReadSize@@YAXPAUFIFO@@PAK1@Z
_TEXT	SEGMENT
_usedSpace$ = -4					; size = 4
_fifo$ = 8						; size = 4
_start$ = 12						; size = 4
_size$ = 16						; size = 4
?fifoAdjustReadSize@@YAXPAUFIFO@@PAK1@Z PROC		; fifoAdjustReadSize, COMDAT

; 148  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx

; 149  :     DWORD usedSpace;
; 150  : 
; 151  :     /* Get the FIFO buffer's start offset and only use that value of start for
; 152  :      * the rest of the calculations
; 153  :      */
; 154  :     *start = fifo->start;

  00004	8b 45 0c	 mov	 eax, DWORD PTR _start$[ebp]
  00007	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  0000a	8b 51 30	 mov	 edx, DWORD PTR [ecx+48]
  0000d	89 10		 mov	 DWORD PTR [eax], edx

; 155  : 
; 156  :     usedSpace = fifoDistance(*start, fifo->end, fifo->size);

  0000f	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  00012	8b 48 38	 mov	 ecx, DWORD PTR [eax+56]
  00015	51		 push	 ecx
  00016	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  00019	8b 42 34	 mov	 eax, DWORD PTR [edx+52]
  0001c	50		 push	 eax
  0001d	8b 4d 0c	 mov	 ecx, DWORD PTR _start$[ebp]
  00020	8b 11		 mov	 edx, DWORD PTR [ecx]
  00022	52		 push	 edx
  00023	e8 00 00 00 00	 call	 ?fifoDistance@@YAKKKK@Z	; fifoDistance
  00028	83 c4 0c	 add	 esp, 12			; 0000000cH
  0002b	89 45 fc	 mov	 DWORD PTR _usedSpace$[ebp], eax

; 157  :     if (*size > usedSpace)

  0002e	8b 45 10	 mov	 eax, DWORD PTR _size$[ebp]
  00031	8b 08		 mov	 ecx, DWORD PTR [eax]
  00033	3b 4d fc	 cmp	 ecx, DWORD PTR _usedSpace$[ebp]
  00036	76 09		 jbe	 SHORT $LN2@fifoAdjust@2

; 158  :     {
; 159  :         /* Strict mode. Non-strict mode would set size to usedSpace. */
; 160  :         *size = 0;

  00038	8b 55 10	 mov	 edx, DWORD PTR _size$[ebp]
  0003b	c7 02 00 00 00
	00		 mov	 DWORD PTR [edx], 0
$LN2@fifoAdjust@2:

; 161  :     }
; 162  : }

  00041	8b e5		 mov	 esp, ebp
  00043	5d		 pop	 ebp
  00044	c3		 ret	 0
?fifoAdjustReadSize@@YAXPAUFIFO@@PAK1@Z ENDP		; fifoAdjustReadSize
_TEXT	ENDS
PUBLIC	?__write@@YAHPAUAVI_FILE@@PAXK@Z		; __write
; Function compile flags: /Odtp
;	COMDAT ?__write@@YAHPAUAVI_FILE@@PAXK@Z
_TEXT	SEGMENT
_written$ = -4						; size = 4
_file$ = 8						; size = 4
_data$ = 12						; size = 4
_size$ = 16						; size = 4
?__write@@YAHPAUAVI_FILE@@PAXK@Z PROC			; __write, COMDAT

; 120  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx

; 121  :     DWORD written;
; 122  : 
; 123  :     if (!WriteFile(file->async.f, data, size, &written, NULL))

  00004	6a 00		 push	 0
  00006	8d 45 fc	 lea	 eax, DWORD PTR _written$[ebp]
  00009	50		 push	 eax
  0000a	8b 4d 10	 mov	 ecx, DWORD PTR _size$[ebp]
  0000d	51		 push	 ecx
  0000e	8b 55 0c	 mov	 edx, DWORD PTR _data$[ebp]
  00011	52		 push	 edx
  00012	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00015	8b 88 30 01 00
	00		 mov	 ecx, DWORD PTR [eax+304]
  0001b	51		 push	 ecx
  0001c	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__WriteFile@20
  00022	85 c0		 test	 eax, eax
  00024	75 17		 jne	 SHORT $LN1@write

; 124  :     {
; 125  :         aviSetError(file, AVI_ERROR_FILE, _T("Could not write to the file. ")
; 126  :                                           _T("The disk is most likely full."));

  00026	68 00 00 00 00	 push	 OFFSET ??_C@_1HG@MLIBDCGH@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAt?$AAo?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?4?$AA?5?$AAT?$AAh?$AAe@
  0002b	6a 04		 push	 4
  0002d	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00030	52		 push	 edx
  00031	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  00036	83 c4 0c	 add	 esp, 12			; 0000000cH

; 127  :         return FALSE;

  00039	33 c0		 xor	 eax, eax
  0003b	eb 05		 jmp	 SHORT $LN2@write
$LN1@write:

; 128  :     }
; 129  : 
; 130  :     return TRUE;

  0003d	b8 01 00 00 00	 mov	 eax, 1
$LN2@write:

; 131  : }

  00042	8b e5		 mov	 esp, ebp
  00044	5d		 pop	 ebp
  00045	c3		 ret	 0
?__write@@YAHPAUAVI_FILE@@PAXK@Z ENDP			; __write
_TEXT	ENDS
PUBLIC	?__read@@YAHPAUAVI_FILE@@PAXK@Z			; __read
; Function compile flags: /Odtp
;	COMDAT ?__read@@YAHPAUAVI_FILE@@PAXK@Z
_TEXT	SEGMENT
_read$ = -4						; size = 4
_file$ = 8						; size = 4
_data$ = 12						; size = 4
_size$ = 16						; size = 4
?__read@@YAHPAUAVI_FILE@@PAXK@Z PROC			; __read, COMDAT

; 99   : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx

; 100  :     DWORD read;
; 101  : 
; 102  :     if (!ReadFile(file->async.f, data, size, &read, NULL))

  00004	6a 00		 push	 0
  00006	8d 45 fc	 lea	 eax, DWORD PTR _read$[ebp]
  00009	50		 push	 eax
  0000a	8b 4d 10	 mov	 ecx, DWORD PTR _size$[ebp]
  0000d	51		 push	 ecx
  0000e	8b 55 0c	 mov	 edx, DWORD PTR _data$[ebp]
  00011	52		 push	 edx
  00012	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00015	8b 88 30 01 00
	00		 mov	 ecx, DWORD PTR [eax+304]
  0001b	51		 push	 ecx
  0001c	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__ReadFile@20
  00022	85 c0		 test	 eax, eax
  00024	75 17		 jne	 SHORT $LN1@read

; 103  :     {
; 104  :         aviSetError(file, AVI_ERROR_FILE, _T("Read failed"));

  00026	68 00 00 00 00	 push	 OFFSET ??_C@_1BI@OFPGBFOH@?$AAR?$AAe?$AAa?$AAd?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@
  0002b	6a 04		 push	 4
  0002d	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00030	52		 push	 edx
  00031	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  00036	83 c4 0c	 add	 esp, 12			; 0000000cH

; 105  :         return FALSE;

  00039	33 c0		 xor	 eax, eax
  0003b	eb 05		 jmp	 SHORT $LN2@read
$LN1@read:

; 106  :     }
; 107  : 
; 108  :     return TRUE;

  0003d	b8 01 00 00 00	 mov	 eax, 1
$LN2@read:

; 109  : }

  00042	8b e5		 mov	 esp, ebp
  00044	5d		 pop	 ebp
  00045	c3		 ret	 0
?__read@@YAHPAUAVI_FILE@@PAXK@Z ENDP			; __read
_TEXT	ENDS
PUBLIC	?__tell@@YAHPAUAVI_FILE@@PA_J@Z			; __tell
; Function compile flags: /Odtp
;	COMDAT ?__tell@@YAHPAUAVI_FILE@@PA_J@Z
_TEXT	SEGMENT
_result$ = -8						; size = 8
_file$ = 8						; size = 4
_offset$ = 12						; size = 4
?__tell@@YAHPAUAVI_FILE@@PA_J@Z PROC			; __tell, COMDAT

; 71   : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 08	 sub	 esp, 8

; 72   :     LARGE_INTEGER result;
; 73   : 
; 74   :     result.QuadPart = 0;

  00006	c7 45 f8 00 00
	00 00		 mov	 DWORD PTR _result$[ebp], 0
  0000d	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _result$[ebp+4], 0

; 75   :     if ((result.LowPart = SetFilePointer(file->async.f,
; 76   :                                          result.LowPart,
; 77   :                                          &result.HighPart,
; 78   :                                          FILE_CURRENT))==INVALID_SET_FILE_POINTER &&
; 79   :         GetLastError() != NO_ERROR)

  00014	6a 01		 push	 1
  00016	8d 45 fc	 lea	 eax, DWORD PTR _result$[ebp+4]
  00019	50		 push	 eax
  0001a	8b 4d f8	 mov	 ecx, DWORD PTR _result$[ebp]
  0001d	51		 push	 ecx
  0001e	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00021	8b 82 30 01 00
	00		 mov	 eax, DWORD PTR [edx+304]
  00027	50		 push	 eax
  00028	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__SetFilePointer@16
  0002e	89 45 f8	 mov	 DWORD PTR _result$[ebp], eax
  00031	83 7d f8 ff	 cmp	 DWORD PTR _result$[ebp], -1
  00035	75 21		 jne	 SHORT $LN1@tell
  00037	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__GetLastError@0
  0003d	85 c0		 test	 eax, eax
  0003f	74 17		 je	 SHORT $LN1@tell

; 80   :     {
; 81   :         aviSetError(file, AVI_ERROR_FILE, _T("Get file pointer falied"));

  00041	68 00 00 00 00	 push	 OFFSET ??_C@_1DA@KPLOLPA@?$AAG?$AAe?$AAt?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?5?$AAp?$AAo?$AAi?$AAn?$AAt?$AAe?$AAr?$AA?5?$AAf?$AAa?$AAl?$AAi?$AAe?$AAd?$AA?$AA@
  00046	6a 04		 push	 4
  00048	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0004b	51		 push	 ecx
  0004c	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  00051	83 c4 0c	 add	 esp, 12			; 0000000cH

; 82   :         return FALSE;

  00054	33 c0		 xor	 eax, eax
  00056	eb 13		 jmp	 SHORT $LN2@tell
$LN1@tell:

; 83   :     }
; 84   : 
; 85   :     *offset = result.QuadPart;

  00058	8b 55 0c	 mov	 edx, DWORD PTR _offset$[ebp]
  0005b	8b 45 f8	 mov	 eax, DWORD PTR _result$[ebp]
  0005e	89 02		 mov	 DWORD PTR [edx], eax
  00060	8b 4d fc	 mov	 ecx, DWORD PTR _result$[ebp+4]
  00063	89 4a 04	 mov	 DWORD PTR [edx+4], ecx

; 86   : 
; 87   :     return TRUE;

  00066	b8 01 00 00 00	 mov	 eax, 1
$LN2@tell:

; 88   : }

  0006b	8b e5		 mov	 esp, ebp
  0006d	5d		 pop	 ebp
  0006e	c3		 ret	 0
?__tell@@YAHPAUAVI_FILE@@PA_J@Z ENDP			; __tell
_TEXT	ENDS
PUBLIC	?__seek@@YAHPAUAVI_FILE@@_J@Z			; __seek
; Function compile flags: /Odtp
;	COMDAT ?__seek@@YAHPAUAVI_FILE@@_J@Z
_TEXT	SEGMENT
_dest$ = -8						; size = 8
_file$ = 8						; size = 4
_offset$ = 12						; size = 8
?__seek@@YAHPAUAVI_FILE@@_J@Z PROC			; __seek, COMDAT

; 48   : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 08	 sub	 esp, 8

; 49   :     LARGE_INTEGER dest;
; 50   : 
; 51   :     dest.QuadPart = offset;

  00006	8b 45 0c	 mov	 eax, DWORD PTR _offset$[ebp]
  00009	89 45 f8	 mov	 DWORD PTR _dest$[ebp], eax
  0000c	8b 4d 10	 mov	 ecx, DWORD PTR _offset$[ebp+4]
  0000f	89 4d fc	 mov	 DWORD PTR _dest$[ebp+4], ecx

; 52   :     if (SetFilePointer(file->async.f, dest.LowPart, &dest.HighPart,
; 53   :                        FILE_BEGIN)==INVALID_SET_FILE_POINTER &&
; 54   :         GetLastError() != NO_ERROR)

  00012	6a 00		 push	 0
  00014	8d 55 fc	 lea	 edx, DWORD PTR _dest$[ebp+4]
  00017	52		 push	 edx
  00018	8b 45 f8	 mov	 eax, DWORD PTR _dest$[ebp]
  0001b	50		 push	 eax
  0001c	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0001f	8b 91 30 01 00
	00		 mov	 edx, DWORD PTR [ecx+304]
  00025	52		 push	 edx
  00026	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__SetFilePointer@16
  0002c	83 f8 ff	 cmp	 eax, -1
  0002f	75 21		 jne	 SHORT $LN1@seek
  00031	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__GetLastError@0
  00037	85 c0		 test	 eax, eax
  00039	74 17		 je	 SHORT $LN1@seek

; 55   :     {
; 56   :         aviSetError(file, AVI_ERROR_FILE, _T("Seek failed"));

  0003b	68 00 00 00 00	 push	 OFFSET ??_C@_1BI@NMEBDPPB@?$AAS?$AAe?$AAe?$AAk?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@
  00040	6a 04		 push	 4
  00042	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00045	50		 push	 eax
  00046	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  0004b	83 c4 0c	 add	 esp, 12			; 0000000cH

; 57   :         return FALSE;

  0004e	33 c0		 xor	 eax, eax
  00050	eb 05		 jmp	 SHORT $LN2@seek
$LN1@seek:

; 58   :     }
; 59   : 
; 60   :     return TRUE;

  00052	b8 01 00 00 00	 mov	 eax, 1
$LN2@seek:

; 61   : }

  00057	8b e5		 mov	 esp, ebp
  00059	5d		 pop	 ebp
  0005a	c3		 ret	 0
?__seek@@YAHPAUAVI_FILE@@_J@Z ENDP			; __seek
PUBLIC	?fileBuildStreamIndex@@YAHPAUAVI_FILE@@W4stream_t@@@Z ; fileBuildStreamIndex
; Function compile flags: /Odtp
;	COMDAT ?fileBuildStreamIndex@@YAHPAUAVI_FILE@@W4stream_t@@@Z
_TEXT	SEGMENT
_entry$ = -3216						; size = 2052
_legacy$ = -1156					; size = 4
_legacyOffset$ = -1152					; size = 8
_legacyCounter$ = -1140					; size = 4
_superIndex$ = -1136					; size = 64
_stdIndex$ = -1072					; size = 1072
_file$ = 8						; size = 4
_type$ = 12						; size = 4
?fileBuildStreamIndex@@YAHPAUAVI_FILE@@W4stream_t@@@Z PROC ; fileBuildStreamIndex, COMDAT

; 462  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	81 ec 90 0c 00
	00		 sub	 esp, 3216		; 00000c90H

; 463  :     struct
; 464  :     {
; 465  :         BOOL  load;   /**< Set this to TRUE to get the next super index entry */
; 466  :         int64 offset; /**< Offset to the current position in the AVISUPERINDEX_ENTRY data */
; 467  :         DWORD next;   /**< The index of the next super index entry to read */
; 468  : 
; 469  :         AVISUPERINDEX       header;
; 470  :         AVISUPERINDEX_ENTRY entry; /**< Data for the current super index entry */
; 471  :     } superIndex;
; 472  : 
; 473  :     struct
; 474  :     {
; 475  :         int64 offset;    /**< Offset to the current position in the AVISTDINDEX_ENTRY data */
; 476  :         DWORD read;      /**< The number of entries that have been read into the array */
; 477  :         DWORD current;   /**< The current entry that's being processed */
; 478  :         DWORD remaining; /**< The number of entries that haven't been read from the file */
; 479  : 
; 480  :         AVISTDINDEX       header;    /**< The header for the current standard index */
; 481  :         AVISTDINDEX_ENTRY data[128]; /**< Temporary storage for some of the standard index entries */
; 482  :     } stdIndex;
; 483  : 
; 484  :     /** Old index entries */
; 485  :     struct
; 486  :     {
; 487  :         DWORD         current;
; 488  :         AVIINDEXENTRY data[128];
; 489  :     } entry;
; 490  : 
; 491  :     int64         legacyOffset;
; 492  :     DWORD         legacyCounter;
; 493  :     AVIINDEXENTRY *legacy;
; 494  : 
; 495  :     #define TRY_FILE(x)\
; 496  :         if (!(x))\
; 497  :            return FALSE
; 498  : 
; 499  :     #define ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
; 500  : 
; 501  :     if (file->superIndex[type].header.nEntriesInUse <= 0 ||
; 502  :         file->legacy.indices[type] <= 0)

  00009	8b 45 0c	 mov	 eax, DWORD PTR _type$[ebp]
  0000c	69 c0 28 04 00
	00		 imul	 eax, 1064		; 00000428H
  00012	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00015	83 bc 01 64 14
	00 00 00	 cmp	 DWORD PTR [ecx+eax+5220], 0
  0001d	76 10		 jbe	 SHORT $LN33@fileBuildS
  0001f	8b 55 0c	 mov	 edx, DWORD PTR _type$[ebp]
  00022	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00025	83 bc 90 34 04
	00 00 00	 cmp	 DWORD PTR [eax+edx*4+1076], 0
  0002d	77 0a		 ja	 SHORT $LN34@fileBuildS
$LN33@fileBuildS:

; 503  :        return TRUE; /* Nothing to do for this stream */

  0002f	b8 01 00 00 00	 mov	 eax, 1
  00034	e9 fd 04 00 00	 jmp	 $LN35@fileBuildS
$LN34@fileBuildS:

; 504  : 
; 505  :     TRY_FILE(__tell(file, &legacyOffset));

  00039	8d 8d 80 fb ff
	ff		 lea	 ecx, DWORD PTR _legacyOffset$[ebp]
  0003f	51		 push	 ecx
  00040	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00043	52		 push	 edx
  00044	e8 00 00 00 00	 call	 ?__tell@@YAHPAUAVI_FILE@@PA_J@Z ; __tell
  00049	83 c4 08	 add	 esp, 8
  0004c	85 c0		 test	 eax, eax
  0004e	75 07		 jne	 SHORT $LN32@fileBuildS
  00050	33 c0		 xor	 eax, eax
  00052	e9 df 04 00 00	 jmp	 $LN35@fileBuildS
$LN32@fileBuildS:

; 506  : 
; 507  :     /* Reset the old entry data */
; 508  :     entry.current = 0;

  00057	c7 85 70 f3 ff
	ff 00 00 00 00	 mov	 DWORD PTR _entry$[ebp], 0

; 509  : 
; 510  :     /* Set up the data for the super index. Make sure the first entry is read
; 511  :        when the loop starts. */
; 512  :     superIndex.offset = file->superIndex[type].offset + sizeof(AVISUPERINDEX);

  00061	8b 45 0c	 mov	 eax, DWORD PTR _type$[ebp]
  00064	69 c0 28 04 00
	00		 imul	 eax, 1064		; 00000428H
  0006a	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0006d	8b 94 01 58 14
	00 00		 mov	 edx, DWORD PTR [ecx+eax+5208]
  00074	83 c2 18	 add	 edx, 24			; 00000018H
  00077	8b 84 01 5c 14
	00 00		 mov	 eax, DWORD PTR [ecx+eax+5212]
  0007e	83 d0 00	 adc	 eax, 0
  00081	89 95 98 fb ff
	ff		 mov	 DWORD PTR _superIndex$[ebp+8], edx
  00087	89 85 9c fb ff
	ff		 mov	 DWORD PTR _superIndex$[ebp+12], eax

; 513  :     superIndex.next   = 0;

  0008d	c7 85 a0 fb ff
	ff 00 00 00 00	 mov	 DWORD PTR _superIndex$[ebp+16], 0

; 514  :     superIndex.load   = TRUE;

  00097	c7 85 90 fb ff
	ff 01 00 00 00	 mov	 DWORD PTR _superIndex$[ebp], 1

; 515  : 
; 516  :     /* Read the super index's header */
; 517  :     TRY_FILE(__seek(file, file->superIndex[type].offset));

  000a1	8b 4d 0c	 mov	 ecx, DWORD PTR _type$[ebp]
  000a4	69 c9 28 04 00
	00		 imul	 ecx, 1064		; 00000428H
  000aa	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000ad	8b 84 0a 5c 14
	00 00		 mov	 eax, DWORD PTR [edx+ecx+5212]
  000b4	50		 push	 eax
  000b5	8b 8c 0a 58 14
	00 00		 mov	 ecx, DWORD PTR [edx+ecx+5208]
  000bc	51		 push	 ecx
  000bd	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000c0	52		 push	 edx
  000c1	e8 00 00 00 00	 call	 ?__seek@@YAHPAUAVI_FILE@@_J@Z ; __seek
  000c6	83 c4 0c	 add	 esp, 12			; 0000000cH
  000c9	85 c0		 test	 eax, eax
  000cb	75 07		 jne	 SHORT $LN31@fileBuildS
  000cd	33 c0		 xor	 eax, eax
  000cf	e9 62 04 00 00	 jmp	 $LN35@fileBuildS
$LN31@fileBuildS:

; 518  :     TRY_FILE(__read(file, &superIndex.header, sizeof(AVISUPERINDEX)));

  000d4	6a 18		 push	 24			; 00000018H
  000d6	8d 85 a4 fb ff
	ff		 lea	 eax, DWORD PTR _superIndex$[ebp+20]
  000dc	50		 push	 eax
  000dd	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000e0	51		 push	 ecx
  000e1	e8 00 00 00 00	 call	 ?__read@@YAHPAUAVI_FILE@@PAXK@Z ; __read
  000e6	83 c4 0c	 add	 esp, 12			; 0000000cH
  000e9	85 c0		 test	 eax, eax
  000eb	75 07		 jne	 SHORT $LN30@fileBuildS
  000ed	33 c0		 xor	 eax, eax
  000ef	e9 42 04 00 00	 jmp	 $LN35@fileBuildS
$LN30@fileBuildS:

; 519  : 
; 520  :     /* Only write a certain number of legacy index entries */
; 521  :     legacyCounter = file->legacy.indices[type];

  000f4	8b 55 0c	 mov	 edx, DWORD PTR _type$[ebp]
  000f7	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000fa	8b 8c 90 34 04
	00 00		 mov	 ecx, DWORD PTR [eax+edx*4+1076]
  00101	89 8d 8c fb ff
	ff		 mov	 DWORD PTR _legacyCounter$[ebp], ecx

; 522  : 
; 523  :     TRY_FILE(__seek(file, legacyOffset));

  00107	8b 95 84 fb ff
	ff		 mov	 edx, DWORD PTR _legacyOffset$[ebp+4]
  0010d	52		 push	 edx
  0010e	8b 85 80 fb ff
	ff		 mov	 eax, DWORD PTR _legacyOffset$[ebp]
  00114	50		 push	 eax
  00115	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00118	51		 push	 ecx
  00119	e8 00 00 00 00	 call	 ?__seek@@YAHPAUAVI_FILE@@_J@Z ; __seek
  0011e	83 c4 0c	 add	 esp, 12			; 0000000cH
  00121	85 c0		 test	 eax, eax
  00123	75 07		 jne	 SHORT $LN28@fileBuildS
  00125	33 c0		 xor	 eax, eax
  00127	e9 0a 04 00 00	 jmp	 $LN35@fileBuildS
$LN28@fileBuildS:

; 524  : 
; 525  :     while (legacyCounter > 0)

  0012c	83 bd 8c fb ff
	ff 00		 cmp	 DWORD PTR _legacyCounter$[ebp], 0
  00133	0f 86 c0 03 00
	00		 jbe	 $LN27@fileBuildS

; 526  :     {
; 527  :         if (superIndex.load)

  00139	83 bd 90 fb ff
	ff 00		 cmp	 DWORD PTR _superIndex$[ebp], 0
  00140	0f 84 70 01 00
	00		 je	 $LN26@fileBuildS

; 528  :         {
; 529  :             /* Load the next super index entry */
; 530  :             if (superIndex.next >= superIndex.header.nEntriesInUse)

  00146	8b 95 a0 fb ff
	ff		 mov	 edx, DWORD PTR _superIndex$[ebp+16]
  0014c	3b 95 a8 fb ff
	ff		 cmp	 edx, DWORD PTR _superIndex$[ebp+24]
  00152	72 1a		 jb	 SHORT $LN25@fileBuildS

; 531  :             {
; 532  :                 /* Ran out of index entries to read. This is definitely an
; 533  :                    error. */
; 534  :                 aviSetError(file, AVI_ERROR_BUILD_INDEX,
; 535  :                                   _T("Ran out of super index entries"));

  00154	68 00 00 00 00	 push	 OFFSET ??_C@_1DO@KPODBFBA@?$AAR?$AAa?$AAn?$AA?5?$AAo?$AAu?$AAt?$AA?5?$AAo?$AAf?$AA?5?$AAs?$AAu?$AAp?$AAe?$AAr?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?5?$AAe?$AAn?$AAt?$AAr?$AAi?$AAe?$AAs?$AA?$AA@
  00159	6a 08		 push	 8
  0015b	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0015e	50		 push	 eax
  0015f	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  00164	83 c4 0c	 add	 esp, 12			; 0000000cH

; 536  :                 return FALSE;

  00167	33 c0		 xor	 eax, eax
  00169	e9 c8 03 00 00	 jmp	 $LN35@fileBuildS
$LN25@fileBuildS:

; 537  :             }
; 538  : 
; 539  :             TRY_FILE(__tell(file, &legacyOffset));

  0016e	8d 8d 80 fb ff
	ff		 lea	 ecx, DWORD PTR _legacyOffset$[ebp]
  00174	51		 push	 ecx
  00175	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00178	52		 push	 edx
  00179	e8 00 00 00 00	 call	 ?__tell@@YAHPAUAVI_FILE@@PA_J@Z ; __tell
  0017e	83 c4 08	 add	 esp, 8
  00181	85 c0		 test	 eax, eax
  00183	75 07		 jne	 SHORT $LN24@fileBuildS
  00185	33 c0		 xor	 eax, eax
  00187	e9 aa 03 00 00	 jmp	 $LN35@fileBuildS
$LN24@fileBuildS:

; 540  : 
; 541  :             TRY_FILE(__seek(file, superIndex.offset));

  0018c	8b 85 9c fb ff
	ff		 mov	 eax, DWORD PTR _superIndex$[ebp+12]
  00192	50		 push	 eax
  00193	8b 8d 98 fb ff
	ff		 mov	 ecx, DWORD PTR _superIndex$[ebp+8]
  00199	51		 push	 ecx
  0019a	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0019d	52		 push	 edx
  0019e	e8 00 00 00 00	 call	 ?__seek@@YAHPAUAVI_FILE@@_J@Z ; __seek
  001a3	83 c4 0c	 add	 esp, 12			; 0000000cH
  001a6	85 c0		 test	 eax, eax
  001a8	75 07		 jne	 SHORT $LN23@fileBuildS
  001aa	33 c0		 xor	 eax, eax
  001ac	e9 85 03 00 00	 jmp	 $LN35@fileBuildS
$LN23@fileBuildS:

; 542  :             TRY_FILE(__read(file, &superIndex.entry,
; 543  :                                   sizeof(AVISUPERINDEX_ENTRY)));

  001b1	6a 10		 push	 16			; 00000010H
  001b3	8d 85 bc fb ff
	ff		 lea	 eax, DWORD PTR _superIndex$[ebp+44]
  001b9	50		 push	 eax
  001ba	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  001bd	51		 push	 ecx
  001be	e8 00 00 00 00	 call	 ?__read@@YAHPAUAVI_FILE@@PAXK@Z ; __read
  001c3	83 c4 0c	 add	 esp, 12			; 0000000cH
  001c6	85 c0		 test	 eax, eax
  001c8	75 07		 jne	 SHORT $LN22@fileBuildS
  001ca	33 c0		 xor	 eax, eax
  001cc	e9 65 03 00 00	 jmp	 $LN35@fileBuildS
$LN22@fileBuildS:

; 544  : 
; 545  :             superIndex.offset += sizeof(AVISUPERINDEX_ENTRY);

  001d1	8b 95 98 fb ff
	ff		 mov	 edx, DWORD PTR _superIndex$[ebp+8]
  001d7	83 c2 10	 add	 edx, 16			; 00000010H
  001da	8b 85 9c fb ff
	ff		 mov	 eax, DWORD PTR _superIndex$[ebp+12]
  001e0	83 d0 00	 adc	 eax, 0
  001e3	89 95 98 fb ff
	ff		 mov	 DWORD PTR _superIndex$[ebp+8], edx
  001e9	89 85 9c fb ff
	ff		 mov	 DWORD PTR _superIndex$[ebp+12], eax

; 546  :             superIndex.next++;

  001ef	8b 8d a0 fb ff
	ff		 mov	 ecx, DWORD PTR _superIndex$[ebp+16]
  001f5	83 c1 01	 add	 ecx, 1
  001f8	89 8d a0 fb ff
	ff		 mov	 DWORD PTR _superIndex$[ebp+16], ecx

; 547  :             superIndex.load = FALSE;

  001fe	c7 85 90 fb ff
	ff 00 00 00 00	 mov	 DWORD PTR _superIndex$[ebp], 0

; 548  : 
; 549  :             /* Read the standard index's header and set it up so that the first
; 550  :                few entries will be read next time an entry is needed */
; 551  :             TRY_FILE(__seek(file, superIndex.entry.qwOffset + 8));

  00208	8b 95 bc fb ff
	ff		 mov	 edx, DWORD PTR _superIndex$[ebp+44]
  0020e	83 c2 08	 add	 edx, 8
  00211	8b 85 c0 fb ff
	ff		 mov	 eax, DWORD PTR _superIndex$[ebp+48]
  00217	83 d0 00	 adc	 eax, 0
  0021a	50		 push	 eax
  0021b	52		 push	 edx
  0021c	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0021f	51		 push	 ecx
  00220	e8 00 00 00 00	 call	 ?__seek@@YAHPAUAVI_FILE@@_J@Z ; __seek
  00225	83 c4 0c	 add	 esp, 12			; 0000000cH
  00228	85 c0		 test	 eax, eax
  0022a	75 07		 jne	 SHORT $LN21@fileBuildS
  0022c	33 c0		 xor	 eax, eax
  0022e	e9 03 03 00 00	 jmp	 $LN35@fileBuildS
$LN21@fileBuildS:

; 552  :             TRY_FILE(__read(file, &stdIndex.header, sizeof(AVISTDINDEX)));

  00233	6a 18		 push	 24			; 00000018H
  00235	8d 95 e4 fb ff
	ff		 lea	 edx, DWORD PTR _stdIndex$[ebp+20]
  0023b	52		 push	 edx
  0023c	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0023f	50		 push	 eax
  00240	e8 00 00 00 00	 call	 ?__read@@YAHPAUAVI_FILE@@PAXK@Z ; __read
  00245	83 c4 0c	 add	 esp, 12			; 0000000cH
  00248	85 c0		 test	 eax, eax
  0024a	75 07		 jne	 SHORT $LN20@fileBuildS
  0024c	33 c0		 xor	 eax, eax
  0024e	e9 e3 02 00 00	 jmp	 $LN35@fileBuildS
$LN20@fileBuildS:

; 553  :             TRY_FILE(__tell(file, &stdIndex.offset));

  00253	8d 8d d0 fb ff
	ff		 lea	 ecx, DWORD PTR _stdIndex$[ebp]
  00259	51		 push	 ecx
  0025a	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0025d	52		 push	 edx
  0025e	e8 00 00 00 00	 call	 ?__tell@@YAHPAUAVI_FILE@@PA_J@Z ; __tell
  00263	83 c4 08	 add	 esp, 8
  00266	85 c0		 test	 eax, eax
  00268	75 07		 jne	 SHORT $LN19@fileBuildS
  0026a	33 c0		 xor	 eax, eax
  0026c	e9 c5 02 00 00	 jmp	 $LN35@fileBuildS
$LN19@fileBuildS:

; 554  : 
; 555  :             stdIndex.read      = 0;

  00271	c7 85 d8 fb ff
	ff 00 00 00 00	 mov	 DWORD PTR _stdIndex$[ebp+8], 0

; 556  :             stdIndex.current   = 0;

  0027b	c7 85 dc fb ff
	ff 00 00 00 00	 mov	 DWORD PTR _stdIndex$[ebp+12], 0

; 557  :             stdIndex.remaining = stdIndex.header.nEntriesInUse;

  00285	8b 85 e8 fb ff
	ff		 mov	 eax, DWORD PTR _stdIndex$[ebp+24]
  0028b	89 85 e0 fb ff
	ff		 mov	 DWORD PTR _stdIndex$[ebp+16], eax

; 558  : 
; 559  :             TRY_FILE(__seek(file, legacyOffset));

  00291	8b 8d 84 fb ff
	ff		 mov	 ecx, DWORD PTR _legacyOffset$[ebp+4]
  00297	51		 push	 ecx
  00298	8b 95 80 fb ff
	ff		 mov	 edx, DWORD PTR _legacyOffset$[ebp]
  0029e	52		 push	 edx
  0029f	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  002a2	50		 push	 eax
  002a3	e8 00 00 00 00	 call	 ?__seek@@YAHPAUAVI_FILE@@_J@Z ; __seek
  002a8	83 c4 0c	 add	 esp, 12			; 0000000cH
  002ab	85 c0		 test	 eax, eax
  002ad	75 07		 jne	 SHORT $LN26@fileBuildS
  002af	33 c0		 xor	 eax, eax
  002b1	e9 80 02 00 00	 jmp	 $LN35@fileBuildS
$LN26@fileBuildS:

; 560  :         }
; 561  : 
; 562  :         /* Load more standard index entries? */
; 563  :         if (stdIndex.current >= stdIndex.read)

  002b6	8b 8d dc fb ff
	ff		 mov	 ecx, DWORD PTR _stdIndex$[ebp+12]
  002bc	3b 8d d8 fb ff
	ff		 cmp	 ecx, DWORD PTR _stdIndex$[ebp+8]
  002c2	0f 82 0e 01 00
	00		 jb	 $LN8@fileBuildS

; 564  :         {
; 565  :             if (stdIndex.remaining > 0)

  002c8	83 bd e0 fb ff
	ff 00		 cmp	 DWORD PTR _stdIndex$[ebp+16], 0
  002cf	0f 86 f7 00 00
	00		 jbe	 $LN16@fileBuildS

; 566  :             {
; 567  :                 /* Determine how many entries can be read */
; 568  :                 if (stdIndex.remaining >= ARRAY_LENGTH(stdIndex.data))

  002d5	81 bd e0 fb ff
	ff 80 00 00 00	 cmp	 DWORD PTR _stdIndex$[ebp+16], 128 ; 00000080H
  002df	72 0c		 jb	 SHORT $LN15@fileBuildS

; 569  :                    stdIndex.read = ARRAY_LENGTH(stdIndex.data);

  002e1	c7 85 d8 fb ff
	ff 80 00 00 00	 mov	 DWORD PTR _stdIndex$[ebp+8], 128 ; 00000080H

; 570  :                    else

  002eb	eb 0c		 jmp	 SHORT $LN14@fileBuildS
$LN15@fileBuildS:

; 571  :                    stdIndex.read = stdIndex.remaining;

  002ed	8b 95 e0 fb ff
	ff		 mov	 edx, DWORD PTR _stdIndex$[ebp+16]
  002f3	89 95 d8 fb ff
	ff		 mov	 DWORD PTR _stdIndex$[ebp+8], edx
$LN14@fileBuildS:

; 572  : 
; 573  :                 TRY_FILE(__tell(file, &legacyOffset));

  002f9	8d 85 80 fb ff
	ff		 lea	 eax, DWORD PTR _legacyOffset$[ebp]
  002ff	50		 push	 eax
  00300	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00303	51		 push	 ecx
  00304	e8 00 00 00 00	 call	 ?__tell@@YAHPAUAVI_FILE@@PA_J@Z ; __tell
  00309	83 c4 08	 add	 esp, 8
  0030c	85 c0		 test	 eax, eax
  0030e	75 07		 jne	 SHORT $LN13@fileBuildS
  00310	33 c0		 xor	 eax, eax
  00312	e9 1f 02 00 00	 jmp	 $LN35@fileBuildS
$LN13@fileBuildS:

; 574  : 
; 575  :                 TRY_FILE(__seek(file, stdIndex.offset));

  00317	8b 95 d4 fb ff
	ff		 mov	 edx, DWORD PTR _stdIndex$[ebp+4]
  0031d	52		 push	 edx
  0031e	8b 85 d0 fb ff
	ff		 mov	 eax, DWORD PTR _stdIndex$[ebp]
  00324	50		 push	 eax
  00325	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00328	51		 push	 ecx
  00329	e8 00 00 00 00	 call	 ?__seek@@YAHPAUAVI_FILE@@_J@Z ; __seek
  0032e	83 c4 0c	 add	 esp, 12			; 0000000cH
  00331	85 c0		 test	 eax, eax
  00333	75 07		 jne	 SHORT $LN12@fileBuildS
  00335	33 c0		 xor	 eax, eax
  00337	e9 fa 01 00 00	 jmp	 $LN35@fileBuildS
$LN12@fileBuildS:

; 576  :                 TRY_FILE(__read(file, stdIndex.data,
; 577  :                                       stdIndex.read *
; 578  :                                       sizeof(AVISTDINDEX_ENTRY)));

  0033c	8b 95 d8 fb ff
	ff		 mov	 edx, DWORD PTR _stdIndex$[ebp+8]
  00342	c1 e2 03	 shl	 edx, 3
  00345	52		 push	 edx
  00346	8d 85 fc fb ff
	ff		 lea	 eax, DWORD PTR _stdIndex$[ebp+44]
  0034c	50		 push	 eax
  0034d	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00350	51		 push	 ecx
  00351	e8 00 00 00 00	 call	 ?__read@@YAHPAUAVI_FILE@@PAXK@Z ; __read
  00356	83 c4 0c	 add	 esp, 12			; 0000000cH
  00359	85 c0		 test	 eax, eax
  0035b	75 07		 jne	 SHORT $LN11@fileBuildS
  0035d	33 c0		 xor	 eax, eax
  0035f	e9 d2 01 00 00	 jmp	 $LN35@fileBuildS
$LN11@fileBuildS:

; 579  : 
; 580  :                 stdIndex.current = 0;

  00364	c7 85 dc fb ff
	ff 00 00 00 00	 mov	 DWORD PTR _stdIndex$[ebp+12], 0

; 581  :                 stdIndex.remaining -= stdIndex.read;

  0036e	8b 95 e0 fb ff
	ff		 mov	 edx, DWORD PTR _stdIndex$[ebp+16]
  00374	2b 95 d8 fb ff
	ff		 sub	 edx, DWORD PTR _stdIndex$[ebp+8]
  0037a	89 95 e0 fb ff
	ff		 mov	 DWORD PTR _stdIndex$[ebp+16], edx

; 582  :                 stdIndex.offset += (QUADWORD)(stdIndex.read *
; 583  :                                               sizeof(AVISTDINDEX_ENTRY));

  00380	8b 85 d8 fb ff
	ff		 mov	 eax, DWORD PTR _stdIndex$[ebp+8]
  00386	c1 e0 03	 shl	 eax, 3
  00389	33 c9		 xor	 ecx, ecx
  0038b	03 85 d0 fb ff
	ff		 add	 eax, DWORD PTR _stdIndex$[ebp]
  00391	8b 95 d4 fb ff
	ff		 mov	 edx, DWORD PTR _stdIndex$[ebp+4]
  00397	13 d1		 adc	 edx, ecx
  00399	89 85 d0 fb ff
	ff		 mov	 DWORD PTR _stdIndex$[ebp], eax
  0039f	89 95 d4 fb ff
	ff		 mov	 DWORD PTR _stdIndex$[ebp+4], edx

; 584  : 
; 585  :                 TRY_FILE(__seek(file, legacyOffset));

  003a5	8b 85 84 fb ff
	ff		 mov	 eax, DWORD PTR _legacyOffset$[ebp+4]
  003ab	50		 push	 eax
  003ac	8b 8d 80 fb ff
	ff		 mov	 ecx, DWORD PTR _legacyOffset$[ebp]
  003b2	51		 push	 ecx
  003b3	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  003b6	52		 push	 edx
  003b7	e8 00 00 00 00	 call	 ?__seek@@YAHPAUAVI_FILE@@_J@Z ; __seek
  003bc	83 c4 0c	 add	 esp, 12			; 0000000cH
  003bf	85 c0		 test	 eax, eax
  003c1	75 07		 jne	 SHORT $LN10@fileBuildS
  003c3	33 c0		 xor	 eax, eax
  003c5	e9 6c 01 00 00	 jmp	 $LN35@fileBuildS
$LN10@fileBuildS:

; 586  :             } else

  003ca	eb 0a		 jmp	 SHORT $LN8@fileBuildS
$LN16@fileBuildS:

; 587  :             {
; 588  :                 /* This index is empty, so load the next one */
; 589  :                 superIndex.load = TRUE;

  003cc	c7 85 90 fb ff
	ff 01 00 00 00	 mov	 DWORD PTR _superIndex$[ebp], 1
$LN8@fileBuildS:

; 590  :             }
; 591  :         }
; 592  : 
; 593  :         /* Convert the OpenDML standard index entries to legacy AVI index
; 594  :            entries if there's anything left in the standard index array */
; 595  :         while (legacyCounter > 0 && stdIndex.current < stdIndex.read)

  003d6	83 bd 8c fb ff
	ff 00		 cmp	 DWORD PTR _legacyCounter$[ebp], 0
  003dd	0f 86 11 01 00
	00		 jbe	 $LN7@fileBuildS
  003e3	8b 85 dc fb ff
	ff		 mov	 eax, DWORD PTR _stdIndex$[ebp+12]
  003e9	3b 85 d8 fb ff
	ff		 cmp	 eax, DWORD PTR _stdIndex$[ebp+8]
  003ef	0f 83 ff 00 00
	00		 jae	 $LN7@fileBuildS

; 596  :         {
; 597  :             legacy = &entry.data[entry.current];

  003f5	8b 8d 70 f3 ff
	ff		 mov	 ecx, DWORD PTR _entry$[ebp]
  003fb	c1 e1 04	 shl	 ecx, 4
  003fe	8d 94 0d 74 f3
	ff ff		 lea	 edx, DWORD PTR _entry$[ebp+ecx+4]
  00405	89 95 7c fb ff
	ff		 mov	 DWORD PTR _legacy$[ebp], edx

; 598  : 
; 599  :             legacy->ckid          = stdIndex.header.dwChunkId;

  0040b	8b 85 7c fb ff
	ff		 mov	 eax, DWORD PTR _legacy$[ebp]
  00411	8b 8d ec fb ff
	ff		 mov	 ecx, DWORD PTR _stdIndex$[ebp+28]
  00417	89 08		 mov	 DWORD PTR [eax], ecx

; 600  :             legacy->dwChunkOffset = stdIndex.data[stdIndex.current].dwOffset - 16;

  00419	8b 95 dc fb ff
	ff		 mov	 edx, DWORD PTR _stdIndex$[ebp+12]
  0041f	8b 84 d5 fc fb
	ff ff		 mov	 eax, DWORD PTR _stdIndex$[ebp+edx*8+44]
  00426	83 e8 10	 sub	 eax, 16			; 00000010H
  00429	8b 8d 7c fb ff
	ff		 mov	 ecx, DWORD PTR _legacy$[ebp]
  0042f	89 41 08	 mov	 DWORD PTR [ecx+8], eax

; 601  :             legacy->dwChunkLength = stdIndex.data[stdIndex.current].dwSize;

  00432	8b 95 7c fb ff
	ff		 mov	 edx, DWORD PTR _legacy$[ebp]
  00438	8b 85 dc fb ff
	ff		 mov	 eax, DWORD PTR _stdIndex$[ebp+12]
  0043e	8b 8c c5 00 fc
	ff ff		 mov	 ecx, DWORD PTR _stdIndex$[ebp+eax*8+48]
  00445	89 4a 0c	 mov	 DWORD PTR [edx+12], ecx

; 602  : 
; 603  :             if (!(legacy->dwChunkLength & 0x80000000))

  00448	8b 95 7c fb ff
	ff		 mov	 edx, DWORD PTR _legacy$[ebp]
  0044e	8b 42 0c	 mov	 eax, DWORD PTR [edx+12]
  00451	25 00 00 00 80	 and	 eax, -2147483648	; 80000000H
  00456	75 0f		 jne	 SHORT $LN6@fileBuildS

; 604  :                legacy->dwFlags = AVIIF_KEYFRAME;

  00458	8b 8d 7c fb ff
	ff		 mov	 ecx, DWORD PTR _legacy$[ebp]
  0045e	c7 41 04 10 00
	00 00		 mov	 DWORD PTR [ecx+4], 16	; 00000010H

; 605  :                else

  00465	eb 0d		 jmp	 SHORT $LN5@fileBuildS
$LN6@fileBuildS:

; 606  :                legacy->dwFlags = 0;

  00467	8b 95 7c fb ff
	ff		 mov	 edx, DWORD PTR _legacy$[ebp]
  0046d	c7 42 04 00 00
	00 00		 mov	 DWORD PTR [edx+4], 0
$LN5@fileBuildS:

; 607  : 
; 608  :             legacy->dwChunkLength &= ~0x80000000;

  00474	8b 85 7c fb ff
	ff		 mov	 eax, DWORD PTR _legacy$[ebp]
  0047a	8b 48 0c	 mov	 ecx, DWORD PTR [eax+12]
  0047d	81 e1 ff ff ff
	7f		 and	 ecx, 2147483647		; 7fffffffH
  00483	8b 95 7c fb ff
	ff		 mov	 edx, DWORD PTR _legacy$[ebp]
  00489	89 4a 0c	 mov	 DWORD PTR [edx+12], ecx

; 609  : 
; 610  :             entry.current++;

  0048c	8b 85 70 f3 ff
	ff		 mov	 eax, DWORD PTR _entry$[ebp]
  00492	83 c0 01	 add	 eax, 1
  00495	89 85 70 f3 ff
	ff		 mov	 DWORD PTR _entry$[ebp], eax

; 611  :             stdIndex.current++;

  0049b	8b 8d dc fb ff
	ff		 mov	 ecx, DWORD PTR _stdIndex$[ebp+12]
  004a1	83 c1 01	 add	 ecx, 1
  004a4	89 8d dc fb ff
	ff		 mov	 DWORD PTR _stdIndex$[ebp+12], ecx

; 612  :             legacyCounter--;

  004aa	8b 95 8c fb ff
	ff		 mov	 edx, DWORD PTR _legacyCounter$[ebp]
  004b0	83 ea 01	 sub	 edx, 1
  004b3	89 95 8c fb ff
	ff		 mov	 DWORD PTR _legacyCounter$[ebp], edx

; 613  : 
; 614  :             if (entry.current >= ARRAY_LENGTH(entry.data))

  004b9	81 bd 70 f3 ff
	ff 80 00 00 00	 cmp	 DWORD PTR _entry$[ebp], 128 ; 00000080H
  004c3	72 2a		 jb	 SHORT $LN4@fileBuildS

; 615  :             {
; 616  :                 /* The legacy index array is full. Write it to the file then
; 617  :                    reset it. */
; 618  :                 TRY_FILE(__write(file, entry.data, sizeof(entry.data)));

  004c5	68 00 08 00 00	 push	 2048			; 00000800H
  004ca	8d 85 74 f3 ff
	ff		 lea	 eax, DWORD PTR _entry$[ebp+4]
  004d0	50		 push	 eax
  004d1	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  004d4	51		 push	 ecx
  004d5	e8 00 00 00 00	 call	 ?__write@@YAHPAUAVI_FILE@@PAXK@Z ; __write
  004da	83 c4 0c	 add	 esp, 12			; 0000000cH
  004dd	85 c0		 test	 eax, eax
  004df	75 04		 jne	 SHORT $LN3@fileBuildS
  004e1	33 c0		 xor	 eax, eax
  004e3	eb 51		 jmp	 SHORT $LN35@fileBuildS
$LN3@fileBuildS:

; 619  :                 entry.current = 0;

  004e5	c7 85 70 f3 ff
	ff 00 00 00 00	 mov	 DWORD PTR _entry$[ebp], 0
$LN4@fileBuildS:

; 620  :             }
; 621  :         }

  004ef	e9 e2 fe ff ff	 jmp	 $LN8@fileBuildS
$LN7@fileBuildS:

; 622  :     }

  004f4	e9 33 fc ff ff	 jmp	 $LN28@fileBuildS
$LN27@fileBuildS:

; 623  : 
; 624  :     /* Write any remaining legacy indices to the file */
; 625  :     if (entry.current > 0)

  004f9	83 bd 70 f3 ff
	ff 00		 cmp	 DWORD PTR _entry$[ebp], 0
  00500	76 2f		 jbe	 SHORT $LN2@fileBuildS

; 626  :     {
; 627  :         TRY_FILE(__write(file, entry.data, entry.current *
; 628  :                                            sizeof(entry.data[0])));

  00502	8b 95 70 f3 ff
	ff		 mov	 edx, DWORD PTR _entry$[ebp]
  00508	c1 e2 04	 shl	 edx, 4
  0050b	52		 push	 edx
  0050c	8d 85 74 f3 ff
	ff		 lea	 eax, DWORD PTR _entry$[ebp+4]
  00512	50		 push	 eax
  00513	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00516	51		 push	 ecx
  00517	e8 00 00 00 00	 call	 ?__write@@YAHPAUAVI_FILE@@PAXK@Z ; __write
  0051c	83 c4 0c	 add	 esp, 12			; 0000000cH
  0051f	85 c0		 test	 eax, eax
  00521	75 04		 jne	 SHORT $LN1@fileBuildS
  00523	33 c0		 xor	 eax, eax
  00525	eb 0f		 jmp	 SHORT $LN35@fileBuildS
$LN1@fileBuildS:

; 629  :         entry.current = 0;

  00527	c7 85 70 f3 ff
	ff 00 00 00 00	 mov	 DWORD PTR _entry$[ebp], 0
$LN2@fileBuildS:

; 630  :     }
; 631  : 
; 632  :     return TRUE;

  00531	b8 01 00 00 00	 mov	 eax, 1
$LN35@fileBuildS:

; 633  : }

  00536	8b e5		 mov	 esp, ebp
  00538	5d		 pop	 ebp
  00539	c3		 ret	 0
?fileBuildStreamIndex@@YAHPAUAVI_FILE@@W4stream_t@@@Z ENDP ; fileBuildStreamIndex
_TEXT	ENDS
PUBLIC	?fifoDumpBlock@@YAHPAUFIFO@@PAUAVI_FILE@@@Z	; fifoDumpBlock
; Function compile flags: /Odtp
;	COMDAT ?fifoDumpBlock@@YAHPAUFIFO@@PAUAVI_FILE@@@Z
_TEXT	SEGMENT
_header$ = -40						; size = 16
_writeError$ = -24					; size = 4
_fifoError$ = -20					; size = 4
_offset$ = -16						; size = 4
_thisBlock$ = -12					; size = 4
_size$ = -8						; size = 4
_read$ = -4						; size = 4
_fifo$ = 8						; size = 4
_file$ = 12						; size = 4
?fifoDumpBlock@@YAHPAUFIFO@@PAUAVI_FILE@@@Z PROC	; fifoDumpBlock, COMDAT

; 351  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 28	 sub	 esp, 40			; 00000028H

; 352  :     /* This function only touches the start offset in the FIFO buffer */
; 353  :     DWORD             offset;
; 354  :     DWORD             thisBlock;
; 355  :     DWORD             size;
; 356  :     DWORD             read;
; 357  :     ASYNC_DATA_HEADER header;
; 358  :     BOOL              writeError;
; 359  :     BOOL              fifoError;
; 360  : 
; 361  :     if (!fifo || !file)

  00006	83 7d 08 00	 cmp	 DWORD PTR _fifo$[ebp], 0
  0000a	74 06		 je	 SHORT $LN17@fifoDumpBl
  0000c	83 7d 0c 00	 cmp	 DWORD PTR _file$[ebp], 0
  00010	75 07		 jne	 SHORT $LN18@fifoDumpBl
$LN17@fifoDumpBl:

; 362  :        return FALSE;

  00012	33 c0		 xor	 eax, eax
  00014	e9 d8 01 00 00	 jmp	 $LN19@fifoDumpBl
$LN18@fifoDumpBl:

; 363  : 
; 364  :     writeError = FALSE;

  00019	c7 45 e8 00 00
	00 00		 mov	 DWORD PTR _writeError$[ebp], 0

; 365  :     fifoError  = FALSE;

  00020	c7 45 ec 00 00
	00 00		 mov	 DWORD PTR _fifoError$[ebp], 0

; 366  : 
; 367  :     EnterCriticalSection(&fifo->mutex.read);

  00027	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  0002a	50		 push	 eax
  0002b	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__EnterCriticalSection@4

; 368  : 
; 369  :     if (fifoReadableSpace(fifo) < sizeof(ASYNC_DATA_HEADER))

  00031	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  00034	51		 push	 ecx
  00035	e8 00 00 00 00	 call	 ?fifoReadableSpace@@YAKPAUFIFO@@@Z ; fifoReadableSpace
  0003a	83 c4 04	 add	 esp, 4
  0003d	83 f8 10	 cmp	 eax, 16			; 00000010H
  00040	73 11		 jae	 SHORT $LN16@fifoDumpBl

; 370  :     {
; 371  :         LeaveCriticalSection(&fifo->mutex.read);

  00042	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  00045	52		 push	 edx
  00046	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__LeaveCriticalSection@4

; 372  :         return FALSE;

  0004c	33 c0		 xor	 eax, eax
  0004e	e9 9e 01 00 00	 jmp	 $LN19@fifoDumpBl
$LN16@fifoDumpBl:

; 373  :     }
; 374  : 
; 375  :     size = sizeof(ASYNC_DATA_HEADER);

  00053	c7 45 f8 10 00
	00 00		 mov	 DWORD PTR _size$[ebp], 16 ; 00000010H

; 376  : 
; 377  :     /* Adjust the read size and set offset to the FIFO buffer's start offset */
; 378  :     fifoAdjustReadSize(fifo, &offset, &size);

  0005a	8d 45 f8	 lea	 eax, DWORD PTR _size$[ebp]
  0005d	50		 push	 eax
  0005e	8d 4d f0	 lea	 ecx, DWORD PTR _offset$[ebp]
  00061	51		 push	 ecx
  00062	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  00065	52		 push	 edx
  00066	e8 00 00 00 00	 call	 ?fifoAdjustReadSize@@YAXPAUFIFO@@PAK1@Z ; fifoAdjustReadSize
  0006b	83 c4 0c	 add	 esp, 12			; 0000000cH

; 379  : 
; 380  :     if (!size)

  0006e	83 7d f8 00	 cmp	 DWORD PTR _size$[ebp], 0
  00072	75 1a		 jne	 SHORT $LN15@fifoDumpBl

; 381  :     {
; 382  :         /* This shouldn't ever happen */
; 383  :         aviSetError(file, AVI_ERROR_FIFO, _T("Internal write error"));

  00074	68 00 00 00 00	 push	 OFFSET ??_C@_1CK@PHGDEJPI@?$AAI?$AAn?$AAt?$AAe?$AAr?$AAn?$AAa?$AAl?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@
  00079	6a 05		 push	 5
  0007b	8b 45 0c	 mov	 eax, DWORD PTR _file$[ebp]
  0007e	50		 push	 eax
  0007f	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  00084	83 c4 0c	 add	 esp, 12			; 0000000cH

; 384  :         fifoError = TRUE;

  00087	c7 45 ec 01 00
	00 00		 mov	 DWORD PTR _fifoError$[ebp], 1
$LN15@fifoDumpBl:

; 385  :     }
; 386  : 
; 387  :     /* Read the header */
; 388  :     read = 0;

  0008e	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _read$[ebp], 0
$LN14@fifoDumpBl:

; 389  :     while (size > 0)

  00095	83 7d f8 00	 cmp	 DWORD PTR _size$[ebp], 0
  00099	76 65		 jbe	 SHORT $LN13@fifoDumpBl

; 390  :     {
; 391  :         if (offset + size > fifo->size)

  0009b	8b 4d f0	 mov	 ecx, DWORD PTR _offset$[ebp]
  0009e	03 4d f8	 add	 ecx, DWORD PTR _size$[ebp]
  000a1	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  000a4	3b 4a 38	 cmp	 ecx, DWORD PTR [edx+56]
  000a7	76 0e		 jbe	 SHORT $LN12@fifoDumpBl

; 392  :            thisBlock = fifo->size - offset;

  000a9	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  000ac	8b 48 38	 mov	 ecx, DWORD PTR [eax+56]
  000af	2b 4d f0	 sub	 ecx, DWORD PTR _offset$[ebp]
  000b2	89 4d f4	 mov	 DWORD PTR _thisBlock$[ebp], ecx

; 393  :            else

  000b5	eb 06		 jmp	 SHORT $LN11@fifoDumpBl
$LN12@fifoDumpBl:

; 394  :            thisBlock = size;

  000b7	8b 55 f8	 mov	 edx, DWORD PTR _size$[ebp]
  000ba	89 55 f4	 mov	 DWORD PTR _thisBlock$[ebp], edx
$LN11@fifoDumpBl:

; 395  : 
; 396  :         memcpy((BYTE *)&header + read, &fifo->data[offset], thisBlock);

  000bd	8b 45 f4	 mov	 eax, DWORD PTR _thisBlock$[ebp]
  000c0	50		 push	 eax
  000c1	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  000c4	8b 51 3c	 mov	 edx, DWORD PTR [ecx+60]
  000c7	03 55 f0	 add	 edx, DWORD PTR _offset$[ebp]
  000ca	52		 push	 edx
  000cb	8b 45 fc	 mov	 eax, DWORD PTR _read$[ebp]
  000ce	8d 4c 05 d8	 lea	 ecx, DWORD PTR _header$[ebp+eax]
  000d2	51		 push	 ecx
  000d3	e8 00 00 00 00	 call	 _memcpy
  000d8	83 c4 0c	 add	 esp, 12			; 0000000cH

; 397  : 
; 398  :         size -= thisBlock;

  000db	8b 55 f8	 mov	 edx, DWORD PTR _size$[ebp]
  000de	2b 55 f4	 sub	 edx, DWORD PTR _thisBlock$[ebp]
  000e1	89 55 f8	 mov	 DWORD PTR _size$[ebp], edx

; 399  :         offset = FIFO_POS(fifo, offset + thisBlock);

  000e4	8b 45 f0	 mov	 eax, DWORD PTR _offset$[ebp]
  000e7	03 45 f4	 add	 eax, DWORD PTR _thisBlock$[ebp]
  000ea	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  000ed	33 d2		 xor	 edx, edx
  000ef	f7 71 38	 div	 DWORD PTR [ecx+56]
  000f2	89 55 f0	 mov	 DWORD PTR _offset$[ebp], edx

; 400  :         read += thisBlock;

  000f5	8b 55 fc	 mov	 edx, DWORD PTR _read$[ebp]
  000f8	03 55 f4	 add	 edx, DWORD PTR _thisBlock$[ebp]
  000fb	89 55 fc	 mov	 DWORD PTR _read$[ebp], edx

; 401  :     }

  000fe	eb 95		 jmp	 SHORT $LN14@fifoDumpBl
$LN13@fifoDumpBl:

; 402  : 
; 403  :     /* Write the data from the FIFO buffer to the file */
; 404  :     size = header.size;

  00100	8b 45 d8	 mov	 eax, DWORD PTR _header$[ebp]
  00103	89 45 f8	 mov	 DWORD PTR _size$[ebp], eax

; 405  : 
; 406  :     if (fifoReadableSpace(fifo) < size + sizeof(ASYNC_DATA_HEADER))

  00106	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  00109	51		 push	 ecx
  0010a	e8 00 00 00 00	 call	 ?fifoReadableSpace@@YAKPAUFIFO@@@Z ; fifoReadableSpace
  0010f	83 c4 04	 add	 esp, 4
  00112	8b 55 f8	 mov	 edx, DWORD PTR _size$[ebp]
  00115	83 c2 10	 add	 edx, 16			; 00000010H
  00118	3b c2		 cmp	 eax, edx
  0011a	73 1a		 jae	 SHORT $LN10@fifoDumpBl

; 407  :     {
; 408  :         /* This also shouldn't ever happen */
; 409  :         aviSetError(file, AVI_ERROR_FIFO, _T("Internal write error"));

  0011c	68 00 00 00 00	 push	 OFFSET ??_C@_1CK@PHGDEJPI@?$AAI?$AAn?$AAt?$AAe?$AAr?$AAn?$AAa?$AAl?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@
  00121	6a 05		 push	 5
  00123	8b 45 0c	 mov	 eax, DWORD PTR _file$[ebp]
  00126	50		 push	 eax
  00127	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  0012c	83 c4 0c	 add	 esp, 12			; 0000000cH

; 410  :         fifoError = TRUE;

  0012f	c7 45 ec 01 00
	00 00		 mov	 DWORD PTR _fifoError$[ebp], 1
$LN10@fifoDumpBl:

; 411  :     }
; 412  : 
; 413  :     if (!fifoError)

  00136	83 7d ec 00	 cmp	 DWORD PTR _fifoError$[ebp], 0
  0013a	0f 85 90 00 00
	00		 jne	 $LN9@fifoDumpBl

; 414  :     {
; 415  :         if (!__seek(file, header.offset))

  00140	8b 4d e4	 mov	 ecx, DWORD PTR _header$[ebp+12]
  00143	51		 push	 ecx
  00144	8b 55 e0	 mov	 edx, DWORD PTR _header$[ebp+8]
  00147	52		 push	 edx
  00148	8b 45 0c	 mov	 eax, DWORD PTR _file$[ebp]
  0014b	50		 push	 eax
  0014c	e8 00 00 00 00	 call	 ?__seek@@YAHPAUAVI_FILE@@_J@Z ; __seek
  00151	83 c4 0c	 add	 esp, 12			; 0000000cH
  00154	85 c0		 test	 eax, eax
  00156	75 07		 jne	 SHORT $LN7@fifoDumpBl

; 416  :            writeError = TRUE;

  00158	c7 45 e8 01 00
	00 00		 mov	 DWORD PTR _writeError$[ebp], 1
$LN7@fifoDumpBl:

; 417  : 
; 418  :         while (size > 0)

  0015f	83 7d f8 00	 cmp	 DWORD PTR _size$[ebp], 0
  00163	76 69		 jbe	 SHORT $LN6@fifoDumpBl

; 419  :         {
; 420  :             if (offset + size > fifo->size)

  00165	8b 4d f0	 mov	 ecx, DWORD PTR _offset$[ebp]
  00168	03 4d f8	 add	 ecx, DWORD PTR _size$[ebp]
  0016b	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  0016e	3b 4a 38	 cmp	 ecx, DWORD PTR [edx+56]
  00171	76 0e		 jbe	 SHORT $LN5@fifoDumpBl

; 421  :                thisBlock = fifo->size - offset;

  00173	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  00176	8b 48 38	 mov	 ecx, DWORD PTR [eax+56]
  00179	2b 4d f0	 sub	 ecx, DWORD PTR _offset$[ebp]
  0017c	89 4d f4	 mov	 DWORD PTR _thisBlock$[ebp], ecx

; 422  :                else

  0017f	eb 06		 jmp	 SHORT $LN4@fifoDumpBl
$LN5@fifoDumpBl:

; 423  :                thisBlock = size;

  00181	8b 55 f8	 mov	 edx, DWORD PTR _size$[ebp]
  00184	89 55 f4	 mov	 DWORD PTR _thisBlock$[ebp], edx
$LN4@fifoDumpBl:

; 424  : 
; 425  :             /* Keep writing data as long as there wasn't a write error */
; 426  :             if (!writeError)

  00187	83 7d e8 00	 cmp	 DWORD PTR _writeError$[ebp], 0
  0018b	75 25		 jne	 SHORT $LN3@fifoDumpBl

; 427  :             {
; 428  :                 if (!__write(file, &fifo->data[offset], thisBlock))

  0018d	8b 45 f4	 mov	 eax, DWORD PTR _thisBlock$[ebp]
  00190	50		 push	 eax
  00191	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  00194	8b 51 3c	 mov	 edx, DWORD PTR [ecx+60]
  00197	03 55 f0	 add	 edx, DWORD PTR _offset$[ebp]
  0019a	52		 push	 edx
  0019b	8b 45 0c	 mov	 eax, DWORD PTR _file$[ebp]
  0019e	50		 push	 eax
  0019f	e8 00 00 00 00	 call	 ?__write@@YAHPAUAVI_FILE@@PAXK@Z ; __write
  001a4	83 c4 0c	 add	 esp, 12			; 0000000cH
  001a7	85 c0		 test	 eax, eax
  001a9	75 07		 jne	 SHORT $LN3@fifoDumpBl

; 429  :                    writeError = TRUE;

  001ab	c7 45 e8 01 00
	00 00		 mov	 DWORD PTR _writeError$[ebp], 1
$LN3@fifoDumpBl:

; 430  :             }
; 431  : 
; 432  :             size -= thisBlock;

  001b2	8b 4d f8	 mov	 ecx, DWORD PTR _size$[ebp]
  001b5	2b 4d f4	 sub	 ecx, DWORD PTR _thisBlock$[ebp]
  001b8	89 4d f8	 mov	 DWORD PTR _size$[ebp], ecx

; 433  :             offset = FIFO_POS(fifo, offset + thisBlock);

  001bb	8b 45 f0	 mov	 eax, DWORD PTR _offset$[ebp]
  001be	03 45 f4	 add	 eax, DWORD PTR _thisBlock$[ebp]
  001c1	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  001c4	33 d2		 xor	 edx, edx
  001c6	f7 71 38	 div	 DWORD PTR [ecx+56]
  001c9	89 55 f0	 mov	 DWORD PTR _offset$[ebp], edx

; 434  :         }

  001cc	eb 91		 jmp	 SHORT $LN7@fifoDumpBl
$LN6@fifoDumpBl:

; 435  :     } else

  001ce	eb 09		 jmp	 SHORT $LN1@fifoDumpBl
$LN9@fifoDumpBl:

; 436  :     {
; 437  :         /* Try and recover from the FIFO error. Just make the start offset
; 438  :            equal to the end offset so the bad data isn't read again. */
; 439  :         offset = fifo->end;

  001d0	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  001d3	8b 42 34	 mov	 eax, DWORD PTR [edx+52]
  001d6	89 45 f0	 mov	 DWORD PTR _offset$[ebp], eax
$LN1@fifoDumpBl:

; 440  :     }
; 441  : 
; 442  :     fifo->start = offset;

  001d9	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  001dc	8b 55 f0	 mov	 edx, DWORD PTR _offset$[ebp]
  001df	89 51 30	 mov	 DWORD PTR [ecx+48], edx

; 443  : 
; 444  :     LeaveCriticalSection(&fifo->mutex.read);

  001e2	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  001e5	50		 push	 eax
  001e6	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__LeaveCriticalSection@4

; 445  : 
; 446  :     /* Always return TRUE even if there was an error so anything that's waiting
; 447  :        for a write to finish isn't blocked forever */
; 448  :     return TRUE;

  001ec	b8 01 00 00 00	 mov	 eax, 1
$LN19@fifoDumpBl:

; 449  : }

  001f1	8b e5		 mov	 esp, ebp
  001f3	5d		 pop	 ebp
  001f4	c3		 ret	 0
?fifoDumpBlock@@YAHPAUFIFO@@PAUAVI_FILE@@@Z ENDP	; fifoDumpBlock
_TEXT	ENDS
PUBLIC	?fifoWrite@@YAHPAUFIFO@@PAUASYNC_DATA_HEADER@@PAE@Z ; fifoWrite
; Function compile flags: /Odtp
;	COMDAT ?fifoWrite@@YAHPAUFIFO@@PAUASYNC_DATA_HEADER@@PAE@Z
_TEXT	SEGMENT
_wrote$ = -20						; size = 4
_result$ = -16						; size = 4
_offset$ = -12						; size = 4
_thisBlock$ = -8					; size = 4
_size$ = -4						; size = 4
_fifo$ = 8						; size = 4
_header$ = 12						; size = 4
_src$ = 16						; size = 4
?fifoWrite@@YAHPAUFIFO@@PAUASYNC_DATA_HEADER@@PAE@Z PROC ; fifoWrite, COMDAT

; 284  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 14	 sub	 esp, 20			; 00000014H

; 285  :     /* This function only touches the end offset in the FIFO buffer */
; 286  :     DWORD offset;
; 287  :     DWORD thisBlock;
; 288  :     DWORD size;
; 289  :     DWORD wrote;
; 290  :     BOOL  result = FALSE;

  00006	c7 45 f0 00 00
	00 00		 mov	 DWORD PTR _result$[ebp], 0

; 291  : 
; 292  :     /* Uses the local variables offset and wrote */
; 293  :     #define FIFO_WRITE(FIFO, SRC, SIZE)\
; 294  :         wrote = 0;\
; 295  : \
; 296  :         while (SIZE > 0)\
; 297  :         {\
; 298  :             if (offset + (SIZE) > (FIFO)->size)\
; 299  :                thisBlock = (FIFO)->size - offset;\
; 300  :                else\
; 301  :                thisBlock = SIZE;\
; 302  : \
; 303  :             memcpy(&(FIFO)->data[offset], (BYTE *)(SRC) + wrote, thisBlock);\
; 304  : \
; 305  :             (SIZE) -= thisBlock;\
; 306  :             offset = FIFO_POS(FIFO, offset + thisBlock);\
; 307  :             wrote += thisBlock;\
; 308  :         }
; 309  : 
; 310  :     if (!fifo)

  0000d	83 7d 08 00	 cmp	 DWORD PTR _fifo$[ebp], 0
  00011	75 07		 jne	 SHORT $LN10@fifoWrite

; 311  :        return FALSE;

  00013	33 c0		 xor	 eax, eax
  00015	e9 47 01 00 00	 jmp	 $LN11@fifoWrite
$LN10@fifoWrite:

; 312  : 
; 313  :     EnterCriticalSection(&fifo->mutex.write);

  0001a	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  0001d	83 c0 18	 add	 eax, 24			; 00000018H
  00020	50		 push	 eax
  00021	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__EnterCriticalSection@4

; 314  : 
; 315  :     /* Build the header and add its size to the number of bytes to write */
; 316  :     size = header->size + sizeof(ASYNC_DATA_HEADER);

  00027	8b 4d 0c	 mov	 ecx, DWORD PTR _header$[ebp]
  0002a	8b 11		 mov	 edx, DWORD PTR [ecx]
  0002c	83 c2 10	 add	 edx, 16			; 00000010H
  0002f	89 55 fc	 mov	 DWORD PTR _size$[ebp], edx

; 317  : 
; 318  :     /* Adjust the write size and set offset to the FIFO buffer's end offset */
; 319  :     fifoAdjustWriteSize(fifo, &offset, &size);

  00032	8d 45 fc	 lea	 eax, DWORD PTR _size$[ebp]
  00035	50		 push	 eax
  00036	8d 4d f4	 lea	 ecx, DWORD PTR _offset$[ebp]
  00039	51		 push	 ecx
  0003a	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  0003d	52		 push	 edx
  0003e	e8 00 00 00 00	 call	 ?fifoAdjustWriteSize@@YAXPAUFIFO@@PAK1@Z ; fifoAdjustWriteSize
  00043	83 c4 0c	 add	 esp, 12			; 0000000cH

; 320  :     if (size > 0)

  00046	83 7d fc 00	 cmp	 DWORD PTR _size$[ebp], 0
  0004a	0f 86 01 01 00
	00		 jbe	 $LN9@fifoWrite

; 321  :     {
; 322  :         /* This means there's enough space to write the header and the data */
; 323  : 
; 324  :         /* Write the header first */
; 325  :         size = sizeof(ASYNC_DATA_HEADER);

  00050	c7 45 fc 10 00
	00 00		 mov	 DWORD PTR _size$[ebp], 16 ; 00000010H

; 326  :         FIFO_WRITE(fifo, header, size);

  00057	c7 45 ec 00 00
	00 00		 mov	 DWORD PTR _wrote$[ebp], 0
$LN8@fifoWrite:
  0005e	83 7d fc 00	 cmp	 DWORD PTR _size$[ebp], 0
  00062	76 64		 jbe	 SHORT $LN7@fifoWrite
  00064	8b 45 f4	 mov	 eax, DWORD PTR _offset$[ebp]
  00067	03 45 fc	 add	 eax, DWORD PTR _size$[ebp]
  0006a	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  0006d	3b 41 38	 cmp	 eax, DWORD PTR [ecx+56]
  00070	76 0e		 jbe	 SHORT $LN6@fifoWrite
  00072	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  00075	8b 42 38	 mov	 eax, DWORD PTR [edx+56]
  00078	2b 45 f4	 sub	 eax, DWORD PTR _offset$[ebp]
  0007b	89 45 f8	 mov	 DWORD PTR _thisBlock$[ebp], eax
  0007e	eb 06		 jmp	 SHORT $LN5@fifoWrite
$LN6@fifoWrite:
  00080	8b 4d fc	 mov	 ecx, DWORD PTR _size$[ebp]
  00083	89 4d f8	 mov	 DWORD PTR _thisBlock$[ebp], ecx
$LN5@fifoWrite:
  00086	8b 55 f8	 mov	 edx, DWORD PTR _thisBlock$[ebp]
  00089	52		 push	 edx
  0008a	8b 45 0c	 mov	 eax, DWORD PTR _header$[ebp]
  0008d	03 45 ec	 add	 eax, DWORD PTR _wrote$[ebp]
  00090	50		 push	 eax
  00091	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  00094	8b 51 3c	 mov	 edx, DWORD PTR [ecx+60]
  00097	03 55 f4	 add	 edx, DWORD PTR _offset$[ebp]
  0009a	52		 push	 edx
  0009b	e8 00 00 00 00	 call	 _memcpy
  000a0	83 c4 0c	 add	 esp, 12			; 0000000cH
  000a3	8b 45 fc	 mov	 eax, DWORD PTR _size$[ebp]
  000a6	2b 45 f8	 sub	 eax, DWORD PTR _thisBlock$[ebp]
  000a9	89 45 fc	 mov	 DWORD PTR _size$[ebp], eax
  000ac	8b 45 f4	 mov	 eax, DWORD PTR _offset$[ebp]
  000af	03 45 f8	 add	 eax, DWORD PTR _thisBlock$[ebp]
  000b2	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  000b5	33 d2		 xor	 edx, edx
  000b7	f7 71 38	 div	 DWORD PTR [ecx+56]
  000ba	89 55 f4	 mov	 DWORD PTR _offset$[ebp], edx
  000bd	8b 55 ec	 mov	 edx, DWORD PTR _wrote$[ebp]
  000c0	03 55 f8	 add	 edx, DWORD PTR _thisBlock$[ebp]
  000c3	89 55 ec	 mov	 DWORD PTR _wrote$[ebp], edx
  000c6	eb 96		 jmp	 SHORT $LN8@fifoWrite
$LN7@fifoWrite:

; 327  : 
; 328  :         /* Write the data */
; 329  :         size = header->size;

  000c8	8b 45 0c	 mov	 eax, DWORD PTR _header$[ebp]
  000cb	8b 08		 mov	 ecx, DWORD PTR [eax]
  000cd	89 4d fc	 mov	 DWORD PTR _size$[ebp], ecx

; 330  :         FIFO_WRITE(fifo, src, size);

  000d0	c7 45 ec 00 00
	00 00		 mov	 DWORD PTR _wrote$[ebp], 0
$LN4@fifoWrite:
  000d7	83 7d fc 00	 cmp	 DWORD PTR _size$[ebp], 0
  000db	76 64		 jbe	 SHORT $LN3@fifoWrite
  000dd	8b 55 f4	 mov	 edx, DWORD PTR _offset$[ebp]
  000e0	03 55 fc	 add	 edx, DWORD PTR _size$[ebp]
  000e3	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  000e6	3b 50 38	 cmp	 edx, DWORD PTR [eax+56]
  000e9	76 0e		 jbe	 SHORT $LN2@fifoWrite
  000eb	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  000ee	8b 51 38	 mov	 edx, DWORD PTR [ecx+56]
  000f1	2b 55 f4	 sub	 edx, DWORD PTR _offset$[ebp]
  000f4	89 55 f8	 mov	 DWORD PTR _thisBlock$[ebp], edx
  000f7	eb 06		 jmp	 SHORT $LN1@fifoWrite
$LN2@fifoWrite:
  000f9	8b 45 fc	 mov	 eax, DWORD PTR _size$[ebp]
  000fc	89 45 f8	 mov	 DWORD PTR _thisBlock$[ebp], eax
$LN1@fifoWrite:
  000ff	8b 4d f8	 mov	 ecx, DWORD PTR _thisBlock$[ebp]
  00102	51		 push	 ecx
  00103	8b 55 10	 mov	 edx, DWORD PTR _src$[ebp]
  00106	03 55 ec	 add	 edx, DWORD PTR _wrote$[ebp]
  00109	52		 push	 edx
  0010a	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  0010d	8b 48 3c	 mov	 ecx, DWORD PTR [eax+60]
  00110	03 4d f4	 add	 ecx, DWORD PTR _offset$[ebp]
  00113	51		 push	 ecx
  00114	e8 00 00 00 00	 call	 _memcpy
  00119	83 c4 0c	 add	 esp, 12			; 0000000cH
  0011c	8b 55 fc	 mov	 edx, DWORD PTR _size$[ebp]
  0011f	2b 55 f8	 sub	 edx, DWORD PTR _thisBlock$[ebp]
  00122	89 55 fc	 mov	 DWORD PTR _size$[ebp], edx
  00125	8b 45 f4	 mov	 eax, DWORD PTR _offset$[ebp]
  00128	03 45 f8	 add	 eax, DWORD PTR _thisBlock$[ebp]
  0012b	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  0012e	33 d2		 xor	 edx, edx
  00130	f7 71 38	 div	 DWORD PTR [ecx+56]
  00133	89 55 f4	 mov	 DWORD PTR _offset$[ebp], edx
  00136	8b 55 ec	 mov	 edx, DWORD PTR _wrote$[ebp]
  00139	03 55 f8	 add	 edx, DWORD PTR _thisBlock$[ebp]
  0013c	89 55 ec	 mov	 DWORD PTR _wrote$[ebp], edx
  0013f	eb 96		 jmp	 SHORT $LN4@fifoWrite
$LN3@fifoWrite:

; 331  : 
; 332  :         fifo->end = offset;

  00141	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  00144	8b 4d f4	 mov	 ecx, DWORD PTR _offset$[ebp]
  00147	89 48 34	 mov	 DWORD PTR [eax+52], ecx

; 333  : 
; 334  :         result = TRUE;

  0014a	c7 45 f0 01 00
	00 00		 mov	 DWORD PTR _result$[ebp], 1
$LN9@fifoWrite:

; 335  :     }
; 336  : 
; 337  :     LeaveCriticalSection(&fifo->mutex.write);

  00151	8b 55 08	 mov	 edx, DWORD PTR _fifo$[ebp]
  00154	83 c2 18	 add	 edx, 24			; 00000018H
  00157	52		 push	 edx
  00158	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__LeaveCriticalSection@4

; 338  : 
; 339  :     return result;

  0015e	8b 45 f0	 mov	 eax, DWORD PTR _result$[ebp]
$LN11@fifoWrite:

; 340  : }

  00161	8b e5		 mov	 esp, ebp
  00163	5d		 pop	 ebp
  00164	c3		 ret	 0
?fifoWrite@@YAHPAUFIFO@@PAUASYNC_DATA_HEADER@@PAE@Z ENDP ; fifoWrite
_TEXT	ENDS
PUBLIC	?fifoWritableSpace@@YAKPAUFIFO@@@Z		; fifoWritableSpace
; Function compile flags: /Odtp
;	COMDAT ?fifoWritableSpace@@YAKPAUFIFO@@@Z
_TEXT	SEGMENT
_fifo$ = 8						; size = 4
?fifoWritableSpace@@YAKPAUFIFO@@@Z PROC			; fifoWritableSpace, COMDAT

; 255  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	56		 push	 esi

; 256  :     if (!fifo)

  00004	83 7d 08 00	 cmp	 DWORD PTR _fifo$[ebp], 0
  00008	75 04		 jne	 SHORT $LN1@fifoWritab

; 257  :        return 0;

  0000a	33 c0		 xor	 eax, eax
  0000c	eb 19		 jmp	 SHORT $LN2@fifoWritab
$LN1@fifoWritab:

; 258  : 
; 259  :     return (fifo->size - 1) - fifoReadableSpace(fifo);

  0000e	8b 45 08	 mov	 eax, DWORD PTR _fifo$[ebp]
  00011	8b 70 38	 mov	 esi, DWORD PTR [eax+56]
  00014	83 ee 01	 sub	 esi, 1
  00017	8b 4d 08	 mov	 ecx, DWORD PTR _fifo$[ebp]
  0001a	51		 push	 ecx
  0001b	e8 00 00 00 00	 call	 ?fifoReadableSpace@@YAKPAUFIFO@@@Z ; fifoReadableSpace
  00020	83 c4 04	 add	 esp, 4
  00023	2b f0		 sub	 esi, eax
  00025	8b c6		 mov	 eax, esi
$LN2@fifoWritab:

; 260  : }

  00027	5e		 pop	 esi
  00028	5d		 pop	 ebp
  00029	c3		 ret	 0
?fifoWritableSpace@@YAKPAUFIFO@@@Z ENDP			; fifoWritableSpace
PUBLIC	?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z		; fileWrite
; Function compile flags: /Odtp
;	COMDAT ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z
_TEXT	SEGMENT
_header$ = -16						; size = 16
_file$ = 8						; size = 4
_data$ = 12						; size = 4
_size$ = 16						; size = 4
?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z PROC			; fileWrite, COMDAT

; 968  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 10	 sub	 esp, 16			; 00000010H

; 969  :     ASYNC_DATA_HEADER header;
; 970  : 
; 971  :     if (!file || file->async.f==INVALID_HANDLE_VALUE || !data || !size)

  00006	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  0000a	74 18		 je	 SHORT $LN4@fileWrite
  0000c	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000f	83 b8 30 01 00
	00 ff		 cmp	 DWORD PTR [eax+304], -1
  00016	74 0c		 je	 SHORT $LN4@fileWrite
  00018	83 7d 0c 00	 cmp	 DWORD PTR _data$[ebp], 0
  0001c	74 06		 je	 SHORT $LN4@fileWrite
  0001e	83 7d 10 00	 cmp	 DWORD PTR _size$[ebp], 0
  00022	75 07		 jne	 SHORT $LN5@fileWrite
$LN4@fileWrite:

; 972  :        return FALSE;

  00024	33 c0		 xor	 eax, eax
  00026	e9 bd 00 00 00	 jmp	 $LN6@fileWrite
$LN5@fileWrite:

; 973  : 
; 974  :     if (size + sizeof(ASYNC_DATA_HEADER) > ASYNC_MEM_LIMIT)

  0002b	8b 4d 10	 mov	 ecx, DWORD PTR _size$[ebp]
  0002e	83 c1 10	 add	 ecx, 16			; 00000010H
  00031	81 f9 00 00 c0
	00		 cmp	 ecx, 12582912		; 00c00000H
  00037	76 1a		 jbe	 SHORT $LN3@fileWrite

; 975  :     {
; 976  :         aviSetError(file, AVI_ERROR_ASYNC,
; 977  :                           _T("Tried to write a block of data that was larger than")
; 978  :                           _T("the entire FIFO buffer"));

  00039	68 00 00 00 00	 push	 OFFSET ??_C@_1JE@PEEANHBL@?$AAT?$AAr?$AAi?$AAe?$AAd?$AA?5?$AAt?$AAo?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?5?$AAa?$AA?5?$AAb?$AAl?$AAo?$AAc?$AAk?$AA?5?$AAo?$AAf?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAt@
  0003e	6a 03		 push	 3
  00040	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00043	52		 push	 edx
  00044	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  00049	83 c4 0c	 add	 esp, 12			; 0000000cH

; 979  :         return FALSE;

  0004c	33 c0		 xor	 eax, eax
  0004e	e9 95 00 00 00	 jmp	 $LN6@fileWrite
$LN3@fileWrite:

; 980  :     }
; 981  : 
; 982  :     /* Yes, keep trying to write data even if there's an error. Errors at this
; 983  :        point usually happen when the disk runs out of space so it's possible
; 984  :        that data will be written to parts of the file that are already on the
; 985  :        disk. If there is an error then make sure to always return FALSE. */
; 986  : 
; 987  :     header.offset = file->async.filePos;

  00053	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00056	8b 88 40 01 00
	00		 mov	 ecx, DWORD PTR [eax+320]
  0005c	89 4d f8	 mov	 DWORD PTR _header$[ebp+8], ecx
  0005f	8b 90 44 01 00
	00		 mov	 edx, DWORD PTR [eax+324]
  00065	89 55 fc	 mov	 DWORD PTR _header$[ebp+12], edx

; 988  :     header.size   = size;

  00068	8b 45 10	 mov	 eax, DWORD PTR _size$[ebp]
  0006b	89 45 f0	 mov	 DWORD PTR _header$[ebp], eax
$LN2@fileWrite:

; 989  : 
; 990  :     /* Try to write the data to the FIFO buffer. If that fails, wait until
; 991  :        enough space is available. */
; 992  :     while (!fifoWrite((FIFO*)file->async.fifo, &header, (BYTE*)data))

  0006e	8b 4d 0c	 mov	 ecx, DWORD PTR _data$[ebp]
  00071	51		 push	 ecx
  00072	8d 55 f0	 lea	 edx, DWORD PTR _header$[ebp]
  00075	52		 push	 edx
  00076	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00079	8b 88 34 01 00
	00		 mov	 ecx, DWORD PTR [eax+308]
  0007f	51		 push	 ecx
  00080	e8 00 00 00 00	 call	 ?fifoWrite@@YAHPAUFIFO@@PAUASYNC_DATA_HEADER@@PAE@Z ; fifoWrite
  00085	83 c4 0c	 add	 esp, 12			; 0000000cH
  00088	85 c0		 test	 eax, eax
  0008a	75 14		 jne	 SHORT $LN1@fileWrite

; 993  :     {
; 994  :         #ifdef AVI_DEBUG
; 995  :         cprintf(_T("Mem limit reached\n"));
; 996  :         #endif
; 997  : 
; 998  :         WaitForSingleObject(file->async.hWriteEvent, INFINITE);

  0008c	6a ff		 push	 -1
  0008e	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00091	8b 82 38 01 00
	00		 mov	 eax, DWORD PTR [edx+312]
  00097	50		 push	 eax
  00098	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__WaitForSingleObject@8

; 999  :     }

  0009e	eb ce		 jmp	 SHORT $LN2@fileWrite
$LN1@fileWrite:

; 1000 : 
; 1001 :     /* Move the file pointer forward */
; 1002 :     file->async.filePos += (int64)size;

  000a0	8b 4d 10	 mov	 ecx, DWORD PTR _size$[ebp]
  000a3	33 d2		 xor	 edx, edx
  000a5	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000a8	03 88 40 01 00
	00		 add	 ecx, DWORD PTR [eax+320]
  000ae	8b 80 44 01 00
	00		 mov	 eax, DWORD PTR [eax+324]
  000b4	13 c2		 adc	 eax, edx
  000b6	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000b9	89 8a 40 01 00
	00		 mov	 DWORD PTR [edx+320], ecx
  000bf	89 82 44 01 00
	00		 mov	 DWORD PTR [edx+324], eax

; 1003 : 
; 1004 :     /* Notify the thread of the new data */
; 1005 :     SetEvent(file->async.hThreadKick);

  000c5	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000c8	8b 88 3c 01 00
	00		 mov	 ecx, DWORD PTR [eax+316]
  000ce	51		 push	 ecx
  000cf	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__SetEvent@4

; 1006 : 
; 1007 :     return aviHasError(file) ? FALSE : TRUE;

  000d5	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000d8	52		 push	 edx
  000d9	e8 00 00 00 00	 call	 ?aviHasError@@YAHPAUAVI_FILE@@@Z ; aviHasError
  000de	83 c4 04	 add	 esp, 4
  000e1	f7 d8		 neg	 eax
  000e3	1b c0		 sbb	 eax, eax
  000e5	83 c0 01	 add	 eax, 1
$LN6@fileWrite:

; 1008 : }

  000e8	8b e5		 mov	 esp, ebp
  000ea	5d		 pop	 ebp
  000eb	c3		 ret	 0
?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ENDP			; fileWrite
_TEXT	ENDS
PUBLIC	?asyncThread@@YGKPAX@Z				; asyncThread
; Function compile flags: /Odtp
;	COMDAT ?asyncThread@@YGKPAX@Z
_TEXT	SEGMENT
tv95 = -32						; size = 4
_bExit$ = -28						; size = 4
_usedSpace$ = -24					; size = 4
_priority$ = -20					; size = 4
_file$ = -16						; size = 4
_setPriority$ = -12					; size = 4
_totalSpace$ = -8					; size = 4
_bFinishedWriting$ = -4					; size = 4
_vFile$ = 8						; size = 4
?asyncThread@@YGKPAX@Z PROC				; asyncThread, COMDAT

; 708  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 20	 sub	 esp, 32			; 00000020H

; 709  :     AVI_FILE* file = (AVI_FILE*)vFile;

  00006	8b 45 08	 mov	 eax, DWORD PTR _vFile$[ebp]
  00009	89 45 f0	 mov	 DWORD PTR _file$[ebp], eax

; 710  :     BOOL  bExit;
; 711  :     BOOL  bFinishedWriting;
; 712  :     int   priority;
; 713  :     int   setPriority;
; 714  :     DWORD totalSpace;
; 715  :     DWORD usedSpace;
; 716  : 
; 717  :     /* Make sure this thread is supposed to be running before doing anything */
; 718  :     if (WaitForSingleObject(file->async.hExit, 0)==WAIT_OBJECT_0)

  0000c	6a 00		 push	 0
  0000e	8b 4d f0	 mov	 ecx, DWORD PTR _file$[ebp]
  00011	8b 91 4c 01 00
	00		 mov	 edx, DWORD PTR [ecx+332]
  00017	52		 push	 edx
  00018	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__WaitForSingleObject@8
  0001e	85 c0		 test	 eax, eax
  00020	75 07		 jne	 SHORT $LN20@asyncThrea

; 719  :        return 0;

  00022	33 c0		 xor	 eax, eax
  00024	e9 6f 01 00 00	 jmp	 $LN21@asyncThrea
$LN20@asyncThrea:

; 720  : 
; 721  :     priority = GetThreadPriority(GetCurrentThread());

  00029	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__GetCurrentThread@0
  0002f	50		 push	 eax
  00030	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__GetThreadPriority@4
  00036	89 45 ec	 mov	 DWORD PTR _priority$[ebp], eax

; 722  :     if (priority==THREAD_PRIORITY_ERROR_RETURN)

  00039	81 7d ec ff ff
	ff 7f		 cmp	 DWORD PTR _priority$[ebp], 2147483647 ; 7fffffffH
  00040	75 07		 jne	 SHORT $LN19@asyncThrea

; 723  :        priority = THREAD_PRIORITY_NORMAL;

  00042	c7 45 ec 00 00
	00 00		 mov	 DWORD PTR _priority$[ebp], 0
$LN19@asyncThrea:

; 724  : 
; 725  :     setPriority = THREAD_PRIORITY_ERROR_RETURN;

  00049	c7 45 f4 ff ff
	ff 7f		 mov	 DWORD PTR _setPriority$[ebp], 2147483647 ; 7fffffffH

; 726  : 
; 727  :     totalSpace = fifoTotalSpace((FIFO*)file->async.fifo);

  00050	8b 45 f0	 mov	 eax, DWORD PTR _file$[ebp]
  00053	8b 88 34 01 00
	00		 mov	 ecx, DWORD PTR [eax+308]
  00059	51		 push	 ecx
  0005a	e8 00 00 00 00	 call	 ?fifoTotalSpace@@YAKPAUFIFO@@@Z ; fifoTotalSpace
  0005f	83 c4 04	 add	 esp, 4
  00062	89 45 f8	 mov	 DWORD PTR _totalSpace$[ebp], eax

; 728  : 
; 729  :     bExit            = FALSE;

  00065	c7 45 e4 00 00
	00 00		 mov	 DWORD PTR _bExit$[ebp], 0

; 730  :     bFinishedWriting = FALSE;

  0006c	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _bFinishedWriting$[ebp], 0
$LN18@asyncThrea:

; 731  :     while (!bExit || (bExit && !bFinishedWriting))

  00073	83 7d e4 00	 cmp	 DWORD PTR _bExit$[ebp], 0
  00077	74 14		 je	 SHORT $LN15@asyncThrea
  00079	83 7d e4 00	 cmp	 DWORD PTR _bExit$[ebp], 0
  0007d	0f 84 13 01 00
	00		 je	 $LN17@asyncThrea
  00083	83 7d fc 00	 cmp	 DWORD PTR _bFinishedWriting$[ebp], 0
  00087	0f 85 09 01 00
	00		 jne	 $LN17@asyncThrea
$LN15@asyncThrea:

; 732  :     {
; 733  :         /* Attempt to write any data that might be in the FIFO buffer */
; 734  :         while (fifoDumpBlock((FIFO*)file->async.fifo, file))

  0008d	8b 55 f0	 mov	 edx, DWORD PTR _file$[ebp]
  00090	52		 push	 edx
  00091	8b 45 f0	 mov	 eax, DWORD PTR _file$[ebp]
  00094	8b 88 34 01 00
	00		 mov	 ecx, DWORD PTR [eax+308]
  0009a	51		 push	 ecx
  0009b	e8 00 00 00 00	 call	 ?fifoDumpBlock@@YAHPAUFIFO@@PAUAVI_FILE@@@Z ; fifoDumpBlock
  000a0	83 c4 08	 add	 esp, 8
  000a3	85 c0		 test	 eax, eax
  000a5	0f 84 a8 00 00
	00		 je	 $LN14@asyncThrea

; 735  :         {
; 736  :             SetEvent(file->async.hWriteEvent);

  000ab	8b 55 f0	 mov	 edx, DWORD PTR _file$[ebp]
  000ae	8b 82 38 01 00
	00		 mov	 eax, DWORD PTR [edx+312]
  000b4	50		 push	 eax
  000b5	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__SetEvent@4

; 737  : 
; 738  :             if (!bExit)

  000bb	83 7d e4 00	 cmp	 DWORD PTR _bExit$[ebp], 0
  000bf	0f 85 89 00 00
	00		 jne	 $LN13@asyncThrea

; 739  :             {
; 740  :                 usedSpace = fifoReadableSpace((FIFO*)file->async.fifo);

  000c5	8b 4d f0	 mov	 ecx, DWORD PTR _file$[ebp]
  000c8	8b 91 34 01 00
	00		 mov	 edx, DWORD PTR [ecx+308]
  000ce	52		 push	 edx
  000cf	e8 00 00 00 00	 call	 ?fifoReadableSpace@@YAKPAUFIFO@@@Z ; fifoReadableSpace
  000d4	83 c4 04	 add	 esp, 4
  000d7	89 45 e8	 mov	 DWORD PTR _usedSpace$[ebp], eax

; 741  :                 switch (priority)

  000da	8b 45 ec	 mov	 eax, DWORD PTR _priority$[ebp]
  000dd	89 45 e0	 mov	 DWORD PTR tv95[ebp], eax
  000e0	83 7d e0 00	 cmp	 DWORD PTR tv95[ebp], 0
  000e4	74 08		 je	 SHORT $LN10@asyncThrea
  000e6	83 7d e0 01	 cmp	 DWORD PTR tv95[ebp], 1
  000ea	74 15		 je	 SHORT $LN8@asyncThrea
  000ec	eb 26		 jmp	 SHORT $LN6@asyncThrea
$LN10@asyncThrea:

; 742  :                 {
; 743  :                     case THREAD_PRIORITY_NORMAL:
; 744  :                         if (usedSpace >= totalSpace >> 1)

  000ee	8b 4d f8	 mov	 ecx, DWORD PTR _totalSpace$[ebp]
  000f1	d1 e9		 shr	 ecx, 1
  000f3	39 4d e8	 cmp	 DWORD PTR _usedSpace$[ebp], ecx
  000f6	72 07		 jb	 SHORT $LN9@asyncThrea

; 745  :                            setPriority = THREAD_PRIORITY_ABOVE_NORMAL;

  000f8	c7 45 f4 01 00
	00 00		 mov	 DWORD PTR _setPriority$[ebp], 1
$LN9@asyncThrea:

; 746  :                     break;

  000ff	eb 1a		 jmp	 SHORT $LN11@asyncThrea
$LN8@asyncThrea:

; 747  : 
; 748  :                     case THREAD_PRIORITY_ABOVE_NORMAL:
; 749  :                         if (usedSpace < totalSpace >> 1)

  00101	8b 55 f8	 mov	 edx, DWORD PTR _totalSpace$[ebp]
  00104	d1 ea		 shr	 edx, 1
  00106	39 55 e8	 cmp	 DWORD PTR _usedSpace$[ebp], edx
  00109	73 07		 jae	 SHORT $LN7@asyncThrea

; 750  :                            setPriority = THREAD_PRIORITY_NORMAL;

  0010b	c7 45 f4 00 00
	00 00		 mov	 DWORD PTR _setPriority$[ebp], 0
$LN7@asyncThrea:

; 751  :                     break;

  00112	eb 07		 jmp	 SHORT $LN11@asyncThrea
$LN6@asyncThrea:

; 752  : 
; 753  :                     default:
; 754  :                         setPriority = THREAD_PRIORITY_NORMAL;

  00114	c7 45 f4 00 00
	00 00		 mov	 DWORD PTR _setPriority$[ebp], 0
$LN11@asyncThrea:

; 755  :                     break;
; 756  :                 }
; 757  : 
; 758  :                 if (setPriority != THREAD_PRIORITY_ERROR_RETURN &&
; 759  :                     priority != setPriority)

  0011b	81 7d f4 ff ff
	ff 7f		 cmp	 DWORD PTR _setPriority$[ebp], 2147483647 ; 7fffffffH
  00122	74 2a		 je	 SHORT $LN13@asyncThrea
  00124	8b 45 ec	 mov	 eax, DWORD PTR _priority$[ebp]
  00127	3b 45 f4	 cmp	 eax, DWORD PTR _setPriority$[ebp]
  0012a	74 22		 je	 SHORT $LN13@asyncThrea

; 760  :                 {
; 761  :                     if (SetThreadPriority(GetCurrentThread(), setPriority))

  0012c	8b 4d f4	 mov	 ecx, DWORD PTR _setPriority$[ebp]
  0012f	51		 push	 ecx
  00130	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__GetCurrentThread@0
  00136	50		 push	 eax
  00137	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__SetThreadPriority@8
  0013d	85 c0		 test	 eax, eax
  0013f	74 0d		 je	 SHORT $LN13@asyncThrea

; 762  :                     {
; 763  :                         priority    = setPriority;

  00141	8b 55 f4	 mov	 edx, DWORD PTR _setPriority$[ebp]
  00144	89 55 ec	 mov	 DWORD PTR _priority$[ebp], edx

; 764  :                         setPriority = THREAD_PRIORITY_ERROR_RETURN;

  00147	c7 45 f4 ff ff
	ff 7f		 mov	 DWORD PTR _setPriority$[ebp], 2147483647 ; 7fffffffH
$LN13@asyncThrea:

; 765  :                     }
; 766  :                 }
; 767  :             }
; 768  :         }

  0014e	e9 3a ff ff ff	 jmp	 $LN15@asyncThrea
$LN14@asyncThrea:

; 769  : 
; 770  :         if (!bExit)

  00153	83 7d e4 00	 cmp	 DWORD PTR _bExit$[ebp], 0
  00157	75 31		 jne	 SHORT $LN3@asyncThrea

; 771  :         {
; 772  :             /* There's nothing to write so wait until something new arrives */
; 773  :             WaitForSingleObject(file->async.hThreadKick, INFINITE);

  00159	6a ff		 push	 -1
  0015b	8b 45 f0	 mov	 eax, DWORD PTR _file$[ebp]
  0015e	8b 88 3c 01 00
	00		 mov	 ecx, DWORD PTR [eax+316]
  00164	51		 push	 ecx
  00165	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__WaitForSingleObject@8

; 774  : 
; 775  :             /* Check the state of the exit event */
; 776  :             if (WaitForSingleObject(file->async.hExit, 0)==WAIT_OBJECT_0)

  0016b	6a 00		 push	 0
  0016d	8b 55 f0	 mov	 edx, DWORD PTR _file$[ebp]
  00170	8b 82 4c 01 00
	00		 mov	 eax, DWORD PTR [edx+332]
  00176	50		 push	 eax
  00177	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__WaitForSingleObject@8
  0017d	85 c0		 test	 eax, eax
  0017f	75 07		 jne	 SHORT $LN2@asyncThrea

; 777  :                bExit = TRUE;

  00181	c7 45 e4 01 00
	00 00		 mov	 DWORD PTR _bExit$[ebp], 1
$LN2@asyncThrea:

; 778  :         } else

  00188	eb 07		 jmp	 SHORT $LN1@asyncThrea
$LN3@asyncThrea:

; 779  :         {
; 780  :             /* The FIFO buffer should be empty now */
; 781  :             bFinishedWriting = TRUE;

  0018a	c7 45 fc 01 00
	00 00		 mov	 DWORD PTR _bFinishedWriting$[ebp], 1
$LN1@asyncThrea:

; 782  :         }
; 783  :     }

  00191	e9 dd fe ff ff	 jmp	 $LN18@asyncThrea
$LN17@asyncThrea:

; 784  : 
; 785  :     return 0;

  00196	33 c0		 xor	 eax, eax
$LN21@asyncThrea:

; 786  : }

  00198	8b e5		 mov	 esp, ebp
  0019a	5d		 pop	 ebp
  0019b	c2 04 00	 ret	 4
?asyncThread@@YGKPAX@Z ENDP				; asyncThread
_TEXT	ENDS
PUBLIC	?fileBuildIndex@@YAHPAUAVI_FILE@@@Z		; fileBuildIndex
; Function compile flags: /Odtp
;	COMDAT ?fileBuildIndex@@YAHPAUAVI_FILE@@@Z
_TEXT	SEGMENT
tv88 = -8						; size = 4
_result$ = -4						; size = 4
_file$ = 8						; size = 4
?fileBuildIndex@@YAHPAUAVI_FILE@@@Z PROC		; fileBuildIndex, COMDAT

; 647  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 08	 sub	 esp, 8

; 648  :     BOOL result;
; 649  : 
; 650  :     /* Don't do anything if the offset to the index chunk's data is invalid */
; 651  :     if (!file->legacy.indexOffset)

  00006	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00009	89 45 f8	 mov	 DWORD PTR tv88[ebp], eax
  0000c	8b 4d f8	 mov	 ecx, DWORD PTR tv88[ebp]
  0000f	8b 55 f8	 mov	 edx, DWORD PTR tv88[ebp]
  00012	8b 81 28 04 00
	00		 mov	 eax, DWORD PTR [ecx+1064]
  00018	0b 82 2c 04 00
	00		 or	 eax, DWORD PTR [edx+1068]
  0001e	75 07		 jne	 SHORT $LN7@fileBuildI

; 652  :        return FALSE;

  00020	33 c0		 xor	 eax, eax
  00022	e9 86 00 00 00	 jmp	 $LN8@fileBuildI
$LN7@fileBuildI:

; 653  : 
; 654  :     result = TRUE;

  00027	c7 45 fc 01 00
	00 00		 mov	 DWORD PTR _result$[ebp], 1

; 655  : 
; 656  :     /* Go to the beginning of the index chunk's data */
; 657  :     if (__seek(file, file->legacy.indexOffset))

  0002e	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00031	8b 91 2c 04 00
	00		 mov	 edx, DWORD PTR [ecx+1068]
  00037	52		 push	 edx
  00038	8b 81 28 04 00
	00		 mov	 eax, DWORD PTR [ecx+1064]
  0003e	50		 push	 eax
  0003f	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00042	51		 push	 ecx
  00043	e8 00 00 00 00	 call	 ?__seek@@YAHPAUAVI_FILE@@_J@Z ; __seek
  00048	83 c4 0c	 add	 esp, 12			; 0000000cH
  0004b	85 c0		 test	 eax, eax
  0004d	74 41		 je	 SHORT $LN6@fileBuildI

; 658  :     {
; 659  :         if (fileBuildStreamIndex(file, VIDEO_STREAM))

  0004f	6a 00		 push	 0
  00051	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00054	52		 push	 edx
  00055	e8 00 00 00 00	 call	 ?fileBuildStreamIndex@@YAHPAUAVI_FILE@@W4stream_t@@@Z ; fileBuildStreamIndex
  0005a	83 c4 08	 add	 esp, 8
  0005d	85 c0		 test	 eax, eax
  0005f	74 26		 je	 SHORT $LN5@fileBuildI

; 660  :         {
; 661  :             if (file->flags & AVI_FLAG_AUDIO)

  00061	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00064	0f b6 08	 movzx	 ecx, BYTE PTR [eax]
  00067	83 e1 02	 and	 ecx, 2
  0006a	74 19		 je	 SHORT $LN4@fileBuildI

; 662  :             {
; 663  :                 if (!fileBuildStreamIndex(file, AUDIO_STREAM))

  0006c	6a 01		 push	 1
  0006e	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00071	52		 push	 edx
  00072	e8 00 00 00 00	 call	 ?fileBuildStreamIndex@@YAHPAUAVI_FILE@@W4stream_t@@@Z ; fileBuildStreamIndex
  00077	83 c4 08	 add	 esp, 8
  0007a	85 c0		 test	 eax, eax
  0007c	75 07		 jne	 SHORT $LN4@fileBuildI

; 664  :                    result = FALSE;

  0007e	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _result$[ebp], 0
$LN4@fileBuildI:

; 665  :             }
; 666  :         } else

  00085	eb 07		 jmp	 SHORT $LN2@fileBuildI
$LN5@fileBuildI:

; 667  :           result = FALSE;

  00087	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _result$[ebp], 0
$LN2@fileBuildI:

; 668  :     } else

  0008e	eb 1a		 jmp	 SHORT $LN1@fileBuildI
$LN6@fileBuildI:

; 669  :     {
; 670  :         aviSetError(file, AVI_ERROR_BUILD_INDEX, _T("Seek to index chunk failed"));

  00090	68 00 00 00 00	 push	 OFFSET ??_C@_1DG@FEEGDAEE@?$AAS?$AAe?$AAe?$AAk?$AA?5?$AAt?$AAo?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?5?$AAc?$AAh?$AAu?$AAn?$AAk?$AA?5?$AAf?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?$AA@
  00095	6a 08		 push	 8
  00097	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0009a	50		 push	 eax
  0009b	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  000a0	83 c4 0c	 add	 esp, 12			; 0000000cH

; 671  :         result = FALSE;

  000a3	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _result$[ebp], 0
$LN1@fileBuildI:

; 672  :     }
; 673  : 
; 674  :     return result;

  000aa	8b 45 fc	 mov	 eax, DWORD PTR _result$[ebp]
$LN8@fileBuildI:

; 675  : }

  000ad	8b e5		 mov	 esp, ebp
  000af	5d		 pop	 ebp
  000b0	c3		 ret	 0
?fileBuildIndex@@YAHPAUAVI_FILE@@@Z ENDP		; fileBuildIndex
PUBLIC	__$ArrayPad$
PUBLIC	?fileReserveSpace@@YAHPAUAVI_FILE@@K@Z		; fileReserveSpace
; Function compile flags: /Odtp
;	COMDAT ?fileReserveSpace@@YAHPAUAVI_FILE@@K@Z
_TEXT	SEGMENT
_block$ = -264						; size = 256
__$ArrayPad$ = -4					; size = 4
_file$ = 8						; size = 4
_size$ = 12						; size = 4
?fileReserveSpace@@YAHPAUAVI_FILE@@K@Z PROC		; fileReserveSpace, COMDAT

; 1017 : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	81 ec 08 01 00
	00		 sub	 esp, 264		; 00000108H
  00009	a1 00 00 00 00	 mov	 eax, DWORD PTR ___security_cookie
  0000e	33 c5		 xor	 eax, ebp
  00010	89 45 fc	 mov	 DWORD PTR __$ArrayPad$[ebp], eax

; 1018 :     #define R_BLOCK_SIZE 256
; 1019 :     BYTE block[R_BLOCK_SIZE];
; 1020 : 
; 1021 :     memset(block, 0, R_BLOCK_SIZE);

  00013	68 00 01 00 00	 push	 256			; 00000100H
  00018	6a 00		 push	 0
  0001a	8d 85 f8 fe ff
	ff		 lea	 eax, DWORD PTR _block$[ebp]
  00020	50		 push	 eax
  00021	e8 00 00 00 00	 call	 _memset
  00026	83 c4 0c	 add	 esp, 12			; 0000000cH
$LN6@fileReserv:

; 1022 :     while (size > 0)

  00029	83 7d 0c 00	 cmp	 DWORD PTR _size$[ebp], 0
  0002d	76 5e		 jbe	 SHORT $LN5@fileReserv

; 1023 :     {
; 1024 :         if (size >= R_BLOCK_SIZE)

  0002f	81 7d 0c 00 01
	00 00		 cmp	 DWORD PTR _size$[ebp], 256 ; 00000100H
  00036	72 2d		 jb	 SHORT $LN4@fileReserv

; 1025 :         {
; 1026 :             if (!fileWrite(file, block, R_BLOCK_SIZE))

  00038	68 00 01 00 00	 push	 256			; 00000100H
  0003d	8d 8d f8 fe ff
	ff		 lea	 ecx, DWORD PTR _block$[ebp]
  00043	51		 push	 ecx
  00044	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00047	52		 push	 edx
  00048	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  0004d	83 c4 0c	 add	 esp, 12			; 0000000cH
  00050	85 c0		 test	 eax, eax
  00052	75 04		 jne	 SHORT $LN3@fileReserv

; 1027 :                return FALSE;

  00054	33 c0		 xor	 eax, eax
  00056	eb 3a		 jmp	 SHORT $LN7@fileReserv
$LN3@fileReserv:

; 1028 : 
; 1029 :             size -= R_BLOCK_SIZE;

  00058	8b 45 0c	 mov	 eax, DWORD PTR _size$[ebp]
  0005b	2d 00 01 00 00	 sub	 eax, 256		; 00000100H
  00060	89 45 0c	 mov	 DWORD PTR _size$[ebp], eax

; 1030 :         } else

  00063	eb 26		 jmp	 SHORT $LN2@fileReserv
$LN4@fileReserv:

; 1031 :         {
; 1032 :             if (!fileWrite(file, block, size))

  00065	8b 4d 0c	 mov	 ecx, DWORD PTR _size$[ebp]
  00068	51		 push	 ecx
  00069	8d 95 f8 fe ff
	ff		 lea	 edx, DWORD PTR _block$[ebp]
  0006f	52		 push	 edx
  00070	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00073	50		 push	 eax
  00074	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00079	83 c4 0c	 add	 esp, 12			; 0000000cH
  0007c	85 c0		 test	 eax, eax
  0007e	75 04		 jne	 SHORT $LN1@fileReserv

; 1033 :                return FALSE;

  00080	33 c0		 xor	 eax, eax
  00082	eb 0e		 jmp	 SHORT $LN7@fileReserv
$LN1@fileReserv:

; 1034 : 
; 1035 :             size = 0;

  00084	c7 45 0c 00 00
	00 00		 mov	 DWORD PTR _size$[ebp], 0
$LN2@fileReserv:

; 1036 :         }
; 1037 :     }

  0008b	eb 9c		 jmp	 SHORT $LN6@fileReserv
$LN5@fileReserv:

; 1038 : 
; 1039 :     return TRUE;

  0008d	b8 01 00 00 00	 mov	 eax, 1
$LN7@fileReserv:

; 1040 : }

  00092	8b 4d fc	 mov	 ecx, DWORD PTR __$ArrayPad$[ebp]
  00095	33 cd		 xor	 ecx, ebp
  00097	e8 00 00 00 00	 call	 @__security_check_cookie@4
  0009c	8b e5		 mov	 esp, ebp
  0009e	5d		 pop	 ebp
  0009f	c3		 ret	 0
?fileReserveSpace@@YAHPAUAVI_FILE@@K@Z ENDP		; fileReserveSpace
_TEXT	ENDS
PUBLIC	?fileClose@@YAXPAUAVI_FILE@@@Z			; fileClose
; Function compile flags: /Odtp
;	COMDAT ?fileClose@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?fileClose@@YAXPAUAVI_FILE@@@Z PROC			; fileClose, COMDAT

; 870  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 871  :     if (file->async.hThread)

  00003	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00006	83 b8 48 01 00
	00 00		 cmp	 DWORD PTR [eax+328], 0
  0000d	74 5f		 je	 SHORT $LN6@fileClose

; 872  :     {
; 873  :         SetEvent(file->async.hExit);

  0000f	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00012	8b 91 4c 01 00
	00		 mov	 edx, DWORD PTR [ecx+332]
  00018	52		 push	 edx
  00019	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__SetEvent@4

; 874  : 
; 875  :         /* The thread might be suspended if the file is being closed because of
; 876  :            an error */
; 877  :         ResumeThread(file->async.hThread);

  0001f	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00022	8b 88 48 01 00
	00		 mov	 ecx, DWORD PTR [eax+328]
  00028	51		 push	 ecx
  00029	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__ResumeThread@4

; 878  : 
; 879  :         /* Wake up the thread and wait for it to finish */
; 880  :         SetEvent(file->async.hThreadKick);

  0002f	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00032	8b 82 3c 01 00
	00		 mov	 eax, DWORD PTR [edx+316]
  00038	50		 push	 eax
  00039	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__SetEvent@4

; 881  :         WaitForSingleObject(file->async.hThread, INFINITE);

  0003f	6a ff		 push	 -1
  00041	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00044	8b 91 48 01 00
	00		 mov	 edx, DWORD PTR [ecx+328]
  0004a	52		 push	 edx
  0004b	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__WaitForSingleObject@8

; 882  :         CloseHandle(file->async.hThread);

  00051	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00054	8b 88 48 01 00
	00		 mov	 ecx, DWORD PTR [eax+328]
  0005a	51		 push	 ecx
  0005b	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__CloseHandle@4

; 883  : 
; 884  :         file->async.hThread = NULL;

  00061	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00064	c7 82 48 01 00
	00 00 00 00 00	 mov	 DWORD PTR [edx+328], 0
$LN6@fileClose:

; 885  :     }
; 886  : 
; 887  :     if (file->async.f != INVALID_HANDLE_VALUE)

  0006e	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00071	83 b8 30 01 00
	00 ff		 cmp	 DWORD PTR [eax+304], -1
  00078	74 29		 je	 SHORT $LN5@fileClose

; 888  :     {
; 889  :         fileBuildIndex(file);

  0007a	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0007d	51		 push	 ecx
  0007e	e8 00 00 00 00	 call	 ?fileBuildIndex@@YAHPAUAVI_FILE@@@Z ; fileBuildIndex
  00083	83 c4 04	 add	 esp, 4

; 890  : 
; 891  :         CloseHandle(file->async.f);

  00086	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00089	8b 82 30 01 00
	00		 mov	 eax, DWORD PTR [edx+304]
  0008f	50		 push	 eax
  00090	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__CloseHandle@4

; 892  :         file->async.f = INVALID_HANDLE_VALUE;

  00096	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00099	c7 81 30 01 00
	00 ff ff ff ff	 mov	 DWORD PTR [ecx+304], -1
$LN5@fileClose:

; 893  :     }
; 894  : 
; 895  :     #ifdef AVI_DEBUG
; 896  :     if (file->async.fifo && fifoReadableSpace(file->async.fifo))
; 897  :        cprintf(_T("Warning - The FIFO buffer isn't empty!\n"));
; 898  :     #endif
; 899  : 
; 900  :     if (file->async.hWriteEvent)

  000a3	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000a6	83 ba 38 01 00
	00 00		 cmp	 DWORD PTR [edx+312], 0
  000ad	74 1d		 je	 SHORT $LN4@fileClose

; 901  :     {
; 902  :         CloseHandle(file->async.hWriteEvent);

  000af	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000b2	8b 88 38 01 00
	00		 mov	 ecx, DWORD PTR [eax+312]
  000b8	51		 push	 ecx
  000b9	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__CloseHandle@4

; 903  :         file->async.hWriteEvent = NULL;

  000bf	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000c2	c7 82 38 01 00
	00 00 00 00 00	 mov	 DWORD PTR [edx+312], 0
$LN4@fileClose:

; 904  :     }
; 905  : 
; 906  :     if (file->async.hThreadKick)

  000cc	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000cf	83 b8 3c 01 00
	00 00		 cmp	 DWORD PTR [eax+316], 0
  000d6	74 1d		 je	 SHORT $LN3@fileClose

; 907  :     {
; 908  :         CloseHandle(file->async.hThreadKick);

  000d8	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000db	8b 91 3c 01 00
	00		 mov	 edx, DWORD PTR [ecx+316]
  000e1	52		 push	 edx
  000e2	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__CloseHandle@4

; 909  :         file->async.hThreadKick = NULL;

  000e8	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000eb	c7 80 3c 01 00
	00 00 00 00 00	 mov	 DWORD PTR [eax+316], 0
$LN3@fileClose:

; 910  :     }
; 911  : 
; 912  :     if (file->async.hExit)

  000f5	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000f8	83 b9 4c 01 00
	00 00		 cmp	 DWORD PTR [ecx+332], 0
  000ff	74 1d		 je	 SHORT $LN2@fileClose

; 913  :     {
; 914  :         CloseHandle(file->async.hExit);

  00101	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00104	8b 82 4c 01 00
	00		 mov	 eax, DWORD PTR [edx+332]
  0010a	50		 push	 eax
  0010b	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__CloseHandle@4

; 915  :         file->async.hExit = NULL;

  00111	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00114	c7 81 4c 01 00
	00 00 00 00 00	 mov	 DWORD PTR [ecx+332], 0
$LN2@fileClose:

; 916  :     }
; 917  : 
; 918  :     if (file->async.fifo)

  0011e	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00121	83 ba 34 01 00
	00 00		 cmp	 DWORD PTR [edx+308], 0
  00128	74 1f		 je	 SHORT $LN7@fileClose

; 919  :     {
; 920  :         fifoDestroy((FIFO*)file->async.fifo);

  0012a	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0012d	8b 88 34 01 00
	00		 mov	 ecx, DWORD PTR [eax+308]
  00133	51		 push	 ecx
  00134	e8 00 00 00 00	 call	 ?fifoDestroy@@YAXPAUFIFO@@@Z ; fifoDestroy
  00139	83 c4 04	 add	 esp, 4

; 921  :         file->async.fifo = NULL;

  0013c	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0013f	c7 82 34 01 00
	00 00 00 00 00	 mov	 DWORD PTR [edx+308], 0
$LN7@fileClose:

; 922  :     }
; 923  : }

  00149	5d		 pop	 ebp
  0014a	c3		 ret	 0
?fileClose@@YAXPAUAVI_FILE@@@Z ENDP			; fileClose
_TEXT	ENDS
PUBLIC	?fileOpen@@YAHPAUAVI_FILE@@PA_W@Z		; fileOpen
; Function compile flags: /Odtp
;	COMDAT ?fileOpen@@YAHPAUAVI_FILE@@PA_W@Z
_TEXT	SEGMENT
_temp$ = -4						; size = 4
_file$ = 8						; size = 4
_fileName$ = 12						; size = 4
?fileOpen@@YAHPAUAVI_FILE@@PA_W@Z PROC			; fileOpen, COMDAT

; 799  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx

; 800  :     DWORD temp;
; 801  : 
; 802  :     if (file->async.f != INVALID_HANDLE_VALUE)

  00004	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00007	83 b8 30 01 00
	00 ff		 cmp	 DWORD PTR [eax+304], -1
  0000e	74 0a		 je	 SHORT $LN7@fileOpen

; 803  :        return TRUE;

  00010	b8 01 00 00 00	 mov	 eax, 1
  00015	e9 eb 01 00 00	 jmp	 $LN8@fileOpen
$LN7@fileOpen:

; 804  : 
; 805  :     file->async.fifo = fifoCreate(ASYNC_MEM_LIMIT);

  0001a	68 00 00 c0 00	 push	 12582912		; 00c00000H
  0001f	e8 00 00 00 00	 call	 ?fifoCreate@@YAPAUFIFO@@K@Z ; fifoCreate
  00024	83 c4 04	 add	 esp, 4
  00027	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0002a	89 81 34 01 00
	00		 mov	 DWORD PTR [ecx+308], eax

; 806  :     if (!file->async.fifo)

  00030	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00033	83 ba 34 01 00
	00 00		 cmp	 DWORD PTR [edx+308], 0
  0003a	75 1a		 jne	 SHORT $LN6@fileOpen

; 807  :     {
; 808  :         aviSetError(file, AVI_ERROR_FILE_OPEN, _T("Out of memory"));

  0003c	68 00 00 00 00	 push	 OFFSET ??_C@_1BM@CKLAAKNF@?$AAO?$AAu?$AAt?$AA?5?$AAo?$AAf?$AA?5?$AAm?$AAe?$AAm?$AAo?$AAr?$AAy?$AA?$AA@
  00041	6a 02		 push	 2
  00043	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00046	50		 push	 eax
  00047	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  0004c	83 c4 0c	 add	 esp, 12			; 0000000cH

; 809  :         return FALSE;

  0004f	33 c0		 xor	 eax, eax
  00051	e9 af 01 00 00	 jmp	 $LN8@fileOpen
$LN6@fileOpen:

; 810  :     }
; 811  : 
; 812  :     file->async.hWriteEvent = CreateEvent(NULL, FALSE, FALSE, NULL);

  00056	6a 00		 push	 0
  00058	6a 00		 push	 0
  0005a	6a 00		 push	 0
  0005c	6a 00		 push	 0
  0005e	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__CreateEventW@16
  00064	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00067	89 81 38 01 00
	00		 mov	 DWORD PTR [ecx+312], eax

; 813  :     if (!file->async.hWriteEvent)

  0006d	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00070	83 ba 38 01 00
	00 00		 cmp	 DWORD PTR [edx+312], 0
  00077	75 26		 jne	 SHORT $LN5@fileOpen

; 814  :     {
; 815  :         fileClose(file);

  00079	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0007c	50		 push	 eax
  0007d	e8 00 00 00 00	 call	 ?fileClose@@YAXPAUAVI_FILE@@@Z ; fileClose
  00082	83 c4 04	 add	 esp, 4

; 816  :         aviSetError(file, AVI_ERROR_FILE_OPEN, _T("Could not create an event"));

  00085	68 00 00 00 00	 push	 OFFSET ??_C@_1DE@BACJFJHG@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAc?$AAr?$AAe?$AAa?$AAt?$AAe?$AA?5?$AAa?$AAn?$AA?5?$AAe?$AAv?$AAe?$AAn?$AAt?$AA?$AA@
  0008a	6a 02		 push	 2
  0008c	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0008f	51		 push	 ecx
  00090	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  00095	83 c4 0c	 add	 esp, 12			; 0000000cH

; 817  :         return FALSE;

  00098	33 c0		 xor	 eax, eax
  0009a	e9 66 01 00 00	 jmp	 $LN8@fileOpen
$LN5@fileOpen:

; 818  :     }
; 819  : 
; 820  :     file->async.hThreadKick = CreateEvent(NULL, FALSE, FALSE, NULL);

  0009f	6a 00		 push	 0
  000a1	6a 00		 push	 0
  000a3	6a 00		 push	 0
  000a5	6a 00		 push	 0
  000a7	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__CreateEventW@16
  000ad	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000b0	89 82 3c 01 00
	00		 mov	 DWORD PTR [edx+316], eax

; 821  :     if (!file->async.hThreadKick)

  000b6	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000b9	83 b8 3c 01 00
	00 00		 cmp	 DWORD PTR [eax+316], 0
  000c0	75 26		 jne	 SHORT $LN4@fileOpen

; 822  :     {
; 823  :         fileClose(file);

  000c2	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000c5	51		 push	 ecx
  000c6	e8 00 00 00 00	 call	 ?fileClose@@YAXPAUAVI_FILE@@@Z ; fileClose
  000cb	83 c4 04	 add	 esp, 4

; 824  :         aviSetError(file, AVI_ERROR_FILE_OPEN, _T("Could not create an event"));

  000ce	68 00 00 00 00	 push	 OFFSET ??_C@_1DE@BACJFJHG@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAc?$AAr?$AAe?$AAa?$AAt?$AAe?$AA?5?$AAa?$AAn?$AA?5?$AAe?$AAv?$AAe?$AAn?$AAt?$AA?$AA@
  000d3	6a 02		 push	 2
  000d5	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000d8	52		 push	 edx
  000d9	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  000de	83 c4 0c	 add	 esp, 12			; 0000000cH

; 825  :         return FALSE;

  000e1	33 c0		 xor	 eax, eax
  000e3	e9 1d 01 00 00	 jmp	 $LN8@fileOpen
$LN4@fileOpen:

; 826  :     }
; 827  : 
; 828  :     file->async.hExit = CreateEvent(NULL, TRUE, FALSE, NULL);

  000e8	6a 00		 push	 0
  000ea	6a 00		 push	 0
  000ec	6a 01		 push	 1
  000ee	6a 00		 push	 0
  000f0	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__CreateEventW@16
  000f6	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000f9	89 81 4c 01 00
	00		 mov	 DWORD PTR [ecx+332], eax

; 829  :     if (!file->async.hExit)

  000ff	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00102	83 ba 4c 01 00
	00 00		 cmp	 DWORD PTR [edx+332], 0
  00109	75 26		 jne	 SHORT $LN3@fileOpen

; 830  :     {
; 831  :         fileClose(file);

  0010b	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0010e	50		 push	 eax
  0010f	e8 00 00 00 00	 call	 ?fileClose@@YAXPAUAVI_FILE@@@Z ; fileClose
  00114	83 c4 04	 add	 esp, 4

; 832  :         aviSetError(file, AVI_ERROR_FILE_OPEN, _T("Could not create an event"));

  00117	68 00 00 00 00	 push	 OFFSET ??_C@_1DE@BACJFJHG@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAc?$AAr?$AAe?$AAa?$AAt?$AAe?$AA?5?$AAa?$AAn?$AA?5?$AAe?$AAv?$AAe?$AAn?$AAt?$AA?$AA@
  0011c	6a 02		 push	 2
  0011e	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00121	51		 push	 ecx
  00122	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  00127	83 c4 0c	 add	 esp, 12			; 0000000cH

; 833  :         return FALSE;

  0012a	33 c0		 xor	 eax, eax
  0012c	e9 d4 00 00 00	 jmp	 $LN8@fileOpen
$LN3@fileOpen:

; 834  :     }
; 835  : 
; 836  :     /* Create the async thread but make sure it doesn't run until the file is
; 837  :        opened and the lock is initialized */
; 838  :     file->async.hThread = CreateThread(NULL, 0, asyncThread,
; 839  :                                        (LPVOID)file, CREATE_SUSPENDED,
; 840  :                                        &temp);

  00131	8d 55 fc	 lea	 edx, DWORD PTR _temp$[ebp]
  00134	52		 push	 edx
  00135	6a 04		 push	 4
  00137	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0013a	50		 push	 eax
  0013b	68 00 00 00 00	 push	 OFFSET ?asyncThread@@YGKPAX@Z ; asyncThread
  00140	6a 00		 push	 0
  00142	6a 00		 push	 0
  00144	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__CreateThread@24
  0014a	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0014d	89 81 48 01 00
	00		 mov	 DWORD PTR [ecx+328], eax

; 841  :     if (!file->async.hThread)

  00153	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00156	83 ba 48 01 00
	00 00		 cmp	 DWORD PTR [edx+328], 0
  0015d	75 26		 jne	 SHORT $LN2@fileOpen

; 842  :     {
; 843  :         fileClose(file);

  0015f	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00162	50		 push	 eax
  00163	e8 00 00 00 00	 call	 ?fileClose@@YAXPAUAVI_FILE@@@Z ; fileClose
  00168	83 c4 04	 add	 esp, 4

; 844  :         aviSetError(file, AVI_ERROR_FILE_OPEN,
; 845  :                           _T("Failed to create the writing thread"));

  0016b	68 00 00 00 00	 push	 OFFSET ??_C@_1EI@KICJBJIH@?$AAF?$AAa?$AAi?$AAl?$AAe?$AAd?$AA?5?$AAt?$AAo?$AA?5?$AAc?$AAr?$AAe?$AAa?$AAt?$AAe?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAr@
  00170	6a 02		 push	 2
  00172	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00175	51		 push	 ecx
  00176	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  0017b	83 c4 0c	 add	 esp, 12			; 0000000cH

; 846  :         return FALSE;

  0017e	33 c0		 xor	 eax, eax
  00180	e9 80 00 00 00	 jmp	 $LN8@fileOpen
$LN2@fileOpen:

; 847  :     }
; 848  : 
; 849  :     file->async.f = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE, 0, NULL,
; 850  :                                CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);

  00185	6a 00		 push	 0
  00187	68 80 00 00 00	 push	 128			; 00000080H
  0018c	6a 01		 push	 1
  0018e	6a 00		 push	 0
  00190	6a 00		 push	 0
  00192	68 00 00 00 c0	 push	 -1073741824		; c0000000H
  00197	8b 55 0c	 mov	 edx, DWORD PTR _fileName$[ebp]
  0019a	52		 push	 edx
  0019b	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__CreateFileW@28
  001a1	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  001a4	89 81 30 01 00
	00		 mov	 DWORD PTR [ecx+304], eax

; 851  :     if (file->async.f==INVALID_HANDLE_VALUE)

  001aa	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  001ad	83 ba 30 01 00
	00 ff		 cmp	 DWORD PTR [edx+304], -1
  001b4	75 23		 jne	 SHORT $LN1@fileOpen

; 852  :     {
; 853  :         fileClose(file);

  001b6	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  001b9	50		 push	 eax
  001ba	e8 00 00 00 00	 call	 ?fileClose@@YAXPAUAVI_FILE@@@Z ; fileClose
  001bf	83 c4 04	 add	 esp, 4

; 854  :         aviSetError(file, AVI_ERROR_FILE_OPEN,
; 855  :                           _T("Could not open the file for writing. An invalid ")
; 856  :                           _T("path might have been used."));

  001c2	68 00 00 00 00	 push	 OFFSET ??_C@_1JG@NBLJNJKF@?$AAC?$AAo?$AAu?$AAl?$AAd?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAo?$AAp?$AAe?$AAn?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AAw?$AAr?$AAi?$AAt@
  001c7	6a 02		 push	 2
  001c9	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  001cc	51		 push	 ecx
  001cd	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  001d2	83 c4 0c	 add	 esp, 12			; 0000000cH

; 857  :         return FALSE;

  001d5	33 c0		 xor	 eax, eax
  001d7	eb 2c		 jmp	 SHORT $LN8@fileOpen
$LN1@fileOpen:

; 858  :     }
; 859  : 
; 860  :     /* Reset the position in the file */
; 861  :     file->async.filePos = 0;

  001d9	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  001dc	c7 82 40 01 00
	00 00 00 00 00	 mov	 DWORD PTR [edx+320], 0
  001e6	c7 82 44 01 00
	00 00 00 00 00	 mov	 DWORD PTR [edx+324], 0

; 862  : 
; 863  :     ResumeThread(file->async.hThread);

  001f0	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  001f3	8b 88 48 01 00
	00		 mov	 ecx, DWORD PTR [eax+328]
  001f9	51		 push	 ecx
  001fa	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__ResumeThread@4

; 864  : 
; 865  :     return TRUE;

  00200	b8 01 00 00 00	 mov	 eax, 1
$LN8@fileOpen:

; 866  : }

  00205	8b e5		 mov	 esp, ebp
  00207	5d		 pop	 ebp
  00208	c3		 ret	 0
?fileOpen@@YAHPAUAVI_FILE@@PA_W@Z ENDP			; fileOpen
_TEXT	ENDS
PUBLIC	?fileReserveLegacyIndex@@YAXPAUAVI_FILE@@@Z	; fileReserveLegacyIndex
; Function compile flags: /Odtp
;	COMDAT ?fileReserveLegacyIndex@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?fileReserveLegacyIndex@@YAXPAUAVI_FILE@@@Z PROC	; fileReserveLegacyIndex, COMDAT

; 685  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp

; 686  :     aviBeginChunk(file, IDX1_CHUNK);

  00003	68 69 64 78 31	 push	 829973609		; 31786469H
  00008	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000b	50		 push	 eax
  0000c	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  00011	83 c4 08	 add	 esp, 8

; 687  : 
; 688  :     file->legacy.indexOffset = fileTell(file);

  00014	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00017	51		 push	 ecx
  00018	e8 00 00 00 00	 call	 ?fileTell@@YA_JPAUAVI_FILE@@@Z ; fileTell
  0001d	83 c4 04	 add	 esp, 4
  00020	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00023	89 81 28 04 00
	00		 mov	 DWORD PTR [ecx+1064], eax
  00029	89 91 2c 04 00
	00		 mov	 DWORD PTR [ecx+1068], edx

; 689  :     if (!fileReserveSpace(file, (file->legacy.indices[VIDEO_STREAM] +
; 690  :                                  file->legacy.indices[AUDIO_STREAM]) *
; 691  :                                 sizeof(AVIINDEXENTRY)))

  0002f	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00032	8b 82 34 04 00
	00		 mov	 eax, DWORD PTR [edx+1076]
  00038	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0003b	03 81 38 04 00
	00		 add	 eax, DWORD PTR [ecx+1080]
  00041	c1 e0 04	 shl	 eax, 4
  00044	50		 push	 eax
  00045	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00048	52		 push	 edx
  00049	e8 00 00 00 00	 call	 ?fileReserveSpace@@YAHPAUAVI_FILE@@K@Z ; fileReserveSpace
  0004e	83 c4 08	 add	 esp, 8
  00051	85 c0		 test	 eax, eax
  00053	75 17		 jne	 SHORT $LN1@fileReserv@2

; 692  :        file->legacy.indexOffset = 0;

  00055	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00058	c7 80 28 04 00
	00 00 00 00 00	 mov	 DWORD PTR [eax+1064], 0
  00062	c7 80 2c 04 00
	00 00 00 00 00	 mov	 DWORD PTR [eax+1068], 0
$LN1@fileReserv@2:

; 693  : 
; 694  :     aviEndChunk(file);

  0006c	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0006f	51		 push	 ecx
  00070	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  00075	83 c4 04	 add	 esp, 4

; 695  : }

  00078	5d		 pop	 ebp
  00079	c3		 ret	 0
?fileReserveLegacyIndex@@YAXPAUAVI_FILE@@@Z ENDP	; fileReserveLegacyIndex
END
