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

Disassembly:
sub esp, 0x210
mov eax, dword [0x4a872c]
mov dword [esp + 0x20c], eax
mov al, byte [0x130f650]
test al, al
je 0x408730
xor eax, eax
mov ecx, dword [esp + 0x20c]
call fcn.00460704
add esp, 0x210
ret
mov eax, dword [0x12e7d18]
test eax, eax
je 0x408751
mov eax, 1
mov ecx, dword [esp + 0x20c]
call fcn.00460704
add esp, 0x210
ret
mov eax, dword [esp + 0x214]
push edi
push eax
push 0x12e46c8
lea ecx, [esp + 0x118]
push str._s_game_d.sav
push ecx
call fcn.00460b10
lea edx, [esp + 0x120]
push 0x48a454
push edx
call fcn.00460cbf
mov edi, eax
add esp, 0x18
test edi, edi
jne 0x4087a0
pop edi
mov ecx, dword [esp + 0x20c]
call fcn.00460704
add esp, 0x210
ret
push str._save_game__n
push edi
call fcn.00460c05
mov eax, dword [0x12e7d38]
imul eax, eax, 0x64
add eax, 0x12e4890
push eax
push str.episode___s_n
push edi
call fcn.00460c05
mov ecx, dword [0x12e7cd4]
push ecx
push str.hero______d_n
push edi
call fcn.00460c05
mov edx, dword [0x1cf9d94]
push edx
push str.level_x___d_n
push edi
call fcn.00460c05
mov eax, dword [0x1cf9d90]
push eax
push str.level_y___d_n
push edi
call fcn.00460c05
mov ecx, dword [0x1cf6b8c]
mov edx, dword [ecx + 0x44]
push edx
push str.hero_x____d_n
push edi
call fcn.00460c05
mov eax, dword [0x1cf6b8c]
mov ecx, dword [eax + 0x48]
add esp, 0x44
push ecx
push str.hero_y____d_n
push edi
call fcn.00460c05
mov edx, dword [0x12e7cc4]
mov eax, dword [0x12e7cc0]
push edx
push eax
push str.score_____d_n
push edi
call fcn.00460c05
mov ecx, dword [0x12e7cd0]
push ecx
push str.lives_____d_n
push edi
call fcn.00460c05
mov edx, dword [0x1cf6b8c]
fld dword [edx + 0x7c]
call fcn.004607d4
push eax
push str.hp________d_n
push edi
call fcn.00460c05
mov eax, dword [0x1cf6b8c]
fld dword [eax + 0x80]
call fcn.004607d4
push eax
push str.defhp_____d_n
push edi
call fcn.00460c05
mov ecx, dword [0x12e7cc8]
add esp, 0x40
push ecx
push str.keys______d_n
push edi
call fcn.00460c05
mov edx, dword [0x12e7ccc]
push edx
push str.mapFound__d_n
push edi
call fcn.00460c05
mov eax, dword [0x12e7cf8]
push eax
push str.coins_____d_n
push edi
call fcn.00460c05
add esp, 0x24
mov eax, dword [0x12e7ce0]
test eax, eax
je 0x408931
push eax
push str.artOnMap__d_n
push edi
call fcn.00460c05
mov ecx, dword [0x12e7ce4]
push ecx
push str.artType___d_n
push edi
call fcn.00460c05
mov edx, dword [0x12e7ce8]
push edx
push str.artWX___d_n
push edi
call fcn.00460c05
mov eax, dword [0x12e7cec]
push eax
push str.artWY___d_n
push edi
call fcn.00460c05
mov ecx, dword [0x12e7cf0]
push ecx
push str.artX___d_n
push edi
call fcn.00460c05
mov edx, dword [0x12e7cf4]
push edx
push str.artY___d_n
push edi
call fcn.00460c05
add esp, 0x48
mov eax, dword [0x12e7d2c]
push ebx
push ebp
push esi
push eax
push str.compass___d_n
push edi
call fcn.00460c05
mov ecx, dword [0x12e7d30]
push ecx
push str.pendant___d_n
push edi
call fcn.00460c05
mov edx, dword [0x12e7d28]
push edx
push str.map_______d_n
push edi
call fcn.00460c05
mov eax, dword [0x12e7cfc]
push eax
push str.money_bet___d_n
push edi
call fcn.00460c05
mov ecx, dword [0x12e7d00]
push ecx
push str.money_won___d_n
push edi
call fcn.00460c05
mov edx, dword [0x12e7d3c]
push edx
push str.items___d_n
push edi
call fcn.00460c05
mov eax, dword [0x12e7d44]
add esp, 0x48
push eax
push str.secret_items___d_n
push edi
call fcn.00460c05
mov ecx, dword [0x12e7d10]
push ecx
push str.cheater___d_n
push edi
call fcn.00460c05
mov esi, dword [0x1cf6b8c]
add esp, 0x18
xor ebx, ebx
add esi, 0xa8
push ebx
push str._n_n_belt_slot__d__n
push edi
call fcn.00460c05
lea edx, [esi + 4]
push edx
push str.name____s_n
push edi
call fcn.00460c05
mov eax, dword [esi]
push eax
push str.item____d_n
push edi
call fcn.00460c05
mov ecx, dword [esi + 0x28]
push ecx
push str.mana____d_n
push edi
call fcn.00460c05
mov edx, dword [esi + 0x24]
push edx
push str.level___d_n
push edi
call fcn.00460c05
add esp, 0x3c
inc ebx
add esi, 0x30
cmp ebx, 6
jl 0x4089d5
mov eax, dword [0x1cf6b8c]
cmp dword [eax + 0x18], 1
mov esi, 0x1546c1c
je 0x408a3d
mov esi, 0x15466fc
xor ebx, ebx
add esi, 4
push ebx
push str._n_n_belt_slot__d_2__n
push edi
call fcn.00460c05
lea ecx, [esi + 4]
push ecx
push str.name____s_n
push edi
call fcn.00460c05
mov edx, dword [esi]
push edx
push str.item____d_n
push edi
call fcn.00460c05
mov eax, dword [esi + 0x28]
push eax
push str.mana____d_n
push edi
call fcn.00460c05
mov ecx, dword [esi + 0x24]
push ecx
push str.level___d_n
push edi
call fcn.00460c05
add esp, 0x3c
inc ebx
add esi, 0x30
cmp ebx, 6
jl 0x408a42
push str._n_completed_episodes__n
push edi
call fcn.00460c05
add esp, 8
xor ebx, ebx
xor ebp, ebp
jmp 0x408ab0
mov esi, dword [0x12e7d58]
test esi, esi
je 0x408b00
mov ecx, dword [0x12e7d5c]
sub ecx, esi
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jae 0x408b00
cmp dword [esi + ebp + 0x18], 0x10
jb 0x408ae6
mov esi, dword [esi + ebp + 4]
jmp 0x408aea
lea esi, [esi + ebp + 4]
push esi
push ebx
push str.EpisodeComplete_d_s_n
push edi
call fcn.00460c05
add esp, 0x10
inc ebx
add ebp, 0x1c
jmp 0x408ab0
push str._n_visited_screens__n
push edi
call fcn.00460c05
mov ebx, dword [0x156ab94]
mov eax, dword [0x156ab9c]
add esp, 8
cmp ebx, eax
jge 0x408b9a
mov ecx, dword [0x156ab98]
lea eax, [ebx + ebx*4]
shl eax, 4
mov dword [esp + 0x10], eax
lea ecx, [ecx]
mov esi, dword [0x156ab90]
cmp esi, ecx
jge 0x408b88
lea ebp, [eax + esi]
lea ebp, [ebp*4 + 0x1cf6b90]
mov eax, dword [ebp]
test eax, eax
je 0x408b7c
mov edx, dword [eax + 4]
test edx, edx
je 0x408b7c
push ebx
push esi
lea edx, [esp + 0x44]
push str._d__d
push edx
call fcn.00460b10
lea eax, [esp + 0x4c]
push eax
push str._s1_n
push edi
call fcn.00460c05
mov ecx, dword [0x156ab98]
add esp, 0x1c
inc esi
add ebp, 4
cmp esi, ecx
jl 0x408b44
mov eax, dword [esp + 0x10]
mov edx, dword [0x156ab9c]
inc ebx
add eax, 0x50
cmp ebx, edx
mov dword [esp + 0x10], eax
jl 0x408b30
push str._n_keys__n
push edi
call fcn.00460c05
add esp, 8
xor ebx, ebx
mov esi, 0x1cf9dbc
nop
mov eax, dword [esi + 8]
test eax, eax
je 0x408be6
cmp dword [esi], 0
je 0x408be6
fld dword [esi + 0x14]
call fcn.004607d4
fld dword [esi + 0x10]
push eax
call fcn.004607d4
mov ecx, dword [esi + 0x1c]
mov edx, dword [esi + 0x18]
push eax
push ecx
push edx
push ebx
push str.key__d___d__d__d__d_n
push edi
call fcn.00460c05
add esp, 0x1c
inc ebx
add esi, 0x78
cmp esi, 0x1cfbbbc
jl 0x408bb0
push str._n_all_items__n
push edi
call fcn.00460c05
mov eax, dword [0x156ab94]
mov ecx, dword [0x156ab9c]
add esp, 8
cmp eax, ecx
mov dword [esp + 0x14], eax
jge 0x408d45
lea eax, [eax + eax*4]
shl eax, 4
mov dword [esp + 0x10], eax
mov eax, dword [0x156ab90]
cmp eax, dword [0x156ab98]
mov dword [esp + 0x1c], eax
jge 0x408d23
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x10]
add eax, ecx
mov ecx, dword [0x15bae18]
lea edx, [eax*4 + 0x1cf6b90]
mov dword [esp + 0x18], edx
mov eax, dword [esp + 0x18]
mov eax, dword [eax]
test eax, eax
je 0x408d01
xor ebp, ebp
test ecx, ecx
jbe 0x408d01
add eax, 0x69a4
mov dword [esp + 0x24], eax
mov esi, dword [esp + 0x24]
xor ebx, ebx
mov dword [esp + 0x20], 0x100
nop
lea ecx, [esi - 0xc]
test ecx, ecx
je 0x408ce4
mov edx, dword [esi]
push edx
call fcn.0042c3a0
mov ecx, dword [esi]
add esp, 4
cmp ecx, ebp
jne 0x408ce4
cmp dword [esi - 8], 1
jne 0x408ce4
add eax, 4
push str.KeyMain
push eax
call fcn.00460712
add esp, 8
test eax, eax
je 0x408ce4
mov eax, dword [esi + 4]
fld dword [esi + 0xc]
push eax
call fcn.004607d4
fld dword [esi + 8]
push eax
call fcn.004607d4
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
push eax
push ebx
push ebp
push ecx
push edx
push str._d__d__d__d_d__d__d_n
push edi
call fcn.00460c05
add esp, 0x24
inc ebx
mov eax, dword [esp + 0x20]
add esi, 0x78
dec eax
mov dword [esp + 0x20], eax
jne 0x408c80
mov ecx, dword [0x15bae18]
inc ebp
cmp ebp, ecx
jb 0x408c71
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
mov edx, dword [0x156ab98]
inc eax
add esi, 4
cmp eax, edx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], esi
jl 0x408c50
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
mov ecx, dword [0x156ab9c]
inc eax
add edx, 0x50
cmp eax, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edx
jl 0x408c20
push str._n_messages__n
push edi
call fcn.00460c05
mov eax, dword [0x156ab94]
mov ecx, dword [0x156ab9c]
add esp, 8
cmp eax, ecx
mov dword [esp + 0x14], eax
jge 0x408e16
lea eax, [eax + eax*4]
shl eax, 4
mov dword [esp + 0x18], eax
jmp 0x408d80
mov ebx, dword [0x156ab90]
cmp ebx, dword [0x156ab98]
jge 0x408df4
mov eax, dword [esp + 0x18]
add eax, ebx
lea ecx, [eax*4 + 0x1cf6b90]
mov dword [esp + 0x10], ecx
nop
mov edx, dword [esp + 0x10]
mov ebp, dword [edx]
test ebp, ebp
je 0x408ddf
xor esi, esi
add ebp, 0x6920
cmp dword [ebp], 0
je 0x408dd6
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x408dd6
mov eax, dword [esp + 0x14]
push 1
push esi
push eax
push ebx
push str.Message__d__d__d_d_n
push edi
call fcn.00460c05
add esp, 0x18
inc esi
add ebp, 0x18
cmp esi, 5
jl 0x408db2
mov ecx, dword [esp + 0x10]
mov eax, dword [0x156ab98]
inc ebx
add ecx, 4
cmp ebx, eax
mov dword [esp + 0x10], ecx
jl 0x408da0
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov ecx, dword [0x156ab9c]
inc eax
add edx, 0x50
cmp eax, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], edx
jl 0x408d80
push str._n_artefacts__n
push edi
call fcn.00460c05
add esp, 8
xor esi, esi
mov ecx, dword [0xff06cc]
test ecx, ecx
je 0x408e6c
mov eax, dword [0xff06d0]
sub eax, ecx
sar eax, 3
cmp esi, eax
jae 0x408e6c
mov ecx, dword [ecx + esi*8]
push ecx
push esi
push str.art_d_type_d_n
push edi
call fcn.00460c05
mov edx, dword [0xff06cc]
movzx eax, byte [edx + esi*8 + 4]
push eax
push esi
push str.art_d_equip_d_n
push edi
call fcn.00460c05
add esp, 0x20
inc esi
jmp 0x408e26
push 0x1d
call fcn.00401610
add esp, 4
test al, al
je 0x408eaa
push 0x1d
call fcn.004015d0
mov esi, eax
mov ecx, dword [esi + 0x1cdd8]
push ecx
push str.artSoulMode_d_n
push edi
call fcn.00460c05
mov edx, dword [esi + 0x1cddc]
push edx
push str.artSoulValue_d_n
push edi
call fcn.00460c05
add esp, 0x1c
push 0x489b8c
push edi
call fcn.00460c05
push 0x489b8c
push edi
call fcn.00460c05
push 0x489b8c
push edi
call fcn.00460c05
push edi
call fcn.00460bb4
lea eax, [esp + 0x138]
push 1
push eax
call fcn.00438090
lea ecx, [esp + 0xa0]
push 5
push ecx
mov edi, eax
call fcn.0045ac10
mov eax, edi
add esp, 0x2c
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408f00
sub eax, edx
push eax
lea edx, [esp + 0x80]
push edi
push edx
call fcn.0045ac80
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x90]
push edx
call fcn.0045ad10
lea eax, [esp + 0xf4]
push eax
lea ecx, [esp + 0x48]
push 0x10
push ecx
call fcn.0040dab0
lea edx, [esp + 0x140]
push 0x48a454
push edx
call fcn.00460cbf
mov esi, eax
add esp, 0x2c
test esi, esi
je 0x408f9c
lea eax, [esp + 0xdc]
push eax
push str._s_n_________________________________n__Please_dont_modify_this_file__n_________________________________n
push esi
call fcn.00460c05
mov eax, edi
add esp, 0xc
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408f80
push esi
sub eax, edx
push 1
push eax
push edi
call fcn.0046125b
push esi
call fcn.00460bb4
add esp, 0x14
push edi
call fcn.00438020
mov ecx, dword [esp + 0x220]
add esp, 4
pop esi
pop ebp
pop ebx
mov eax, 1
pop edi
call fcn.00460704
add esp, 0x210
ret