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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x60
mov eax, dword [esi + 0x4c]
xor edx, edx
mov dword [ebp - 0xc], eax
mov eax, dword [esi + 0xb4]
mov dword [ebp - 8], eax
mov dword [ebp - 4], eax
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x24], edx
cmp dword [esi + 0x70], edx
je 0x4026ac
mov eax, dword [esi]
mov ecx, dword [esi + 0x64]
mov dword [ebp - 0x58], eax
mov eax, dword [esi + 0x3c]
mov dword [ebp - 0x54], 0x52
mov dword [ebp - 0x50], edx
cmp ecx, eax
jae 0x4022d0
sub eax, ecx
mov dword [ebp - 0x14], eax
jmp 0x4022d3
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x14]
push ebx
mov ebx, dword [esi + 0xa8]
push edi
mov dword [ebp - 0x4c], eax
mov eax, dword [esi + 0x18]
xor edi, edi
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x48], edx
cmp ebx, edx
jle 0x402340
mov eax, dword [ebp - 4]
sub eax, dword [ebp - 8]
lea ecx, [eax + 0x18]
cmp ecx, dword [esi + 4]
jle 0x402317
push eax
push dword [ebp - 8]
mov eax, esi
call fcn.004016b8
mov eax, dword [ebp - 8]
pop ecx
pop ecx
mov dword [ebp - 4], eax
mov eax, dword [esi + 0xa4]
lea eax, [eax + edi*8]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 4]
lea ecx, [ebp - 0x60]
call fcn.00402252
inc edi
mov dword [ebp - 4], eax
cmp edi, ebx
jl 0x4022f6
xor edx, edx
mov dword [esi + 0xa8], edx
cmp dword [esi + 0x40], edx
jne 0x4023a0
mov ecx, dword [esi + 0x78]
cmp ecx, edx
jne 0x402364
mov ecx, dword [esi + 0x4c]
mov eax, 0x1b58
add ecx, eax
mov dword [esi + 0x78], eax
mov dword [esi + 0x74], ecx
jmp 0x4023a6
mov edi, dword [esi + 0x4c]
mov eax, edi
sub eax, dword [esi + 0x74]
js 0x4023a6
mov eax, 0x1b58
cmp ecx, eax
jae 0x40237a
mov dword [esi + 0x78], eax
mov eax, dword [esi + 0x78]
mov ecx, eax
shr ecx, 1
add eax, ecx
mov ecx, 0x1d4c0
mov dword [esi + 0x78], eax
cmp eax, ecx
jbe 0x402392
mov dword [esi + 0x78], ecx
mov eax, dword [esi + 0x78]
add eax, edi
or dword [esi + 0x48], 1
mov dword [esi + 0x74], eax
jmp 0x4023a6
mov dword [esi + 0x74], edx
mov dword [esi + 0x78], edx
test byte [esi + 0x48], 1
je 0x4023e4
mov eax, dword [ebp - 4]
sub eax, dword [ebp - 8]
mov dword [ebp - 0x54], 0x53
lea ecx, [eax + 0x18]
cmp ecx, dword [esi + 4]
jle 0x4023d4
push eax
push dword [ebp - 8]
mov eax, esi
call fcn.004016b8
mov eax, dword [ebp - 8]
pop ecx
pop ecx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
lea ecx, [ebp - 0x60]
call fcn.00402252
mov dword [ebp - 4], eax
xor edx, edx
test byte [esi + 0x48], 2
je 0x402422
mov eax, dword [ebp - 4]
sub eax, dword [ebp - 8]
mov dword [ebp - 0x54], 0x54
lea ecx, [eax + 0x18]
cmp ecx, dword [esi + 4]
jle 0x402412
push eax
push dword [ebp - 8]
mov eax, esi
call fcn.004016b8
mov eax, dword [ebp - 8]
pop ecx
pop ecx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
lea ecx, [ebp - 0x60]
call fcn.00402252
mov dword [ebp - 4], eax
xor edx, edx
mov ecx, dword [esi + 0x38]
mov eax, dword [esi + 0x40]
mov dword [esi + 0x48], edx
mov dword [ebp - 0x10], ecx
cmp ecx, eax
jbe 0x402435
mov dword [ebp - 0x10], eax
cmp dword [esi + 0xc0], edx
jne 0x402448
mov eax, dword [esi + 0x44]
cmp eax, dword [ebp - 0x10]
ja 0x402448
mov dword [ebp - 0x10], eax
mov eax, dword [esi + 0x14]
sub eax, dword [esi + 0x10]
sub eax, dword [ebp - 0x10]
jns 0x4024dd
lea edi, [esi + 0x84]
mov eax, dword [edi]
cmp edi, eax
je 0x4024dd
mov ecx, dword [eax]
mov ebx, dword [eax + 4]
mov dword [ecx + 4], ebx
mov ecx, dword [eax + 4]
mov ebx, dword [eax]
mov dword [ecx], ebx
mov dword [eax], edx
mov dword [eax + 4], edx
mov ebx, dword [esi + 0x98]
mov dword [eax + 4], ebx
lea ebx, [esi + 0x94]
mov dword [eax], ebx
mov ebx, dword [esi + 0x98]
mov dword [ebx], eax
dec dword [esi + 0x68]
inc dword [esi + 0x60]
mov ecx, dword [esi]
mov dword [esi + 0x98], eax
mov dword [eax + 8], ecx
mov ecx, dword [ebp - 0x14]
mov dword [eax + 0x14], ecx
mov ecx, dword [ebp - 0xc]
mov dword [eax + 0xc], 0x51
mov dword [eax + 0x18], ecx
mov ebx, dword [esi + 0x14]
mov dword [eax + 0x1c], ebx
inc dword [esi + 0x14]
mov ebx, dword [esi + 0x18]
mov dword [eax + 0x20], ebx
mov dword [eax + 0x28], ecx
mov ecx, dword [esi + 0x30]
mov dword [eax + 0x2c], ecx
mov dword [eax + 0x30], edx
mov dword [eax + 0x34], edx
mov eax, dword [esi + 0x14]
sub eax, dword [esi + 0x10]
sub eax, dword [ebp - 0x10]
js 0x40245d
mov eax, dword [esi + 0xb8]
cmp eax, edx
jle 0x4024ec
mov dword [ebp - 0x1c], eax
jmp 0x4024f0
or dword [ebp - 0x1c], 0xffffffff
cmp dword [esi + 0x6c], edx
jne 0x402500
mov eax, dword [esi + 0x30]
sar eax, 3
mov dword [ebp - 0x20], eax
jmp 0x402503
mov dword [ebp - 0x20], edx
lea eax, [esi + 0x94]
mov edi, dword [eax]
jmp 0x402621
mov eax, dword [edi + 0x34]
cmp eax, edx
jne 0x40252c
mov dword [edi + 0x34], 1
mov eax, dword [esi + 0x30]
mov dword [edi + 0x2c], eax
add eax, dword [ebp - 0x20]
add eax, dword [ebp - 0xc]
jmp 0x4025a7
mov ecx, dword [ebp - 0xc]
sub ecx, dword [edi + 0x28]
js 0x402579
inc eax
mov dword [edi + 0x34], eax
mov eax, dword [esi + 0x6c]
inc dword [esi + 0x58]
cmp eax, edx
jne 0x402555
mov ecx, dword [esi + 0x30]
mov eax, dword [edi + 0x2c]
cmp eax, ecx
jb 0x40254e
mov ecx, eax
add eax, ecx
mov dword [edi + 0x2c], eax
jmp 0x40256a
cmp eax, 2
jae 0x40255f
mov eax, dword [edi + 0x2c]
jmp 0x402562
mov eax, dword [esi + 0x30]
cdq
sub eax, edx
sar eax, 1
add dword [edi + 0x2c], eax
mov eax, dword [edi + 0x2c]
add eax, dword [ebp - 0xc]
mov dword [ebp - 0x24], 1
jmp 0x4025a7
mov ecx, dword [ebp - 0x1c]
cmp dword [edi + 0x30], ecx
jb 0x402619
mov ecx, dword [esi + 0xbc]
cmp eax, ecx
jle 0x402597
cmp ecx, edx
jg 0x402619
inc eax
mov dword [edi + 0x34], eax
mov eax, dword [edi + 0x2c]
add eax, dword [ebp - 0xc]
inc dword [ebp - 0x18]
mov dword [edi + 0x30], edx
mov ecx, dword [edi + 0x24]
mov dword [edi + 0x28], eax
mov eax, dword [ebp - 0xc]
mov dword [edi + 0x18], eax
mov eax, dword [ebp - 0x14]
mov dword [edi + 0x14], eax
mov eax, dword [esi + 0x18]
mov dword [edi + 0x20], eax
mov eax, dword [ebp - 4]
sub eax, dword [ebp - 8]
lea ecx, [ecx + eax + 0x18]
cmp ecx, dword [esi + 4]
jle 0x4025e1
push eax
push dword [ebp - 8]
mov eax, esi
call fcn.004016b8
mov eax, dword [ebp - 8]
pop ecx
pop ecx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
mov ecx, edi
call fcn.00402252
mov ebx, eax
mov dword [ebp - 4], eax
mov eax, dword [edi + 0x24]
test eax, eax
je 0x40260b
push eax
lea eax, [edi + 0x38]
push eax
push ebx
call fcn.00506bd0
add esp, 0xc
add ebx, dword [edi + 0x24]
mov dword [ebp - 4], ebx
mov eax, dword [edi + 0x34]
cmp eax, dword [esi + 0x7c]
jb 0x402617
or dword [esi + 0xc], 0xffffffff
xor edx, edx
mov edi, dword [edi]
lea eax, [esi + 0x94]
cmp edi, eax
jne 0x402510
mov eax, dword [ebp - 4]
sub eax, dword [ebp - 8]
cmp eax, edx
jle 0x402642
push eax
push dword [ebp - 8]
mov eax, esi
call fcn.004016b8
pop ecx
pop ecx
xor edx, edx
push 2
pop ecx
cmp dword [ebp - 0x18], edx
je 0x402671
mov eax, dword [esi + 0x14]
sub eax, dword [esi + 0x10]
shr eax, 1
mov dword [esi + 0x24], eax
cmp eax, ecx
jae 0x40265c
mov dword [esi + 0x24], ecx
mov eax, dword [esi + 0x24]
add eax, dword [ebp - 0x1c]
mov edi, dword [esi + 8]
imul edi, eax
mov dword [esi + 0x44], eax
mov dword [esi + 0x80], edi
pop edi
pop ebx
cmp dword [ebp - 0x24], edx
je 0x402698
mov eax, dword [ebp - 0x10]
shr eax, 1
mov dword [esi + 0x24], eax
cmp eax, ecx
jae 0x402687
mov dword [esi + 0x24], ecx
mov ecx, dword [esi + 8]
xor eax, eax
inc eax
mov dword [esi + 0x44], eax
mov dword [esi + 0x80], ecx
jmp 0x40269b
xor eax, eax
inc eax
cmp dword [esi + 0x44], eax
jae 0x4026ac
mov dword [esi + 0x44], eax
mov eax, dword [esi + 8]
mov dword [esi + 0x80], eax
leave
ret