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

	TITLE	d:\Source Code\STGM\mmgr.cpp
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB LIBCMTD
INCLUDELIB OLDNAMES

PUBLIC	??_C@_00CNPNBAHC@?$AA@				; `string'
PUBLIC	??_C@_02HHFHKOHM@?$DP?$DP?$AA@			; `string'
PUBLIC	??_C@_04LIAPHEDB@free?$AA@			; `string'
PUBLIC	??_C@_08PLALIOCI@delete?$FL?$FN?$AA@		; `string'
PUBLIC	??_C@_06FOBLBEIN@delete?$AA@			; `string'
PUBLIC	??_C@_07EOOHGPEI@realloc?$AA@			; `string'
PUBLIC	??_C@_06DLAMMMII@calloc?$AA@			; `string'
PUBLIC	??_C@_06GLDDLHNF@malloc?$AA@			; `string'
PUBLIC	??_C@_05LEAFLCCG@new?$FL?$FN?$AA@		; `string'
PUBLIC	??_C@_03CLCAEGCJ@new?$AA@			; `string'
PUBLIC	??_C@_07NBCGADJA@Unknown?$AA@			; `string'
PUBLIC	??_C@_0P@GHFPNOJB@bad?5allocation?$AA@		; `string'
PUBLIC	?criticalSection@@3U_RTL_CRITICAL_SECTION@@A	; criticalSection
PUBLIC	?criticalInitialized@@3_NA			; criticalInitialized
PUBLIC	?collate@?$_Locbase@H@std@@2HB			; std::_Locbase<int>::collate
PUBLIC	?ctype@?$_Locbase@H@std@@2HB			; std::_Locbase<int>::ctype
PUBLIC	?monetary@?$_Locbase@H@std@@2HB			; std::_Locbase<int>::monetary
PUBLIC	?numeric@?$_Locbase@H@std@@2HB			; std::_Locbase<int>::numeric
PUBLIC	?time@?$_Locbase@H@std@@2HB			; std::_Locbase<int>::time
PUBLIC	?messages@?$_Locbase@H@std@@2HB			; std::_Locbase<int>::messages
PUBLIC	?all@?$_Locbase@H@std@@2HB			; std::_Locbase<int>::all
PUBLIC	?none@?$_Locbase@H@std@@2HB			; std::_Locbase<int>::none
PUBLIC	?table_size@?$ctype@D@std@@2IB			; std::ctype<char>::table_size
PUBLIC	?skipws@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::skipws
PUBLIC	?unitbuf@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::unitbuf
PUBLIC	?uppercase@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::uppercase
PUBLIC	?showbase@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::showbase
PUBLIC	?showpoint@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::showpoint
PUBLIC	?showpos@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::showpos
PUBLIC	?left@?$_Iosb@H@std@@2W4_Fmtflags@12@B		; std::_Iosb<int>::left
PUBLIC	?right@?$_Iosb@H@std@@2W4_Fmtflags@12@B		; std::_Iosb<int>::right
PUBLIC	?internal@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::internal
PUBLIC	?dec@?$_Iosb@H@std@@2W4_Fmtflags@12@B		; std::_Iosb<int>::dec
PUBLIC	?oct@?$_Iosb@H@std@@2W4_Fmtflags@12@B		; std::_Iosb<int>::oct
PUBLIC	?hex@?$_Iosb@H@std@@2W4_Fmtflags@12@B		; std::_Iosb<int>::hex
PUBLIC	?scientific@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::scientific
PUBLIC	?fixed@?$_Iosb@H@std@@2W4_Fmtflags@12@B		; std::_Iosb<int>::fixed
PUBLIC	?boolalpha@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::boolalpha
PUBLIC	?_Stdio@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::_Stdio
PUBLIC	?adjustfield@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::adjustfield
PUBLIC	?basefield@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::basefield
PUBLIC	?floatfield@?$_Iosb@H@std@@2W4_Fmtflags@12@B	; std::_Iosb<int>::floatfield
PUBLIC	?goodbit@?$_Iosb@H@std@@2W4_Iostate@12@B	; std::_Iosb<int>::goodbit
PUBLIC	?eofbit@?$_Iosb@H@std@@2W4_Iostate@12@B		; std::_Iosb<int>::eofbit
PUBLIC	?failbit@?$_Iosb@H@std@@2W4_Iostate@12@B	; std::_Iosb<int>::failbit
PUBLIC	?badbit@?$_Iosb@H@std@@2W4_Iostate@12@B		; std::_Iosb<int>::badbit
PUBLIC	?_Hardfail@?$_Iosb@H@std@@2W4_Iostate@12@B	; std::_Iosb<int>::_Hardfail
PUBLIC	?in@?$_Iosb@H@std@@2W4_Openmode@12@B		; std::_Iosb<int>::in
PUBLIC	?out@?$_Iosb@H@std@@2W4_Openmode@12@B		; std::_Iosb<int>::out
PUBLIC	?ate@?$_Iosb@H@std@@2W4_Openmode@12@B		; std::_Iosb<int>::ate
PUBLIC	?app@?$_Iosb@H@std@@2W4_Openmode@12@B		; std::_Iosb<int>::app
PUBLIC	?trunc@?$_Iosb@H@std@@2W4_Openmode@12@B		; std::_Iosb<int>::trunc
PUBLIC	?_Nocreate@?$_Iosb@H@std@@2W4_Openmode@12@B	; std::_Iosb<int>::_Nocreate
PUBLIC	?_Noreplace@?$_Iosb@H@std@@2W4_Openmode@12@B	; std::_Iosb<int>::_Noreplace
PUBLIC	?binary@?$_Iosb@H@std@@2W4_Openmode@12@B	; std::_Iosb<int>::binary
PUBLIC	?beg@?$_Iosb@H@std@@2W4_Seekdir@12@B		; std::_Iosb<int>::beg
PUBLIC	?cur@?$_Iosb@H@std@@2W4_Seekdir@12@B		; std::_Iosb<int>::cur
PUBLIC	?end@?$_Iosb@H@std@@2W4_Seekdir@12@B		; std::_Iosb<int>::end
PUBLIC	?m_alloc_unknown@@3IB				; m_alloc_unknown
PUBLIC	?m_alloc_new@@3IB				; m_alloc_new
PUBLIC	?m_alloc_new_array@@3IB				; m_alloc_new_array
PUBLIC	?m_alloc_malloc@@3IB				; m_alloc_malloc
PUBLIC	?m_alloc_calloc@@3IB				; m_alloc_calloc
PUBLIC	?m_alloc_realloc@@3IB				; m_alloc_realloc
PUBLIC	?m_alloc_delete@@3IB				; m_alloc_delete
PUBLIC	?m_alloc_delete_array@@3IB			; m_alloc_delete_array
PUBLIC	?m_alloc_free@@3IB				; m_alloc_free
PUBLIC	?memoryPassthrough@@3_NA			; memoryPassthrough
PUBLIC	?memoryDestroyPassthrough@@3_NA			; memoryDestroyPassthrough
_BSS	SEGMENT
?criticalSection@@3U_RTL_CRITICAL_SECTION@@A DB 018H DUP (?) ; criticalSection
?criticalInitialized@@3_NA DB 01H DUP (?)		; criticalInitialized
	ALIGN	4

_randomWipe DB	01H DUP (?)
	ALIGN	4

_alwaysValidateAll DB 01H DUP (?)
	ALIGN	4

_alwaysLogAll DB 01H DUP (?)
	ALIGN	4

_alwaysWipeAll DB 01H DUP (?)
	ALIGN	4

_currentAllocationCount DD 01H DUP (?)
_breakOnAllocationCount DD 01H DUP (?)
_sourceLine DD	01H DUP (?)
_staticDeinitTime DB 01H DUP (?)
	ALIGN	4

_reservoirBuffer DD 01H DUP (?)
_reservoirBufferSize DD 01H DUP (?)
?memoryPassthrough@@3_NA DB 01H DUP (?)			; memoryPassthrough
	ALIGN	4

?memoryDestroyPassthrough@@3_NA DB 01H DUP (?)		; memoryDestroyPassthrough
_BSS	ENDS
;	COMDAT ??_C@_00CNPNBAHC@?$AA@
CONST	SEGMENT
??_C@_00CNPNBAHC@?$AA@ DB 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
CONST	SEGMENT
??_C@_02HHFHKOHM@?$DP?$DP?$AA@ DB '??', 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_04LIAPHEDB@free?$AA@
CONST	SEGMENT
??_C@_04LIAPHEDB@free?$AA@ DB 'free', 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_08PLALIOCI@delete?$FL?$FN?$AA@
CONST	SEGMENT
??_C@_08PLALIOCI@delete?$FL?$FN?$AA@ DB 'delete[]', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_06FOBLBEIN@delete?$AA@
CONST	SEGMENT
??_C@_06FOBLBEIN@delete?$AA@ DB 'delete', 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_07EOOHGPEI@realloc?$AA@
CONST	SEGMENT
??_C@_07EOOHGPEI@realloc?$AA@ DB 'realloc', 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_06DLAMMMII@calloc?$AA@
CONST	SEGMENT
??_C@_06DLAMMMII@calloc?$AA@ DB 'calloc', 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_06GLDDLHNF@malloc?$AA@
CONST	SEGMENT
??_C@_06GLDDLHNF@malloc?$AA@ DB 'malloc', 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_05LEAFLCCG@new?$FL?$FN?$AA@
CONST	SEGMENT
??_C@_05LEAFLCCG@new?$FL?$FN?$AA@ DB 'new[]', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_03CLCAEGCJ@new?$AA@
CONST	SEGMENT
??_C@_03CLCAEGCJ@new?$AA@ DB 'new', 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_07NBCGADJA@Unknown?$AA@
CONST	SEGMENT
??_C@_07NBCGADJA@Unknown?$AA@ DB 'Unknown', 00H		; `string'
CONST	ENDS
CONST	SEGMENT
?m_alloc_unknown@@3IB DD 00H				; m_alloc_unknown
?m_alloc_new@@3IB DD 01H				; m_alloc_new
?m_alloc_new_array@@3IB DD 02H				; m_alloc_new_array
?m_alloc_malloc@@3IB DD 03H				; m_alloc_malloc
?m_alloc_calloc@@3IB DD 04H				; m_alloc_calloc
?m_alloc_realloc@@3IB DD 05H				; m_alloc_realloc
?m_alloc_delete@@3IB DD 06H				; m_alloc_delete
?m_alloc_delete_array@@3IB DD 07H			; m_alloc_delete_array
?m_alloc_free@@3IB DD 08H				; m_alloc_free
CONST	ENDS
;	COMDAT ?end@?$_Iosb@H@std@@2W4_Seekdir@12@B
CONST	SEGMENT
?end@?$_Iosb@H@std@@2W4_Seekdir@12@B DD 02H		; std::_Iosb<int>::end
CONST	ENDS
;	COMDAT ?cur@?$_Iosb@H@std@@2W4_Seekdir@12@B
CONST	SEGMENT
?cur@?$_Iosb@H@std@@2W4_Seekdir@12@B DD 01H		; std::_Iosb<int>::cur
CONST	ENDS
;	COMDAT ?beg@?$_Iosb@H@std@@2W4_Seekdir@12@B
CONST	SEGMENT
?beg@?$_Iosb@H@std@@2W4_Seekdir@12@B DD 00H		; std::_Iosb<int>::beg
CONST	ENDS
;	COMDAT ?binary@?$_Iosb@H@std@@2W4_Openmode@12@B
CONST	SEGMENT
?binary@?$_Iosb@H@std@@2W4_Openmode@12@B DD 020H	; std::_Iosb<int>::binary
CONST	ENDS
;	COMDAT ?_Noreplace@?$_Iosb@H@std@@2W4_Openmode@12@B
CONST	SEGMENT
?_Noreplace@?$_Iosb@H@std@@2W4_Openmode@12@B DD 080H	; std::_Iosb<int>::_Noreplace
CONST	ENDS
;	COMDAT ?_Nocreate@?$_Iosb@H@std@@2W4_Openmode@12@B
CONST	SEGMENT
?_Nocreate@?$_Iosb@H@std@@2W4_Openmode@12@B DD 040H	; std::_Iosb<int>::_Nocreate
CONST	ENDS
;	COMDAT ?trunc@?$_Iosb@H@std@@2W4_Openmode@12@B
CONST	SEGMENT
?trunc@?$_Iosb@H@std@@2W4_Openmode@12@B DD 010H		; std::_Iosb<int>::trunc
CONST	ENDS
;	COMDAT ?app@?$_Iosb@H@std@@2W4_Openmode@12@B
CONST	SEGMENT
?app@?$_Iosb@H@std@@2W4_Openmode@12@B DD 08H		; std::_Iosb<int>::app
CONST	ENDS
;	COMDAT ?ate@?$_Iosb@H@std@@2W4_Openmode@12@B
CONST	SEGMENT
?ate@?$_Iosb@H@std@@2W4_Openmode@12@B DD 04H		; std::_Iosb<int>::ate
CONST	ENDS
;	COMDAT ?out@?$_Iosb@H@std@@2W4_Openmode@12@B
CONST	SEGMENT
?out@?$_Iosb@H@std@@2W4_Openmode@12@B DD 02H		; std::_Iosb<int>::out
CONST	ENDS
;	COMDAT ?in@?$_Iosb@H@std@@2W4_Openmode@12@B
CONST	SEGMENT
?in@?$_Iosb@H@std@@2W4_Openmode@12@B DD 01H		; std::_Iosb<int>::in
CONST	ENDS
;	COMDAT ?_Hardfail@?$_Iosb@H@std@@2W4_Iostate@12@B
CONST	SEGMENT
?_Hardfail@?$_Iosb@H@std@@2W4_Iostate@12@B DD 010H	; std::_Iosb<int>::_Hardfail
CONST	ENDS
;	COMDAT ?badbit@?$_Iosb@H@std@@2W4_Iostate@12@B
CONST	SEGMENT
?badbit@?$_Iosb@H@std@@2W4_Iostate@12@B DD 04H		; std::_Iosb<int>::badbit
CONST	ENDS
;	COMDAT ?failbit@?$_Iosb@H@std@@2W4_Iostate@12@B
CONST	SEGMENT
?failbit@?$_Iosb@H@std@@2W4_Iostate@12@B DD 02H		; std::_Iosb<int>::failbit
CONST	ENDS
;	COMDAT ?eofbit@?$_Iosb@H@std@@2W4_Iostate@12@B
CONST	SEGMENT
?eofbit@?$_Iosb@H@std@@2W4_Iostate@12@B DD 01H		; std::_Iosb<int>::eofbit
CONST	ENDS
;	COMDAT ?goodbit@?$_Iosb@H@std@@2W4_Iostate@12@B
CONST	SEGMENT
?goodbit@?$_Iosb@H@std@@2W4_Iostate@12@B DD 00H		; std::_Iosb<int>::goodbit
CONST	ENDS
;	COMDAT ?floatfield@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?floatfield@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 03000H	; std::_Iosb<int>::floatfield
CONST	ENDS
;	COMDAT ?basefield@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?basefield@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 0e00H	; std::_Iosb<int>::basefield
CONST	ENDS
;	COMDAT ?adjustfield@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?adjustfield@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 01c0H	; std::_Iosb<int>::adjustfield
CONST	ENDS
;	COMDAT ?_Stdio@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?_Stdio@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 08000H	; std::_Iosb<int>::_Stdio
CONST	ENDS
;	COMDAT ?boolalpha@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?boolalpha@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 04000H	; std::_Iosb<int>::boolalpha
CONST	ENDS
;	COMDAT ?fixed@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?fixed@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 02000H	; std::_Iosb<int>::fixed
CONST	ENDS
;	COMDAT ?scientific@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?scientific@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 01000H	; std::_Iosb<int>::scientific
CONST	ENDS
;	COMDAT ?hex@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?hex@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 0800H		; std::_Iosb<int>::hex
CONST	ENDS
;	COMDAT ?oct@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?oct@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 0400H		; std::_Iosb<int>::oct
CONST	ENDS
;	COMDAT ?dec@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?dec@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 0200H		; std::_Iosb<int>::dec
CONST	ENDS
;	COMDAT ?internal@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?internal@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 0100H	; std::_Iosb<int>::internal
CONST	ENDS
;	COMDAT ?right@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?right@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 080H		; std::_Iosb<int>::right
CONST	ENDS
;	COMDAT ?left@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?left@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 040H		; std::_Iosb<int>::left
CONST	ENDS
;	COMDAT ?showpos@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?showpos@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 020H	; std::_Iosb<int>::showpos
CONST	ENDS
;	COMDAT ?showpoint@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?showpoint@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 010H	; std::_Iosb<int>::showpoint
CONST	ENDS
;	COMDAT ?showbase@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?showbase@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 08H	; std::_Iosb<int>::showbase
CONST	ENDS
;	COMDAT ?uppercase@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?uppercase@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 04H	; std::_Iosb<int>::uppercase
CONST	ENDS
;	COMDAT ?unitbuf@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?unitbuf@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 02H	; std::_Iosb<int>::unitbuf
CONST	ENDS
;	COMDAT ?skipws@?$_Iosb@H@std@@2W4_Fmtflags@12@B
CONST	SEGMENT
?skipws@?$_Iosb@H@std@@2W4_Fmtflags@12@B DD 01H		; std::_Iosb<int>::skipws
CONST	ENDS
;	COMDAT ?table_size@?$ctype@D@std@@2IB
CONST	SEGMENT
?table_size@?$ctype@D@std@@2IB DD 0100H			; std::ctype<char>::table_size
CONST	ENDS
;	COMDAT ?none@?$_Locbase@H@std@@2HB
CONST	SEGMENT
?none@?$_Locbase@H@std@@2HB DD 00H			; std::_Locbase<int>::none
CONST	ENDS
;	COMDAT ?all@?$_Locbase@H@std@@2HB
CONST	SEGMENT
?all@?$_Locbase@H@std@@2HB DD 03fH			; std::_Locbase<int>::all
CONST	ENDS
;	COMDAT ?messages@?$_Locbase@H@std@@2HB
CONST	SEGMENT
?messages@?$_Locbase@H@std@@2HB DD 020H			; std::_Locbase<int>::messages
CONST	ENDS
;	COMDAT ?time@?$_Locbase@H@std@@2HB
CONST	SEGMENT
?time@?$_Locbase@H@std@@2HB DD 010H			; std::_Locbase<int>::time
CONST	ENDS
;	COMDAT ?numeric@?$_Locbase@H@std@@2HB
CONST	SEGMENT
?numeric@?$_Locbase@H@std@@2HB DD 08H			; std::_Locbase<int>::numeric
CONST	ENDS
;	COMDAT ?monetary@?$_Locbase@H@std@@2HB
CONST	SEGMENT
?monetary@?$_Locbase@H@std@@2HB DD 04H			; std::_Locbase<int>::monetary
CONST	ENDS
;	COMDAT ?ctype@?$_Locbase@H@std@@2HB
CONST	SEGMENT
?ctype@?$_Locbase@H@std@@2HB DD 02H			; std::_Locbase<int>::ctype
CONST	ENDS
;	COMDAT ?collate@?$_Locbase@H@std@@2HB
CONST	SEGMENT
?collate@?$_Locbase@H@std@@2HB DD 01H			; std::_Locbase<int>::collate
CONST	ENDS
_DATA	SEGMENT
__bad_alloc_Message DD FLAT:??_C@_0P@GHFPNOJB@bad?5allocation?$AA@
_cleanupLogOnFirstRun DB 01H
	ORG $+3
_prefixPattern DD 0baadf00dH
_postfixPattern DD 0deadc0deH
_unusedPattern DD 0feedfaceH
_releasedPattern DD 0deadbeefH
_allocationTypes DD FLAT:??_C@_07NBCGADJA@Unknown?$AA@
	DD	FLAT:??_C@_03CLCAEGCJ@new?$AA@
	DD	FLAT:??_C@_05LEAFLCCG@new?$FL?$FN?$AA@
	DD	FLAT:??_C@_06GLDDLHNF@malloc?$AA@
	DD	FLAT:??_C@_06DLAMMMII@calloc?$AA@
	DD	FLAT:??_C@_07EOOHGPEI@realloc?$AA@
	DD	FLAT:??_C@_06FOBLBEIN@delete?$AA@
	DD	FLAT:??_C@_08PLALIOCI@delete?$FL?$FN?$AA@
	DD	FLAT:??_C@_04LIAPHEDB@free?$AA@
_sourceFile DD	FLAT:??_C@_02HHFHKOHM@?$DP?$DP?$AA@
_sourceFunc DD	FLAT:??_C@_02HHFHKOHM@?$DP?$DP?$AA@
_memoryLogFile DD FLAT:??_C@_00CNPNBAHC@?$AA@
_memoryLeakLogFile DD FLAT:??_C@_00CNPNBAHC@?$AA@
_DATA	ENDS
;	COMDAT ??_C@_0P@GHFPNOJB@bad?5allocation?$AA@
CONST	SEGMENT
??_C@_0P@GHFPNOJB@bad?5allocation?$AA@ DB 'bad allocation', 00H ; `string'
CONST	ENDS
PUBLIC	??_7bad_alloc@std@@6B@				; std::bad_alloc::`vftable'
PUBLIC	??0bad_alloc@std@@QAE@PBD@Z			; std::bad_alloc::bad_alloc
PUBLIC	??_R4bad_alloc@std@@6B@				; std::bad_alloc::`RTTI Complete Object Locator'
PUBLIC	??_R0?AVbad_alloc@std@@@8			; std::bad_alloc `RTTI Type Descriptor'
PUBLIC	??_R3bad_alloc@std@@8				; std::bad_alloc::`RTTI Class Hierarchy Descriptor'
PUBLIC	??_R2bad_alloc@std@@8				; std::bad_alloc::`RTTI Base Class Array'
PUBLIC	??_R1A@?0A@EA@bad_alloc@std@@8			; std::bad_alloc::`RTTI Base Class Descriptor at (0,-1,0,64)'
PUBLIC	??_R1A@?0A@EA@exception@std@@8			; std::exception::`RTTI Base Class Descriptor at (0,-1,0,64)'
PUBLIC	??_R0?AVexception@std@@@8			; std::exception `RTTI Type Descriptor'
PUBLIC	??_R3exception@std@@8				; std::exception::`RTTI Class Hierarchy Descriptor'
PUBLIC	??_R2exception@std@@8				; std::exception::`RTTI Base Class Array'
EXTRN	??0exception@std@@QAE@ABQBD@Z:PROC		; std::exception::exception
EXTRN	??_7type_info@@6B@:QWORD			; type_info::`vftable'
EXTRN	??_Ebad_alloc@std@@UAEPAXI@Z:PROC		; std::bad_alloc::`vector deleting destructor'
EXTRN	?what@exception@std@@UBEPBDXZ:PROC		; std::exception::what
;	COMDAT ??_R2exception@std@@8
; File c:\program files\microsoft visual studio 8\vc\include\exception
rdata$r	SEGMENT
??_R2exception@std@@8 DD FLAT:??_R1A@?0A@EA@exception@std@@8 ; std::exception::`RTTI Base Class Array'
rdata$r	ENDS
;	COMDAT ??_R3exception@std@@8
rdata$r	SEGMENT
??_R3exception@std@@8 DD 00H				; std::exception::`RTTI Class Hierarchy Descriptor'
	DD	00H
	DD	01H
	DD	FLAT:??_R2exception@std@@8
rdata$r	ENDS
;	COMDAT ??_R0?AVexception@std@@@8
_DATA	SEGMENT
??_R0?AVexception@std@@@8 DD FLAT:??_7type_info@@6B@	; std::exception `RTTI Type Descriptor'
	DD	00H
	DB	'.?AVexception@std@@', 00H
_DATA	ENDS
;	COMDAT ??_R1A@?0A@EA@exception@std@@8
rdata$r	SEGMENT
??_R1A@?0A@EA@exception@std@@8 DD FLAT:??_R0?AVexception@std@@@8 ; std::exception::`RTTI Base Class Descriptor at (0,-1,0,64)'
	DD	00H
	DD	00H
	DD	0ffffffffH
	DD	00H
	DD	040H
	DD	FLAT:??_R3exception@std@@8
rdata$r	ENDS
;	COMDAT ??_R1A@?0A@EA@bad_alloc@std@@8
rdata$r	SEGMENT
??_R1A@?0A@EA@bad_alloc@std@@8 DD FLAT:??_R0?AVbad_alloc@std@@@8 ; std::bad_alloc::`RTTI Base Class Descriptor at (0,-1,0,64)'
	DD	01H
	DD	00H
	DD	0ffffffffH
	DD	00H
	DD	040H
	DD	FLAT:??_R3bad_alloc@std@@8
rdata$r	ENDS
;	COMDAT ??_R2bad_alloc@std@@8
rdata$r	SEGMENT
??_R2bad_alloc@std@@8 DD FLAT:??_R1A@?0A@EA@bad_alloc@std@@8 ; std::bad_alloc::`RTTI Base Class Array'
	DD	FLAT:??_R1A@?0A@EA@exception@std@@8
rdata$r	ENDS
;	COMDAT ??_R3bad_alloc@std@@8
rdata$r	SEGMENT
??_R3bad_alloc@std@@8 DD 00H				; std::bad_alloc::`RTTI Class Hierarchy Descriptor'
	DD	00H
	DD	02H
	DD	FLAT:??_R2bad_alloc@std@@8
rdata$r	ENDS
;	COMDAT ??_R0?AVbad_alloc@std@@@8
_DATA	SEGMENT
??_R0?AVbad_alloc@std@@@8 DD FLAT:??_7type_info@@6B@	; std::bad_alloc `RTTI Type Descriptor'
	DD	00H
	DB	'.?AVbad_alloc@std@@', 00H
_DATA	ENDS
;	COMDAT ??_R4bad_alloc@std@@6B@
rdata$r	SEGMENT
??_R4bad_alloc@std@@6B@ DD 00H				; std::bad_alloc::`RTTI Complete Object Locator'
	DD	00H
	DD	00H
	DD	FLAT:??_R0?AVbad_alloc@std@@@8
	DD	FLAT:??_R3bad_alloc@std@@8
rdata$r	ENDS
;	COMDAT ??_7bad_alloc@std@@6B@
CONST	SEGMENT
??_7bad_alloc@std@@6B@ DD FLAT:??_R4bad_alloc@std@@6B@	; std::bad_alloc::`vftable'
	DD	FLAT:??_Ebad_alloc@std@@UAEPAXI@Z
	DD	FLAT:?what@exception@std@@UBEPBDXZ
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ??0bad_alloc@std@@QAE@PBD@Z
_TEXT	SEGMENT
__Message$ = 8						; size = 4
??0bad_alloc@std@@QAE@PBD@Z PROC			; std::bad_alloc::bad_alloc, COMDAT
; _this$ = ecx

; 371  : 		{	// construct from message string

	push	esi
	lea	eax, DWORD PTR __Message$[esp]
	push	eax
	mov	esi, ecx
	call	??0exception@std@@QAE@ABQBD@Z		; std::exception::exception
	mov	DWORD PTR [esi], OFFSET ??_7bad_alloc@std@@6B@

; 372  : 		}

	mov	eax, esi
	pop	esi
	ret	4
??0bad_alloc@std@@QAE@PBD@Z ENDP			; std::bad_alloc::bad_alloc
_TEXT	ENDS
PUBLIC	??0bad_alloc@std@@QAE@XZ			; std::bad_alloc::bad_alloc
EXTRN	??0exception@std@@QAE@ABQBDH@Z:PROC		; std::exception::exception
; Function compile flags: /Ogtpy
;	COMDAT ??0bad_alloc@std@@QAE@XZ
_TEXT	SEGMENT
??0bad_alloc@std@@QAE@XZ PROC				; std::bad_alloc::bad_alloc, COMDAT
; _this$ = ecx

; 376  : 		{	// construct from message string with no memory allocation

	push	esi
	push	1
	push	OFFSET __bad_alloc_Message
	mov	esi, ecx
	call	??0exception@std@@QAE@ABQBDH@Z		; std::exception::exception
	mov	DWORD PTR [esi], OFFSET ??_7bad_alloc@std@@6B@

; 377  : 		}

	mov	eax, esi
	pop	esi
	ret	0
??0bad_alloc@std@@QAE@XZ ENDP				; std::bad_alloc::bad_alloc
_TEXT	ENDS
PUBLIC	??1bad_alloc@std@@UAE@XZ			; std::bad_alloc::~bad_alloc
EXTRN	??1exception@std@@UAE@XZ:PROC			; std::exception::~exception
; Function compile flags: /Ogtpy
;	COMDAT ??1bad_alloc@std@@UAE@XZ
_TEXT	SEGMENT
??1bad_alloc@std@@UAE@XZ PROC				; std::bad_alloc::~bad_alloc, COMDAT
; _this$ = ecx

; 380  : 		{	// destroy the object

	mov	DWORD PTR [ecx], OFFSET ??_7bad_alloc@std@@6B@

; 381  : 		}

	jmp	??1exception@std@@UAE@XZ		; std::exception::~exception
??1bad_alloc@std@@UAE@XZ ENDP				; std::bad_alloc::~bad_alloc
_TEXT	ENDS
EXTRN	__localtime64:PROC
; Function compile flags: /Ogtpy
; File c:\program files\microsoft visual studio 8\vc\include\time.inl
;	COMDAT _localtime
_TEXT	SEGMENT
_localtime PROC						; COMDAT
; __Time$ = eax

; 116  : #pragma warning( push )
; 117  : #pragma warning( disable : 4996 )
; 118  :     return _localtime64(_Time);

	push	eax
	call	__localtime64
	add	esp, 4

; 119  : #pragma warning( pop )
; 120  : }

	ret	0
_localtime ENDP
_TEXT	ENDS
EXTRN	__time64:PROC
; Function compile flags: /Ogtpy
;	COMDAT _time
_TEXT	SEGMENT
_time	PROC						; COMDAT
; __Time$ = eax

; 135  :     return _time64(_Time);

	push	eax
	call	__time64
	add	esp, 4

; 136  : }

	ret	0
_time	ENDP
_TEXT	ENDS
PUBLIC	??_C@_0DI@IBJJIDNM@?4?4?4so?0?5to?5find?5all?5errors?5in?5the@ ; `string'
PUBLIC	??_C@_0DM@DHCEDF@?5?5?5?$FLD?$FN?5?9?5Information?5used?5for?5de@ ; `string'
PUBLIC	??_C@_0EM@CBFHOHAP@?5?5?5?$FLF?$FN?5?9?5Failure?5induced?5for?5the@ ; `string'
PUBLIC	??_C@_0BN@NFLHEIAD@?5?5?5?$FLI?$FN?5?9?5Generic?5information?$AA@ ; `string'
PUBLIC	??_C@_0BG@FBLDLBMH@?5?5?5?$FL?9?$FN?5?9?5Deallocation?$AA@ ; `string'
PUBLIC	??_C@_0BG@DLPJDJNK@?5?5?5?$FL?$HO?$FN?5?9?5Reallocation?$AA@ ; `string'
PUBLIC	??_C@_0BE@JEADAANI@?5?5?5?$FL?$CL?$FN?5?9?5Allocation?$AA@ ; `string'
PUBLIC	??_C@_0P@PEOOEJPA@?5?5?5?$FL?$CB?$FN?5?9?5Error?$AA@ ; `string'
PUBLIC	??_C@_0DO@OFGEJHPA@Note?5that?5the?5following?5guides?5a@ ; `string'
PUBLIC	??_C@_0BD@GHEHAIPE@extremely?5helpful?4?$AA@	; `string'
PUBLIC	??_C@_0EO@KKJDCBHI@There?5is?5a?5lot?5of?5useful?5informa@ ; `string'
PUBLIC	??_C@_0P@NJMPAHFG@reallocations?4?$AA@		; `string'
PUBLIC	??_C@_0EG@HLMENCBE@or?5by?5tracking?5a?5specific?5addres@ ; `string'
PUBLIC	??_C@_0FB@FDENIDBF@issues?4?5You?5can?5do?5this?5by?5traci@ ; `string'
PUBLIC	??_C@_0EL@CHPKMMOI@Interrogate?5this?5file?5to?5track?5e@ ; `string'
PUBLIC	??_C@_0FB@PECCKEMI@This?5file?5contains?5a?5log?5of?5all?5@ ; `string'
PUBLIC	??_C@_0CN@PDCJMMJP@?5?5?5?5?5?5?$CFs?5?9?5Memory?5logging?5file?5c@ ; `string'
PUBLIC	??_C@_0FB@DCLGMKGJ@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@ ; `string'
PUBLIC	??_C@_0GL@NCGMOIPN@?$HM?5?5?5Memory?5log?5report?5for?3?5?5?$CF02d@ ; `string'
PUBLIC	?log@@YAXPBDZZ					; log
PUBLIC	??_C@_0GA@DBDBKGKP@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@ ; `string'
EXTRN	_asctime:PROC
EXTRN	_remove:PROC
EXTRN	__imp__GetFileAttributesA@4:PROC
;	COMDAT ?t@?7??doCleanupLogOnFirstRun@@YAXXZ@4_JA
_BSS	SEGMENT
?t@?7??doCleanupLogOnFirstRun@@YAXXZ@4_JA DQ 01H DUP (?) ; `doCleanupLogOnFirstRun'::`8'::t
_BSS	ENDS
;	COMDAT ?attrib@?4??doCleanupLogOnFirstRun@@YAXXZ@4KA
_BSS	SEGMENT
?attrib@?4??doCleanupLogOnFirstRun@@YAXXZ@4KA DD 01H DUP (?) ; `doCleanupLogOnFirstRun'::`5'::attrib
_BSS	ENDS
;	COMDAT ?$S1@?4??doCleanupLogOnFirstRun@@YAXXZ@4IA
_BSS	SEGMENT
?$S1@?4??doCleanupLogOnFirstRun@@YAXXZ@4IA DD 01H DUP (?) ; `doCleanupLogOnFirstRun'::`5'::$S1
_BSS	ENDS
;	COMDAT ??_C@_0DI@IBJJIDNM@?4?4?4so?0?5to?5find?5all?5errors?5in?5the@
CONST	SEGMENT
??_C@_0DI@IBJJIDNM@?4?4?4so?0?5to?5find?5all?5errors?5in?5the@ DB '...so,'
	DB	' to find all errors in the file, search for "[!]"', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0DM@DHCEDF@?5?5?5?$FLD?$FN?5?9?5Information?5used?5for?5de@
CONST	SEGMENT
??_C@_0DM@DHCEDF@?5?5?5?$FLD?$FN?5?9?5Information?5used?5for?5de@ DB '   '
	DB	'[D] - Information used for debugging this memory manager', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0EM@CBFHOHAP@?5?5?5?$FLF?$FN?5?9?5Failure?5induced?5for?5the@
CONST	SEGMENT
??_C@_0EM@CBFHOHAP@?5?5?5?$FLF?$FN?5?9?5Failure?5induced?5for?5the@ DB ' '
	DB	'  [F] - Failure induced for the purpose of stress-testing you'
	DB	'r application', 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_0BN@NFLHEIAD@?5?5?5?$FLI?$FN?5?9?5Generic?5information?$AA@
CONST	SEGMENT
??_C@_0BN@NFLHEIAD@?5?5?5?$FLI?$FN?5?9?5Generic?5information?$AA@ DB '   '
	DB	'[I] - Generic information', 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_0BG@FBLDLBMH@?5?5?5?$FL?9?$FN?5?9?5Deallocation?$AA@
CONST	SEGMENT
??_C@_0BG@FBLDLBMH@?5?5?5?$FL?9?$FN?5?9?5Deallocation?$AA@ DB '   [-] - D'
	DB	'eallocation', 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_0BG@DLPJDJNK@?5?5?5?$FL?$HO?$FN?5?9?5Reallocation?$AA@
CONST	SEGMENT
??_C@_0BG@DLPJDJNK@?5?5?5?$FL?$HO?$FN?5?9?5Reallocation?$AA@ DB '   [~] -'
	DB	' Reallocation', 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_0BE@JEADAANI@?5?5?5?$FL?$CL?$FN?5?9?5Allocation?$AA@
CONST	SEGMENT
??_C@_0BE@JEADAANI@?5?5?5?$FL?$CL?$FN?5?9?5Allocation?$AA@ DB '   [+] - A'
	DB	'llocation', 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_0P@PEOOEJPA@?5?5?5?$FL?$CB?$FN?5?9?5Error?$AA@
CONST	SEGMENT
??_C@_0P@PEOOEJPA@?5?5?5?$FL?$CB?$FN?5?9?5Error?$AA@ DB '   [!] - Error', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0DO@OFGEJHPA@Note?5that?5the?5following?5guides?5a@
CONST	SEGMENT
??_C@_0DO@OFGEJHPA@Note?5that?5the?5following?5guides?5a@ DB 'Note that t'
	DB	'he following guides are used throughout this file:', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0BD@GHEHAIPE@extremely?5helpful?4?$AA@
CONST	SEGMENT
??_C@_0BD@GHEHAIPE@extremely?5helpful?4?$AA@ DB 'extremely helpful.', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0EO@KKJDCBHI@There?5is?5a?5lot?5of?5useful?5informa@
CONST	SEGMENT
??_C@_0EO@KKJDCBHI@There?5is?5a?5lot?5of?5useful?5informa@ DB 'There is a'
	DB	' lot of useful information here which, when used creatively, '
	DB	'can be', 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_0P@NJMPAHFG@reallocations?4?$AA@
CONST	SEGMENT
??_C@_0P@NJMPAHFG@reallocations?4?$AA@ DB 'reallocations.', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0EG@HLMENCBE@or?5by?5tracking?5a?5specific?5addres@
CONST	SEGMENT
??_C@_0EG@HLMENCBE@or?5by?5tracking?5a?5specific?5addres@ DB 'or by track'
	DB	'ing a specific address through a series of allocations and', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0FB@FDENIDBF@issues?4?5You?5can?5do?5this?5by?5traci@
CONST	SEGMENT
??_C@_0FB@FDENIDBF@issues?4?5You?5can?5do?5this?5by?5traci@ DB 'issues. Y'
	DB	'ou can do this by tracing the allocations performed by a spec'
	DB	'ific owner', 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_0EL@CHPKMMOI@Interrogate?5this?5file?5to?5track?5e@
CONST	SEGMENT
??_C@_0EL@CHPKMMOI@Interrogate?5this?5file?5to?5track?5e@ DB 'Interrogate'
	DB	' this file to track errors or to help track down memory-relat'
	DB	'ed', 00H					; `string'
CONST	ENDS
;	COMDAT ??_C@_0FB@PECCKEMI@This?5file?5contains?5a?5log?5of?5all?5@
CONST	SEGMENT
??_C@_0FB@PECCKEMI@This?5file?5contains?5a?5log?5of?5all?5@ DB 'This file'
	DB	' contains a log of all memory operations performed during the'
	DB	' last run.', 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_0CN@PDCJMMJP@?5?5?5?5?5?5?$CFs?5?9?5Memory?5logging?5file?5c@
CONST	SEGMENT
??_C@_0CN@PDCJMMJP@?5?5?5?5?5?5?$CFs?5?9?5Memory?5logging?5file?5c@ DB ' '
	DB	'     %s - Memory logging file created on %s', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0FB@DCLGMKGJ@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
CONST	SEGMENT
??_C@_0FB@DCLGMKGJ@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@ DB '-'
	DB	'-------------------------------------------------------------'
	DB	'------------------', 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_0GL@NCGMOIPN@?$HM?5?5?5Memory?5log?5report?5for?3?5?5?$CF02d@
CONST	SEGMENT
??_C@_0GL@NCGMOIPN@?$HM?5?5?5Memory?5log?5report?5for?3?5?5?$CF02d@ DB '|'
	DB	'   Memory log report for:  %02d/%02d/%04d %02d:%02d:%02d     '
	DB	'                                           |', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0GA@DBDBKGKP@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
CONST	SEGMENT
??_C@_0GA@DBDBKGKP@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@ DB '-'
	DB	'-------------------------------------------------------------'
	DB	'---------------------------------', 00H	; `string'
; Function compile flags: /Ogtpy
; File d:\source code\stgm\mmgr.cpp
CONST	ENDS
;	COMDAT ?doCleanupLogOnFirstRun@@YAXXZ
_TEXT	SEGMENT
_t$37636 = -8						; size = 8
?doCleanupLogOnFirstRun@@YAXXZ PROC			; doCleanupLogOnFirstRun, COMDAT

; 322  : {

	sub	esp, 8

; 323  : 	if (cleanupLogOnFirstRun)

	cmp	BYTE PTR _cleanupLogOnFirstRun, 0
	je	$LN4@doCleanupL

; 324  : 	{
; 325  : 		cleanupLogOnFirstRun = false;
; 326  : 		static unsigned long attrib = GetFileAttributes(memoryLogFile);

	test	BYTE PTR ?$S1@?4??doCleanupLogOnFirstRun@@YAXXZ@4IA, 1
	mov	BYTE PTR _cleanupLogOnFirstRun, 0
	jne	SHORT $LN15@doCleanupL
	mov	eax, DWORD PTR _memoryLogFile
	or	DWORD PTR ?$S1@?4??doCleanupLogOnFirstRun@@YAXXZ@4IA, 1
	push	eax
	call	DWORD PTR __imp__GetFileAttributesA@4
	mov	DWORD PTR ?attrib@?4??doCleanupLogOnFirstRun@@YAXXZ@4KA, eax
$LN15@doCleanupL:

; 327  : 		if (attrib != 0xFFFFFFFF)

	cmp	DWORD PTR ?attrib@?4??doCleanupLogOnFirstRun@@YAXXZ@4KA, -1
	je	SHORT $LN2@doCleanupL

; 328  : 		{
; 329  : 			static time_t  t = time(NULL);

	mov	eax, 2
	test	BYTE PTR ?$S1@?4??doCleanupLogOnFirstRun@@YAXXZ@4IA, al
	jne	SHORT $LN1@doCleanupL
	or	DWORD PTR ?$S1@?4??doCleanupLogOnFirstRun@@YAXXZ@4IA, eax
	push	0
	call	__time64
	add	esp, 4
	mov	DWORD PTR ?t@?7??doCleanupLogOnFirstRun@@YAXXZ@4_JA, eax
	mov	DWORD PTR ?t@?7??doCleanupLogOnFirstRun@@YAXXZ@4_JA+4, edx
$LN1@doCleanupL:
	push	esi

; 330  : 			struct  tm *tme = localtime(&t);

	push	OFFSET ?t@?7??doCleanupLogOnFirstRun@@YAXXZ@4_JA
	call	__localtime64

; 331  : 
; 332  : 			log("-----------------------------------------------------------------------------------------------");

	push	OFFSET ??_C@_0GA@DBDBKGKP@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	mov	esi, eax
	call	?log@@YAXPBDZZ				; log

; 333  : 			log("|   Memory log report for:  %02d/%02d/%04d %02d:%02d:%02d                                                |", tme->tm_mon + 1, tme->tm_mday, tme->tm_year + 1900, tme->tm_hour, tme->tm_min, tme->tm_sec);

	mov	ecx, DWORD PTR [esi]
	mov	edx, DWORD PTR [esi+4]
	mov	eax, DWORD PTR [esi+8]
	push	ecx
	mov	ecx, DWORD PTR [esi+20]
	push	edx
	mov	edx, DWORD PTR [esi+12]
	push	eax
	mov	eax, DWORD PTR [esi+16]
	add	ecx, 1900				; 0000076cH
	push	ecx
	push	edx
	add	eax, 1
	push	eax
	push	OFFSET ??_C@_0GL@NCGMOIPN@?$HM?5?5?5Memory?5log?5report?5for?3?5?5?$CF02d@
	call	?log@@YAXPBDZZ				; log

; 334  : 			log("-----------------------------------------------------------------------------------------------");

	push	OFFSET ??_C@_0GA@DBDBKGKP@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	call	?log@@YAXPBDZZ				; log
	add	esp, 40					; 00000028H
	pop	esi

; 370  : 	}
; 371  : }

	add	esp, 8
	ret	0
$LN2@doCleanupL:

; 335  : 			return;
; 336  : 		}
; 337  : 		remove(memoryLogFile);

	mov	ecx, DWORD PTR _memoryLogFile
	push	ecx
	call	_remove

; 338  : 
; 339  : 		// Print a header for the log
; 340  : 
; 341  : 		time_t	t = time(NULL);

	push	0
	call	__time64

; 342  : 		log("--------------------------------------------------------------------------------");

	push	OFFSET ??_C@_0FB@DCLGMKGJ@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	mov	DWORD PTR _t$37636[esp+20], eax
	mov	DWORD PTR _t$37636[esp+24], edx
	call	?log@@YAXPBDZZ				; log

; 343  : 		log("");

	push	OFFSET ??_C@_00CNPNBAHC@?$AA@
	call	?log@@YAXPBDZZ				; log

; 344  : 		log("      %s - Memory logging file created on %s", memoryLogFile, asctime(localtime(&t)));

	lea	edx, DWORD PTR _t$37636[esp+24]
	push	edx
	call	__localtime64
	push	eax
	call	_asctime
	push	eax
	mov	eax, DWORD PTR _memoryLogFile
	push	eax
	push	OFFSET ??_C@_0CN@PDCJMMJP@?5?5?5?5?5?5?$CFs?5?9?5Memory?5logging?5file?5c@
	call	?log@@YAXPBDZZ				; log

; 345  : 		log("--------------------------------------------------------------------------------");

	push	OFFSET ??_C@_0FB@DCLGMKGJ@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	call	?log@@YAXPBDZZ				; log

; 346  : 		log("");

	push	OFFSET ??_C@_00CNPNBAHC@?$AA@
	call	?log@@YAXPBDZZ				; log

; 347  : 		log("This file contains a log of all memory operations performed during the last run.");

	push	OFFSET ??_C@_0FB@PECCKEMI@This?5file?5contains?5a?5log?5of?5all?5@
	call	?log@@YAXPBDZZ				; log

; 348  : 		log("");

	push	OFFSET ??_C@_00CNPNBAHC@?$AA@
	call	?log@@YAXPBDZZ				; log

; 349  : 		log("Interrogate this file to track errors or to help track down memory-related");

	push	OFFSET ??_C@_0EL@CHPKMMOI@Interrogate?5this?5file?5to?5track?5e@
	call	?log@@YAXPBDZZ				; log

; 350  : 		log("issues. You can do this by tracing the allocations performed by a specific owner");

	push	OFFSET ??_C@_0FB@FDENIDBF@issues?4?5You?5can?5do?5this?5by?5traci@
	call	?log@@YAXPBDZZ				; log

; 351  : 		log("or by tracking a specific address through a series of allocations and");

	push	OFFSET ??_C@_0EG@HLMENCBE@or?5by?5tracking?5a?5specific?5addres@
	call	?log@@YAXPBDZZ				; log
	add	esp, 64					; 00000040H

; 352  : 		log("reallocations.");

	push	OFFSET ??_C@_0P@NJMPAHFG@reallocations?4?$AA@
	call	?log@@YAXPBDZZ				; log

; 353  : 		log("");

	push	OFFSET ??_C@_00CNPNBAHC@?$AA@
	call	?log@@YAXPBDZZ				; log

; 354  : 		log("There is a lot of useful information here which, when used creatively, can be");

	push	OFFSET ??_C@_0EO@KKJDCBHI@There?5is?5a?5lot?5of?5useful?5informa@
	call	?log@@YAXPBDZZ				; log

; 355  : 		log("extremely helpful.");

	push	OFFSET ??_C@_0BD@GHEHAIPE@extremely?5helpful?4?$AA@
	call	?log@@YAXPBDZZ				; log

; 356  : 		log("");

	push	OFFSET ??_C@_00CNPNBAHC@?$AA@
	call	?log@@YAXPBDZZ				; log

; 357  : 		log("Note that the following guides are used throughout this file:");

	push	OFFSET ??_C@_0DO@OFGEJHPA@Note?5that?5the?5following?5guides?5a@
	call	?log@@YAXPBDZZ				; log

; 358  : 		log("");

	push	OFFSET ??_C@_00CNPNBAHC@?$AA@
	call	?log@@YAXPBDZZ				; log

; 359  : 		log("   [!] - Error");

	push	OFFSET ??_C@_0P@PEOOEJPA@?5?5?5?$FL?$CB?$FN?5?9?5Error?$AA@
	call	?log@@YAXPBDZZ				; log

; 360  : 		log("   [+] - Allocation");

	push	OFFSET ??_C@_0BE@JEADAANI@?5?5?5?$FL?$CL?$FN?5?9?5Allocation?$AA@
	call	?log@@YAXPBDZZ				; log

; 361  : 		log("   [~] - Reallocation");

	push	OFFSET ??_C@_0BG@DLPJDJNK@?5?5?5?$FL?$HO?$FN?5?9?5Reallocation?$AA@
	call	?log@@YAXPBDZZ				; log

; 362  : 		log("   [-] - Deallocation");

	push	OFFSET ??_C@_0BG@FBLDLBMH@?5?5?5?$FL?9?$FN?5?9?5Deallocation?$AA@
	call	?log@@YAXPBDZZ				; log

; 363  : 		log("   [I] - Generic information");

	push	OFFSET ??_C@_0BN@NFLHEIAD@?5?5?5?$FLI?$FN?5?9?5Generic?5information?$AA@
	call	?log@@YAXPBDZZ				; log

; 364  : 		log("   [F] - Failure induced for the purpose of stress-testing your application");

	push	OFFSET ??_C@_0EM@CBFHOHAP@?5?5?5?$FLF?$FN?5?9?5Failure?5induced?5for?5the@
	call	?log@@YAXPBDZZ				; log

; 365  : 		log("   [D] - Information used for debugging this memory manager");

	push	OFFSET ??_C@_0DM@DHCEDF@?5?5?5?$FLD?$FN?5?9?5Information?5used?5for?5de@
	call	?log@@YAXPBDZZ				; log

; 366  : 		log("");

	push	OFFSET ??_C@_00CNPNBAHC@?$AA@
	call	?log@@YAXPBDZZ				; log

; 367  : 		log("...so, to find all errors in the file, search for \"[!]\"");

	push	OFFSET ??_C@_0DI@IBJJIDNM@?4?4?4so?0?5to?5find?5all?5errors?5in?5the@
	call	?log@@YAXPBDZZ				; log
	add	esp, 64					; 00000040H

; 368  : 		log("");

	push	OFFSET ??_C@_00CNPNBAHC@?$AA@
	call	?log@@YAXPBDZZ				; log

; 369  : 		log("--------------------------------------------------------------------------------");

	push	OFFSET ??_C@_0FB@DCLGMKGJ@?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	call	?log@@YAXPBDZZ				; log
	add	esp, 8
$LN4@doCleanupL:

; 370  : 	}
; 371  : }

	add	esp, 8
	ret	0
?doCleanupLogOnFirstRun@@YAXXZ ENDP			; doCleanupLogOnFirstRun
_TEXT	ENDS
EXTRN	_strrchr:PROC
; Function compile flags: /Ogtpy
;	COMDAT ?sourceFileStripper@@YAPBDPBD@Z
_TEXT	SEGMENT
?sourceFileStripper@@YAPBDPBD@Z PROC			; sourceFileStripper, COMDAT
; _sourceFile$ = esi

; 377  : 	const char	*ptr = strrchr(sourceFile, '\\');

	push	92					; 0000005cH
	push	esi
	call	_strrchr
	add	esp, 8

; 378  : 	if (ptr) return ptr + 1;

	test	eax, eax
	je	SHORT $LN2@sourceFile
$LN5@sourceFile:
	add	eax, 1

; 382  : }

	ret	0
$LN2@sourceFile:

; 379  : 	ptr = strrchr(sourceFile, '/');

	push	47					; 0000002fH
	push	esi
	call	_strrchr
	add	esp, 8

; 380  : 	if (ptr) return ptr + 1;

	test	eax, eax
	jne	SHORT $LN5@sourceFile

; 381  : 	return sourceFile;

	mov	eax, esi

; 382  : }

	ret	0
?sourceFileStripper@@YAPBDPBD@Z ENDP			; sourceFileStripper
_TEXT	ENDS
PUBLIC	??_C@_0N@GKPAADIG@?$CFs?$CI?$CF05d?$CJ?3?3?$CFs?$AA@ ; `string'
EXTRN	__snprintf:PROC
EXTRN	_memset:PROC
;	COMDAT ?str@?1??ownerString@@YAPBDPBDI0@Z@4PADA
_BSS	SEGMENT
?str@?1??ownerString@@YAPBDPBDI0@Z@4PADA DB 0b4H DUP (?) ; `ownerString'::`2'::str
_BSS	ENDS
;	COMDAT ??_C@_0N@GKPAADIG@?$CFs?$CI?$CF05d?$CJ?3?3?$CFs?$AA@
CONST	SEGMENT
??_C@_0N@GKPAADIG@?$CFs?$CI?$CF05d?$CJ?3?3?$CFs?$AA@ DB '%s(%05d)::%s', 00H ; `string'
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ?ownerString@@YAPBDPBDI0@Z
_TEXT	SEGMENT
_sourceLine$ = 8					; size = 4
_sourceFunc$ = 12					; size = 4
?ownerString@@YAPBDPBDI0@Z PROC				; ownerString, COMDAT
; _sourceFile$ = eax

; 387  : {

	push	esi

; 388  : 	sourceFunc;
; 389  : 	static	char	str[180];
; 390  : 	memset(str, 0, sizeof(str));

	push	180					; 000000b4H
	push	0
	push	OFFSET ?str@?1??ownerString@@YAPBDPBDI0@Z@4PADA
	mov	esi, eax
	call	_memset

; 391  : 	_snprintf(str, 179, "%s(%05d)::%s", sourceFileStripper(sourceFile), sourceLine, sourceFunc);

	push	92					; 0000005cH
	push	esi
	call	_strrchr
	add	esp, 20					; 00000014H
	test	eax, eax
	jne	SHORT $LN7@ownerStrin
	push	47					; 0000002fH
	push	esi
	call	_strrchr
	add	esp, 8
	test	eax, eax
	je	SHORT $LN3@ownerStrin
$LN7@ownerStrin:
	lea	esi, DWORD PTR [eax+1]
$LN3@ownerStrin:
	mov	eax, DWORD PTR _sourceFunc$[esp]
	mov	ecx, DWORD PTR _sourceLine$[esp]
	push	eax
	push	ecx
	push	esi
	push	OFFSET ??_C@_0N@GKPAADIG@?$CFs?$CI?$CF05d?$CJ?3?3?$CFs?$AA@
	push	179					; 000000b3H
	push	OFFSET ?str@?1??ownerString@@YAPBDPBDI0@Z@4PADA
	call	__snprintf
	add	esp, 24					; 00000018H

; 392  : 	return str;

	mov	eax, OFFSET ?str@?1??ownerString@@YAPBDPBDI0@Z@4PADA
	pop	esi

; 393  : }

	ret	0
?ownerString@@YAPBDPBDI0@Z ENDP				; ownerString
_TEXT	ENDS
PUBLIC	??_C@_02GMHACPFF@?$CFu?$AA@			; `string'
EXTRN	_memmove:PROC
EXTRN	_sprintf:PROC
;	COMDAT ?str@?1??insertCommas@@YAPBDI@Z@4PADA
_BSS	SEGMENT
?str@?1??insertCommas@@YAPBDI@Z@4PADA DB 01eH DUP (?)	; `insertCommas'::`2'::str
_BSS	ENDS
;	COMDAT ??_C@_02GMHACPFF@?$CFu?$AA@
CONST	SEGMENT
??_C@_02GMHACPFF@?$CFu?$AA@ DB '%u', 00H		; `string'
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ?insertCommas@@YAPBDI@Z
_TEXT	SEGMENT
_value$ = 8						; size = 4
?insertCommas@@YAPBDI@Z PROC				; insertCommas, COMDAT

; 399  : 	static	char	str[30];
; 400  : 	memset(str, 0, sizeof(str));

	xor	eax, eax
	mov	DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA, eax
	mov	DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA+4, eax
	mov	DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA+8, eax
	mov	DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA+12, eax
	mov	DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA+16, eax
	mov	DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA+20, eax
	mov	DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA+24, eax
	mov	WORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA+28, ax

; 401  : 
; 402  : 	sprintf(str, "%u", value);

	mov	eax, DWORD PTR _value$[esp-4]
	push	eax
	push	OFFSET ??_C@_02GMHACPFF@?$CFu?$AA@
	push	OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	call	_sprintf

; 403  : 	if (strlen(str) > 3)

	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	add	esp, 12					; 0000000cH
	lea	edx, DWORD PTR [eax+1]
	npad	6
$LL6@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL6@insertComm
	sub	eax, edx
	cmp	eax, 3
	push	esi
	jbe	SHORT $LN3@insertComm

; 404  : 	{
; 405  : 		memmove(&str[strlen(str)-3], &str[strlen(str)-4], 4);

	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	lea	edx, DWORD PTR [eax+1]
	npad	7
$LL7@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL7@insertComm
	sub	eax, edx
	mov	edx, eax
	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	lea	esi, DWORD PTR [eax+1]
$LL8@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL8@insertComm
	lea	ecx, DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA[edx-4]
	sub	eax, esi
	push	4
	push	ecx
	lea	edx, DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA[eax-3]
	push	edx
	call	_memmove

; 406  : 		str[strlen(str) - 4] = ',';

	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	add	esp, 12					; 0000000cH
	lea	edx, DWORD PTR [eax+1]
$LL9@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL9@insertComm
	sub	eax, edx
	mov	BYTE PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA[eax-4], 44 ; 0000002cH
$LN3@insertComm:

; 407  : 	}
; 408  : 	if (strlen(str) > 7)

	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	lea	edx, DWORD PTR [eax+1]
	npad	6
$LL10@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL10@insertComm
	sub	eax, edx
	cmp	eax, 7
	jbe	SHORT $LN2@insertComm

; 409  : 	{
; 410  : 		memmove(&str[strlen(str)-7], &str[strlen(str)-8], 8);

	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	lea	edx, DWORD PTR [eax+1]
$LL11@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL11@insertComm
	sub	eax, edx
	mov	edx, eax
	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	lea	esi, DWORD PTR [eax+1]
	npad	3
$LL12@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL12@insertComm
	lea	ecx, DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA[edx-8]
	sub	eax, esi
	push	8
	push	ecx
	lea	edx, DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA[eax-7]
	push	edx
	call	_memmove

; 411  : 		str[strlen(str) - 8] = ',';

	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	add	esp, 12					; 0000000cH
	lea	edx, DWORD PTR [eax+1]
	npad	5
$LL13@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL13@insertComm
	sub	eax, edx
	mov	BYTE PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA[eax-8], 44 ; 0000002cH
$LN2@insertComm:

; 412  : 	}
; 413  : 	if (strlen(str) > 11)

	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	lea	edx, DWORD PTR [eax+1]
	npad	6
$LL14@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL14@insertComm
	sub	eax, edx
	cmp	eax, 11					; 0000000bH

; 414  : 	{
; 415  : 		memmove(&str[strlen(str)-11], &str[strlen(str)-12], 12);

	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	jbe	SHORT $LN1@insertComm
	lea	edx, DWORD PTR [eax+1]
$LL15@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL15@insertComm
	sub	eax, edx
	mov	edx, eax
	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	lea	esi, DWORD PTR [eax+1]
	npad	3
$LL16@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL16@insertComm
	lea	ecx, DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA[edx-12]
	sub	eax, esi
	push	12					; 0000000cH
	push	ecx
	lea	edx, DWORD PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA[eax-11]
	push	edx
	call	_memmove

; 416  : 		str[strlen(str) - 12] = ',';

	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
	add	esp, 12					; 0000000cH
	lea	edx, DWORD PTR [eax+1]
	npad	5
$LL17@insertComm:
	mov	cl, BYTE PTR [eax]
	add	eax, 1
	test	cl, cl
	jne	SHORT $LL17@insertComm
	sub	eax, edx
	mov	BYTE PTR ?str@?1??insertCommas@@YAPBDI@Z@4PADA[eax-12], 44 ; 0000002cH

; 417  : 	}
; 418  : 
; 419  : 	return str;

	mov	eax, OFFSET ?str@?1??insertCommas@@YAPBDI@Z@4PADA
$LN1@insertComm:
	pop	esi

; 420  : }

	ret	0
?insertCommas@@YAPBDI@Z ENDP				; insertCommas
_TEXT	ENDS
PUBLIC	??_C@_0BA@JOBBHHKL@?$CF10s?5bytes?5?5?5?5?5?$AA@ ; `string'
PUBLIC	??_C@_0O@KECAKIOB@?$CF10s?5?$CI?$CF7?42fK?$CJ?$AA@ ; `string'
PUBLIC	__real@3a800000
PUBLIC	??_C@_0O@KAKNNEFD@?$CF10s?5?$CI?$CF7?42fM?$CJ?$AA@ ; `string'
PUBLIC	__real@35800000
PUBLIC	__real@4f800000
EXTRN	__fltused:DWORD
;	COMDAT ?str@?1??memorySizeString@@YAPBDK@Z@4PADA
_BSS	SEGMENT
?str@?1??memorySizeString@@YAPBDK@Z@4PADA DB 05aH DUP (?) ; `memorySizeString'::`2'::str
_BSS	ENDS
;	COMDAT ??_C@_0BA@JOBBHHKL@?$CF10s?5bytes?5?5?5?5?5?$AA@
CONST	SEGMENT
??_C@_0BA@JOBBHHKL@?$CF10s?5bytes?5?5?5?5?5?$AA@ DB '%10s bytes     ', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0O@KECAKIOB@?$CF10s?5?$CI?$CF7?42fK?$CJ?$AA@
CONST	SEGMENT
??_C@_0O@KECAKIOB@?$CF10s?5?$CI?$CF7?42fK?$CJ?$AA@ DB '%10s (%7.2fK)', 00H ; `string'
CONST	ENDS
;	COMDAT __real@3a800000
CONST	SEGMENT
__real@3a800000 DD 03a800000r			; 0.000976563
CONST	ENDS
;	COMDAT ??_C@_0O@KAKNNEFD@?$CF10s?5?$CI?$CF7?42fM?$CJ?$AA@
CONST	SEGMENT
??_C@_0O@KAKNNEFD@?$CF10s?5?$CI?$CF7?42fM?$CJ?$AA@ DB '%10s (%7.2fM)', 00H ; `string'
CONST	ENDS
;	COMDAT __real@35800000
CONST	SEGMENT
__real@35800000 DD 035800000r			; 9.53674e-007
CONST	ENDS
;	COMDAT __real@4f800000
CONST	SEGMENT
__real@4f800000 DD 04f800000r			; 4.29497e+009
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ?memorySizeString@@YAPBDK@Z
_TEXT	SEGMENT
tv132 = -4						; size = 4
tv77 = -4						; size = 4
?memorySizeString@@YAPBDK@Z PROC			; memorySizeString, COMDAT
; _size$ = eax

; 425  : {

	push	ecx

; 426  : 	static	char	str[90];
; 427  : 	     if (size > (1024*1024))	sprintf(str, "%10s (%7.2fM)", insertCommas(size), static_cast<float>(size) / (1024.0f * 1024.0f));

	cmp	eax, 1048576				; 00100000H
	jbe	SHORT $LN4@memorySize
	mov	ecx, eax
	test	ecx, ecx
	mov	DWORD PTR tv132[esp+4], ecx
	fild	DWORD PTR tv132[esp+4]
	jge	SHORT $LN7@memorySize
	fadd	DWORD PTR __real@4f800000
$LN7@memorySize:
	fmul	DWORD PTR __real@35800000
	sub	esp, 8
	fstp	QWORD PTR [esp]
	push	eax
	call	?insertCommas@@YAPBDI@Z			; insertCommas
	add	esp, 4
	push	eax
	push	OFFSET ??_C@_0O@KAKNNEFD@?$CF10s?5?$CI?$CF7?42fM?$CJ?$AA@
	push	OFFSET ?str@?1??memorySizeString@@YAPBDK@Z@4PADA
	call	_sprintf
	add	esp, 20					; 00000014H

; 430  : 	return str;

	mov	eax, OFFSET ?str@?1??memorySizeString@@YAPBDK@Z@4PADA

; 431  : }

	pop	ecx
	ret	0
$LN4@memorySize:

; 428  : 	else if (size > 1024)		sprintf(str, "%10s (%7.2fK)", insertCommas(size), static_cast<float>(size) / 1024.0f);

	cmp	eax, 1024				; 00000400H
	jbe	SHORT $LN2@memorySize
	mov	edx, eax
	test	edx, edx
	mov	DWORD PTR tv77[esp+4], edx
	fild	DWORD PTR tv77[esp+4]
	jge	SHORT $LN8@memorySize
	fadd	DWORD PTR __real@4f800000
$LN8@memorySize:
	fmul	DWORD PTR __real@3a800000
	sub	esp, 8
	fstp	QWORD PTR [esp]
	push	eax
	call	?insertCommas@@YAPBDI@Z			; insertCommas
	add	esp, 4
	push	eax
	push	OFFSET ??_C@_0O@KECAKIOB@?$CF10s?5?$CI?$CF7?42fK?$CJ?$AA@
	push	OFFSET ?str@?1??memorySizeString@@YAPBDK@Z@4PADA
	call	_sprintf
	add	esp, 20					; 00000014H

; 430  : 	return str;

	mov	eax, OFFSET ?str@?1??memorySizeString@@YAPBDK@Z@4PADA

; 431  : }

	pop	ecx
	ret	0
$LN2@memorySize:

; 429  : 	else				sprintf(str, "%10s bytes     ", insertCommas(size));

	push	eax
	call	?insertCommas@@YAPBDI@Z			; insertCommas
	push	eax
	push	OFFSET ??_C@_0BA@JOBBHHKL@?$CF10s?5bytes?5?5?5?5?5?$AA@
	push	OFFSET ?str@?1??memorySizeString@@YAPBDK@Z@4PADA
	call	_sprintf
	add	esp, 16					; 00000010H

; 430  : 	return str;

	mov	eax, OFFSET ?str@?1??memorySizeString@@YAPBDK@Z@4PADA

; 431  : }

	pop	ecx
	ret	0
?memorySizeString@@YAPBDK@Z ENDP			; memorySizeString
_TEXT	ENDS
_BSS	SEGMENT
	ALIGN	4

_hashTable DD	01000H DUP (?)
; Function compile flags: /Ogtpy
_BSS	ENDS
;	COMDAT ?findAllocUnit@@YAPAUtag_au@@PBX@Z
_TEXT	SEGMENT
?findAllocUnit@@YAPAUtag_au@@PBX@Z PROC			; findAllocUnit, COMDAT
; _reportedAddress$ = ecx

; 437  : 	// Just in case...
; 438  : 	m_assert(reportedAddress != NULL);
; 439  : 
; 440  : 	// Use the address to locate the hash index. Note that we shift off the lower four bits. This is because most allocated
; 441  : 	// addresses will be on four-, eight- or even sixteen-byte boundaries. If we didn't do this, the hash index would not have
; 442  : 	// very good coverage.
; 443  : 
; 444  : 	unsigned int	hashIndex = (reinterpret_cast<unsigned int>(const_cast<void *>(reportedAddress)) >> 4) & (hashSize - 1);
; 445  : 	sAllocUnit	*ptr = hashTable[hashIndex];

	mov	eax, ecx
	shr	eax, 4
	and	eax, 4095				; 00000fffH
	mov	eax, DWORD PTR _hashTable[eax*4]

; 446  : 	while(ptr)

	test	eax, eax
	je	SHORT $LN2@findAllocU
$LL3@findAllocU:

; 447  : 	{
; 448  : 		if (ptr->reportedAddress == reportedAddress) return ptr;

	cmp	DWORD PTR [eax+12], ecx
	je	SHORT $LN4@findAllocU

; 449  : 		ptr = ptr->next;

	mov	eax, DWORD PTR [eax+116]
	test	eax, eax
	jne	SHORT $LL3@findAllocU
$LN2@findAllocU:

; 450  : 	}
; 451  : 
; 452  : 	return NULL;

	xor	eax, eax
$LN4@findAllocU:

; 453  : }

	ret	0
?findAllocUnit@@YAPAUtag_au@@PBX@Z ENDP			; findAllocUnit
; Function compile flags: /Ogtpy
_TEXT	ENDS
;	COMDAT ?calculateActualSize@@YAII@Z
_TEXT	SEGMENT
?calculateActualSize@@YAII@Z PROC			; calculateActualSize, COMDAT
; _reportedSize$ = eax

; 459  : 	// We use DWORDS as our padding, and a long is guaranteed to be 4 bytes, but an int is not (ANSI defines an int as
; 460  : 	// being the standard word size for a processor; on a 32-bit machine, that's 4 bytes, but on a 64-bit machine, it's
; 461  : 	// 8 bytes, which means an int can actually be larger than a long.)
; 462  : 
; 463  : 	return reportedSize + paddingSize * sizeof(long) * 2;

	add	eax, 32					; 00000020H

; 464  : }

	ret	0
?calculateActualSize@@YAII@Z ENDP			; calculateActualSize
; Function compile flags: /Ogtpy
_TEXT	ENDS
;	COMDAT ?calculateReportedSize@@YAII@Z
_TEXT	SEGMENT
?calculateReportedSize@@YAII@Z PROC			; calculateReportedSize, COMDAT
; _actualSize$ = eax

; 470  : 	// We use DWORDS as our padding, and a long is guaranteed to be 4 bytes, but an int is not (ANSI defines an int as
; 471  : 	// being the standard word size for a processor; on a 32-bit machine, that's 4 bytes, but on a 64-bit machine, it's
; 472  : 	// 8 bytes, which means an int can actually be larger than a long.)
; 473  : 
; 474  : 	return actualSize - paddingSize * sizeof(long) * 2;

	add	eax, -32				; ffffffe0H

; 475  : }

	ret	0
?calculateReportedSize@@YAII@Z ENDP			; calculateReportedSize
; Function compile flags: /Ogtpy
_TEXT	ENDS
;	COMDAT ?calculateReportedAddress@@YAPAXPBX@Z
_TEXT	SEGMENT
?calculateReportedAddress@@YAPAXPBX@Z PROC		; calculateReportedAddress, COMDAT
; _actualAddress$ = eax

; 481  : 	// We allow this...
; 482  : 
; 483  : 	if (!actualAddress) return NULL;

	test	eax, eax
	jne	SHORT $LN1@calculateR

; 488  : }

	ret	0
$LN1@calculateR:

; 484  : 
; 485  : 	// JUst account for the padding
; 486  : 
; 487  : 	return reinterpret_cast<void *>(const_cast<char *>(reinterpret_cast<const char *>(actualAddress) + sizeof(long) * paddingSize));

	add	eax, 16					; 00000010H

; 488  : }

	ret	0
?calculateReportedAddress@@YAPAXPBX@Z ENDP		; calculateReportedAddress
_TEXT	ENDS
EXTRN	_rand:PROC
; Function compile flags: /Ogtpy
;	COMDAT ?wipeWithPattern@@YAXPAUtag_au@@KI@Z
_TEXT	SEGMENT
_allocUnit$ = 8						; size = 4
?wipeWithPattern@@YAXPAUtag_au@@KI@Z PROC		; wipeWithPattern, COMDAT
; _pattern$ = eax
; _originalReportedSize$ = ecx

; 494  : 	// For a serious test run, we use wipes of random a random value. However, if this causes a crash, we don't want it to
; 495  : 	// crash in a differnt place each time, so we specifically DO NOT call srand. If, by chance your program calls srand(),
; 496  : 	// you may wish to disable that when running with a random wipe test. This will make any crashes more consistent so they
; 497  : 	// can be tracked down easier.
; 498  : 
; 499  : 	if (randomWipe)

	cmp	BYTE PTR _randomWipe, 0
	push	ebx
	push	ebp
	push	esi
	push	edi
	mov	ebx, ecx
	je	SHORT $LN11@wipeWithPa

; 500  : 	{
; 501  : 		pattern = ((rand() & 0xff) << 24) | ((rand() & 0xff) << 16) | ((rand() & 0xff) << 8) | (rand() & 0xff);

	call	_rand
	mov	edi, eax
	and	edi, 255				; 000000ffH
	call	_rand
	mov	esi, eax
	shl	esi, 8
	or	esi, edi
	shl	esi, 8
	call	_rand
	mov	edi, eax
	and	edi, 255				; 000000ffH
	or	edi, esi
	shl	edi, 8
	call	_rand
	and	eax, 255				; 000000ffH
	or	eax, edi
$LN11@wipeWithPa:

; 502  : 	}
; 503  : 
; 504  : 	// -DOC- We should wipe with 0's if we're not in debug mode, so we can help hide bugs if possible when we release the
; 505  : 	// product. So uncomment the following line for releases.
; 506  : 	//
; 507  : 	// Note that the "alwaysWipeAll" should be turned on for this to have effect, otherwise it won't do much good. But we'll
; 508  : 	// leave it this way (as an option) because this does slow things down.
; 509  : //	pattern = 0;
; 510  : 
; 511  : 	// This part of the operation is optional
; 512  : 
; 513  : 	if (alwaysWipeAll && allocUnit->reportedSize > originalReportedSize)

	cmp	BYTE PTR _alwaysWipeAll, 0
	je	SHORT $LN25@wipeWithPa
	mov	edx, DWORD PTR _allocUnit$[esp+12]
	mov	ecx, DWORD PTR [edx+4]
	cmp	ecx, ebx
	jbe	SHORT $LN4@wipeWithPa

; 514  : 	{
; 515  : 		// Fill the bulk
; 516  : 
; 517  : 		long	*lptr = reinterpret_cast<long *>(reinterpret_cast<char *>(allocUnit->reportedAddress) + originalReportedSize);

	mov	ebp, DWORD PTR [edx+12]

; 518  : 		int	length = static_cast<int>(allocUnit->reportedSize - originalReportedSize);

	sub	ecx, ebx
	add	ebp, ebx
	mov	ebx, ecx

; 519  : 		int	i;
; 520  : 		for (i = 0; i < (length >> 2); i++, lptr++)

	mov	edx, ebx
	sar	edx, 2
	test	edx, edx
	jle	SHORT $LN9@wipeWithPa
	mov	edi, ebp
	mov	ecx, edx
	rep stosd
	lea	ebp, DWORD PTR [ebp+edx*4]
$LN9@wipeWithPa:

; 521  : 		{
; 522  : 			*lptr = pattern;
; 523  : 		}
; 524  : 
; 525  : 		// Fill the remainder
; 526  : 
; 527  : 		unsigned int	shiftCount = 0;

	xor	esi, esi

; 528  : 		char		*cptr = reinterpret_cast<char *>(lptr);
; 529  : 		for (i = 0; i < (length & 0x3); i++, cptr++, shiftCount += 8)

	xor	edx, edx
	and	ebx, 3
	mov	edi, ebx
	jle	SHORT $LN25@wipeWithPa
$LL24@wipeWithPa:

; 530  : 		{
; 531  : 			*cptr = static_cast<char>((pattern & (0xff << shiftCount)) >> shiftCount);

	mov	ecx, esi
	mov	ebx, 255				; 000000ffH
	shl	ebx, cl
	add	edx, 1
	add	esi, 8
	and	ebx, eax
	shr	ebx, cl
	cmp	edx, edi
	mov	BYTE PTR [edx+ebp-1], bl
	jl	SHORT $LL24@wipeWithPa
$LN25@wipeWithPa:

; 528  : 		char		*cptr = reinterpret_cast<char *>(lptr);
; 529  : 		for (i = 0; i < (length & 0x3); i++, cptr++, shiftCount += 8)

	mov	edx, DWORD PTR _allocUnit$[esp+12]
$LN4@wipeWithPa:

; 532  : 		}
; 533  : 	}
; 534  : 
; 535  : 	// Write in the prefix/postfix bytes
; 536  : 
; 537  : 	long		*pre = reinterpret_cast<long *>(allocUnit->actualAddress);

	mov	eax, DWORD PTR [edx+8]

; 538  : 	long		*post = reinterpret_cast<long *>(reinterpret_cast<char *>(allocUnit->actualAddress) + allocUnit->actualSize - paddingSize * sizeof(long));

	mov	ecx, DWORD PTR [edx]

; 539  : 	for (unsigned int i = 0; i < paddingSize; i++, pre++, post++)
; 540  : 	{
; 541  : 		*pre = prefixPattern;

	mov	edx, DWORD PTR _prefixPattern

; 542  : 		*post = postfixPattern;

	mov	esi, DWORD PTR _postfixPattern
	lea	ecx, DWORD PTR [ecx+eax-16]
	mov	DWORD PTR [eax], edx
	mov	DWORD PTR [ecx], esi
	mov	DWORD PTR [eax+4], edx
	mov	DWORD PTR [ecx+4], esi
	mov	DWORD PTR [eax+8], edx
	mov	DWORD PTR [ecx+8], esi
	pop	edi
	mov	DWORD PTR [eax+12], edx
	mov	DWORD PTR [ecx+12], esi
	pop	esi
	pop	ebp
	pop	ebx

; 543  : 	}
; 544  : }

	ret	0
?wipeWithPattern@@YAXPAUtag_au@@KI@Z ENDP		; wipeWithPattern
_TEXT	ENDS
PUBLIC	??0MemStaticTimeTracker@@QAE@XZ			; MemStaticTimeTracker::MemStaticTimeTracker
; Function compile flags: /Ogtpy
;	COMDAT ??0MemStaticTimeTracker@@QAE@XZ
_TEXT	SEGMENT
??0MemStaticTimeTracker@@QAE@XZ PROC			; MemStaticTimeTracker::MemStaticTimeTracker, COMDAT
; _this$ = ecx

; 643  : 	MemStaticTimeTracker() {doCleanupLogOnFirstRun();}

	push	esi
	mov	esi, ecx
	call	?doCleanupLogOnFirstRun@@YAXXZ		; doCleanupLogOnFirstRun
	mov	eax, esi
	pop	esi
	ret	0
??0MemStaticTimeTracker@@QAE@XZ ENDP			; MemStaticTimeTracker::MemStaticTimeTracker
_TEXT	ENDS
PUBLIC	?m_alwaysValidateAll@@YAAA_NXZ			; m_alwaysValidateAll
; Function compile flags: /Ogtpy
;	COMDAT ?m_alwaysValidateAll@@YAAA_NXZ
_TEXT	SEGMENT
?m_alwaysValidateAll@@YAAA_NXZ PROC			; m_alwaysValidateAll, COMDAT

; 654  : 	// Force a validation of all allocation units each time we enter this software
; 655  : 	return alwaysValidateAll;

	mov	eax, OFFSET _alwaysValidateAll

; 656  : }

	ret	0
?m_alwaysValidateAll@@YAAA_NXZ ENDP			; m_alwaysValidateAll
_TEXT	ENDS
PUBLIC	?m_alwaysLogAll@@YAAA_NXZ			; m_alwaysLogAll
; Function compile flags: /Ogtpy
;	COMDAT ?m_alwaysLogAll@@YAAA_NXZ
_TEXT	SEGMENT
?m_alwaysLogAll@@YAAA_NXZ PROC				; m_alwaysLogAll, COMDAT

; 662  : 	// Force a log of every allocation & deallocation into memory.log
; 663  : 	return alwaysLogAll;

	mov	eax, OFFSET _alwaysLogAll

; 664  : }

	ret	0
?m_alwaysLogAll@@YAAA_NXZ ENDP				; m_alwaysLogAll
_TEXT	ENDS
PUBLIC	?m_alwaysWipeAll@@YAAA_NXZ			; m_alwaysWipeAll
; Function compile flags: /Ogtpy
;	COMDAT ?m_alwaysWipeAll@@YAAA_NXZ
_TEXT	SEGMENT
?m_alwaysWipeAll@@YAAA_NXZ PROC				; m_alwaysWipeAll, COMDAT

; 670  : 	// Force this software to always wipe memory with a pattern when it is being allocated/dallocated
; 671  : 	return alwaysWipeAll;

	mov	eax, OFFSET _alwaysWipeAll

; 672  : }

	ret	0
?m_alwaysWipeAll@@YAAA_NXZ ENDP				; m_alwaysWipeAll
_TEXT	ENDS
PUBLIC	?m_randomeWipe@@YAAA_NXZ			; m_randomeWipe
; Function compile flags: /Ogtpy
;	COMDAT ?m_randomeWipe@@YAAA_NXZ
_TEXT	SEGMENT
?m_randomeWipe@@YAAA_NXZ PROC				; m_randomeWipe, COMDAT

; 678  : 	// Force this software to use a random pattern when wiping memory -- good for stress testing
; 679  : 	return randomWipe;

	mov	eax, OFFSET _randomWipe

; 680  : }

	ret	0
?m_randomeWipe@@YAAA_NXZ ENDP				; m_randomeWipe
_TEXT	ENDS
PUBLIC	?m_breakOnRealloc@@YAAA_NPAX@Z			; m_breakOnRealloc
; Function compile flags: /Ogtpy
;	COMDAT ?m_breakOnRealloc@@YAAA_NPAX@Z
_TEXT	SEGMENT
_reportedAddress$ = 8					; size = 4
?m_breakOnRealloc@@YAAA_NPAX@Z PROC			; m_breakOnRealloc, COMDAT

; 689  : 	// Locate the existing allocation unit
; 690  : 
; 691  : 	sAllocUnit	*au = findAllocUnit(reportedAddress);

	mov	ecx, DWORD PTR _reportedAddress$[esp-4]
	mov	eax, ecx
	shr	eax, 4
	and	eax, 4095				; 00000fffH
	mov	eax, DWORD PTR _hashTable[eax*4]
	test	eax, eax
	je	SHORT $LN4@m_breakOnR
	npad	7
$LL5@m_breakOnR:
	cmp	DWORD PTR [eax+12], ecx
	je	SHORT $LN9@m_breakOnR
	mov	eax, DWORD PTR [eax+116]
	test	eax, eax
	jne	SHORT $LL5@m_breakOnR
$LN4@m_breakOnR:
	xor	eax, eax
$LN9@m_breakOnR:

; 692  : 
; 693  : 	// If you hit this assert, you tried to set a breakpoint on reallocation for an address that doesn't exist. Interrogate the
; 694  : 	// stack frame or the variable 'au' to see which allocation this is.
; 695  : 	m_assert(au != NULL);
; 696  : 
; 697  : 	// If you hit this assert, you tried to set a breakpoint on reallocation for an address that wasn't allocated in a way that
; 698  : 	// is compatible with reallocation.
; 699  : 	m_assert(au->allocationType == m_alloc_malloc ||
; 700  : 		 au->allocationType == m_alloc_calloc ||
; 701  : 		 au->allocationType == m_alloc_realloc);
; 702  : 
; 703  : 	return au->breakOnRealloc;

	add	eax, 105				; 00000069H

; 704  : }

	ret	0
?m_breakOnRealloc@@YAAA_NPAX@Z ENDP			; m_breakOnRealloc
_TEXT	ENDS
PUBLIC	?m_breakOnDealloc@@YAAA_NPAX@Z			; m_breakOnDealloc
; Function compile flags: /Ogtpy
;	COMDAT ?m_breakOnDealloc@@YAAA_NPAX@Z
_TEXT	SEGMENT
_reportedAddress$ = 8					; size = 4
?m_breakOnDealloc@@YAAA_NPAX@Z PROC			; m_breakOnDealloc, COMDAT

; 713  : 	// Locate the existing allocation unit
; 714  : 
; 715  : 	sAllocUnit	*au = findAllocUnit(reportedAddress);

	mov	ecx, DWORD PTR _reportedAddress$[esp-4]
	mov	eax, ecx
	shr	eax, 4
	and	eax, 4095				; 00000fffH
	mov	eax, DWORD PTR _hashTable[eax*4]
	test	eax, eax
	je	SHORT $LN4@m_breakOnD
	npad	7
$LL5@m_breakOnD:
	cmp	DWORD PTR [eax+12], ecx
	je	SHORT $LN9@m_breakOnD
	mov	eax, DWORD PTR [eax+116]
	test	eax, eax
	jne	SHORT $LL5@m_breakOnD
$LN4@m_breakOnD:
	xor	eax, eax
$LN9@m_breakOnD:

; 716  : 
; 717  : 	// If you hit this assert, you tried to set a breakpoint on deallocation for an address that doesn't exist. Interrogate the
; 718  : 	// stack frame or the variable 'au' to see which allocation this is.
; 719  : 	m_assert(au != NULL);
; 720  : 
; 721  : 	return au->breakOnDealloc;

	add	eax, 104				; 00000068H

; 722  : }

	ret	0
?m_breakOnDealloc@@YAAA_NPAX@Z ENDP			; m_breakOnDealloc
_TEXT	ENDS
PUBLIC	?m_breakOnAllocation@@YAXI@Z			; m_breakOnAllocation
; Function compile flags: /Ogtpy
;	COMDAT ?m_breakOnAllocation@@YAXI@Z
_TEXT	SEGMENT
_count$ = 8						; size = 4
?m_breakOnAllocation@@YAXI@Z PROC			; m_breakOnAllocation, COMDAT

; 730  : 	breakOnAllocationCount = count;

	mov	eax, DWORD PTR _count$[esp-4]
	mov	DWORD PTR _breakOnAllocationCount, eax

; 731  : }

	ret	0
?m_breakOnAllocation@@YAXI@Z ENDP			; m_breakOnAllocation
; Function compile flags: /Ogtpy
_TEXT	ENDS
;	COMDAT ?resetGlobals@@YAXXZ
_TEXT	SEGMENT
?resetGlobals@@YAXXZ PROC				; resetGlobals, COMDAT

; 797  : 	sourceFile = "??";

	mov	eax, OFFSET ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	mov	DWORD PTR _sourceFile, eax

; 798  : 	sourceLine = 0;

	mov	DWORD PTR _sourceLine, 0

; 799  : 	sourceFunc = "??";

	mov	DWORD PTR _sourceFunc, eax

; 800  : }

	ret	0
?resetGlobals@@YAXXZ ENDP				; resetGlobals
_TEXT	ENDS
PUBLIC	?m_validateAddress@@YA_NPBX@Z			; m_validateAddress
; Function compile flags: /Ogtpy
;	COMDAT ?m_validateAddress@@YA_NPBX@Z
_TEXT	SEGMENT
_reportedAddress$ = 8					; size = 4
?m_validateAddress@@YA_NPBX@Z PROC			; m_validateAddress, COMDAT

; 1624 : 	// Just see if the address exists in our allocation routines
; 1625 : 
; 1626 : 	return findAllocUnit(reportedAddress) != NULL;

	mov	ecx, DWORD PTR _reportedAddress$[esp-4]
	mov	eax, ecx
	shr	eax, 4
	and	eax, 4095				; 00000fffH
	mov	eax, DWORD PTR _hashTable[eax*4]
	test	eax, eax
	je	SHORT $LN4@m_validate
	npad	7
$LL5@m_validate:
	cmp	DWORD PTR [eax+12], ecx
	je	SHORT $LN6@m_validate
	mov	eax, DWORD PTR [eax+116]
	test	eax, eax
	jne	SHORT $LL5@m_validate
$LN4@m_validate:
	xor	eax, eax
$LN6@m_validate:
	xor	ecx, ecx
	test	eax, eax
	setne	cl
	mov	al, cl

; 1627 : }

	ret	0
?m_validateAddress@@YA_NPBX@Z ENDP			; m_validateAddress
_TEXT	ENDS
PUBLIC	?m_calcUnused@@YAIPBUtag_au@@@Z			; m_calcUnused
; Function compile flags: /Ogtpy
;	COMDAT ?m_calcUnused@@YAIPBUtag_au@@@Z
_TEXT	SEGMENT
_allocUnit$ = 8						; size = 4
?m_calcUnused@@YAIPBUtag_au@@@Z PROC			; m_calcUnused, COMDAT

; 1723 : 	const unsigned long	*ptr = reinterpret_cast<const unsigned long *>(allocUnit->reportedAddress);

	mov	ecx, DWORD PTR _allocUnit$[esp-4]
	mov	edx, DWORD PTR [ecx+12]
	mov	ecx, DWORD PTR [ecx+4]

; 1724 : 	unsigned int		count = 0;

	xor	eax, eax

; 1725 : 
; 1726 : 	for (unsigned int i = 0; i < allocUnit->reportedSize; i += sizeof(long), ptr++)

	test	ecx, ecx
	jbe	SHORT $LN2@m_calcUnus
	add	ecx, -1
	shr	ecx, 2
	push	esi
	mov	esi, DWORD PTR _unusedPattern
	add	ecx, 1
$LL4@m_calcUnus:

; 1727 : 	{
; 1728 : 		if (*ptr == unusedPattern) count += sizeof(long);

	cmp	DWORD PTR [edx], esi
	jne	SHORT $LN3@m_calcUnus
	add	eax, 4
$LN3@m_calcUnus:

; 1725 : 
; 1726 : 	for (unsigned int i = 0; i < allocUnit->reportedSize; i += sizeof(long), ptr++)

	add	edx, 4
	sub	ecx, 1
	jne	SHORT $LL4@m_calcUnus
	pop	esi
$LN2@m_calcUnus:

; 1729 : 	}
; 1730 : 
; 1731 : 	return count;
; 1732 : }

	ret	0
?m_calcUnused@@YAIPBUtag_au@@@Z ENDP			; m_calcUnused
_TEXT	ENDS
PUBLIC	?m_calcAllUnused@@YAIXZ				; m_calcAllUnused
; Function compile flags: /Ogtpy
;	COMDAT ?m_calcAllUnused@@YAIXZ
_TEXT	SEGMENT
?m_calcAllUnused@@YAIXZ PROC				; m_calcAllUnused, COMDAT

; 1737 : {

	push	ebx
	push	ebp

; 1738 : 	// Just go through each allocation unit in the hash table and count the unused RAM
; 1739 : 
; 1740 : 	unsigned int	total = 0;
; 1741 : 	for (unsigned int i = 0; i < hashSize; i++)

	mov	ebp, DWORD PTR _unusedPattern
	push	esi
	xor	eax, eax
	push	edi
	xor	ebx, ebx
	npad	2
$LL22@m_calcAllU:

; 1742 : 	{
; 1743 : 		sAllocUnit	*ptr = hashTable[i];

	mov	edx, DWORD PTR _hashTable[ebx]

; 1744 : 		while(ptr)

	test	edx, edx
	je	SHORT $LN4@m_calcAllU
	npad	6
$LL2@m_calcAllU:
	mov	ecx, DWORD PTR [edx+4]

; 1745 : 		{
; 1746 : 			total += m_calcUnused(ptr);

	mov	esi, DWORD PTR [edx+12]
	xor	edi, edi
	test	ecx, ecx
	jbe	SHORT $LN9@m_calcAllU
	add	ecx, -1
	shr	ecx, 2
	add	ecx, 1
$LL11@m_calcAllU:
	cmp	DWORD PTR [esi], ebp
	jne	SHORT $LN10@m_calcAllU
	add	edi, 4
$LN10@m_calcAllU:
	add	esi, 4
	sub	ecx, 1
	jne	SHORT $LL11@m_calcAllU
$LN9@m_calcAllU:

; 1747 : 			ptr = ptr->next;

	mov	edx, DWORD PTR [edx+116]
	add	eax, edi
	test	edx, edx
	jne	SHORT $LL2@m_calcAllU
$LN4@m_calcAllU:

; 1738 : 	// Just go through each allocation unit in the hash table and count the unused RAM
; 1739 : 
; 1740 : 	unsigned int	total = 0;
; 1741 : 	for (unsigned int i = 0; i < hashSize; i++)

	add	ebx, 4
	cmp	ebx, 16384				; 00004000H
	jb	SHORT $LL22@m_calcAllU
	pop	edi
	pop	esi
	pop	ebp
	pop	ebx

; 1748 : 		}
; 1749 : 	}
; 1750 : 
; 1751 : 	return total;
; 1752 : }

	ret	0
?m_calcAllUnused@@YAIXZ ENDP				; m_calcAllUnused
_TEXT	ENDS
PUBLIC	?m_getMemoryStatistics@@YA?AUsMStats@@XZ	; m_getMemoryStatistics
_BSS	SEGMENT
_stats	DB	024H DUP (?)
; Function compile flags: /Ogtpy
_BSS	ENDS
;	COMDAT ?m_getMemoryStatistics@@YA?AUsMStats@@XZ
_TEXT	SEGMENT
$T41332 = 8						; size = 4
?m_getMemoryStatistics@@YA?AUsMStats@@XZ PROC		; m_getMemoryStatistics, COMDAT

; 1845 : 	return stats;

	mov	eax, DWORD PTR $T41332[esp-4]
	push	esi
	push	edi
	mov	ecx, 9
	mov	esi, OFFSET _stats
	mov	edi, eax
	rep movsd
	pop	edi
	pop	esi

; 1846 : }

	ret	0
?m_getMemoryStatistics@@YA?AUsMStats@@XZ ENDP		; m_getMemoryStatistics
_TEXT	ENDS
PUBLIC	__TI2?AVbad_alloc@std@@
PUBLIC	??_C@_0DN@JHKGIIJF@C?3?2Program?5Files?2Microsoft?5Visua@ ; `string'
PUBLIC	?allocate@?$_DebugHeapAllocator@D@std@@QAAPADIPBX@Z ; std::_DebugHeapAllocator<char>::allocate
PUBLIC	__CTA2?AVbad_alloc@std@@
PUBLIC	__CT??_R0?AVbad_alloc@std@@@8??0bad_alloc@std@@QAE@ABV01@@Z12
PUBLIC	??0bad_alloc@std@@QAE@ABV01@@Z			; std::bad_alloc::bad_alloc
PUBLIC	__CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12
EXTRN	??_U@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z:PROC	; operator new[]
EXTRN	?_DebugHeapTag_func@std@@YAABU_DebugHeapTag_t@1@XZ:PROC ; std::_DebugHeapTag_func
EXTRN	__CxxThrowException@8:PROC
EXTRN	??0exception@std@@QAE@ABV01@@Z:PROC		; std::exception::exception
;	COMDAT __CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12
; File c:\program files\microsoft visual studio 8\vc\include\exception
xdata$x	SEGMENT
__CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 DD 00H
	DD	FLAT:??_R0?AVexception@std@@@8
	DD	00H
	DD	0ffffffffH
	ORG $+4
	DD	0cH
	DD	FLAT:??0exception@std@@QAE@ABV01@@Z
xdata$x	ENDS
;	COMDAT __CT??_R0?AVbad_alloc@std@@@8??0bad_alloc@std@@QAE@ABV01@@Z12
xdata$x	SEGMENT
__CT??_R0?AVbad_alloc@std@@@8??0bad_alloc@std@@QAE@ABV01@@Z12 DD 00H
	DD	FLAT:??_R0?AVbad_alloc@std@@@8
	DD	00H
	DD	0ffffffffH
	ORG $+4
	DD	0cH
	DD	FLAT:??0bad_alloc@std@@QAE@ABV01@@Z
xdata$x	ENDS
;	COMDAT __CTA2?AVbad_alloc@std@@
xdata$x	SEGMENT
__CTA2?AVbad_alloc@std@@ DD 02H
	DD	FLAT:__CT??_R0?AVbad_alloc@std@@@8??0bad_alloc@std@@QAE@ABV01@@Z12
	DD	FLAT:__CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12
xdata$x	ENDS
;	COMDAT __TI2?AVbad_alloc@std@@
xdata$x	SEGMENT
__TI2?AVbad_alloc@std@@ DD 00H
	DD	FLAT:??1bad_alloc@std@@UAE@XZ
	DD	00H
	DD	FLAT:__CTA2?AVbad_alloc@std@@
xdata$x	ENDS
;	COMDAT ??_C@_0DN@JHKGIIJF@C?3?2Program?5Files?2Microsoft?5Visua@
CONST	SEGMENT
??_C@_0DN@JHKGIIJF@C?3?2Program?5Files?2Microsoft?5Visua@ DB 'C:\Program '
	DB	'Files\Microsoft Visual Studio 8\VC\include\xdebug', 00H ; `string'
; Function compile flags: /Ogtpy
; File c:\program files\microsoft visual studio 8\vc\include\xdebug
CONST	ENDS
;	COMDAT ?allocate@?$_DebugHeapAllocator@D@std@@QAAPADIPBX@Z
_TEXT	SEGMENT
$T41336 = -12						; size = 12
_this$ = 8						; size = 4
$T41342 = 12						; size = 4
__Count$ = 12						; size = 4
___formal$ = 16						; size = 4
?allocate@?$_DebugHeapAllocator@D@std@@QAAPADIPBX@Z PROC ; std::_DebugHeapAllocator<char>::allocate, COMDAT

; 79   : 		{	// check for integer overflow

	sub	esp, 12					; 0000000cH
	push	esi

; 80   : 		if (_Count <= 0)

	mov	esi, DWORD PTR __Count$[esp+12]
	test	esi, esi
	ja	SHORT $LN3@allocate

; 81   : 			_Count = 0;

	xor	esi, esi
$LN1@allocate:

; 84   : 
; 85   : 			// allocate array of _Count elements, ignore hint
; 86   : 		return ((_Ty *)_NEW_CRT char[_Count * sizeof(_Ty)]);

	push	86					; 00000056H
	push	OFFSET ??_C@_0DN@JHKGIIJF@C?3?2Program?5Files?2Microsoft?5Visua@
	call	?_DebugHeapTag_func@std@@YAABU_DebugHeapTag_t@1@XZ ; std::_DebugHeapTag_func
	push	eax
	push	esi
	call	??_U@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z ; operator new[]
	add	esp, 16					; 00000010H
	pop	esi

; 87   : 		}

	add	esp, 12					; 0000000cH
	ret	0
$LN3@allocate:

; 82   : 		else if (((size_t)(-1) / _Count) < sizeof(_Ty))

	or	eax, -1
	xor	edx, edx
	div	esi
	cmp	eax, 1
	jae	SHORT $LN1@allocate

; 83   : 			_THROW_NCEE(std::bad_alloc, NULL);

	lea	eax, DWORD PTR $T41342[esp+12]
	push	eax
	lea	ecx, DWORD PTR $T41336[esp+20]
	mov	DWORD PTR $T41342[esp+16], 0
	call	??0exception@std@@QAE@ABQBD@Z		; std::exception::exception
	push	OFFSET __TI2?AVbad_alloc@std@@
	lea	ecx, DWORD PTR $T41336[esp+20]
	push	ecx
	mov	DWORD PTR $T41336[esp+24], OFFSET ??_7bad_alloc@std@@6B@
	call	__CxxThrowException@8
$LN9@allocate:
$LN8@allocate:
	int	3
?allocate@?$_DebugHeapAllocator@D@std@@QAAPADIPBX@Z ENDP ; std::_DebugHeapAllocator<char>::allocate
; Function compile flags: /Ogtpy
_TEXT	ENDS
;	COMDAT ??0bad_alloc@std@@QAE@ABV01@@Z
_TEXT	SEGMENT
___that$ = 8						; size = 4
??0bad_alloc@std@@QAE@ABV01@@Z PROC			; std::bad_alloc::bad_alloc, COMDAT
; _this$ = ecx
	mov	eax, DWORD PTR ___that$[esp-4]
	push	esi
	push	eax
	mov	esi, ecx
	call	??0exception@std@@QAE@ABV01@@Z		; std::exception::exception
	mov	DWORD PTR [esi], OFFSET ??_7bad_alloc@std@@6B@
	mov	eax, esi
	pop	esi
	ret	4
??0bad_alloc@std@@QAE@ABV01@@Z ENDP			; std::bad_alloc::bad_alloc
_TEXT	ENDS
PUBLIC	?allocate@?$_DebugHeapAllocator@D@std@@QAEPADI@Z ; std::_DebugHeapAllocator<char>::allocate
; Function compile flags: /Ogtpy
;	COMDAT ?allocate@?$_DebugHeapAllocator@D@std@@QAEPADI@Z
_TEXT	SEGMENT
$T41352 = -12						; size = 12
$T41357 = 8						; size = 4
__Count$ = 8						; size = 4
?allocate@?$_DebugHeapAllocator@D@std@@QAEPADI@Z PROC	; std::_DebugHeapAllocator<char>::allocate, COMDAT
; _this$ = ecx

; 90   : 		{	// check for integer overflow

	sub	esp, 12					; 0000000cH
	push	esi

; 91   : 		if (_Count <= 0)

	mov	esi, DWORD PTR __Count$[esp+12]
	test	esi, esi
	ja	SHORT $LN3@allocate@2

; 92   : 			_Count = 0;

	xor	esi, esi
$LN1@allocate@2:

; 95   : 
; 96   : 			// allocate array of _Count elements
; 97   : 		return ((_Ty *)_NEW_CRT char[_Count * sizeof(_Ty)]);

	push	97					; 00000061H
	push	OFFSET ??_C@_0DN@JHKGIIJF@C?3?2Program?5Files?2Microsoft?5Visua@
	call	?_DebugHeapTag_func@std@@YAABU_DebugHeapTag_t@1@XZ ; std::_DebugHeapTag_func
	push	eax
	push	esi
	call	??_U@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z ; operator new[]
	add	esp, 16					; 00000010H
	pop	esi

; 98   : 		}

	add	esp, 12					; 0000000cH
	ret	4
$LN3@allocate@2:

; 93   : 		else if (((size_t)(-1) / _Count) < sizeof(_Ty))

	or	eax, -1
	xor	edx, edx
	div	esi
	cmp	eax, 1
	jae	SHORT $LN1@allocate@2

; 94   : 			_THROW_NCEE(std::bad_alloc, NULL);

	lea	eax, DWORD PTR $T41357[esp+12]
	push	eax
	lea	ecx, DWORD PTR $T41352[esp+20]
	mov	DWORD PTR $T41357[esp+16], 0
	call	??0exception@std@@QAE@ABQBD@Z		; std::exception::exception
	push	OFFSET __TI2?AVbad_alloc@std@@
	lea	ecx, DWORD PTR $T41352[esp+20]
	push	ecx
	mov	DWORD PTR $T41352[esp+24], OFFSET ??_7bad_alloc@std@@6B@
	call	__CxxThrowException@8
$LN9@allocate@2:
$LN8@allocate@2:
	int	3
?allocate@?$_DebugHeapAllocator@D@std@@QAEPADI@Z ENDP	; std::_DebugHeapAllocator<char>::allocate
_TEXT	ENDS
PUBLIC	??0?$allocator@D@std@@QAE@XZ			; std::allocator<char>::allocator<char>
; Function compile flags: /Ogtpy
; File c:\program files\microsoft visual studio 8\vc\include\xmemory
;	COMDAT ??0?$allocator@D@std@@QAE@XZ
_TEXT	SEGMENT
??0?$allocator@D@std@@QAE@XZ PROC			; std::allocator<char>::allocator<char>, COMDAT
; _this$ = ecx

; 120  : 	allocator() _THROW0()

	mov	eax, ecx

; 121  : 		{	// construct default allocator (do nothing)
; 122  : 		}

	ret	0
??0?$allocator@D@std@@QAE@XZ ENDP			; std::allocator<char>::allocator<char>
_TEXT	ENDS
PUBLIC	??0?$allocator@D@std@@QAE@ABV01@@Z		; std::allocator<char>::allocator<char>
; Function compile flags: /Ogtpy
;	COMDAT ??0?$allocator@D@std@@QAE@ABV01@@Z
_TEXT	SEGMENT
___formal$ = 8						; size = 4
??0?$allocator@D@std@@QAE@ABV01@@Z PROC			; std::allocator<char>::allocator<char>, COMDAT
; _this$ = ecx

; 124  : 	allocator(const allocator<_Ty>&) _THROW0()

	mov	eax, ecx

; 125  : 		{	// construct by copying (do nothing)
; 126  : 		}

	ret	4
??0?$allocator@D@std@@QAE@ABV01@@Z ENDP			; std::allocator<char>::allocator<char>
_TEXT	ENDS
PUBLIC	??$_DebugHeapDelete@X@std@@YAXPAX@Z		; std::_DebugHeapDelete<void>
EXTRN	_free:PROC
; Function compile flags: /Ogtpy
; File c:\program files\microsoft visual studio 8\vc\include\xdebug
;	COMDAT ??$_DebugHeapDelete@X@std@@YAXPAX@Z
_TEXT	SEGMENT
__Ptr$ = 8						; size = 4
??$_DebugHeapDelete@X@std@@YAXPAX@Z PROC		; std::_DebugHeapDelete<void>, COMDAT

; 56   : 	if (_Ptr != 0)

	mov	eax, DWORD PTR __Ptr$[esp-4]
	test	eax, eax
	je	SHORT $LN1@DebugHeapD

; 57   : 		{	// worth deleting
; 58   : 		_Ptr->~_Ty();
; 59   : 		// delete as _NORMAL_BLOCK, not _CRT_BLOCK, since we might have
; 60   : 		// facets allocated by normal new.
; 61   : 		free(_Ptr);

	mov	DWORD PTR __Ptr$[esp-4], eax
	jmp	_free
$LN1@DebugHeapD:

; 62   : 		}
; 63   : 	}

	ret	0
??$_DebugHeapDelete@X@std@@YAXPAX@Z ENDP		; std::_DebugHeapDelete<void>
_TEXT	ENDS
PUBLIC	??_C@_04LLEBNMDN@?$CFs?$AN?6?$AA@		; `string'
PUBLIC	??_C@_02BOGAIONP@ab?$AA@			; `string'
EXTRN	_fclose:PROC
EXTRN	_fprintf:PROC
EXTRN	_fopen:PROC
EXTRN	_vsprintf:PROC
;	COMDAT ?buffer@?3??log@@YAXPBDZZ@4PADA
; File d:\source code\stgm\mmgr.cpp
_BSS	SEGMENT
?buffer@?3??log@@YAXPBDZZ@4PADA DB 0800H DUP (?)	; `log'::`4'::buffer
_BSS	ENDS
;	COMDAT ??_C@_04LLEBNMDN@?$CFs?$AN?6?$AA@
CONST	SEGMENT
??_C@_04LLEBNMDN@?$CFs?$AN?6?$AA@ DB '%s', 0dH, 0aH, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_02BOGAIONP@ab?$AA@
CONST	SEGMENT
??_C@_02BOGAIONP@ab?$AA@ DB 'ab', 00H			; `string'
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ?log@@YAXPBDZZ
_TEXT	SEGMENT
_format$ = 8						; size = 4
?log@@YAXPBDZZ PROC					; log, COMDAT

; 292  : 	// Cleanup the log?
; 293  : 
; 294  : 	if (cleanupLogOnFirstRun) doCleanupLogOnFirstRun();

	cmp	BYTE PTR _cleanupLogOnFirstRun, 0
	je	SHORT $LN2@log
	call	?doCleanupLogOnFirstRun@@YAXXZ		; doCleanupLogOnFirstRun
$LN2@log:

; 295  : 
; 296  : 	// Build the buffer
; 297  : 
; 298  : 	static char buffer[2048];
; 299  : 	va_list	ap;
; 300  : 	va_start(ap, format);
; 301  : 	vsprintf(buffer, format, ap);

	mov	ecx, DWORD PTR _format$[esp-4]
	push	esi
	lea	eax, DWORD PTR _format$[esp+4]
	push	eax
	push	ecx
	push	OFFSET ?buffer@?3??log@@YAXPBDZZ@4PADA
	call	_vsprintf

; 302  : 	va_end(ap);
; 303  : 
; 304  : 	// Open the log file
; 305  : 	FILE	*fp = fopen(memoryLogFile, "ab");

	mov	edx, DWORD PTR _memoryLogFile
	push	OFFSET ??_C@_02BOGAIONP@ab?$AA@
	push	edx
	call	_fopen
	mov	esi, eax
	add	esp, 20					; 00000014H

; 306  : 
; 307  : 	// If you hit this assert, then the memory logger is unable to log information to a file (can't open the file for some
; 308  : 	// reason.) You can interrogate the variable 'buffer' to see what was supposed to be logged (but won't be.)
; 309  : 	//m_assert(fp);
; 310  : 
; 311  : 	if (!fp) return;

	test	esi, esi
	je	SHORT $LN3@log

; 312  : 
; 313  : 	// Spit out the data to the log
; 314  : 
; 315  : 	fprintf(fp, "%s\r\n", buffer);

	push	OFFSET ?buffer@?3??log@@YAXPBDZZ@4PADA
	push	OFFSET ??_C@_04LLEBNMDN@?$CFs?$AN?6?$AA@
	push	esi
	call	_fprintf

; 316  : 	fclose(fp);

	push	esi
	call	_fclose
	add	esp, 16					; 00000010H
$LN3@log:
	pop	esi

; 317  : }

	ret	0
?log@@YAXPBDZZ ENDP					; log
_TEXT	ENDS
PUBLIC	??_C@_0EE@OPCDPECI@?$CF06d?50x?$CF08X?50x?$CF08X?50x?$CF08X?50x?$CF08X@ ; `string'
PUBLIC	??_C@_0IO@FDJKDPCI@?9?9?9?9?9?9?5?9?9?9?9?9?9?9?9?9?9?5?9?9?9?9?9?9?9?9?9?9?5?9?9?9@ ; `string'
PUBLIC	??_C@_0GG@CIBNGLFN@Number?5Reported?5?5?5Reported?5?5?5?5Ac@ ; `string'
PUBLIC	??_C@_0GG@GMKAALB@Alloc?4?5?5?5Addr?5?5?5?5?5?5?5Size?5?5?5?5?5?5?5A@ ; `string'
;	COMDAT ??_C@_0EE@OPCDPECI@?$CF06d?50x?$CF08X?50x?$CF08X?50x?$CF08X?50x?$CF08X@
CONST	SEGMENT
??_C@_0EE@OPCDPECI@?$CF06d?50x?$CF08X?50x?$CF08X?50x?$CF08X?50x?$CF08X@ DB '%'
	DB	'06d 0x%08X 0x%08X 0x%08X 0x%08X 0x%08X %-8s    %c       %c   '
	DB	' %s', 0dH, 0aH, 00H				; `string'
CONST	ENDS
;	COMDAT ??_C@_0IO@FDJKDPCI@?9?9?9?9?9?9?5?9?9?9?9?9?9?9?9?9?9?5?9?9?9?9?9?9?9?9?9?9?5?9?9?9@
CONST	SEGMENT
??_C@_0IO@FDJKDPCI@?9?9?9?9?9?9?5?9?9?9?9?9?9?9?9?9?9?5?9?9?9?9?9?9?9?9?9?9?5?9?9?9@ DB '-'
	DB	'----- ---------- ---------- ---------- ---------- ---------- '
	DB	'-------- ------- ------- ------------------------------------'
	DB	'--------------- ', 0dH, 0aH, 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_0GG@CIBNGLFN@Number?5Reported?5?5?5Reported?5?5?5?5Ac@
CONST	SEGMENT
??_C@_0GG@CIBNGLFN@Number?5Reported?5?5?5Reported?5?5?5?5Ac@ DB 'Number R'
	DB	'eported   Reported    Actual     Actual     Unused    Method '
	DB	' Dealloc Realloc Allocated by ', 0dH, 0aH, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0GG@GMKAALB@Alloc?4?5?5?5Addr?5?5?5?5?5?5?5Size?5?5?5?5?5?5?5A@
CONST	SEGMENT
??_C@_0GG@GMKAALB@Alloc?4?5?5?5Addr?5?5?5?5?5?5?5Size?5?5?5?5?5?5?5A@ DB 'A'
	DB	'lloc.   Addr       Size       Addr       Size                '
	DB	'        BreakOn BreakOn              ', 0dH, 0aH, 00H ; `string'
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ?dumpAllocations@@YAXPAU_iobuf@@@Z
_TEXT	SEGMENT
tv317 = -264						; size = 4
_output$37766 = -260					; size = 260
_fp$ = 8						; size = 4
?dumpAllocations@@YAXPAU_iobuf@@@Z PROC			; dumpAllocations, COMDAT

; 549  : {

	sub	esp, 264				; 00000108H
	push	ebx
	push	ebp
	mov	ebp, DWORD PTR _fp$[esp+268]
	push	esi
	push	edi

; 550  : 	fprintf(fp, "Alloc.   Addr       Size       Addr       Size                        BreakOn BreakOn              \r\n");

	push	OFFSET ??_C@_0GG@GMKAALB@Alloc?4?5?5?5Addr?5?5?5?5?5?5?5Size?5?5?5?5?5?5?5A@
	push	ebp
	call	_fprintf

; 551  : 	fprintf(fp, "Number Reported   Reported    Actual     Actual     Unused    Method  Dealloc Realloc Allocated by \r\n");

	push	OFFSET ??_C@_0GG@CIBNGLFN@Number?5Reported?5?5?5Reported?5?5?5?5Ac@
	push	ebp
	call	_fprintf

; 552  : 	fprintf(fp, "------ ---------- ---------- ---------- ---------- ---------- -------- ------- ------- --------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IO@FDJKDPCI@?9?9?9?9?9?9?5?9?9?9?9?9?9?9?9?9?9?5?9?9?9?9?9?9?9?9?9?9?5?9?9?9@
	push	ebp
	call	_fprintf
	add	esp, 24					; 00000018H

; 553  : 
; 554  : 
; 555  : 	for (unsigned int i = 0; i < hashSize; i++)

	xor	eax, eax
	mov	DWORD PTR tv317[esp+280], eax
	npad	5
$LL28@dumpAlloca:

; 556  : 	{
; 557  : 		sAllocUnit *ptr = hashTable[i];

	mov	esi, DWORD PTR _hashTable[eax]

; 558  : 		while(ptr)

	test	esi, esi
	je	$LN4@dumpAlloca
	npad	2
$LL2@dumpAlloca:

; 559  : 		{
; 560  : 			char output[260];
; 561  : 			sprintf(output, "%06d 0x%08X 0x%08X 0x%08X 0x%08X 0x%08X %-8s    %c       %c    %s\r\n",
; 562  : 				ptr->allocationNumber,
; 563  : 				reinterpret_cast<unsigned int>(ptr->reportedAddress), ptr->reportedSize,
; 564  : 				reinterpret_cast<unsigned int>(ptr->actualAddress), ptr->actualSize,
; 565  : 				m_calcUnused(ptr),
; 566  : 				allocationTypes[ptr->allocationType],
; 567  : 				ptr->breakOnDealloc ? 'Y':'N',
; 568  : 				ptr->breakOnRealloc ? 'Y':'N',
; 569  : 				ownerString(ptr->sourceFile, ptr->sourceLine, ptr->sourceFunc));

	mov	ebx, DWORD PTR [esi+96]
	push	180					; 000000b4H
	push	0
	push	OFFSET ?str@?1??ownerString@@YAPBDPBDI0@Z@4PADA
	lea	edi, DWORD PTR [esi+16]
	call	_memset
	push	92					; 0000005cH
	push	edi
	call	_strrchr
	add	esp, 20					; 00000014H
	test	eax, eax
	jne	SHORT $LN29@dumpAlloca
	push	47					; 0000002fH
	push	edi
	call	_strrchr
	add	esp, 8
	test	eax, eax
	je	SHORT $LN10@dumpAlloca
$LN29@dumpAlloca:
	lea	edi, DWORD PTR [eax+1]
$LN10@dumpAlloca:
	lea	eax, DWORD PTR [esi+56]
	push	eax
	push	ebx
	push	edi
	push	OFFSET ??_C@_0N@GKPAADIG@?$CFs?$CI?$CF05d?$CJ?3?3?$CFs?$AA@
	push	179					; 000000b3H
	push	OFFSET ?str@?1??ownerString@@YAPBDPBDI0@Z@4PADA
	call	__snprintf
	mov	eax, DWORD PTR [esi+4]
	mov	ecx, DWORD PTR [esi+12]
	add	esp, 24					; 00000018H
	xor	edi, edi
	test	eax, eax
	mov	edx, ecx
	jbe	SHORT $LN15@dumpAlloca
	mov	ebp, DWORD PTR _unusedPattern
	lea	ebx, DWORD PTR [eax-1]
	shr	ebx, 2
	add	ebx, 1
$LL17@dumpAlloca:
	cmp	DWORD PTR [edx], ebp
	jne	SHORT $LN16@dumpAlloca
	add	edi, 4
$LN16@dumpAlloca:
	add	edx, 4
	sub	ebx, 1
	jne	SHORT $LL17@dumpAlloca
	mov	ebp, DWORD PTR _fp$[esp+276]
$LN15@dumpAlloca:
	movzx	edx, BYTE PTR [esi+105]
	neg	dl
	push	OFFSET ?str@?1??ownerString@@YAPBDPBDI0@Z@4PADA
	sbb	edx, edx
	and	edx, 11					; 0000000bH
	add	edx, 78					; 0000004eH
	push	edx
	movzx	edx, BYTE PTR [esi+104]
	neg	dl
	sbb	edx, edx
	and	edx, 11					; 0000000bH
	add	edx, 78					; 0000004eH
	push	edx
	mov	edx, DWORD PTR [esi+100]
	mov	edx, DWORD PTR _allocationTypes[edx*4]
	push	edx
	mov	edx, DWORD PTR [esi]
	push	edi
	push	edx
	mov	edx, DWORD PTR [esi+8]
	push	edx
	push	eax
	mov	eax, DWORD PTR [esi+108]
	push	ecx
	push	eax
	lea	ecx, DWORD PTR _output$37766[esp+320]
	push	OFFSET ??_C@_0EE@OPCDPECI@?$CF06d?50x?$CF08X?50x?$CF08X?50x?$CF08X?50x?$CF08X@
	push	ecx
	call	_sprintf

; 570  : 		    fprintf(fp,output);

	lea	edx, DWORD PTR _output$37766[esp+328]
	push	edx
	push	ebp
	call	_fprintf

; 571  : 			//OutputDebugString(output);
; 572  : 			ptr = ptr->next;

	mov	esi, DWORD PTR [esi+116]
	add	esp, 56					; 00000038H
	test	esi, esi
	jne	$LL2@dumpAlloca

; 558  : 		while(ptr)

	mov	eax, DWORD PTR tv317[esp+280]
$LN4@dumpAlloca:

; 553  : 
; 554  : 
; 555  : 	for (unsigned int i = 0; i < hashSize; i++)

	add	eax, 4
	cmp	eax, 16384				; 00004000H
	mov	DWORD PTR tv317[esp+280], eax
	jb	$LL28@dumpAlloca
	pop	edi
	pop	esi
	pop	ebp
	pop	ebx

; 573  : 		}
; 574  : 	}
; 575  : }

	add	esp, 264				; 00000108H
	ret	0
?dumpAllocations@@YAXPAU_iobuf@@@Z ENDP			; dumpAllocations
_TEXT	ENDS
PUBLIC	??_C@_0BK@BGCFNIAD@?$CFd?5memory?5leak?$CFs?5found?3?$AN?6?$AA@ ; `string'
PUBLIC	??_C@_01LKDEMHDF@s?$AA@				; `string'
PUBLIC	??_C@_02PCIJFNDE@?$AN?6?$AA@			; `string'
PUBLIC	??_C@_0JB@JJMIPLMB@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ ; `string'
PUBLIC	??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@ ; `string'
PUBLIC	??_C@_03ELIABIOC@w?$CLb?$AA@			; `string'
EXTRN	?DeallocMemory@@YAXPAX@Z:PROC			; DeallocMemory
_BSS	SEGMENT
_reservoir DD	01H DUP (?)
_BSS	ENDS
;	COMDAT ?timeString@?9??dumpLeakReport@@YAXXZ@4PADA
; File c:\program files\microsoft visual studio 8\vc\include\time.inl
_BSS	SEGMENT
?timeString@?9??dumpLeakReport@@YAXXZ@4PADA DB 019H DUP (?) ; `dumpLeakReport'::`10'::timeString
_BSS	ENDS
;	COMDAT ??_C@_0BK@BGCFNIAD@?$CFd?5memory?5leak?$CFs?5found?3?$AN?6?$AA@
CONST	SEGMENT
??_C@_0BK@BGCFNIAD@?$CFd?5memory?5leak?$CFs?5found?3?$AN?6?$AA@ DB '%d me'
	DB	'mory leak%s found:', 0dH, 0aH, 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_01LKDEMHDF@s?$AA@
CONST	SEGMENT
??_C@_01LKDEMHDF@s?$AA@ DB 's', 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_02PCIJFNDE@?$AN?6?$AA@
CONST	SEGMENT
??_C@_02PCIJFNDE@?$AN?6?$AA@ DB 0dH, 0aH, 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_0JB@JJMIPLMB@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
CONST	SEGMENT
??_C@_0JB@JJMIPLMB@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ DB '|'
	DB	'                                          Memory leak report '
	DB	'for:  %02d/%02d/%04d %02d:%02d:%02d                          '
	DB	'                  |', 0dH, 0aH, 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
CONST	SEGMENT
??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@ DB ' '
	DB	'-------------------------------------------------------------'
	DB	'-------------------------------------------------------------'
	DB	'-------- ', 0dH, 0aH, 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_03ELIABIOC@w?$CLb?$AA@
CONST	SEGMENT
??_C@_03ELIABIOC@w?$CLb?$AA@ DB 'w+b', 00H		; `string'
; Function compile flags: /Ogtpy
; File d:\source code\stgm\mmgr.cpp
CONST	ENDS
;	COMDAT ?dumpLeakReport@@YAXXZ
_TEXT	SEGMENT
_t$37783 = -268						; size = 8
_filename$37773 = -260					; size = 260
?dumpLeakReport@@YAXXZ PROC				; dumpLeakReport, COMDAT

; 580  : {

	sub	esp, 268				; 0000010cH

; 581  : 	// Any leaks?
; 582  : 	if (stats.totalAllocUnitCount)

	cmp	DWORD PTR _stats+28, 0
	push	esi
	je	$LN10@dumpLeakRe
	push	edi

; 583  : 	{
; 584  : 		// Open the report file
; 585  : 		
; 586  : 		char filename[MAX_PATH];
; 587  : 		int x = 1;

	mov	edi, DWORD PTR __imp__GetFileAttributesA@4
	mov	esi, 1
$LL9@dumpLeakRe:

; 588  : 		do {
; 589  : 			sprintf(filename,memoryLeakLogFile,x);

	mov	eax, DWORD PTR _memoryLeakLogFile
	push	esi
	push	eax
	lea	ecx, DWORD PTR _filename$37773[esp+284]
	push	ecx
	call	_sprintf
	add	esp, 12					; 0000000cH

; 590  : 			x++;
; 591  : 		} while (
; 592  : 			(GetFileAttributes(filename) != 0xFFFFFFFF)
; 593  : 		);

	lea	edx, DWORD PTR _filename$37773[esp+276]
	push	edx
	add	esi, 1
	call	edi
	cmp	eax, -1
	jne	SHORT $LL9@dumpLeakRe

; 594  : 		FILE *fp = fopen(filename,"w+b");

	lea	eax, DWORD PTR _filename$37773[esp+276]
	push	OFFSET ??_C@_03ELIABIOC@w?$CLb?$AA@
	push	eax
	call	_fopen
	mov	esi, eax
	add	esp, 8

; 595  : 
; 596  : 		//FILE	*fp = fopen(memoryLeakLogFile, "w+b");
; 597  : 
; 598  : 		// If you hit this assert, then the memory report generator is unable to log information to a file (can't open the file for
; 599  : 		// some reason.)
; 600  : 		m_assert(fp);
; 601  : 		if (!fp) return;

	test	esi, esi
	je	$LN23@dumpLeakRe

; 602  : 		// Header
; 603  : 		static  char    timeString[25];
; 604  : 		memset(timeString, 0, sizeof(timeString));

	xor	eax, eax

; 605  : 		time_t  t = time(NULL);

	push	eax
	mov	DWORD PTR ?timeString@?9??dumpLeakReport@@YAXXZ@4PADA, eax
	mov	DWORD PTR ?timeString@?9??dumpLeakReport@@YAXXZ@4PADA+4, eax
	mov	DWORD PTR ?timeString@?9??dumpLeakReport@@YAXXZ@4PADA+8, eax
	mov	DWORD PTR ?timeString@?9??dumpLeakReport@@YAXXZ@4PADA+12, eax
	mov	DWORD PTR ?timeString@?9??dumpLeakReport@@YAXXZ@4PADA+16, eax
	mov	DWORD PTR ?timeString@?9??dumpLeakReport@@YAXXZ@4PADA+20, eax
	mov	BYTE PTR ?timeString@?9??dumpLeakReport@@YAXXZ@4PADA+24, al
	call	__time64

; 606  : 		struct  tm *tme = localtime(&t);

	lea	ecx, DWORD PTR _t$37783[esp+280]
	push	ecx
	mov	DWORD PTR _t$37783[esp+284], eax
	mov	DWORD PTR _t$37783[esp+288], edx
	call	__localtime64

; 607  : 		fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	mov	edi, eax
	call	_fprintf

; 608  : 		fprintf(fp, "|                                          Memory leak report for:  %02d/%02d/%04d %02d:%02d:%02d                                            |\r\n", tme->tm_mon + 1, tme->tm_mday, tme->tm_year + 1900, tme->tm_hour, tme->tm_min, tme->tm_sec);

	mov	edx, DWORD PTR [edi]
	mov	eax, DWORD PTR [edi+4]
	mov	ecx, DWORD PTR [edi+8]
	push	edx
	mov	edx, DWORD PTR [edi+20]
	push	eax
	mov	eax, DWORD PTR [edi+12]
	push	ecx
	mov	ecx, DWORD PTR [edi+16]
	add	edx, 1900				; 0000076cH
	push	edx
	push	eax
	add	ecx, 1
	push	ecx
	push	OFFSET ??_C@_0JB@JJMIPLMB@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
	push	esi
	call	_fprintf

; 609  : 		fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	call	_fprintf

; 610  : 		fprintf(fp, "\r\n");

	push	OFFSET ??_C@_02PCIJFNDE@?$AN?6?$AA@
	push	esi
	call	_fprintf
	add	esp, 64					; 00000040H

; 611  : 		fprintf(fp, "\r\n");

	push	OFFSET ??_C@_02PCIJFNDE@?$AN?6?$AA@
	push	esi
	call	_fprintf

; 612  : 		fprintf(fp, "%d memory leak%s found:\r\n", stats.totalAllocUnitCount, stats.totalAllocUnitCount == 1 ? "":"s");

	mov	eax, DWORD PTR _stats+28
	add	esp, 8
	cmp	eax, 1
	mov	ecx, OFFSET ??_C@_00CNPNBAHC@?$AA@
	je	SHORT $LN14@dumpLeakRe
	mov	ecx, OFFSET ??_C@_01LKDEMHDF@s?$AA@
$LN14@dumpLeakRe:
	push	ecx
	push	eax
	push	OFFSET ??_C@_0BK@BGCFNIAD@?$CFd?5memory?5leak?$CFs?5found?3?$AN?6?$AA@
	push	esi
	call	_fprintf

; 613  : 		fprintf(fp, "\r\n");

	push	OFFSET ??_C@_02PCIJFNDE@?$AN?6?$AA@
	push	esi
	call	_fprintf

; 614  : 
; 615  : 		dumpAllocations(fp);

	push	esi
	call	?dumpAllocations@@YAXPAU_iobuf@@@Z	; dumpAllocations

; 616  : 
; 617  : 		fclose(fp);

	push	esi
	call	_fclose
	add	esp, 32					; 00000020H
$LN23@dumpLeakRe:
	pop	edi
$LN4@dumpLeakRe:
	pop	esi

; 632  : 		}
; 633  : 	}
; 634  : }

	add	esp, 268				; 0000010cH
	ret	0
$LN10@dumpLeakRe:

; 618  : 	}
; 619  : 	else
; 620  : 	{
; 621  : 		// We can finally free up our own memory allocations
; 622  : 		if (reservoirBuffer)

	cmp	DWORD PTR _reservoirBuffer, 0
	je	SHORT $LN4@dumpLeakRe

; 623  : 		{
; 624  : 			for (unsigned int i = 0; i < reservoirBufferSize; i++)

	xor	esi, esi
	cmp	DWORD PTR _reservoirBufferSize, esi
	jbe	SHORT $LN1@dumpLeakRe
$LL22@dumpLeakRe:

; 625  : 			{
; 626  : 				DeallocMemory(reservoirBuffer[i]);

	mov	edx, DWORD PTR _reservoirBuffer
	mov	eax, DWORD PTR [edx+esi*4]
	push	eax
	call	?DeallocMemory@@YAXPAX@Z		; DeallocMemory
	add	esi, 1
	add	esp, 4
	cmp	esi, DWORD PTR _reservoirBufferSize
	jb	SHORT $LL22@dumpLeakRe
$LN1@dumpLeakRe:

; 627  : 			}
; 628  : 			//DeallocMemory(reservoirBuffer);
; 629  : 			reservoirBuffer = 0;

	mov	DWORD PTR _reservoirBuffer, 0

; 630  : 			reservoirBufferSize = 0;

	mov	DWORD PTR _reservoirBufferSize, 0

; 631  : 			reservoir = NULL;

	mov	DWORD PTR _reservoir, 0
	pop	esi

; 632  : 		}
; 633  : 	}
; 634  : }

	add	esp, 268				; 0000010cH
	ret	0
?dumpLeakReport@@YAXXZ ENDP				; dumpLeakReport
_TEXT	ENDS
PUBLIC	??1MemStaticTimeTracker@@QAE@XZ			; MemStaticTimeTracker::~MemStaticTimeTracker
EXTRN	__imp__DeleteCriticalSection@4:PROC
; Function compile flags: /Ogtpy
;	COMDAT ??1MemStaticTimeTracker@@QAE@XZ
_TEXT	SEGMENT
??1MemStaticTimeTracker@@QAE@XZ PROC			; MemStaticTimeTracker::~MemStaticTimeTracker, COMDAT
; _this$ = ecx

; 644  : 	~MemStaticTimeTracker() {staticDeinitTime = true; dumpLeakReport();DeleteCriticalSection(&criticalSection);criticalInitialized=false;}

	mov	BYTE PTR _staticDeinitTime, 1
	call	?dumpLeakReport@@YAXXZ			; dumpLeakReport
	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__DeleteCriticalSection@4
	mov	BYTE PTR ?criticalInitialized@@3_NA, 0	; criticalInitialized
	ret	0
??1MemStaticTimeTracker@@QAE@XZ ENDP			; MemStaticTimeTracker::~MemStaticTimeTracker
_TEXT	ENDS
PUBLIC	??_C@_0DK@NLCOMIEF@?$FLI?$FN?5NOTE?$CB?5Possible?5destructor?5ch@ ; `string'
PUBLIC	?m_setOwner@@YAXPBDI0@Z				; m_setOwner
;	COMDAT ??_C@_0DK@NLCOMIEF@?$FLI?$FN?5NOTE?$CB?5Possible?5destructor?5ch@
CONST	SEGMENT
??_C@_0DK@NLCOMIEF@?$FLI?$FN?5NOTE?$CB?5Possible?5destructor?5ch@ DB '[I]'
	DB	' NOTE! Possible destructor chain: previous owner is %s', 00H ; `string'
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ?m_setOwner@@YAXPBDI0@Z
_TEXT	SEGMENT
_file$ = 8						; size = 4
_line$ = 12						; size = 4
_func$ = 16						; size = 4
?m_setOwner@@YAXPBDI0@Z PROC				; m_setOwner, COMDAT

; 739  : 	// You're probably wondering about this...
; 740  : 	//
; 741  : 	// It's important for this memory manager to primarily work with global new/delete in their original forms (i.e. with
; 742  : 	// no extra parameters.) In order to do this, we use macros that call this function prior to operators new & delete. This
; 743  : 	// is fine... usually. Here's what actually happens when you use this macro to delete an object:
; 744  : 	//
; 745  : 	// m_setOwner(__FILE__, __LINE__, __FUNCTION__) --> object::~object() --> delete
; 746  : 	//
; 747  : 	// Note that the compiler inserts a call to the object's destructor just prior to calling our overridden operator delete.
; 748  : 	// But what happens when we delete an object whose destructor deletes another object, whose desctuctor deletes another
; 749  : 	// object? Here's a diagram (indentation follows stack depth):
; 750  : 	//
; 751  : 	// m_setOwner(...) -> ~obj1()                          // original call to delete obj1
; 752  : 	//     m_setOwner(...) -> ~obj2()                      // obj1's destructor deletes obj2
; 753  : 	//         m_setOwner(...) -> ~obj3()                  // obj2's destructor deletes obj3
; 754  : 	//             ...                                     // obj3's destructor just does some stuff
; 755  : 	//         delete                                      // back in obj2's destructor, we call delete
; 756  : 	//     delete                                          // back in obj1's destructor, we call delete
; 757  : 	// delete                                              // back to our original call, we call delete
; 758  : 	//
; 759  : 	// Because m_setOwner() just sets up some static variables (below) it's important that each call to m_setOwner() and
; 760  : 	// successive calls to new/delete alternate. However, in this case, three calls to m_setOwner() happen in succession
; 761  : 	// followed by three calls to delete in succession (with a few calls to destructors mixed in for fun.) This means that
; 762  : 	// only the final call to delete (in this chain of events) will have the proper reporting, and the first two in the chain
; 763  : 	// will not have ANY owner-reporting information. The deletes will still work fine, we just won't know who called us.
; 764  : 	//
; 765  : 	// "Then build a stack, my friend!" you might think... but it's a very common thing that people will be working with third-
; 766  : 	// party libraries (including MFC under Windows) which is not compiled with this memory manager's macros. In those cases,
; 767  : 	// m_setOwner() is never called, and rightfully should not have the proper trace-back information. So if one of the
; 768  : 	// destructors in the chain ends up being a call to a delete from a non-mmgr-compiled library, the stack will get confused.
; 769  : 	//
; 770  : 	// I've been unable to find a solution to this problem, but at least we can detect it and report the data before we
; 771  : 	// lose it. That's what this is all about. It makes it somewhat confusing to read in the logs, but at least ALL the
; 772  : 	// information is present...
; 773  : 	//
; 774  : 	// There's a caveat here... The compiler is not required to call operator delete if the value being deleted is NULL.
; 775  : 	// In this case, any call to delete with a NULL will sill call m_setOwner(), which will make m_setOwner() think that
; 776  : 	// there is a destructor chain becuase we setup the variables, but nothing gets called to clear them. Because of this
; 777  : 	// we report a "Possible destructor chain".
; 778  : 	//
; 779  : 	// Thanks to J. Woznack (from Kodiak Interactive Software Studios -- www.kodiakgames.com) for pointing this out.
; 780  : 
; 781  : 	if (sourceLine && alwaysLogAll)

	mov	eax, DWORD PTR _sourceLine
	test	eax, eax
	je	SHORT $LN1@m_setOwner
	cmp	BYTE PTR _alwaysLogAll, 0
	je	SHORT $LN1@m_setOwner

; 782  : 	{
; 783  : 		log("[I] NOTE! Possible destructor chain: previous owner is %s", ownerString(sourceFile, sourceLine, sourceFunc));

	mov	ecx, DWORD PTR _sourceFunc
	push	ecx
	push	eax
	mov	eax, DWORD PTR _sourceFile
	call	?ownerString@@YAPBDPBDI0@Z		; ownerString
	push	eax
	push	OFFSET ??_C@_0DK@NLCOMIEF@?$FLI?$FN?5NOTE?$CB?5Possible?5destructor?5ch@
	call	?log@@YAXPBDZZ				; log
	add	esp, 16					; 00000010H
$LN1@m_setOwner:

; 784  : 	}
; 785  : 
; 786  : 	// Okay... save this stuff off so we can keep track of the caller
; 787  : 
; 788  : 	sourceFile = file;

	mov	edx, DWORD PTR _file$[esp-4]

; 789  : 	sourceLine = line;

	mov	eax, DWORD PTR _line$[esp-4]

; 790  : 	sourceFunc = func;

	mov	ecx, DWORD PTR _func$[esp-4]
	mov	DWORD PTR _sourceFile, edx
	mov	DWORD PTR _sourceLine, eax
	mov	DWORD PTR _sourceFunc, ecx

; 791  : }

	ret	0
?m_setOwner@@YAXPBDI0@Z ENDP				; m_setOwner
_TEXT	ENDS
PUBLIC	??_C@_0BN@KGEPAADI@?$FLI?$FN?5?$CFsAllocation?5number?5?3?5?$CFd?$AA@ ; `string'
PUBLIC	??_C@_0BN@CMPPEAHC@?$FLI?$FN?5?$CFsAllocation?5type?5?5?5?3?5?$CFs?$AA@ ; `string'
PUBLIC	??_C@_0CF@GMAEMJGF@?$FLI?$FN?5?$CFsOwner?5?5?5?5?5?5?5?5?5?5?5?5?5?3?5?$CFs?$CI?$CFd?$CJ@ ; `string'
PUBLIC	??_C@_0CG@MPFLHNAM@?$FLI?$FN?5?$CFsSize?5?$CIactual?$CJ?5?5?5?5?5?3?50x?$CF08X@ ; `string'
PUBLIC	??_C@_0CG@DNOKLHLH@?$FLI?$FN?5?$CFsSize?5?$CIreported?$CJ?5?5?5?3?50x?$CF08X@ ; `string'
PUBLIC	??_C@_0CA@CCLFGDEN@?$FLI?$FN?5?$CFsAddress?5?$CIactual?$CJ?5?5?3?5?$CF010p?$AA@ ; `string'
PUBLIC	??_C@_0CA@OPGPIAHL@?$FLI?$FN?5?$CFsAddress?5?$CIreported?$CJ?3?5?$CF010p?$AA@ ; `string'
PUBLIC	?m_dumpAllocUnit@@YAXPBUtag_au@@PBD@Z		; m_dumpAllocUnit
;	COMDAT ??_C@_0BN@KGEPAADI@?$FLI?$FN?5?$CFsAllocation?5number?5?3?5?$CFd?$AA@
CONST	SEGMENT
??_C@_0BN@KGEPAADI@?$FLI?$FN?5?$CFsAllocation?5number?5?3?5?$CFd?$AA@ DB '['
	DB	'I] %sAllocation number : %d', 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_0BN@CMPPEAHC@?$FLI?$FN?5?$CFsAllocation?5type?5?5?5?3?5?$CFs?$AA@
CONST	SEGMENT
??_C@_0BN@CMPPEAHC@?$FLI?$FN?5?$CFsAllocation?5type?5?5?5?3?5?$CFs?$AA@ DB '['
	DB	'I] %sAllocation type   : %s', 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_0CF@GMAEMJGF@?$FLI?$FN?5?$CFsOwner?5?5?5?5?5?5?5?5?5?5?5?5?5?3?5?$CFs?$CI?$CFd?$CJ@
CONST	SEGMENT
??_C@_0CF@GMAEMJGF@?$FLI?$FN?5?$CFsOwner?5?5?5?5?5?5?5?5?5?5?5?5?5?3?5?$CFs?$CI?$CFd?$CJ@ DB '['
	DB	'I] %sOwner             : %s(%d)::%s', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_0CG@MPFLHNAM@?$FLI?$FN?5?$CFsSize?5?$CIactual?$CJ?5?5?5?5?5?3?50x?$CF08X@
CONST	SEGMENT
??_C@_0CG@MPFLHNAM@?$FLI?$FN?5?$CFsSize?5?$CIactual?$CJ?5?5?5?5?5?3?50x?$CF08X@ DB '['
	DB	'I] %sSize (actual)     : 0x%08X (%s)', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_0CG@DNOKLHLH@?$FLI?$FN?5?$CFsSize?5?$CIreported?$CJ?5?5?5?3?50x?$CF08X@
CONST	SEGMENT
??_C@_0CG@DNOKLHLH@?$FLI?$FN?5?$CFsSize?5?$CIreported?$CJ?5?5?5?3?50x?$CF08X@ DB '['
	DB	'I] %sSize (reported)   : 0x%08X (%s)', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_0CA@CCLFGDEN@?$FLI?$FN?5?$CFsAddress?5?$CIactual?$CJ?5?5?3?5?$CF010p?$AA@
CONST	SEGMENT
??_C@_0CA@CCLFGDEN@?$FLI?$FN?5?$CFsAddress?5?$CIactual?$CJ?5?5?3?5?$CF010p?$AA@ DB '['
	DB	'I] %sAddress (actual)  : %010p', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_0CA@OPGPIAHL@?$FLI?$FN?5?$CFsAddress?5?$CIreported?$CJ?3?5?$CF010p?$AA@
CONST	SEGMENT
??_C@_0CA@OPGPIAHL@?$FLI?$FN?5?$CFsAddress?5?$CIreported?$CJ?3?5?$CF010p?$AA@ DB '['
	DB	'I] %sAddress (reported): %010p', 00H	; `string'
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ?m_dumpAllocUnit@@YAXPBUtag_au@@PBD@Z
_TEXT	SEGMENT
_allocUnit$ = 8						; size = 4
_prefix$ = 12						; size = 4
?m_dumpAllocUnit@@YAXPBUtag_au@@PBD@Z PROC		; m_dumpAllocUnit, COMDAT

; 1759 : {

	push	esi

; 1760 : 	log("[I] %sAddress (reported): %010p",       prefix, allocUnit->reportedAddress);

	mov	esi, DWORD PTR _allocUnit$[esp]
	mov	eax, DWORD PTR [esi+12]
	push	edi
	mov	edi, DWORD PTR _prefix$[esp+4]
	push	eax
	push	edi
	push	OFFSET ??_C@_0CA@OPGPIAHL@?$FLI?$FN?5?$CFsAddress?5?$CIreported?$CJ?3?5?$CF010p?$AA@
	call	?log@@YAXPBDZZ				; log

; 1761 : 	log("[I] %sAddress (actual)  : %010p",       prefix, allocUnit->actualAddress);

	mov	ecx, DWORD PTR [esi+8]
	push	ecx
	push	edi
	push	OFFSET ??_C@_0CA@CCLFGDEN@?$FLI?$FN?5?$CFsAddress?5?$CIactual?$CJ?5?5?3?5?$CF010p?$AA@
	call	?log@@YAXPBDZZ				; log

; 1762 : 	log("[I] %sSize (reported)   : 0x%08X (%s)", prefix, static_cast<unsigned int>(allocUnit->reportedSize), memorySizeString(static_cast<unsigned int>(allocUnit->reportedSize)));

	mov	eax, DWORD PTR [esi+4]
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	mov	edx, DWORD PTR [esi+4]
	push	eax
	push	edx
	push	edi
	push	OFFSET ??_C@_0CG@DNOKLHLH@?$FLI?$FN?5?$CFsSize?5?$CIreported?$CJ?5?5?5?3?50x?$CF08X@
	call	?log@@YAXPBDZZ				; log

; 1763 : 	log("[I] %sSize (actual)     : 0x%08X (%s)", prefix, static_cast<unsigned int>(allocUnit->actualSize), memorySizeString(static_cast<unsigned int>(allocUnit->actualSize)));

	mov	eax, DWORD PTR [esi]
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	mov	eax, DWORD PTR [esi]
	push	eax
	push	edi
	push	OFFSET ??_C@_0CG@MPFLHNAM@?$FLI?$FN?5?$CFsSize?5?$CIactual?$CJ?5?5?5?5?5?3?50x?$CF08X@
	call	?log@@YAXPBDZZ				; log

; 1764 : 	log("[I] %sOwner             : %s(%d)::%s",  prefix, allocUnit->sourceFile, allocUnit->sourceLine, allocUnit->sourceFunc);

	mov	edx, DWORD PTR [esi+96]
	lea	ecx, DWORD PTR [esi+56]
	push	ecx
	push	edx
	lea	eax, DWORD PTR [esi+16]
	push	eax
	push	edi
	push	OFFSET ??_C@_0CF@GMAEMJGF@?$FLI?$FN?5?$CFsOwner?5?5?5?5?5?5?5?5?5?5?5?5?5?3?5?$CFs?$CI?$CFd?$CJ@
	call	?log@@YAXPBDZZ				; log

; 1765 : 	log("[I] %sAllocation type   : %s",          prefix, allocationTypes[allocUnit->allocationType]);

	mov	ecx, DWORD PTR [esi+100]
	mov	edx, DWORD PTR _allocationTypes[ecx*4]
	add	esp, 76					; 0000004cH
	push	edx
	push	edi
	push	OFFSET ??_C@_0BN@CMPPEAHC@?$FLI?$FN?5?$CFsAllocation?5type?5?5?5?3?5?$CFs?$AA@
	call	?log@@YAXPBDZZ				; log

; 1766 : 	log("[I] %sAllocation number : %d",          prefix, allocUnit->allocationNumber);

	mov	eax, DWORD PTR [esi+108]
	push	eax
	push	edi
	push	OFFSET ??_C@_0BN@KGEPAADI@?$FLI?$FN?5?$CFsAllocation?5number?5?3?5?$CFd?$AA@
	call	?log@@YAXPBDZZ				; log
	add	esp, 24					; 00000018H
	pop	edi
	pop	esi

; 1767 : }

	ret	0
?m_dumpAllocUnit@@YAXPBUtag_au@@PBD@Z ENDP		; m_dumpAllocUnit
_TEXT	ENDS
PUBLIC	??_C@_06MHMFDNCL@?$AN?6?$AN?6?$AN?6?$AA@	; `string'
PUBLIC	??_C@_0CK@MMANFKAE@?5?5?5?5Memory?5allocated?5but?5not?5in?5@ ; `string'
PUBLIC	??_C@_0IH@GEDMMLFG@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ ; `string'
PUBLIC	??_C@_0CK@MNFBOOLB@?5?5?5?5?5?5?5?5?5?5?5?5?5?5Allocation?5unit?5co@ ; `string'
PUBLIC	??_C@_0IH@NLOIOPFJ@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ ; `string'
PUBLIC	??_C@_0CK@GJNDODIF@?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5Act@ ; `string'
PUBLIC	??_C@_0IH@EHALCHGA@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ ; `string'
PUBLIC	??_C@_0CK@LHFIFEGD@?5?5?5?5?5?5?5?5?5?5?5Memory?5tracking?5overh@ ; `string'
PUBLIC	??_C@_0CK@HNCNJKJK@?5?5?5?5?5?5?5?5?5Actual?5total?5memory?5in?5@ ; `string'
PUBLIC	??_C@_0CK@GNEAPJDK@?5?5?5?5?5?5?5?5?5?5?5?5Reported?5to?5applicat@ ; `string'
PUBLIC	??_C@_0CM@EFENNOEI@?5?5?5?5?5?5?5?5?5?5?5?5?5?5Allocation?5unit?5co@ ; `string'
PUBLIC	??_C@_0IH@JCFEOJNN@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ ; `string'
PUBLIC	??_C@_0JB@GPNPDKPP@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ ; `string'
PUBLIC	?m_dumpMemoryReport@@YAXPBD_N@Z			; m_dumpMemoryReport
;	COMDAT ?timeString@?7??m_dumpMemoryReport@@YAXPBD_N@Z@4PADA
; File c:\program files\microsoft visual studio 8\vc\include\time.inl
_BSS	SEGMENT
?timeString@?7??m_dumpMemoryReport@@YAXPBD_N@Z@4PADA DB 019H DUP (?) ; `m_dumpMemoryReport'::`8'::timeString
_BSS	ENDS
;	COMDAT ??_C@_06MHMFDNCL@?$AN?6?$AN?6?$AN?6?$AA@
CONST	SEGMENT
??_C@_06MHMFDNCL@?$AN?6?$AN?6?$AN?6?$AA@ DB 0dH, 0aH, 0dH, 0aH, 0dH, 0aH, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0CK@MMANFKAE@?5?5?5?5Memory?5allocated?5but?5not?5in?5@
CONST	SEGMENT
??_C@_0CK@MMANFKAE@?5?5?5?5Memory?5allocated?5but?5not?5in?5@ DB '    Mem'
	DB	'ory allocated but not in use: %s', 0dH, 0aH, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0IH@GEDMMLFG@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
CONST	SEGMENT
??_C@_0IH@GEDMMLFG@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ DB '|'
	DB	'                                                           U '
	DB	'N U S E D                                                    '
	DB	'        |', 0dH, 0aH, 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_0CK@MNFBOOLB@?5?5?5?5?5?5?5?5?5?5?5?5?5?5Allocation?5unit?5co@
CONST	SEGMENT
??_C@_0CK@MNFBOOLB@?5?5?5?5?5?5?5?5?5?5?5?5?5?5Allocation?5unit?5co@ DB ' '
	DB	'             Allocation unit count: %s', 0dH, 0aH, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0IH@NLOIOPFJ@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
CONST	SEGMENT
??_C@_0IH@NLOIOPFJ@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ DB '|'
	DB	'                                                      A C C U'
	DB	' M U L A T E D                                               '
	DB	'        |', 0dH, 0aH, 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_0CK@GJNDODIF@?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5Act@
CONST	SEGMENT
??_C@_0CK@GJNDODIF@?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5Act@ DB ' '
	DB	'                            Actual: %s', 0dH, 0aH, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0IH@EHALCHGA@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
CONST	SEGMENT
??_C@_0IH@EHALCHGA@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ DB '|'
	DB	'                                                            P'
	DB	' E A K S                                                     '
	DB	'        |', 0dH, 0aH, 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_0CK@LHFIFEGD@?5?5?5?5?5?5?5?5?5?5?5Memory?5tracking?5overh@
CONST	SEGMENT
??_C@_0CK@LHFIFEGD@?5?5?5?5?5?5?5?5?5?5?5Memory?5tracking?5overh@ DB '   '
	DB	'        Memory tracking overhead: %s', 0dH, 0aH, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0CK@HNCNJKJK@?5?5?5?5?5?5?5?5?5Actual?5total?5memory?5in?5@
CONST	SEGMENT
??_C@_0CK@HNCNJKJK@?5?5?5?5?5?5?5?5?5Actual?5total?5memory?5in?5@ DB '   '
	DB	'      Actual total memory in use: %s', 0dH, 0aH, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0CK@GNEAPJDK@?5?5?5?5?5?5?5?5?5?5?5?5Reported?5to?5applicat@
CONST	SEGMENT
??_C@_0CK@GNEAPJDK@?5?5?5?5?5?5?5?5?5?5?5?5Reported?5to?5applicat@ DB '  '
	DB	'          Reported to application: %s', 0dH, 0aH, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0CM@EFENNOEI@?5?5?5?5?5?5?5?5?5?5?5?5?5?5Allocation?5unit?5co@
CONST	SEGMENT
??_C@_0CM@EFENNOEI@?5?5?5?5?5?5?5?5?5?5?5?5?5?5Allocation?5unit?5co@ DB ' '
	DB	'             Allocation unit count: %10s', 0dH, 0aH, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0IH@JCFEOJNN@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
CONST	SEGMENT
??_C@_0IH@JCFEOJNN@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ DB '|'
	DB	'                                                           T '
	DB	'O T A L S                                                    '
	DB	'        |', 0dH, 0aH, 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_0JB@GPNPDKPP@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
CONST	SEGMENT
??_C@_0JB@GPNPDKPP@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@ DB '|'
	DB	'                                             Memory report fo'
	DB	'r: %02d/%02d/%04d %02d:%02d:%02d                             '
	DB	'                  |', 0dH, 0aH, 00H		; `string'
; Function compile flags: /Ogtpy
; File d:\source code\stgm\mmgr.cpp
CONST	ENDS
;	COMDAT ?m_dumpMemoryReport@@YAXPBD_N@Z
_TEXT	SEGMENT
_t$ = -8						; size = 8
_filename$ = 8						; size = 4
_overwrite$ = 12					; size = 1
?m_dumpMemoryReport@@YAXPBD_N@Z PROC			; m_dumpMemoryReport, COMDAT

; 1772 : {

	sub	esp, 8

; 1773 : 	// Open the report file
; 1774 : 
; 1775 : 	FILE	*fp = NULL;
; 1776 : 	
; 1777 : 	if (overwrite)	fp = fopen(filename, "w+b");

	cmp	BYTE PTR _overwrite$[esp+4], 0
	push	esi
	je	SHORT $LN3@m_dumpMemo
	mov	eax, DWORD PTR _filename$[esp+8]
	push	OFFSET ??_C@_03ELIABIOC@w?$CLb?$AA@
	push	eax
	jmp	SHORT $LN10@m_dumpMemo
$LN3@m_dumpMemo:

; 1778 : 	else		fp = fopen(filename, "ab");

	mov	ecx, DWORD PTR _filename$[esp+8]
	push	OFFSET ??_C@_02BOGAIONP@ab?$AA@
	push	ecx
$LN10@m_dumpMemo:
	call	_fopen
	mov	esi, eax
	add	esp, 8

; 1779 : 
; 1780 : 	// If you hit this assert, then the memory report generator is unable to log information to a file (can't open the file for
; 1781 : 	// some reason.)
; 1782 : 	m_assert(fp);
; 1783 : 	if (!fp) return;

	test	esi, esi
	je	$LN4@m_dumpMemo

; 1784 : 
; 1785 :         // Header
; 1786 : 
; 1787 :         static  char    timeString[25];
; 1788 :         memset(timeString, 0, sizeof(timeString));

	xor	eax, eax
	push	edi

; 1789 :         time_t  t = time(NULL);

	push	eax
	mov	DWORD PTR ?timeString@?7??m_dumpMemoryReport@@YAXPBD_N@Z@4PADA, eax
	mov	DWORD PTR ?timeString@?7??m_dumpMemoryReport@@YAXPBD_N@Z@4PADA+4, eax
	mov	DWORD PTR ?timeString@?7??m_dumpMemoryReport@@YAXPBD_N@Z@4PADA+8, eax
	mov	DWORD PTR ?timeString@?7??m_dumpMemoryReport@@YAXPBD_N@Z@4PADA+12, eax
	mov	DWORD PTR ?timeString@?7??m_dumpMemoryReport@@YAXPBD_N@Z@4PADA+16, eax
	mov	DWORD PTR ?timeString@?7??m_dumpMemoryReport@@YAXPBD_N@Z@4PADA+20, eax
	mov	BYTE PTR ?timeString@?7??m_dumpMemoryReport@@YAXPBD_N@Z@4PADA+24, al
	call	__time64
	mov	DWORD PTR _t$[esp+24], edx

; 1790 :         struct  tm *tme = localtime(&t);

	lea	edx, DWORD PTR _t$[esp+20]
	push	edx
	mov	DWORD PTR _t$[esp+24], eax
	call	__localtime64

; 1791 : 	fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	mov	edi, eax
	call	_fprintf

; 1792 :         fprintf(fp, "|                                             Memory report for: %02d/%02d/%04d %02d:%02d:%02d                                               |\r\n", tme->tm_mon + 1, tme->tm_mday, tme->tm_year + 1900, tme->tm_hour, tme->tm_min, tme->tm_sec);

	mov	eax, DWORD PTR [edi]
	mov	ecx, DWORD PTR [edi+4]
	mov	edx, DWORD PTR [edi+8]
	push	eax
	mov	eax, DWORD PTR [edi+20]
	push	ecx
	mov	ecx, DWORD PTR [edi+12]
	push	edx
	mov	edx, DWORD PTR [edi+16]
	add	eax, 1900				; 0000076cH
	push	eax
	push	ecx
	add	edx, 1
	push	edx
	push	OFFSET ??_C@_0JB@GPNPDKPP@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
	push	esi
	call	_fprintf

; 1793 : 	fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	call	_fprintf

; 1794 : 	fprintf(fp, "\r\n");

	push	OFFSET ??_C@_02PCIJFNDE@?$AN?6?$AA@
	push	esi
	call	_fprintf
	add	esp, 64					; 00000040H

; 1795 : 	fprintf(fp, "\r\n");

	push	OFFSET ??_C@_02PCIJFNDE@?$AN?6?$AA@
	push	esi
	call	_fprintf

; 1796 : 
; 1797 : 	// Report summary
; 1798 : 
; 1799 : 	fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	call	_fprintf

; 1800 : 	fprintf(fp, "|                                                           T O T A L S                                                            |\r\n");

	push	OFFSET ??_C@_0IH@JCFEOJNN@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
	push	esi
	call	_fprintf

; 1801 : 	fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	call	_fprintf

; 1802 : 	fprintf(fp, "              Allocation unit count: %10s\r\n", insertCommas(stats.totalAllocUnitCount));

	mov	eax, DWORD PTR _stats+28
	push	eax
	call	?insertCommas@@YAPBDI@Z			; insertCommas
	push	eax
	push	OFFSET ??_C@_0CM@EFENNOEI@?5?5?5?5?5?5?5?5?5?5?5?5?5?5Allocation?5unit?5co@
	push	esi
	call	_fprintf

; 1803 : 	fprintf(fp, "            Reported to application: %s\r\n", memorySizeString(stats.totalReportedMemory));

	mov	eax, DWORD PTR _stats
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	push	OFFSET ??_C@_0CK@GNEAPJDK@?5?5?5?5?5?5?5?5?5?5?5?5Reported?5to?5applicat@
	push	esi
	call	_fprintf

; 1804 : 	fprintf(fp, "         Actual total memory in use: %s\r\n", memorySizeString(stats.totalActualMemory));

	mov	eax, DWORD PTR _stats+4
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	push	OFFSET ??_C@_0CK@HNCNJKJK@?5?5?5?5?5?5?5?5?5Actual?5total?5memory?5in?5@
	push	esi
	call	_fprintf

; 1805 : 	fprintf(fp, "           Memory tracking overhead: %s\r\n", memorySizeString(stats.totalActualMemory - stats.totalReportedMemory));

	mov	eax, DWORD PTR _stats+4
	sub	eax, DWORD PTR _stats
	add	esp, 72					; 00000048H
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	push	OFFSET ??_C@_0CK@LHFIFEGD@?5?5?5?5?5?5?5?5?5?5?5Memory?5tracking?5overh@
	push	esi
	call	_fprintf

; 1806 : 	fprintf(fp, "\r\n");

	push	OFFSET ??_C@_02PCIJFNDE@?$AN?6?$AA@
	push	esi
	call	_fprintf

; 1807 : 
; 1808 : 	fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	call	_fprintf

; 1809 : 	fprintf(fp, "|                                                            P E A K S                                                             |\r\n");

	push	OFFSET ??_C@_0IH@EHALCHGA@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
	push	esi
	call	_fprintf

; 1810 : 	fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	call	_fprintf

; 1811 : 	fprintf(fp, "              Allocation unit count: %10s\r\n", insertCommas(stats.peakAllocUnitCount));

	mov	ecx, DWORD PTR _stats+32
	push	ecx
	call	?insertCommas@@YAPBDI@Z			; insertCommas
	push	eax
	push	OFFSET ??_C@_0CM@EFENNOEI@?5?5?5?5?5?5?5?5?5?5?5?5?5?5Allocation?5unit?5co@
	push	esi
	call	_fprintf

; 1812 : 	fprintf(fp, "            Reported to application: %s\r\n", memorySizeString(stats.peakReportedMemory));

	mov	eax, DWORD PTR _stats+8
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	push	OFFSET ??_C@_0CK@GNEAPJDK@?5?5?5?5?5?5?5?5?5?5?5?5Reported?5to?5applicat@
	push	esi
	call	_fprintf

; 1813 : 	fprintf(fp, "                             Actual: %s\r\n", memorySizeString(stats.peakActualMemory));

	mov	eax, DWORD PTR _stats+12
	add	esp, 72					; 00000048H
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	push	OFFSET ??_C@_0CK@GJNDODIF@?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5Act@
	push	esi
	call	_fprintf

; 1814 : 	fprintf(fp, "           Memory tracking overhead: %s\r\n", memorySizeString(stats.peakActualMemory - stats.peakReportedMemory));

	mov	eax, DWORD PTR _stats+12
	sub	eax, DWORD PTR _stats+8
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	push	OFFSET ??_C@_0CK@LHFIFEGD@?5?5?5?5?5?5?5?5?5?5?5Memory?5tracking?5overh@
	push	esi
	call	_fprintf

; 1815 : 	fprintf(fp, "\r\n");

	push	OFFSET ??_C@_02PCIJFNDE@?$AN?6?$AA@
	push	esi
	call	_fprintf

; 1816 : 
; 1817 : 	fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	call	_fprintf

; 1818 : 	fprintf(fp, "|                                                      A C C U M U L A T E D                                                       |\r\n");

	push	OFFSET ??_C@_0IH@NLOIOPFJ@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
	push	esi
	call	_fprintf

; 1819 : 	fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	call	_fprintf

; 1820 : 	fprintf(fp, "              Allocation unit count: %s\r\n", memorySizeString(stats.accumulatedAllocUnitCount));

	mov	eax, DWORD PTR _stats+24
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	push	OFFSET ??_C@_0CK@MNFBOOLB@?5?5?5?5?5?5?5?5?5?5?5?5?5?5Allocation?5unit?5co@
	push	esi
	call	_fprintf

; 1821 : 	fprintf(fp, "            Reported to application: %s\r\n", memorySizeString(stats.accumulatedReportedMemory));

	mov	eax, DWORD PTR _stats+16
	add	esp, 68					; 00000044H
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	push	OFFSET ??_C@_0CK@GNEAPJDK@?5?5?5?5?5?5?5?5?5?5?5?5Reported?5to?5applicat@
	push	esi
	call	_fprintf

; 1822 : 	fprintf(fp, "                             Actual: %s\r\n", memorySizeString(stats.accumulatedActualMemory));

	mov	eax, DWORD PTR _stats+20
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	push	OFFSET ??_C@_0CK@GJNDODIF@?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5Act@
	push	esi
	call	_fprintf

; 1823 : 	fprintf(fp, "\r\n");

	push	OFFSET ??_C@_02PCIJFNDE@?$AN?6?$AA@
	push	esi
	call	_fprintf

; 1824 : 
; 1825 : 	fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	call	_fprintf

; 1826 : 	fprintf(fp, "|                                                           U N U S E D                                                            |\r\n");

	push	OFFSET ??_C@_0IH@GEDMMLFG@?$HM?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5?5@
	push	esi
	call	_fprintf

; 1827 : 	fprintf(fp, " ---------------------------------------------------------------------------------------------------------------------------------- \r\n");

	push	OFFSET ??_C@_0IH@HEAGFCDP@?5?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9@
	push	esi
	call	_fprintf

; 1828 : 	fprintf(fp, "    Memory allocated but not in use: %s\r\n", memorySizeString(m_calcAllUnused()));

	call	?m_calcAllUnused@@YAIXZ			; m_calcAllUnused
	call	?memorySizeString@@YAPBDK@Z		; memorySizeString
	push	eax
	push	OFFSET ??_C@_0CK@MMANFKAE@?5?5?5?5Memory?5allocated?5but?5not?5in?5@
	push	esi
	call	_fprintf
	add	esp, 68					; 00000044H

; 1829 : 	fprintf(fp, "\r\n\r\n\r\n");

	push	OFFSET ??_C@_06MHMFDNCL@?$AN?6?$AN?6?$AN?6?$AA@
	push	esi
	call	_fprintf

; 1830 : 
; 1831 : 	dumpAllocations(fp); // Redundant, output to leak log anyways.

	push	esi
	call	?dumpAllocations@@YAXPAU_iobuf@@@Z	; dumpAllocations

; 1832 : 
; 1833 : 	fclose(fp);

	push	esi
	call	_fclose
	add	esp, 16					; 00000010H
	pop	edi
$LN4@m_dumpMemo:
	pop	esi

; 1834 : }

	add	esp, 8
	ret	0
?m_dumpMemoryReport@@YAXPBD_N@Z ENDP			; m_dumpMemoryReport
_TEXT	ENDS
PUBLIC	??_C@_0O@FFNIAOFD@memreport?4log?$AA@		; `string'
PUBLIC	?m_dumpLog@@YAXXZ				; m_dumpLog
;	COMDAT ??_C@_0O@FFNIAOFD@memreport?4log?$AA@
CONST	SEGMENT
??_C@_0O@FFNIAOFD@memreport?4log?$AA@ DB 'memreport.log', 00H ; `string'
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ?m_dumpLog@@YAXXZ
_TEXT	SEGMENT
?m_dumpLog@@YAXXZ PROC					; m_dumpLog, COMDAT

; 1838 : 	m_dumpMemoryReport("memreport.log",true);

	push	1
	push	OFFSET ??_C@_0O@FFNIAOFD@memreport?4log?$AA@
	call	?m_dumpMemoryReport@@YAXPBD_N@Z		; m_dumpMemoryReport
	add	esp, 8

; 1839 : }

	ret	0
?m_dumpLog@@YAXXZ ENDP					; m_dumpLog
_TEXT	ENDS
PUBLIC	?deallocate@?$_DebugHeapAllocator@D@std@@QAEXPADI@Z ; std::_DebugHeapAllocator<char>::deallocate
; Function compile flags: /Ogtpy
; File c:\program files\microsoft visual studio 8\vc\include\xdebug
;	COMDAT ?deallocate@?$_DebugHeapAllocator@D@std@@QAEXPADI@Z
_TEXT	SEGMENT
__Ptr$ = 8						; size = 4
___formal$ = 12						; size = 4
?deallocate@?$_DebugHeapAllocator@D@std@@QAEXPADI@Z PROC ; std::_DebugHeapAllocator<char>::deallocate, COMDAT
; _this$ = ecx

; 102  : 		_DELETE_CRT_VEC(_Ptr);

	mov	eax, DWORD PTR __Ptr$[esp-4]
	test	eax, eax
	je	SHORT $LN3@deallocate
	push	eax
	call	_free
	pop	ecx
$LN3@deallocate:

; 103  : 		}

	ret	8
?deallocate@?$_DebugHeapAllocator@D@std@@QAEXPADI@Z ENDP ; std::_DebugHeapAllocator<char>::deallocate
_TEXT	ENDS
PUBLIC	??0?$_DebugHeapAllocator@D@std@@QAE@XZ		; std::_DebugHeapAllocator<char>::_DebugHeapAllocator<char>
; Function compile flags: /Ogtpy
;	COMDAT ??0?$_DebugHeapAllocator@D@std@@QAE@XZ
_TEXT	SEGMENT
??0?$_DebugHeapAllocator@D@std@@QAE@XZ PROC		; std::_DebugHeapAllocator<char>::_DebugHeapAllocator<char>, COMDAT
; _this$ = ecx
	mov	eax, ecx
	ret	0
??0?$_DebugHeapAllocator@D@std@@QAE@XZ ENDP		; std::_DebugHeapAllocator<char>::_DebugHeapAllocator<char>
_TEXT	ENDS
PUBLIC	??0?$_DebugHeapAllocator@D@std@@QAE@ABV01@@Z	; std::_DebugHeapAllocator<char>::_DebugHeapAllocator<char>
; Function compile flags: /Ogtpy
;	COMDAT ??0?$_DebugHeapAllocator@D@std@@QAE@ABV01@@Z
_TEXT	SEGMENT
___that$ = 8						; size = 4
??0?$_DebugHeapAllocator@D@std@@QAE@ABV01@@Z PROC	; std::_DebugHeapAllocator<char>::_DebugHeapAllocator<char>, COMDAT
; _this$ = ecx
	mov	eax, ecx
	ret	4
??0?$_DebugHeapAllocator@D@std@@QAE@ABV01@@Z ENDP	; std::_DebugHeapAllocator<char>::_DebugHeapAllocator<char>
_TEXT	ENDS
PUBLIC	??_C@_0EA@NNGJFDCD@?$FL?$CB?$FN?5A?5memory?5allocation?5unit?5was@ ; `string'
PUBLIC	??_C@_02KNHHEEKP@?5?5?$AA@			; `string'
PUBLIC	??_C@_0EB@JANJBPCM@?$FL?$CB?$FN?5A?5memory?5allocation?5unit?5was@ ; `string'
PUBLIC	?m_validateAllocUnit@@YA_NPBUtag_au@@@Z		; m_validateAllocUnit
;	COMDAT ??_C@_0EA@NNGJFDCD@?$FL?$CB?$FN?5A?5memory?5allocation?5unit?5was@
; File d:\source code\stgm\mmgr.cpp
CONST	SEGMENT
??_C@_0EA@NNGJFDCD@?$FL?$CB?$FN?5A?5memory?5allocation?5unit?5was@ DB '[!'
	DB	'] A memory allocation unit was corrupt because of an overrun:'
	DB	00H						; `string'
CONST	ENDS
;	COMDAT ??_C@_02KNHHEEKP@?5?5?$AA@
CONST	SEGMENT
??_C@_02KNHHEEKP@?5?5?$AA@ DB '  ', 00H			; `string'
CONST	ENDS
;	COMDAT ??_C@_0EB@JANJBPCM@?$FL?$CB?$FN?5A?5memory?5allocation?5unit?5was@
CONST	SEGMENT
??_C@_0EB@JANJBPCM@?$FL?$CB?$FN?5A?5memory?5allocation?5unit?5was@ DB '[!'
	DB	'] A memory allocation unit was corrupt because of an underrun'
	DB	':', 00H					; `string'
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ?m_validateAllocUnit@@YA_NPBUtag_au@@@Z
_TEXT	SEGMENT
_allocUnit$ = 8						; size = 4
?m_validateAllocUnit@@YA_NPBUtag_au@@@Z PROC		; m_validateAllocUnit, COMDAT

; 1632 : {

	push	ebx
	push	ebp
	push	esi

; 1633 : 	// Make sure the padding is untouched
; 1634 : 
; 1635 : 	long	*pre = reinterpret_cast<long *>(allocUnit->actualAddress);

	mov	esi, DWORD PTR _allocUnit$[esp+8]

; 1636 : 	long	*post = reinterpret_cast<long *>((char *)allocUnit->actualAddress + allocUnit->actualSize - paddingSize * sizeof(long));

	mov	eax, DWORD PTR [esi]
	push	edi
	mov	edi, DWORD PTR [esi+8]
	lea	ebx, DWORD PTR [edi+eax-16]

; 1637 : 	bool	errorFlag = false;

	xor	al, al
	mov	ebp, 4
	npad	8
$LL5@m_validate@2:

; 1638 : 	for (unsigned int i = 0; i < paddingSize; i++, pre++, post++)
; 1639 : 	{
; 1640 : 		if (*pre != (long) prefixPattern)

	mov	ecx, DWORD PTR [edi]
	cmp	ecx, DWORD PTR _prefixPattern
	je	SHORT $LN2@m_validate@2

; 1641 : 		{
; 1642 : 			log("[!] A memory allocation unit was corrupt because of an underrun:");

	push	OFFSET ??_C@_0EB@JANJBPCM@?$FL?$CB?$FN?5A?5memory?5allocation?5unit?5was@
	call	?log@@YAXPBDZZ				; log

; 1643 : 			m_dumpAllocUnit(allocUnit, "  ");

	push	OFFSET ??_C@_02KNHHEEKP@?5?5?$AA@
	push	esi
	call	?m_dumpAllocUnit@@YAXPBUtag_au@@PBD@Z	; m_dumpAllocUnit
	add	esp, 12					; 0000000cH

; 1644 : 			errorFlag = true;

	mov	al, 1
$LN2@m_validate@2:

; 1645 : 		}
; 1646 : 
; 1647 : 		// If you hit this assert, then you should know that this allocation unit has been damaged. Something (possibly the
; 1648 : 		// owner?) has underrun the allocation unit (modified a few bytes prior to the start). You can interrogate the
; 1649 : 		// variable 'allocUnit' to see statistics and information about this damaged allocation unit.
; 1650 : 		m_assert(*pre == static_cast<long>(prefixPattern));
; 1651 : 
; 1652 : 		if (*post != static_cast<long>(postfixPattern))

	mov	edx, DWORD PTR [ebx]
	cmp	edx, DWORD PTR _postfixPattern
	je	SHORT $LN4@m_validate@2

; 1653 : 		{
; 1654 : 			log("[!] A memory allocation unit was corrupt because of an overrun:");

	push	OFFSET ??_C@_0EA@NNGJFDCD@?$FL?$CB?$FN?5A?5memory?5allocation?5unit?5was@
	call	?log@@YAXPBDZZ				; log

; 1655 : 			m_dumpAllocUnit(allocUnit, "  ");

	push	OFFSET ??_C@_02KNHHEEKP@?5?5?$AA@
	push	esi
	call	?m_dumpAllocUnit@@YAXPBUtag_au@@PBD@Z	; m_dumpAllocUnit
	add	esp, 12					; 0000000cH

; 1656 : 			errorFlag = true;

	mov	al, 1
$LN4@m_validate@2:
	add	edi, 4
	add	ebx, 4
	sub	ebp, 1
	jne	SHORT $LL5@m_validate@2
	pop	edi

; 1657 : 		}
; 1658 : 
; 1659 : 		// If you hit this assert, then you should know that this allocation unit has been damaged. Something (possibly the
; 1660 : 		// owner?) has overrun the allocation unit (modified a few bytes after the end). You can interrogate the variable
; 1661 : 		// 'allocUnit' to see statistics and information about this damaged allocation unit.
; 1662 : 		m_assert(*post == static_cast<long>(postfixPattern));
; 1663 : 	}
; 1664 : 
; 1665 : 	// Return the error status (we invert it, because a return of 'false' means error)
; 1666 : 
; 1667 : 	return !errorFlag;

	xor	ecx, ecx
	test	al, al
	pop	esi
	sete	cl
	pop	ebp
	mov	al, cl
	pop	ebx

; 1668 : }

	ret	0
?m_validateAllocUnit@@YA_NPBUtag_au@@@Z ENDP		; m_validateAllocUnit
_TEXT	ENDS
PUBLIC	??_C@_0FM@IJIPEMGF@?$FL?$CB?$FN?5While?5validting?5all?5allocati@ ; `string'
PUBLIC	??_C@_0CI@KBFDECIH@?$FL?$CB?$FN?5Memory?5tracking?5hash?5table?5c@ ; `string'
PUBLIC	?m_validateAllAllocUnits@@YA_NXZ		; m_validateAllAllocUnits
;	COMDAT ??_C@_0FM@IJIPEMGF@?$FL?$CB?$FN?5While?5validting?5all?5allocati@
CONST	SEGMENT
??_C@_0FM@IJIPEMGF@?$FL?$CB?$FN?5While?5validting?5all?5allocati@ DB '[!]'
	DB	' While validting all allocation units, %d allocation unit(s) '
	DB	'were found to have problems', 00H		; `string'
CONST	ENDS
;	COMDAT ??_C@_0CI@KBFDECIH@?$FL?$CB?$FN?5Memory?5tracking?5hash?5table?5c@
CONST	SEGMENT
??_C@_0CI@KBFDECIH@?$FL?$CB?$FN?5Memory?5tracking?5hash?5table?5c@ DB '[!'
	DB	'] Memory tracking hash table corrupt!', 00H	; `string'
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ?m_validateAllAllocUnits@@YA_NXZ
_TEXT	SEGMENT
?m_validateAllAllocUnits@@YA_NXZ PROC			; m_validateAllAllocUnits, COMDAT

; 1673 : {

	push	ebx
	push	ebp
	push	esi
	push	edi

; 1674 : 	// Just go through each allocation unit in the hash table and count the ones that have errors
; 1675 : 
; 1676 : 	unsigned int	errors = 0;

	xor	ebp, ebp

; 1677 : 	unsigned int	allocCount = 0;

	xor	ebx, ebx

; 1678 : 	for (unsigned int i = 0; i < hashSize; i++)

	xor	edi, edi
	npad	6
$LL15@m_validate@3:

; 1679 : 	{
; 1680 : 		sAllocUnit	*ptr = hashTable[i];

	mov	esi, DWORD PTR _hashTable[edi]

; 1681 : 		while(ptr)

	test	esi, esi
	je	SHORT $LN7@m_validate@3
	npad	6
$LL5@m_validate@3:

; 1682 : 		{
; 1683 : 			allocCount++;
; 1684 : 			if (!m_validateAllocUnit(ptr)) errors++;

	push	esi
	add	ebx, 1
	call	?m_validateAllocUnit@@YA_NPBUtag_au@@@Z	; m_validateAllocUnit
	add	esp, 4
	test	al, al
	jne	SHORT $LN3@m_validate@3
	add	ebp, 1
$LN3@m_validate@3:

; 1685 : 			ptr = ptr->next;

	mov	esi, DWORD PTR [esi+116]
	test	esi, esi
	jne	SHORT $LL5@m_validate@3
$LN7@m_validate@3:

; 1678 : 	for (unsigned int i = 0; i < hashSize; i++)

	add	edi, 4
	cmp	edi, 16384				; 00004000H
	jb	SHORT $LL15@m_validate@3

; 1686 : 		}
; 1687 : 	}
; 1688 : 
; 1689 : 	// Test for hash-table correctness
; 1690 : 
; 1691 : 	if (allocCount != stats.totalAllocUnitCount)

	cmp	ebx, DWORD PTR _stats+28
	je	SHORT $LN2@m_validate@3

; 1692 : 	{
; 1693 : 		log("[!] Memory tracking hash table corrupt!");

	push	OFFSET ??_C@_0CI@KBFDECIH@?$FL?$CB?$FN?5Memory?5tracking?5hash?5table?5c@
	call	?log@@YAXPBDZZ				; log
	add	esp, 4

; 1694 : 		errors++;

	add	ebp, 1
$LN2@m_validate@3:

; 1695 : 	}
; 1696 : 
; 1697 : 	// If you hit this assert, then the internal memory (hash table) used by this memory tracking software is damaged! The
; 1698 : 	// best way to track this down is to use the alwaysLogAll flag in conjunction with STRESS_TEST macro to narrow in on the
; 1699 : 	// offending code. After running the application with these settings (and hitting this assert again), interrogate the
; 1700 : 	// memory.log file to find the previous successful operation. The corruption will have occurred between that point and this
; 1701 : 	// assertion.
; 1702 : 	m_assert(allocCount == stats.totalAllocUnitCount);
; 1703 : 
; 1704 : 	// If you hit this assert, then you've probably already been notified that there was a problem with a allocation unit in a
; 1705 : 	// prior call to validateAllocUnit(), but this assert is here just to make sure you know about it. :)
; 1706 : 	m_assert(errors == 0);
; 1707 : 
; 1708 : 	// Log any errors
; 1709 : 
; 1710 : 	if (errors) log("[!] While validting all allocation units, %d allocation unit(s) were found to have problems", errors);

	test	ebp, ebp
	je	SHORT $LN1@m_validate@3
	push	ebp
	push	OFFSET ??_C@_0FM@IJIPEMGF@?$FL?$CB?$FN?5While?5validting?5all?5allocati@
	call	?log@@YAXPBDZZ				; log
	add	esp, 8
$LN1@m_validate@3:
	pop	edi

; 1711 : 
; 1712 : 	// Return the error status
; 1713 : 
; 1714 : 	return errors != 0;

	xor	eax, eax
	pop	esi
	test	ebp, ebp
	pop	ebp
	setne	al
	pop	ebx

; 1715 : }

	ret	0
?m_validateAllAllocUnits@@YA_NXZ ENDP			; m_validateAllAllocUnits
_TEXT	ENDS
PUBLIC	??_C@_06NFJEEBCF@?$FL?$CB?$FN?5?$CFs?$AA@	; `string'
PUBLIC	??_C@_0CE@KIHEFDMN@?$FL?$CL?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5thread?50x?$CF@ ; `string'
PUBLIC	??_C@_0CC@CJLIKJAD@?$FL?$CL?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5addr?50x?$CF08@ ; `string'
PUBLIC	??_C@_0CO@JPACDFFD@Request?5for?5allocation?5failed?4?5O@ ; `string'
PUBLIC	??_C@_0DJ@MHMMEBFJ@Unable?5to?5allocate?5RAM?5for?5inter@ ; `string'
PUBLIC	__TI2PAD
PUBLIC	??_C@_0CI@NEDJGDHO@?$FL?$CL?$FN?5?$CF05d?5?$CF8s?5of?5size?50x?$CF08X?$CI?$CF08d@ ; `string'
PUBLIC	?m_allocator@@YAPAXPBDI0II@Z			; m_allocator
PUBLIC	??_R0PAD@8					; char * `RTTI Type Descriptor'
PUBLIC	__CTA2PAD
PUBLIC	__CT??_R0PAD@84
PUBLIC	__CT??_R0PAX@84
PUBLIC	??_R0PAX@8					; void * `RTTI Type Descriptor'
EXTRN	__imp__LeaveCriticalSection@4:PROC
EXTRN	_strncpy:PROC
EXTRN	__imp__GetCurrentThreadId@0:PROC
EXTRN	_realloc:PROC
EXTRN	?AllocMemory@@YAPAXI@Z:PROC			; AllocMemory
EXTRN	__imp__EnterCriticalSection@4:PROC
EXTRN	__imp__InitializeCriticalSection@4:PROC
EXTRN	___CxxFrameHandler3:PROC
;	COMDAT ??_R0PAX@8
_DATA	SEGMENT
??_R0PAX@8 DD	FLAT:??_7type_info@@6B@			; void * `RTTI Type Descriptor'
	DD	00H
	DB	'.PAX', 00H
_DATA	ENDS
;	COMDAT __CT??_R0PAX@84
xdata$x	SEGMENT
__CT??_R0PAX@84 DD 01H
	DD	FLAT:??_R0PAX@8
	DD	00H
	DD	0ffffffffH
	ORG $+4
	DD	04H
	DD	00H
xdata$x	ENDS
;	COMDAT __CT??_R0PAD@84
xdata$x	SEGMENT
__CT??_R0PAD@84 DD 01H
	DD	FLAT:??_R0PAD@8
	DD	00H
	DD	0ffffffffH
	ORG $+4
	DD	04H
	DD	00H
xdata$x	ENDS
;	COMDAT __CTA2PAD
xdata$x	SEGMENT
__CTA2PAD DD	02H
	DD	FLAT:__CT??_R0PAD@84
	DD	FLAT:__CT??_R0PAX@84
xdata$x	ENDS
;	COMDAT ??_R0PAD@8
_DATA	SEGMENT
??_R0PAD@8 DD	FLAT:??_7type_info@@6B@			; char * `RTTI Type Descriptor'
	DD	00H
	DB	'.PAD', 00H
_DATA	ENDS
;	COMDAT ??_C@_06NFJEEBCF@?$FL?$CB?$FN?5?$CFs?$AA@
CONST	SEGMENT
??_C@_06NFJEEBCF@?$FL?$CB?$FN?5?$CFs?$AA@ DB '[!] %s', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0CE@KIHEFDMN@?$FL?$CL?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5thread?50x?$CF@
CONST	SEGMENT
??_C@_0CE@KIHEFDMN@?$FL?$CL?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5thread?50x?$CF@ DB '['
	DB	'+] ---->             thread 0x%08X', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_0CC@CJLIKJAD@?$FL?$CL?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5addr?50x?$CF08@
CONST	SEGMENT
??_C@_0CC@CJLIKJAD@?$FL?$CL?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5addr?50x?$CF08@ DB '['
	DB	'+] ---->             addr 0x%08X', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_0CO@JPACDFFD@Request?5for?5allocation?5failed?4?5O@
CONST	SEGMENT
??_C@_0CO@JPACDFFD@Request?5for?5allocation?5failed?4?5O@ DB 'Request for'
	DB	' allocation failed. Out of memory.', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_0DJ@MHMMEBFJ@Unable?5to?5allocate?5RAM?5for?5inter@
CONST	SEGMENT
??_C@_0DJ@MHMMEBFJ@Unable?5to?5allocate?5RAM?5for?5inter@ DB 'Unable to a'
	DB	'llocate RAM for internal memory tracking data', 00H ; `string'
CONST	ENDS
;	COMDAT __TI2PAD
xdata$x	SEGMENT
__TI2PAD DD	00H
	DD	00H
	DD	00H
	DD	FLAT:__CTA2PAD
xdata$x	ENDS
;	COMDAT ??_C@_0CI@NEDJGDHO@?$FL?$CL?$FN?5?$CF05d?5?$CF8s?5of?5size?50x?$CF08X?$CI?$CF08d@
CONST	SEGMENT
??_C@_0CI@NEDJGDHO@?$FL?$CL?$FN?5?$CF05d?5?$CF8s?5of?5size?50x?$CF08X?$CI?$CF08d@ DB '['
	DB	'+] %05d %8s of size 0x%08X(%08d) by %s', 00H ; `string'
CONST	ENDS
;	COMDAT xdata$x
xdata$x	SEGMENT
__catchsym$?m_allocator@@YAPAXPBDI0II@Z$2 DD 01H
	DD	FLAT:??_R0PAD@8
	DD	0ffffffe0H
	DD	FLAT:__catch$?m_allocator@@YAPAXPBDI0II@Z$0
__unwindtable$?m_allocator@@YAPAXPBDI0II@Z DD 0ffffffffH
	DD	00H
	DD	0ffffffffH
	DD	00H
__tryblocktable$?m_allocator@@YAPAXPBDI0II@Z DD 00H
	DD	00H
	DD	01H
	DD	01H
	DD	FLAT:__catchsym$?m_allocator@@YAPAXPBDI0II@Z$2
__ehfuncinfo$?m_allocator@@YAPAXPBDI0II@Z DD 019930522H
	DD	02H
	DD	FLAT:__unwindtable$?m_allocator@@YAPAXPBDI0II@Z
	DD	01H
	DD	FLAT:__tryblocktable$?m_allocator@@YAPAXPBDI0II@Z
	DD	2 DUP(00H)
	DD	00H
	DD	01H
; Function compile flags: /Ogtpy
xdata$x	ENDS
;	COMDAT ?m_allocator@@YAPAXPBDI0II@Z
_TEXT	SEGMENT
_err$38019 = -32					; size = 4
tv478 = -28						; size = 4
$T41489 = -24						; size = 4
$T41488 = -20						; size = 4
__$EHRec$ = -16						; size = 16
_sourceFile$ = 8					; size = 4
_sourceLine$ = 12					; size = 4
_sourceFunc$ = 16					; size = 4
_allocationType$ = 20					; size = 4
_reportedSize$ = 24					; size = 4
?m_allocator@@YAPAXPBDI0II@Z PROC			; m_allocator, COMDAT

; 1104 : {

	push	ebp
	mov	ebp, esp
	push	-1
	push	__ehhandler$?m_allocator@@YAPAXPBDI0II@Z
	mov	eax, DWORD PTR fs:0
	push	eax
	mov	DWORD PTR fs:0, esp
	sub	esp, 20					; 00000014H

; 1105 : 	if (!criticalInitialized)

	cmp	BYTE PTR ?criticalInitialized@@3_NA, 0	; criticalInitialized
	push	ebx
	push	esi
	push	edi
	mov	DWORD PTR __$EHRec$[ebp], esp
	jne	SHORT $LN21@m_allocato

; 1106 : 	{
; 1107 : 		InitializeCriticalSection(&criticalSection);

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__InitializeCriticalSection@4

; 1108 : 		criticalInitialized = true;

	mov	BYTE PTR ?criticalInitialized@@3_NA, 1	; criticalInitialized
$LN21@m_allocato:

; 1109 : 	}
; 1110 : 	EnterCriticalSection(&criticalSection);	

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__EnterCriticalSection@4

; 1111 : 	try
; 1112 : 	{
; 1113 : 		#ifdef TEST_MEMORY_MANAGER
; 1114 : 		log("[D] ENTER: m_allocator()");
; 1115 : 		#endif
; 1116 : 
; 1117 : 		// Increase our allocation count
; 1118 : 
; 1119 : 		currentAllocationCount++;

	add	DWORD PTR _currentAllocationCount, 1

; 1120 : 
; 1121 : 		// Log the request
; 1122 : 
; 1123 : 		if (alwaysLogAll) log("[+] %05d %8s of size 0x%08X(%08d) by %s", currentAllocationCount, allocationTypes[allocationType], reportedSize, reportedSize, ownerString(sourceFile, sourceLine, sourceFunc));

	cmp	BYTE PTR _alwaysLogAll, 0
	mov	edi, DWORD PTR _sourceFile$[ebp]
	mov	DWORD PTR __$EHRec$[ebp+12], 0
	je	SHORT $LN42@m_allocato
	mov	eax, DWORD PTR _sourceFunc$[ebp]
	mov	ecx, DWORD PTR _sourceLine$[ebp]
	push	eax
	push	ecx
	mov	eax, edi
	call	?ownerString@@YAPBDPBDI0@Z		; ownerString
	mov	ebx, DWORD PTR _reportedSize$[ebp]
	mov	edx, DWORD PTR _allocationType$[ebp]
	mov	ecx, DWORD PTR _currentAllocationCount
	push	eax
	mov	eax, DWORD PTR _allocationTypes[edx*4]
	push	ebx
	push	ebx
	push	eax
	push	ecx
	push	OFFSET ??_C@_0CI@NEDJGDHO@?$FL?$CL?$FN?5?$CF05d?5?$CF8s?5of?5size?50x?$CF08X?$CI?$CF08d@
	call	?log@@YAXPBDZZ				; log
	add	esp, 32					; 00000020H
	jmp	SHORT $LN19@m_allocato
$LN42@m_allocato:
	mov	ebx, DWORD PTR _reportedSize$[ebp]
$LN19@m_allocato:

; 1124 : 
; 1125 : 		// If you hit this assert, you requested a breakpoint on a specific allocation count
; 1126 : 		m_assert(currentAllocationCount != breakOnAllocationCount);
; 1127 : 
; 1128 : 		// If necessary, grow the reservoir of unused allocation units
; 1129 : 
; 1130 : 		if (!reservoir)

	mov	esi, DWORD PTR _reservoir
	test	esi, esi
	jne	$LN13@m_allocato

; 1131 : 		{
; 1132 : 			// Allocate 256 reservoir elements
; 1133 : 
; 1134 : 			reservoir = (sAllocUnit *) AllocMemory(sizeof(sAllocUnit) * 256);

	push	31744					; 00007c00H
	call	?AllocMemory@@YAPAXI@Z			; AllocMemory
	mov	esi, eax
	add	esp, 4

; 1135 : 
; 1136 : 			// If you hit this assert, then the memory manager failed to allocate internal memory for tracking the
; 1137 : 			// allocations
; 1138 : 			m_assert(reservoir != NULL);
; 1139 : 
; 1140 : 			// Danger Will Robinson!
; 1141 : 
; 1142 : 			if (reservoir == NULL) throw "Unable to allocate RAM for internal memory tracking data";

	test	esi, esi
	mov	DWORD PTR _reservoir, esi
	jne	SHORT $LN17@m_allocato
	push	OFFSET __TI2PAD
	lea	edx, DWORD PTR $T41488[ebp]
	push	edx
	mov	DWORD PTR $T41488[ebp], OFFSET ??_C@_0DJ@MHMMEBFJ@Unable?5to?5allocate?5RAM?5for?5inter@
	call	__CxxThrowException@8
$LN47@m_allocato:
$LN17@m_allocato:

; 1143 : 
; 1144 : 			// Build a linked-list of the elements in our reservoir
; 1145 : 
; 1146 : 			memset(reservoir, 0, sizeof(sAllocUnit) * 256);

	push	31744					; 00007c00H
	push	0
	push	esi
	call	_memset
	add	esp, 12					; 0000000cH

; 1147 : 			for (unsigned int i = 0; i < 256 - 1; i++)

	xor	eax, eax
$LL16@m_allocato:
	cmp	eax, 255				; 000000ffH
	jae	SHORT $LN14@m_allocato

; 1148 : 			{
; 1149 : 				reservoir[i].next = &reservoir[i+1];

	mov	ecx, eax
	imul	ecx, 124				; 0000007cH
	add	ecx, esi
	lea	edx, DWORD PTR [ecx+124]
	mov	DWORD PTR [ecx+116], edx
	add	eax, 1
	jmp	SHORT $LL16@m_allocato
$LN14@m_allocato:

; 1150 : 			}
; 1151 : 
; 1152 : 			// Add this address to our reservoirBuffer so we can free it later
; 1153 : 
; 1154 : 			sAllocUnit	**temp = (sAllocUnit **) realloc(reservoirBuffer, (reservoirBufferSize + 1) * sizeof(sAllocUnit *));

	mov	edi, DWORD PTR _reservoirBufferSize
	mov	ecx, DWORD PTR _reservoirBuffer
	lea	eax, DWORD PTR [edi*4+4]
	push	eax
	push	ecx
	call	_realloc
	add	esp, 8

; 1155 : 			m_assert(temp);
; 1156 : 			if (temp)

	test	eax, eax
	je	SHORT $LN44@m_allocato

; 1157 : 			{
; 1158 : 				reservoirBuffer = temp;
; 1159 : 				reservoirBuffer[reservoirBufferSize++] = reservoir;

	mov	DWORD PTR [eax+edi*4], esi
	add	edi, 1
	mov	DWORD PTR _reservoirBuffer, eax
	mov	DWORD PTR _reservoirBufferSize, edi
$LN44@m_allocato:
	mov	edi, DWORD PTR _sourceFile$[ebp]
$LN13@m_allocato:

; 1160 : 			}
; 1161 : 		}
; 1162 : 
; 1163 : 		// Logical flow says this should never happen...
; 1164 : 		m_assert(reservoir != NULL);
; 1165 : 
; 1166 : 		// Grab a new allocaton unit from the front of the reservoir
; 1167 : 
; 1168 : 		sAllocUnit	*au = reservoir;
; 1169 : 		reservoir = au->next;

	mov	edx, DWORD PTR [esi+116]
	lea	eax, DWORD PTR [esi+116]

; 1170 : 
; 1171 : 		// Populate it with some real data
; 1172 : 
; 1173 : 		memset(au, 0, sizeof(sAllocUnit));

	push	124					; 0000007cH
	push	0
	push	esi
	mov	DWORD PTR tv478[ebp], eax
	mov	DWORD PTR _reservoir, edx
	call	_memset

; 1174 : 		au->actualSize        = calculateActualSize(reportedSize);

	lea	eax, DWORD PTR [ebx+32]

; 1175 : 		#ifdef RANDOM_FAILURE
; 1176 : 		double	a = rand();
; 1177 : 		double	b = RAND_MAX / 100.0 * RANDOM_FAILURE;
; 1178 : 		if (a > b)
; 1179 : 		{
; 1180 : 			au->actualAddress = AllocMemory(au->actualSize);
; 1181 : 		}
; 1182 : 		else
; 1183 : 		{
; 1184 : 			log("[F] Random faiure");
; 1185 : 			au->actualAddress = NULL;
; 1186 : 		}
; 1187 : 		#else
; 1188 : 		au->actualAddress     = AllocMemory(au->actualSize);

	push	eax
	mov	DWORD PTR [esi], eax
	call	?AllocMemory@@YAPAXI@Z			; AllocMemory
	add	esp, 16					; 00000010H

; 1189 : 		#endif
; 1190 : 		au->reportedSize      = reportedSize;
; 1191 : 		au->reportedAddress   = calculateReportedAddress(au->actualAddress);

	test	eax, eax
	mov	DWORD PTR [esi+8], eax
	mov	DWORD PTR [esi+4], ebx
	je	SHORT $LN31@m_allocato
$LN30@m_allocato:
	add	eax, 16					; 00000010H
$LN31@m_allocato:

; 1192 : 		au->allocationType    = allocationType;
; 1193 : 		au->sourceLine        = sourceLine;

	mov	ecx, DWORD PTR _sourceLine$[ebp]

; 1194 : 		au->allocationNumber  = currentAllocationCount;

	mov	edx, DWORD PTR _currentAllocationCount
	mov	DWORD PTR [esi+12], eax
	mov	eax, DWORD PTR _allocationType$[ebp]
	mov	DWORD PTR [esi+100], eax
	mov	DWORD PTR [esi+96], ecx
	mov	DWORD PTR [esi+108], edx

; 1195 : 		au->threadId          = GetCurrentThreadId();

	call	DWORD PTR __imp__GetCurrentThreadId@0

; 1196 : 		if (sourceFile) strncpy(au->sourceFile, sourceFileStripper(sourceFile), sizeof(au->sourceFile) - 1);

	test	edi, edi
	mov	DWORD PTR [esi+112], eax
	je	SHORT $LN12@m_allocato
	push	92					; 0000005cH
	push	edi
	call	_strrchr
	add	esp, 8
	test	eax, eax
	je	SHORT $LN34@m_allocato
	add	eax, 1
	push	39					; 00000027H
	push	eax
	lea	eax, DWORD PTR [esi+16]
	push	eax
	call	_strncpy
	add	esp, 12					; 0000000cH
	jmp	SHORT $LN11@m_allocato
$LN34@m_allocato:
	push	47					; 0000002fH
	push	edi
	call	_strrchr
	add	esp, 8
	test	eax, eax
	je	SHORT $LN33@m_allocato
	add	eax, 1
	push	39					; 00000027H
	push	eax
	lea	eax, DWORD PTR [esi+16]
	push	eax
	call	_strncpy
	add	esp, 12					; 0000000cH
	jmp	SHORT $LN11@m_allocato
$LN33@m_allocato:
	mov	eax, edi
	push	39					; 00000027H
	push	eax
	lea	eax, DWORD PTR [esi+16]
	push	eax
	call	_strncpy
	add	esp, 12					; 0000000cH
	jmp	SHORT $LN11@m_allocato
$LN12@m_allocato:

; 1197 : 		else		strcpy (au->sourceFile, "??");

	mov	cx, WORD PTR ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	mov	WORD PTR [esi+16], cx
	mov	dl, BYTE PTR ??_C@_02HHFHKOHM@?$DP?$DP?$AA@+2
	mov	BYTE PTR [esi+18], dl
$LN11@m_allocato:

; 1198 : 		if (sourceFunc) strncpy(au->sourceFunc, sourceFunc, sizeof(au->sourceFunc) - 1);

	mov	eax, DWORD PTR _sourceFunc$[ebp]
	test	eax, eax
	je	SHORT $LN10@m_allocato
	push	39					; 00000027H
	push	eax
	lea	eax, DWORD PTR [esi+56]
	push	eax
	call	_strncpy
	add	esp, 12					; 0000000cH
	jmp	SHORT $LN9@m_allocato
$LN10@m_allocato:

; 1199 : 		else		strcpy (au->sourceFunc, "??");

	mov	cx, WORD PTR ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	mov	WORD PTR [esi+56], cx
	mov	dl, BYTE PTR ??_C@_02HHFHKOHM@?$DP?$DP?$AA@+2
	mov	BYTE PTR [esi+58], dl
$LN9@m_allocato:

; 1200 : 
; 1201 : 		// We don't want to assert with random failures, because we want the application to deal with them.
; 1202 : 
; 1203 : 		#ifndef RANDOM_FAILURE
; 1204 : 		// If you hit this assert, then the requested allocation simply failed (you're out of memory.) Interrogate the
; 1205 : 		// variable 'au' or the stack frame to see what you were trying to do.
; 1206 : 		m_assert(au->actualAddress != NULL);
; 1207 : 		#endif
; 1208 : 
; 1209 : 		if (au->actualAddress == NULL)

	cmp	DWORD PTR [esi+8], 0
	jne	SHORT $LN8@m_allocato

; 1210 : 		{
; 1211 : 			throw "Request for allocation failed. Out of memory.";

	push	OFFSET __TI2PAD
	lea	eax, DWORD PTR $T41489[ebp]
	push	eax
	mov	DWORD PTR $T41489[ebp], OFFSET ??_C@_0CO@JPACDFFD@Request?5for?5allocation?5failed?4?5O@
	call	__CxxThrowException@8
$LN48@m_allocato:
$LN8@m_allocato:

; 1212 : 		}
; 1213 : 
; 1214 : 		// If you hit this assert, then this allocation was made from a source that isn't setup to use this memory tracking
; 1215 : 		// software, use the stack frame to locate the source and include our H file.
; 1216 : 		m_assert(allocationType != m_alloc_unknown);
; 1217 : 
; 1218 : 		// Insert the new allocation into the hash table
; 1219 : 
; 1220 : 		unsigned int	hashIndex = (reinterpret_cast<unsigned int>(au->reportedAddress) >> 4) & (hashSize - 1);

	mov	eax, DWORD PTR [esi+12]
	shr	eax, 4
	and	eax, 4095				; 00000fffH

; 1221 : 		if (hashTable[hashIndex]) hashTable[hashIndex]->prev = au;

	mov	ecx, DWORD PTR _hashTable[eax*4]
	test	ecx, ecx
	je	SHORT $LN7@m_allocato
	mov	DWORD PTR [ecx+120], esi
$LN7@m_allocato:

; 1222 : 		au->next = hashTable[hashIndex];

	mov	ecx, DWORD PTR _hashTable[eax*4]
	mov	edx, DWORD PTR tv478[ebp]

; 1223 : 		au->prev = NULL;
; 1224 : 		hashTable[hashIndex] = au;
; 1225 : 
; 1226 : 		// Account for the new allocatin unit in our stats
; 1227 : 
; 1228 : 		stats.totalReportedMemory += static_cast<unsigned int>(au->reportedSize);
; 1229 : 		stats.totalActualMemory   += static_cast<unsigned int>(au->actualSize);

	mov	edi, DWORD PTR _stats+4

; 1230 : 		stats.totalAllocUnitCount++;

	mov	ebx, DWORD PTR _stats+28
	mov	DWORD PTR [edx], ecx
	mov	edx, DWORD PTR _stats
	mov	DWORD PTR [esi+120], 0
	mov	DWORD PTR _hashTable[eax*4], esi
	mov	eax, DWORD PTR [esi+4]
	mov	ecx, DWORD PTR [esi]
	add	edx, eax
	add	edi, ecx
	add	ebx, 1

; 1231 : 		if (stats.totalReportedMemory > stats.peakReportedMemory) stats.peakReportedMemory = stats.totalReportedMemory;

	cmp	edx, DWORD PTR _stats+8
	mov	DWORD PTR _stats, edx
	mov	DWORD PTR _stats+4, edi
	mov	DWORD PTR _stats+28, ebx
	jbe	SHORT $LN6@m_allocato
	mov	DWORD PTR _stats+8, edx
$LN6@m_allocato:

; 1232 : 		if (stats.totalActualMemory   > stats.peakActualMemory)   stats.peakActualMemory   = stats.totalActualMemory;

	cmp	edi, DWORD PTR _stats+12
	jbe	SHORT $LN5@m_allocato
	mov	DWORD PTR _stats+12, edi
$LN5@m_allocato:

; 1233 : 		if (stats.totalAllocUnitCount > stats.peakAllocUnitCount) stats.peakAllocUnitCount = stats.totalAllocUnitCount;

	cmp	ebx, DWORD PTR _stats+32
	jbe	SHORT $LN4@m_allocato
	mov	DWORD PTR _stats+32, ebx
$LN4@m_allocato:

; 1234 : 		stats.accumulatedReportedMemory += static_cast<unsigned int>(au->reportedSize);

	add	DWORD PTR _stats+16, eax

; 1235 : 		stats.accumulatedActualMemory += static_cast<unsigned int>(au->actualSize);

	add	DWORD PTR _stats+20, ecx

; 1236 : 		stats.accumulatedAllocUnitCount++;
; 1237 : 
; 1238 : 		// Prepare the allocation unit for use (wipe it with recognizable garbage)
; 1239 : 
; 1240 : 		wipeWithPattern(au, unusedPattern);

	mov	eax, DWORD PTR _unusedPattern
	add	DWORD PTR _stats+24, 1
	push	esi
	xor	ecx, ecx
	call	?wipeWithPattern@@YAXPAUtag_au@@KI@Z	; wipeWithPattern
	add	esp, 4

; 1241 : 
; 1242 : 		// calloc() expects the reported memory address range to be filled with 0's
; 1243 : 
; 1244 : 		if (allocationType == m_alloc_calloc)

	cmp	DWORD PTR _allocationType$[ebp], 4
	jne	SHORT $LN3@m_allocato

; 1245 : 		{
; 1246 : 			memset(au->reportedAddress, 0, au->reportedSize);

	mov	eax, DWORD PTR [esi+4]
	mov	ecx, DWORD PTR [esi+12]
	push	eax
	push	0
	push	ecx
	call	_memset
	add	esp, 12					; 0000000cH
$LN3@m_allocato:

; 1247 : 		}
; 1248 : 
; 1249 : 		// Validate every single allocated unit in memory
; 1250 : 
; 1251 : 		if (alwaysValidateAll) m_validateAllAllocUnits();

	cmp	BYTE PTR _alwaysValidateAll, 0
	je	SHORT $LN2@m_allocato
	call	?m_validateAllAllocUnits@@YA_NXZ	; m_validateAllAllocUnits
$LN2@m_allocato:

; 1252 : 
; 1253 : 		// Log the result
; 1254 : 
; 1255 : 		if (alwaysLogAll)

	cmp	BYTE PTR _alwaysLogAll, 0
	je	SHORT $LN1@m_allocato

; 1256 : 		{
; 1257 : 			log("[+] ---->             addr 0x%08X", reinterpret_cast<unsigned int>(au->reportedAddress));

	mov	edx, DWORD PTR [esi+12]
	push	edx
	push	OFFSET ??_C@_0CC@CJLIKJAD@?$FL?$CL?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5addr?50x?$CF08@
	call	?log@@YAXPBDZZ				; log

; 1258 : 			log("[+] ---->             thread 0x%08X", au->threadId);

	mov	eax, DWORD PTR [esi+112]
	add	esp, 8
	push	eax
	push	OFFSET ??_C@_0CE@KIHEFDMN@?$FL?$CL?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5thread?50x?$CF@
	call	?log@@YAXPBDZZ				; log
	add	esp, 8
$LN1@m_allocato:

; 1259 : 		}
; 1260 : 
; 1261 : 		// Resetting the globals insures that if at some later time, somebody calls our memory manager from an unknown
; 1262 : 		// source (i.e. they didn't include our H file) then we won't think it was the last allocation.
; 1263 : 
; 1264 : 		resetGlobals();

	mov	eax, OFFSET ??_C@_02HHFHKOHM@?$DP?$DP?$AA@

; 1265 : 
; 1266 : 		// Return the (reported) address of the new allocation unit
; 1267 : 
; 1268 : 		#ifdef TEST_MEMORY_MANAGER
; 1269 : 		log("[D] EXIT : m_allocator()");
; 1270 : 		#endif
; 1271 : 		LeaveCriticalSection(&criticalSection);

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	mov	DWORD PTR _sourceFile, eax
	mov	DWORD PTR _sourceLine, 0
	mov	DWORD PTR _sourceFunc, eax
	call	DWORD PTR __imp__LeaveCriticalSection@4

; 1272 : 		return au->reportedAddress;

	mov	eax, DWORD PTR [esi+12]

; 1286 : 	}
; 1287 : 
; 1288 : }

	mov	ecx, DWORD PTR __$EHRec$[ebp+4]
	mov	DWORD PTR fs:0, ecx
	pop	edi
	pop	esi
	pop	ebx
	mov	esp, ebp
	pop	ebp
	ret	0
__catch$?m_allocator@@YAPAXPBDI0II@Z$0:

; 1273 : 	}
; 1274 : 	catch(const char *err)
; 1275 : 	{
; 1276 : 		// Deal with the errors
; 1277 : 
; 1278 : 		log("[!] %s", err);

	mov	ecx, DWORD PTR _err$38019[ebp]
	push	ecx
	push	OFFSET ??_C@_06NFJEEBCF@?$FL?$CB?$FN?5?$CFs?$AA@
	call	?log@@YAXPBDZZ				; log
	add	esp, 8

; 1279 : 		resetGlobals();

	call	?resetGlobals@@YAXXZ			; resetGlobals

; 1280 : 
; 1281 : 		#ifdef TEST_MEMORY_MANAGER
; 1282 : 		log("[D] EXIT : m_allocator()");
; 1283 : 		#endif
; 1284 : 		LeaveCriticalSection(&criticalSection);

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__LeaveCriticalSection@4

; 1285 : 		return NULL;

	mov	eax, $LN27@m_allocato
	ret	0
$LN27@m_allocato:

; 1286 : 	}
; 1287 : 
; 1288 : }

	mov	ecx, DWORD PTR __$EHRec$[ebp+4]
	pop	edi
	pop	esi
	xor	eax, eax
	mov	DWORD PTR fs:0, ecx
	pop	ebx
	mov	esp, ebp
	pop	ebp
	ret	0
$LN46@m_allocato:
_TEXT	ENDS
;	COMDAT text$x
text$x	SEGMENT
__ehhandler$?m_allocator@@YAPAXPBDI0II@Z:
	mov	eax, OFFSET __ehfuncinfo$?m_allocator@@YAPAXPBDI0II@Z
	jmp	___CxxFrameHandler3
text$x	ENDS
?m_allocator@@YAPAXPBDI0II@Z ENDP			; m_allocator
PUBLIC	??_C@_0CC@MMIFHLME@?$FL?$HO?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5addr?50x?$CF08@ ; `string'
PUBLIC	??_C@_0DA@HCHEMAGA@Request?5for?5reallocation?5failed?4@ ; `string'
PUBLIC	??_C@_0CI@GJCGIAIO@?$FL?$HO?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5from?50x?$CF08@ ; `string'
PUBLIC	??_C@_0DD@GOLJKMMD@Request?5to?5reallocate?5RAM?5that?5w@ ; `string'
PUBLIC	??_C@_0CI@IGIJFDHM@?$FL?$HO?$FN?5?$CF05d?5?$CF8s?5of?5size?50x?$CF08X?$CI?$CF08d@ ; `string'
PUBLIC	?m_reallocator@@YAPAXPBDI0IIPAX@Z		; m_reallocator
;	COMDAT ??_C@_0CC@MMIFHLME@?$FL?$HO?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5addr?50x?$CF08@
CONST	SEGMENT
??_C@_0CC@MMIFHLME@?$FL?$HO?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5addr?50x?$CF08@ DB '['
	DB	'~] ---->             addr 0x%08X', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_0DA@HCHEMAGA@Request?5for?5reallocation?5failed?4@
CONST	SEGMENT
??_C@_0DA@HCHEMAGA@Request?5for?5reallocation?5failed?4@ DB 'Request for '
	DB	'reallocation failed. Out of memory.', 00H	; `string'
CONST	ENDS
;	COMDAT ??_C@_0CI@GJCGIAIO@?$FL?$HO?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5from?50x?$CF08@
CONST	SEGMENT
??_C@_0CI@GJCGIAIO@?$FL?$HO?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5from?50x?$CF08@ DB '['
	DB	'~] ---->             from 0x%08X(%08d)', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0DD@GOLJKMMD@Request?5to?5reallocate?5RAM?5that?5w@
CONST	SEGMENT
??_C@_0DD@GOLJKMMD@Request?5to?5reallocate?5RAM?5that?5w@ DB 'Request to '
	DB	'reallocate RAM that was never allocated', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0CI@IGIJFDHM@?$FL?$HO?$FN?5?$CF05d?5?$CF8s?5of?5size?50x?$CF08X?$CI?$CF08d@
CONST	SEGMENT
??_C@_0CI@IGIJFDHM@?$FL?$HO?$FN?5?$CF05d?5?$CF8s?5of?5size?50x?$CF08X?$CI?$CF08d@ DB '['
	DB	'~] %05d %8s of size 0x%08X(%08d) by %s', 00H ; `string'
CONST	ENDS
;	COMDAT xdata$x
xdata$x	SEGMENT
__catchsym$?m_reallocator@@YAPAXPBDI0IIPAX@Z$2 DD 01H
	DD	FLAT:??_R0PAD@8
	DD	0ffffffe0H
	DD	FLAT:__catch$?m_reallocator@@YAPAXPBDI0IIPAX@Z$0
__unwindtable$?m_reallocator@@YAPAXPBDI0IIPAX@Z DD 0ffffffffH
	DD	00H
	DD	0ffffffffH
	DD	00H
__tryblocktable$?m_reallocator@@YAPAXPBDI0IIPAX@Z DD 00H
	DD	00H
	DD	01H
	DD	01H
	DD	FLAT:__catchsym$?m_reallocator@@YAPAXPBDI0IIPAX@Z$2
__ehfuncinfo$?m_reallocator@@YAPAXPBDI0IIPAX@Z DD 019930522H
	DD	02H
	DD	FLAT:__unwindtable$?m_reallocator@@YAPAXPBDI0IIPAX@Z
	DD	01H
	DD	FLAT:__tryblocktable$?m_reallocator@@YAPAXPBDI0IIPAX@Z
	DD	2 DUP(00H)
	DD	00H
	DD	01H
; Function compile flags: /Ogtpy
xdata$x	ENDS
;	COMDAT ?m_reallocator@@YAPAXPBDI0IIPAX@Z
_TEXT	SEGMENT
_err$38077 = -32					; size = 4
_originalReportedSize$38039 = -28			; size = 4
$T41537 = -24						; size = 4
$T41536 = -20						; size = 4
__$EHRec$ = -16						; size = 16
_sourceFile$ = 8					; size = 4
_sourceLine$ = 12					; size = 4
_sourceFunc$ = 16					; size = 4
_reallocationType$ = 20					; size = 4
_reportedSize$ = 24					; size = 4
_reportedAddress$ = 28					; size = 4
?m_reallocator@@YAPAXPBDI0IIPAX@Z PROC			; m_reallocator, COMDAT

; 1295 : {

	push	ebp
	mov	ebp, esp
	push	-1
	push	__ehhandler$?m_reallocator@@YAPAXPBDI0IIPAX@Z
	mov	eax, DWORD PTR fs:0
	push	eax
	mov	DWORD PTR fs:0, esp
	sub	esp, 20					; 00000014H

; 1296 : 	if (!criticalInitialized)

	cmp	BYTE PTR ?criticalInitialized@@3_NA, 0	; criticalInitialized
	push	ebx
	push	esi
	push	edi
	mov	DWORD PTR __$EHRec$[ebp], esp
	jne	SHORT $LN22@m_realloca

; 1297 : 	{
; 1298 : 		InitializeCriticalSection(&criticalSection);

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__InitializeCriticalSection@4

; 1299 : 		criticalInitialized = true;

	mov	BYTE PTR ?criticalInitialized@@3_NA, 1	; criticalInitialized
$LN22@m_realloca:

; 1300 : 	}
; 1301 : 	EnterCriticalSection(&criticalSection);	

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__EnterCriticalSection@4

; 1302 : 	try
; 1303 : 	{
; 1304 : 		#ifdef TEST_MEMORY_MANAGER
; 1305 : 		log("[D] ENTER: m_reallocator()");
; 1306 : 		#endif
; 1307 : 
; 1308 : 		// Calling realloc with a NULL should force same operations as a malloc
; 1309 : 
; 1310 : 		if (!reportedAddress)

	mov	esi, DWORD PTR _reportedAddress$[ebp]
	test	esi, esi
	mov	DWORD PTR __$EHRec$[ebp+12], 0
	jne	SHORT $LN20@m_realloca

; 1311 : 		{
; 1312 : 			return m_allocator(sourceFile, sourceLine, sourceFunc, reallocationType, reportedSize);

	mov	eax, DWORD PTR _reportedSize$[ebp]
	mov	ecx, DWORD PTR _reallocationType$[ebp]
	mov	edx, DWORD PTR _sourceFunc$[ebp]
	push	eax
	mov	eax, DWORD PTR _sourceLine$[ebp]
	push	ecx
	mov	ecx, DWORD PTR _sourceFile$[ebp]
	push	edx
	push	eax
	push	ecx
	call	?m_allocator@@YAPAXPBDI0II@Z		; m_allocator
	add	esp, 20					; 00000014H

; 1493 : 	}
; 1494 : }

	mov	ecx, DWORD PTR __$EHRec$[ebp+4]
	mov	DWORD PTR fs:0, ecx
	pop	edi
	pop	esi
	pop	ebx
	mov	esp, ebp
	pop	ebp
	ret	0
$LN20@m_realloca:

; 1313 : 		}
; 1314 : 
; 1315 : 		// Increase our allocation count
; 1316 : 
; 1317 : 		currentAllocationCount++;

	add	DWORD PTR _currentAllocationCount, 1

; 1318 : 
; 1319 : 		// If you hit this assert, you requested a breakpoint on a specific allocation count
; 1320 : 		m_assert(currentAllocationCount != breakOnAllocationCount);
; 1321 : 
; 1322 : 		// Log the request
; 1323 : 
; 1324 : 		if (alwaysLogAll) log("[~] %05d %8s of size 0x%08X(%08d) by %s", currentAllocationCount, allocationTypes[reallocationType], reportedSize, reportedSize, ownerString(sourceFile, sourceLine, sourceFunc));

	cmp	BYTE PTR _alwaysLogAll, 0
	mov	ebx, DWORD PTR _sourceFile$[ebp]
	je	SHORT $LN19@m_realloca
	mov	edx, DWORD PTR _sourceFunc$[ebp]
	mov	eax, DWORD PTR _sourceLine$[ebp]
	push	edx
	push	eax
	mov	eax, ebx
	call	?ownerString@@YAPBDPBDI0@Z		; ownerString
	mov	ecx, DWORD PTR _reallocationType$[ebp]
	mov	edx, DWORD PTR _allocationTypes[ecx*4]
	push	eax
	mov	eax, DWORD PTR _reportedSize$[ebp]
	push	eax
	push	eax
	mov	eax, DWORD PTR _currentAllocationCount
	push	edx
	push	eax
	push	OFFSET ??_C@_0CI@IGIJFDHM@?$FL?$HO?$FN?5?$CF05d?5?$CF8s?5of?5size?50x?$CF08X?$CI?$CF08d@
	call	?log@@YAXPBDZZ				; log
	add	esp, 32					; 00000020H
$LN19@m_realloca:

; 1325 : 
; 1326 : 		// Locate the existing allocation unit
; 1327 : 
; 1328 : 		sAllocUnit	*au = findAllocUnit(reportedAddress);

	mov	eax, esi
	shr	eax, 4
	and	eax, 4095				; 00000fffH
	mov	edi, DWORD PTR _hashTable[eax*4]
	npad	7
$LL31@m_realloca:
	test	edi, edi
	je	SHORT $LN45@m_realloca
	cmp	DWORD PTR [edi+12], esi
	je	SHORT $LN18@m_realloca
	mov	edi, DWORD PTR [edi+116]
	jmp	SHORT $LL31@m_realloca
$LN45@m_realloca:

; 1329 : 
; 1330 : 		// If you hit this assert, you tried to reallocate RAM that wasn't allocated by this memory manager.
; 1331 : 		m_assert(au != NULL);
; 1332 : 		if (au == NULL) throw "Request to reallocate RAM that was never allocated";

	push	OFFSET __TI2PAD
	lea	ecx, DWORD PTR $T41536[ebp]
	push	ecx
	mov	DWORD PTR $T41536[ebp], OFFSET ??_C@_0DD@GOLJKMMD@Request?5to?5reallocate?5RAM?5that?5w@
	call	__CxxThrowException@8
$LN51@m_realloca:
$LN18@m_realloca:

; 1333 : 
; 1334 : 		// If you hit this assert, then the allocation unit that is about to be reallocated is damaged. But you probably
; 1335 : 		// already know that from a previous assert you should have seen in validateAllocUnit() :)
; 1336 : 		m_assert(m_validateAllocUnit(au));
; 1337 : 
; 1338 : 		// If you hit this assert, then this reallocation was made from a source that isn't setup to use this memory
; 1339 : 		// tracking software, use the stack frame to locate the source and include our H file.
; 1340 : 		m_assert(reallocationType != m_alloc_unknown);
; 1341 : 
; 1342 : 		// If you hit this assert, you were trying to reallocate RAM that was not allocated in a way that is compatible with
; 1343 : 		// realloc. In other words, you have a allocation/reallocation mismatch.
; 1344 : 		m_assert(au->allocationType == m_alloc_malloc ||
; 1345 : 			 au->allocationType == m_alloc_calloc ||
; 1346 : 			 au->allocationType == m_alloc_realloc);
; 1347 : 
; 1348 : 		// If you hit this assert, then the "break on realloc" flag for this allocation unit is set (and will continue to be
; 1349 : 		// set until you specifically shut it off. Interrogate the 'au' variable to determine information about this
; 1350 : 		// allocation unit.
; 1351 : 		m_assert(au->breakOnRealloc == false);
; 1352 : 
; 1353 : 		// Keep track of the original size
; 1354 : 
; 1355 : 		unsigned int	originalReportedSize = static_cast<unsigned int>(au->reportedSize);
; 1356 : 
; 1357 : 		if (alwaysLogAll) log("[~] ---->             from 0x%08X(%08d)", originalReportedSize, originalReportedSize);

	cmp	BYTE PTR _alwaysLogAll, 0
	mov	eax, DWORD PTR [edi+4]
	mov	DWORD PTR _originalReportedSize$38039[ebp], eax
	je	SHORT $LN17@m_realloca
	push	eax
	push	eax
	push	OFFSET ??_C@_0CI@GJCGIAIO@?$FL?$HO?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5from?50x?$CF08@
	call	?log@@YAXPBDZZ				; log
	add	esp, 12					; 0000000cH
$LN17@m_realloca:

; 1358 : 
; 1359 : 		// Do the reallocation
; 1360 : 
; 1361 : 		void	*oldReportedAddress = reportedAddress;
; 1362 : 		size_t	newActualSize = calculateActualSize(reportedSize);

	mov	esi, DWORD PTR _reportedSize$[ebp]

; 1363 : 		void	*newActualAddress = NULL;
; 1364 : 		#ifdef RANDOM_FAILURE
; 1365 : 		double	a = rand();
; 1366 : 		double	b = RAND_MAX / 100.0 * RANDOM_FAILURE;
; 1367 : 		if (a > b)
; 1368 : 		{
; 1369 : 			newActualAddress = realloc(au->actualAddress, newActualSize);
; 1370 : 		}
; 1371 : 		else
; 1372 : 		{
; 1373 : 			log("[F] Random faiure");
; 1374 : 		}
; 1375 : 		#else
; 1376 : 		newActualAddress = realloc(au->actualAddress, newActualSize);

	mov	edx, DWORD PTR [edi+8]
	add	esi, 32					; 00000020H
	push	esi
	push	edx
	call	_realloc
	add	esp, 8

; 1377 : 		#endif
; 1378 : 
; 1379 : 		// We don't want to assert with random failures, because we want the application to deal with them.
; 1380 : 
; 1381 : 		#ifndef RANDOM_FAILURE
; 1382 : 		// If you hit this assert, then the requested allocation simply failed (you're out of memory) Interrogate the
; 1383 : 		// variable 'au' to see the original allocation. You can also query 'newActualSize' to see the amount of memory
; 1384 : 		// trying to be allocated. Finally, you can query 'reportedSize' to see how much memory was requested by the caller.
; 1385 : 		m_assert(newActualAddress);
; 1386 : 		#endif
; 1387 : 
; 1388 : 		if (!newActualAddress) throw "Request for reallocation failed. Out of memory.";

	test	eax, eax
	jne	SHORT $LN16@m_realloca
	push	OFFSET __TI2PAD
	lea	eax, DWORD PTR $T41537[ebp]
	push	eax
	mov	DWORD PTR $T41537[ebp], OFFSET ??_C@_0DA@HCHEMAGA@Request?5for?5reallocation?5failed?4@
	call	__CxxThrowException@8
$LN52@m_realloca:
$LN16@m_realloca:

; 1389 : 
; 1390 : 		// Remove this allocation from our stats (we'll add the new reallocation again later)
; 1391 : 
; 1392 : 		stats.totalReportedMemory -= static_cast<unsigned int>(au->reportedSize);

	mov	ecx, DWORD PTR [edi+4]

; 1393 : 		stats.totalActualMemory   -= static_cast<unsigned int>(au->actualSize);

	mov	edx, DWORD PTR [edi]
	sub	DWORD PTR _stats, ecx
	sub	DWORD PTR _stats+4, edx

; 1394 : 
; 1395 : 		// Update the allocation with the new information
; 1396 : 
; 1397 : 		au->actualSize        = newActualSize;
; 1398 : 		au->actualAddress     = newActualAddress;
; 1399 : 		au->reportedSize      = calculateReportedSize(newActualSize);
; 1400 : 		au->reportedAddress   = calculateReportedAddress(newActualAddress);
; 1401 : 		au->allocationType    = reallocationType;
; 1402 : 		au->sourceLine        = sourceLine;

	mov	ecx, DWORD PTR _sourceLine$[ebp]

; 1403 : 		au->allocationNumber  = currentAllocationCount;

	mov	edx, DWORD PTR _currentAllocationCount
	mov	DWORD PTR [edi+8], eax
	add	eax, 16					; 00000010H
	mov	DWORD PTR [edi], esi
	mov	DWORD PTR [edi+12], eax
	mov	eax, DWORD PTR _reallocationType$[ebp]
	add	esi, -32				; ffffffe0H
	mov	DWORD PTR [edi+4], esi
	mov	DWORD PTR [edi+100], eax
	mov	DWORD PTR [edi+96], ecx
	mov	DWORD PTR [edi+108], edx

; 1404 : 		au->threadId          = GetCurrentThreadId();

	call	DWORD PTR __imp__GetCurrentThreadId@0

; 1405 : 		if (sourceFile) strncpy(au->sourceFile, sourceFileStripper(sourceFile), sizeof(au->sourceFile) - 1);

	test	ebx, ebx
	mov	DWORD PTR [edi+112], eax
	je	SHORT $LN15@m_realloca
	push	39					; 00000027H
	mov	esi, ebx
	call	?sourceFileStripper@@YAPBDPBD@Z		; sourceFileStripper
	push	eax
	lea	eax, DWORD PTR [edi+16]
	push	eax
	call	_strncpy
	add	esp, 12					; 0000000cH
	jmp	SHORT $LN14@m_realloca
$LN15@m_realloca:

; 1406 : 		else		strcpy (au->sourceFile, "??");

	mov	cx, WORD PTR ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	mov	WORD PTR [edi+16], cx
	mov	dl, BYTE PTR ??_C@_02HHFHKOHM@?$DP?$DP?$AA@+2
	mov	BYTE PTR [edi+18], dl
$LN14@m_realloca:

; 1407 : 		if (sourceFunc) strncpy(au->sourceFunc, sourceFunc, sizeof(au->sourceFunc) - 1);

	mov	eax, DWORD PTR _sourceFunc$[ebp]
	xor	esi, esi
	cmp	eax, esi
	je	SHORT $LN13@m_realloca
	push	39					; 00000027H
	push	eax
	lea	eax, DWORD PTR [edi+56]
	push	eax
	call	_strncpy
	add	esp, 12					; 0000000cH
	jmp	SHORT $LN12@m_realloca
$LN13@m_realloca:

; 1408 : 		else		strcpy (au->sourceFunc, "??");

	mov	cx, WORD PTR ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	mov	WORD PTR [edi+56], cx
	mov	dl, BYTE PTR ??_C@_02HHFHKOHM@?$DP?$DP?$AA@+2
	mov	BYTE PTR [edi+58], dl
$LN12@m_realloca:

; 1409 : 
; 1410 : 		// The reallocation may cause the address to change, so we should relocate our allocation unit within the hash table
; 1411 : 
; 1412 : 		unsigned int	hashIndex = static_cast<unsigned int>(-1);
; 1413 : 		if (oldReportedAddress != au->reportedAddress)

	mov	eax, DWORD PTR _reportedAddress$[ebp]
	cmp	eax, DWORD PTR [edi+12]
	je	SHORT $LN11@m_realloca

; 1414 : 		{
; 1415 : 			// Remove this allocation unit from the hash table
; 1416 : 
; 1417 : 			{
; 1418 : 				unsigned int	hashIndex = (reinterpret_cast<unsigned int>(oldReportedAddress) >> 4) & (hashSize - 1);

	shr	eax, 4
	and	eax, 4095				; 00000fffH

; 1419 : 				if (hashTable[hashIndex] == au)

	mov	ecx, DWORD PTR _hashTable[eax*4]
	cmp	ecx, edi
	jne	SHORT $LN10@m_realloca

; 1420 : 				{
; 1421 : 					hashTable[hashIndex] = hashTable[hashIndex]->next;

	mov	ecx, DWORD PTR [ecx+116]
	mov	DWORD PTR _hashTable[eax*4], ecx

; 1422 : 				}
; 1423 : 				else

	jmp	SHORT $LN7@m_realloca
$LN10@m_realloca:

; 1424 : 				{
; 1425 : 					if (au->prev)	au->prev->next = au->next;

	mov	eax, DWORD PTR [edi+120]
	cmp	eax, esi
	je	SHORT $LN8@m_realloca
	mov	edx, DWORD PTR [edi+116]
	mov	DWORD PTR [eax+116], edx
$LN8@m_realloca:

; 1426 : 					if (au->next)	au->next->prev = au->prev;

	mov	eax, DWORD PTR [edi+116]
	cmp	eax, esi
	je	SHORT $LN7@m_realloca
	mov	ecx, DWORD PTR [edi+120]
	mov	DWORD PTR [eax+120], ecx
$LN7@m_realloca:

; 1427 : 				}
; 1428 : 			}
; 1429 : 
; 1430 : 			// Re-insert it back into the hash table
; 1431 : 
; 1432 : 			hashIndex = (reinterpret_cast<unsigned int>(au->reportedAddress) >> 4) & (hashSize - 1);

	mov	eax, DWORD PTR [edi+12]
	shr	eax, 4
	and	eax, 4095				; 00000fffH

; 1433 : 			if (hashTable[hashIndex]) hashTable[hashIndex]->prev = au;

	mov	ecx, DWORD PTR _hashTable[eax*4]
	cmp	ecx, esi
	je	SHORT $LN6@m_realloca
	mov	DWORD PTR [ecx+120], edi
$LN6@m_realloca:

; 1434 : 			au->next = hashTable[hashIndex];

	mov	edx, DWORD PTR _hashTable[eax*4]
	mov	DWORD PTR [edi+116], edx

; 1435 : 			au->prev = NULL;

	mov	DWORD PTR [edi+120], esi

; 1436 : 			hashTable[hashIndex] = au;

	mov	DWORD PTR _hashTable[eax*4], edi
$LN11@m_realloca:

; 1437 : 		}
; 1438 : 
; 1439 : 		// Account for the new allocatin unit in our stats
; 1440 : 
; 1441 : 		stats.totalReportedMemory += static_cast<unsigned int>(au->reportedSize);

	mov	eax, DWORD PTR _stats

; 1442 : 		stats.totalActualMemory   += static_cast<unsigned int>(au->actualSize);

	mov	ecx, DWORD PTR _stats+4
	add	eax, DWORD PTR [edi+4]
	add	ecx, DWORD PTR [edi]

; 1443 : 		if (stats.totalReportedMemory > stats.peakReportedMemory) stats.peakReportedMemory = stats.totalReportedMemory;

	cmp	eax, DWORD PTR _stats+8
	mov	DWORD PTR _stats, eax
	mov	DWORD PTR _stats+4, ecx
	jbe	SHORT $LN5@m_realloca
	mov	DWORD PTR _stats+8, eax
$LN5@m_realloca:

; 1444 : 		if (stats.totalActualMemory   > stats.peakActualMemory)   stats.peakActualMemory   = stats.totalActualMemory;

	cmp	ecx, DWORD PTR _stats+12
	jbe	SHORT $LN4@m_realloca
	mov	DWORD PTR _stats+12, ecx
$LN4@m_realloca:

; 1445 : 		int	deltaReportedSize = static_cast<int>(reportedSize - originalReportedSize);

	mov	eax, DWORD PTR _reportedSize$[ebp]
	mov	ecx, DWORD PTR _originalReportedSize$38039[ebp]
	sub	eax, ecx

; 1446 : 		if (deltaReportedSize > 0)

	cmp	eax, esi
	jle	SHORT $LN3@m_realloca

; 1447 : 		{
; 1448 : 			stats.accumulatedReportedMemory += deltaReportedSize;

	add	DWORD PTR _stats+16, eax

; 1449 : 			stats.accumulatedActualMemory += deltaReportedSize;

	add	DWORD PTR _stats+20, eax
$LN3@m_realloca:

; 1450 : 		}
; 1451 : 
; 1452 : 		// Prepare the allocation unit for use (wipe it with recognizable garbage)
; 1453 : 
; 1454 : 		wipeWithPattern(au, unusedPattern, originalReportedSize);

	mov	eax, DWORD PTR _unusedPattern
	push	edi
	call	?wipeWithPattern@@YAXPAUtag_au@@KI@Z	; wipeWithPattern
	add	esp, 4

; 1455 : 
; 1456 : 		// If you hit this assert, then something went wrong, because the allocation unit was properly validated PRIOR to
; 1457 : 		// the reallocation. This should not happen.
; 1458 : 		m_assert(m_validateAllocUnit(au));
; 1459 : 
; 1460 : 		// Validate every single allocated unit in memory
; 1461 : 
; 1462 : 		if (alwaysValidateAll) m_validateAllAllocUnits();

	cmp	BYTE PTR _alwaysValidateAll, 0
	je	SHORT $LN2@m_realloca
	call	?m_validateAllAllocUnits@@YA_NXZ	; m_validateAllAllocUnits
$LN2@m_realloca:

; 1463 : 
; 1464 : 		// Log the result
; 1465 : 
; 1466 : 		if (alwaysLogAll) log("[~] ---->             addr 0x%08X", reinterpret_cast<unsigned int>(au->reportedAddress));

	cmp	BYTE PTR _alwaysLogAll, 0
	je	SHORT $LN1@m_realloca
	mov	eax, DWORD PTR [edi+12]
	push	eax
	push	OFFSET ??_C@_0CC@MMIFHLME@?$FL?$HO?$FN?5?9?9?9?9?$DO?5?5?5?5?5?5?5?5?5?5?5?5?5addr?50x?$CF08@
	call	?log@@YAXPBDZZ				; log
	add	esp, 8
$LN1@m_realloca:

; 1467 : 
; 1468 : 		// Resetting the globals insures that if at some later time, somebody calls our memory manager from an unknown
; 1469 : 		// source (i.e. they didn't include our H file) then we won't think it was the last allocation.
; 1470 : 
; 1471 : 		resetGlobals();

	mov	eax, OFFSET ??_C@_02HHFHKOHM@?$DP?$DP?$AA@

; 1472 : 
; 1473 : 		// Return the (reported) address of the new allocation unit
; 1474 : 
; 1475 : 		#ifdef TEST_MEMORY_MANAGER
; 1476 : 		log("[D] EXIT : m_reallocator()");
; 1477 : 		#endif
; 1478 : 		LeaveCriticalSection(&criticalSection);

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	mov	DWORD PTR _sourceFile, eax
	mov	DWORD PTR _sourceLine, esi
	mov	DWORD PTR _sourceFunc, eax
	call	DWORD PTR __imp__LeaveCriticalSection@4

; 1479 : 		return au->reportedAddress;

	mov	eax, DWORD PTR [edi+12]

; 1493 : 	}
; 1494 : }

	mov	ecx, DWORD PTR __$EHRec$[ebp+4]
	mov	DWORD PTR fs:0, ecx
	pop	edi
	pop	esi
	pop	ebx
	mov	esp, ebp
	pop	ebp
	ret	0
__catch$?m_reallocator@@YAPAXPBDI0IIPAX@Z$0:

; 1480 : 	}
; 1481 : 	catch(const char *err)
; 1482 : 	{
; 1483 : 		// Deal with the errors
; 1484 : 
; 1485 : 		log("[!] %s", err);

	mov	ecx, DWORD PTR _err$38077[ebp]
	push	ecx
	push	OFFSET ??_C@_06NFJEEBCF@?$FL?$CB?$FN?5?$CFs?$AA@
	call	?log@@YAXPBDZZ				; log
	add	esp, 8

; 1486 : 		resetGlobals();

	call	?resetGlobals@@YAXXZ			; resetGlobals

; 1487 : 
; 1488 : 		#ifdef TEST_MEMORY_MANAGER
; 1489 : 		log("[D] EXIT : m_reallocator()");
; 1490 : 		#endif
; 1491 : 		LeaveCriticalSection(&criticalSection);

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__LeaveCriticalSection@4

; 1492 : 		return NULL;

	mov	eax, $LN28@m_realloca
	ret	0
$LN28@m_realloca:

; 1493 : 	}
; 1494 : }

	mov	ecx, DWORD PTR __$EHRec$[ebp+4]
	pop	edi
	pop	esi
	xor	eax, eax
	mov	DWORD PTR fs:0, ecx
	pop	ebx
	mov	esp, ebp
	pop	ebp
	ret	0
$LN50@m_realloca:
_TEXT	ENDS
;	COMDAT text$x
text$x	SEGMENT
__ehhandler$?m_reallocator@@YAPAXPBDI0IIPAX@Z:
	mov	eax, OFFSET __ehfuncinfo$?m_reallocator@@YAPAXPBDI0IIPAX@Z
	jmp	___CxxFrameHandler3
text$x	ENDS
?m_reallocator@@YAPAXPBDI0IIPAX@Z ENDP			; m_reallocator
PUBLIC	??_C@_0DD@MPCHMOCN@Request?5to?5deallocate?5RAM?5that?5w@ ; `string'
PUBLIC	??_C@_0DC@FIFKHPPA@?$FL?9?$FN?5?9?9?9?9?9?5?$CF8s?5of?5addr?50x?$CF08X?5thr@ ; `string'
PUBLIC	?m_deallocator@@YAXPBDI0IPBX@Z			; m_deallocator
;	COMDAT ??_C@_0DD@MPCHMOCN@Request?5to?5deallocate?5RAM?5that?5w@
CONST	SEGMENT
??_C@_0DD@MPCHMOCN@Request?5to?5deallocate?5RAM?5that?5w@ DB 'Request to '
	DB	'deallocate RAM that was never allocated', 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_0DC@FIFKHPPA@?$FL?9?$FN?5?9?9?9?9?9?5?$CF8s?5of?5addr?50x?$CF08X?5thr@
CONST	SEGMENT
??_C@_0DC@FIFKHPPA@?$FL?9?$FN?5?9?9?9?9?9?5?$CF8s?5of?5addr?50x?$CF08X?5thr@ DB '['
	DB	'-] ----- %8s of addr 0x%08X thread 0x%08X by %s ', 00H ; `string'
CONST	ENDS
;	COMDAT xdata$x
xdata$x	SEGMENT
__catchsym$?m_deallocator@@YAXPBDI0IPBX@Z$2 DD 01H
	DD	FLAT:??_R0PAD@8
	DD	0ffffffe8H
	DD	FLAT:__catch$?m_deallocator@@YAXPBDI0IPBX@Z$0
__unwindtable$?m_deallocator@@YAXPBDI0IPBX@Z DD 0ffffffffH
	DD	00H
	DD	0ffffffffH
	DD	00H
__tryblocktable$?m_deallocator@@YAXPBDI0IPBX@Z DD 00H
	DD	00H
	DD	01H
	DD	01H
	DD	FLAT:__catchsym$?m_deallocator@@YAXPBDI0IPBX@Z$2
__ehfuncinfo$?m_deallocator@@YAXPBDI0IPBX@Z DD 019930522H
	DD	02H
	DD	FLAT:__unwindtable$?m_deallocator@@YAXPBDI0IPBX@Z
	DD	01H
	DD	FLAT:__tryblocktable$?m_deallocator@@YAXPBDI0IPBX@Z
	DD	2 DUP(00H)
	DD	00H
	DD	01H
; Function compile flags: /Ogtpy
xdata$x	ENDS
;	COMDAT ?m_deallocator@@YAXPBDI0IPBX@Z
_TEXT	SEGMENT
_err$38108 = -24					; size = 4
$T41584 = -20						; size = 4
__$EHRec$ = -16						; size = 16
_sourceFile$ = 8					; size = 4
_sourceLine$ = 12					; size = 4
_sourceFunc$ = 16					; size = 4
_deallocationType$ = 20					; size = 4
_reportedAddress$ = 24					; size = 4
?m_deallocator@@YAXPBDI0IPBX@Z PROC			; m_deallocator, COMDAT

; 1501 : {

	push	ebp
	mov	ebp, esp
	push	-1
	push	__ehhandler$?m_deallocator@@YAXPBDI0IPBX@Z
	mov	eax, DWORD PTR fs:0
	push	eax
	mov	DWORD PTR fs:0, esp
	sub	esp, 12					; 0000000cH
	push	ebx
	push	esi

; 1502 : 	if (!criticalInitialized)

	xor	ebx, ebx
	cmp	BYTE PTR ?criticalInitialized@@3_NA, bl	; criticalInitialized
	push	edi
	mov	DWORD PTR __$EHRec$[ebp], esp
	jne	SHORT $LN11@m_dealloca

; 1503 : 	{
; 1504 : 		InitializeCriticalSection(&criticalSection);

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__InitializeCriticalSection@4

; 1505 : 		criticalInitialized = true;

	mov	BYTE PTR ?criticalInitialized@@3_NA, 1	; criticalInitialized
$LN11@m_dealloca:

; 1506 : 	}
; 1507 : 	EnterCriticalSection(&criticalSection);	

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__EnterCriticalSection@4

; 1508 : 	try
; 1509 : 	{
; 1510 : 		#ifdef TEST_MEMORY_MANAGER
; 1511 : 		log("[D] ENTER: m_deallocator()");
; 1512 : 		#endif
; 1513 : 
; 1514 : 		// Log the request
; 1515 : 
; 1516 : 		if (alwaysLogAll)

	cmp	BYTE PTR _alwaysLogAll, bl
	mov	DWORD PTR __$EHRec$[ebp+12], ebx
	je	SHORT $LN29@m_dealloca

; 1517 : 		{
; 1518 : 			log("[-] ----- %8s of addr 0x%08X thread 0x%08X by %s ", allocationTypes[deallocationType], reinterpret_cast<unsigned int>(const_cast<void *>(reportedAddress)),GetCurrentThreadId(), ownerString(sourceFile, sourceLine, sourceFunc));

	mov	eax, DWORD PTR _sourceFunc$[ebp]
	mov	ecx, DWORD PTR _sourceLine$[ebp]
	push	eax
	mov	eax, DWORD PTR _sourceFile$[ebp]
	push	ecx
	call	?ownerString@@YAPBDPBDI0@Z		; ownerString
	add	esp, 8
	push	eax
	call	DWORD PTR __imp__GetCurrentThreadId@0
	mov	edx, DWORD PTR _deallocationType$[ebp]
	mov	edi, DWORD PTR _reportedAddress$[ebp]
	push	eax
	mov	eax, DWORD PTR _allocationTypes[edx*4]
	push	edi
	push	eax
	push	OFFSET ??_C@_0DC@FIFKHPPA@?$FL?9?$FN?5?9?9?9?9?9?5?$CF8s?5of?5addr?50x?$CF08X?5thr@
	call	?log@@YAXPBDZZ				; log
	add	esp, 20					; 00000014H
	jmp	SHORT $LN9@m_dealloca
$LN29@m_dealloca:
	mov	edi, DWORD PTR _reportedAddress$[ebp]
$LN9@m_dealloca:

; 1519 : 		}
; 1520 : 		// We should only ever get here with a null pointer if they try to do so with a call to free() (delete[] and delete will
; 1521 : 		// both bail before they get here.) So, since ANSI allows free(NULL), we'll not bother trying to actually free the allocated
; 1522 : 		// memory or track it any further.
; 1523 : 
; 1524 : 		if (reportedAddress)

	cmp	edi, ebx
	je	$LN8@m_dealloca

; 1525 : 		{
; 1526 : 			// Go get the allocation unit
; 1527 : 
; 1528 : 			sAllocUnit	*au = findAllocUnit(reportedAddress);

	mov	eax, edi
	shr	eax, 4
	and	eax, 4095				; 00000fffH
	mov	esi, DWORD PTR _hashTable[eax*4]
$LL20@m_dealloca:
	cmp	esi, ebx
	je	SHORT $LN27@m_dealloca
	cmp	DWORD PTR [esi+12], edi
	je	SHORT $LN7@m_dealloca
	mov	esi, DWORD PTR [esi+116]
	jmp	SHORT $LL20@m_dealloca
$LN27@m_dealloca:

; 1529 : 
; 1530 : 			// If you hit this assert, you tried to deallocate RAM that wasn't allocated by this memory manager.
; 1531 : 			m_assert(au != NULL);
; 1532 : 			if (au == NULL) throw "Request to deallocate RAM that was never allocated";

	push	OFFSET __TI2PAD
	lea	ecx, DWORD PTR $T41584[ebp]
	push	ecx
	mov	DWORD PTR $T41584[ebp], OFFSET ??_C@_0DD@MPCHMOCN@Request?5to?5deallocate?5RAM?5that?5w@
	call	__CxxThrowException@8
$LN33@m_dealloca:
$LN7@m_dealloca:

; 1533 : 
; 1534 : 			// If you hit this assert, then the allocation unit that is about to be deallocated is damaged. But you probably
; 1535 : 			// already know that from a previous assert you should have seen in validateAllocUnit() :)
; 1536 : 			m_assert(m_validateAllocUnit(au));
; 1537 : 
; 1538 : 			// If you hit this assert, then this deallocation was made from a source that isn't setup to use this memory
; 1539 : 			// tracking software, use the stack frame to locate the source and include our H file.
; 1540 : 			m_assert(deallocationType != m_alloc_unknown);
; 1541 : 
; 1542 : 			// If you hit this assert, you were trying to deallocate RAM that was not allocated in a way that is compatible with
; 1543 : 			// the deallocation method requested. In other words, you have a allocation/deallocation mismatch.
; 1544 : 			m_assert((deallocationType == m_alloc_delete       && au->allocationType == m_alloc_new      ) ||
; 1545 : 				(deallocationType == m_alloc_delete_array && au->allocationType == m_alloc_new_array) ||
; 1546 : 				(deallocationType == m_alloc_free         && au->allocationType == m_alloc_malloc   ) ||
; 1547 : 				(deallocationType == m_alloc_free         && au->allocationType == m_alloc_calloc   ) ||
; 1548 : 				(deallocationType == m_alloc_free         && au->allocationType == m_alloc_realloc  ) ||
; 1549 : 				(deallocationType == m_alloc_unknown                                                ) );
; 1550 : 
; 1551 : 			// If you hit this assert, then the "break on dealloc" flag for this allocation unit is set. Interrogate the 'au'
; 1552 : 			// variable to determine information about this allocation unit.
; 1553 : 			m_assert(au->breakOnDealloc == false);
; 1554 : 
; 1555 : 			// Wipe the deallocated RAM with a new pattern. This doen't actually do us much good in debug mode under WIN32,
; 1556 : 			// because Microsoft's memory debugging & tracking utilities will wipe it right after we do. Oh well.
; 1557 : 
; 1558 : 			wipeWithPattern(au, releasedPattern);

	mov	eax, DWORD PTR _releasedPattern
	push	esi
	xor	ecx, ecx
	call	?wipeWithPattern@@YAXPAUtag_au@@KI@Z	; wipeWithPattern

; 1559 : 
; 1560 : 			// Do the deallocation
; 1561 : 
; 1562 : 			DeallocMemory(au->actualAddress);

	mov	edx, DWORD PTR [esi+8]
	push	edx
	call	?DeallocMemory@@YAXPAX@Z		; DeallocMemory

; 1563 : 
; 1564 : 			// Remove this allocation unit from the hash table
; 1565 : 
; 1566 : 			unsigned int	hashIndex = (reinterpret_cast<unsigned int>(au->reportedAddress) >> 4) & (hashSize - 1);

	mov	eax, DWORD PTR [esi+12]
	shr	eax, 4
	and	eax, 4095				; 00000fffH
	add	esp, 8

; 1567 : 			if (hashTable[hashIndex] == au)

	cmp	DWORD PTR _hashTable[eax*4], esi
	jne	SHORT $LN6@m_dealloca

; 1568 : 			{
; 1569 : 				hashTable[hashIndex] = au->next;

	mov	ecx, DWORD PTR [esi+116]
	mov	DWORD PTR _hashTable[eax*4], ecx

; 1570 : 			}
; 1571 : 			else

	jmp	SHORT $LN3@m_dealloca
$LN6@m_dealloca:

; 1572 : 			{
; 1573 : 				if (au->prev)	au->prev->next = au->next;

	mov	eax, DWORD PTR [esi+120]
	cmp	eax, ebx
	je	SHORT $LN4@m_dealloca
	mov	edx, DWORD PTR [esi+116]
	mov	DWORD PTR [eax+116], edx
$LN4@m_dealloca:

; 1574 : 				if (au->next)	au->next->prev = au->prev;

	mov	eax, DWORD PTR [esi+116]
	cmp	eax, ebx
	je	SHORT $LN3@m_dealloca
	mov	ecx, DWORD PTR [esi+120]
	mov	DWORD PTR [eax+120], ecx
$LN3@m_dealloca:

; 1575 : 			}
; 1576 : 
; 1577 : 			// Remove this allocation from our stats
; 1578 : 
; 1579 : 			stats.totalReportedMemory -= static_cast<unsigned int>(au->reportedSize);

	mov	edx, DWORD PTR [esi+4]

; 1580 : 			stats.totalActualMemory   -= static_cast<unsigned int>(au->actualSize);

	mov	eax, DWORD PTR [esi]
	sub	DWORD PTR _stats, edx
	sub	DWORD PTR _stats+4, eax

; 1581 : 			stats.totalAllocUnitCount--;

	sub	DWORD PTR _stats+28, 1

; 1582 : 
; 1583 : 			// Add this allocation unit to the front of our reservoir of unused allocation units
; 1584 : 
; 1585 : 			memset(au, 0, sizeof(sAllocUnit));

	push	124					; 0000007cH
	push	ebx
	push	esi
	call	_memset

; 1586 : 			au->next = reservoir;

	mov	ecx, DWORD PTR _reservoir
	add	esp, 12					; 0000000cH
	mov	DWORD PTR [esi+116], ecx

; 1587 : 			reservoir = au;

	mov	DWORD PTR _reservoir, esi
$LN8@m_dealloca:

; 1588 : 		}
; 1589 : 
; 1590 : 		// Resetting the globals insures that if at some later time, somebody calls our memory manager from an unknown
; 1591 : 		// source (i.e. they didn't include our H file) then we won't think it was the last allocation.
; 1592 : 
; 1593 : 		resetGlobals();
; 1594 : 
; 1595 : 		// Validate every single allocated unit in memory
; 1596 : 
; 1597 : 		if (alwaysValidateAll) m_validateAllAllocUnits();

	cmp	BYTE PTR _alwaysValidateAll, bl
	mov	eax, OFFSET ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	mov	DWORD PTR _sourceFile, eax
	mov	DWORD PTR _sourceLine, ebx
	mov	DWORD PTR _sourceFunc, eax
	je	SHORT $LN2@m_dealloca
	call	?m_validateAllAllocUnits@@YA_NXZ	; m_validateAllAllocUnits
$LN2@m_dealloca:

; 1598 : 
; 1599 : 		// If we're in the midst of static deinitialization time, track any pending memory leaks
; 1600 : 
; 1601 : 		if (staticDeinitTime) dumpLeakReport();

	cmp	BYTE PTR _staticDeinitTime, bl
	je	SHORT $LN17@m_dealloca
	call	?dumpLeakReport@@YAXXZ			; dumpLeakReport
$LN17@m_dealloca:

; 1610 : 
; 1611 : 	#ifdef TEST_MEMORY_MANAGER
; 1612 : 	log("[D] EXIT : m_deallocator()");
; 1613 : 	#endif
; 1614 : 		LeaveCriticalSection(&criticalSection);

	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__LeaveCriticalSection@4

; 1615 : }

	mov	ecx, DWORD PTR __$EHRec$[ebp+4]
	pop	edi
	pop	esi
	mov	DWORD PTR fs:0, ecx
	pop	ebx
	mov	esp, ebp
	pop	ebp
	ret	0
__catch$?m_deallocator@@YAXPBDI0IPBX@Z$0:

; 1602 : 	}
; 1603 : 	catch(const char *err)
; 1604 : 	{
; 1605 : 		// Deal with errors
; 1606 : 
; 1607 : 		log("[!] %s", err);

	mov	edx, DWORD PTR _err$38108[ebp]
	push	edx
	push	OFFSET ??_C@_06NFJEEBCF@?$FL?$CB?$FN?5?$CFs?$AA@
	call	?log@@YAXPBDZZ				; log
	add	esp, 8

; 1608 : 		resetGlobals();

	call	?resetGlobals@@YAXXZ			; resetGlobals

; 1609 : 	}

	mov	eax, $LN17@m_dealloca
	ret	0
$LN32@m_dealloca:
_TEXT	ENDS
;	COMDAT text$x
text$x	SEGMENT
__ehhandler$?m_deallocator@@YAXPBDI0IPBX@Z:
	mov	eax, OFFSET __ehfuncinfo$?m_deallocator@@YAXPBDI0IPBX@Z
	jmp	___CxxFrameHandler3
text$x	ENDS
?m_deallocator@@YAXPBDI0IPBX@Z ENDP			; m_deallocator
PUBLIC	??2@YAPAXI@Z					; operator new
EXTRN	?set_new_handler@std@@YAP6AXXZP6AXXZ@Z:PROC	; std::set_new_handler
; Function compile flags: /Ogtpy
;	COMDAT ??2@YAPAXI@Z
_TEXT	SEGMENT
_func$ = -16						; size = 4
$T41618 = -12						; size = 12
_reportedSize$ = 8					; size = 4
??2@YAPAXI@Z PROC					; operator new, COMDAT

; 810  : {

	sub	esp, 16					; 00000010H

; 811  : 	if (memoryPassthrough) return AllocMemory(reportedSize);

	cmp	BYTE PTR ?memoryPassthrough@@3_NA, 0	; memoryPassthrough
	je	SHORT $LN7@operator

; 862  : 		}
; 863  : 	}
; 864  : }

	add	esp, 16					; 00000010H

; 811  : 	if (memoryPassthrough) return AllocMemory(reportedSize);

	jmp	?AllocMemory@@YAPAXI@Z			; AllocMemory
$LN7@operator:

; 812  : 	#ifdef TEST_MEMORY_MANAGER
; 813  : 	log("[D] ENTER: new");
; 814  : 	#endif
; 815  : 
; 816  : 	// Save these off...
; 817  : 
; 818  : 	const	char		*file = sourceFile;
; 819  : 	const	unsigned int	line = sourceLine;
; 820  : 	const	char		*func = sourceFunc;

	mov	eax, DWORD PTR _sourceFunc
	push	ebx
	mov	ebx, DWORD PTR _sourceFile
	push	ebp
	mov	ebp, DWORD PTR _sourceLine
	push	esi

; 821  : 
; 822  : 	// ANSI says: allocation requests of 0 bytes will still return a valid value
; 823  : 
; 824  : 	if (reportedSize == 0) reportedSize = 1;

	mov	esi, DWORD PTR _reportedSize$[esp+24]
	test	esi, esi
	mov	DWORD PTR _func$[esp+28], eax
	jne	SHORT $LN14@operator
	mov	esi, 1
$LN14@operator:
	push	edi

; 825  : 
; 826  : 	// ANSI says: loop continuously because the error handler could possibly free up some memory
; 827  : 
; 828  : 	for(;;)
; 829  : 	{
; 830  : 		// Try the allocation
; 831  : 
; 832  : 		void	*ptr = m_allocator(file, line, func, m_alloc_new, reportedSize);

	push	esi
	push	1
	push	eax
	push	ebp
	push	ebx
	call	?m_allocator@@YAPAXPBDI0II@Z		; m_allocator
	add	esp, 20					; 00000014H

; 833  : 		if (ptr)

	test	eax, eax
	jne	SHORT $LN19@operator
	npad	4
$LL5@operator:

; 834  : 		{
; 835  : 			#ifdef TEST_MEMORY_MANAGER
; 836  : 			log("[D] EXIT : new");
; 837  : 			#endif
; 838  : 			return ptr;
; 839  : 		}
; 840  : 
; 841  : 		// There isn't a way to determine the new handler, except through setting it. So we'll just set it to NULL, then
; 842  : 		// set it back again.
; 843  : 
; 844  : 		new_handler	nh = std::set_new_handler(0);

	push	0
	call	?set_new_handler@std@@YAP6AXXZP6AXXZ@Z	; std::set_new_handler
	mov	edi, eax

; 845  : 		std::set_new_handler(nh);

	push	edi
	call	?set_new_handler@std@@YAP6AXXZP6AXXZ@Z	; std::set_new_handler
	add	esp, 8

; 846  : 
; 847  : 		// If there is an error handler, call it
; 848  : 
; 849  : 		if (nh)

	test	edi, edi
	je	SHORT $LN2@operator

; 850  : 		{
; 851  : 			(*nh)();

	call	edi
	mov	ecx, DWORD PTR _func$[esp+32]
	push	esi
	push	1
	push	ecx
	push	ebp
	push	ebx
	call	?m_allocator@@YAPAXPBDI0II@Z		; m_allocator
	add	esp, 20					; 00000014H
	test	eax, eax
	je	SHORT $LL5@operator
$LN19@operator:
	pop	edi
	pop	esi
	pop	ebp
	pop	ebx

; 862  : 		}
; 863  : 	}
; 864  : }

	add	esp, 16					; 00000010H
	ret	0
$LN2@operator:

; 852  : 		}
; 853  : 
; 854  : 		// Otherwise, throw the exception
; 855  : 
; 856  : 		else
; 857  : 		{
; 858  : 			#ifdef TEST_MEMORY_MANAGER
; 859  : 			log("[D] EXIT : new");
; 860  : 			#endif
; 861  : 			throw std::bad_alloc();

	push	1
	push	OFFSET __bad_alloc_Message
	lea	ecx, DWORD PTR $T41618[esp+40]
	call	??0exception@std@@QAE@ABQBDH@Z		; std::exception::exception
	push	OFFSET __TI2?AVbad_alloc@std@@
	lea	edx, DWORD PTR $T41618[esp+36]
	push	edx
	mov	DWORD PTR $T41618[esp+40], OFFSET ??_7bad_alloc@std@@6B@
	call	__CxxThrowException@8
$LN22@operator:
$LN21@operator:
	int	3
??2@YAPAXI@Z ENDP					; operator new
_TEXT	ENDS
PUBLIC	??_U@YAPAXI@Z					; operator new[]
; Function compile flags: /Ogtpy
;	COMDAT ??_U@YAPAXI@Z
_TEXT	SEGMENT
_func$ = -16						; size = 4
$T41636 = -12						; size = 12
_reportedSize$ = 8					; size = 4
??_U@YAPAXI@Z PROC					; operator new[], COMDAT

; 869  : {

	sub	esp, 16					; 00000010H

; 870  : 	if (memoryPassthrough) return AllocMemory(reportedSize); 

	cmp	BYTE PTR ?memoryPassthrough@@3_NA, 0	; memoryPassthrough
	je	SHORT $LN7@operator@2

; 921  : 		}
; 922  : 	}
; 923  : }

	add	esp, 16					; 00000010H

; 870  : 	if (memoryPassthrough) return AllocMemory(reportedSize); 

	jmp	?AllocMemory@@YAPAXI@Z			; AllocMemory
$LN7@operator@2:

; 871  : 	#ifdef TEST_MEMORY_MANAGER
; 872  : 	log("[D] ENTER: new[]");
; 873  : 	#endif
; 874  : 
; 875  : 	// Save these off...
; 876  : 
; 877  : 	const	char		*file = sourceFile;
; 878  : 	const	unsigned int	line = sourceLine;
; 879  : 	const	char		*func = sourceFunc;

	mov	eax, DWORD PTR _sourceFunc
	push	ebx
	mov	ebx, DWORD PTR _sourceFile
	push	ebp
	mov	ebp, DWORD PTR _sourceLine
	push	esi

; 880  : 
; 881  : 	// The ANSI standard says that allocation requests of 0 bytes will still return a valid value
; 882  : 
; 883  : 	if (reportedSize == 0) reportedSize = 1;

	mov	esi, DWORD PTR _reportedSize$[esp+24]
	test	esi, esi
	mov	DWORD PTR _func$[esp+28], eax
	jne	SHORT $LN12@operator@2
	mov	esi, 1
$LN12@operator@2:
	push	edi

; 884  : 
; 885  : 	// ANSI says: loop continuously because the error handler could possibly free up some memory
; 886  : 
; 887  : 	for(;;)
; 888  : 	{
; 889  : 		// Try the allocation
; 890  : 
; 891  : 		void	*ptr = m_allocator(file, line, func, m_alloc_new_array, reportedSize);

	push	esi
	push	2
	push	eax
	push	ebp
	push	ebx
	call	?m_allocator@@YAPAXPBDI0II@Z		; m_allocator
	add	esp, 20					; 00000014H

; 892  : 		if (ptr)

	test	eax, eax
	jne	SHORT $LN18@operator@2
	npad	4
$LL5@operator@2:

; 893  : 		{
; 894  : 			#ifdef TEST_MEMORY_MANAGER
; 895  : 			log("[D] EXIT : new[]");
; 896  : 			#endif
; 897  : 			return ptr;
; 898  : 		}
; 899  : 
; 900  : 		// There isn't a way to determine the new handler, except through setting it. So we'll just set it to NULL, then
; 901  : 		// set it back again.
; 902  : 
; 903  : 		new_handler	nh = std::set_new_handler(0);

	push	0
	call	?set_new_handler@std@@YAP6AXXZP6AXXZ@Z	; std::set_new_handler
	mov	edi, eax

; 904  : 		std::set_new_handler(nh);

	push	edi
	call	?set_new_handler@std@@YAP6AXXZP6AXXZ@Z	; std::set_new_handler
	add	esp, 8

; 905  : 
; 906  : 		// If there is an error handler, call it
; 907  : 
; 908  : 		if (nh)

	test	edi, edi
	je	SHORT $LN2@operator@2

; 909  : 		{
; 910  : 			(*nh)();

	call	edi
	mov	ecx, DWORD PTR _func$[esp+32]
	push	esi
	push	2
	push	ecx
	push	ebp
	push	ebx
	call	?m_allocator@@YAPAXPBDI0II@Z		; m_allocator
	add	esp, 20					; 00000014H
	test	eax, eax
	je	SHORT $LL5@operator@2
$LN18@operator@2:
	pop	edi
	pop	esi
	pop	ebp
	pop	ebx

; 921  : 		}
; 922  : 	}
; 923  : }

	add	esp, 16					; 00000010H
	ret	0
$LN2@operator@2:

; 911  : 		}
; 912  : 
; 913  : 		// Otherwise, throw the exception
; 914  : 
; 915  : 		else
; 916  : 		{
; 917  : 			#ifdef TEST_MEMORY_MANAGER
; 918  : 			log("[D] EXIT : new[]");
; 919  : 			#endif
; 920  : 			throw std::bad_alloc();

	push	1
	push	OFFSET __bad_alloc_Message
	lea	ecx, DWORD PTR $T41636[esp+40]
	call	??0exception@std@@QAE@ABQBDH@Z		; std::exception::exception
	push	OFFSET __TI2?AVbad_alloc@std@@
	lea	edx, DWORD PTR $T41636[esp+36]
	push	edx
	mov	DWORD PTR $T41636[esp+40], OFFSET ??_7bad_alloc@std@@6B@
	call	__CxxThrowException@8
$LN21@operator@2:
$LN20@operator@2:
	int	3
??_U@YAPAXI@Z ENDP					; operator new[]
_TEXT	ENDS
PUBLIC	??2@YAPAXIPBDH@Z				; operator new
; Function compile flags: /Ogtpy
;	COMDAT ??2@YAPAXIPBDH@Z
_TEXT	SEGMENT
$T41653 = -12						; size = 12
_reportedSize$ = 8					; size = 4
_sourceFile$ = 12					; size = 4
_sourceLine$ = 16					; size = 4
??2@YAPAXIPBDH@Z PROC					; operator new, COMDAT

; 934  : {

	sub	esp, 12					; 0000000cH

; 935  : 	if (memoryPassthrough) return AllocMemory(reportedSize); 

	cmp	BYTE PTR ?memoryPassthrough@@3_NA, 0	; memoryPassthrough
	je	SHORT $LN7@operator@3
	mov	eax, DWORD PTR _reportedSize$[esp+8]
	push	eax
	call	?AllocMemory@@YAPAXI@Z			; AllocMemory
	add	esp, 4

; 980  : 		}
; 981  : 	}
; 982  : }

	add	esp, 12					; 0000000cH
	ret	0
$LN7@operator@3:
	push	edi

; 936  : 	#ifdef TEST_MEMORY_MANAGER
; 937  : 	log("[D] ENTER: new");
; 938  : 	#endif
; 939  : 
; 940  : 	// The ANSI standard says that allocation requests of 0 bytes will still return a valid value
; 941  : 
; 942  : 	if (reportedSize == 0) reportedSize = 1;

	mov	edi, DWORD PTR _reportedSize$[esp+12]
	test	edi, edi
	jne	SHORT $LN14@operator@3
	mov	edi, 1
$LN14@operator@3:
	push	ebx

; 943  : 
; 944  : 	// ANSI says: loop continuously because the error handler could possibly free up some memory
; 945  : 
; 946  : 	for(;;)
; 947  : 	{
; 948  : 		// Try the allocation
; 949  : 
; 950  : 		void	*ptr = m_allocator(sourceFile, sourceLine, "??", m_alloc_new, reportedSize);

	mov	ebx, DWORD PTR _sourceLine$[esp+16]
	push	ebp
	mov	ebp, DWORD PTR _sourceFile$[esp+20]
	push	esi
	push	edi
	push	1
	push	OFFSET ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	push	ebx
	push	ebp
	call	?m_allocator@@YAPAXPBDI0II@Z		; m_allocator
	add	esp, 20					; 00000014H

; 951  : 		if (ptr)

	test	eax, eax
	jne	SHORT $LN17@operator@3
	npad	4
$LL5@operator@3:

; 952  : 		{
; 953  : 			#ifdef TEST_MEMORY_MANAGER
; 954  : 			log("[D] EXIT : new");
; 955  : 			#endif
; 956  : 			return ptr;
; 957  : 		}
; 958  : 
; 959  : 		// There isn't a way to determine the new handler, except through setting it. So we'll just set it to NULL, then
; 960  : 		// set it back again.
; 961  : 
; 962  : 		new_handler	nh = std::set_new_handler(0);

	push	0
	call	?set_new_handler@std@@YAP6AXXZP6AXXZ@Z	; std::set_new_handler
	mov	esi, eax

; 963  : 		std::set_new_handler(nh);

	push	esi
	call	?set_new_handler@std@@YAP6AXXZP6AXXZ@Z	; std::set_new_handler
	add	esp, 8

; 964  : 
; 965  : 		// If there is an error handler, call it
; 966  : 
; 967  : 		if (nh)

	test	esi, esi
	je	SHORT $LN2@operator@3

; 968  : 		{
; 969  : 			(*nh)();

	call	esi
	push	edi
	push	1
	push	OFFSET ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	push	ebx
	push	ebp
	call	?m_allocator@@YAPAXPBDI0II@Z		; m_allocator
	add	esp, 20					; 00000014H
	test	eax, eax
	je	SHORT $LL5@operator@3
$LN17@operator@3:
	pop	esi
	pop	ebp
	pop	ebx
	pop	edi

; 980  : 		}
; 981  : 	}
; 982  : }

	add	esp, 12					; 0000000cH
	ret	0
$LN2@operator@3:

; 970  : 		}
; 971  : 
; 972  : 		// Otherwise, throw the exception
; 973  : 
; 974  : 		else
; 975  : 		{
; 976  : 			#ifdef TEST_MEMORY_MANAGER
; 977  : 			log("[D] EXIT : new");
; 978  : 			#endif
; 979  : 			throw std::bad_alloc();

	push	1
	push	OFFSET __bad_alloc_Message
	lea	ecx, DWORD PTR $T41653[esp+36]
	call	??0exception@std@@QAE@ABQBDH@Z		; std::exception::exception
	push	OFFSET __TI2?AVbad_alloc@std@@
	lea	ecx, DWORD PTR $T41653[esp+32]
	push	ecx
	mov	DWORD PTR $T41653[esp+36], OFFSET ??_7bad_alloc@std@@6B@
	call	__CxxThrowException@8
$LN21@operator@3:
$LN20@operator@3:
	int	3
??2@YAPAXIPBDH@Z ENDP					; operator new
_TEXT	ENDS
PUBLIC	??_U@YAPAXIPBDH@Z				; operator new[]
; Function compile flags: /Ogtpy
;	COMDAT ??_U@YAPAXIPBDH@Z
_TEXT	SEGMENT
$T41670 = -12						; size = 12
_reportedSize$ = 8					; size = 4
_sourceFile$ = 12					; size = 4
_sourceLine$ = 16					; size = 4
??_U@YAPAXIPBDH@Z PROC					; operator new[], COMDAT

; 987  : {

	sub	esp, 12					; 0000000cH

; 988  : 	if (memoryPassthrough) return AllocMemory(reportedSize); 

	cmp	BYTE PTR ?memoryPassthrough@@3_NA, 0	; memoryPassthrough
	je	SHORT $LN7@operator@4
	mov	eax, DWORD PTR _reportedSize$[esp+8]
	push	eax
	call	?AllocMemory@@YAPAXI@Z			; AllocMemory
	add	esp, 4

; 1033 : 		}
; 1034 : 	}
; 1035 : }

	add	esp, 12					; 0000000cH
	ret	0
$LN7@operator@4:
	push	edi

; 989  : 	#ifdef TEST_MEMORY_MANAGER
; 990  : 	log("[D] ENTER: new[]");
; 991  : 	#endif
; 992  : 
; 993  : 	// The ANSI standard says that allocation requests of 0 bytes will still return a valid value
; 994  : 
; 995  : 	if (reportedSize == 0) reportedSize = 1;

	mov	edi, DWORD PTR _reportedSize$[esp+12]
	test	edi, edi
	jne	SHORT $LN12@operator@4
	mov	edi, 1
$LN12@operator@4:
	push	ebx

; 996  : 
; 997  : 	// ANSI says: loop continuously because the error handler could possibly free up some memory
; 998  : 
; 999  : 	for(;;)
; 1000 : 	{
; 1001 : 		// Try the allocation
; 1002 : 
; 1003 : 		void	*ptr = m_allocator(sourceFile, sourceLine, "??", m_alloc_new_array, reportedSize);

	mov	ebx, DWORD PTR _sourceLine$[esp+16]
	push	ebp
	mov	ebp, DWORD PTR _sourceFile$[esp+20]
	push	esi
	push	edi
	push	2
	push	OFFSET ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	push	ebx
	push	ebp
	call	?m_allocator@@YAPAXPBDI0II@Z		; m_allocator
	add	esp, 20					; 00000014H

; 1004 : 		if (ptr)

	test	eax, eax
	jne	SHORT $LN16@operator@4
	npad	4
$LL5@operator@4:

; 1005 : 		{
; 1006 : 			#ifdef TEST_MEMORY_MANAGER
; 1007 : 			log("[D] EXIT : new[]");
; 1008 : 			#endif
; 1009 : 			return ptr;
; 1010 : 		}
; 1011 : 
; 1012 : 		// There isn't a way to determine the new handler, except through setting it. So we'll just set it to NULL, then
; 1013 : 		// set it back again.
; 1014 : 
; 1015 : 		new_handler	nh = std::set_new_handler(0);

	push	0
	call	?set_new_handler@std@@YAP6AXXZP6AXXZ@Z	; std::set_new_handler
	mov	esi, eax

; 1016 : 		std::set_new_handler(nh);

	push	esi
	call	?set_new_handler@std@@YAP6AXXZP6AXXZ@Z	; std::set_new_handler
	add	esp, 8

; 1017 : 
; 1018 : 		// If there is an error handler, call it
; 1019 : 
; 1020 : 		if (nh)

	test	esi, esi
	je	SHORT $LN2@operator@4

; 1021 : 		{
; 1022 : 			(*nh)();

	call	esi
	push	edi
	push	2
	push	OFFSET ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	push	ebx
	push	ebp
	call	?m_allocator@@YAPAXPBDI0II@Z		; m_allocator
	add	esp, 20					; 00000014H
	test	eax, eax
	je	SHORT $LL5@operator@4
$LN16@operator@4:
	pop	esi
	pop	ebp
	pop	ebx
	pop	edi

; 1033 : 		}
; 1034 : 	}
; 1035 : }

	add	esp, 12					; 0000000cH
	ret	0
$LN2@operator@4:

; 1023 : 		}
; 1024 : 
; 1025 : 		// Otherwise, throw the exception
; 1026 : 
; 1027 : 		else
; 1028 : 		{
; 1029 : 			#ifdef TEST_MEMORY_MANAGER
; 1030 : 			log("[D] EXIT : new[]");
; 1031 : 			#endif
; 1032 : 			throw std::bad_alloc();

	push	1
	push	OFFSET __bad_alloc_Message
	lea	ecx, DWORD PTR $T41670[esp+36]
	call	??0exception@std@@QAE@ABQBDH@Z		; std::exception::exception
	push	OFFSET __TI2?AVbad_alloc@std@@
	lea	ecx, DWORD PTR $T41670[esp+32]
	push	ecx
	mov	DWORD PTR $T41670[esp+36], OFFSET ??_7bad_alloc@std@@6B@
	call	__CxxThrowException@8
$LN20@operator@4:
$LN19@operator@4:
	int	3
??_U@YAPAXIPBDH@Z ENDP					; operator new[]
_TEXT	ENDS
PUBLIC	??_C@_0DB@LJLLMNJM@?$FL?9?$FN?5?9?9?9?9?9?5?$CF8s?5of?5NULL?5?5?5?5?5?5?5?5?5?5?5@ ; `string'
PUBLIC	??3@YAXPAX@Z					; operator delete
;	COMDAT ??_C@_0DB@LJLLMNJM@?$FL?9?$FN?5?9?9?9?9?9?5?$CF8s?5of?5NULL?5?5?5?5?5?5?5?5?5?5?5@
CONST	SEGMENT
??_C@_0DB@LJLLMNJM@?$FL?9?$FN?5?9?9?9?9?9?5?$CF8s?5of?5NULL?5?5?5?5?5?5?5?5?5?5?5@ DB '['
	DB	'-] ----- %8s of NULL                      by %s', 00H ; `string'
; Function compile flags: /Ogtpy
CONST	ENDS
;	COMDAT ??3@YAXPAX@Z
_TEXT	SEGMENT
_reportedAddress$ = 8					; size = 4
??3@YAXPAX@Z PROC					; operator delete, COMDAT

; 1046 : 	if(memoryDestroyPassthrough)

	cmp	BYTE PTR ?memoryDestroyPassthrough@@3_NA, 0 ; memoryDestroyPassthrough
	je	SHORT $LN4@operator@5

; 1047 : 	{
; 1048 : 		DeallocMemory(reportedAddress);

	jmp	?DeallocMemory@@YAXPAX@Z		; DeallocMemory
$LN4@operator@5:

; 1049 : 		return;
; 1050 : 	}
; 1051 : 	#ifdef TEST_MEMORY_MANAGER
; 1052 : 	log("[D] ENTER: delete");
; 1053 : 	#endif
; 1054 : 
; 1055 : 	// ANSI says: delete & delete[] allow NULL pointers (they do nothing)
; 1056 : 
; 1057 : 	if (reportedAddress) m_deallocator(sourceFile, sourceLine, sourceFunc, m_alloc_delete, reportedAddress);

	mov	eax, DWORD PTR _reportedAddress$[esp-4]
	test	eax, eax
	je	SHORT $LN3@operator@5
	mov	ecx, DWORD PTR _sourceFunc
	mov	edx, DWORD PTR _sourceLine
	push	eax
	mov	eax, DWORD PTR _sourceFile
	push	6
	push	ecx
	push	edx
	push	eax
	call	?m_deallocator@@YAXPBDI0IPBX@Z		; m_deallocator
	jmp	SHORT $LN10@operator@5
$LN3@operator@5:

; 1058 : 	else if (alwaysLogAll) log("[-] ----- %8s of NULL                      by %s", allocationTypes[m_alloc_delete], ownerString(sourceFile, sourceLine, sourceFunc));

	cmp	BYTE PTR _alwaysLogAll, 0
	je	SHORT $LN1@operator@5
	mov	ecx, DWORD PTR _sourceFunc
	mov	edx, DWORD PTR _sourceLine
	mov	eax, DWORD PTR _sourceFile
	push	ecx
	push	edx
	call	?ownerString@@YAPBDPBDI0@Z		; ownerString
	push	eax
	mov	eax, DWORD PTR _allocationTypes+24
	push	eax
	push	OFFSET ??_C@_0DB@LJLLMNJM@?$FL?9?$FN?5?9?9?9?9?9?5?$CF8s?5of?5NULL?5?5?5?5?5?5?5?5?5?5?5@
	call	?log@@YAXPBDZZ				; log
$LN10@operator@5:
	add	esp, 20					; 00000014H
$LN1@operator@5:

; 1059 : 
; 1060 : 	// Resetting the globals insures that if at some later time, somebody calls our memory manager from an unknown
; 1061 : 	// source (i.e. they didn't include our H file) then we won't think it was the last allocation.
; 1062 : 
; 1063 : 	resetGlobals();

	mov	eax, OFFSET ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	mov	DWORD PTR _sourceFile, eax
	mov	DWORD PTR _sourceLine, 0
	mov	DWORD PTR _sourceFunc, eax

; 1064 : 
; 1065 : 	#ifdef TEST_MEMORY_MANAGER
; 1066 : 	log("[D] EXIT : delete");
; 1067 : 	#endif
; 1068 : }

	ret	0
??3@YAXPAX@Z ENDP					; operator delete
_TEXT	ENDS
PUBLIC	??_V@YAXPAX@Z					; operator delete[]
; Function compile flags: /Ogtpy
;	COMDAT ??_V@YAXPAX@Z
_TEXT	SEGMENT
_reportedAddress$ = 8					; size = 4
??_V@YAXPAX@Z PROC					; operator delete[], COMDAT

; 1074 : 	if(memoryDestroyPassthrough)

	cmp	BYTE PTR ?memoryDestroyPassthrough@@3_NA, 0 ; memoryDestroyPassthrough
	je	SHORT $LN4@operator@6

; 1075 : 	{
; 1076 : 		DeallocMemory(reportedAddress);

	jmp	?DeallocMemory@@YAXPAX@Z		; DeallocMemory
$LN4@operator@6:

; 1077 : 		return;
; 1078 : 	}
; 1079 : 	#ifdef TEST_MEMORY_MANAGER
; 1080 : 	log("[D] ENTER: delete[]");
; 1081 : 	#endif
; 1082 : 
; 1083 : 	// ANSI says: delete & delete[] allow NULL pointers (they do nothing)
; 1084 : 
; 1085 : 	if (reportedAddress) m_deallocator(sourceFile, sourceLine, sourceFunc, m_alloc_delete_array, reportedAddress);

	mov	eax, DWORD PTR _reportedAddress$[esp-4]
	test	eax, eax
	je	SHORT $LN3@operator@6
	mov	ecx, DWORD PTR _sourceFunc
	mov	edx, DWORD PTR _sourceLine
	push	eax
	mov	eax, DWORD PTR _sourceFile
	push	7
	push	ecx
	push	edx
	push	eax
	call	?m_deallocator@@YAXPBDI0IPBX@Z		; m_deallocator
	jmp	SHORT $LN10@operator@6
$LN3@operator@6:

; 1086 : 	else if (alwaysLogAll)

	cmp	BYTE PTR _alwaysLogAll, 0
	je	SHORT $LN1@operator@6

; 1087 : 		log("[-] ----- %8s of NULL                      by %s", allocationTypes[m_alloc_delete_array], ownerString(sourceFile, sourceLine, sourceFunc));

	mov	ecx, DWORD PTR _sourceFunc
	mov	edx, DWORD PTR _sourceLine
	mov	eax, DWORD PTR _sourceFile
	push	ecx
	push	edx
	call	?ownerString@@YAPBDPBDI0@Z		; ownerString
	push	eax
	mov	eax, DWORD PTR _allocationTypes+28
	push	eax
	push	OFFSET ??_C@_0DB@LJLLMNJM@?$FL?9?$FN?5?9?9?9?9?9?5?$CF8s?5of?5NULL?5?5?5?5?5?5?5?5?5?5?5@
	call	?log@@YAXPBDZZ				; log
$LN10@operator@6:
	add	esp, 20					; 00000014H
$LN1@operator@6:

; 1088 : 
; 1089 : 	// Resetting the globals insures that if at some later time, somebody calls our memory manager from an unknown
; 1090 : 	// source (i.e. they didn't include our H file) then we won't think it was the last allocation.
; 1091 : 
; 1092 : 	resetGlobals();

	mov	eax, OFFSET ??_C@_02HHFHKOHM@?$DP?$DP?$AA@
	mov	DWORD PTR _sourceFile, eax
	mov	DWORD PTR _sourceLine, 0
	mov	DWORD PTR _sourceFunc, eax

; 1093 : 
; 1094 : 	#ifdef TEST_MEMORY_MANAGER
; 1095 : 	log("[D] EXIT : delete[]");
; 1096 : 	#endif
; 1097 : }

	ret	0
??_V@YAXPAX@Z ENDP					; operator delete[]
; Function compile flags: /Ogtpy
_TEXT	ENDS
;	COMDAT ??_Gbad_alloc@std@@UAEPAXI@Z
_TEXT	SEGMENT
___flags$ = 8						; size = 4
??_Gbad_alloc@std@@UAEPAXI@Z PROC			; std::bad_alloc::`scalar deleting destructor', COMDAT
; _this$ = ecx
	push	esi
	mov	esi, ecx
	mov	DWORD PTR [esi], OFFSET ??_7bad_alloc@std@@6B@
	call	??1exception@std@@UAE@XZ		; std::exception::~exception
	test	BYTE PTR ___flags$[esp], 1
	je	SHORT $LN6@scalar
	push	esi
	call	??3@YAXPAX@Z				; operator delete
	add	esp, 4
$LN6@scalar:
	mov	eax, esi
	pop	esi
	ret	4
??_Gbad_alloc@std@@UAEPAXI@Z ENDP			; std::bad_alloc::`scalar deleting destructor'
_TEXT	ENDS
EXTRN	_atexit:PROC
; Function compile flags: /Ogtpy
;	COMDAT ??__Emstt@@YAXXZ
text$yc	SEGMENT
??__Emstt@@YAXXZ PROC					; `dynamic initializer for 'mstt'', COMDAT

; 646  : static	MemStaticTimeTracker	mstt;

	call	?doCleanupLogOnFirstRun@@YAXXZ		; doCleanupLogOnFirstRun
	push	OFFSET ??__Fmstt@@YAXXZ			; `dynamic atexit destructor for 'mstt''
	call	_atexit
	pop	ecx
	ret	0
??__Emstt@@YAXXZ ENDP					; `dynamic initializer for 'mstt''
; Function compile flags: /Ogtpy
text$yc	ENDS
;	COMDAT ??__Fmstt@@YAXXZ
text$yd	SEGMENT
??__Fmstt@@YAXXZ PROC					; `dynamic atexit destructor for 'mstt'', COMDAT
	mov	BYTE PTR _staticDeinitTime, 1
	call	?dumpLeakReport@@YAXXZ			; dumpLeakReport
	push	OFFSET ?criticalSection@@3U_RTL_CRITICAL_SECTION@@A ; criticalSection
	call	DWORD PTR __imp__DeleteCriticalSection@4
	mov	BYTE PTR ?criticalInitialized@@3_NA, 0	; criticalInitialized
	ret	0
??__Fmstt@@YAXXZ ENDP					; `dynamic atexit destructor for 'mstt''
text$yd	ENDS
_BSS	SEGMENT
_mstt	DB	01H DUP (?)
_BSS	ENDS
CRT$XCU	SEGMENT
_mstt$initializer$ DD FLAT:??__Emstt@@YAXXZ
CRT$XCU	ENDS
END
