Function at 0x40f620
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, 0x4a5fa0
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 0x40f6c3
mov eax, dword [esp + 0x4c]
inc eax
cmp ecx, eax
jl 0x40f6c3
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 0x40f6af
cmp eax, 4
jne 0x40f6c3
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 0x40f709
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 0x40f6f4
cmp edx, 4
jne 0x40f705
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 0x40f747
mov eax, dword [esp + 0x4c]
inc eax
cmp ecx, eax
jl 0x40f747
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 0x40f739
cmp eax, 4
jne 0x40f743
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.0x40f763
jmp dword [ecx*4 + 0x40f974]
test ebp, ebp
je 0x40f775
add ebp, 0x1e
mov dword [esp + 0x30], ebp
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40f784
add eax, 0x3c
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x10]
test eax, eax
je case.default.0x40f763
add eax, 0x5a
jmp 0x40f842
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
test eax, eax
mov dword [esp + 0x18], edx
je case.default.0x40f763
lea ecx, [eax + 0x5a]
add eax, 0x3c
mov dword [esp + 0x2c], ecx
jmp 0x40f842
test ebp, ebp
je 0x40f7cd
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.0x40f763
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 0x40f842
test ebp, ebp
je 0x40f7fa
add ebp, 0x78
mov dword [esp + 0x30], ebp
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40f809
add eax, 0x78
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x10]
test eax, eax
je case.default.0x40f763
add eax, 0x78
jmp 0x40f842
test ebp, ebp
je 0x40f824
add ebp, 0x96
mov dword [esp + 0x30], ebp
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40f835
add eax, 0x96
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x10]
test eax, eax
je case.default.0x40f763
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 0x40f8f1
mov esi, dword [esp + 0x44]
mov dword [eax], 1
mov cx, word [edi]
test cx, cx
jle 0x40f892
mov eax, esi
movsx ecx, cx
sar eax, 1
add eax, ecx
jmp 0x40f89b
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 0x40f8de
imul ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x40]
test ecx, ecx
jle 0x40f8d1
mov eax, edi
sar eax, 1
add eax, ecx
cdq
idiv edi
jmp 0x40f8e0
mov edx, edi
mov eax, ecx
sar edx, 1
sub eax, edx
cdq
idiv edi
jmp 0x40f8e0
xor eax, eax
mov word [esi], ax
add esi, 2
dec ebp
jne 0x40f8b1
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 0x40f912
mov eax, edi
movsx ecx, cx
sar eax, 1
add eax, ecx
jmp 0x40f91b
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 0x40f95c
imul ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x40]
test ecx, ecx
jle 0x40f94f
mov eax, esi
sar eax, 1
add eax, ecx
cdq
idiv esi
jmp 0x40f95e
mov edx, esi
mov eax, ecx
sar edx, 1
sub eax, edx
cdq
idiv esi
jmp 0x40f95e
xor eax, eax
mov word [edi], ax
add ebx, 2
add edi, 2
dec ebp
jne 0x40f930
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret