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

Disassembly:
sub esp, 0x14
mov eax, dword [esp + 0x20]
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x34]
imul eax, edi
mov ebx, dword [esp + 0x2c]
mov esi, dword [esp + 0x38]
mov edx, dword [esp + 0x40]
xor ebp, ebp
lea ecx, [eax + ebx]
mov eax, 0x465f60
mov dword [esp + 0x30], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x34], eax
lea eax, [ecx + ecx*2]
shl eax, 3
sub eax, ecx
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], ebp
lea esi, [esi + eax*4]
add eax, esi
mov esi, dword [esp + 0x28]
cmp ebx, ebp
mov dword [esp + 0x28], ebp
lea eax, [esi + eax*4 + 0xd4]
mov dword [esp + 0x1c], eax
je 0x40f693
mov eax, dword [esp + 0x4c]
inc eax
cmp ecx, eax
jl 0x40f693
lea eax, [ecx + ecx*2]
shl eax, 3
sub eax, ecx
lea eax, [eax + eax*4]
lea eax, [esi + eax*4]
mov dword [esp + 0x20], eax
mov eax, dword [eax - 0xe0]
cmp eax, 3
je 0x40f67f
cmp eax, 4
jne 0x40f693
mov eax, dword [esp + 0x20]
lea ebp, [eax - 0x1ac]
mov eax, dword [eax - 0xdc]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x4c]
add eax, edi
cmp ecx, eax
mov dword [esp + 0x4c], eax
jl 0x40f6d9
mov eax, ecx
sub eax, edi
lea edx, [eax + eax*2]
shl edx, 3
sub edx, eax
lea edx, [edx + edx*4]
lea eax, [esi + edx*4]
mov edx, dword [esi + edx*4 + 0xec]
cmp edx, 3
je 0x40f6c4
cmp edx, 4
jne 0x40f6d5
lea edx, [eax + 0x20]
mov eax, dword [eax + 0xf0]
mov dword [esp + 0x28], edx
mov dword [esp + 0x14], eax
mov edx, dword [esp + 0x40]
test ebx, ebx
je 0x40f717
mov eax, dword [esp + 0x4c]
inc eax
cmp ecx, eax
jl 0x40f717
mov eax, ecx
sub eax, edi
lea edx, [eax + eax*2]
shl edx, 3
sub edx, eax
lea edx, [edx + edx*4]
mov eax, dword [esi + edx*4 - 0xe0]
lea edx, [esi + edx*4]
cmp eax, 3
je 0x40f709
cmp eax, 4
jne 0x40f713
add edx, 0xfffffe54
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x40]
lea eax, [ecx + ecx*2]
shl eax, 3
sub eax, ecx
mov ecx, dword [esp + 0x38]
cmp ecx, 5
lea eax, [eax + eax*4]
lea eax, [esi + eax*4 + 0x20]
ja case.default.0x40f733
jmp dword [ecx*4 + 0x40f944]
test ebp, ebp
je 0x40f745
add ebp, 0x1e
mov dword [esp + 0x30], ebp
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40f754
add eax, 0x3c
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x10]
test eax, eax
je case.default.0x40f733
add eax, 0x5a
jmp 0x40f812
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
test eax, eax
mov dword [esp + 0x18], edx
je case.default.0x40f733
lea ecx, [eax + 0x5a]
add eax, 0x3c
mov dword [esp + 0x2c], ecx
jmp 0x40f812
test ebp, ebp
je 0x40f79d
lea ecx, [ebp + 0x5a]
add ebp, 0x1e
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], ebp
mov dword [esp + 0x2c], eax
mov dword [esp + 0x14], edx
jmp case.default.0x40f733
lea ecx, [eax + 0x3c]
mov dword [esp + 0x18], edx
mov dword [esp + 0x30], ecx
lea ecx, [eax + 0x1e]
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x14], edx
jmp 0x40f812
test ebp, ebp
je 0x40f7ca
add ebp, 0x78
mov dword [esp + 0x30], ebp
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40f7d9
add eax, 0x78
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x10]
test eax, eax
je case.default.0x40f733
add eax, 0x78
jmp 0x40f812
test ebp, ebp
je 0x40f7f4
add ebp, 0x96
mov dword [esp + 0x30], ebp
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40f805
add eax, 0x96
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x10]
test eax, eax
je case.default.0x40f733
add eax, 0x96
mov dword [esp + 0x34], eax
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x30]
mov edi, dword [esp + 0x2c]
movsx ecx, word [edx]
movsx eax, word [eax]
sub eax, ecx
cdq
mov esi, eax
mov eax, ecx
xor esi, edx
sub esi, edx
movsx edx, word [edi]
sub eax, edx
cdq
xor eax, edx
sub eax, edx
cmp esi, eax
mov eax, dword [esp + 0x1c]
jge 0x40f8c1
mov esi, dword [esp + 0x44]
mov dword [eax], 1
mov cx, word [edi]
test cx, cx
jle 0x40f862
mov eax, esi
movsx ecx, cx
sar eax, 1
add eax, ecx
jmp 0x40f86b
mov edx, esi
movsx eax, cx
sar edx, 1
sub eax, edx
cdq
idiv esi
mov ecx, dword [esp + 0x48]
mov ebx, edi
sub ebx, ecx
mov ebp, 7
lea esi, [ecx + 2]
mov word [ecx], ax
movsx ecx, word [ebx + esi]
test ecx, ecx
je 0x40f8ae
imul ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x40]
test ecx, ecx
jle 0x40f8a1
mov eax, edi
sar eax, 1
add eax, ecx
cdq
idiv edi
jmp 0x40f8b0
mov edx, edi
mov eax, ecx
sar edx, 1
sub eax, edx
cdq
idiv edi
jmp 0x40f8b0
xor eax, eax
mov word [esi], ax
add esi, 2
dec ebp
jne 0x40f881
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov esi, dword [esp + 0x30]
mov edi, dword [esp + 0x44]
mov dword [eax], 2
mov cx, word [esi]
test cx, cx
jle 0x40f8e2
mov eax, edi
movsx ecx, cx
sar eax, 1
add eax, ecx
jmp 0x40f8eb
mov edx, edi
movsx eax, cx
sar edx, 1
sub eax, edx
cdq
idiv edi
mov ecx, dword [esp + 0x48]
lea ebx, [esi + 0x10]
mov ebp, 7
lea edi, [ecx + 2]
mov word [ecx], ax
movsx ecx, word [ebx]
test ecx, ecx
je 0x40f92c
imul ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x40]
test ecx, ecx
jle 0x40f91f
mov eax, esi
sar eax, 1
add eax, ecx
cdq
idiv esi
jmp 0x40f92e
mov edx, esi
mov eax, ecx
sar edx, 1
sub eax, edx
cdq
idiv esi
jmp 0x40f92e
xor eax, eax
mov word [edi], ax
add ebx, 2
add edi, 2
dec ebp
jne 0x40f900
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret