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

Disassembly:
sub esp, 8
mov dword [0x54fda0], 0
push ebx
push esi
push edi
mov esi, ecx
push ebp
mov ecx, 0x613d48
call fcn.0045a840
mov ecx, 0x563c00
call fcn.0045a840
mov dword [esi + 0xf0], 0xffffffff
mov byte [esi + 0x1d], 3
mov ecx, esi
mov eax, dword [esi]
call dword [eax + 0xbc]
mov eax, dword [esp + 0x20]
mov word [esi + 0x7c], ax
mov ecx, dword [0x54738c]
call fcn.004792e0
test eax, eax
je 0x405a53
mov eax, dword [esi + 0x58]
mov ecx, dword [eax + 0x14]
call fcn.004a4860
jmp 0x405a65
mov eax, dword [0x54738c]
mov eax, dword [eax + 0x28]
cmp eax, 0xffffffff
jne 0x405a65
call fcn.00519ab0
mov dword [esi + 0x78], eax
mov eax, dword [esi + 0x78]
push eax
call fcn.00519aa0
mov ecx, dword [0x54738c]
add esp, 4
mov eax, dword [esi + 0x78]
mov dword [ecx + 0x30], eax
call fcn.00519ab0
push eax
mov dword [esi + 0x78], eax
push str.World:_new_game__rand_d_
mov ecx, dword [0x547328]
push ecx
call fcn.0042ed50
mov edx, dword [esp + 0x28]
add esp, 0xc
mov ax, word [edx + 0x294]
inc ax
mov word [esi + 0x3c], ax
movsx ecx, word [edx + 0x2a4]
movsx eax, word [edx + 0x2a2]
push ecx
push eax
mov ecx, dword [esi + 0x28]
call fcn.004b3020
call fcn.00519ab0
push eax
mov dword [esi + 0x78], eax
push str.__World:_after_new_map__rand_d_
mov ecx, dword [0x547328]
push ecx
call fcn.0042ed50
mov edx, dword [esp + 0x28]
add esp, 0xc
mov ax, word [edx + 0x294]
inc ax
movsx ecx, ax
mov word [esi + 0x3c], ax
push ecx
push 4
call fcn.00513f50
mov dword [esi + 0x40], eax
mov ebx, dword [esi]
add esp, 8
mov ecx, esi
call dword [ebx + 0x64]
call fcn.00519ab0
push eax
mov dword [esi + 0x78], eax
push str.__World:_after_gaia__rand_d_
mov ecx, dword [0x547328]
push ecx
call fcn.0042ed50
mov edx, dword [esp + 0x28]
add esp, 0xc
mov ecx, esi
mov ebx, dword [esi]
push edx
call dword [ebx + 0x68]
call fcn.00519ab0
push eax
mov dword [esi + 0x78], eax
push str.__World:_after_players__rand_d_
mov ecx, dword [0x547328]
push ecx
mov edi, 1
call fcn.0042ed50
add esp, 0xc
push edi
mov eax, dword [esi + 0x58]
mov ecx, dword [eax + 0x14]
call fcn.004a48c0
cmp eax, 2
je 0x405b71
cmp eax, 4
jne 0x405bfe
lea eax, [edi - 1]
mov ecx, dword [0x54738c]
push eax
call fcn.004793c0
cmp eax, 1
mov ebx, eax
jle 0x405bfe
mov ebp, 1
push ebp
mov eax, dword [esi + 0x58]
mov ecx, dword [eax + 0x14]
call fcn.004a48c0
cmp ebp, edi
je 0x405bf8
cmp eax, 2
je 0x405ba6
cmp eax, 4
jne 0x405bf8
lea eax, [ebp - 1]
mov ecx, dword [0x54738c]
push eax
call fcn.004793c0
cmp eax, ebx
jne 0x405bf8
push 0
mov ecx, dword [0x54738c]
push ebp
call fcn.00479aa0
push eax
mov ecx, dword [0x54738c]
push edi
call fcn.00479aa0
mov ecx, dword [esi + 0x40]
mov ecx, dword [ecx + eax*4]
call fcn.004edf70
push 1
mov ecx, dword [0x54738c]
push edi
call fcn.00479aa0
mov ecx, dword [esi + 0x40]
mov ecx, dword [ecx + eax*4]
call fcn.004edf40
inc ebp
cmp ebp, 9
jl 0x405b8c
inc edi
cmp edi, 9
jl 0x405b57
mov ecx, dword [0x54738c]
call fcn.00479290
test eax, eax
je 0x405cd9
mov ecx, dword [0x54738c]
call fcn.004792a0
test eax, eax
jne 0x405cd9
mov edi, 1
push edi
mov eax, dword [esi + 0x58]
mov ecx, dword [eax + 0x14]
call fcn.004a48c0
cmp eax, 4
jne 0x405ccf
lea eax, [edi - 1]
mov ecx, dword [0x54738c]
push eax
call fcn.004793c0
cmp eax, 1
jne 0x405ccf
mov ebx, 1
push ebx
mov eax, dword [esi + 0x58]
mov ecx, dword [eax + 0x14]
call fcn.004a48c0
cmp ebx, edi
je 0x405cc9
cmp eax, 4
jne 0x405cc9
lea eax, [ebx - 1]
mov ecx, dword [0x54738c]
push eax
call fcn.004793c0
cmp eax, 1
jne 0x405cc9
push 0
mov ecx, dword [0x54738c]
push ebx
call fcn.00479aa0
push eax
mov ecx, dword [0x54738c]
push edi
call fcn.00479aa0
mov ecx, dword [esi + 0x40]
mov ecx, dword [ecx + eax*4]
call fcn.004edf70
push 1
mov ecx, dword [0x54738c]
push edi
call fcn.00479aa0
mov ecx, dword [esi + 0x40]
mov ecx, dword [ecx + eax*4]
call fcn.004edf40
inc ebx
cmp ebx, 9
jl 0x405c61
inc edi
cmp edi, 9
jl 0x405c33
xor eax, eax
mov dword [esi + 4], eax
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x14], eax
mov ecx, dword [0x54738c]
call fcn.004792d0
test eax, eax
je 0x405d06
mov ecx, dword [0x54738c]
call fcn.00479b80
fstp dword [esi + 0x18]
jmp 0x405d0d
mov dword [esi + 0x18], 0x3f800000
xor ecx, ecx
mov edx, dword [esp + 0x1c]
mov byte [esi + 0x1c], cl
mov dword [esi + 0x84], ecx
mov eax, dword [edx + 0x298]
mov dword [esp + 0x14], ecx
test eax, eax
je 0x405d3c
push edx
mov ecx, esi
push eax
mov eax, dword [esi]
call dword [eax + 0x84]
mov byte [esp + 0x13], al
jmp 0x405d73
mov edx, dword [esp + 0x1c]
mov al, byte [edx + 0x2a8]
test al, al
je 0x405d5b
mov eax, dword [esi]
push edx
mov ecx, esi
call dword [eax + pe_nt_image_headers32]
mov byte [esp + 0x13], al
jmp 0x405d73
mov edx, dword [esp + 0x1c]
mov ecx, esi
push edx
mov eax, dword [esi]
call dword [eax + 0x70]
mov dword [esp + 0x14], 1
mov byte [esp + 0x13], al
mov ecx, esi
xor ebx, ebx
xor edi, edi
call fcn.00409090
cmp word [esi + 0x3c], bx
jle 0x405da2
mov eax, dword [esi + 0x40]
mov ecx, dword [eax + ebx]
test ecx, ecx
je 0x405d96
mov eax, dword [ecx]
call dword [eax + 0x88]
add ebx, 4
inc edi
movsx eax, word [esi + 0x3c]
cmp eax, edi
jg 0x405d84
mov al, byte [esp + 0x13]
test al, al
je 0x405dae
mov byte [esi + 0x1d], 0
call fcn.00519ab0
push eax
mov dword [esi + 0x78], eax
push str.__World:_end_of_new_game__rand_d_
mov ecx, dword [0x547328]
push ecx
call fcn.0042ed50
mov ecx, dword [esp + 0x20]
add esp, 0xc
cmp ecx, 1
jne 0x405e1c
mov edi, 1
cmp word [esi + 0x3c], di
jle 0x405e1c
mov ebx, 4
mov eax, dword [esi + 0x40]
mov ecx, dword [eax + ebx]
test ecx, ecx
je 0x405e10
mov edx, dword [esp + 0x1c]
mov ebp, dword [ecx]
movsx eax, word [edx + 0x2a0]
push eax
push 0
push str.RANDOM
push str.RANDOM
push str.RANDOM
call dword [ebp + 0x28]
add ebx, 4
inc edi
movsx eax, word [esi + 0x3c]
cmp eax, edi
jg 0x405de4
mov al, byte [esp + 0x13]
pop ebp
pop edi
pop esi
pop ebx
add esp, 8
ret 8