Function at 0x40da4b
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x54
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x58]
push esi
mov esi, ecx
mov ecx, dword [esp + 0x60]
push edi
push eax
push ecx
push edx
mov ecx, esi
mov dword [esp + 0x40], esi
call fcn.00492640
test eax, eax
jne 0x40da6d
pop edi
pop esi
add esp, 0x54
ret 0xc
mov ecx, dword [esi + 8]
push str.STATES_BOOTY
call fcn.004b79d0
xor edi, edi
mov dword [esi + 0x20], eax
cmp eax, edi
jne 0x40da8d
pop edi
xor eax, eax
pop esi
add esp, 0x54
ret 0xc
mov ecx, dword [esi + 8]
push 0x521774
call fcn.004b79d0
cmp eax, edi
mov dword [esi + 0x24], eax
jne 0x40daab
pop edi
xor eax, eax
pop esi
add esp, 0x54
ret 0xc
mov eax, dword [esi + 4]
cmp dword [eax + 0x1b0], edi
je 0x40db18
mov ecx, dword [esi + 0x20]
push str.IMAGES
call fcn.004b76b0
cmp eax, edi
jne 0x40dad1
pop edi
xor eax, eax
pop esi
add esp, 0x54
ret 0xc
mov ecx, dword [esi + 0xc]
push 0x521768
push str.BOOTY
push eax
mov ecx, dword [ecx + 0x10]
mov edx, dword [ecx]
call dword [edx + pe_nt_image_headers32]
mov ecx, dword [esi + 0x20]
push str.ANIS
call fcn.004b76b0
cmp eax, edi
jne 0x40db02
pop edi
xor eax, eax
pop esi
add esp, 0x54
ret 0xc
push 0x521768
push str.BOOTY
push eax
mov eax, dword [esi + 0xc]
mov ecx, dword [eax + 0x2c]
call fcn.004cece0
mov ecx, dword [0x52c668]
push ebx
push ebp
mov dword [esp + 0x70], ecx
lea ebp, [esp + 0x40]
mov ebx, 0x521dd8
mov edx, dword [ebx]
lea eax, [esp + 0x70]
push edx
push 0x5220d4
push eax
call fcn.004fafb8
mov ecx, dword [esp + 0x7c]
add ebx, 0x20
add esp, 0xc
add ebp, 4
mov edx, dword [ecx - 8]
cmp ebx, 0x521ef8
mov dword [ebp - 4], edx
jl 0x40db2d
xor ebp, ebp
mov ecx, 0x532c80
mov eax, 0x521dd8
mov edx, dword [ecx]
add ecx, 4
imul edx, dword [eax]
add eax, 0x20
add ebp, edx
cmp eax, 0x521ef8
jl 0x40db66
mov eax, dword [0x532c3c]
push edi
mov dword [esp + 0x2c], eax
sub eax, ebp
mov dword [esp + 0x28], eax
mov eax, dword [esi + 0xc]
push str.SimpleAnimation
push 0x270e
mov ecx, dword [eax + 8]
push 0x1d2
push 0x1a4
push edi
mov dword [esp + 0x4c], ebp
call fcn.004c9480
mov ebx, eax
push 5
push str.BOOTY_SYMBOLS
mov ecx, ebx
mov dword [esp + 0x34], ebx
call fcn.004c6d60
mov ecx, dword [ebx + 0x7c]
push 0x60
mov dword [esp + 0x6c], ecx
call fcn.004fcaea
add esp, 4
cmp eax, edi
je 0x40dbea
mov dword [eax + 0x28], vtable.CStatsNumber.0
mov dword [eax], vtable.CStatsItem.0
mov dword [esp + 0x6c], eax
jmp 0x40dbee
mov dword [esp + 0x6c], edi
mov ecx, dword [esp + 0x6c]
push 0x1d2
push 4
push 0x1a4
push 1
push 0x63
push 0xa
push ebx
call fcn.00493d50
mov eax, dword [esp + 0x68]
mov edx, dword [esp + 0x6c]
push 0x34
mov dword [eax + 0x18], edx
call fcn.004fcaea
add esp, 4
cmp eax, edi
je 0x40dc2f
mov dword [eax], vtable.CStatsNumber.0
mov dword [esp + 0x6c], eax
jmp 0x40dc33
mov dword [esp + 0x6c], edi
push ebp
lea ecx, [esp + 0x74]
push 0x5220d4
push ecx
call fcn.004fafb8
mov edx, dword [esp + 0x7c]
add esp, 0xc
mov ecx, dword [esp + 0x6c]
mov eax, dword [edx - 8]
push str.BOOTY_SCORENUMBERS
push 0xffffffffffffffff
push 0x1ea
push 0xb
push eax
push edi
push ebx
call fcn.004939d0
mov ecx, dword [esi + 0xc]
push edi
push str.SimpleAnimation
push 0x270e
mov ecx, dword [ecx + 8]
push 0x1d2
push 0x5a
push edi
call fcn.004c9480
mov ebx, eax
push 4
push str.BOOTY_SYMBOLS
mov ecx, ebx
mov dword [esp + 0x38], ebx
call fcn.004c6d60
mov edx, dword [ebx + 0x7c]
push 0x60
mov dword [esp + 0x6c], edx
call fcn.004fcaea
add esp, 4
cmp eax, edi
je 0x40dcbf
mov dword [eax + 0x28], vtable.CStatsNumber.0
mov dword [eax], vtable.CStatsItem.0
mov ebp, eax
jmp 0x40dcc1
xor ebp, ebp
push 0x1d2
push 4
push 0x5a
push 1
push 0x63
push 0xa
push ebx
mov ecx, ebp
call fcn.00493d50
mov eax, dword [esp + 0x68]
push 0x34
mov dword [eax + 0x18], ebp
call fcn.004fcaea
add esp, 4
cmp eax, edi
je 0x40dcf9
mov dword [eax], vtable.CStatsNumber.0
mov dword [esp + 0x68], eax
jmp 0x40dcfd
mov dword [esp + 0x68], edi
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x70]
push ecx
push 0x5220d4
push edx
call fcn.004fafb8
mov eax, dword [esp + 0x7c]
mov edx, dword [esp + 0x30]
add esp, 0xc
mov ecx, dword [eax - 8]
push str.BOOTY_SCORENUMBERS
push 0xffffffffffffffff
push 0x9b
push 0xb
push ecx
mov ecx, dword [esp + 0x7c]
push edx
push ebx
call fcn.004939d0
lea eax, [esi + 0x15c]
mov dword [0x532830], 1
mov dword [esp + 0x14], edi
mov dword [esp + 0x24], 0x37
mov dword [esp + 0x20], 8
mov dword [esp + 0x18], eax
mov ebx, 0x521eec
mov dword [esp + 0x1c], edi
mov edx, dword [esp + 0x14]
mov ecx, dword [esi + 0xc]
push edi
add edx, 0x270e
mov ecx, dword [ecx + 8]
push str.TreasureCounter
push edx
push 0xffffffffffffff9c
push 0xffffffffffffff9c
push edi
call fcn.004c9480
mov ebp, eax
mov eax, dword [esp + 0x18]
cmp ebp, edi
mov dword [eax], ebp
je 0x40df6a
mov ecx, dword [ebx - 0x1c]
push ecx
lea ecx, [esp + 0x14]
call fcn.004fce17
mov eax, dword [ebx]
cmp eax, edi
jl 0x40ddbf
mov edx, dword [eax*4 + 0x521ef0]
lea ecx, [esp + 0x10]
push edx
call fcn.004fd139
mov eax, dword [esp + 0x10]
mov ecx, ebp
push eax
call fcn.004c6dd0
mov ecx, dword [ebp + 0x7c]
push 0xb8
mov dword [esp + 0x3c], ecx
call fcn.004fcaea
add esp, 4
cmp eax, edi
je 0x40de83
mov dword [eax + 0x28], vtable.CStatsNumber.0
mov dword [eax], vtable.CTcVars.0
mov dword [eax + 0x60], edi
mov dword [eax + 0x64], edi
mov dword [eax + 0x68], edi
mov dword [eax + 0x6c], edi
mov dword [eax + 0x74], edi
mov dword [eax + 0x78], edi
mov dword [eax + 0x7c], edi
mov dword [eax + 0x70], edi
mov dword [eax + 0x80], edi
mov dword [eax + 0x84], edi
mov dword [eax + 0x88], edi
mov dword [0x52b9e0], 8
mov dword [eax + 0xa8], edi
mov dword [eax + 0x8c], edi
mov dword [eax + 0x90], edi
mov dword [eax + 0x94], edi
mov dword [eax + 0x98], 1
mov dword [eax + 0x9c], edi
mov dword [eax + 0xa0], edi
mov dword [eax + 0xa4], edi
mov dword [eax + 0xac], 0x3ff00000
mov dword [eax + 0xb0], edi
mov dword [eax + 0xb4], edi
mov ecx, dword [0x53b1fc]
inc ecx
mov esi, eax
mov dword [0x53b1fc], ecx
jmp 0x40de85
xor esi, esi
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
mov edx, dword [ecx + 0x532ca0]
mov dword [esi + 0x8c], eax
mov eax, edx
mov dword [esi + 0x90], edx
mov dword [esi + 0x94], eax
mov edx, dword [ebx - 4]
mov dword [esi + 0x98], edx
mov ecx, dword [ecx + 0x536b5c]
cmp ecx, eax
jle 0x40debc
mov eax, ecx
mov ecx, dword [esp + 0x6c]
mov edx, dword [esp + 0x68]
mov dword [esi + 0x9c], eax
mov eax, dword [esp + 0x24]
mov dword [esi + 0xa0], 0xa0
mov dword [esi + 0xa4], eax
mov eax, dword [ebx - 0xc]
mov dword [0x53b200], ecx
mov dword [0x53b204], edx
mov dword [esi + 0xa8], eax
mov ecx, dword [ebx - 8]
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
mov dword [esi + 0xac], ecx
mov ecx, dword [esp + 0x28]
mov dword [esi + 0x84], eax
mov eax, dword [esi + 0xa4]
mov dword [esi + 0xb4], ecx
mov ecx, dword [esi + 0xa0]
push eax
push 4
push ecx
push 1
mov dword [esi + 0x88], edx
mov edx, dword [esp + 0x44]
push 0x63
push 0xa
push ebp
mov ecx, esi
mov dword [esi + 0xb0], edx
call fcn.00493d50
mov edx, dword [esp + 0x38]
mov dword [edx + 0x18], esi
mov eax, dword [esi + 0x90]
cmp eax, dword [esi + 0x9c]
je 0x40df5d
mov dword [0x532830], edi
lea ecx, [esp + 0x10]
call fcn.004fcda9
mov esi, dword [esp + 0x3c]
mov eax, dword [esp + 0x14]
mov ebp, dword [esp + 0x18]
mov edx, dword [esp + 0x24]
inc eax
add ebp, 4
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x18], ebp
mov ebp, dword [esp + 0x20]
sub eax, 4
sub ebx, 0x20
dec ebp
add edx, 0x2c
cmp eax, 0xffffffdc
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], ebp
mov dword [esp + 0x24], edx
jg 0x40dd6a
mov ecx, dword [esi + 4]
pop ebp
pop ebx
cmp dword [ecx + 0x1b0], edi
je 0x40dfc8
push str.030CUSTOM
lea ecx, [esi + 0x180]
call fcn.004fcee6
jmp 0x40e030
mov eax, dword [esi + 0x14]
mov edx, dword [0x52c668]
shl eax, 1
cmp eax, 0xa
mov dword [esp + 0x64], edx
mov ecx, 0x521d14
jl 0x40dfe6
mov ecx, 0x521d10
push eax
push ecx
lea eax, [esp + 0x6c]
push str._s_d
push eax
call fcn.004fafb8
add esp, 0x10
lea ecx, [esp + 0x64]
add esi, 0x180
push ecx
mov ecx, esi
call fcn.004fce96
cmp dword [0x532828], edi
je 0x40e01b
push 0x521cb4
jmp 0x40e020
push str.AMULET
mov ecx, esi
call fcn.004fd139
lea ecx, [esp + 0x64]
call fcn.004fcda9
lea ecx, [esp + 0x68]
call fcn.004fcda9
pop edi
mov eax, 1
pop esi
add esp, 0x54
ret 0xc