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

Disassembly:
sub esp, 0x68
push ebx
push ebp
push esi
mov esi, dword [esp + 0x78]
push edi
mov edi, eax
mov eax, 0xff
cmp word [esi + 0x10], ax
jne 0x40f893
mov ecx, eax
cmp word [esi + 0x14], cx
jne 0x40f893
mov edx, eax
cmp word [esi + 0x12], dx
jne 0x40f893
cmp dword [esi + 0x5c], 0
mov byte [esp + 0x13], 1
jne 0x40f898
mov byte [esp + 0x13], 0
mov eax, dword [esi + 0x54]
mov eax, dword [eax + 0xe098]
test eax, eax
je 0x40f8b9
cmp dword [esi + 0x50], eax
je 0x40f8b9
mov eax, esi
call fcn.0040e4e0
test eax, eax
je 0x40fcb0
mov ecx, dword [esi + 0x30]
mov ebp, dword [edi + 4]
xor edx, edx
mov eax, ebp
div ecx
mov ebx, dword [edi + 0xc]
mov eax, ebx
sub ebp, edx
xor edx, edx
div ecx
mov dword [edi + 4], ebp
sub ebx, edx
xor edx, edx
lea ebx, [ebx + ecx - 1]
mov dword [esp + 0x40], ebx
mov dword [edi + 0xc], ebx
mov ebx, dword [edi]
mov eax, ebx
div ecx
mov eax, dword [edi + 8]
sub ebx, edx
xor edx, edx
div ecx
mov eax, dword [edi + 8]
mov dword [edi], ebx
sub eax, edx
lea eax, [eax + ecx - 1]
mov dword [edi + 8], eax
mov dword [esp + 0x44], eax
xor edx, edx
mov eax, ebp
div ecx
xor edx, edx
movzx edi, byte [esi + 0xc]
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x40]
div ecx
xor edx, edx
mov dword [esp + 0x74], eax
mov eax, ebx
div ecx
xor edx, edx
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x44]
div ecx
mov ecx, dword [esi + 4]
mov dword [esp + 0x70], eax
mov eax, edi
imul eax, ebx
cdq
and edx, 7
add eax, edx
mov ebx, eax
mov edx, ecx
imul edx, ebp
mov eax, edi
imul eax, dword [esp + 0x68]
sar ebx, 3
add ebx, edx
add ebx, dword [esi + 0x50]
cdq
and edx, 7
add eax, edx
mov edx, dword [esp + 0x6c]
imul ecx, edx
mov ebp, eax
sar ebp, 3
add ebp, ecx
add ebp, dword [esi + 0x34]
cmp byte [esi + 0xf], 0
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x40], ebp
je 0x40fc3f
movzx edi, byte [esi + 0xc]
mov eax, dword [esp + 0x74]
shr edi, 3
cmp edx, eax
mov dword [esp + 0x48], edi
jge 0x40fcb0
mov ecx, dword [esp + 0x70]
sub ecx, dword [esp + 0x68]
sub eax, edx
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x44], eax
xor edx, edx
cmp dword [esp + 0x3c], edx
mov dword [esp + 0x18], edx
jle 0x40fc15
mov dword [esp + 0x38], ebp
jmp 0x40f9c2
xor edx, edx
mov ebx, dword [esi + 0x30]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], edx
mov dword [esp + 0x14], edx
mov dword [esp + 0x4c], ebx
cmp ebx, edx
jbe 0x40fb0f
xor eax, eax
cmp ebx, edx
jbe 0x40fafe
movzx ecx, byte [esi + 0x16]
mov dword [esp + 0x50], ecx
movzx ecx, word [esi + 0x10]
mov dword [esp + 0x54], ecx
movzx ecx, byte [esi + 0x17]
mov dword [esp + 0x58], ecx
movzx ecx, word [esi + 0x12]
mov dword [esp + 0x5c], ecx
movzx ecx, byte [esi + 0x18]
mov dword [esp + 0x60], ecx
movzx ecx, word [esi + 0x14]
mov dword [esp + 0x64], ecx
jmp 0x40fa20
cmp edi, 2
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], edx
mov dword [esp + 0x20], edx
jl 0x40fa87
imul ebx, dword [esp + 0x18]
mov esi, dword [esi + 4]
imul esi, dword [esp + 0x14]
add ebx, eax
imul ebx, edi
add ebx, dword [esp + 0x1c]
add edi, 0xfffffffe
shr edi, 1
xor ebp, ebp
add esi, ebx
inc edi
lea ecx, [edi + edi]
mov dword [esp + 0x20], ecx
movzx ebx, byte [esi]
mov ecx, ebp
shl ebx, cl
lea ecx, [ebp + 8]
add esi, 2
add ebp, 0x10
add dword [esp + 0x24], ebx
movzx ebx, byte [esi - 1]
shl ebx, cl
add dword [esp + 0x28], ebx
sub edi, 1
jne 0x40fa58
mov edi, dword [esp + 0x48]
mov esi, dword [esp + 0x7c]
mov ebx, dword [esp + 0x4c]
cmp dword [esp + 0x20], edi
jae 0x40fab9
mov ebp, dword [esi + 4]
imul ebp, dword [esp + 0x14]
mov ecx, dword [esp + 0x20]
mov edx, ebx
imul edx, dword [esp + 0x18]
add edx, eax
imul edx, edi
add edx, ecx
add ebp, edx
mov edx, dword [esp + 0x1c]
movzx edx, byte [edx + ebp]
add ecx, ecx
add ecx, ecx
add ecx, ecx
shl edx, cl
mov ebp, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
add ecx, ebp
add edx, ecx
mov ecx, dword [esp + 0x50]
mov ebp, edx
shr ebp, cl
mov ecx, dword [esp + 0x58]
inc eax
and ebp, dword [esp + 0x54]
add dword [esp + 0x2c], ebp
mov ebp, edx
shr ebp, cl
mov ecx, dword [esp + 0x60]
shr edx, cl
and ebp, dword [esp + 0x5c]
and edx, dword [esp + 0x64]
add dword [esp + 0x30], ebp
add dword [esp + 0x34], edx
xor edx, edx
cmp eax, ebx
jb 0x40fa20
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
cmp eax, ebx
jb 0x40f9e1
mov ecx, dword [esi + 0x30]
mov eax, dword [esp + 0x2c]
imul ecx, ecx
xor edx, edx
div ecx
xor edx, edx
mov ebx, eax
mov eax, dword [esp + 0x30]
div ecx
xor edx, edx
mov ebp, eax
mov eax, dword [esp + 0x34]
div ecx
cmp byte [esp + 0x13], 0
je 0x40fbbb
imul ebx, ebx, 0xb
lea eax, [eax + eax*4]
shl ebp, 4
add eax, ebp
add eax, ebx
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
cmp eax, 0x20
jg 0x40fb5e
mov eax, 0x101010
jmp 0x40fbd1
cmp eax, 0x40
jg 0x40fb6a
mov eax, 0x303030
jmp 0x40fbd1
cmp eax, 0x60
jg 0x40fb76
mov eax, 0x505050
jmp 0x40fbd1
cmp eax, 0x80
jg 0x40fb84
mov eax, 0x707070
jmp 0x40fbd1
cmp eax, 0xa0
jg 0x40fb92
mov eax, 0x909090
jmp 0x40fbd1
cmp eax, 0xc0
jg 0x40fba0
mov eax, 0xb0b0b0
jmp 0x40fbd1
xor edx, edx
cmp eax, 0xe0
setg dl
dec edx
and edx, 0xffdfdfe0
add edx, 0xf0f0f0
mov eax, edx
jmp 0x40fbd1
movzx ecx, byte [esi + 0x18]
shl eax, cl
movzx ecx, byte [esi + 0x17]
shl ebp, cl
movzx ecx, byte [esi + 0x16]
shl ebx, cl
add eax, ebp
add eax, ebx
xor edx, edx
test edi, edi
jbe 0x40fbf6
xor ebp, ebp
lea esp, [esp]
mov ecx, ebp
mov ebx, eax
shr ebx, cl
mov ecx, dword [esp + 0x38]
inc edx
add ebp, 8
mov byte [ecx + edx - 1], bl
cmp edx, edi
jb 0x40fbe0
mov eax, dword [esp + 0x18]
add dword [esp + 0x38], edi
inc eax
cmp eax, dword [esp + 0x3c]
mov dword [esp + 0x18], eax
jl 0x40f9c0
mov ebp, dword [esp + 0x40]
mov ebx, dword [esp + 0x1c]
mov eax, dword [esi + 4]
mov edx, dword [esi + 0x30]
imul edx, eax
add ebx, edx
add ebp, eax
sub dword [esp + 0x44], 1
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x40], ebp
jne 0x40f9a9
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x68
ret 4
movzx eax, byte [esi + 0xc]
mov ecx, dword [esp + 0x74]
shr eax, 3
cmp edx, ecx
mov dword [esp + 0x38], eax
jge 0x40fcb0
mov edi, dword [esp + 0x70]
sub edi, dword [esp + 0x68]
sub ecx, edx
mov dword [esp + 0x44], edi
mov dword [esp + 0x40], ecx
xor edi, edi
cmp dword [esp + 0x44], edi
jle 0x40fc9c
mov dword [esp + 0x7c], ebp
mov edx, dword [esp + 0x7c]
mov ecx, edi
imul ecx, eax
imul ecx, dword [esi + 0x30]
push eax
add ecx, ebx
push ecx
push edx
call fcn.00463790
mov eax, dword [esp + 0x44]
add dword [esp + 0x88], eax
inc edi
add esp, 0xc
cmp edi, dword [esp + 0x44]
jl 0x40fc70
mov ecx, dword [esi + 4]
mov edx, dword [esi + 0x30]
imul edx, ecx
add ebx, edx
add ebp, ecx
sub dword [esp + 0x40], 1
jne 0x40fc64
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x68
ret 4