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

Disassembly:
sub esp, 0x74
push ebx
push esi
mov esi, dword [esp + 0x80]
xor ebx, ebx
cmp esi, ebx
jne 0x100501db
pop esi
lea eax, [ebx + 0x14]
pop ebx
add esp, 0x74
ret
mov eax, dword [esp + 0x84]
cdq
sub eax, edx
mov ecx, eax
mov eax, dword [esp + 0x88]
cdq
sub eax, edx
sar ecx, 1
sar eax, 1
mov dword [esp + 0x84], ecx
mov dword [esp + 0x88], eax
cmp ecx, ebx
jne 0x1005020f
cmp eax, ebx
je 0x100505dc
push esi
call fcn.1004e3a0
add esp, 4
mov dword [esp + 0x40], eax
cmp eax, 2
jne 0x10050231
movsx eax, word [esi]
neg eax
sbb eax, eax
pop esi
and eax, 6
pop ebx
add esp, 0x74
ret
mov ecx, dword [esi + 4]
xor eax, eax
xor edx, edx
cmp dx, word [esi]
mov dword [esp + 0x30], ecx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x54], eax
jge 0x100505dc
push ebp
push edi
jmp 0x1005025a
mov esi, dword [esp + 0x88]
xor ebx, ebx
mov edx, dword [esi + 0xc]
movsx eax, word [edx + eax*2]
mov edi, dword [esp + 0x1c]
xor ebp, ebp
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x58], eax
mov dword [esp + 0x78], ebx
mov dword [esp + 0x74], ebx
mov dword [esp + 0x70], ebp
mov dword [esp + 0x6c], ebx
mov esi, eax
mov dword [esp + 0x10], edi
mov dword [esp + 0x20], 0xffffffff
cmp edi, eax
je 0x100505ba
lea esp, [esp]
mov edx, dword [esp + 0x20]
cmp esi, edx
je 0x100505ba
cmp edi, edx
je 0x100502e1
mov eax, dword [ecx + edi*8]
sub eax, dword [ecx + esi*8]
mov edx, dword [ecx + edi*8 + 4]
sub edx, dword [ecx + esi*8 + 4]
mov dword [esp + 0x64], eax
lea eax, [esp + 0x64]
push eax
mov dword [esp + 0x6c], edx
call fcn.1004c9c0
add esp, 4
mov dword [esp + 0x34], eax
test eax, eax
je 0x10050591
jmp 0x100502f9
mov ecx, dword [esp + 0x74]
mov edx, dword [esp + 0x78]
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x64], ecx
mov dword [esp + 0x68], edx
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x18]
test eax, eax
je 0x100505a0
cmp dword [esp + 0x20], 0
jge 0x1005031c
mov dword [esp + 0x20], esi
mov dword [esp + 0x74], ebx
mov dword [esp + 0x78], ebp
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x64]
imul edx
mov ecx, edx
sar ecx, 0x1f
add ecx, 0x8000
add eax, ecx
adc edx, 0
shr eax, 0x10
shl edx, 0x10
add eax, edx
mov dword [esp + 0x24], eax
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x70]
mov edx, dword [esp + 0x68]
imul edx
mov ecx, edx
sar ecx, 0x1f
add ecx, 0x8000
add eax, ecx
adc edx, 0
shr eax, 0x10
shl edx, 0x10
add eax, edx
mov dword [esp + 0x40], eax
mov ecx, dword [esp + 0x40]
add edi, ecx
cmp edi, 0xffff1000
jle 0x1005052e
mov edx, dword [esp + 0x68]
mov eax, dword [esp + 0x64]
add edi, 0x10000
add ebx, eax
add ebp, edx
cmp dword [esp + 0x48], 0
mov dword [esp + 0x50], edi
mov dword [esp + 0x80], ebx
jne 0x100503a6
neg ebp
jmp 0x100503af
neg ebx
mov dword [esp + 0x80], ebx
mov eax, dword [esp + 0x64]
mov edx, dword [esp + 0x70]
imul edx
mov ecx, edx
sar ecx, 0x1f
add ecx, 0x8000
add eax, ecx
adc edx, 0
shr eax, 0x10
shl edx, 0x10
add eax, edx
mov dword [esp + 0x28], eax
mov ebx, dword [esp + 0x28]
mov eax, dword [esp + 0x68]
mov edx, dword [esp + 0x6c]
imul edx
mov ecx, edx
sar ecx, 0x1f
add ecx, 0x8000
add eax, ecx
adc edx, 0
shr eax, 0x10
shl edx, 0x10
add eax, edx
mov dword [esp + 0x44], eax
sub ebx, dword [esp + 0x44]
cmp dword [esp + 0x48], 0
mov dword [esp + 0x14], ebx
jne 0x10050414
neg ebx
mov dword [esp + 0x14], ebx
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x34]
cmp eax, ecx
mov dword [esp + 0x18], eax
jl 0x10050428
mov dword [esp + 0x18], ecx
mov eax, dword [esp + 0x8c]
mov edx, dword [esp + 0x14]
imul edx
mov ecx, edx
sar ecx, 0x1f
add ecx, 0x8000
add eax, ecx
adc edx, 0
shr eax, 0x10
shl edx, 0x10
add eax, edx
mov dword [esp + 0x2c], eax
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x60], ecx
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x50]
imul edx
mov ecx, edx
sar ecx, 0x1f
add ecx, 0x8000
add eax, ecx
adc edx, 0
shr eax, 0x10
shl edx, 0x10
add eax, edx
mov dword [esp + 0x4c], eax
mov edx, dword [esp + 0x60]
cmp edx, dword [esp + 0x4c]
jg 0x10050494
mov eax, dword [esp + 0x8c]
push edi
push eax
jmp 0x1005049a
mov ecx, dword [esp + 0x18]
push ebx
push ecx
push ebp
call fcn.1004c560
mov ebx, eax
add esp, 0xc
mov eax, dword [esp + 0x90]
mov edx, dword [esp + 0x14]
imul edx
mov ecx, edx
sar ecx, 0x1f
add ecx, 0x8000
add eax, ecx
adc edx, 0
shr eax, 0x10
shl edx, 0x10
add eax, edx
mov dword [esp + 0x30], eax
mov ebp, dword [esp + 0x30]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x50]
imul edx
mov ecx, edx
sar ecx, 0x1f
add ecx, 0x8000
add eax, ecx
adc edx, 0
shr eax, 0x10
shl edx, 0x10
add eax, edx
mov dword [esp + 0x54], eax
cmp ebp, dword [esp + 0x54]
mov eax, dword [esp + 0x80]
jg 0x10050519
mov edx, dword [esp + 0x90]
push edi
push edx
push eax
call fcn.1004c560
add esp, 0xc
jmp 0x10050532
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
push ecx
push edx
push eax
call fcn.1004c560
add esp, 0xc
jmp 0x10050532
xor eax, eax
xor ebx, ebx
cmp esi, dword [esp + 0x10]
je 0x10050575
jmp 0x10050540
mov ecx, dword [esp + 0x8c]
lea edx, [ebx + ecx]
mov ecx, dword [esp + 0x38]
add dword [ecx + esi*8], edx
mov edx, dword [esp + 0x90]
add edx, eax
add dword [ecx + esi*8 + 4], edx
cmp esi, dword [esp + 0x58]
lea ecx, [ecx + esi*8 + 4]
jge 0x1005056b
inc esi
jmp 0x1005056f
mov esi, dword [esp + 0x1c]
cmp esi, dword [esp + 0x10]
jne 0x10050540
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 0x64]
mov ebp, dword [esp + 0x68]
mov eax, dword [esp + 0x34]
mov dword [esp + 0x6c], ebx
mov dword [esp + 0x70], ebp
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x58]
cmp edi, eax
jge 0x100505a4
inc edi
mov dword [esp + 0x10], edi
jmp 0x100505ae
mov esi, edi
jmp 0x10050579
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x10], ecx
mov edi, ecx
mov ecx, dword [esp + 0x38]
cmp edi, esi
jne 0x100502a0
mov edx, dword [esp + 0x88]
movsx edx, word [edx]
inc eax
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x5c]
inc eax
cmp eax, edx
mov dword [esp + 0x5c], eax
jl 0x10050251
pop edi
pop ebp
pop esi
xor eax, eax
pop ebx
add esp, 0x74
ret