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

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

INCLUDELIB OLDNAMES

PUBLIC	??_C@_1DE@EBPEOCFM@?$AAb?$AAu?$AAi?$AAl?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAl?$AAe?$AAg?$AAa?$AAc?$AAy?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?$AA@ ; `string'
PUBLIC	??_C@_1EE@KNKKNNAE@?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAv?$AAi?$AAd?$AAe?$AAo?$AA?5?$AAc?$AAo?$AAm?$AAp?$AAr?$AAe?$AAs?$AAs?$AAo@ ; `string'
PUBLIC	??_C@_1DO@HFKGBECC@?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAw?$AAa?$AAv?$AAe?$AAI?$AAn?$AA?5?$AAd?$AAe?$AAv?$AAi?$AAc?$AAe?$AA?$AA@ ; `string'
PUBLIC	??_C@_1DK@KOAJMLIF@?$AAr?$AAe?$AAa?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAf?$AAr?$AAo?$AAm?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAF?$AAI?$AAF?$AAO?$AA?5?$AAb?$AAu?$AAf?$AAf?$AAe?$AAr?$AA?$AA@ ; `string'
PUBLIC	??_C@_1DG@MBOHGMHK@?$AAi?$AAn?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAr?$AAe?$AAa?$AAd?$AA?$AA@ ; `string'
PUBLIC	??_C@_1DG@NKBHIMDK@?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAt?$AAo?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAb?$AAu?$AAf?$AAf?$AAe?$AAr?$AA?$AA@ ; `string'
PUBLIC	??_C@_1CC@NAMKJAIK@?$AAo?$AAp?$AAe?$AAn?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?$AA@ ; `string'
PUBLIC	??_C@_1CO@DLGENJPH@?$AAg?$AAe?$AAt?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAr?$AAe?$AAa?$AAd?$AAy?$AA?5?$AAt?$AAo?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?$AA@ ; `string'
PUBLIC	??_C@_1CO@OAILNABH@?$AAi?$AAn?$AA?5?$AAa?$AAn?$AA?5?$AAu?$AAn?$AAk?$AAn?$AAo?$AAw?$AAn?$AA?5?$AAl?$AAo?$AAc?$AAa?$AAt?$AAi?$AAo?$AAn?$AA?$AA@ ; `string'
PUBLIC	?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@II@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append
PUBLIC	?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append
PUBLIC	?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_W@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append
PUBLIC	??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::operator+=
PUBLIC	?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::c_str
PUBLIC	?aviSetBaseOffset@@YAXPAUAVI_FILE@@H@Z		; aviSetBaseOffset
PUBLIC	?aviErrorLocations@@3PAPB_WA			; aviErrorLocations
PUBLIC	??_C@_1DC@BCHABBLK@?$AAA?$AAn?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?5?$AAo?$AAc?$AAc?$AAu?$AAr?$AAr?$AAe?$AAd?$AA?5?$AAw?$AAh?$AAi?$AAl?$AAe?$AA?5?$AA?$AA@ ; `string'
PUBLIC	??_C@_1CA@NBDIHIHD@?$AAR?$AAe?$AAc?$AAo?$AAr?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAE?$AAr?$AAr?$AAo?$AAr?$AA?$AA@ ; `string'
PUBLIC	??_C@_15IEGBJKPD@?$AA?3?$AA?6?$AA?$AA@		; `string'
PUBLIC	??_C@_1BM@MPJJHMIB@?$AAU?$AAn?$AAk?$AAn?$AAo?$AAw?$AAn?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@ ; `string'
PUBLIC	??_C@_1BK@MGMFAEKH@?$AAk?$AAe?$AAr?$AAn?$AAe?$AAl?$AA3?$AA2?$AA?4?$AAd?$AAl?$AAl?$AA?$AA@ ; `string'
PUBLIC	??_C@_0BB@GDGABGCO@SetFilePointerEx?$AA@	; `string'
PUBLIC	??_C@_1BC@NFCHMNPG@?$AAN?$AAo?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@ ; `string'
PUBLIC	??_C@_1EG@PLJILMFD@?$AAC?$AAo?$AAu?$AAl?$AAd?$AAn?$AA?8?$AAt?$AA?5?$AAg?$AAe?$AAt?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAt?$AAi?$AAm?$AAe?$AAr?$AA?8?$AAs?$AA?5?$AAf?$AAr?$AAe?$AAq?$AAu?$AAe?$AAn@ ; `string'
EXTRN	_wcsncpy:PROC
EXTRN	__imp__MessageBoxW@16:PROC
EXTRN	__imp__GetProcAddress@8:PROC
EXTRN	__imp__GetModuleHandleW@4:PROC
EXTRN	_malloc:PROC
EXTRN	_memset:PROC
EXTRN	_free:PROC
;	COMDAT ??_C@_1EG@PLJILMFD@?$AAC?$AAo?$AAu?$AAl?$AAd?$AAn?$AA?8?$AAt?$AA?5?$AAg?$AAe?$AAt?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAt?$AAi?$AAm?$AAe?$AAr?$AA?8?$AAs?$AA?5?$AAf?$AAr?$AAe?$AAq?$AAu?$AAe?$AAn@
CONST	SEGMENT
??_C@_1EG@PLJILMFD@?$AAC?$AAo?$AAu?$AAl?$AAd?$AAn?$AA?8?$AAt?$AA?5?$AAg?$AAe?$AAt?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAt?$AAi?$AAm?$AAe?$AAr?$AA?8?$AAs?$AA?5?$AAf?$AAr?$AAe?$AAq?$AAu?$AAe?$AAn@ DB 'C'
	DB	00H, 'o', 00H, 'u', 00H, 'l', 00H, 'd', 00H, 'n', 00H, '''', 00H
	DB	't', 00H, ' ', 00H, 'g', 00H, 'e', 00H, 't', 00H, ' ', 00H, 't'
	DB	00H, 'h', 00H, 'e', 00H, ' ', 00H, 't', 00H, 'i', 00H, 'm', 00H
	DB	'e', 00H, 'r', 00H, '''', 00H, 's', 00H, ' ', 00H, 'f', 00H, 'r'
	DB	00H, 'e', 00H, 'q', 00H, 'u', 00H, 'e', 00H, 'n', 00H, 'c', 00H
	DB	'y', 00H, 00H, 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_1BC@NFCHMNPG@?$AAN?$AAo?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@
CONST	SEGMENT
??_C@_1BC@NFCHMNPG@?$AAN?$AAo?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@ DB 'N'
	DB	00H, 'o', 00H, ' ', 00H, 'e', 00H, 'r', 00H, 'r', 00H, 'o', 00H
	DB	'r', 00H, 00H, 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_0BB@GDGABGCO@SetFilePointerEx?$AA@
CONST	SEGMENT
??_C@_0BB@GDGABGCO@SetFilePointerEx?$AA@ DB 'SetFilePointerEx', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_1BK@MGMFAEKH@?$AAk?$AAe?$AAr?$AAn?$AAe?$AAl?$AA3?$AA2?$AA?4?$AAd?$AAl?$AAl?$AA?$AA@
CONST	SEGMENT
??_C@_1BK@MGMFAEKH@?$AAk?$AAe?$AAr?$AAn?$AAe?$AAl?$AA3?$AA2?$AA?4?$AAd?$AAl?$AAl?$AA?$AA@ DB 'k'
	DB	00H, 'e', 00H, 'r', 00H, 'n', 00H, 'e', 00H, 'l', 00H, '3', 00H
	DB	'2', 00H, '.', 00H, 'd', 00H, 'l', 00H, 'l', 00H, 00H, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_1BM@MPJJHMIB@?$AAU?$AAn?$AAk?$AAn?$AAo?$AAw?$AAn?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@
CONST	SEGMENT
??_C@_1BM@MPJJHMIB@?$AAU?$AAn?$AAk?$AAn?$AAo?$AAw?$AAn?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@ DB 'U'
	DB	00H, 'n', 00H, 'k', 00H, 'n', 00H, 'o', 00H, 'w', 00H, 'n', 00H
	DB	' ', 00H, 'e', 00H, 'r', 00H, 'r', 00H, 'o', 00H, 'r', 00H, 00H
	DB	00H						; `string'
CONST	ENDS
;	COMDAT ??_C@_15IEGBJKPD@?$AA?3?$AA?6?$AA?$AA@
CONST	SEGMENT
??_C@_15IEGBJKPD@?$AA?3?$AA?6?$AA?$AA@ DB ':', 00H, 0aH, 00H, 00H, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_1CA@NBDIHIHD@?$AAR?$AAe?$AAc?$AAo?$AAr?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAE?$AAr?$AAr?$AAo?$AAr?$AA?$AA@
CONST	SEGMENT
??_C@_1CA@NBDIHIHD@?$AAR?$AAe?$AAc?$AAo?$AAr?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAE?$AAr?$AAr?$AAo?$AAr?$AA?$AA@ DB 'R'
	DB	00H, 'e', 00H, 'c', 00H, 'o', 00H, 'r', 00H, 'd', 00H, 'i', 00H
	DB	'n', 00H, 'g', 00H, ' ', 00H, 'E', 00H, 'r', 00H, 'r', 00H, 'o'
	DB	00H, 'r', 00H, 00H, 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_1DC@BCHABBLK@?$AAA?$AAn?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?5?$AAo?$AAc?$AAc?$AAu?$AAr?$AAr?$AAe?$AAd?$AA?5?$AAw?$AAh?$AAi?$AAl?$AAe?$AA?5?$AA?$AA@
CONST	SEGMENT
??_C@_1DC@BCHABBLK@?$AAA?$AAn?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?5?$AAo?$AAc?$AAc?$AAu?$AAr?$AAr?$AAe?$AAd?$AA?5?$AAw?$AAh?$AAi?$AAl?$AAe?$AA?5?$AA?$AA@ DB 'A'
	DB	00H, 'n', 00H, ' ', 00H, 'e', 00H, 'r', 00H, 'r', 00H, 'o', 00H
	DB	'r', 00H, ' ', 00H, 'o', 00H, 'c', 00H, 'c', 00H, 'u', 00H, 'r'
	DB	00H, 'r', 00H, 'e', 00H, 'd', 00H, ' ', 00H, 'w', 00H, 'h', 00H
	DB	'i', 00H, 'l', 00H, 'e', 00H, ' ', 00H, 00H, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_1DE@EBPEOCFM@?$AAb?$AAu?$AAi?$AAl?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAl?$AAe?$AAg?$AAa?$AAc?$AAy?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?$AA@
CONST	SEGMENT
??_C@_1DE@EBPEOCFM@?$AAb?$AAu?$AAi?$AAl?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAl?$AAe?$AAg?$AAa?$AAc?$AAy?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?$AA@ DB 'b'
	DB	00H, 'u', 00H, 'i', 00H, 'l', 00H, 'd', 00H, 'i', 00H, 'n', 00H
	DB	'g', 00H, ' ', 00H, 't', 00H, 'h', 00H, 'e', 00H, ' ', 00H, 'l'
	DB	00H, 'e', 00H, 'g', 00H, 'a', 00H, 'c', 00H, 'y', 00H, ' ', 00H
	DB	'i', 00H, 'n', 00H, 'd', 00H, 'e', 00H, 'x', 00H, 00H, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_1EE@KNKKNNAE@?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAv?$AAi?$AAd?$AAe?$AAo?$AA?5?$AAc?$AAo?$AAm?$AAp?$AAr?$AAe?$AAs?$AAs?$AAo@
CONST	SEGMENT
??_C@_1EE@KNKKNNAE@?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAv?$AAi?$AAd?$AAe?$AAo?$AA?5?$AAc?$AAo?$AAm?$AAp?$AAr?$AAe?$AAs?$AAs?$AAo@ DB 'i'
	DB	00H, 'n', 00H, 'i', 00H, 't', 00H, 'i', 00H, 'a', 00H, 'l', 00H
	DB	'i', 00H, 'z', 00H, 'i', 00H, 'n', 00H, 'g', 00H, ' ', 00H, 't'
	DB	00H, 'h', 00H, 'e', 00H, ' ', 00H, 'v', 00H, 'i', 00H, 'd', 00H
	DB	'e', 00H, 'o', 00H, ' ', 00H, 'c', 00H, 'o', 00H, 'm', 00H, 'p'
	DB	00H, 'r', 00H, 'e', 00H, 's', 00H, 's', 00H, 'o', 00H, 'r', 00H
	DB	00H, 00H					; `string'
CONST	ENDS
;	COMDAT ??_C@_1DO@HFKGBECC@?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAw?$AAa?$AAv?$AAe?$AAI?$AAn?$AA?5?$AAd?$AAe?$AAv?$AAi?$AAc?$AAe?$AA?$AA@
CONST	SEGMENT
??_C@_1DO@HFKGBECC@?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAw?$AAa?$AAv?$AAe?$AAI?$AAn?$AA?5?$AAd?$AAe?$AAv?$AAi?$AAc?$AAe?$AA?$AA@ DB 'i'
	DB	00H, 'n', 00H, 'i', 00H, 't', 00H, 'i', 00H, 'a', 00H, 'l', 00H
	DB	'i', 00H, 'z', 00H, 'i', 00H, 'n', 00H, 'g', 00H, ' ', 00H, 't'
	DB	00H, 'h', 00H, 'e', 00H, ' ', 00H, 'w', 00H, 'a', 00H, 'v', 00H
	DB	'e', 00H, 'I', 00H, 'n', 00H, ' ', 00H, 'd', 00H, 'e', 00H, 'v'
	DB	00H, 'i', 00H, 'c', 00H, 'e', 00H, 00H, 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_1DK@KOAJMLIF@?$AAr?$AAe?$AAa?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAf?$AAr?$AAo?$AAm?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAF?$AAI?$AAF?$AAO?$AA?5?$AAb?$AAu?$AAf?$AAf?$AAe?$AAr?$AA?$AA@
CONST	SEGMENT
??_C@_1DK@KOAJMLIF@?$AAr?$AAe?$AAa?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAf?$AAr?$AAo?$AAm?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAF?$AAI?$AAF?$AAO?$AA?5?$AAb?$AAu?$AAf?$AAf?$AAe?$AAr?$AA?$AA@ DB 'r'
	DB	00H, 'e', 00H, 'a', 00H, 'd', 00H, 'i', 00H, 'n', 00H, 'g', 00H
	DB	' ', 00H, 'f', 00H, 'r', 00H, 'o', 00H, 'm', 00H, ' ', 00H, 't'
	DB	00H, 'h', 00H, 'e', 00H, ' ', 00H, 'F', 00H, 'I', 00H, 'F', 00H
	DB	'O', 00H, ' ', 00H, 'b', 00H, 'u', 00H, 'f', 00H, 'f', 00H, 'e'
	DB	00H, 'r', 00H, 00H, 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_1DG@MBOHGMHK@?$AAi?$AAn?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAr?$AAe?$AAa?$AAd?$AA?$AA@
CONST	SEGMENT
??_C@_1DG@MBOHGMHK@?$AAi?$AAn?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAr?$AAe?$AAa?$AAd?$AA?$AA@ DB 'i'
	DB	00H, 'n', 00H, ' ', 00H, 't', 00H, 'h', 00H, 'e', 00H, ' ', 00H
	DB	'd', 00H, 'a', 00H, 't', 00H, 'a', 00H, ' ', 00H, 'w', 00H, 'r'
	DB	00H, 'i', 00H, 't', 00H, 'i', 00H, 'n', 00H, 'g', 00H, ' ', 00H
	DB	't', 00H, 'h', 00H, 'r', 00H, 'e', 00H, 'a', 00H, 'd', 00H, 00H
	DB	00H						; `string'
CONST	ENDS
;	COMDAT ??_C@_1DG@NKBHIMDK@?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAt?$AAo?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAb?$AAu?$AAf?$AAf?$AAe?$AAr?$AA?$AA@
CONST	SEGMENT
??_C@_1DG@NKBHIMDK@?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAt?$AAo?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAb?$AAu?$AAf?$AAf?$AAe?$AAr?$AA?$AA@ DB 'w'
	DB	00H, 'r', 00H, 'i', 00H, 't', 00H, 'i', 00H, 'n', 00H, 'g', 00H
	DB	' ', 00H, 'd', 00H, 'a', 00H, 't', 00H, 'a', 00H, ' ', 00H, 't'
	DB	00H, 'o', 00H, ' ', 00H, 't', 00H, 'h', 00H, 'e', 00H, ' ', 00H
	DB	'b', 00H, 'u', 00H, 'f', 00H, 'f', 00H, 'e', 00H, 'r', 00H, 00H
	DB	00H						; `string'
CONST	ENDS
;	COMDAT ??_C@_1CC@NAMKJAIK@?$AAo?$AAp?$AAe?$AAn?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?$AA@
CONST	SEGMENT
??_C@_1CC@NAMKJAIK@?$AAo?$AAp?$AAe?$AAn?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?$AA@ DB 'o'
	DB	00H, 'p', 00H, 'e', 00H, 'n', 00H, 'i', 00H, 'n', 00H, 'g', 00H
	DB	' ', 00H, 't', 00H, 'h', 00H, 'e', 00H, ' ', 00H, 'f', 00H, 'i'
	DB	00H, 'l', 00H, 'e', 00H, 00H, 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_1CO@DLGENJPH@?$AAg?$AAe?$AAt?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAr?$AAe?$AAa?$AAd?$AAy?$AA?5?$AAt?$AAo?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?$AA@
CONST	SEGMENT
??_C@_1CO@DLGENJPH@?$AAg?$AAe?$AAt?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAr?$AAe?$AAa?$AAd?$AAy?$AA?5?$AAt?$AAo?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?$AA@ DB 'g'
	DB	00H, 'e', 00H, 't', 00H, 't', 00H, 'i', 00H, 'n', 00H, 'g', 00H
	DB	' ', 00H, 'r', 00H, 'e', 00H, 'a', 00H, 'd', 00H, 'y', 00H, ' '
	DB	00H, 't', 00H, 'o', 00H, ' ', 00H, 'w', 00H, 'r', 00H, 'i', 00H
	DB	't', 00H, 'e', 00H, 00H, 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_1CO@OAILNABH@?$AAi?$AAn?$AA?5?$AAa?$AAn?$AA?5?$AAu?$AAn?$AAk?$AAn?$AAo?$AAw?$AAn?$AA?5?$AAl?$AAo?$AAc?$AAa?$AAt?$AAi?$AAo?$AAn?$AA?$AA@
CONST	SEGMENT
??_C@_1CO@OAILNABH@?$AAi?$AAn?$AA?5?$AAa?$AAn?$AA?5?$AAu?$AAn?$AAk?$AAn?$AAo?$AAw?$AAn?$AA?5?$AAl?$AAo?$AAc?$AAa?$AAt?$AAi?$AAo?$AAn?$AA?$AA@ DB 'i'
	DB	00H, 'n', 00H, ' ', 00H, 'a', 00H, 'n', 00H, ' ', 00H, 'u', 00H
	DB	'n', 00H, 'k', 00H, 'n', 00H, 'o', 00H, 'w', 00H, 'n', 00H, ' '
	DB	00H, 'l', 00H, 'o', 00H, 'c', 00H, 'a', 00H, 't', 00H, 'i', 00H
	DB	'o', 00H, 'n', 00H, 00H, 00H			; `string'
?aviErrorLocations@@3PAPB_WA DD FLAT:??_C@_1CO@OAILNABH@?$AAi?$AAn?$AA?5?$AAa?$AAn?$AA?5?$AAu?$AAn?$AAk?$AAn?$AAo?$AAw?$AAn?$AA?5?$AAl?$AAo?$AAc?$AAa?$AAt?$AAi?$AAo?$AAn?$AA?$AA@ ; aviErrorLocations
	DD	FLAT:??_C@_1CO@DLGENJPH@?$AAg?$AAe?$AAt?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAr?$AAe?$AAa?$AAd?$AAy?$AA?5?$AAt?$AAo?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAe?$AA?$AA@
	DD	FLAT:??_C@_1CC@NAMKJAIK@?$AAo?$AAp?$AAe?$AAn?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAf?$AAi?$AAl?$AAe?$AA?$AA@
	DD	FLAT:??_C@_1DG@NKBHIMDK@?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAt?$AAo?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAb?$AAu?$AAf?$AAf?$AAe?$AAr?$AA?$AA@
	DD	FLAT:??_C@_1DG@MBOHGMHK@?$AAi?$AAn?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAd?$AAa?$AAt?$AAa?$AA?5?$AAw?$AAr?$AAi?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAr?$AAe?$AAa?$AAd?$AA?$AA@
	DD	FLAT:??_C@_1DK@KOAJMLIF@?$AAr?$AAe?$AAa?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAf?$AAr?$AAo?$AAm?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAF?$AAI?$AAF?$AAO?$AA?5?$AAb?$AAu?$AAf?$AAf?$AAe?$AAr?$AA?$AA@
	DD	FLAT:??_C@_1DO@HFKGBECC@?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAw?$AAa?$AAv?$AAe?$AAI?$AAn?$AA?5?$AAd?$AAe?$AAv?$AAi?$AAc?$AAe?$AA?$AA@
	DD	FLAT:??_C@_1EE@KNKKNNAE@?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAv?$AAi?$AAd?$AAe?$AAo?$AA?5?$AAc?$AAo?$AAm?$AAp?$AAr?$AAe?$AAs?$AAs?$AAo@
	DD	FLAT:??_C@_1DE@EBPEOCFM@?$AAb?$AAu?$AAi?$AAl?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAl?$AAe?$AAg?$AAa?$AAc?$AAy?$AA?5?$AAi?$AAn?$AAd?$AAe?$AAx?$AA?$AA@
PUBLIC	?aviGetStreamValueAverage@@YA_JPAUSTREAM_VALUES@@@Z ; aviGetStreamValueAverage
EXTRN	__alldiv:PROC
; Function compile flags: /Odtp
; File c:\develop\dscaler423a\dscaler\avi.cpp
;	COMDAT ?aviGetStreamValueAverage@@YA_JPAUSTREAM_VALUES@@@Z
_TEXT	SEGMENT
tv69 = -8						; size = 8
_value$ = 8						; size = 4
?aviGetStreamValueAverage@@YA_JPAUSTREAM_VALUES@@@Z PROC ; aviGetStreamValueAverage, COMDAT

; 1199 : {

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

; 1200 :     return (value->count > 0) ? (value->total / (int64)value->count) : 0;

  00006	8b 45 08	 mov	 eax, DWORD PTR _value$[ebp]
  00009	83 78 0c 00	 cmp	 DWORD PTR [eax+12], 0
  0000d	76 21		 jbe	 SHORT $LN3@aviGetStre
  0000f	8b 4d 08	 mov	 ecx, DWORD PTR _value$[ebp]
  00012	8b 51 0c	 mov	 edx, DWORD PTR [ecx+12]
  00015	33 c0		 xor	 eax, eax
  00017	8b 4d 08	 mov	 ecx, DWORD PTR _value$[ebp]
  0001a	50		 push	 eax
  0001b	52		 push	 edx
  0001c	8b 51 04	 mov	 edx, DWORD PTR [ecx+4]
  0001f	52		 push	 edx
  00020	8b 01		 mov	 eax, DWORD PTR [ecx]
  00022	50		 push	 eax
  00023	e8 00 00 00 00	 call	 __alldiv
  00028	89 45 f8	 mov	 DWORD PTR tv69[ebp], eax
  0002b	89 55 fc	 mov	 DWORD PTR tv69[ebp+4], edx
  0002e	eb 0e		 jmp	 SHORT $LN4@aviGetStre
$LN3@aviGetStre:
  00030	c7 45 f8 00 00
	00 00		 mov	 DWORD PTR tv69[ebp], 0
  00037	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR tv69[ebp+4], 0
$LN4@aviGetStre:
  0003e	8b 45 f8	 mov	 eax, DWORD PTR tv69[ebp]
  00041	8b 55 fc	 mov	 edx, DWORD PTR tv69[ebp+4]

; 1201 : }

  00044	8b e5		 mov	 esp, ebp
  00046	5d		 pop	 ebp
  00047	c3		 ret	 0
?aviGetStreamValueAverage@@YA_JPAUSTREAM_VALUES@@@Z ENDP ; aviGetStreamValueAverage
_TEXT	ENDS
PUBLIC	?aviAddStreamValue@@YAXPAUSTREAM_VALUES@@K@Z	; aviAddStreamValue
; Function compile flags: /Odtp
;	COMDAT ?aviAddStreamValue@@YAXPAUSTREAM_VALUES@@K@Z
_TEXT	SEGMENT
_value$ = 8						; size = 4
_amount$ = 12						; size = 4
?aviAddStreamValue@@YAXPAUSTREAM_VALUES@@K@Z PROC	; aviAddStreamValue, COMDAT

; 1185 : {

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

; 1186 :     value->total += (int64)amount;

  00003	8b 45 0c	 mov	 eax, DWORD PTR _amount$[ebp]
  00006	33 c9		 xor	 ecx, ecx
  00008	8b 55 08	 mov	 edx, DWORD PTR _value$[ebp]
  0000b	03 02		 add	 eax, DWORD PTR [edx]
  0000d	8b 52 04	 mov	 edx, DWORD PTR [edx+4]
  00010	13 d1		 adc	 edx, ecx
  00012	8b 4d 08	 mov	 ecx, DWORD PTR _value$[ebp]
  00015	89 01		 mov	 DWORD PTR [ecx], eax
  00017	89 51 04	 mov	 DWORD PTR [ecx+4], edx

; 1187 :     value->count++;

  0001a	8b 55 08	 mov	 edx, DWORD PTR _value$[ebp]
  0001d	8b 42 0c	 mov	 eax, DWORD PTR [edx+12]
  00020	83 c0 01	 add	 eax, 1
  00023	8b 4d 08	 mov	 ecx, DWORD PTR _value$[ebp]
  00026	89 41 0c	 mov	 DWORD PTR [ecx+12], eax

; 1188 : 
; 1189 :     if (amount > value->max)

  00029	8b 55 08	 mov	 edx, DWORD PTR _value$[ebp]
  0002c	8b 45 0c	 mov	 eax, DWORD PTR _amount$[ebp]
  0002f	3b 42 08	 cmp	 eax, DWORD PTR [edx+8]
  00032	76 09		 jbe	 SHORT $LN2@aviAddStre

; 1190 :        value->max = amount;

  00034	8b 4d 08	 mov	 ecx, DWORD PTR _value$[ebp]
  00037	8b 55 0c	 mov	 edx, DWORD PTR _amount$[ebp]
  0003a	89 51 08	 mov	 DWORD PTR [ecx+8], edx
$LN2@aviAddStre:

; 1191 : }

  0003d	5d		 pop	 ebp
  0003e	c3		 ret	 0
?aviAddStreamValue@@YAXPAUSTREAM_VALUES@@K@Z ENDP	; aviAddStreamValue
_TEXT	ENDS
PUBLIC	?aviUnlockAudio@@YAXPAUAVI_FILE@@@Z		; aviUnlockAudio
; Function compile flags: /Odtp
;	COMDAT ?aviUnlockAudio@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviUnlockAudio@@YAXPAUAVI_FILE@@@Z PROC		; aviUnlockAudio, COMDAT

; 1170 : {

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

; 1171 :     if (file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0f		 je	 SHORT $LN2@aviUnlockA

; 1172 :        LeaveCriticalSection(&file->lock.audio);

  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	05 98 01 00 00	 add	 eax, 408		; 00000198H
  00011	50		 push	 eax
  00012	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__LeaveCriticalSection@4
$LN2@aviUnlockA:

; 1173 : }

  00018	5d		 pop	 ebp
  00019	c3		 ret	 0
?aviUnlockAudio@@YAXPAUAVI_FILE@@@Z ENDP		; aviUnlockAudio
_TEXT	ENDS
PUBLIC	?aviLockAudio@@YAXPAUAVI_FILE@@@Z		; aviLockAudio
; Function compile flags: /Odtp
;	COMDAT ?aviLockAudio@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviLockAudio@@YAXPAUAVI_FILE@@@Z PROC			; aviLockAudio, COMDAT

; 1159 : {

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

; 1160 :     if (file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0f		 je	 SHORT $LN2@aviLockAud@2

; 1161 :        EnterCriticalSection(&file->lock.audio);

  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	05 98 01 00 00	 add	 eax, 408		; 00000198H
  00011	50		 push	 eax
  00012	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__EnterCriticalSection@4
$LN2@aviLockAud@2:

; 1162 : }

  00018	5d		 pop	 ebp
  00019	c3		 ret	 0
?aviLockAudio@@YAXPAUAVI_FILE@@@Z ENDP			; aviLockAudio
_TEXT	ENDS
PUBLIC	?aviUnlockVideo@@YAXPAUAVI_FILE@@@Z		; aviUnlockVideo
; Function compile flags: /Odtp
;	COMDAT ?aviUnlockVideo@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviUnlockVideo@@YAXPAUAVI_FILE@@@Z PROC		; aviUnlockVideo, COMDAT

; 1148 : {

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

; 1149 :     if (file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0f		 je	 SHORT $LN2@aviUnlockV

; 1150 :        LeaveCriticalSection(&file->lock.video);

  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	05 80 01 00 00	 add	 eax, 384		; 00000180H
  00011	50		 push	 eax
  00012	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__LeaveCriticalSection@4
$LN2@aviUnlockV:

; 1151 : }

  00018	5d		 pop	 ebp
  00019	c3		 ret	 0
?aviUnlockVideo@@YAXPAUAVI_FILE@@@Z ENDP		; aviUnlockVideo
_TEXT	ENDS
PUBLIC	?aviLockVideo@@YAXPAUAVI_FILE@@@Z		; aviLockVideo
; Function compile flags: /Odtp
;	COMDAT ?aviLockVideo@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviLockVideo@@YAXPAUAVI_FILE@@@Z PROC			; aviLockVideo, COMDAT

; 1137 : {

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

; 1138 :     if (file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0f		 je	 SHORT $LN2@aviLockVid

; 1139 :        EnterCriticalSection(&file->lock.video);

  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	05 80 01 00 00	 add	 eax, 384		; 00000180H
  00011	50		 push	 eax
  00012	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__EnterCriticalSection@4
$LN2@aviLockVid:

; 1140 : }

  00018	5d		 pop	 ebp
  00019	c3		 ret	 0
?aviLockVideo@@YAXPAUAVI_FILE@@@Z ENDP			; aviLockVideo
_TEXT	ENDS
PUBLIC	?aviUnlockTimer@@YAXPAUAVI_FILE@@@Z		; aviUnlockTimer
; Function compile flags: /Odtp
;	COMDAT ?aviUnlockTimer@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviUnlockTimer@@YAXPAUAVI_FILE@@@Z PROC		; aviUnlockTimer, COMDAT

; 1126 : {

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

; 1127 :     if (file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0f		 je	 SHORT $LN2@aviUnlockT

; 1128 :        LeaveCriticalSection(&file->lock.timer);

  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	05 68 01 00 00	 add	 eax, 360		; 00000168H
  00011	50		 push	 eax
  00012	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__LeaveCriticalSection@4
$LN2@aviUnlockT:

; 1129 : }

  00018	5d		 pop	 ebp
  00019	c3		 ret	 0
?aviUnlockTimer@@YAXPAUAVI_FILE@@@Z ENDP		; aviUnlockTimer
_TEXT	ENDS
PUBLIC	?aviLockTimer@@YAXPAUAVI_FILE@@@Z		; aviLockTimer
; Function compile flags: /Odtp
;	COMDAT ?aviLockTimer@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviLockTimer@@YAXPAUAVI_FILE@@@Z PROC			; aviLockTimer, COMDAT

; 1115 : {

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

; 1116 :     if (file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0f		 je	 SHORT $LN2@aviLockTim

; 1117 :        EnterCriticalSection(&file->lock.timer);

  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	05 68 01 00 00	 add	 eax, 360		; 00000168H
  00011	50		 push	 eax
  00012	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__EnterCriticalSection@4
$LN2@aviLockTim:

; 1118 : }

  00018	5d		 pop	 ebp
  00019	c3		 ret	 0
?aviLockTimer@@YAXPAUAVI_FILE@@@Z ENDP			; aviLockTimer
_TEXT	ENDS
PUBLIC	?aviUnlockFile@@YAXPAUAVI_FILE@@@Z		; aviUnlockFile
; Function compile flags: /Odtp
;	COMDAT ?aviUnlockFile@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviUnlockFile@@YAXPAUAVI_FILE@@@Z PROC			; aviUnlockFile, COMDAT

; 1104 : {

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

; 1105 :     if (file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0f		 je	 SHORT $LN2@aviUnlockF

; 1106 :        LeaveCriticalSection(&file->lock.file);

  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	05 50 01 00 00	 add	 eax, 336		; 00000150H
  00011	50		 push	 eax
  00012	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__LeaveCriticalSection@4
$LN2@aviUnlockF:

; 1107 : }

  00018	5d		 pop	 ebp
  00019	c3		 ret	 0
?aviUnlockFile@@YAXPAUAVI_FILE@@@Z ENDP			; aviUnlockFile
_TEXT	ENDS
PUBLIC	?aviLockFile@@YAXPAUAVI_FILE@@@Z		; aviLockFile
; Function compile flags: /Odtp
;	COMDAT ?aviLockFile@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviLockFile@@YAXPAUAVI_FILE@@@Z PROC			; aviLockFile, COMDAT

; 1093 : {

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

; 1094 :     if (file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0f		 je	 SHORT $LN2@aviLockFil@2

; 1095 :        EnterCriticalSection(&file->lock.file);

  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	05 50 01 00 00	 add	 eax, 336		; 00000150H
  00011	50		 push	 eax
  00012	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__EnterCriticalSection@4
$LN2@aviLockFil@2:

; 1096 : }

  00018	5d		 pop	 ebp
  00019	c3		 ret	 0
?aviLockFile@@YAXPAUAVI_FILE@@@Z ENDP			; aviLockFile
_TEXT	ENDS
PUBLIC	?aviTimerGetStart@@YA_JPAUAVI_FILE@@@Z		; aviTimerGetStart
; Function compile flags: /Odtp
;	COMDAT ?aviTimerGetStart@@YA_JPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviTimerGetStart@@YA_JPAUAVI_FILE@@@Z PROC		; aviTimerGetStart, COMDAT

; 1076 : {

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

; 1077 :     if (!file || !file->timer.flag)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 0c		 je	 SHORT $LN1@aviTimerGe
  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	83 b8 60 02 00
	00 00		 cmp	 DWORD PTR [eax+608], 0
  00013	75 06		 jne	 SHORT $LN2@aviTimerGe
$LN1@aviTimerGe:

; 1078 :        return 0;

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

; 1079 : 
; 1080 :     return file->timer.start;

  0001b	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0001e	8b 81 68 02 00
	00		 mov	 eax, DWORD PTR [ecx+616]
  00024	8b 91 6c 02 00
	00		 mov	 edx, DWORD PTR [ecx+620]
$LN3@aviTimerGe:

; 1081 : }

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

; 1061 : {

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

; 1062 :     if (!file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	75 02		 jne	 SHORT $LN1@aviTimerSe

; 1063 :        return;

  00009	eb 22		 jmp	 SHORT $LN2@aviTimerSe
$LN1@aviTimerSe:

; 1064 : 
; 1065 :     file->timer.start = value;

  0000b	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000e	8b 4d 0c	 mov	 ecx, DWORD PTR _value$[ebp]
  00011	89 88 68 02 00
	00		 mov	 DWORD PTR [eax+616], ecx
  00017	8b 55 10	 mov	 edx, DWORD PTR _value$[ebp+4]
  0001a	89 90 6c 02 00
	00		 mov	 DWORD PTR [eax+620], edx

; 1066 :     file->timer.flag  = TRUE;

  00020	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00023	c7 80 60 02 00
	00 01 00 00 00	 mov	 DWORD PTR [eax+608], 1
$LN2@aviTimerSe:

; 1067 : }

  0002d	5d		 pop	 ebp
  0002e	c3		 ret	 0
?aviTimerSetStart@@YAXPAUAVI_FILE@@_J@Z ENDP		; aviTimerSetStart
_TEXT	ENDS
PUBLIC	?aviTimerStarted@@YAHPAUAVI_FILE@@@Z		; aviTimerStarted
; Function compile flags: /Odtp
;	COMDAT ?aviTimerStarted@@YAHPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviTimerStarted@@YAHPAUAVI_FILE@@@Z PROC		; aviTimerStarted, COMDAT

; 1048 : {

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

; 1049 :     if (!file)

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

; 1050 :        return FALSE;

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

; 1051 : 
; 1052 :     return file->timer.flag;

  0000d	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00010	8b 80 60 02 00
	00		 mov	 eax, DWORD PTR [eax+608]
$LN2@aviTimerSt:

; 1053 : }

  00016	5d		 pop	 ebp
  00017	c3		 ret	 0
?aviTimerStarted@@YAHPAUAVI_FILE@@@Z ENDP		; aviTimerStarted
_TEXT	ENDS
PUBLIC	_aviGetTimer
; Function compile flags: /Odtp
;	COMDAT _aviGetTimer
_TEXT	SEGMENT
_aviGetTimer PROC					; COMDAT

; 1038 : {

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

; 1039 :     return GetTickCount();

  00003	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__GetTickCount@0
  00009	33 d2		 xor	 edx, edx

; 1040 : }

  0000b	5d		 pop	 ebp
  0000c	c3		 ret	 0
_aviGetTimer ENDP
_TEXT	ENDS
PUBLIC	?aviGetTimerFreq@@YA_JXZ			; aviGetTimerFreq
; Function compile flags: /Odtp
;	COMDAT ?aviGetTimerFreq@@YA_JXZ
_TEXT	SEGMENT
?aviGetTimerFreq@@YA_JXZ PROC				; aviGetTimerFreq, COMDAT

; 1033 : {

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

; 1034 :     return 1000;

  00003	b8 e8 03 00 00	 mov	 eax, 1000		; 000003e8H
  00008	33 d2		 xor	 edx, edx

; 1035 : }

  0000a	5d		 pop	 ebp
  0000b	c3		 ret	 0
?aviGetTimerFreq@@YA_JXZ ENDP				; aviGetTimerFreq
_TEXT	ENDS
PUBLIC	_aviSetLimit
; Function compile flags: /Odtp
;	COMDAT _aviSetLimit
_TEXT	SEGMENT
_file$ = 8						; size = 4
_limitMiB$ = 12						; size = 4
_aviSetLimit PROC					; COMDAT

; 598  : {

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

; 599  :     if (file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 37		 je	 SHORT $LN4@aviSetLimi

; 600  :     {
; 601  :         if (!(file->flags & AVI_FLAG_LARGE_FILES) &&
; 602  :             (limitMiB > AVI_4GiB_LIMIT || !limitMiB))

  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	0f b6 08	 movzx	 ecx, BYTE PTR [eax]
  0000f	81 e1 80 00 00
	00		 and	 ecx, 128		; 00000080H
  00015	75 16		 jne	 SHORT $LN2@aviSetLimi
  00017	81 7d 0c 8c 0f
	00 00		 cmp	 DWORD PTR _limitMiB$[ebp], 3980 ; 00000f8cH
  0001e	77 06		 ja	 SHORT $LN1@aviSetLimi
  00020	83 7d 0c 00	 cmp	 DWORD PTR _limitMiB$[ebp], 0
  00024	75 07		 jne	 SHORT $LN2@aviSetLimi
$LN1@aviSetLimi:

; 603  :            limitMiB = AVI_4GiB_LIMIT;

  00026	c7 45 0c 8c 0f
	00 00		 mov	 DWORD PTR _limitMiB$[ebp], 3980 ; 00000f8cH
$LN2@aviSetLimi:

; 604  : 
; 605  :         file->limit = (int64)limitMiB * (int64)1048576;

  0002d	8b 45 0c	 mov	 eax, DWORD PTR _limitMiB$[ebp]
  00030	ba 00 00 10 00	 mov	 edx, 1048576		; 00100000H
  00035	f7 e2		 mul	 edx
  00037	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0003a	89 41 08	 mov	 DWORD PTR [ecx+8], eax
  0003d	89 51 0c	 mov	 DWORD PTR [ecx+12], edx
$LN4@aviSetLimi:

; 606  :     }
; 607  : }

  00040	5d		 pop	 ebp
  00041	c3		 ret	 0
_aviSetLimit ENDP
_TEXT	ENDS
PUBLIC	_aviLimitReached
; Function compile flags: /Odtp
;	COMDAT _aviLimitReached
_TEXT	SEGMENT
_file$ = 8						; size = 4
_aviLimitReached PROC					; COMDAT

; 580  : {

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

; 581  :     if (!file)

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

; 582  :        return FALSE;

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

; 583  : 
; 584  :     return file->hold;

  0000d	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00010	8b 40 04	 mov	 eax, DWORD PTR [eax+4]
$LN2@aviLimitRe:

; 585  : }

  00013	5d		 pop	 ebp
  00014	c3		 ret	 0
_aviLimitReached ENDP
_TEXT	ENDS
PUBLIC	_aviFrameReady
; Function compile flags: /Odtp
;	COMDAT _aviFrameReady
_TEXT	SEGMENT
_file$ = 8						; size = 4
_aviFrameReady PROC					; COMDAT

; 560  : {

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

; 561  :     /**** DScaler already does its own timing and doesn't need this ****/
; 562  :     /*if (!aviTimerStarted(file) ||
; 563  :         aviGetTimer() < file->video.timer.next)
; 564  :        return TRUE;
; 565  : 
; 566  :     return FALSE;*/
; 567  : 
; 568  :     return TRUE;

  00003	b8 01 00 00 00	 mov	 eax, 1

; 569  : }

  00008	5d		 pop	 ebp
  00009	c3		 ret	 0
_aviFrameReady ENDP
_TEXT	ENDS
PUBLIC	?aviGetBaseOffset@@YA_JPAUAVI_FILE@@H@Z		; aviGetBaseOffset
; Function compile flags: /Odtp
;	COMDAT ?aviGetBaseOffset@@YA_JPAUAVI_FILE@@H@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
_type$ = 12						; size = 4
?aviGetBaseOffset@@YA_JPAUAVI_FILE@@H@Z PROC		; aviGetBaseOffset, COMDAT

; 208  : {

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

; 209  :     assert(type >= 0 && type < MAX_BASE_OFFSET);
; 210  :     return file->chunk.baseOffset[type];

  00003	8b 4d 0c	 mov	 ecx, DWORD PTR _type$[ebp]
  00006	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00009	8b 84 ca b0 01
	00 00		 mov	 eax, DWORD PTR [edx+ecx*8+432]
  00010	8b 94 ca b4 01
	00 00		 mov	 edx, DWORD PTR [edx+ecx*8+436]

; 211  : }

  00017	5d		 pop	 ebp
  00018	c3		 ret	 0
?aviGetBaseOffset@@YA_JPAUAVI_FILE@@H@Z ENDP		; aviGetBaseOffset
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ?aviSetBaseOffset@@YAXPAUAVI_FILE@@H@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
_type$ = 12						; size = 4
?aviSetBaseOffset@@YAXPAUAVI_FILE@@H@Z PROC		; aviSetBaseOffset, COMDAT

; 197  : {

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

; 198  :     assert(type >= 0 && type < MAX_BASE_OFFSET);
; 199  :     file->chunk.baseOffset[type] = fileTell(file);

  00004	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00007	50		 push	 eax
  00008	e8 00 00 00 00	 call	 ?fileTell@@YA_JPAUAVI_FILE@@@Z ; fileTell
  0000d	83 c4 04	 add	 esp, 4
  00010	8b 4d 0c	 mov	 ecx, DWORD PTR _type$[ebp]
  00013	8b 75 08	 mov	 esi, DWORD PTR _file$[ebp]
  00016	89 84 ce b0 01
	00 00		 mov	 DWORD PTR [esi+ecx*8+432], eax
  0001d	89 94 ce b4 01
	00 00		 mov	 DWORD PTR [esi+ecx*8+436], edx

; 200  : }

  00024	5e		 pop	 esi
  00025	5d		 pop	 ebp
  00026	c3		 ret	 0
?aviSetBaseOffset@@YAXPAUAVI_FILE@@H@Z ENDP		; aviSetBaseOffset
_TEXT	ENDS
PUBLIC	_aviFileCreate
; Function compile flags: /Odtp
;	COMDAT _aviFileCreate
_TEXT	SEGMENT
_file$ = -12						; size = 4
_hLibrary$ = -8						; size = 4
_i$ = -4						; size = 4
_aviFileCreate PROC					; COMDAT

; 148  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 0c	 sub	 esp, 12			; 0000000cH

; 149  :     AVI_FILE *file;
; 150  :     int      i;
; 151  :     HMODULE  hLibrary;
; 152  : 
; 153  :     file = (AVI_FILE *)malloc(sizeof(AVI_FILE));

  00006	68 a8 1c 00 00	 push	 7336			; 00001ca8H
  0000b	e8 00 00 00 00	 call	 _malloc
  00010	83 c4 04	 add	 esp, 4
  00013	89 45 f4	 mov	 DWORD PTR _file$[ebp], eax

; 154  :     if (!file)

  00016	83 7d f4 00	 cmp	 DWORD PTR _file$[ebp], 0
  0001a	75 07		 jne	 SHORT $LN7@aviFileCre

; 155  :        return NULL;

  0001c	33 c0		 xor	 eax, eax
  0001e	e9 e5 00 00 00	 jmp	 $LN8@aviFileCre
$LN7@aviFileCre:

; 156  : 
; 157  :     memset(file, 0, sizeof(AVI_FILE));

  00023	68 a8 1c 00 00	 push	 7336			; 00001ca8H
  00028	6a 00		 push	 0
  0002a	8b 45 f4	 mov	 eax, DWORD PTR _file$[ebp]
  0002d	50		 push	 eax
  0002e	e8 00 00 00 00	 call	 _memset
  00033	83 c4 0c	 add	 esp, 12			; 0000000cH

; 158  : 
; 159  :     /* Initialize handles */
; 160  :     file->async.f       = INVALID_HANDLE_VALUE;

  00036	8b 4d f4	 mov	 ecx, DWORD PTR _file$[ebp]
  00039	c7 81 30 01 00
	00 ff ff ff ff	 mov	 DWORD PTR [ecx+304], -1

; 161  :     file->audio.hWaveIn = (HWAVEIN)INVALID_HANDLE_VALUE;

  00043	8b 55 f4	 mov	 edx, DWORD PTR _file$[ebp]
  00046	c7 82 78 03 00
	00 ff ff ff ff	 mov	 DWORD PTR [edx+888], -1

; 162  : 
; 163  :     /* Initialize the super index headers */
; 164  :     for (i = 0; i < NUM_STREAMS; i++)

  00050	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _i$[ebp], 0
  00057	eb 09		 jmp	 SHORT $LN6@aviFileCre
$LN5@aviFileCre:
  00059	8b 45 fc	 mov	 eax, DWORD PTR _i$[ebp]
  0005c	83 c0 01	 add	 eax, 1
  0005f	89 45 fc	 mov	 DWORD PTR _i$[ebp], eax
$LN6@aviFileCre:
  00062	83 7d fc 02	 cmp	 DWORD PTR _i$[ebp], 2
  00066	7d 2f		 jge	 SHORT $LN4@aviFileCre

; 165  :     {
; 166  :         file->superIndex[i].header.wLongsPerEntry = 4;

  00068	8b 4d fc	 mov	 ecx, DWORD PTR _i$[ebp]
  0006b	69 c9 28 04 00
	00		 imul	 ecx, 1064		; 00000428H
  00071	ba 04 00 00 00	 mov	 edx, 4
  00076	8b 45 f4	 mov	 eax, DWORD PTR _file$[ebp]
  00079	66 89 94 08 60
	14 00 00	 mov	 WORD PTR [eax+ecx+5216], dx

; 167  :         file->superIndex[i].header.bIndexType     = AVI_INDEX_OF_INDEXES;

  00081	8b 4d fc	 mov	 ecx, DWORD PTR _i$[ebp]
  00084	69 c9 28 04 00
	00		 imul	 ecx, 1064		; 00000428H
  0008a	8b 55 f4	 mov	 edx, DWORD PTR _file$[ebp]
  0008d	c6 84 0a 63 14
	00 00 00	 mov	 BYTE PTR [edx+ecx+5219], 0

; 168  :     }

  00095	eb c2		 jmp	 SHORT $LN5@aviFileCre
$LN4@aviFileCre:

; 169  : 
; 170  :     /* Initialize the error data */
; 171  :     InitializeCriticalSection(&file->error.lock);

  00097	8b 45 f4	 mov	 eax, DWORD PTR _file$[ebp]
  0009a	83 c0 10	 add	 eax, 16			; 00000010H
  0009d	50		 push	 eax
  0009e	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__InitializeCriticalSection@4

; 172  :     file->error.type = AVI_ERROR_NONE;

  000a4	8b 4d f4	 mov	 ecx, DWORD PTR _file$[ebp]
  000a7	c7 41 28 00 00
	00 00		 mov	 DWORD PTR [ecx+40], 0

; 173  : 
; 174  :     /* Check for large file support */
; 175  :     hLibrary = GetModuleHandle(_T("kernel32.dll"));

  000ae	68 00 00 00 00	 push	 OFFSET ??_C@_1BK@MGMFAEKH@?$AAk?$AAe?$AAr?$AAn?$AAe?$AAl?$AA3?$AA2?$AA?4?$AAd?$AAl?$AAl?$AA?$AA@
  000b3	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__GetModuleHandleW@4
  000b9	89 45 f8	 mov	 DWORD PTR _hLibrary$[ebp], eax

; 176  :     if (hLibrary)

  000bc	83 7d f8 00	 cmp	 DWORD PTR _hLibrary$[ebp], 0
  000c0	74 24		 je	 SHORT $LN3@aviFileCre

; 177  :     {
; 178  :         if (GetProcAddress(hLibrary, "SetFilePointerEx"))

  000c2	68 00 00 00 00	 push	 OFFSET ??_C@_0BB@GDGABGCO@SetFilePointerEx?$AA@
  000c7	8b 55 f8	 mov	 edx, DWORD PTR _hLibrary$[ebp]
  000ca	52		 push	 edx
  000cb	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__GetProcAddress@8
  000d1	85 c0		 test	 eax, eax
  000d3	74 11		 je	 SHORT $LN3@aviFileCre

; 179  :            file->flags |= AVI_FLAG_LARGE_FILES;

  000d5	8b 45 f4	 mov	 eax, DWORD PTR _file$[ebp]
  000d8	0f b6 08	 movzx	 ecx, BYTE PTR [eax]
  000db	81 c9 80 00 00
	00		 or	 ecx, 128		; 00000080H
  000e1	8b 55 f4	 mov	 edx, DWORD PTR _file$[ebp]
  000e4	88 0a		 mov	 BYTE PTR [edx], cl
$LN3@aviFileCre:

; 180  :     }
; 181  : 
; 182  :     /* If large file support isn't available then set the default file size
; 183  :        limit to 4GiB */
; 184  :     if (!(file->flags & AVI_FLAG_LARGE_FILES))

  000e6	8b 45 f4	 mov	 eax, DWORD PTR _file$[ebp]
  000e9	0f b6 08	 movzx	 ecx, BYTE PTR [eax]
  000ec	81 e1 80 00 00
	00		 and	 ecx, 128		; 00000080H
  000f2	75 11		 jne	 SHORT $LN1@aviFileCre

; 185  :        aviSetLimit(file, AVI_4GiB_LIMIT);

  000f4	68 8c 0f 00 00	 push	 3980			; 00000f8cH
  000f9	8b 55 f4	 mov	 edx, DWORD PTR _file$[ebp]
  000fc	52		 push	 edx
  000fd	e8 00 00 00 00	 call	 _aviSetLimit
  00102	83 c4 08	 add	 esp, 8
$LN1@aviFileCre:

; 186  : 
; 187  :     return file;

  00105	8b 45 f4	 mov	 eax, DWORD PTR _file$[ebp]
$LN8@aviFileCre:

; 188  : }

  00108	8b e5		 mov	 esp, ebp
  0010a	5d		 pop	 ebp
  0010b	c3		 ret	 0
_aviFileCreate ENDP
_TEXT	ENDS
PUBLIC	?aviGetStreamCC@@YAPAUSTREAM_CC@@PAUAVI_FILE@@W4stream_t@@@Z ; aviGetStreamCC
; Function compile flags: /Odtp
;	COMDAT ?aviGetStreamCC@@YAPAUSTREAM_CC@@PAUAVI_FILE@@W4stream_t@@@Z
_TEXT	SEGMENT
tv69 = -4						; size = 4
_file$ = 8						; size = 4
_type$ = 12						; size = 4
?aviGetStreamCC@@YAPAUSTREAM_CC@@PAUAVI_FILE@@W4stream_t@@@Z PROC ; aviGetStreamCC, COMDAT

; 136  : {

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

; 137  :     assert(type==VIDEO_STREAM || type==AUDIO_STREAM);
; 138  : 
; 139  :     return type==VIDEO_STREAM ? &file->video.cc : &file->audio.cc;

  00004	83 7d 0c 00	 cmp	 DWORD PTR _type$[ebp], 0
  00008	75 0d		 jne	 SHORT $LN3@aviGetStre@2
  0000a	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000d	05 a0 02 00 00	 add	 eax, 672		; 000002a0H
  00012	89 45 fc	 mov	 DWORD PTR tv69[ebp], eax
  00015	eb 0c		 jmp	 SHORT $LN4@aviGetStre@2
$LN3@aviGetStre@2:
  00017	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0001a	81 c1 48 03 00
	00		 add	 ecx, 840		; 00000348H
  00020	89 4d fc	 mov	 DWORD PTR tv69[ebp], ecx
$LN4@aviGetStre@2:
  00023	8b 45 fc	 mov	 eax, DWORD PTR tv69[ebp]

; 140  : }

  00026	8b e5		 mov	 esp, ebp
  00028	5d		 pop	 ebp
  00029	c3		 ret	 0
?aviGetStreamCC@@YAPAUSTREAM_CC@@PAUAVI_FILE@@W4stream_t@@@Z ENDP ; aviGetStreamCC
_TEXT	ENDS
PUBLIC	?aviHasError@@YAHPAUAVI_FILE@@@Z		; aviHasError
; Function compile flags: /Odtp
;	COMDAT ?aviHasError@@YAHPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviHasError@@YAHPAUAVI_FILE@@@Z PROC			; aviHasError, COMDAT

; 75   : {

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

; 76   :     if (!file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	75 07		 jne	 SHORT $LN1@aviHasErro

; 77   :        return TRUE;

  00009	b8 01 00 00 00	 mov	 eax, 1
  0000e	eb 0e		 jmp	 SHORT $LN2@aviHasErro
$LN1@aviHasErro:

; 78   : 
; 79   :     return file->error.type==AVI_ERROR_NONE ? FALSE : TRUE;

  00010	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00013	33 c9		 xor	 ecx, ecx
  00015	83 78 28 00	 cmp	 DWORD PTR [eax+40], 0
  00019	0f 95 c1	 setne	 cl
  0001c	8b c1		 mov	 eax, ecx
$LN2@aviHasErro:

; 80   : }

  0001e	5d		 pop	 ebp
  0001f	c3		 ret	 0
?aviHasError@@YAHPAUAVI_FILE@@@Z ENDP			; aviHasError
_TEXT	ENDS
PUBLIC	?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
; Function compile flags: /Odtp
;	COMDAT ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
_type$ = 12						; size = 4
_message$ = 16						; size = 4
?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z PROC	; aviSetError, COMDAT

; 58   : {

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

; 59   :     if (file && message)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 41		 je	 SHORT $LN2@aviSetErro
  00009	83 7d 10 00	 cmp	 DWORD PTR _message$[ebp], 0
  0000d	74 3b		 je	 SHORT $LN2@aviSetErro

; 60   :     {
; 61   :         EnterCriticalSection(&file->error.lock);

  0000f	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00012	83 c0 10	 add	 eax, 16			; 00000010H
  00015	50		 push	 eax
  00016	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__EnterCriticalSection@4

; 62   :         file->error.type = type;

  0001c	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0001f	8b 55 0c	 mov	 edx, DWORD PTR _type$[ebp]
  00022	89 51 28	 mov	 DWORD PTR [ecx+40], edx

; 63   :         _tcsncpy(file->error.message, message, sizeof(file->error.message)/ sizeof(TCHAR));

  00025	68 80 00 00 00	 push	 128			; 00000080H
  0002a	8b 45 10	 mov	 eax, DWORD PTR _message$[ebp]
  0002d	50		 push	 eax
  0002e	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00031	83 c1 2c	 add	 ecx, 44			; 0000002cH
  00034	51		 push	 ecx
  00035	e8 00 00 00 00	 call	 _wcsncpy
  0003a	83 c4 0c	 add	 esp, 12			; 0000000cH

; 64   :         LeaveCriticalSection(&file->error.lock);

  0003d	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00040	83 c2 10	 add	 edx, 16			; 00000010H
  00043	52		 push	 edx
  00044	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__LeaveCriticalSection@4
$LN2@aviSetErro:

; 65   :     }
; 66   : }

  0004a	5d		 pop	 ebp
  0004b	c3		 ret	 0
?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ENDP	; aviSetError
; Function compile flags: /Odtp
; File c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring
;	COMDAT ?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ
_TEXT	SEGMENT
_this$ = -4						; size = 4
?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ PROC ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::c_str, COMDAT
; _this$ = ecx

; 1650 : 		{	// return pointer to null-terminated nonmutable array

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx
  00004	89 4d fc	 mov	 DWORD PTR _this$[ebp], ecx

; 1651 : 		return (_Myptr());

  00007	8b 4d fc	 mov	 ecx, DWORD PTR _this$[ebp]
  0000a	e8 00 00 00 00	 call	 ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IBEPB_WXZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Myptr

; 1652 : 		}

  0000f	8b e5		 mov	 esp, ebp
  00011	5d		 pop	 ebp
  00012	c3		 ret	 0
?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ ENDP ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::c_str
PUBLIC	?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z		; aviWriteFourCC
; Function compile flags: /Odtp
; File c:\develop\dscaler423a\dscaler\avi.cpp
;	COMDAT ?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
_cc$ = 12						; size = 4
?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z PROC		; aviWriteFourCC, COMDAT

; 762  : {

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

; 763  :     fileWrite(file, &cc, sizeof(FOURCC));

  00003	6a 04		 push	 4
  00005	8d 45 0c	 lea	 eax, DWORD PTR _cc$[ebp]
  00008	50		 push	 eax
  00009	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0000c	51		 push	 ecx
  0000d	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00012	83 c4 0c	 add	 esp, 12			; 0000000cH

; 764  : }

  00015	5d		 pop	 ebp
  00016	c3		 ret	 0
?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z ENDP		; aviWriteFourCC
_TEXT	ENDS
PUBLIC	?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z		; aviBeginChunk
; Function compile flags: /Odtp
;	COMDAT ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z
_TEXT	SEGMENT
_chunk$ = -4						; size = 4
_file$ = 8						; size = 4
_cc$ = 12						; size = 4
?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z PROC		; aviBeginChunk, COMDAT

; 620  : {

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

; 621  :     CHUNK *chunk;
; 622  : 
; 623  :     assert(file->chunk.current < MAX_CHUNK);
; 624  : 
; 625  :     chunk = &file->chunk.data[file->chunk.current];

  00004	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00007	8b 88 50 02 00
	00		 mov	 ecx, DWORD PTR [eax+592]
  0000d	c1 e1 04	 shl	 ecx, 4
  00010	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00013	8d 84 0a d0 01
	00 00		 lea	 eax, DWORD PTR [edx+ecx+464]
  0001a	89 45 fc	 mov	 DWORD PTR _chunk$[ebp], eax

; 626  : 
; 627  :     chunk->cc    = cc;

  0001d	8b 4d fc	 mov	 ecx, DWORD PTR _chunk$[ebp]
  00020	8b 55 0c	 mov	 edx, DWORD PTR _cc$[ebp]
  00023	89 11		 mov	 DWORD PTR [ecx], edx

; 628  :     chunk->begin = fileTell(file);

  00025	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00028	50		 push	 eax
  00029	e8 00 00 00 00	 call	 ?fileTell@@YA_JPAUAVI_FILE@@@Z ; fileTell
  0002e	83 c4 04	 add	 esp, 4
  00031	8b 4d fc	 mov	 ecx, DWORD PTR _chunk$[ebp]
  00034	89 41 08	 mov	 DWORD PTR [ecx+8], eax
  00037	89 51 0c	 mov	 DWORD PTR [ecx+12], edx

; 629  :     chunk->size  = 0;

  0003a	8b 55 fc	 mov	 edx, DWORD PTR _chunk$[ebp]
  0003d	c7 42 04 00 00
	00 00		 mov	 DWORD PTR [edx+4], 0

; 630  : 
; 631  :     fileWrite(file, &chunk->cc, sizeof(FOURCC));

  00044	6a 04		 push	 4
  00046	8b 45 fc	 mov	 eax, DWORD PTR _chunk$[ebp]
  00049	50		 push	 eax
  0004a	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0004d	51		 push	 ecx
  0004e	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00053	83 c4 0c	 add	 esp, 12			; 0000000cH

; 632  :     fileWrite(file, &chunk->size, sizeof(DWORD));

  00056	6a 04		 push	 4
  00058	8b 55 fc	 mov	 edx, DWORD PTR _chunk$[ebp]
  0005b	83 c2 04	 add	 edx, 4
  0005e	52		 push	 edx
  0005f	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00062	50		 push	 eax
  00063	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00068	83 c4 0c	 add	 esp, 12			; 0000000cH

; 633  : 
; 634  :     file->chunk.current++;

  0006b	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0006e	8b 91 50 02 00
	00		 mov	 edx, DWORD PTR [ecx+592]
  00074	83 c2 01	 add	 edx, 1
  00077	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0007a	89 90 50 02 00
	00		 mov	 DWORD PTR [eax+592], edx

; 635  : }

  00080	8b e5		 mov	 esp, ebp
  00082	5d		 pop	 ebp
  00083	c3		 ret	 0
?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ENDP		; aviBeginChunk
PUBLIC	?aviEndChunk@@YAKPAUAVI_FILE@@@Z		; aviEndChunk
PUBLIC	?aviRIFFChunkEnding@@YAXPAUAVI_FILE@@@Z		; aviRIFFChunkEnding
; Function compile flags: /Odtp
;	COMDAT ?aviRIFFChunkEnding@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
tv81 = -8						; size = 8
_file$ = 8						; size = 4
?aviRIFFChunkEnding@@YAXPAUAVI_FILE@@@Z PROC		; aviRIFFChunkEnding, COMDAT

; 639  : {

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

; 640  :     /* A base offset of 0 for the RIFF chunk means that the first RIFF chunk is
; 641  :        ending */
; 642  :     if (aviGetBaseOffset(file, RIFF_BASE)==0)

  00006	6a 00		 push	 0
  00008	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000b	50		 push	 eax
  0000c	e8 00 00 00 00	 call	 ?aviGetBaseOffset@@YA_JPAUAVI_FILE@@H@Z ; aviGetBaseOffset
  00011	83 c4 08	 add	 esp, 8
  00014	89 45 f8	 mov	 DWORD PTR tv81[ebp], eax
  00017	89 55 fc	 mov	 DWORD PTR tv81[ebp+4], edx
  0001a	8b 4d f8	 mov	 ecx, DWORD PTR tv81[ebp]
  0001d	0b 4d fc	 or	 ecx, DWORD PTR tv81[ebp+4]
  00020	75 2a		 jne	 SHORT $LN1@aviRIFFChu

; 643  :     {
; 644  :         file->legacy.frames = file->video.numFrames;

  00022	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00025	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00028	8b 88 30 03 00
	00		 mov	 ecx, DWORD PTR [eax+816]
  0002e	89 8a 30 04 00
	00		 mov	 DWORD PTR [edx+1072], ecx

; 645  : 
; 646  :         aviIndexSetLegacyCounters(file);

  00034	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00037	52		 push	 edx
  00038	e8 00 00 00 00	 call	 ?aviIndexSetLegacyCounters@@YAXPAUAVI_FILE@@@Z ; aviIndexSetLegacyCounters
  0003d	83 c4 04	 add	 esp, 4

; 647  : 
; 648  :         /* Reserve space for the legacy index at the end of the first RIFF
; 649  :            chunk */
; 650  :         fileReserveLegacyIndex(file);

  00040	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00043	50		 push	 eax
  00044	e8 00 00 00 00	 call	 ?fileReserveLegacyIndex@@YAXPAUAVI_FILE@@@Z ; fileReserveLegacyIndex
  00049	83 c4 04	 add	 esp, 4
$LN1@aviRIFFChu:

; 651  :     }
; 652  : 
; 653  :     /* Reset the counters for the next RIFF chunk */
; 654  :     aviIndexClearCounters(file);

  0004c	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0004f	51		 push	 ecx
  00050	e8 00 00 00 00	 call	 ?aviIndexClearCounters@@YAXPAUAVI_FILE@@@Z ; aviIndexClearCounters
  00055	83 c4 04	 add	 esp, 4

; 655  : }

  00058	8b e5		 mov	 esp, ebp
  0005a	5d		 pop	 ebp
  0005b	c3		 ret	 0
?aviRIFFChunkEnding@@YAXPAUAVI_FILE@@@Z ENDP		; aviRIFFChunkEnding
; Function compile flags: /Odtp
;	COMDAT ?aviEndChunk@@YAKPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_offset$ = -16						; size = 8
_chunk$ = -8						; size = 4
_temp$ = -1						; size = 1
_file$ = 8						; size = 4
?aviEndChunk@@YAKPAUAVI_FILE@@@Z PROC			; aviEndChunk, COMDAT

; 666  : {

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

; 667  :     int64 offset;
; 668  :     CHUNK *chunk;
; 669  :     BYTE  temp;
; 670  : 
; 671  :     assert(file->chunk.current > 0);
; 672  : 
; 673  :     if (file->chunk.current - 1 <= 0)

  00006	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00009	8b 88 50 02 00
	00		 mov	 ecx, DWORD PTR [eax+592]
  0000f	83 e9 01	 sub	 ecx, 1
  00012	75 0c		 jne	 SHORT $LN2@aviEndChun

; 674  :     {
; 675  :         /* This should be the main RIFF chunk */
; 676  :         aviRIFFChunkEnding(file);

  00014	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00017	52		 push	 edx
  00018	e8 00 00 00 00	 call	 ?aviRIFFChunkEnding@@YAXPAUAVI_FILE@@@Z ; aviRIFFChunkEnding
  0001d	83 c4 04	 add	 esp, 4
$LN2@aviEndChun:

; 677  :     }
; 678  : 
; 679  :     file->chunk.current--;

  00020	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00023	8b 88 50 02 00
	00		 mov	 ecx, DWORD PTR [eax+592]
  00029	83 e9 01	 sub	 ecx, 1
  0002c	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0002f	89 8a 50 02 00
	00		 mov	 DWORD PTR [edx+592], ecx

; 680  : 
; 681  :     chunk = &file->chunk.data[file->chunk.current];

  00035	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00038	8b 88 50 02 00
	00		 mov	 ecx, DWORD PTR [eax+592]
  0003e	c1 e1 04	 shl	 ecx, 4
  00041	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00044	8d 84 0a d0 01
	00 00		 lea	 eax, DWORD PTR [edx+ecx+464]
  0004b	89 45 f8	 mov	 DWORD PTR _chunk$[ebp], eax

; 682  : 
; 683  :     offset = fileTell(file);

  0004e	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00051	51		 push	 ecx
  00052	e8 00 00 00 00	 call	 ?fileTell@@YA_JPAUAVI_FILE@@@Z ; fileTell
  00057	83 c4 04	 add	 esp, 4
  0005a	89 45 f0	 mov	 DWORD PTR _offset$[ebp], eax
  0005d	89 55 f4	 mov	 DWORD PTR _offset$[ebp+4], edx

; 684  :     fileSeek(file, chunk->begin + 4);

  00060	8b 55 f8	 mov	 edx, DWORD PTR _chunk$[ebp]
  00063	8b 42 08	 mov	 eax, DWORD PTR [edx+8]
  00066	83 c0 04	 add	 eax, 4
  00069	8b 4a 0c	 mov	 ecx, DWORD PTR [edx+12]
  0006c	83 d1 00	 adc	 ecx, 0
  0006f	51		 push	 ecx
  00070	50		 push	 eax
  00071	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00074	52		 push	 edx
  00075	e8 00 00 00 00	 call	 ?fileSeek@@YAHPAUAVI_FILE@@_J@Z ; fileSeek
  0007a	83 c4 0c	 add	 esp, 12			; 0000000cH

; 685  : 
; 686  :     chunk->size = (DWORD)(offset - (chunk->begin + 8));

  0007d	8b 45 f8	 mov	 eax, DWORD PTR _chunk$[ebp]
  00080	8b 48 08	 mov	 ecx, DWORD PTR [eax+8]
  00083	83 c1 08	 add	 ecx, 8
  00086	8b 50 0c	 mov	 edx, DWORD PTR [eax+12]
  00089	83 d2 00	 adc	 edx, 0
  0008c	8b 45 f0	 mov	 eax, DWORD PTR _offset$[ebp]
  0008f	2b c1		 sub	 eax, ecx
  00091	8b 4d f4	 mov	 ecx, DWORD PTR _offset$[ebp+4]
  00094	1b ca		 sbb	 ecx, edx
  00096	8b 55 f8	 mov	 edx, DWORD PTR _chunk$[ebp]
  00099	89 42 04	 mov	 DWORD PTR [edx+4], eax

; 687  :     fileWrite(file, &chunk->size, sizeof(DWORD));

  0009c	6a 04		 push	 4
  0009e	8b 45 f8	 mov	 eax, DWORD PTR _chunk$[ebp]
  000a1	83 c0 04	 add	 eax, 4
  000a4	50		 push	 eax
  000a5	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000a8	51		 push	 ecx
  000a9	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  000ae	83 c4 0c	 add	 esp, 12			; 0000000cH

; 688  : 
; 689  :     fileSeek(file, offset);

  000b1	8b 55 f4	 mov	 edx, DWORD PTR _offset$[ebp+4]
  000b4	52		 push	 edx
  000b5	8b 45 f0	 mov	 eax, DWORD PTR _offset$[ebp]
  000b8	50		 push	 eax
  000b9	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000bc	51		 push	 ecx
  000bd	e8 00 00 00 00	 call	 ?fileSeek@@YAHPAUAVI_FILE@@_J@Z ; fileSeek
  000c2	83 c4 0c	 add	 esp, 12			; 0000000cH

; 690  : 
; 691  :     /* Write an extra byte after the end of the chunk if it contains data that
; 692  :        has an odd number of bytes. This should rarely or never happen since
; 693  :        most things that are saved have an even number of data bytes. */
; 694  :     if (chunk->size % 2)

  000c5	8b 55 f8	 mov	 edx, DWORD PTR _chunk$[ebp]
  000c8	8b 42 04	 mov	 eax, DWORD PTR [edx+4]
  000cb	33 d2		 xor	 edx, edx
  000cd	b9 02 00 00 00	 mov	 ecx, 2
  000d2	f7 f1		 div	 ecx
  000d4	85 d2		 test	 edx, edx
  000d6	74 16		 je	 SHORT $LN1@aviEndChun

; 695  :     {
; 696  :         temp = 0;

  000d8	c6 45 ff 00	 mov	 BYTE PTR _temp$[ebp], 0

; 697  :         fileWrite(file, &temp, 1);

  000dc	6a 01		 push	 1
  000de	8d 55 ff	 lea	 edx, DWORD PTR _temp$[ebp]
  000e1	52		 push	 edx
  000e2	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000e5	50		 push	 eax
  000e6	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  000eb	83 c4 0c	 add	 esp, 12			; 0000000cH
$LN1@aviEndChun:

; 698  :     }
; 699  : 
; 700  :     return chunk->size;

  000ee	8b 4d f8	 mov	 ecx, DWORD PTR _chunk$[ebp]
  000f1	8b 41 04	 mov	 eax, DWORD PTR [ecx+4]

; 701  : }

  000f4	8b e5		 mov	 esp, ebp
  000f6	5d		 pop	 ebp
  000f7	c3		 ret	 0
?aviEndChunk@@YAKPAUAVI_FILE@@@Z ENDP			; aviEndChunk
; Function compile flags: /Odtp
; File c:\program files (x86)\microsoft visual studio 9.0\vc\include\xstring
;	COMDAT ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@II@Z
_TEXT	SEGMENT
_this$ = -8						; size = 4
__Num$ = -4						; size = 4
__Right$ = 8						; size = 4
__Roff$ = 12						; size = 4
__Count$ = 16						; size = 4
?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@II@Z PROC ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append, COMDAT
; _this$ = ecx

; 951  : 		{	// append _Right [_Roff, _Roff + _Count)

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 08	 sub	 esp, 8
  00006	89 4d f8	 mov	 DWORD PTR _this$[ebp], ecx

; 952  : 		if (_Right.size() < _Roff)

  00009	8b 4d 08	 mov	 ecx, DWORD PTR __Right$[ebp]
  0000c	e8 00 00 00 00	 call	 ?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::size
  00011	3b 45 0c	 cmp	 eax, DWORD PTR __Roff$[ebp]
  00014	73 05		 jae	 SHORT $LN5@append@5

; 953  : 			_String_base::_Xran();	// _Roff off end

  00016	e8 00 00 00 00	 call	 ?_Xran@_String_base@std@@SAXXZ ; std::_String_base::_Xran
$LN5@append@5:

; 954  : 		size_type _Num = _Right.size() - _Roff;

  0001b	8b 4d 08	 mov	 ecx, DWORD PTR __Right$[ebp]
  0001e	e8 00 00 00 00	 call	 ?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::size
  00023	2b 45 0c	 sub	 eax, DWORD PTR __Roff$[ebp]
  00026	89 45 fc	 mov	 DWORD PTR __Num$[ebp], eax

; 955  : 		if (_Num < _Count)

  00029	8b 45 fc	 mov	 eax, DWORD PTR __Num$[ebp]
  0002c	3b 45 10	 cmp	 eax, DWORD PTR __Count$[ebp]
  0002f	73 06		 jae	 SHORT $LN4@append@5

; 956  : 			_Count = _Num;	// trim _Count to size

  00031	8b 4d fc	 mov	 ecx, DWORD PTR __Num$[ebp]
  00034	89 4d 10	 mov	 DWORD PTR __Count$[ebp], ecx
$LN4@append@5:

; 957  : 		if (npos - _Mysize <= _Count || _Mysize + _Count < _Mysize)

  00037	8b 55 f8	 mov	 edx, DWORD PTR _this$[ebp]
  0003a	83 c8 ff	 or	 eax, -1
  0003d	2b 42 14	 sub	 eax, DWORD PTR [edx+20]
  00040	3b 45 10	 cmp	 eax, DWORD PTR __Count$[ebp]
  00043	76 11		 jbe	 SHORT $LN2@append@5
  00045	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  00048	8b 51 14	 mov	 edx, DWORD PTR [ecx+20]
  0004b	03 55 10	 add	 edx, DWORD PTR __Count$[ebp]
  0004e	8b 45 f8	 mov	 eax, DWORD PTR _this$[ebp]
  00051	3b 50 14	 cmp	 edx, DWORD PTR [eax+20]
  00054	73 05		 jae	 SHORT $LN3@append@5
$LN2@append@5:

; 958  : 			_String_base::_Xlen();	// result too long

  00056	e8 00 00 00 00	 call	 ?_Xlen@_String_base@std@@SAXXZ ; std::_String_base::_Xlen
$LN3@append@5:

; 959  : 
; 960  : 		if (0 < _Count && _Grow(_Num = _Mysize + _Count))

  0005b	83 7d 10 00	 cmp	 DWORD PTR __Count$[ebp], 0
  0005f	76 67		 jbe	 SHORT $LN1@append@5
  00061	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  00064	8b 51 14	 mov	 edx, DWORD PTR [ecx+20]
  00067	03 55 10	 add	 edx, DWORD PTR __Count$[ebp]
  0006a	89 55 fc	 mov	 DWORD PTR __Num$[ebp], edx
  0006d	6a 00		 push	 0
  0006f	8b 45 fc	 mov	 eax, DWORD PTR __Num$[ebp]
  00072	50		 push	 eax
  00073	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  00076	e8 00 00 00 00	 call	 ?_Grow@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAE_NI_N@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Grow
  0007b	0f b6 c8	 movzx	 ecx, al
  0007e	85 c9		 test	 ecx, ecx
  00080	74 46		 je	 SHORT $LN1@append@5

; 961  : 			{	// make room and append new stuff
; 962  : 			_Traits_helper::copy_s<_Traits>(_Myptr() + _Mysize, _Myres - _Mysize,
; 963  : 				_Right._Myptr() + _Roff, _Count);

  00082	8b 55 10	 mov	 edx, DWORD PTR __Count$[ebp]
  00085	52		 push	 edx
  00086	8b 4d 08	 mov	 ecx, DWORD PTR __Right$[ebp]
  00089	e8 00 00 00 00	 call	 ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IBEPB_WXZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Myptr
  0008e	8b 4d 0c	 mov	 ecx, DWORD PTR __Roff$[ebp]
  00091	8d 14 48	 lea	 edx, DWORD PTR [eax+ecx*2]
  00094	52		 push	 edx
  00095	8b 45 f8	 mov	 eax, DWORD PTR _this$[ebp]
  00098	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  0009b	8b 50 18	 mov	 edx, DWORD PTR [eax+24]
  0009e	2b 51 14	 sub	 edx, DWORD PTR [ecx+20]
  000a1	52		 push	 edx
  000a2	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  000a5	e8 00 00 00 00	 call	 ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEPA_WXZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Myptr
  000aa	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  000ad	8b 51 14	 mov	 edx, DWORD PTR [ecx+20]
  000b0	8d 04 50	 lea	 eax, DWORD PTR [eax+edx*2]
  000b3	50		 push	 eax
  000b4	e8 00 00 00 00	 call	 ??$copy_s@U?$char_traits@_W@std@@@_Traits_helper@std@@YAPA_WPA_WIPB_WI@Z ; std::_Traits_helper::copy_s<std::char_traits<wchar_t> >
  000b9	83 c4 10	 add	 esp, 16			; 00000010H

; 964  : 			_Eos(_Num);

  000bc	8b 4d fc	 mov	 ecx, DWORD PTR __Num$[ebp]
  000bf	51		 push	 ecx
  000c0	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  000c3	e8 00 00 00 00	 call	 ?_Eos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXI@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Eos
$LN1@append@5:

; 965  : 			}
; 966  : 		return (*this);

  000c8	8b 45 f8	 mov	 eax, DWORD PTR _this$[ebp]

; 967  : 		}

  000cb	8b e5		 mov	 esp, ebp
  000cd	5d		 pop	 ebp
  000ce	c2 0c 00	 ret	 12			; 0000000cH
?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@II@Z ENDP ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z
_TEXT	SEGMENT
_this$ = -8						; size = 4
__Num$ = -4						; size = 4
__Ptr$ = 8						; size = 4
__Count$ = 12						; size = 4
?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z PROC ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append, COMDAT
; _this$ = ecx

; 970  : 		{	// append [_Ptr, _Ptr + _Count)

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 08	 sub	 esp, 8
  00006	89 4d f8	 mov	 DWORD PTR _this$[ebp], ecx

; 971  : 
; 972  :  #if _HAS_ITERATOR_DEBUGGING
; 973  : 		if (_Count != 0)
; 974  : 			_DEBUG_POINTER(_Ptr);
; 975  :  #endif /* _HAS_ITERATOR_DEBUGGING */
; 976  : 
; 977  : 		if (_Inside(_Ptr))

  00009	8b 45 08	 mov	 eax, DWORD PTR __Ptr$[ebp]
  0000c	50		 push	 eax
  0000d	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  00010	e8 00 00 00 00	 call	 ?_Inside@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAE_NPB_W@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Inside
  00015	0f b6 c8	 movzx	 ecx, al
  00018	85 c9		 test	 ecx, ecx
  0001a	74 25		 je	 SHORT $LN4@append@6

; 978  : 			return (append(*this, _Ptr - _Myptr(), _Count));	// substring

  0001c	8b 55 0c	 mov	 edx, DWORD PTR __Count$[ebp]
  0001f	52		 push	 edx
  00020	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  00023	e8 00 00 00 00	 call	 ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEPA_WXZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Myptr
  00028	8b 4d 08	 mov	 ecx, DWORD PTR __Ptr$[ebp]
  0002b	2b c8		 sub	 ecx, eax
  0002d	d1 f9		 sar	 ecx, 1
  0002f	51		 push	 ecx
  00030	8b 55 f8	 mov	 edx, DWORD PTR _this$[ebp]
  00033	52		 push	 edx
  00034	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  00037	e8 00 00 00 00	 call	 ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@II@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append
  0003c	e9 89 00 00 00	 jmp	 $LN5@append@6
$LN4@append@6:

; 979  : 		if (npos - _Mysize <= _Count || _Mysize + _Count < _Mysize)

  00041	8b 45 f8	 mov	 eax, DWORD PTR _this$[ebp]
  00044	83 c9 ff	 or	 ecx, -1
  00047	2b 48 14	 sub	 ecx, DWORD PTR [eax+20]
  0004a	3b 4d 0c	 cmp	 ecx, DWORD PTR __Count$[ebp]
  0004d	76 11		 jbe	 SHORT $LN2@append@6
  0004f	8b 55 f8	 mov	 edx, DWORD PTR _this$[ebp]
  00052	8b 42 14	 mov	 eax, DWORD PTR [edx+20]
  00055	03 45 0c	 add	 eax, DWORD PTR __Count$[ebp]
  00058	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  0005b	3b 41 14	 cmp	 eax, DWORD PTR [ecx+20]
  0005e	73 05		 jae	 SHORT $LN3@append@6
$LN2@append@6:

; 980  : 			_String_base::_Xlen();	// result too long

  00060	e8 00 00 00 00	 call	 ?_Xlen@_String_base@std@@SAXXZ ; std::_String_base::_Xlen
$LN3@append@6:

; 981  : 
; 982  : 		size_type _Num;
; 983  : 		if (0 < _Count && _Grow(_Num = _Mysize + _Count))

  00065	83 7d 0c 00	 cmp	 DWORD PTR __Count$[ebp], 0
  00069	76 5c		 jbe	 SHORT $LN1@append@6
  0006b	8b 55 f8	 mov	 edx, DWORD PTR _this$[ebp]
  0006e	8b 42 14	 mov	 eax, DWORD PTR [edx+20]
  00071	03 45 0c	 add	 eax, DWORD PTR __Count$[ebp]
  00074	89 45 fc	 mov	 DWORD PTR __Num$[ebp], eax
  00077	6a 00		 push	 0
  00079	8b 4d fc	 mov	 ecx, DWORD PTR __Num$[ebp]
  0007c	51		 push	 ecx
  0007d	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  00080	e8 00 00 00 00	 call	 ?_Grow@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAE_NI_N@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Grow
  00085	0f b6 d0	 movzx	 edx, al
  00088	85 d2		 test	 edx, edx
  0008a	74 3b		 je	 SHORT $LN1@append@6

; 984  : 			{	// make room and append new stuff
; 985  : 			_Traits_helper::copy_s<_Traits>(_Myptr() + _Mysize, _Myres - _Mysize, _Ptr, _Count);

  0008c	8b 45 0c	 mov	 eax, DWORD PTR __Count$[ebp]
  0008f	50		 push	 eax
  00090	8b 4d 08	 mov	 ecx, DWORD PTR __Ptr$[ebp]
  00093	51		 push	 ecx
  00094	8b 55 f8	 mov	 edx, DWORD PTR _this$[ebp]
  00097	8b 45 f8	 mov	 eax, DWORD PTR _this$[ebp]
  0009a	8b 4a 18	 mov	 ecx, DWORD PTR [edx+24]
  0009d	2b 48 14	 sub	 ecx, DWORD PTR [eax+20]
  000a0	51		 push	 ecx
  000a1	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  000a4	e8 00 00 00 00	 call	 ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEPA_WXZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Myptr
  000a9	8b 55 f8	 mov	 edx, DWORD PTR _this$[ebp]
  000ac	8b 4a 14	 mov	 ecx, DWORD PTR [edx+20]
  000af	8d 14 48	 lea	 edx, DWORD PTR [eax+ecx*2]
  000b2	52		 push	 edx
  000b3	e8 00 00 00 00	 call	 ??$copy_s@U?$char_traits@_W@std@@@_Traits_helper@std@@YAPA_WPA_WIPB_WI@Z ; std::_Traits_helper::copy_s<std::char_traits<wchar_t> >
  000b8	83 c4 10	 add	 esp, 16			; 00000010H

; 986  : 			_Eos(_Num);

  000bb	8b 45 fc	 mov	 eax, DWORD PTR __Num$[ebp]
  000be	50		 push	 eax
  000bf	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  000c2	e8 00 00 00 00	 call	 ?_Eos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXI@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Eos
$LN1@append@6:

; 987  : 			}
; 988  : 		return (*this);

  000c7	8b 45 f8	 mov	 eax, DWORD PTR _this$[ebp]
$LN5@append@6:

; 989  : 		}

  000ca	8b e5		 mov	 esp, ebp
  000cc	5d		 pop	 ebp
  000cd	c2 08 00	 ret	 8
?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z ENDP ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_W@Z
_TEXT	SEGMENT
_this$ = -4						; size = 4
__Ptr$ = 8						; size = 4
?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_W@Z PROC ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append, COMDAT
; _this$ = ecx

; 992  : 		{	// append [_Ptr, <null>)

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx
  00004	89 4d fc	 mov	 DWORD PTR _this$[ebp], ecx

; 993  : 		_DEBUG_POINTER(_Ptr);
; 994  : 		return (append(_Ptr, _Traits::length(_Ptr)));

  00007	8b 45 08	 mov	 eax, DWORD PTR __Ptr$[ebp]
  0000a	50		 push	 eax
  0000b	e8 00 00 00 00	 call	 ?length@?$char_traits@_W@std@@SAIPB_W@Z ; std::char_traits<wchar_t>::length
  00010	83 c4 04	 add	 esp, 4
  00013	50		 push	 eax
  00014	8b 4d 08	 mov	 ecx, DWORD PTR __Ptr$[ebp]
  00017	51		 push	 ecx
  00018	8b 4d fc	 mov	 ecx, DWORD PTR _this$[ebp]
  0001b	e8 00 00 00 00	 call	 ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append

; 995  : 		}

  00020	8b e5		 mov	 esp, ebp
  00022	5d		 pop	 ebp
  00023	c2 04 00	 ret	 4
?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_W@Z ENDP ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z
_TEXT	SEGMENT
_this$ = -4						; size = 4
__Ptr$ = 8						; size = 4
??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z PROC ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::operator+=, COMDAT
; _this$ = ecx

; 935  : 		{	// append [_Ptr, <null>)

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx
  00004	89 4d fc	 mov	 DWORD PTR _this$[ebp], ecx

; 936  : 		return (append(_Ptr));

  00007	8b 45 08	 mov	 eax, DWORD PTR __Ptr$[ebp]
  0000a	50		 push	 eax
  0000b	8b 4d fc	 mov	 ecx, DWORD PTR _this$[ebp]
  0000e	e8 00 00 00 00	 call	 ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_W@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append

; 937  : 		}

  00013	8b e5		 mov	 esp, ebp
  00015	5d		 pop	 ebp
  00016	c2 04 00	 ret	 4
??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z ENDP ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::operator+=
_TEXT	ENDS
PUBLIC	?aviEndAllChunks@@YAXPAUAVI_FILE@@@Z		; aviEndAllChunks
; Function compile flags: /Odtp
; File c:\develop\dscaler423a\dscaler\avi.cpp
;	COMDAT ?aviEndAllChunks@@YAXPAUAVI_FILE@@@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
?aviEndAllChunks@@YAXPAUAVI_FILE@@@Z PROC		; aviEndAllChunks, COMDAT

; 750  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
$LN2@aviEndAllC:

; 751  :     while (file->chunk.current > 0)

  00003	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00006	83 b8 50 02 00
	00 00		 cmp	 DWORD PTR [eax+592], 0
  0000d	76 0e		 jbe	 SHORT $LN3@aviEndAllC

; 752  :         aviEndChunk(file);

  0000f	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00012	51		 push	 ecx
  00013	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  00018	83 c4 04	 add	 esp, 4
  0001b	eb e6		 jmp	 SHORT $LN2@aviEndAllC
$LN3@aviEndAllC:

; 753  : }

  0001d	5d		 pop	 ebp
  0001e	c3		 ret	 0
?aviEndAllChunks@@YAXPAUAVI_FILE@@@Z ENDP		; aviEndAllChunks
PUBLIC	?aviCheckFile@@YAXPAUAVI_FILE@@PAUSTREAM_VALUES@@@Z ; aviCheckFile
; Function compile flags: /Odtp
;	COMDAT ?aviCheckFile@@YAXPAUAVI_FILE@@PAUSTREAM_VALUES@@@Z
_TEXT	SEGMENT
tv190 = -44						; size = 8
tv187 = -36						; size = 8
tv159 = -28						; size = 8
tv156 = -20						; size = 8
tv137 = -12						; size = 4
_average$ = -8						; size = 8
_file$ = 8						; size = 4
_values$ = 12						; size = 4
?aviCheckFile@@YAXPAUAVI_FILE@@PAUSTREAM_VALUES@@@Z PROC ; aviCheckFile, COMDAT

; 776  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 2c	 sub	 esp, 44			; 0000002cH
  00006	56		 push	 esi
  00007	57		 push	 edi

; 777  :     int64 average;
; 778  : 
; 779  :     if (values)

  00008	83 7d 0c 00	 cmp	 DWORD PTR _values$[ebp], 0
  0000c	74 14		 je	 SHORT $LN5@aviCheckFi

; 780  :        average = aviGetStreamValueAverage(values);

  0000e	8b 45 0c	 mov	 eax, DWORD PTR _values$[ebp]
  00011	50		 push	 eax
  00012	e8 00 00 00 00	 call	 ?aviGetStreamValueAverage@@YA_JPAUSTREAM_VALUES@@@Z ; aviGetStreamValueAverage
  00017	83 c4 04	 add	 esp, 4
  0001a	89 45 f8	 mov	 DWORD PTR _average$[ebp], eax
  0001d	89 55 fc	 mov	 DWORD PTR _average$[ebp+4], edx

; 781  :        else

  00020	eb 0e		 jmp	 SHORT $LN4@aviCheckFi
$LN5@aviCheckFi:

; 782  :        average = 0;

  00022	c7 45 f8 00 00
	00 00		 mov	 DWORD PTR _average$[ebp], 0
  00029	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _average$[ebp+4], 0
$LN4@aviCheckFi:

; 783  : 
; 784  :     if (file->limit)

  00030	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00033	89 4d f4	 mov	 DWORD PTR tv137[ebp], ecx
  00036	8b 55 f4	 mov	 edx, DWORD PTR tv137[ebp]
  00039	8b 45 f4	 mov	 eax, DWORD PTR tv137[ebp]
  0003c	8b 4a 08	 mov	 ecx, DWORD PTR [edx+8]
  0003f	0b 48 0c	 or	 ecx, DWORD PTR [eax+12]
  00042	74 43		 je	 SHORT $LN3@aviCheckFi

; 785  :     {
; 786  :         /* Determine if the file is getting too large */
; 787  :         if (fileTell(file) >= file->limit + average)

  00044	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00047	52		 push	 edx
  00048	e8 00 00 00 00	 call	 ?fileTell@@YA_JPAUAVI_FILE@@@Z ; fileTell
  0004d	83 c4 04	 add	 esp, 4
  00050	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00053	8b 71 08	 mov	 esi, DWORD PTR [ecx+8]
  00056	03 75 f8	 add	 esi, DWORD PTR _average$[ebp]
  00059	8b 49 0c	 mov	 ecx, DWORD PTR [ecx+12]
  0005c	13 4d fc	 adc	 ecx, DWORD PTR _average$[ebp+4]
  0005f	89 45 ec	 mov	 DWORD PTR tv156[ebp], eax
  00062	89 55 f0	 mov	 DWORD PTR tv156[ebp+4], edx
  00065	89 75 e4	 mov	 DWORD PTR tv159[ebp], esi
  00068	89 4d e8	 mov	 DWORD PTR tv159[ebp+4], ecx
  0006b	8b 55 f0	 mov	 edx, DWORD PTR tv156[ebp+4]
  0006e	3b 55 e8	 cmp	 edx, DWORD PTR tv159[ebp+4]
  00071	7c 14		 jl	 SHORT $LN3@aviCheckFi
  00073	7f 08		 jg	 SHORT $LN8@aviCheckFi
  00075	8b 45 ec	 mov	 eax, DWORD PTR tv156[ebp]
  00078	3b 45 e4	 cmp	 eax, DWORD PTR tv159[ebp]
  0007b	72 0a		 jb	 SHORT $LN3@aviCheckFi
$LN8@aviCheckFi:

; 788  :            file->hold = TRUE;

  0007d	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00080	c7 41 04 01 00
	00 00		 mov	 DWORD PTR [ecx+4], 1
$LN3@aviCheckFi:

; 789  :     }
; 790  : 
; 791  :     if (fileTell(file) - aviGetBaseOffset(file, RIFF_BASE) >=
; 792  :         (int64)CHUNK_LIMIT + average)

  00087	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0008a	52		 push	 edx
  0008b	e8 00 00 00 00	 call	 ?fileTell@@YA_JPAUAVI_FILE@@@Z ; fileTell
  00090	83 c4 04	 add	 esp, 4
  00093	8b f0		 mov	 esi, eax
  00095	8b fa		 mov	 edi, edx
  00097	6a 00		 push	 0
  00099	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0009c	50		 push	 eax
  0009d	e8 00 00 00 00	 call	 ?aviGetBaseOffset@@YA_JPAUAVI_FILE@@H@Z ; aviGetBaseOffset
  000a2	83 c4 08	 add	 esp, 8
  000a5	2b f0		 sub	 esi, eax
  000a7	1b fa		 sbb	 edi, edx
  000a9	8b 4d f8	 mov	 ecx, DWORD PTR _average$[ebp]
  000ac	81 c1 00 00 40
	3d		 add	 ecx, 1027604480		; 3d400000H
  000b2	8b 55 fc	 mov	 edx, DWORD PTR _average$[ebp+4]
  000b5	83 d2 00	 adc	 edx, 0
  000b8	89 75 dc	 mov	 DWORD PTR tv187[ebp], esi
  000bb	89 7d e0	 mov	 DWORD PTR tv187[ebp+4], edi
  000be	89 4d d4	 mov	 DWORD PTR tv190[ebp], ecx
  000c1	89 55 d8	 mov	 DWORD PTR tv190[ebp+4], edx
  000c4	8b 45 e0	 mov	 eax, DWORD PTR tv187[ebp+4]
  000c7	3b 45 d8	 cmp	 eax, DWORD PTR tv190[ebp+4]
  000ca	0f 8c 92 00 00
	00		 jl	 $LN6@aviCheckFi
  000d0	7f 0c		 jg	 SHORT $LN9@aviCheckFi
  000d2	8b 4d dc	 mov	 ecx, DWORD PTR tv187[ebp]
  000d5	3b 4d d4	 cmp	 ecx, DWORD PTR tv190[ebp]
  000d8	0f 82 84 00 00
	00		 jb	 $LN6@aviCheckFi
$LN9@aviCheckFi:

; 793  :     {
; 794  :         /* Split the file */
; 795  : 
; 796  :         /* assert current chunk==LIST movi */
; 797  : 
; 798  :         aviIndexFlush(file);

  000de	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000e1	52		 push	 edx
  000e2	e8 00 00 00 00	 call	 ?aviIndexFlush@@YAXPAUAVI_FILE@@@Z ; aviIndexFlush
  000e7	83 c4 04	 add	 esp, 4

; 799  : 
; 800  :         aviEndChunk(file);

  000ea	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000ed	50		 push	 eax
  000ee	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  000f3	83 c4 04	 add	 esp, 4

; 801  :         aviEndChunk(file);

  000f6	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000f9	51		 push	 ecx
  000fa	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  000ff	83 c4 04	 add	 esp, 4

; 802  : 
; 803  :         /* Start a new RIFF AVIX chunk */
; 804  :         aviSetBaseOffset(file, RIFF_BASE);

  00102	6a 00		 push	 0
  00104	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00107	52		 push	 edx
  00108	e8 00 00 00 00	 call	 ?aviSetBaseOffset@@YAXPAUAVI_FILE@@H@Z ; aviSetBaseOffset
  0010d	83 c4 08	 add	 esp, 8

; 805  : 
; 806  :         aviBeginChunk(file, RIFF_CHUNK);

  00110	68 52 49 46 46	 push	 1179011410		; 46464952H
  00115	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00118	50		 push	 eax
  00119	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  0011e	83 c4 08	 add	 esp, 8

; 807  :         aviWriteFourCC(file, mmioFOURCC('A', 'V', 'I', 'X'));

  00121	68 41 56 49 58	 push	 1481201217		; 58495641H
  00126	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00129	51		 push	 ecx
  0012a	e8 00 00 00 00	 call	 ?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z ; aviWriteFourCC
  0012f	83 c4 08	 add	 esp, 8

; 808  : 
; 809  :         aviSetBaseOffset(file, MOVI_BASE);

  00132	6a 01		 push	 1
  00134	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00137	52		 push	 edx
  00138	e8 00 00 00 00	 call	 ?aviSetBaseOffset@@YAXPAUAVI_FILE@@H@Z ; aviSetBaseOffset
  0013d	83 c4 08	 add	 esp, 8

; 810  : 
; 811  :         aviBeginChunk(file, LIST_CHUNK);

  00140	68 4c 49 53 54	 push	 1414744396		; 5453494cH
  00145	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00148	50		 push	 eax
  00149	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  0014e	83 c4 08	 add	 esp, 8

; 812  :         aviWriteFourCC(file, mmioFOURCC('m', 'o', 'v', 'i'));

  00151	68 6d 6f 76 69	 push	 1769369453		; 69766f6dH
  00156	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00159	51		 push	 ecx
  0015a	e8 00 00 00 00	 call	 ?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z ; aviWriteFourCC
  0015f	83 c4 08	 add	 esp, 8
$LN6@aviCheckFi:

; 813  :     }
; 814  : }

  00162	5f		 pop	 edi
  00163	5e		 pop	 esi
  00164	8b e5		 mov	 esp, ebp
  00166	5d		 pop	 ebp
  00167	c3		 ret	 0
?aviCheckFile@@YAXPAUAVI_FILE@@PAUSTREAM_VALUES@@@Z ENDP ; aviCheckFile
_TEXT	ENDS
PUBLIC	?aviEndChunkWithIndex@@YAKPAUAVI_FILE@@W4stream_t@@KKH@Z ; aviEndChunkWithIndex
; Function compile flags: /Odtp
;	COMDAT ?aviEndChunkWithIndex@@YAKPAUAVI_FILE@@W4stream_t@@KKH@Z
_TEXT	SEGMENT
_size$ = -12						; size = 4
_begin$ = -8						; size = 8
_file$ = 8						; size = 4
_type$ = 12						; size = 4
_replicate$ = 16					; size = 4
_duration$ = 20						; size = 4
_keyFrame$ = 24						; size = 4
?aviEndChunkWithIndex@@YAKPAUAVI_FILE@@W4stream_t@@KKH@Z PROC ; aviEndChunkWithIndex, COMDAT

; 720  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 0c	 sub	 esp, 12			; 0000000cH

; 721  :     int64 begin;
; 722  :     DWORD size;
; 723  : 
; 724  :     assert(file->chunk.current > 0);
; 725  : 
; 726  :     /* Get the offset to the start of the chunk's data */
; 727  :     begin = file->chunk.data[file->chunk.current - 1].begin + 8;

  00006	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00009	8b 88 50 02 00
	00		 mov	 ecx, DWORD PTR [eax+592]
  0000f	83 e9 01	 sub	 ecx, 1
  00012	c1 e1 04	 shl	 ecx, 4
  00015	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00018	8b 84 0a d8 01
	00 00		 mov	 eax, DWORD PTR [edx+ecx+472]
  0001f	83 c0 08	 add	 eax, 8
  00022	8b 8c 0a dc 01
	00 00		 mov	 ecx, DWORD PTR [edx+ecx+476]
  00029	83 d1 00	 adc	 ecx, 0
  0002c	89 45 f8	 mov	 DWORD PTR _begin$[ebp], eax
  0002f	89 4d fc	 mov	 DWORD PTR _begin$[ebp+4], ecx

; 728  : 
; 729  :     /* End the current chunk and save its size */
; 730  :     size = aviEndChunk(file);

  00032	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00035	52		 push	 edx
  00036	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  0003b	83 c4 04	 add	 esp, 4
  0003e	89 45 f4	 mov	 DWORD PTR _size$[ebp], eax

; 731  : 
; 732  :     /* Add a new index for the chunk that was just ended */
; 733  :     replicate++;

  00041	8b 45 10	 mov	 eax, DWORD PTR _replicate$[ebp]
  00044	83 c0 01	 add	 eax, 1
  00047	89 45 10	 mov	 DWORD PTR _replicate$[ebp], eax
$LN2@aviEndChun@2:

; 734  : 
; 735  :     while (replicate > 0)

  0004a	83 7d 10 00	 cmp	 DWORD PTR _replicate$[ebp], 0
  0004e	76 2f		 jbe	 SHORT $LN1@aviEndChun@2

; 736  :     {
; 737  :         aviIndexAddEntry(file, type, begin, size, duration, keyFrame);

  00050	8b 4d 18	 mov	 ecx, DWORD PTR _keyFrame$[ebp]
  00053	51		 push	 ecx
  00054	8b 55 14	 mov	 edx, DWORD PTR _duration$[ebp]
  00057	52		 push	 edx
  00058	8b 45 f4	 mov	 eax, DWORD PTR _size$[ebp]
  0005b	50		 push	 eax
  0005c	8b 4d fc	 mov	 ecx, DWORD PTR _begin$[ebp+4]
  0005f	51		 push	 ecx
  00060	8b 55 f8	 mov	 edx, DWORD PTR _begin$[ebp]
  00063	52		 push	 edx
  00064	8b 45 0c	 mov	 eax, DWORD PTR _type$[ebp]
  00067	50		 push	 eax
  00068	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0006b	51		 push	 ecx
  0006c	e8 00 00 00 00	 call	 ?aviIndexAddEntry@@YAXPAUAVI_FILE@@W4stream_t@@_JKKH@Z ; aviIndexAddEntry
  00071	83 c4 1c	 add	 esp, 28			; 0000001cH

; 738  :         replicate--;

  00074	8b 55 10	 mov	 edx, DWORD PTR _replicate$[ebp]
  00077	83 ea 01	 sub	 edx, 1
  0007a	89 55 10	 mov	 DWORD PTR _replicate$[ebp], edx

; 739  :     }

  0007d	eb cb		 jmp	 SHORT $LN2@aviEndChun@2
$LN1@aviEndChun@2:

; 740  : 
; 741  :     return size;

  0007f	8b 45 f4	 mov	 eax, DWORD PTR _size$[ebp]

; 742  : }

  00082	8b e5		 mov	 esp, ebp
  00084	5d		 pop	 ebp
  00085	c3		 ret	 0
?aviEndChunkWithIndex@@YAKPAUAVI_FILE@@W4stream_t@@KKH@Z ENDP ; aviEndChunkWithIndex
_TEXT	ENDS
PUBLIC	_aviEndWriting
; Function compile flags: /Odtp
;	COMDAT _aviEndWriting
_TEXT	SEGMENT
_largestChunk$ = -4					; size = 4
_file$ = 8						; size = 4
_aviEndWriting PROC					; COMDAT

; 449  : {

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

; 450  :     DWORD largestChunk;
; 451  : 
; 452  :     if (file)

  00004	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00008	0f 84 7e 02 00
	00		 je	 $LN9@aviEndWrit

; 453  :     {
; 454  :         aviVideoCompressorClose(file);

  0000e	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00011	50		 push	 eax
  00012	e8 00 00 00 00	 call	 ?aviVideoCompressorClose@@YAHPAUAVI_FILE@@@Z ; aviVideoCompressorClose
  00017	83 c4 04	 add	 esp, 4

; 455  : 
; 456  :         if (file->flags & AVI_FLAG_AUDIO)

  0001a	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0001d	0f b6 11	 movzx	 edx, BYTE PTR [ecx]
  00020	83 e2 02	 and	 edx, 2
  00023	74 0c		 je	 SHORT $LN7@aviEndWrit

; 457  :            aviAudioEnd(file);

  00025	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00028	50		 push	 eax
  00029	e8 00 00 00 00	 call	 ?aviAudioEnd@@YAXPAUAVI_FILE@@@Z ; aviAudioEnd
  0002e	83 c4 04	 add	 esp, 4
$LN7@aviEndWrit:

; 458  : 
; 459  :         if (fileIsOpen(file))

  00031	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00034	51		 push	 ecx
  00035	e8 00 00 00 00	 call	 ?fileIsOpen@@YAHPAUAVI_FILE@@@Z ; fileIsOpen
  0003a	83 c4 04	 add	 esp, 4
  0003d	85 c0		 test	 eax, eax
  0003f	0f 84 47 02 00
	00		 je	 $LN9@aviEndWrit

; 460  :         {
; 461  :             aviLockFile(file);

  00045	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00048	52		 push	 edx
  00049	e8 00 00 00 00	 call	 ?aviLockFile@@YAXPAUAVI_FILE@@@Z ; aviLockFile
  0004e	83 c4 04	 add	 esp, 4

; 462  : 
; 463  :             aviIndexFlush(file);

  00051	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00054	50		 push	 eax
  00055	e8 00 00 00 00	 call	 ?aviIndexFlush@@YAXPAUAVI_FILE@@@Z ; aviIndexFlush
  0005a	83 c4 04	 add	 esp, 4

; 464  :             aviEndAllChunks(file);

  0005d	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00060	51		 push	 ecx
  00061	e8 00 00 00 00	 call	 ?aviEndAllChunks@@YAXPAUAVI_FILE@@@Z ; aviEndAllChunks
  00066	83 c4 04	 add	 esp, 4

; 465  : 
; 466  :             /* Update dwTotalFrames in the AVI header */
; 467  :             fileSeek(file, aviGetBaseOffset(file, AVIH_BASE) +
; 468  :                            offsetof(MainAVIHeader, dwTotalFrames));

  00069	6a 02		 push	 2
  0006b	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0006e	52		 push	 edx
  0006f	e8 00 00 00 00	 call	 ?aviGetBaseOffset@@YA_JPAUAVI_FILE@@H@Z ; aviGetBaseOffset
  00074	83 c4 08	 add	 esp, 8
  00077	83 c0 10	 add	 eax, 16			; 00000010H
  0007a	83 d2 00	 adc	 edx, 0
  0007d	52		 push	 edx
  0007e	50		 push	 eax
  0007f	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00082	50		 push	 eax
  00083	e8 00 00 00 00	 call	 ?fileSeek@@YAHPAUAVI_FILE@@_J@Z ; fileSeek
  00088	83 c4 0c	 add	 esp, 12			; 0000000cH

; 469  : 
; 470  :             fileWrite(file, &file->legacy.frames, sizeof(DWORD));

  0008b	6a 04		 push	 4
  0008d	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00090	81 c1 30 04 00
	00		 add	 ecx, 1072		; 00000430H
  00096	51		 push	 ecx
  00097	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0009a	52		 push	 edx
  0009b	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  000a0	83 c4 0c	 add	 esp, 12			; 0000000cH

; 471  : 
; 472  :             /* Update dwSuggestedBufferSize in the AVI header */
; 473  :             fileSeek(file, aviGetBaseOffset(file, AVIH_BASE) +
; 474  :                            offsetof(MainAVIHeader, dwSuggestedBufferSize));

  000a3	6a 02		 push	 2
  000a5	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000a8	50		 push	 eax
  000a9	e8 00 00 00 00	 call	 ?aviGetBaseOffset@@YA_JPAUAVI_FILE@@H@Z ; aviGetBaseOffset
  000ae	83 c4 08	 add	 esp, 8
  000b1	83 c0 1c	 add	 eax, 28			; 0000001cH
  000b4	83 d2 00	 adc	 edx, 0
  000b7	52		 push	 edx
  000b8	50		 push	 eax
  000b9	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000bc	51		 push	 ecx
  000bd	e8 00 00 00 00	 call	 ?fileSeek@@YAHPAUAVI_FILE@@_J@Z ; fileSeek
  000c2	83 c4 0c	 add	 esp, 12			; 0000000cH

; 475  : 
; 476  :             /* The suggested buffer size should be the size of the largest
; 477  :                chunk in any of the streams written to the file. Determine which
; 478  :                stream has the largest chunk then write that size to the
; 479  :                file. */
; 480  :             if (((file->flags & AVI_FLAG_AUDIO) &&
; 481  :                  file->video.values.max > file->audio.values.max) ||
; 482  :                 !(file->flags & AVI_FLAG_AUDIO))

  000c5	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000c8	0f b6 02	 movzx	 eax, BYTE PTR [edx]
  000cb	83 e0 02	 and	 eax, 2
  000ce	74 14		 je	 SHORT $LN3@aviEndWrit
  000d0	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000d3	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000d6	8b 81 40 03 00
	00		 mov	 eax, DWORD PTR [ecx+832]
  000dc	3b 82 90 03 00
	00		 cmp	 eax, DWORD PTR [edx+912]
  000e2	77 0b		 ja	 SHORT $LN4@aviEndWrit
$LN3@aviEndWrit:
  000e4	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000e7	0f b6 11	 movzx	 edx, BYTE PTR [ecx]
  000ea	83 e2 02	 and	 edx, 2
  000ed	75 0e		 jne	 SHORT $LN5@aviEndWrit
$LN4@aviEndWrit:

; 483  :                largestChunk = file->video.values.max;

  000ef	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000f2	8b 88 40 03 00
	00		 mov	 ecx, DWORD PTR [eax+832]
  000f8	89 4d fc	 mov	 DWORD PTR _largestChunk$[ebp], ecx

; 484  :                else

  000fb	eb 0c		 jmp	 SHORT $LN2@aviEndWrit
$LN5@aviEndWrit:

; 485  :                largestChunk = file->audio.values.max;

  000fd	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00100	8b 82 90 03 00
	00		 mov	 eax, DWORD PTR [edx+912]
  00106	89 45 fc	 mov	 DWORD PTR _largestChunk$[ebp], eax
$LN2@aviEndWrit:

; 486  : 
; 487  :             fileWrite(file, &largestChunk, sizeof(DWORD));

  00109	6a 04		 push	 4
  0010b	8d 4d fc	 lea	 ecx, DWORD PTR _largestChunk$[ebp]
  0010e	51		 push	 ecx
  0010f	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00112	52		 push	 edx
  00113	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00118	83 c4 0c	 add	 esp, 12			; 0000000cH

; 488  : 
; 489  :             /* Update dwLength in the video stream header */
; 490  :             fileSeek(file, file->video.strhOffset +
; 491  :                            offsetof(AVIStreamHeader, dwLength));

  0011b	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0011e	8b 88 a8 02 00
	00		 mov	 ecx, DWORD PTR [eax+680]
  00124	83 c1 20	 add	 ecx, 32			; 00000020H
  00127	33 d2		 xor	 edx, edx
  00129	52		 push	 edx
  0012a	51		 push	 ecx
  0012b	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0012e	50		 push	 eax
  0012f	e8 00 00 00 00	 call	 ?fileSeek@@YAHPAUAVI_FILE@@_J@Z ; fileSeek
  00134	83 c4 0c	 add	 esp, 12			; 0000000cH

; 492  : 
; 493  :             fileWrite(file, &file->video.numFrames, sizeof(DWORD));

  00137	6a 04		 push	 4
  00139	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0013c	81 c1 30 03 00
	00		 add	 ecx, 816		; 00000330H
  00142	51		 push	 ecx
  00143	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00146	52		 push	 edx
  00147	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  0014c	83 c4 0c	 add	 esp, 12			; 0000000cH

; 494  : 
; 495  :             /* Update dwSuggestedBufferSize in the video stream header */
; 496  :             fileSeek(file, file->video.strhOffset +
; 497  :                            offsetof(AVIStreamHeader, dwSuggestedBufferSize));

  0014f	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00152	8b 88 a8 02 00
	00		 mov	 ecx, DWORD PTR [eax+680]
  00158	83 c1 24	 add	 ecx, 36			; 00000024H
  0015b	33 d2		 xor	 edx, edx
  0015d	52		 push	 edx
  0015e	51		 push	 ecx
  0015f	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00162	50		 push	 eax
  00163	e8 00 00 00 00	 call	 ?fileSeek@@YAHPAUAVI_FILE@@_J@Z ; fileSeek
  00168	83 c4 0c	 add	 esp, 12			; 0000000cH

; 498  : 
; 499  :             largestChunk = file->video.values.max;

  0016b	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0016e	8b 91 40 03 00
	00		 mov	 edx, DWORD PTR [ecx+832]
  00174	89 55 fc	 mov	 DWORD PTR _largestChunk$[ebp], edx

; 500  :             fileWrite(file, &largestChunk, sizeof(DWORD));

  00177	6a 04		 push	 4
  00179	8d 45 fc	 lea	 eax, DWORD PTR _largestChunk$[ebp]
  0017c	50		 push	 eax
  0017d	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00180	51		 push	 ecx
  00181	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00186	83 c4 0c	 add	 esp, 12			; 0000000cH

; 501  : 
; 502  :             if (file->flags & AVI_FLAG_AUDIO)

  00189	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0018c	0f b6 02	 movzx	 eax, BYTE PTR [edx]
  0018f	83 e0 02	 and	 eax, 2
  00192	74 6e		 je	 SHORT $LN1@aviEndWrit

; 503  :             {
; 504  :                 /* Update dwLength in the audio stream header */
; 505  :                 fileSeek(file, file->audio.strhOffset +
; 506  :                                offsetof(AVIStreamHeader, dwLength));

  00194	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00197	8b 91 74 03 00
	00		 mov	 edx, DWORD PTR [ecx+884]
  0019d	83 c2 20	 add	 edx, 32			; 00000020H
  001a0	33 c0		 xor	 eax, eax
  001a2	50		 push	 eax
  001a3	52		 push	 edx
  001a4	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  001a7	51		 push	 ecx
  001a8	e8 00 00 00 00	 call	 ?fileSeek@@YAHPAUAVI_FILE@@_J@Z ; fileSeek
  001ad	83 c4 0c	 add	 esp, 12			; 0000000cH

; 507  : 
; 508  :                 fileWrite(file, &file->audio.streamLength, sizeof(DWORD));

  001b0	6a 04		 push	 4
  001b2	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  001b5	81 c2 84 03 00
	00		 add	 edx, 900		; 00000384H
  001bb	52		 push	 edx
  001bc	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  001bf	50		 push	 eax
  001c0	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  001c5	83 c4 0c	 add	 esp, 12			; 0000000cH

; 509  : 
; 510  :                 /* Update dwSuggestedBufferSize in the audio stream header */
; 511  :                 fileSeek(file, file->audio.strhOffset +
; 512  :                                offsetof(AVIStreamHeader,
; 513  :                                         dwSuggestedBufferSize));

  001c8	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  001cb	8b 91 74 03 00
	00		 mov	 edx, DWORD PTR [ecx+884]
  001d1	83 c2 24	 add	 edx, 36			; 00000024H
  001d4	33 c0		 xor	 eax, eax
  001d6	50		 push	 eax
  001d7	52		 push	 edx
  001d8	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  001db	51		 push	 ecx
  001dc	e8 00 00 00 00	 call	 ?fileSeek@@YAHPAUAVI_FILE@@_J@Z ; fileSeek
  001e1	83 c4 0c	 add	 esp, 12			; 0000000cH

; 514  : 
; 515  :                 largestChunk = file->audio.values.max;

  001e4	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  001e7	8b 82 90 03 00
	00		 mov	 eax, DWORD PTR [edx+912]
  001ed	89 45 fc	 mov	 DWORD PTR _largestChunk$[ebp], eax

; 516  :                 fileWrite(file, &largestChunk, sizeof(DWORD));

  001f0	6a 04		 push	 4
  001f2	8d 4d fc	 lea	 ecx, DWORD PTR _largestChunk$[ebp]
  001f5	51		 push	 ecx
  001f6	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  001f9	52		 push	 edx
  001fa	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  001ff	83 c4 0c	 add	 esp, 12			; 0000000cH
$LN1@aviEndWrit:

; 517  :             }
; 518  : 
; 519  :             /* Update dwTotalFrames in the extended AVI header */
; 520  :             fileSeek(file, aviGetBaseOffset(file, DMLH_BASE) +
; 521  :                            offsetof(ODMLExtendedAVIHeader, dwTotalFrames));

  00202	6a 03		 push	 3
  00204	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00207	50		 push	 eax
  00208	e8 00 00 00 00	 call	 ?aviGetBaseOffset@@YA_JPAUAVI_FILE@@H@Z ; aviGetBaseOffset
  0020d	83 c4 08	 add	 esp, 8
  00210	52		 push	 edx
  00211	50		 push	 eax
  00212	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00215	51		 push	 ecx
  00216	e8 00 00 00 00	 call	 ?fileSeek@@YAHPAUAVI_FILE@@_J@Z ; fileSeek
  0021b	83 c4 0c	 add	 esp, 12			; 0000000cH

; 522  : 
; 523  :             fileWrite(file, &file->video.numFrames, sizeof(DWORD));

  0021e	6a 04		 push	 4
  00220	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00223	81 c2 30 03 00
	00		 add	 edx, 816		; 00000330H
  00229	52		 push	 edx
  0022a	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0022d	50		 push	 eax
  0022e	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00233	83 c4 0c	 add	 esp, 12			; 0000000cH

; 524  : 
; 525  :             fileClose(file);

  00236	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00239	51		 push	 ecx
  0023a	e8 00 00 00 00	 call	 ?fileClose@@YAXPAUAVI_FILE@@@Z ; fileClose
  0023f	83 c4 04	 add	 esp, 4

; 526  : 
; 527  :             aviUnlockFile(file);

  00242	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00245	52		 push	 edx
  00246	e8 00 00 00 00	 call	 ?aviUnlockFile@@YAXPAUAVI_FILE@@@Z ; aviUnlockFile
  0024b	83 c4 04	 add	 esp, 4

; 528  : 
; 529  :             /* Delete critical sections */
; 530  :             DeleteCriticalSection(&file->lock.file);

  0024e	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00251	05 50 01 00 00	 add	 eax, 336		; 00000150H
  00256	50		 push	 eax
  00257	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__DeleteCriticalSection@4

; 531  :             DeleteCriticalSection(&file->lock.timer);

  0025d	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00260	81 c1 68 01 00
	00		 add	 ecx, 360		; 00000168H
  00266	51		 push	 ecx
  00267	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__DeleteCriticalSection@4

; 532  :             DeleteCriticalSection(&file->lock.video);

  0026d	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00270	81 c2 80 01 00
	00		 add	 edx, 384		; 00000180H
  00276	52		 push	 edx
  00277	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__DeleteCriticalSection@4

; 533  :             DeleteCriticalSection(&file->lock.audio);

  0027d	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00280	05 98 01 00 00	 add	 eax, 408		; 00000198H
  00285	50		 push	 eax
  00286	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__DeleteCriticalSection@4
$LN9@aviEndWrit:

; 534  :         }
; 535  :     }
; 536  : }

  0028c	8b e5		 mov	 esp, ebp
  0028e	5d		 pop	 ebp
  0028f	c3		 ret	 0
_aviEndWriting ENDP
_TEXT	ENDS
PUBLIC	__$ArrayPad$
PUBLIC	_aviDisplayError
;	COMDAT xdata$x
xdata$x	SEGMENT
__unwindtable$_aviDisplayError DD 0ffffffffH
	DD	FLAT:__unwindfunclet$_aviDisplayError$0
__ehfuncinfo$_aviDisplayError DD 019930522H
	DD	01H
	DD	FLAT:__unwindtable$_aviDisplayError
	DD	2 DUP(00H)
	DD	2 DUP(00H)
	DD	00H
	DD	00H
; Function compile flags: /Odtp
xdata$x	ENDS
;	COMDAT _aviDisplayError
_TEXT	SEGMENT
_message$ = -52						; size = 28
__$ArrayPad$ = -24					; size = 4
_locationPost$ = -20					; size = 4
_title$ = -16						; size = 4
__$EHRec$ = -12						; size = 12
_file$ = 8						; size = 4
_hWnd$ = 12						; size = 4
_post$ = 16						; size = 4
_aviDisplayError PROC					; COMDAT

; 89   : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	6a ff		 push	 -1
  00005	68 00 00 00 00	 push	 __ehhandler$_aviDisplayError
  0000a	64 a1 00 00 00
	00		 mov	 eax, DWORD PTR fs:0
  00010	50		 push	 eax
  00011	83 ec 28	 sub	 esp, 40			; 00000028H
  00014	a1 00 00 00 00	 mov	 eax, DWORD PTR ___security_cookie
  00019	33 c5		 xor	 eax, ebp
  0001b	89 45 e8	 mov	 DWORD PTR __$ArrayPad$[ebp], eax
  0001e	50		 push	 eax
  0001f	8d 45 f4	 lea	 eax, DWORD PTR __$EHRec$[ebp]
  00022	64 a3 00 00 00
	00		 mov	 DWORD PTR fs:0, eax

; 90   :     tstring message(_T("An error occurred while "));

  00028	68 00 00 00 00	 push	 OFFSET ??_C@_1DC@BCHABBLK@?$AAA?$AAn?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?5?$AAo?$AAc?$AAc?$AAu?$AAr?$AAr?$AAe?$AAd?$AA?5?$AAw?$AAh?$AAi?$AAl?$AAe?$AA?5?$AA?$AA@
  0002d	8d 4d cc	 lea	 ecx, DWORD PTR _message$[ebp]
  00030	e8 00 00 00 00	 call	 ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@PB_W@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >
  00035	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR __$EHRec$[ebp+8], 0

; 91   :     const TCHAR* title = _T("Recording Error");

  0003c	c7 45 f0 00 00
	00 00		 mov	 DWORD PTR _title$[ebp], OFFSET ??_C@_1CA@NBDIHIHD@?$AAR?$AAe?$AAc?$AAo?$AAr?$AAd?$AAi?$AAn?$AAg?$AA?5?$AAE?$AAr?$AAr?$AAo?$AAr?$AA?$AA@

; 92   :     const TCHAR* locationPost = _T(":\n");

  00043	c7 45 ec 00 00
	00 00		 mov	 DWORD PTR _locationPost$[ebp], OFFSET ??_C@_15IEGBJKPD@?$AA?3?$AA?6?$AA?$AA@

; 93   : 
; 94   :     if (file)

  0004a	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  0004e	0f 84 8b 00 00
	00		 je	 $LN5@aviDisplay

; 95   :     {
; 96   :         EnterCriticalSection(&file->error.lock);

  00054	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00057	83 c0 10	 add	 eax, 16			; 00000010H
  0005a	50		 push	 eax
  0005b	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__EnterCriticalSection@4

; 97   : 
; 98   :         /* Get the tstring that describes where the error occurred */
; 99   :         if (file->error.type >= 0 && file->error.type < AVI_MAX_ERROR)

  00061	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00064	83 79 28 00	 cmp	 DWORD PTR [ecx+40], 0
  00068	7c 21		 jl	 SHORT $LN4@aviDisplay
  0006a	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0006d	83 7a 28 09	 cmp	 DWORD PTR [edx+40], 9
  00071	7d 18		 jge	 SHORT $LN4@aviDisplay

; 100  :         {
; 101  :            message += aviErrorLocations[file->error.type];

  00073	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00076	8b 48 28	 mov	 ecx, DWORD PTR [eax+40]
  00079	8b 14 8d 00 00
	00 00		 mov	 edx, DWORD PTR ?aviErrorLocations@@3PAPB_WA[ecx*4]
  00080	52		 push	 edx
  00081	8d 4d cc	 lea	 ecx, DWORD PTR _message$[ebp]
  00084	e8 00 00 00 00	 call	 ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::operator+=

; 102  :         }
; 103  :         else

  00089	eb 0e		 jmp	 SHORT $LN3@aviDisplay
$LN4@aviDisplay:

; 104  :         {
; 105  :            message += aviErrorLocations[AVI_ERROR_NONE];

  0008b	a1 00 00 00 00	 mov	 eax, DWORD PTR ?aviErrorLocations@@3PAPB_WA
  00090	50		 push	 eax
  00091	8d 4d cc	 lea	 ecx, DWORD PTR _message$[ebp]
  00094	e8 00 00 00 00	 call	 ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::operator+=
$LN3@aviDisplay:

; 106  :         }
; 107  :         
; 108  :         message += locationPost;

  00099	8b 4d ec	 mov	 ecx, DWORD PTR _locationPost$[ebp]
  0009c	51		 push	 ecx
  0009d	8d 4d cc	 lea	 ecx, DWORD PTR _message$[ebp]
  000a0	e8 00 00 00 00	 call	 ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::operator+=

; 109  : 
; 110  :         if (post)

  000a5	83 7d 10 00	 cmp	 DWORD PTR _post$[ebp], 0
  000a9	74 0c		 je	 SHORT $LN2@aviDisplay

; 111  :         {
; 112  :             message += post;

  000ab	8b 55 10	 mov	 edx, DWORD PTR _post$[ebp]
  000ae	52		 push	 edx
  000af	8d 4d cc	 lea	 ecx, DWORD PTR _message$[ebp]
  000b2	e8 00 00 00 00	 call	 ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::operator+=
$LN2@aviDisplay:

; 113  :         }
; 114  : 
; 115  :         MessageBox(hWnd, message.c_str(), title, MB_OK | MB_ICONERROR);

  000b7	6a 10		 push	 16			; 00000010H
  000b9	8b 45 f0	 mov	 eax, DWORD PTR _title$[ebp]
  000bc	50		 push	 eax
  000bd	8d 4d cc	 lea	 ecx, DWORD PTR _message$[ebp]
  000c0	e8 00 00 00 00	 call	 ?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::c_str
  000c5	50		 push	 eax
  000c6	8b 4d 0c	 mov	 ecx, DWORD PTR _hWnd$[ebp]
  000c9	51		 push	 ecx
  000ca	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__MessageBoxW@16

; 116  : 
; 117  :         LeaveCriticalSection(&file->error.lock);

  000d0	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000d3	83 c2 10	 add	 edx, 16			; 00000010H
  000d6	52		 push	 edx
  000d7	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__LeaveCriticalSection@4

; 118  :     } 
; 119  :     else

  000dd	eb 15		 jmp	 SHORT $LN1@aviDisplay
$LN5@aviDisplay:

; 120  :     {
; 121  :         MessageBox(hWnd, _T("Unknown error"), title, MB_OK | MB_ICONERROR);

  000df	6a 10		 push	 16			; 00000010H
  000e1	8b 45 f0	 mov	 eax, DWORD PTR _title$[ebp]
  000e4	50		 push	 eax
  000e5	68 00 00 00 00	 push	 OFFSET ??_C@_1BM@MPJJHMIB@?$AAU?$AAn?$AAk?$AAn?$AAo?$AAw?$AAn?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@
  000ea	8b 4d 0c	 mov	 ecx, DWORD PTR _hWnd$[ebp]
  000ed	51		 push	 ecx
  000ee	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__MessageBoxW@16
$LN1@aviDisplay:

; 122  :     }
; 123  : }

  000f4	c7 45 fc ff ff
	ff ff		 mov	 DWORD PTR __$EHRec$[ebp+8], -1
  000fb	8d 4d cc	 lea	 ecx, DWORD PTR _message$[ebp]
  000fe	e8 00 00 00 00	 call	 ??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@XZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::~basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >
  00103	8b 4d f4	 mov	 ecx, DWORD PTR __$EHRec$[ebp]
  00106	64 89 0d 00 00
	00 00		 mov	 DWORD PTR fs:0, ecx
  0010d	59		 pop	 ecx
  0010e	8b 4d e8	 mov	 ecx, DWORD PTR __$ArrayPad$[ebp]
  00111	33 cd		 xor	 ecx, ebp
  00113	e8 00 00 00 00	 call	 @__security_check_cookie@4
  00118	8b e5		 mov	 esp, ebp
  0011a	5d		 pop	 ebp
  0011b	c3		 ret	 0
_TEXT	ENDS
;	COMDAT text$x
text$x	SEGMENT
__unwindfunclet$_aviDisplayError$0:
  00000	8d 4d cc	 lea	 ecx, DWORD PTR _message$[ebp]
  00003	e9 00 00 00 00	 jmp	 ??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@XZ ; std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::~basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >
__ehhandler$_aviDisplayError:
  00008	8b 54 24 08	 mov	 edx, DWORD PTR [esp+8]
  0000c	8d 42 0c	 lea	 eax, DWORD PTR [edx+12]
  0000f	8b 4a d4	 mov	 ecx, DWORD PTR [edx-44]
  00012	33 c8		 xor	 ecx, eax
  00014	e8 00 00 00 00	 call	 @__security_check_cookie@4
  00019	8b 4a f4	 mov	 ecx, DWORD PTR [edx-12]
  0001c	33 c8		 xor	 ecx, eax
  0001e	e8 00 00 00 00	 call	 @__security_check_cookie@4
  00023	b8 00 00 00 00	 mov	 eax, OFFSET __ehfuncinfo$_aviDisplayError
  00028	e9 00 00 00 00	 jmp	 ___CxxFrameHandler3
text$x	ENDS
_aviDisplayError ENDP
PUBLIC	?aviSaveAudio@@YAHPAUAVI_FILE@@PAXKKPAUSTREAM_VALUES@@@Z ; aviSaveAudio
; Function compile flags: /Odtp
;	COMDAT ?aviSaveAudio@@YAHPAUAVI_FILE@@PAXKKPAUSTREAM_VALUES@@@Z
_TEXT	SEGMENT
_result$ = -4						; size = 4
_file$ = 8						; size = 4
_src$ = 12						; size = 4
_size$ = 16						; size = 4
_samples$ = 20						; size = 4
_values$ = 24						; size = 4
?aviSaveAudio@@YAHPAUAVI_FILE@@PAXKKPAUSTREAM_VALUES@@@Z PROC ; aviSaveAudio, COMDAT

; 1004 : {

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

; 1005 :     BOOL result;
; 1006 : 
; 1007 :     if (!file || !src)

  00004	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00008	74 06		 je	 SHORT $LN1@aviSaveAud
  0000a	83 7d 0c 00	 cmp	 DWORD PTR _src$[ebp], 0
  0000e	75 04		 jne	 SHORT $LN2@aviSaveAud
$LN1@aviSaveAud:

; 1008 :        return FALSE;

  00010	33 c0		 xor	 eax, eax
  00012	eb 6e		 jmp	 SHORT $LN3@aviSaveAud
$LN2@aviSaveAud:

; 1009 : 
; 1010 :     aviLockFile(file);

  00014	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00017	50		 push	 eax
  00018	e8 00 00 00 00	 call	 ?aviLockFile@@YAXPAUAVI_FILE@@@Z ; aviLockFile
  0001d	83 c4 04	 add	 esp, 4

; 1011 : 
; 1012 :     aviBeginChunk(file, file->audio.cc.data);

  00020	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00023	8b 91 48 03 00
	00		 mov	 edx, DWORD PTR [ecx+840]
  00029	52		 push	 edx
  0002a	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0002d	50		 push	 eax
  0002e	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  00033	83 c4 08	 add	 esp, 8

; 1013 :     result = fileWrite(file, src, size);

  00036	8b 4d 10	 mov	 ecx, DWORD PTR _size$[ebp]
  00039	51		 push	 ecx
  0003a	8b 55 0c	 mov	 edx, DWORD PTR _src$[ebp]
  0003d	52		 push	 edx
  0003e	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00041	50		 push	 eax
  00042	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00047	83 c4 0c	 add	 esp, 12			; 0000000cH
  0004a	89 45 fc	 mov	 DWORD PTR _result$[ebp], eax

; 1014 :     aviEndChunkWithIndex(file, AUDIO_STREAM, 0, samples, FALSE);

  0004d	6a 00		 push	 0
  0004f	8b 4d 14	 mov	 ecx, DWORD PTR _samples$[ebp]
  00052	51		 push	 ecx
  00053	6a 00		 push	 0
  00055	6a 01		 push	 1
  00057	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0005a	52		 push	 edx
  0005b	e8 00 00 00 00	 call	 ?aviEndChunkWithIndex@@YAKPAUAVI_FILE@@W4stream_t@@KKH@Z ; aviEndChunkWithIndex
  00060	83 c4 14	 add	 esp, 20			; 00000014H

; 1015 : 
; 1016 :     aviCheckFile(file, values);

  00063	8b 45 18	 mov	 eax, DWORD PTR _values$[ebp]
  00066	50		 push	 eax
  00067	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0006a	51		 push	 ecx
  0006b	e8 00 00 00 00	 call	 ?aviCheckFile@@YAXPAUAVI_FILE@@PAUSTREAM_VALUES@@@Z ; aviCheckFile
  00070	83 c4 08	 add	 esp, 8

; 1017 : 
; 1018 :     aviUnlockFile(file);

  00073	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00076	52		 push	 edx
  00077	e8 00 00 00 00	 call	 ?aviUnlockFile@@YAXPAUAVI_FILE@@@Z ; aviUnlockFile
  0007c	83 c4 04	 add	 esp, 4

; 1019 : 
; 1020 :     return result;

  0007f	8b 45 fc	 mov	 eax, DWORD PTR _result$[ebp]
$LN3@aviSaveAud:

; 1021 : }

  00082	8b e5		 mov	 esp, ebp
  00084	5d		 pop	 ebp
  00085	c3		 ret	 0
?aviSaveAudio@@YAHPAUAVI_FILE@@PAXKKPAUSTREAM_VALUES@@@Z ENDP ; aviSaveAudio
_TEXT	ENDS
PUBLIC	_aviSaveFrame
; Function compile flags: /Odtp
;	COMDAT _aviSaveFrame
_TEXT	SEGMENT
tv413 = -48						; size = 8
tv366 = -40						; size = 4
tv365 = -36						; size = 4
_result$ = -32						; size = 4
_isKey$ = -28						; size = 4
_data$ = -24						; size = 4
_size$ = -20						; size = 4
_temp$ = -16						; size = 8
_writeFrames$ = -8					; size = 4
_count$ = -4						; size = 4
_file$ = 8						; size = 4
_src$ = 12						; size = 4
_inTime$ = 16						; size = 8
_aviSaveFrame PROC					; COMDAT

; 826  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 30	 sub	 esp, 48			; 00000030H
  00006	56		 push	 esi

; 827  :     DWORD     size;
; 828  :     BOOL      isKey;
; 829  :     BOOL      result = TRUE;

  00007	c7 45 e0 01 00
	00 00		 mov	 DWORD PTR _result$[ebp], 1

; 830  :     void      *data;
; 831  :     int       writeFrames;
; 832  :     int       count;
; 833  :     aviTime_t temp;
; 834  : 
; 835  :     if (!file || !src)

  0000e	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00012	74 06		 je	 SHORT $LN20@aviSaveFra
  00014	83 7d 0c 00	 cmp	 DWORD PTR _src$[ebp], 0
  00018	75 07		 jne	 SHORT $LN21@aviSaveFra
$LN20@aviSaveFra:

; 836  :        return FALSE;

  0001a	33 c0		 xor	 eax, eax
  0001c	e9 62 04 00 00	 jmp	 $LN22@aviSaveFra
$LN21@aviSaveFra:

; 837  : 
; 838  :     /* Stop here if no more data is supposed to be written */
; 839  :     if (file->hold)

  00021	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00024	83 78 04 00	 cmp	 DWORD PTR [eax+4], 0
  00028	74 0a		 je	 SHORT $LN19@aviSaveFra

; 840  :        return TRUE;

  0002a	b8 01 00 00 00	 mov	 eax, 1
  0002f	e9 4f 04 00 00	 jmp	 $LN22@aviSaveFra
$LN19@aviSaveFra:

; 841  : 
; 842  :     writeFrames = 1;

  00034	c7 45 f8 01 00
	00 00		 mov	 DWORD PTR _writeFrames$[ebp], 1

; 843  : 
; 844  :     aviLockVideo(file);

  0003b	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0003e	51		 push	 ecx
  0003f	e8 00 00 00 00	 call	 ?aviLockVideo@@YAXPAUAVI_FILE@@@Z ; aviLockVideo
  00044	83 c4 04	 add	 esp, 4

; 845  :     aviLockTimer(file);

  00047	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0004a	52		 push	 edx
  0004b	e8 00 00 00 00	 call	 ?aviLockTimer@@YAXPAUAVI_FILE@@@Z ; aviLockTimer
  00050	83 c4 04	 add	 esp, 4

; 846  : 
; 847  :     if (!aviTimerStarted(file))

  00053	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00056	50		 push	 eax
  00057	e8 00 00 00 00	 call	 ?aviTimerStarted@@YAHPAUAVI_FILE@@@Z ; aviTimerStarted
  0005c	83 c4 04	 add	 esp, 4
  0005f	85 c0		 test	 eax, eax
  00061	75 5f		 jne	 SHORT $LN18@aviSaveFra

; 848  :     {
; 849  :         file->video.timer.frames         = 1;

  00063	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00066	c7 81 80 02 00
	00 01 00 00 00	 mov	 DWORD PTR [ecx+640], 1

; 850  :         file->video.timer.extraFrames    = 0;

  00070	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00073	c7 82 90 02 00
	00 00 00 00 00	 mov	 DWORD PTR [edx+656], 0

; 851  :         file->video.timer.lostFrames     = 0;

  0007d	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00080	c7 80 94 02 00
	00 00 00 00 00	 mov	 DWORD PTR [eax+660], 0

; 852  :         file->video.timer.expectedFrames = file->video.fps;

  0008a	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0008d	d9 81 34 03 00
	00		 fld	 DWORD PTR [ecx+820]
  00093	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00096	dd 9a 88 02 00
	00		 fstp	 QWORD PTR [edx+648]

; 853  :         file->video.missing.frames       = 0;

  0009c	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0009f	c7 80 98 02 00
	00 00 00 00 00	 mov	 DWORD PTR [eax+664], 0

; 854  : 
; 855  :         aviTimerSetStart(file, inTime);

  000a9	8b 4d 14	 mov	 ecx, DWORD PTR _inTime$[ebp+4]
  000ac	51		 push	 ecx
  000ad	8b 55 10	 mov	 edx, DWORD PTR _inTime$[ebp]
  000b0	52		 push	 edx
  000b1	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000b4	50		 push	 eax
  000b5	e8 00 00 00 00	 call	 ?aviTimerSetStart@@YAXPAUAVI_FILE@@_J@Z ; aviTimerSetStart
  000ba	83 c4 0c	 add	 esp, 12			; 0000000cH

; 856  :     } else

  000bd	e9 72 02 00 00	 jmp	 $LN13@aviSaveFra
$LN18@aviSaveFra:

; 857  :     {
; 858  :         if (file->flags & AVI_FLAG_AUDIO)

  000c2	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000c5	0f b6 11	 movzx	 edx, BYTE PTR [ecx]
  000c8	83 e2 02	 and	 edx, 2
  000cb	0f 84 63 02 00
	00		 je	 $LN13@aviSaveFra

; 859  :         {
; 860  :             /* Make sure that only FPS number of frames are written for each
; 861  :                second */
; 862  :             writeFrames = 1;

  000d1	c7 45 f8 01 00
	00 00		 mov	 DWORD PTR _writeFrames$[ebp], 1

; 863  :             if (file->video.timer.frames < (int)file->video.timer.expectedFrames)

  000d8	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  000db	dd 80 88 02 00
	00		 fld	 QWORD PTR [eax+648]
  000e1	e8 00 00 00 00	 call	 __ftol2_sse
  000e6	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000e9	39 81 80 02 00
	00		 cmp	 DWORD PTR [ecx+640], eax
  000ef	7d 17		 jge	 SHORT $LN15@aviSaveFra

; 864  :                file->video.timer.frames++;

  000f1	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000f4	8b 82 80 02 00
	00		 mov	 eax, DWORD PTR [edx+640]
  000fa	83 c0 01	 add	 eax, 1
  000fd	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00100	89 81 80 02 00
	00		 mov	 DWORD PTR [ecx+640], eax

; 865  :                else

  00106	eb 1c		 jmp	 SHORT $LN14@aviSaveFra
$LN15@aviSaveFra:

; 866  :                {
; 867  :                    file->video.timer.extraFrames++;

  00108	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0010b	8b 82 90 02 00
	00		 mov	 eax, DWORD PTR [edx+656]
  00111	83 c0 01	 add	 eax, 1
  00114	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00117	89 81 90 02 00
	00		 mov	 DWORD PTR [ecx+656], eax

; 868  :                    writeFrames = 0;

  0011d	c7 45 f8 00 00
	00 00		 mov	 DWORD PTR _writeFrames$[ebp], 0
$LN14@aviSaveFra:

; 869  :                }
; 870  : 
; 871  :             /* Has a second passed? */
; 872  :             if (file->timer.elapsed >= file->timer.freq)

  00124	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00127	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0012a	89 55 dc	 mov	 DWORD PTR tv365[ebp], edx
  0012d	89 45 d8	 mov	 DWORD PTR tv366[ebp], eax
  00130	8b 4d dc	 mov	 ecx, DWORD PTR tv365[ebp]
  00133	8b 55 d8	 mov	 edx, DWORD PTR tv366[ebp]
  00136	8b 81 74 02 00
	00		 mov	 eax, DWORD PTR [ecx+628]
  0013c	3b 82 5c 02 00
	00		 cmp	 eax, DWORD PTR [edx+604]
  00142	0f 8c ec 01 00
	00		 jl	 $LN13@aviSaveFra
  00148	7f 18		 jg	 SHORT $LN24@aviSaveFra
  0014a	8b 4d dc	 mov	 ecx, DWORD PTR tv365[ebp]
  0014d	8b 55 d8	 mov	 edx, DWORD PTR tv366[ebp]
  00150	8b 81 70 02 00
	00		 mov	 eax, DWORD PTR [ecx+624]
  00156	3b 82 58 02 00
	00		 cmp	 eax, DWORD PTR [edx+600]
  0015c	0f 82 d2 01 00
	00		 jb	 $LN13@aviSaveFra
$LN24@aviSaveFra:

; 873  :             {
; 874  :                 /* Reset the extra frame counter */
; 875  :                 count = 0;

  00162	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _count$[ebp], 0

; 876  : 
; 877  :                 /* Make sure that the expected frame count is met */
; 878  :                 if (file->video.timer.frames < (int)file->video.timer.expectedFrames)

  00169	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0016c	dd 81 88 02 00
	00		 fld	 QWORD PTR [ecx+648]
  00172	e8 00 00 00 00	 call	 __ftol2_sse
  00177	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0017a	39 82 80 02 00
	00		 cmp	 DWORD PTR [edx+640], eax
  00180	7d 1d		 jge	 SHORT $LN12@aviSaveFra

; 879  :                    count += (int)file->video.timer.expectedFrames -
; 880  :                             file->video.timer.frames;

  00182	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00185	dd 80 88 02 00
	00		 fld	 QWORD PTR [eax+648]
  0018b	e8 00 00 00 00	 call	 __ftol2_sse
  00190	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00193	2b 81 80 02 00
	00		 sub	 eax, DWORD PTR [ecx+640]
  00199	03 45 fc	 add	 eax, DWORD PTR _count$[ebp]
  0019c	89 45 fc	 mov	 DWORD PTR _count$[ebp], eax
$LN12@aviSaveFra:

; 881  : 
; 882  :                 /* Calculate the number of seconds that have passed */
; 883  :                 temp = file->timer.elapsed / file->timer.freq;

  0019f	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  001a2	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  001a5	8b 88 5c 02 00
	00		 mov	 ecx, DWORD PTR [eax+604]
  001ab	51		 push	 ecx
  001ac	8b 80 58 02 00
	00		 mov	 eax, DWORD PTR [eax+600]
  001b2	50		 push	 eax
  001b3	8b 8a 74 02 00
	00		 mov	 ecx, DWORD PTR [edx+628]
  001b9	51		 push	 ecx
  001ba	8b 92 70 02 00
	00		 mov	 edx, DWORD PTR [edx+624]
  001c0	52		 push	 edx
  001c1	e8 00 00 00 00	 call	 __alldiv
  001c6	89 45 f0	 mov	 DWORD PTR _temp$[ebp], eax
  001c9	89 55 f4	 mov	 DWORD PTR _temp$[ebp+4], edx

; 884  : 
; 885  :                 /* Make up for any lost frames in other seconds */
; 886  :                 if (temp > 1)

  001cc	83 7d f4 00	 cmp	 DWORD PTR _temp$[ebp+4], 0
  001d0	7c 31		 jl	 SHORT $LN11@aviSaveFra
  001d2	7f 06		 jg	 SHORT $LN25@aviSaveFra
  001d4	83 7d f0 01	 cmp	 DWORD PTR _temp$[ebp], 1
  001d8	76 29		 jbe	 SHORT $LN11@aviSaveFra
$LN25@aviSaveFra:

; 887  :                    count += (int)(file->video.fps * (float)(temp - 1));

  001da	8b 45 f0	 mov	 eax, DWORD PTR _temp$[ebp]
  001dd	83 e8 01	 sub	 eax, 1
  001e0	8b 4d f4	 mov	 ecx, DWORD PTR _temp$[ebp+4]
  001e3	83 d9 00	 sbb	 ecx, 0
  001e6	89 45 d0	 mov	 DWORD PTR tv413[ebp], eax
  001e9	89 4d d4	 mov	 DWORD PTR tv413[ebp+4], ecx
  001ec	df 6d d0	 fild	 QWORD PTR tv413[ebp]
  001ef	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  001f2	d8 8a 34 03 00
	00		 fmul	 DWORD PTR [edx+820]
  001f8	e8 00 00 00 00	 call	 __ftol2_sse
  001fd	03 45 fc	 add	 eax, DWORD PTR _count$[ebp]
  00200	89 45 fc	 mov	 DWORD PTR _count$[ebp], eax
$LN11@aviSaveFra:

; 888  : 
; 889  :                 if (count > 0)

  00203	83 7d fc 00	 cmp	 DWORD PTR _count$[ebp], 0
  00207	0f 8e af 00 00
	00		 jle	 $LN7@aviSaveFra

; 890  :                 {
; 891  :                     file->video.timer.frames += count;

  0020d	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00210	8b 88 80 02 00
	00		 mov	 ecx, DWORD PTR [eax+640]
  00216	03 4d fc	 add	 ecx, DWORD PTR _count$[ebp]
  00219	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0021c	89 8a 80 02 00
	00		 mov	 DWORD PTR [edx+640], ecx

; 892  :                     file->video.timer.lostFrames += count;

  00222	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00225	8b 88 94 02 00
	00		 mov	 ecx, DWORD PTR [eax+660]
  0022b	03 4d fc	 add	 ecx, DWORD PTR _count$[ebp]
  0022e	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00231	89 8a 94 02 00
	00		 mov	 DWORD PTR [edx+660], ecx

; 893  : 
; 894  :                     /* Add these lost frames into the total number of missing
; 895  :                        frames */
; 896  :                     file->video.missing.frames += count;

  00237	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0023a	8b 88 98 02 00
	00		 mov	 ecx, DWORD PTR [eax+664]
  00240	03 4d fc	 add	 ecx, DWORD PTR _count$[ebp]
  00243	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00246	89 8a 98 02 00
	00		 mov	 DWORD PTR [edx+664], ecx

; 897  : 
; 898  :                     /* Keep spreading out the duplicate frames as long as the
; 899  :                        number of missing frames stays below 1 second.
; 900  :                        Otherwise just duplicate all of the missing frames at
; 901  :                        once. */
; 902  :                     if (file->video.missing.frames <= file->video.fps)

  0024c	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0024f	db 80 98 02 00
	00		 fild	 DWORD PTR [eax+664]
  00255	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00258	d9 81 34 03 00
	00		 fld	 DWORD PTR [ecx+820]
  0025e	de d9		 fcompp
  00260	df e0		 fnstsw	 ax
  00262	f6 c4 01	 test	 ah, 1
  00265	75 2a		 jne	 SHORT $LN9@aviSaveFra

; 903  :                        file->video.missing.step = (int)((float)file->video.missing.frames /
; 904  :                                                         ((float)file->video.fps / 4.0f));

  00267	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0026a	db 82 98 02 00
	00		 fild	 DWORD PTR [edx+664]
  00270	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00273	d9 80 34 03 00
	00		 fld	 DWORD PTR [eax+820]
  00279	dc 35 00 00 00
	00		 fdiv	 QWORD PTR __real@4010000000000000
  0027f	de f9		 fdivp	 ST(1), ST(0)
  00281	e8 00 00 00 00	 call	 __ftol2_sse
  00286	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00289	89 81 9c 02 00
	00		 mov	 DWORD PTR [ecx+668], eax

; 905  :                        else

  0028f	eb 12		 jmp	 SHORT $LN8@aviSaveFra
$LN9@aviSaveFra:

; 906  :                        file->video.missing.step = file->video.missing.frames;

  00291	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00294	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00297	8b 88 98 02 00
	00		 mov	 ecx, DWORD PTR [eax+664]
  0029d	89 8a 9c 02 00
	00		 mov	 DWORD PTR [edx+668], ecx
$LN8@aviSaveFra:

; 907  : 
; 908  :                     if (file->video.missing.step < 1)

  002a3	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  002a6	83 ba 9c 02 00
	00 01		 cmp	 DWORD PTR [edx+668], 1
  002ad	7d 0d		 jge	 SHORT $LN7@aviSaveFra

; 909  :                        file->video.missing.step = 1;

  002af	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  002b2	c7 80 9c 02 00
	00 01 00 00 00	 mov	 DWORD PTR [eax+668], 1
$LN7@aviSaveFra:

; 910  :                 }
; 911  : 
; 912  :                 #ifdef AVI_DEBUG
; 913  :                 if (file->video.timer.extraFrames > 0 ||
; 914  :                     file->video.timer.lostFrames > 0 ||
; 915  :                     file->timer.elapsed - (temp * file->timer.freq) > 0)
; 916  :                 {
; 917  :                    cprintf(_T("%d second(s), %d frame(s), %d extra, %d lost"),
; 918  :                                                    (int)temp,
; 919  :                                                    file->video.timer.frames,
; 920  :                                                    file->video.timer.extraFrames,
; 921  :                                                    file->video.timer.lostFrames);
; 922  : 
; 923  :                     cprintf(_T(", elapsed: %u"), (unsigned long)(file->timer.elapsed - (temp * file->timer.freq)));
; 924  : 
; 925  :                     if (file->video.timer.lostFrames > 0)
; 926  :                        cprintf(_T(", %u MB"), (unsigned long)(fileTell(file) / (1024 * 1024)));
; 927  : 
; 928  :                     cprintf(_T("\n"));
; 929  :                 }
; 930  :                 #endif
; 931  : 
; 932  :                 /* Calculate the number of frames that are expected for the
; 933  :                    next second */
; 934  :                 file->video.timer.expectedFrames += (float)temp *
; 935  :                                                     file->video.fps;

  002bc	df 6d f0	 fild	 QWORD PTR _temp$[ebp]
  002bf	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  002c2	d8 89 34 03 00
	00		 fmul	 DWORD PTR [ecx+820]
  002c8	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  002cb	dc 82 88 02 00
	00		 fadd	 QWORD PTR [edx+648]
  002d1	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  002d4	dd 98 88 02 00
	00		 fstp	 QWORD PTR [eax+648]

; 936  : 
; 937  :                 /* Reset the frame counters */
; 938  :                 file->video.timer.extraFrames = 0;

  002da	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  002dd	c7 81 90 02 00
	00 00 00 00 00	 mov	 DWORD PTR [ecx+656], 0

; 939  :                 file->video.timer.lostFrames  = 0;

  002e7	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  002ea	c7 82 94 02 00
	00 00 00 00 00	 mov	 DWORD PTR [edx+660], 0

; 940  :                 file->timer.elapsed -= temp * file->timer.freq;

  002f4	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  002f7	8b 88 5c 02 00
	00		 mov	 ecx, DWORD PTR [eax+604]
  002fd	51		 push	 ecx
  002fe	8b 90 58 02 00
	00		 mov	 edx, DWORD PTR [eax+600]
  00304	52		 push	 edx
  00305	8b 45 f4	 mov	 eax, DWORD PTR _temp$[ebp+4]
  00308	50		 push	 eax
  00309	8b 4d f0	 mov	 ecx, DWORD PTR _temp$[ebp]
  0030c	51		 push	 ecx
  0030d	e8 00 00 00 00	 call	 __allmul
  00312	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00315	8b b1 70 02 00
	00		 mov	 esi, DWORD PTR [ecx+624]
  0031b	2b f0		 sub	 esi, eax
  0031d	8b 81 74 02 00
	00		 mov	 eax, DWORD PTR [ecx+628]
  00323	1b c2		 sbb	 eax, edx
  00325	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00328	89 b1 70 02 00
	00		 mov	 DWORD PTR [ecx+624], esi
  0032e	89 81 74 02 00
	00		 mov	 DWORD PTR [ecx+628], eax
$LN13@aviSaveFra:

; 941  :             }
; 942  :         }
; 943  :     }
; 944  : 
; 945  :     aviUnlockTimer(file);

  00334	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00337	52		 push	 edx
  00338	e8 00 00 00 00	 call	 ?aviUnlockTimer@@YAXPAUAVI_FILE@@@Z ; aviUnlockTimer
  0033d	83 c4 04	 add	 esp, 4

; 946  : 
; 947  :     /* Update the number of frames to write if there are still missing
; 948  :        frames */
; 949  :     if (file->video.missing.frames > 0)

  00340	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00343	83 b8 98 02 00
	00 00		 cmp	 DWORD PTR [eax+664], 0
  0034a	7e 4c		 jle	 SHORT $LN6@aviSaveFra

; 950  :     {
; 951  :         if (file->video.missing.step <= file->video.missing.frames)

  0034c	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0034f	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00352	8b 81 9c 02 00
	00		 mov	 eax, DWORD PTR [ecx+668]
  00358	3b 82 98 02 00
	00		 cmp	 eax, DWORD PTR [edx+664]
  0035e	7f 0e		 jg	 SHORT $LN5@aviSaveFra

; 952  :            count = file->video.missing.step;

  00360	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00363	8b 91 9c 02 00
	00		 mov	 edx, DWORD PTR [ecx+668]
  00369	89 55 fc	 mov	 DWORD PTR _count$[ebp], edx

; 953  :            else

  0036c	eb 0c		 jmp	 SHORT $LN4@aviSaveFra
$LN5@aviSaveFra:

; 954  :            count = file->video.missing.frames;

  0036e	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00371	8b 88 98 02 00
	00		 mov	 ecx, DWORD PTR [eax+664]
  00377	89 4d fc	 mov	 DWORD PTR _count$[ebp], ecx
$LN4@aviSaveFra:

; 955  : 
; 956  :         file->video.missing.frames -= count;

  0037a	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0037d	8b 82 98 02 00
	00		 mov	 eax, DWORD PTR [edx+664]
  00383	2b 45 fc	 sub	 eax, DWORD PTR _count$[ebp]
  00386	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00389	89 81 98 02 00
	00		 mov	 DWORD PTR [ecx+664], eax

; 957  :         writeFrames += count;

  0038f	8b 55 f8	 mov	 edx, DWORD PTR _writeFrames$[ebp]
  00392	03 55 fc	 add	 edx, DWORD PTR _count$[ebp]
  00395	89 55 f8	 mov	 DWORD PTR _writeFrames$[ebp], edx
$LN6@aviSaveFra:

; 958  :     }
; 959  : 
; 960  :     if (writeFrames > 0)

  00398	83 7d f8 00	 cmp	 DWORD PTR _writeFrames$[ebp], 0
  0039c	0f 8e d2 00 00
	00		 jle	 $LN3@aviSaveFra

; 961  :     {
; 962  :         data = aviVideoCompressData(file, src, &isKey, &size);

  003a2	8d 45 ec	 lea	 eax, DWORD PTR _size$[ebp]
  003a5	50		 push	 eax
  003a6	8d 4d e4	 lea	 ecx, DWORD PTR _isKey$[ebp]
  003a9	51		 push	 ecx
  003aa	8b 55 0c	 mov	 edx, DWORD PTR _src$[ebp]
  003ad	52		 push	 edx
  003ae	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  003b1	50		 push	 eax
  003b2	e8 00 00 00 00	 call	 ?aviVideoCompressData@@YAPAXPAUAVI_FILE@@PAXPAHPAK@Z ; aviVideoCompressData
  003b7	83 c4 10	 add	 esp, 16			; 00000010H
  003ba	89 45 e8	 mov	 DWORD PTR _data$[ebp], eax

; 963  : 
; 964  :         aviLockFile(file);

  003bd	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  003c0	51		 push	 ecx
  003c1	e8 00 00 00 00	 call	 ?aviLockFile@@YAXPAUAVI_FILE@@@Z ; aviLockFile
  003c6	83 c4 04	 add	 esp, 4

; 965  :         aviBeginChunk(file, file->video.cc.data);

  003c9	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  003cc	8b 82 a0 02 00
	00		 mov	 eax, DWORD PTR [edx+672]
  003d2	50		 push	 eax
  003d3	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  003d6	51		 push	 ecx
  003d7	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  003dc	83 c4 08	 add	 esp, 8

; 966  : 
; 967  :         if (data && size > 0)

  003df	83 7d e8 00	 cmp	 DWORD PTR _data$[ebp], 0
  003e3	74 25		 je	 SHORT $LN1@aviSaveFra
  003e5	83 7d ec 00	 cmp	 DWORD PTR _size$[ebp], 0
  003e9	76 1f		 jbe	 SHORT $LN1@aviSaveFra

; 968  :         {
; 969  :             if (!fileWrite(file, data, size))

  003eb	8b 55 ec	 mov	 edx, DWORD PTR _size$[ebp]
  003ee	52		 push	 edx
  003ef	8b 45 e8	 mov	 eax, DWORD PTR _data$[ebp]
  003f2	50		 push	 eax
  003f3	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  003f6	51		 push	 ecx
  003f7	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  003fc	83 c4 0c	 add	 esp, 12			; 0000000cH
  003ff	85 c0		 test	 eax, eax
  00401	75 07		 jne	 SHORT $LN1@aviSaveFra

; 970  :                result = FALSE;

  00403	c7 45 e0 00 00
	00 00		 mov	 DWORD PTR _result$[ebp], 0
$LN1@aviSaveFra:

; 971  :         }
; 972  : 
; 973  :         size = aviEndChunkWithIndex(file, VIDEO_STREAM, writeFrames - 1, 1,
; 974  :                                     isKey);

  0040a	8b 55 e4	 mov	 edx, DWORD PTR _isKey$[ebp]
  0040d	52		 push	 edx
  0040e	6a 01		 push	 1
  00410	8b 45 f8	 mov	 eax, DWORD PTR _writeFrames$[ebp]
  00413	83 e8 01	 sub	 eax, 1
  00416	50		 push	 eax
  00417	6a 00		 push	 0
  00419	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0041c	51		 push	 ecx
  0041d	e8 00 00 00 00	 call	 ?aviEndChunkWithIndex@@YAKPAUAVI_FILE@@W4stream_t@@KKH@Z ; aviEndChunkWithIndex
  00422	83 c4 14	 add	 esp, 20			; 00000014H
  00425	89 45 ec	 mov	 DWORD PTR _size$[ebp], eax

; 975  : 
; 976  :         /* Update the maximum and average chunk sizes for this stream */
; 977  :         aviAddStreamValue(&file->video.values, size);

  00428	8b 55 ec	 mov	 edx, DWORD PTR _size$[ebp]
  0042b	52		 push	 edx
  0042c	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0042f	05 38 03 00 00	 add	 eax, 824		; 00000338H
  00434	50		 push	 eax
  00435	e8 00 00 00 00	 call	 ?aviAddStreamValue@@YAXPAUSTREAM_VALUES@@K@Z ; aviAddStreamValue
  0043a	83 c4 08	 add	 esp, 8

; 978  : 
; 979  :         file->video.numFrames += writeFrames;

  0043d	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00440	8b 91 30 03 00
	00		 mov	 edx, DWORD PTR [ecx+816]
  00446	03 55 f8	 add	 edx, DWORD PTR _writeFrames$[ebp]
  00449	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0044c	89 90 30 03 00
	00		 mov	 DWORD PTR [eax+816], edx

; 980  : 
; 981  :         aviCheckFile(file, &file->video.values);

  00452	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00455	81 c1 38 03 00
	00		 add	 ecx, 824		; 00000338H
  0045b	51		 push	 ecx
  0045c	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0045f	52		 push	 edx
  00460	e8 00 00 00 00	 call	 ?aviCheckFile@@YAXPAUAVI_FILE@@PAUSTREAM_VALUES@@@Z ; aviCheckFile
  00465	83 c4 08	 add	 esp, 8

; 982  :         aviUnlockFile(file);

  00468	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0046b	50		 push	 eax
  0046c	e8 00 00 00 00	 call	 ?aviUnlockFile@@YAXPAUAVI_FILE@@@Z ; aviUnlockFile
  00471	83 c4 04	 add	 esp, 4
$LN3@aviSaveFra:

; 983  :     }
; 984  : 
; 985  :     aviUnlockVideo(file);

  00474	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00477	51		 push	 ecx
  00478	e8 00 00 00 00	 call	 ?aviUnlockVideo@@YAXPAUAVI_FILE@@@Z ; aviUnlockVideo
  0047d	83 c4 04	 add	 esp, 4

; 986  : 
; 987  :     return result;

  00480	8b 45 e0	 mov	 eax, DWORD PTR _result$[ebp]
$LN22@aviSaveFra:

; 988  : }

  00483	5e		 pop	 esi
  00484	8b e5		 mov	 esp, ebp
  00486	5d		 pop	 ebp
  00487	c3		 ret	 0
_aviSaveFrame ENDP
_TEXT	ENDS
PUBLIC	_aviFileDestroy
; Function compile flags: /Odtp
;	COMDAT _aviFileDestroy
_TEXT	SEGMENT
_file$ = 8						; size = 4
_aviFileDestroy PROC					; COMDAT

; 543  : {

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

; 544  :     if (file)

  00003	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  00007	74 25		 je	 SHORT $LN2@aviFileDes

; 545  :     {
; 546  :         aviEndWriting(file);

  00009	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0000c	50		 push	 eax
  0000d	e8 00 00 00 00	 call	 _aviEndWriting
  00012	83 c4 04	 add	 esp, 4

; 547  : 
; 548  :         DeleteCriticalSection(&file->error.lock);

  00015	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00018	83 c1 10	 add	 ecx, 16			; 00000010H
  0001b	51		 push	 ecx
  0001c	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__DeleteCriticalSection@4

; 549  :         free(file);

  00022	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00025	52		 push	 edx
  00026	e8 00 00 00 00	 call	 _free
  0002b	83 c4 04	 add	 esp, 4
$LN2@aviFileDes:

; 550  :     }
; 551  : }

  0002e	5d		 pop	 ebp
  0002f	c3		 ret	 0
_aviFileDestroy ENDP
PUBLIC	_aviBeginWriting
; Function compile flags: /Odtp
;	COMDAT _aviBeginWriting
_TEXT	SEGMENT
tv439 = -180						; size = 8
tv437 = -172						; size = 4
tv434 = -166						; size = 2
tv427 = -164						; size = 8
tv422 = -156						; size = 8
tv379 = -148						; size = 8
tv374 = -140						; size = 8
tv362 = -132						; size = 4
_odmlAVIh$ = -128					; size = 4
_biOut$ = -124						; size = 4
_avih$ = -120						; size = 56
_strh$ = -64						; size = 64
_file$ = 8						; size = 4
_fileName$ = 12						; size = 4
_aviBeginWriting PROC					; COMDAT

; 222  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	81 ec b4 00 00
	00		 sub	 esp, 180		; 000000b4H

; 223  :     MainAVIHeader         avih;
; 224  :     AVIStreamHeader       strh;
; 225  :     BITMAPINFOHEADER      *biOut;
; 226  :     ODMLExtendedAVIHeader odmlAVIh;
; 227  : 
; 228  :     #define AVI_BEGIN_WRITING_ABORT()\
; 229  :     {\
; 230  :         aviEndWriting(file);\
; 231  :         return FALSE;\
; 232  :     }
; 233  : 
; 234  :     if (!file || !(file->flags & AVI_FLAG_VIDEO))

  00009	83 7d 08 00	 cmp	 DWORD PTR _file$[ebp], 0
  0000d	74 0b		 je	 SHORT $LN8@aviBeginWr
  0000f	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00012	0f b6 08	 movzx	 ecx, BYTE PTR [eax]
  00015	83 e1 01	 and	 ecx, 1
  00018	75 07		 jne	 SHORT $LN9@aviBeginWr
$LN8@aviBeginWr:

; 235  :        return FALSE;

  0001a	33 c0		 xor	 eax, eax
  0001c	e9 93 06 00 00	 jmp	 $LN10@aviBeginWr
$LN9@aviBeginWr:

; 236  : 
; 237  :     #ifdef AVI_DEBUG
; 238  :     AllocConsole();
; 239  :     cprintf(_T("----------------------\n"));
; 240  :     #endif
; 241  : 
; 242  :     /* Just to be safe */
; 243  :     aviEndWriting(file);

  00021	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00024	52		 push	 edx
  00025	e8 00 00 00 00	 call	 _aviEndWriting
  0002a	83 c4 04	 add	 esp, 4

; 244  : 
; 245  :     /**** Variable initialization ****/
; 246  : 
; 247  :     /* Clear any errors */
; 248  :     aviSetError(file, AVI_ERROR_NONE, _T("No error"));

  0002d	68 00 00 00 00	 push	 OFFSET ??_C@_1BC@NFCHMNPG@?$AAN?$AAo?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AA@
  00032	6a 00		 push	 0
  00034	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00037	50		 push	 eax
  00038	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  0003d	83 c4 0c	 add	 esp, 12			; 0000000cH

; 249  : 
; 250  :     /* Make sure audio and video data can be written */
; 251  :     file->hold = FALSE;

  00040	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00043	c7 41 04 00 00
	00 00		 mov	 DWORD PTR [ecx+4], 0

; 252  : 
; 253  :     /* Reset the legacy data */
; 254  :     memset(&file->legacy, 0, sizeof(file->legacy));

  0004a	6a 18		 push	 24			; 00000018H
  0004c	6a 00		 push	 0
  0004e	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00051	81 c2 28 04 00
	00		 add	 edx, 1064		; 00000428H
  00057	52		 push	 edx
  00058	e8 00 00 00 00	 call	 _memset
  0005d	83 c4 0c	 add	 esp, 12			; 0000000cH

; 255  : 
; 256  :     /* Clear the index counters */
; 257  :     aviIndexClearCounters(file);

  00060	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00063	50		 push	 eax
  00064	e8 00 00 00 00	 call	 ?aviIndexClearCounters@@YAXPAUAVI_FILE@@@Z ; aviIndexClearCounters
  00069	83 c4 04	 add	 esp, 4

; 258  : 
; 259  :     /* Set up the timer stuff */
; 260  :     memset(&file->timer, 0, sizeof(struct AVI_FILE::AVI_FILE_TIMER));

  0006c	6a 20		 push	 32			; 00000020H
  0006e	6a 00		 push	 0
  00070	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00073	81 c1 58 02 00
	00		 add	 ecx, 600		; 00000258H
  00079	51		 push	 ecx
  0007a	e8 00 00 00 00	 call	 _memset
  0007f	83 c4 0c	 add	 esp, 12			; 0000000cH

; 261  :     memset(&file->video.timer, 0, sizeof(struct AVI_FILE::VIDEO_STREAM::AVI_FILE_VIDEO_TIMER));

  00082	6a 20		 push	 32			; 00000020H
  00084	6a 00		 push	 0
  00086	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00089	81 c2 78 02 00
	00		 add	 edx, 632		; 00000278H
  0008f	52		 push	 edx
  00090	e8 00 00 00 00	 call	 _memset
  00095	83 c4 0c	 add	 esp, 12			; 0000000cH

; 262  : 
; 263  :     /* Clear the stream values */
; 264  :     memset(&file->video.values, 0, sizeof(file->video.values));

  00098	6a 10		 push	 16			; 00000010H
  0009a	6a 00		 push	 0
  0009c	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0009f	05 38 03 00 00	 add	 eax, 824		; 00000338H
  000a4	50		 push	 eax
  000a5	e8 00 00 00 00	 call	 _memset
  000aa	83 c4 0c	 add	 esp, 12			; 0000000cH

; 265  :     memset(&file->audio.values, 0, sizeof(file->audio.values));

  000ad	6a 10		 push	 16			; 00000010H
  000af	6a 00		 push	 0
  000b1	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000b4	81 c1 88 03 00
	00		 add	 ecx, 904		; 00000388H
  000ba	51		 push	 ecx
  000bb	e8 00 00 00 00	 call	 _memset
  000c0	83 c4 0c	 add	 esp, 12			; 0000000cH

; 266  : 
; 267  :     file->timer.freq = aviGetTimerFreq();

  000c3	e8 00 00 00 00	 call	 ?aviGetTimerFreq@@YA_JXZ ; aviGetTimerFreq
  000c8	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  000cb	89 81 58 02 00
	00		 mov	 DWORD PTR [ecx+600], eax
  000d1	89 91 5c 02 00
	00		 mov	 DWORD PTR [ecx+604], edx

; 268  :     if (!file->timer.freq)

  000d7	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  000da	89 95 7c ff ff
	ff		 mov	 DWORD PTR tv362[ebp], edx
  000e0	8b 85 7c ff ff
	ff		 mov	 eax, DWORD PTR tv362[ebp]
  000e6	8b 8d 7c ff ff
	ff		 mov	 ecx, DWORD PTR tv362[ebp]
  000ec	8b 90 58 02 00
	00		 mov	 edx, DWORD PTR [eax+600]
  000f2	0b 91 5c 02 00
	00		 or	 edx, DWORD PTR [ecx+604]
  000f8	75 26		 jne	 SHORT $LN7@aviBeginWr

; 269  :     {
; 270  :         aviSetError(file, AVI_ERROR_BEGIN, _T("Couldn't get the timer's ")
; 271  :                                            _T("frequency"));

  000fa	68 00 00 00 00	 push	 OFFSET ??_C@_1EG@PLJILMFD@?$AAC?$AAo?$AAu?$AAl?$AAd?$AAn?$AA?8?$AAt?$AA?5?$AAg?$AAe?$AAt?$AA?5?$AAt?$AAh?$AAe?$AA?5?$AAt?$AAi?$AAm?$AAe?$AAr?$AA?8?$AAs?$AA?5?$AAf?$AAr?$AAe?$AAq?$AAu?$AAe?$AAn@
  000ff	6a 01		 push	 1
  00101	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00104	50		 push	 eax
  00105	e8 00 00 00 00	 call	 ?aviSetError@@YAXPAUAVI_FILE@@W4aviError_t@@PA_W@Z ; aviSetError
  0010a	83 c4 0c	 add	 esp, 12			; 0000000cH

; 272  :         AVI_BEGIN_WRITING_ABORT();

  0010d	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00110	51		 push	 ecx
  00111	e8 00 00 00 00	 call	 _aviEndWriting
  00116	83 c4 04	 add	 esp, 4
  00119	33 c0		 xor	 eax, eax
  0011b	e9 94 05 00 00	 jmp	 $LN10@aviBeginWr
$LN7@aviBeginWr:

; 273  :     }
; 274  : 
; 275  :     file->video.timer.step = (aviTime_t)((double)file->timer.freq / ((double)file->video.rate / (double)file->video.scale));

  00120	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00123	df aa 58 02 00
	00		 fild	 QWORD PTR [edx+600]
  00129	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0012c	8b 88 d4 02 00
	00		 mov	 ecx, DWORD PTR [eax+724]
  00132	89 8d 74 ff ff
	ff		 mov	 DWORD PTR tv374[ebp], ecx
  00138	c7 85 78 ff ff
	ff 00 00 00 00	 mov	 DWORD PTR tv374[ebp+4], 0
  00142	df ad 74 ff ff
	ff		 fild	 QWORD PTR tv374[ebp]
  00148	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0014b	8b 82 d8 02 00
	00		 mov	 eax, DWORD PTR [edx+728]
  00151	89 85 6c ff ff
	ff		 mov	 DWORD PTR tv379[ebp], eax
  00157	c7 85 70 ff ff
	ff 00 00 00 00	 mov	 DWORD PTR tv379[ebp+4], 0
  00161	df ad 6c ff ff
	ff		 fild	 QWORD PTR tv379[ebp]
  00167	de f9		 fdivp	 ST(1), ST(0)
  00169	de f9		 fdivp	 ST(1), ST(0)
  0016b	e8 00 00 00 00	 call	 __ftol2
  00170	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00173	89 81 78 02 00
	00		 mov	 DWORD PTR [ecx+632], eax
  00179	89 91 7c 02 00
	00		 mov	 DWORD PTR [ecx+636], edx

; 276  : 
; 277  :     if (!aviVideoCompressorOpen(file))

  0017f	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00182	52		 push	 edx
  00183	e8 00 00 00 00	 call	 ?aviVideoCompressorOpen@@YAHPAUAVI_FILE@@@Z ; aviVideoCompressorOpen
  00188	83 c4 04	 add	 esp, 4
  0018b	85 c0		 test	 eax, eax
  0018d	75 13		 jne	 SHORT $LN6@aviBeginWr

; 278  :     {
; 279  :         #ifdef AVI_DEBUG
; 280  :         cprintf(_T("Couldn't open the video compressor\n"));
; 281  :         #endif
; 282  : 
; 283  :         AVI_BEGIN_WRITING_ABORT();

  0018f	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00192	50		 push	 eax
  00193	e8 00 00 00 00	 call	 _aviEndWriting
  00198	83 c4 04	 add	 esp, 4
  0019b	33 c0		 xor	 eax, eax
  0019d	e9 12 05 00 00	 jmp	 $LN10@aviBeginWr
$LN6@aviBeginWr:

; 284  :     }
; 285  : 
; 286  :     if ((file->flags & AVI_FLAG_AUDIO) && !aviAudioBegin(file))

  001a2	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  001a5	0f b6 11	 movzx	 edx, BYTE PTR [ecx]
  001a8	83 e2 02	 and	 edx, 2
  001ab	74 23		 je	 SHORT $LN5@aviBeginWr
  001ad	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  001b0	50		 push	 eax
  001b1	e8 00 00 00 00	 call	 ?aviAudioBegin@@YAHPAUAVI_FILE@@@Z ; aviAudioBegin
  001b6	83 c4 04	 add	 esp, 4
  001b9	85 c0		 test	 eax, eax
  001bb	75 13		 jne	 SHORT $LN5@aviBeginWr

; 287  :     {
; 288  :         #ifdef AVI_DEBUG
; 289  :         cprintf(_T("Audio initialization failed\n"));
; 290  :         #endif
; 291  : 
; 292  :         AVI_BEGIN_WRITING_ABORT();

  001bd	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  001c0	51		 push	 ecx
  001c1	e8 00 00 00 00	 call	 _aviEndWriting
  001c6	83 c4 04	 add	 esp, 4
  001c9	33 c0		 xor	 eax, eax
  001cb	e9 e4 04 00 00	 jmp	 $LN10@aviBeginWr
$LN5@aviBeginWr:

; 293  :     }
; 294  : 
; 295  :     if (!fileOpen(file, fileName))

  001d0	8b 55 0c	 mov	 edx, DWORD PTR _fileName$[ebp]
  001d3	52		 push	 edx
  001d4	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  001d7	50		 push	 eax
  001d8	e8 00 00 00 00	 call	 ?fileOpen@@YAHPAUAVI_FILE@@PA_W@Z ; fileOpen
  001dd	83 c4 08	 add	 esp, 8
  001e0	85 c0		 test	 eax, eax
  001e2	75 13		 jne	 SHORT $LN4@aviBeginWr

; 296  :        AVI_BEGIN_WRITING_ABORT();

  001e4	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  001e7	51		 push	 ecx
  001e8	e8 00 00 00 00	 call	 _aviEndWriting
  001ed	83 c4 04	 add	 esp, 4
  001f0	33 c0		 xor	 eax, eax
  001f2	e9 bd 04 00 00	 jmp	 $LN10@aviBeginWr
$LN4@aviBeginWr:

; 297  : 
; 298  :     /* Initialize critical sections */
; 299  :     InitializeCriticalSection(&file->lock.file);

  001f7	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  001fa	81 c2 50 01 00
	00		 add	 edx, 336		; 00000150H
  00200	52		 push	 edx
  00201	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__InitializeCriticalSection@4

; 300  :     InitializeCriticalSection(&file->lock.timer);

  00207	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0020a	05 68 01 00 00	 add	 eax, 360		; 00000168H
  0020f	50		 push	 eax
  00210	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__InitializeCriticalSection@4

; 301  :     InitializeCriticalSection(&file->lock.video);

  00216	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00219	81 c1 80 01 00
	00		 add	 ecx, 384		; 00000180H
  0021f	51		 push	 ecx
  00220	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__InitializeCriticalSection@4

; 302  :     InitializeCriticalSection(&file->lock.audio);

  00226	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00229	81 c2 98 01 00
	00		 add	 edx, 408		; 00000198H
  0022f	52		 push	 edx
  00230	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__InitializeCriticalSection@4

; 303  : 
; 304  :     /**** Begin: First RIFF chunk ****/
; 305  :     aviSetBaseOffset(file, RIFF_BASE);

  00236	6a 00		 push	 0
  00238	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0023b	50		 push	 eax
  0023c	e8 00 00 00 00	 call	 ?aviSetBaseOffset@@YAXPAUAVI_FILE@@H@Z ; aviSetBaseOffset
  00241	83 c4 08	 add	 esp, 8

; 306  :     aviBeginChunk(file, RIFF_CHUNK);

  00244	68 52 49 46 46	 push	 1179011410		; 46464952H
  00249	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0024c	51		 push	 ecx
  0024d	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  00252	83 c4 08	 add	 esp, 8

; 307  :     aviWriteFourCC(file, mmioFOURCC('A', 'V', 'I', ' '));

  00255	68 41 56 49 20	 push	 541677121		; 20495641H
  0025a	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0025d	52		 push	 edx
  0025e	e8 00 00 00 00	 call	 ?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z ; aviWriteFourCC
  00263	83 c4 08	 add	 esp, 8

; 308  : 
; 309  :     /**** Begin: LIST avih chunk ****/
; 310  :     aviBeginChunk(file, LIST_CHUNK);

  00266	68 4c 49 53 54	 push	 1414744396		; 5453494cH
  0026b	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0026e	50		 push	 eax
  0026f	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  00274	83 c4 08	 add	 esp, 8

; 311  :     aviWriteFourCC(file, listtypeAVIHEADER);

  00277	68 68 64 72 6c	 push	 1819436136		; 6c726468H
  0027c	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0027f	51		 push	 ecx
  00280	e8 00 00 00 00	 call	 ?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z ; aviWriteFourCC
  00285	83 c4 08	 add	 esp, 8

; 312  : 
; 313  :     /* AVI header */
; 314  :     aviBeginChunk(file, AVIH_CHUNK);

  00288	68 61 76 69 68	 push	 1751742049		; 68697661H
  0028d	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00290	52		 push	 edx
  00291	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  00296	83 c4 08	 add	 esp, 8

; 315  :       memset(&avih, 0, sizeof(MainAVIHeader));

  00299	6a 38		 push	 56			; 00000038H
  0029b	6a 00		 push	 0
  0029d	8d 45 88	 lea	 eax, DWORD PTR _avih$[ebp]
  002a0	50		 push	 eax
  002a1	e8 00 00 00 00	 call	 _memset
  002a6	83 c4 0c	 add	 esp, 12			; 0000000cH

; 316  : 
; 317  :       aviSetBaseOffset(file, AVIH_BASE);

  002a9	6a 02		 push	 2
  002ab	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  002ae	51		 push	 ecx
  002af	e8 00 00 00 00	 call	 ?aviSetBaseOffset@@YAXPAUAVI_FILE@@H@Z ; aviSetBaseOffset
  002b4	83 c4 08	 add	 esp, 8

; 318  : 
; 319  :       /* The video stream is required */
; 320  :       avih.dwStreams = 1;

  002b7	c7 45 a0 01 00
	00 00		 mov	 DWORD PTR _avih$[ebp+24], 1

; 321  : 
; 322  :       /* Check to see if the audio stream is going to be used */
; 323  :       if (file->flags & AVI_FLAG_AUDIO)

  002be	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  002c1	0f b6 02	 movzx	 eax, BYTE PTR [edx]
  002c4	83 e0 02	 and	 eax, 2
  002c7	74 09		 je	 SHORT $LN3@aviBeginWr

; 324  :          avih.dwStreams++;

  002c9	8b 4d a0	 mov	 ecx, DWORD PTR _avih$[ebp+24]
  002cc	83 c1 01	 add	 ecx, 1
  002cf	89 4d a0	 mov	 DWORD PTR _avih$[ebp+24], ecx
$LN3@aviBeginWr:

; 325  : 
; 326  :       avih.dwFlags = AVIF_HASINDEX | AVIF_MUSTUSEINDEX;

  002d2	c7 45 94 30 00
	00 00		 mov	 DWORD PTR _avih$[ebp+12], 48 ; 00000030H

; 327  : 
; 328  :       /* FPS = rate / scale */
; 329  :       avih.dwMicroSecPerFrame = (DWORD)(1000000.0f / ((float)file->video.rate /
; 330  :                                                       (float)file->video.scale));

  002d9	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  002dc	8b 82 d4 02 00
	00		 mov	 eax, DWORD PTR [edx+724]
  002e2	89 85 64 ff ff
	ff		 mov	 DWORD PTR tv422[ebp], eax
  002e8	c7 85 68 ff ff
	ff 00 00 00 00	 mov	 DWORD PTR tv422[ebp+4], 0
  002f2	df ad 64 ff ff
	ff		 fild	 QWORD PTR tv422[ebp]
  002f8	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  002fb	8b 91 d8 02 00
	00		 mov	 edx, DWORD PTR [ecx+728]
  00301	89 95 5c ff ff
	ff		 mov	 DWORD PTR tv427[ebp], edx
  00307	c7 85 60 ff ff
	ff 00 00 00 00	 mov	 DWORD PTR tv427[ebp+4], 0
  00311	df ad 5c ff ff
	ff		 fild	 QWORD PTR tv427[ebp]
  00317	de f9		 fdivp	 ST(1), ST(0)
  00319	dc 3d 00 00 00
	00		 fdivr	 QWORD PTR __real@412e848000000000
  0031f	d9 bd 5a ff ff
	ff		 fnstcw	 WORD PTR tv434[ebp]
  00325	0f b7 85 5a ff
	ff ff		 movzx	 eax, WORD PTR tv434[ebp]
  0032c	0d 00 0c 00 00	 or	 eax, 3072		; 00000c00H
  00331	89 85 54 ff ff
	ff		 mov	 DWORD PTR tv437[ebp], eax
  00337	d9 ad 54 ff ff
	ff		 fldcw	 WORD PTR tv437[ebp]
  0033d	df bd 4c ff ff
	ff		 fistp	 QWORD PTR tv439[ebp]
  00343	d9 ad 5a ff ff
	ff		 fldcw	 WORD PTR tv434[ebp]
  00349	8b 85 4c ff ff
	ff		 mov	 eax, DWORD PTR tv439[ebp]
  0034f	89 45 88	 mov	 DWORD PTR _avih$[ebp], eax

; 331  :       avih.dwWidth            = file->video.info.biWidth;

  00352	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00355	8b 91 b0 02 00
	00		 mov	 edx, DWORD PTR [ecx+688]
  0035b	89 55 a8	 mov	 DWORD PTR _avih$[ebp+32], edx

; 332  :       avih.dwHeight           = file->video.info.biHeight;

  0035e	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00361	8b 88 b4 02 00
	00		 mov	 ecx, DWORD PTR [eax+692]
  00367	89 4d ac	 mov	 DWORD PTR _avih$[ebp+36], ecx

; 333  : 
; 334  :       fileWrite(file, &avih, sizeof(MainAVIHeader));

  0036a	6a 38		 push	 56			; 00000038H
  0036c	8d 55 88	 lea	 edx, DWORD PTR _avih$[ebp]
  0036f	52		 push	 edx
  00370	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00373	50		 push	 eax
  00374	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00379	83 c4 0c	 add	 esp, 12			; 0000000cH

; 335  :     aviEndChunk(file);

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

; 336  : 
; 337  :     /* Get the output format */
; 338  :     biOut = aviVideoGetOutputFormat(file);

  00388	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0038b	52		 push	 edx
  0038c	e8 00 00 00 00	 call	 ?aviVideoGetOutputFormat@@YAPAUtagBITMAPINFOHEADER@@PAUAVI_FILE@@@Z ; aviVideoGetOutputFormat
  00391	83 c4 04	 add	 esp, 4
  00394	89 45 84	 mov	 DWORD PTR _biOut$[ebp], eax

; 339  :     assert(biOut);
; 340  : 
; 341  :     /**** Begin: Video stream data ****/
; 342  :     aviBeginChunk(file, LIST_CHUNK);

  00397	68 4c 49 53 54	 push	 1414744396		; 5453494cH
  0039c	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0039f	50		 push	 eax
  003a0	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  003a5	83 c4 08	 add	 esp, 8

; 343  :       aviWriteFourCC(file, mmioFOURCC('s', 't', 'r', 'l'));

  003a8	68 73 74 72 6c	 push	 1819440243		; 6c727473H
  003ad	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  003b0	51		 push	 ecx
  003b1	e8 00 00 00 00	 call	 ?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z ; aviWriteFourCC
  003b6	83 c4 08	 add	 esp, 8

; 344  : 
; 345  :       /* Stream header */
; 346  :       aviBeginChunk(file, STRH_CHUNK);

  003b9	68 73 74 72 68	 push	 1752331379		; 68727473H
  003be	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  003c1	52		 push	 edx
  003c2	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  003c7	83 c4 08	 add	 esp, 8

; 347  :         memset(&strh, 0, sizeof(AVIStreamHeader));

  003ca	6a 40		 push	 64			; 00000040H
  003cc	6a 00		 push	 0
  003ce	8d 45 c0	 lea	 eax, DWORD PTR _strh$[ebp]
  003d1	50		 push	 eax
  003d2	e8 00 00 00 00	 call	 _memset
  003d7	83 c4 0c	 add	 esp, 12			; 0000000cH

; 348  : 
; 349  :         file->video.strhOffset = (DWORD)fileTell(file);

  003da	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  003dd	51		 push	 ecx
  003de	e8 00 00 00 00	 call	 ?fileTell@@YA_JPAUAVI_FILE@@@Z ; fileTell
  003e3	83 c4 04	 add	 esp, 4
  003e6	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  003e9	89 82 a8 02 00
	00		 mov	 DWORD PTR [edx+680], eax

; 350  : 
; 351  :         strh.fccType    = streamtypeVIDEO;

  003ef	c7 45 c0 76 69
	64 73		 mov	 DWORD PTR _strh$[ebp], 1935960438 ; 73646976H

; 352  :         strh.fccHandler = file->video.fccHandler;

  003f6	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  003f9	8b 88 dc 02 00
	00		 mov	 ecx, DWORD PTR [eax+732]
  003ff	89 4d c4	 mov	 DWORD PTR _strh$[ebp+4], ecx

; 353  :         strh.dwRate     = file->video.rate;

  00402	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00405	8b 82 d4 02 00
	00		 mov	 eax, DWORD PTR [edx+724]
  0040b	89 45 d8	 mov	 DWORD PTR _strh$[ebp+24], eax

; 354  :         strh.dwScale    = file->video.scale;

  0040e	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00411	8b 91 d8 02 00
	00		 mov	 edx, DWORD PTR [ecx+728]
  00417	89 55 d4	 mov	 DWORD PTR _strh$[ebp+20], edx

; 355  : 
; 356  :         fileWrite(file, &strh, sizeof(AVIStreamHeader));

  0041a	6a 40		 push	 64			; 00000040H
  0041c	8d 45 c0	 lea	 eax, DWORD PTR _strh$[ebp]
  0041f	50		 push	 eax
  00420	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00423	51		 push	 ecx
  00424	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00429	83 c4 0c	 add	 esp, 12			; 0000000cH

; 357  :       aviEndChunk(file);

  0042c	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0042f	52		 push	 edx
  00430	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  00435	83 c4 04	 add	 esp, 4

; 358  : 
; 359  :       /* Stream format */
; 360  :       aviBeginChunk(file, STRF_CHUNK);

  00438	68 73 74 72 66	 push	 1718776947		; 66727473H
  0043d	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00440	50		 push	 eax
  00441	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  00446	83 c4 08	 add	 esp, 8

; 361  :         fileWrite(file, biOut, biOut->biSize);

  00449	8b 4d 84	 mov	 ecx, DWORD PTR _biOut$[ebp]
  0044c	8b 11		 mov	 edx, DWORD PTR [ecx]
  0044e	52		 push	 edx
  0044f	8b 45 84	 mov	 eax, DWORD PTR _biOut$[ebp]
  00452	50		 push	 eax
  00453	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00456	51		 push	 ecx
  00457	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  0045c	83 c4 0c	 add	 esp, 12			; 0000000cH

; 362  :       aviEndChunk(file);

  0045f	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00462	52		 push	 edx
  00463	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  00468	83 c4 04	 add	 esp, 4

; 363  : 
; 364  :       /* Initial super index */
; 365  :       aviBeginChunk(file, INDX_CHUNK);

  0046b	68 69 6e 64 78	 push	 2019847785		; 78646e69H
  00470	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00473	50		 push	 eax
  00474	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  00479	83 c4 08	 add	 esp, 8

; 366  :         aviWriteInitialSuperIndex(file, VIDEO_STREAM);

  0047c	6a 00		 push	 0
  0047e	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00481	51		 push	 ecx
  00482	e8 00 00 00 00	 call	 ?aviWriteInitialSuperIndex@@YAXPAUAVI_FILE@@W4stream_t@@@Z ; aviWriteInitialSuperIndex
  00487	83 c4 08	 add	 esp, 8

; 367  :       aviEndChunk(file);

  0048a	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0048d	52		 push	 edx
  0048e	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  00493	83 c4 04	 add	 esp, 4

; 368  : 
; 369  :     /**** End: Video stream data ****/
; 370  :     aviEndChunk(file);

  00496	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00499	50		 push	 eax
  0049a	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  0049f	83 c4 04	 add	 esp, 4

; 371  : 
; 372  :     if (file->flags & AVI_FLAG_AUDIO)

  004a2	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  004a5	0f b6 11	 movzx	 edx, BYTE PTR [ecx]
  004a8	83 e2 02	 and	 edx, 2
  004ab	0f 84 09 01 00
	00		 je	 $LN2@aviBeginWr

; 373  :     {
; 374  :         /**** Begin: Audio stream data ****/
; 375  :         aviBeginChunk(file, LIST_CHUNK);

  004b1	68 4c 49 53 54	 push	 1414744396		; 5453494cH
  004b6	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  004b9	50		 push	 eax
  004ba	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  004bf	83 c4 08	 add	 esp, 8

; 376  :           aviWriteFourCC(file, mmioFOURCC('s', 't', 'r', 'l'));

  004c2	68 73 74 72 6c	 push	 1819440243		; 6c727473H
  004c7	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  004ca	51		 push	 ecx
  004cb	e8 00 00 00 00	 call	 ?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z ; aviWriteFourCC
  004d0	83 c4 08	 add	 esp, 8

; 377  : 
; 378  :           /* Stream header */
; 379  :           aviBeginChunk(file, STRH_CHUNK);

  004d3	68 73 74 72 68	 push	 1752331379		; 68727473H
  004d8	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  004db	52		 push	 edx
  004dc	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  004e1	83 c4 08	 add	 esp, 8

; 380  :             memset(&strh, 0, sizeof(AVIStreamHeader));

  004e4	6a 40		 push	 64			; 00000040H
  004e6	6a 00		 push	 0
  004e8	8d 45 c0	 lea	 eax, DWORD PTR _strh$[ebp]
  004eb	50		 push	 eax
  004ec	e8 00 00 00 00	 call	 _memset
  004f1	83 c4 0c	 add	 esp, 12			; 0000000cH

; 381  : 
; 382  :             file->audio.strhOffset = (DWORD)fileTell(file);

  004f4	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  004f7	51		 push	 ecx
  004f8	e8 00 00 00 00	 call	 ?fileTell@@YA_JPAUAVI_FILE@@@Z ; fileTell
  004fd	83 c4 04	 add	 esp, 4
  00500	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00503	89 82 74 03 00
	00		 mov	 DWORD PTR [edx+884], eax

; 383  : 
; 384  :             strh.fccType      = streamtypeAUDIO;

  00509	c7 45 c0 61 75
	64 73		 mov	 DWORD PTR _strh$[ebp], 1935963489 ; 73647561H

; 385  :             strh.dwRate       = file->audio.wfxOut.nSamplesPerSec;

  00510	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00513	8b 88 66 03 00
	00		 mov	 ecx, DWORD PTR [eax+870]
  00519	89 4d d8	 mov	 DWORD PTR _strh$[ebp+24], ecx

; 386  :             strh.dwScale      = 1;

  0051c	c7 45 d4 01 00
	00 00		 mov	 DWORD PTR _strh$[ebp+20], 1

; 387  :             strh.dwSampleSize = file->audio.wfxOut.nBlockAlign;

  00523	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00526	0f b7 82 6e 03
	00 00		 movzx	 eax, WORD PTR [edx+878]
  0052d	89 45 ec	 mov	 DWORD PTR _strh$[ebp+44], eax

; 388  : 
; 389  :             fileWrite(file, &strh, sizeof(AVIStreamHeader));

  00530	6a 40		 push	 64			; 00000040H
  00532	8d 4d c0	 lea	 ecx, DWORD PTR _strh$[ebp]
  00535	51		 push	 ecx
  00536	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00539	52		 push	 edx
  0053a	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  0053f	83 c4 0c	 add	 esp, 12			; 0000000cH

; 390  :           aviEndChunk(file);

  00542	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00545	50		 push	 eax
  00546	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  0054b	83 c4 04	 add	 esp, 4

; 391  : 
; 392  :           /* Stream format */
; 393  :           aviBeginChunk(file, STRF_CHUNK);

  0054e	68 73 74 72 66	 push	 1718776947		; 66727473H
  00553	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00556	51		 push	 ecx
  00557	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  0055c	83 c4 08	 add	 esp, 8

; 394  :             fileWrite(file, &file->audio.wfxOut, sizeof(WAVEFORMATEX));

  0055f	6a 12		 push	 18			; 00000012H
  00561	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00564	81 c2 62 03 00
	00		 add	 edx, 866		; 00000362H
  0056a	52		 push	 edx
  0056b	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0056e	50		 push	 eax
  0056f	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  00574	83 c4 0c	 add	 esp, 12			; 0000000cH

; 395  :           aviEndChunk(file);

  00577	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0057a	51		 push	 ecx
  0057b	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  00580	83 c4 04	 add	 esp, 4

; 396  : 
; 397  :           /* Initial super index */
; 398  :           aviBeginChunk(file, INDX_CHUNK);

  00583	68 69 6e 64 78	 push	 2019847785		; 78646e69H
  00588	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0058b	52		 push	 edx
  0058c	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  00591	83 c4 08	 add	 esp, 8

; 399  :             aviWriteInitialSuperIndex(file, AUDIO_STREAM);

  00594	6a 01		 push	 1
  00596	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00599	50		 push	 eax
  0059a	e8 00 00 00 00	 call	 ?aviWriteInitialSuperIndex@@YAXPAUAVI_FILE@@W4stream_t@@@Z ; aviWriteInitialSuperIndex
  0059f	83 c4 08	 add	 esp, 8

; 400  :           aviEndChunk(file);

  005a2	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  005a5	51		 push	 ecx
  005a6	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  005ab	83 c4 04	 add	 esp, 4

; 401  : 
; 402  :         /**** End: Audio stream data ****/
; 403  :         aviEndChunk(file);

  005ae	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  005b1	52		 push	 edx
  005b2	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  005b7	83 c4 04	 add	 esp, 4
$LN2@aviBeginWr:

; 404  :     }
; 405  : 
; 406  :     /**** Begin: OpenDML chunk ****/
; 407  :     aviBeginChunk(file, LIST_CHUNK);

  005ba	68 4c 49 53 54	 push	 1414744396		; 5453494cH
  005bf	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  005c2	50		 push	 eax
  005c3	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  005c8	83 c4 08	 add	 esp, 8

; 408  :     aviWriteFourCC(file, mmioFOURCC('o', 'd', 'm', 'l'));

  005cb	68 6f 64 6d 6c	 push	 1819108463		; 6c6d646fH
  005d0	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  005d3	51		 push	 ecx
  005d4	e8 00 00 00 00	 call	 ?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z ; aviWriteFourCC
  005d9	83 c4 08	 add	 esp, 8

; 409  : 
; 410  :       /* Extended AVI header */
; 411  :       aviBeginChunk(file, mmioFOURCC('d', 'm', 'l', 'h'));

  005dc	68 64 6d 6c 68	 push	 1751936356		; 686c6d64H
  005e1	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  005e4	52		 push	 edx
  005e5	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  005ea	83 c4 08	 add	 esp, 8

; 412  :         memset(&odmlAVIh, 0, sizeof(ODMLExtendedAVIHeader));

  005ed	6a 04		 push	 4
  005ef	6a 00		 push	 0
  005f1	8d 45 80	 lea	 eax, DWORD PTR _odmlAVIh$[ebp]
  005f4	50		 push	 eax
  005f5	e8 00 00 00 00	 call	 _memset
  005fa	83 c4 0c	 add	 esp, 12			; 0000000cH

; 413  : 
; 414  :         aviSetBaseOffset(file, DMLH_BASE);

  005fd	6a 03		 push	 3
  005ff	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00602	51		 push	 ecx
  00603	e8 00 00 00 00	 call	 ?aviSetBaseOffset@@YAXPAUAVI_FILE@@H@Z ; aviSetBaseOffset
  00608	83 c4 08	 add	 esp, 8

; 415  :         fileWrite(file, &odmlAVIh, sizeof(ODMLExtendedAVIHeader));

  0060b	6a 04		 push	 4
  0060d	8d 55 80	 lea	 edx, DWORD PTR _odmlAVIh$[ebp]
  00610	52		 push	 edx
  00611	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00614	50		 push	 eax
  00615	e8 00 00 00 00	 call	 ?fileWrite@@YAHPAUAVI_FILE@@PAXK@Z ; fileWrite
  0061a	83 c4 0c	 add	 esp, 12			; 0000000cH

; 416  :       aviEndChunk(file);

  0061d	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00620	51		 push	 ecx
  00621	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  00626	83 c4 04	 add	 esp, 4

; 417  : 
; 418  :     /**** End: OpenDML chunk ****/
; 419  :     aviEndChunk(file);

  00629	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  0062c	52		 push	 edx
  0062d	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  00632	83 c4 04	 add	 esp, 4

; 420  : 
; 421  :     /**** End: LIST avih chunk ****/
; 422  :     aviEndChunk(file);

  00635	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00638	50		 push	 eax
  00639	e8 00 00 00 00	 call	 ?aviEndChunk@@YAKPAUAVI_FILE@@@Z ; aviEndChunk
  0063e	83 c4 04	 add	 esp, 4

; 423  : 
; 424  :     /* Start the LIST movi chunk */
; 425  :     aviSetBaseOffset(file, MOVI_BASE);

  00641	6a 01		 push	 1
  00643	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00646	51		 push	 ecx
  00647	e8 00 00 00 00	 call	 ?aviSetBaseOffset@@YAXPAUAVI_FILE@@H@Z ; aviSetBaseOffset
  0064c	83 c4 08	 add	 esp, 8

; 426  :     aviBeginChunk(file, LIST_CHUNK);

  0064f	68 4c 49 53 54	 push	 1414744396		; 5453494cH
  00654	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00657	52		 push	 edx
  00658	e8 00 00 00 00	 call	 ?aviBeginChunk@@YAXPAUAVI_FILE@@K@Z ; aviBeginChunk
  0065d	83 c4 08	 add	 esp, 8

; 427  :     aviWriteFourCC(file, mmioFOURCC('m', 'o', 'v', 'i'));

  00660	68 6d 6f 76 69	 push	 1769369453		; 69766f6dH
  00665	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  00668	50		 push	 eax
  00669	e8 00 00 00 00	 call	 ?aviWriteFourCC@@YAXPAUAVI_FILE@@K@Z ; aviWriteFourCC
  0066e	83 c4 08	 add	 esp, 8

; 428  : 
; 429  :     /* Reset the frame counter */
; 430  :     file->video.numFrames = 0;

  00671	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  00674	c7 81 30 03 00
	00 00 00 00 00	 mov	 DWORD PTR [ecx+816], 0

; 431  : 
; 432  :     /* Reset the missing frame data */
; 433  :     file->video.missing.frames = 0;

  0067e	8b 55 08	 mov	 edx, DWORD PTR _file$[ebp]
  00681	c7 82 98 02 00
	00 00 00 00 00	 mov	 DWORD PTR [edx+664], 0

; 434  :     file->video.missing.step   = 0;

  0068b	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  0068e	c7 80 9c 02 00
	00 00 00 00 00	 mov	 DWORD PTR [eax+668], 0

; 435  : 
; 436  :     if (file->flags & AVI_FLAG_AUDIO)

  00698	8b 4d 08	 mov	 ecx, DWORD PTR _file$[ebp]
  0069b	0f b6 11	 movzx	 edx, BYTE PTR [ecx]
  0069e	83 e2 02	 and	 edx, 2
  006a1	74 0c		 je	 SHORT $LN1@aviBeginWr

; 437  :        aviAudioStartRecording(file);

  006a3	8b 45 08	 mov	 eax, DWORD PTR _file$[ebp]
  006a6	50		 push	 eax
  006a7	e8 00 00 00 00	 call	 ?aviAudioStartRecording@@YAXPAUAVI_FILE@@@Z ; aviAudioStartRecording
  006ac	83 c4 04	 add	 esp, 4
$LN1@aviBeginWr:

; 438  : 
; 439  :     return TRUE;

  006af	b8 01 00 00 00	 mov	 eax, 1
$LN10@aviBeginWr:

; 440  : }

  006b4	8b e5		 mov	 esp, ebp
  006b6	5d		 pop	 ebp
  006b7	c3		 ret	 0
_aviBeginWriting ENDP
END
