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

Disassembly:
sub esp, 0x60
push esi
push edi
mov edi, dword [esp + 0x78]
lea ecx, [esp + 0x5c]
push ecx
mov esi, 1
lea eax, [esp + 0x20]
push edi
mov dword [esp + 0x24], 0
mov dword [esp + 0x64], esi
mov dword [esp + 0x68], esi
mov dword [esp + 0x6c], eax
call fcn.00403560
add esp, 8
test eax, eax
jne 0x403f63
pop edi
mov eax, 0xa
pop esi
add esp, 0x60
ret
push ebx
push ebp
push 0
lea edx, [esp + 0x5c]
push edx
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0x4c]
push ecx
lea edx, [esp + 0x5c]
push edx
lea eax, [esp + 0x3c]
push eax
call fcn.00403050
mov ebp, dword [esp + 0x94]
push edi
push ebp
call fcn.004034d0
add esp, 0x20
test eax, eax
jge 0x404006
mov ebx, dword [esp + 0x74]
test ebx, ebx
je 0x403fe0
push esi
push ebx
call fcn.004030e0
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
mov ecx, dword [ebx + 4]
mov edi, dword [ebx + 8]
shl ecx, 2
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
test esi, esi
rep stosb byte es:[edi], al
mov eax, dword [ebx + 8]
mov dword [eax], esi
mov dword [ebx], 1
jne 0x40455d
mov eax, dword [esp + 0x78]
test eax, eax
je 0x403ffc
push ebp
push eax
call fcn.00403170
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x60
ret
lea ecx, [esp + 0x28]
push ebp
push ecx
call fcn.00403170
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
lea edx, [esp + 0x4c]
push edi
push edx
call fcn.00403170
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
mov eax, dword [ebp + 4]
add eax, 2
push eax
lea ecx, [esp + 0x44]
mov ebx, 1
push ecx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x30], ebx
call fcn.004030e0
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
lea edx, [esp + 0x40]
push ebx
push edx
call fcn.004030e0
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
test esi, esi
mov ecx, dword [esp + 0x44]
mov edi, dword [esp + 0x48]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x48]
mov dword [eax], esi
mov dword [esp + 0x40], ebx
jne 0x40455d
lea ecx, [esp + 0x34]
push 2
push ecx
call fcn.004030e0
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
lea edx, [esp + 0x58]
push 3
push edx
call fcn.004030e0
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
lea eax, [esp + 0x4c]
push eax
call fcn.004032c0
add esp, 4
and eax, 0x8000001f
jns 0x4040e0
dec eax
or eax, 0xffffffe0
inc eax
cmp eax, 0x1f
jge 0x404122
mov edi, 0x1f
sub edi, eax
lea ecx, [esp + 0x28]
push edi
push ecx
mov dword [esp + 0x2c], edi
call fcn.00403310
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
lea edx, [esp + 0x4c]
push edi
push edx
call fcn.00403310
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
jmp 0x40412a
mov dword [esp + 0x24], 0
mov ebx, dword [esp + 0x2c]
mov eax, dword [esp + 0x50]
dec ebx
dec eax
mov ebp, ebx
sub ebp, eax
mov edi, ebp
mov dword [esp + 0x18], eax
shl edi, 5
lea eax, [esp + 0x4c]
push edi
push eax
call fcn.00403310
lea ecx, [esp + 0x54]
push ecx
lea edx, [esp + 0x34]
push edx
call fcn.00403560
add esp, 0x10
test eax, eax
jl 0x404191
mov eax, dword [esp + 0x48]
inc dword [eax + ebp*4]
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x2c]
push ecx
mov edx, ecx
push edx
call fcn.00403870
lea eax, [esp + 0x58]
push eax
lea ecx, [esp + 0x38]
push ecx
call fcn.00403560
add esp, 0x14
test eax, eax
jge 0x404162
lea edx, [esp + 0x4c]
push edi
push edx
call fcn.00403410
mov ecx, dword [esp + 0x20]
add esp, 8
cmp ebx, ecx
mov eax, ebx
mov dword [esp + 0x10], eax
jle 0x4044ce
lea ebx, [ebp*4]
add edi, 0xffffffe0
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], edi
jmp 0x4041d0
mov eax, dword [esp + 0x10]
lea esp, [esp]
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x18]
mov ebp, dword [esp + 0x30]
mov edi, dword [ecx + edx*4]
cmp dword [ebp + eax*4], edi
jb 0x4041f6
mov eax, dword [esp + 0x48]
mov dword [eax + ebx - 4], 0xffffffff
jmp 0x4042a2
mov ecx, dword [ebp + eax*4]
mov eax, ecx
mov esi, edi
shr esi, 0x10
xor edx, edx
div esi
mov ebx, edi
and ebx, 0xffff
mov edx, eax
mov eax, dword [esp + 0x10]
mov ebp, dword [ebp + eax*4 - 4]
mov eax, edx
imul eax, esi
sub ecx, eax
mov eax, ebp
shr eax, 0x10
shl ecx, 0x10
or ecx, eax
mov eax, edx
imul eax, ebx
cmp ecx, eax
mov dword [esp + 0x14], edx
jae 0x40424f
dec edx
add ecx, edi
cmp ecx, edi
mov dword [esp + 0x14], edx
jb 0x40424f
cmp ecx, eax
jae 0x40424b
add ecx, edi
dec edx
cmp ecx, edi
jae 0x404240
mov dword [esp + 0x14], edx
sub ecx, eax
xor edx, edx
mov eax, ecx
div esi
and ebp, 0xffff
mov edx, eax
imul edx, esi
sub ecx, edx
mov edx, eax
imul edx, ebx
shl ecx, 0x10
or ecx, ebp
cmp ecx, edx
jae 0x40428b
add ecx, edi
dec eax
cmp ecx, edi
jb 0x40428b
lea esp, [esp]
cmp ecx, edx
jae 0x40428b
add ecx, edi
dec eax
cmp ecx, edi
jae 0x404280
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
shl ecx, 0x10
or ecx, eax
mov eax, dword [esp + 0x48]
mov dword [eax + edx - 4], ecx
mov ebx, edx
mov eax, dword [esp + 0x48]
inc dword [eax + ebx - 4]
lea ebx, [ebx]
mov eax, dword [esp + 0x48]
dec dword [ebx + eax - 4]
mov ebp, 1
lea eax, [esp + 0x34]
push ebp
push eax
call fcn.004030e0
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
test esi, esi
mov ecx, dword [esp + 0x38]
mov edi, dword [esp + 0x3c]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x3c]
mov dword [ecx], eax
mov dword [esp + 0x34], ebp
jne 0x40455d
mov ecx, dword [esp + 0x18]
cmp ecx, ebp
jl 0x404301
mov edx, dword [esp + 0x54]
mov eax, dword [edx + ecx*4 - 4]
mov edx, dword [esp + 0x3c]
mov dword [edx], eax
mov eax, dword [esp + 0x54]
mov ecx, dword [eax + ecx*4]
mov edx, dword [esp + 0x3c]
mov dword [edx + 4], ecx
mov eax, dword [esp + 0x48]
mov ecx, dword [ebx + eax - 4]
push ecx
lea edx, [esp + 0x38]
push edx
mov eax, edx
push eax
call fcn.00403ee0
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x40455d
lea ecx, [esp + 0x58]
push ebp
push ecx
call fcn.004030e0
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
test esi, esi
mov ecx, dword [esp + 0x5c]
mov edi, dword [esp + 0x60]
rep stosd dword es:[edi], eax
mov edx, dword [esp + 0x60]
mov dword [edx], eax
mov dword [esp + 0x58], ebp
jne 0x40455d
mov eax, dword [esp + 0x10]
cmp eax, 2
jge 0x404379
xor ecx, ecx
jmp 0x404381
mov ecx, dword [esp + 0x30]
mov ecx, dword [ecx + eax*4 - 8]
cmp eax, ebp
mov edx, dword [esp + 0x60]
mov dword [edx], ecx
jge 0x40438f
xor ecx, ecx
jmp 0x404397
mov ecx, dword [esp + 0x30]
mov ecx, dword [ecx + eax*4 - 4]
mov edx, dword [esp + 0x60]
mov dword [edx + 4], ecx
mov ecx, dword [esp + 0x30]
mov edx, dword [ecx + eax*4]
mov eax, dword [esp + 0x60]
lea ecx, [esp + 0x58]
mov dword [eax + 8], edx
push ecx
lea edx, [esp + 0x38]
push edx
call fcn.00403560
add esp, 8
test eax, eax
jg 0x4042b0
mov eax, dword [esp + 0x48]
mov ecx, dword [eax + ebx - 4]
push ecx
lea edx, [esp + 0x50]
push edx
lea eax, [esp + 0x3c]
push eax
call fcn.00403ee0
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x40455d
mov edi, dword [esp + 0x20]
lea ecx, [esp + 0x34]
push edi
push ecx
call fcn.00403310
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x2c]
push eax
mov ecx, eax
push ecx
call fcn.00403870
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x40455d
mov dword [esp + 0x20], eax
lea eax, [esp + 0x64]
push eax
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x24]
push ecx
mov dword [esp + 0x6c], ebp
mov dword [esp + 0x70], ebp
mov dword [esp + 0x74], edx
call fcn.00403560
add esp, 8
test eax, eax
jge 0x4044ab
lea edx, [esp + 0x4c]
push edx
lea eax, [esp + 0x38]
push eax
call fcn.00403170
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
lea ecx, [esp + 0x34]
push edi
push ecx
call fcn.00403310
mov esi, eax
add esp, 8
test esi, esi
jne 0x40455d
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x2c]
push eax
mov ecx, eax
push ecx
call fcn.00403800
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x40455d
mov eax, dword [esp + 0x48]
dec dword [eax + ebx - 4]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
dec eax
sub edi, 0x20
sub ebx, 4
cmp eax, ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0x20], edi
mov dword [esp + 0x1c], ebx
jg 0x4041c5
mov edi, dword [esp + 0x74]
test edi, edi
je 0x4044f9
lea edx, [esp + 0x40]
push edx
push edi
call fcn.00403170
mov eax, dword [esp + 0x84]
mov ecx, dword [eax]
mov edx, dword [esp + 0x88]
add esp, 8
imul ecx, dword [edx]
mov dword [edi], ecx
mov edi, dword [esp + 0x78]
test edi, edi
je 0x40455d
mov eax, dword [esp + 0x24]
push eax
lea ecx, [esp + 0x2c]
push ecx
call fcn.00403410
lea edx, [esp + 0x30]
push edx
push edi
call fcn.00403170
mov eax, dword [esp + 0x8c]
mov ecx, dword [eax]
lea eax, [esp + 0x74]
push eax
mov ebx, 1
lea edx, [esp + 0x38]
push edi
mov dword [edi], ecx
mov dword [esp + 0x3c], 0
mov dword [esp + 0x7c], ebx
mov dword [esp + 0x80], ebx
mov dword [esp + 0x84], edx
call fcn.00403560
add esp, 0x18
test eax, eax
jne 0x40455d
mov dword [edi], ebx
push 0
lea ecx, [esp + 0x5c]
push ecx
lea edx, [esp + 0x3c]
push edx
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x5c]
push ecx
lea edx, [esp + 0x3c]
push edx
call fcn.00403080
add esp, 0x18
pop ebp
pop ebx
pop edi
mov eax, esi
pop esi
add esp, 0x60
ret