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

Disassembly:
sub esp, 0x20
push ebx
push ebp
mov ebp, dword [esp + 0x3c]
push esi
mov esi, dword [esp + 0x38]
push edi
lea eax, [ebp*2]
add eax, ebp
lea ecx, [esi + esi]
cmp ecx, eax
jl 0x1005983f
lea ecx, [esi + 2]
mov eax, 0xaaaaaaab
mul ecx
mov ebx, edx
shr ebx, 1
jmp 0x10059844
lea ebx, [ebp + 1]
sar ebx, 1
mov ecx, dword [esp + 0x38]
lea eax, [ebx + ebx]
mov edi, dword [esp + 0x34]
sub esi, eax
mov dword [esp + 0x2c], eax
sub ebp, ebx
push esi
lea eax, [ebx*8]
mov dword [esp + 0x40], esi
add eax, ecx
push eax
push ebx
push ecx
push edi
mov dword [esp + 0x3c], eax
call fcn.10059790
add esp, 0x14
mov dword [esp + 0x14], eax
test eax, eax
jne 0x100598b7
mov eax, dword [esp + 0x38]
push ebx
lea esi, [eax + ebx*4]
push esi
push edi
call fcn.10055410
add esp, 0xc
test eax, eax
jns 0x100598b7
push ebx
push edi
lea eax, [ebx*8]
add eax, edi
push esi
push eax
call fcn.100010b0
add esp, 0x10
mov dword [esp + 0x24], 0
mov eax, 1
jmp 0x100598df
mov eax, dword [esp + 0x38]
push ebx
lea esi, [eax + ebx*4]
push esi
lea eax, [ebx*8]
add eax, edi
push edi
push eax
call fcn.100010b0
mov ecx, dword [esp + 0x24]
add esp, 0x10
sub ecx, eax
xor eax, eax
mov dword [esp + 0x24], ecx
push ebx
push esi
push edi
push edi
mov dword [esp + 0x54], eax
mov dword [esp + 0x2c], eax
call section..text
mov esi, dword [esp + 0x50]
add esp, 0x10
add dword [esp + 0x14], eax
lea eax, [edi + ebx*4]
lea ecx, [esi + ebx*4]
mov dword [esp + 0x18], ecx
cmp ebp, ebx
jne 0x10059962
push ebx
push ecx
push esi
push eax
call section..text
push ebx
lea ecx, [esi + ebx*4]
mov dword [esp + 0x34], eax
push ecx
push esi
call fcn.10055410
mov esi, eax
lea ecx, [ebx + ebx*2]
mov eax, dword [esp + 0x34]
lea edx, [edi + ecx*4]
mov ecx, dword [esp + 0x5c]
test esi, esi
push ebx
cmovns ecx, eax
mov dword [esp + 0x30], edx
cmovns eax, dword [esp + 0x60]
push ecx
push eax
push edx
call fcn.100010b0
mov eax, dword [esp + 0x48]
add esp, 0x2c
xor eax, 1
test esi, esi
cmovns eax, dword [esp + 0x1c]
mov dword [esp + 0x44], eax
jmp 0x100599fd
push ebp
push ecx
push ebx
push esi
push eax
call fcn.10059790
mov edx, dword [esp + 0x2c]
mov esi, ebx
add esp, 0x14
mov dword [esp + 0x20], eax
sub esi, ebp
mov ecx, edx
mov eax, esi
nop
lea ecx, [ecx - 4]
dec eax
cmp dword [ecx], 0
jne 0x100599e3
test eax, eax
jne 0x10059980
push ebp
push edx
push dword [esp + 0x48]
call fcn.10055410
add esp, 0xc
test eax, eax
jns 0x100599df
mov ecx, dword [esp + 0x18]
lea eax, [ebx + ebx*2]
push ebp
push dword [esp + 0x44]
lea eax, [edi + eax*4]
push ecx
push eax
mov dword [esp + 0x20], eax
call fcn.100010b0
add esp, 0x10
test esi, esi
je 0x100599d8
lea eax, [ebx*2]
mov ecx, esi
add eax, ebp
add eax, ebx
lea edi, [edi + eax*4]
xor eax, eax
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x34]
xor dword [esp + 0x44], 1
jmp 0x100599fd
mov edx, dword [esp + 0x18]
push ebp
push edx
push ebx
push dword [esp + 0x4c]
lea eax, [ebx + ebx*2]
lea eax, [edi + eax*4]
push eax
mov dword [esp + 0x24], eax
call fcn.10050db0
add esp, 0x14
mov esi, dword [esp + 0x48]
lea eax, [edi + ebx*4]
push ebx
push eax
push edi
push esi
call fcn.100591f0
add esp, 0x10
lea eax, [esi + ebx*4]
cmp dword [esp + 0x14], 1
mov dword [esp + 0x34], eax
jne 0x10059a35
push ebx
lea ecx, [edi + ebx*4]
push ecx
push eax
push eax
call section..text
mov ecx, eax
add esp, 0x10
mov eax, dword [esp + 0x34]
jmp 0x10059a51
jbe 0x10059a4f
push 2
push ebx
lea ecx, [edi + ebx*4]
push ecx
push eax
call fcn.10001d27
mov ecx, eax
add esp, 0x10
mov eax, dword [esp + 0x34]
jmp 0x10059a51
xor ecx, ecx
cmp dword [esp + 0x20], 0
mov dword [esp + 0x1c], ecx
je 0x10059a72
push ebx
push edi
push eax
push eax
call section..text
add eax, dword [esp + 0x24]
add esp, 0x10
mov ecx, dword [esp + 0x1c]
add ecx, eax
push ebx
push dword [esp + 0x14]
lea eax, [ebx*8]
lea edx, [eax + esi]
add eax, edi
mov dword [edx], ecx
push eax
push edi
mov dword [esp + 0x30], edx
call fcn.100591f0
mov eax, dword [esp + 0x34]
add esp, 0x10
test eax, eax
je 0x10059aad
push ebx
push dword [esp + 0x14]
lea eax, [edi + ebx*4]
push eax
push eax
call section..text
add esp, 0x10
mov dword [edi + ebx*8], eax
mov eax, dword [esp + 0x2c]
inc eax
cmp dword [esp + 0x44], 0
push eax
push edi
push esi
push esi
je 0x10059ac7
call fcn.100010b0
jmp 0x10059acc
call section..text
add esp, 0x10
lea eax, [ebx*2 + 1]
push 1
push eax
push esi
push esi
call fcn.100012f8
push ebx
push dword [esp + 0x48]
lea eax, [ebx*8]
add eax, edi
push esi
push eax
mov ecx, dword [eax]
mov dword [esp + 0x44], ecx
call section..text
mov ecx, dword [esp + 0x40]
add esp, 0x20
mov esi, dword [esp + 0x34]
mov edx, dword [ecx]
add edx, dword [esi]
add edx, eax
mov dword [esi], edx
mov ecx, dword [ecx]
add ecx, eax
cmp edx, ecx
jae 0x10059b1f
add dword [esi + 4], 1
lea esi, [esi + 4]
je 0x10059b16
cmp dword [esp + 0x44], 0
push ebx
push edi
je 0x10059b6b
mov esi, dword [esp + 0x50]
push esi
push esi
call section..text
push eax
push ebx
lea eax, [edi + ebx*4]
push eax
lea esi, [ebx*8]
add esi, edi
push esi
push esi
call fcn.100010a7
mov ecx, dword [esp + 0x58]
add esp, 0x24
mov edx, dword [esp + 0x24]
add edx, eax
mov eax, dword [ecx]
add eax, edx
mov dword [ecx], eax
cmp eax, edx
jae 0x10059bb4
add dword [ecx + 4], 1
lea ecx, [ecx + 4]
je 0x10059b60
jmp 0x10059bb4
mov eax, dword [esp + 0x50]
push eax
push eax
call fcn.100010b0
push eax
push ebx
lea eax, [edi + ebx*4]
push eax
lea eax, [ebx*8]
add eax, edi
push eax
push eax
call fcn.10001157
mov edx, dword [esp + 0x58]
add esp, 0x24
mov esi, dword [esp + 0x24]
add esi, eax
mov ecx, dword [edx]
mov eax, ecx
sub eax, esi
mov dword [edx], eax
cmp ecx, esi
jae 0x10059bb4
mov ecx, dword [edx + 4]
lea edx, [edx + 4]
lea eax, [ecx - 1]
mov dword [edx], eax
test ecx, ecx
je 0x10059ba5
push ebx
push dword [esp + 0x44]
push dword [esp + 0x40]
push edi
call fcn.100591f0
mov ecx, dword [esp + 0x4c]
add esp, 0x10
cmp ecx, ebp
jle 0x10059bd4
mov edx, ecx
mov eax, ebp
jmp 0x10059bd8
mov edx, ebp
mov eax, ecx
mov esi, dword [esp + 0x10]
push eax
mov eax, dword [esp + 0x1c]
cmovle eax, dword [esp + 0x2c]
push eax
mov eax, dword [esp + 0x30]
cmovle eax, dword [esp + 0x20]
push edx
push eax
push esi
call fcn.10052eb0
push ebx
lea eax, [edi + ebx*4]
push esi
push eax
push eax
call fcn.100010b0
mov esi, dword [esp + 0x44]
push eax
push ebx
push edi
mov esi, dword [esi]
add esi, eax
lea eax, [ebx*8]
add eax, edi
push eax
push eax
call fcn.10001157
push eax
push ebx
lea eax, [edi + ebx*4]
push eax
push dword [esp + 0x78]
push dword [esp + 0x58]
call fcn.10001157
add esp, 0x4c
sub esi, eax
lea eax, [ebx + ebx*2]
push ebx
push dword [esp + 0x4c]
push eax
lea eax, [edi + ebx*4]
push eax
push eax
call fcn.10059790
mov ecx, dword [esp + 0x50]
add esi, eax
add esp, 0x14
mov dword [esp + 0x38], esi
lea eax, [ecx + ebp]
cmp eax, ebx
jle 0x10059c9b
mov esi, ebx
lea eax, [ebx + ebx]
sub ebp, ebx
shl esi, 4
add ebp, ecx
add esi, edi
push ebp
push esi
push eax
lea eax, [ebx*8]
add eax, edi
push eax
push eax
call fcn.10050db0
mov ecx, dword [esp + 0x4c]
add esp, 0x14
sub ecx, eax
mov eax, dword [esi]
add eax, ecx
mov dword [esi], eax
cmp eax, ecx
jae 0x10059c9b
add dword [esi + 4], 1
lea esi, [esi + 4]
je 0x10059c92
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret