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

Disassembly:
push 0xffffffffffffffff
push 0x50fd98
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x54
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x64]
push ebx
push ebp
push esi
mov esi, ecx
mov ecx, dword [esp + 0x74]
push edi
push eax
push ecx
push edx
mov ecx, esi
mov dword [esp + 0x48], esi
call fcn.004961b0
test eax, eax
jne 0x40dde1
mov ecx, dword [esp + 0x64]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60
ret 0xc
mov ecx, dword [esi + 8]
push str.STATES_BOOTY
call fcn.004c06e0
xor ebx, ebx
mov dword [esi + 0x20], eax
cmp eax, ebx
jne 0x40de0e
xor eax, eax
mov ecx, dword [esp + 0x64]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60
ret 0xc
mov ecx, dword [esi + 8]
push str.CLAW
call fcn.004c06e0
cmp eax, ebx
mov dword [esi + 0x24], eax
jne 0x40de39
xor eax, eax
mov ecx, dword [esp + 0x64]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60
ret 0xc
mov eax, dword [esi + 4]
cmp dword [eax + 0x1b0], ebx
je 0x40dec0
mov ecx, dword [esi + 0x20]
push str.IMAGES
call fcn.004c0490
cmp eax, ebx
jne 0x40de6c
xor eax, eax
mov ecx, dword [esp + 0x64]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60
ret 0xc
mov ecx, dword [esi + 0xc]
push 0x534738
push str.BOOTY
push eax
mov ecx, dword [ecx + 0x10]
mov edx, dword [ecx]
call dword [edx + 0x48]
mov ecx, dword [esi + 0x20]
push str.ANIS
call fcn.004c0490
cmp eax, ebx
jne 0x40deaa
xor eax, eax
mov ecx, dword [esp + 0x64]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60
ret 0xc
push 0x534738
push str.BOOTY
push eax
mov eax, dword [esi + 0xc]
mov ecx, dword [eax + 0x2c]
call fcn.004d7740
lea ecx, [esp + 0x7c]
call fcn.00501a9a
mov dword [esp + 0x6c], ebx
lea ebp, [esp + 0x40]
mov edi, 0x534da8
mov ecx, dword [edi]
lea edx, [esp + 0x7c]
push ecx
push 0x5350a8
push edx
call fcn.00500338
mov eax, dword [esp + 0x88]
add edi, 0x20
add esp, 0xc
add ebp, 4
mov ecx, dword [eax - 8]
cmp edi, 0x534ec8
mov dword [ebp - 4], ecx
jl 0x40ded6
xor ebp, ebp
mov ecx, 0x5462b8
mov eax, 0x534da8
mov edx, dword [ecx]
add ecx, 4
imul edx, dword [eax]
add eax, 0x20
add ebp, edx
cmp eax, 0x534ec8
jl 0x40df12
mov eax, dword [0x546274]
push ebx
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 ebx
mov dword [esp + 0x4c], ebp
call fcn.004d21d0
mov edi, eax
push 5
push str.BOOTY_SYMBOLS
mov ecx, edi
mov dword [esp + 0x34], edi
call fcn.004d0c60
mov ecx, dword [edi + 0x6c]
push 0x60
mov dword [esp + 0x78], ecx
call fcn.00501a4d
add esp, 4
cmp eax, ebx
je 0x40df96
mov dword [eax + 0x28], vtable.CStatsNumber.0
mov dword [eax], vtable.CStatsItem.0
mov dword [esp + 0x78], eax
jmp 0x40df9a
mov dword [esp + 0x78], ebx
mov ecx, dword [esp + 0x78]
push 0x1d2
push 4
push 0x1a4
push 1
push 0x63
push 0xa
push edi
call fcn.004978f0
mov eax, dword [esp + 0x74]
mov edx, dword [esp + 0x78]
push 0x34
mov dword [eax + 0x18], edx
call fcn.00501a4d
add esp, 4
cmp eax, ebx
je 0x40dfdb
mov dword [eax], vtable.CStatsNumber.0
mov dword [esp + 0x78], eax
jmp 0x40dfdf
mov dword [esp + 0x78], ebx
push ebp
lea ecx, [esp + 0x80]
push 0x5350a8
push ecx
call fcn.00500338
mov edx, dword [esp + 0x88]
add esp, 0xc
mov ecx, dword [esp + 0x78]
mov eax, dword [edx - 8]
push str.BOOTY_SCORENUMBERS
push 0xffffffffffffffff
push 0x1ea
push 0xb
push eax
push ebx
push edi
call fcn.00497550
mov ecx, dword [esi + 0xc]
push ebx
push str.SimpleAnimation
push 0x270e
mov ecx, dword [ecx + 8]
push 0x1d2
push 0x5a
push ebx
call fcn.004d21d0
mov edi, eax
push 4
push str.BOOTY_SYMBOLS
mov ecx, edi
mov dword [esp + 0x38], edi
call fcn.004d0c60
mov edx, dword [edi + 0x6c]
push 0x60
mov dword [esp + 0x78], edx
call fcn.00501a4d
add esp, 4
cmp eax, ebx
je 0x40e071
mov dword [eax + 0x28], vtable.CStatsNumber.0
mov dword [eax], vtable.CStatsItem.0
mov ebp, eax
jmp 0x40e073
xor ebp, ebp
push 0x1d2
push 4
push 0x5a
push 1
push 0x63
push 0xa
push edi
mov ecx, ebp
call fcn.004978f0
mov eax, dword [esp + 0x74]
push 0x34
mov dword [eax + 0x18], ebp
call fcn.00501a4d
add esp, 4
cmp eax, ebx
je 0x40e0ab
mov dword [eax], vtable.CStatsNumber.0
mov dword [esp + 0x74], eax
jmp 0x40e0af
mov dword [esp + 0x74], ebx
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x7c]
push ecx
push 0x5350a8
push edx
call fcn.00500338
mov eax, dword [esp + 0x88]
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 + 0x88]
push edx
push edi
call fcn.00497550
lea eax, [esi + 0x15c]
mov dword [0x545f58], 1
mov dword [esp + 0x14], ebx
mov dword [esp + 0x24], 0x37
mov dword [esp + 0x20], 8
mov dword [esp + 0x18], eax
mov edi, 0x534ebc
mov dword [esp + 0x1c], ebx
mov ecx, dword [esp + 0x14]
mov edx, dword [esi + 0xc]
push ebx
add ecx, 0x270e
push str.TreasureCounter
push ecx
mov ecx, dword [edx + 8]
push 0xffffffffffffff9c
push 0xffffffffffffff9c
push ebx
call fcn.004d21d0
mov ebp, eax
mov eax, dword [esp + 0x18]
cmp ebp, ebx
mov dword [eax], ebp
je 0x40e32b
mov ecx, dword [edi - 0x1c]
push ecx
lea ecx, [esp + 0x14]
call fcn.00501c53
mov eax, dword [edi]
mov byte [esp + 0x6c], 1
cmp eax, ebx
jl 0x40e17c
mov edx, dword [eax*4 + 0x534ec0]
lea ecx, [esp + 0x10]
push edx
call fcn.00501f81
mov eax, dword [esp + 0x10]
mov ecx, ebp
push eax
call fcn.004d0cd0
mov ecx, dword [ebp + 0x6c]
push 0xb8
mov dword [esp + 0x3c], ecx
call fcn.00501a4d
add esp, 4
cmp eax, ebx
je 0x40e240
mov dword [eax + 0x28], vtable.CStatsNumber.0
mov dword [eax], vtable.CTcVars.0
mov dword [eax + 0x60], ebx
mov dword [eax + 0x64], ebx
mov dword [eax + 0x68], ebx
mov dword [eax + 0x6c], ebx
mov dword [eax + 0x74], ebx
mov dword [eax + 0x78], ebx
mov dword [eax + 0x7c], ebx
mov dword [eax + 0x70], ebx
mov dword [eax + 0x80], ebx
mov dword [eax + 0x84], ebx
mov dword [eax + 0x88], ebx
mov dword [0x53e8e0], 8
mov dword [eax + 0xa8], ebx
mov dword [eax + 0x8c], ebx
mov dword [eax + 0x90], ebx
mov dword [eax + 0x94], ebx
mov dword [eax + 0x98], 1
mov dword [eax + 0x9c], ebx
mov dword [eax + 0xa0], ebx
mov dword [eax + 0xa4], ebx
mov dword [eax + 0xac], 0x3ff00000
mov dword [eax + 0xb0], ebx
mov dword [eax + 0xb4], ebx
mov ecx, dword [0x54e93c]
inc ecx
mov esi, eax
mov dword [0x54e93c], ecx
jmp 0x40e242
xor esi, esi
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
mov edx, dword [ecx + 0x5462d8]
mov dword [esi + 0x8c], eax
mov eax, edx
mov dword [esi + 0x90], edx
mov dword [esi + 0x94], eax
mov edx, dword [edi - 4]
mov dword [esi + 0x98], edx
mov ecx, dword [ecx + 0x54a078]
cmp ecx, eax
jle 0x40e279
mov eax, ecx
mov ecx, dword [esp + 0x78]
mov edx, dword [esp + 0x74]
mov dword [esi + 0x9c], eax
mov eax, dword [esp + 0x24]
mov dword [esi + 0xa0], 0xa0
mov dword [esi + 0xa4], eax
mov eax, dword [edi - 0xc]
mov dword [0x54e940], ecx
mov dword [0x54e944], edx
mov dword [esi + 0xa8], eax
mov ecx, dword [edi - 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.004978f0
mov edx, dword [esp + 0x38]
mov dword [edx + 0x18], esi
mov eax, dword [esi + 0x90]
cmp eax, dword [esi + 0x9c]
je 0x40e31a
mov dword [0x545f58], ebx
lea ecx, [esp + 0x10]
mov byte [esp + 0x6c], bl
call fcn.00501be5
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 edi, 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 0x40e122
mov ecx, dword [esi + 4]
cmp dword [ecx + 0x1b0], ebx
je 0x40e387
push str.030CUSTOM
lea ecx, [esi + 0x180]
call fcn.00501d2d
jmp fcn.0040e3fa
mov edi, dword [esi + 0x14]
lea ecx, [esp + 0x78]
shl edi, 1
call fcn.00501a9a
cmp edi, 0xa
mov byte [esp + 0x6c], 2
mov eax, 0x534ce4
jl 0x40e3a9
mov eax, 0x534ce0
push edi
push eax
lea edx, [esp + 0x80]
push str._s_d
push edx
call fcn.00500338
add esp, 0x10
add esi, 0x180
lea eax, [esp + 0x78]
mov ecx, esi
push eax
call fcn.00501cde
cmp dword [0x545f50], ebx
je 0x40e3e1
push 0x534c84
jmp 0x40e3e6
push str.AMULET
mov ecx, esi