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

Disassembly:
sub esp, 0x3c
push ebx
push ebp
push esi
mov esi, ecx
mov ecx, dword [esi + 0xc4]
push edi
mov dword [esp + 0x34], esi
call fcn.0043c970
lea ebx, [esi + 0xcc]
mov ecx, ebx
mov dword [esp + 0x28], eax
call fcn.0043c970
mov dword [esp + 0x3c], eax
mov eax, dword [esi + 0xc4]
mov ecx, dword [eax + 0x228]
test ecx, ecx
jne 0x40e6c8
mov ecx, dword [eax + 0x188]
test ecx, ecx
jne 0x40e6bf
xor ebp, ebp
mov dword [esp + 0x10], ebp
jmp 0x40e6d4
mov ebp, dword [eax + 0x78]
mov dword [esp + 0x10], ebp
jmp 0x40e6d4
mov ecx, dword [eax + 0x1c0]
mov dword [esp + 0x10], ecx
mov ebp, ecx
mov ecx, dword [eax + 0x228]
test ecx, ecx
jne 0x40e6f1
mov ecx, dword [eax + 0x188]
test ecx, ecx
jne 0x40e6ec
xor edi, edi
jmp 0x40e6f7
mov edi, dword [eax + 0x7c]
jmp 0x40e6f7
mov edi, dword [eax + 0x1bc]
mov ecx, dword [eax + 0x228]
test ecx, ecx
jne 0x40e714
mov ecx, dword [eax + 0x188]
test ecx, ecx
jne 0x40e70f
xor eax, eax
jmp 0x40e71a
mov eax, dword [eax + 0x74]
jmp 0x40e71a
mov eax, dword [eax + 0x1c4]
cdq
sub eax, edx
sar eax, 1
mov dword [esp + 0x48], eax
mov eax, dword [ebx + 0x228]
test eax, eax
jne 0x40e740
mov eax, dword [ebx + 0x188]
test eax, eax
jne 0x40e73b
xor eax, eax
jmp 0x40e746
mov eax, dword [ebx + 0x74]
jmp 0x40e746
mov eax, dword [ebx + 0x1c4]
cdq
lea ecx, [edi - 2]
sub eax, edx
mov edx, dword [esi + 0x310]
mov dword [esp + 0x24], ecx
mov ebx, ebp
mov ecx, edi
sar eax, 1
shr ebx, 1
shr ecx, 1
test edi, edi
mov dword [esp + 0x30], eax
mov dword [esp + 0x38], ebx
mov dword [esp + 0x44], ecx
jle 0x40e919
neg ecx
mov dword [esp + 0x14], ecx
lea ecx, [edi - 1]
shr ecx, 1
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x3c]
inc ecx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x3c], ecx
test ebp, ebp
mov edi, dword [esp + 0x1c]
jle 0x40e8e1
mov eax, dword [esp + 0x20]
mov dword [esp + 0x18], eax
lea eax, [ebp - 1]
shr eax, 1
neg ebx
inc eax
mov dword [esp + 0x2c], eax
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx]
imul eax, dword [esp + 0x50]
cdq
and edx, 0xff
add eax, edx
sar eax, 8
and eax, 0x3ff
shl eax, 2
mov ecx, dword [eax + esi + 0x1314]
mov ebp, dword [eax + esi + 0x314]
mov eax, dword [esp + 0x14]
imul eax, ebp
cdq
and edx, 0x3ff
add eax, edx
sar eax, 0xa
mov dword [esp + 0x40], eax
mov eax, ebx
imul eax, ecx
cdq
and edx, 0x3ff
add eax, edx
mov edx, dword [esp + 0x38]
mov esi, eax
mov eax, dword [esp + 0x40]
add eax, edx
sar esi, 0xa
add esi, eax
mov eax, dword [esp + 0x14]
imul eax, ecx
cdq
and edx, 0x3ff
add eax, edx
mov ecx, eax
mov eax, ebx
imul eax, ebp
cdq
and edx, 0x3ff
add eax, edx
mov edx, dword [esp + 0x44]
sar ecx, 0xa
sar eax, 0xa
sub ecx, eax
add ecx, edx
cmp esi, 1
jge 0x40e84f
mov eax, dword [esp + 0x10]
add eax, 0xfffffffe
add esi, eax
mov eax, dword [esp + 0x10]
add eax, 0xfffffffe
cmp esi, eax
jl 0x40e85c
sub esi, eax
cmp ecx, 1
mov eax, dword [esp + 0x24]
jge 0x40e867
add ecx, eax
cmp ecx, eax
jl 0x40e86d
sub ecx, eax
mov edx, dword [esp + 0x48]
mov ebp, dword [esp + 0x28]
mov eax, ecx
imul eax, edx
add eax, esi
inc ecx
imul ecx, edx
mov edx, dword [esp + 0x28]
lea eax, [ebp + eax*2]
mov bp, word [eax]
mov word [edi], bp
mov ax, word [eax + 2]
mov word [edi + 2], ax
add ecx, esi
mov esi, dword [esp + 0x18]
lea eax, [edx + ecx*2]
mov dx, word [eax]
mov ecx, dword [esp + 0x30]
mov word [edi + ecx*2], dx
mov ax, word [eax + 2]
mov word [edi + ecx*2 + 2], ax
mov eax, dword [esp + 0x2c]
add esi, 8
add ebx, 2
add edi, 4
dec eax
mov dword [esp + 0x18], esi
mov esi, dword [esp + 0x34]
mov dword [esp + 0x2c], eax
jne 0x40e7b0
mov ebx, dword [esp + 0x38]
mov ebp, dword [esp + 0x10]
mov eax, ecx
mov ecx, dword [esp + 0x3c]
mov edi, dword [esp + 0x1c]
lea edx, [eax*4]
add edi, edx
mov edx, dword [esp + 0x14]
add edx, 2
mov dword [esp + 0x1c], edi
mov edi, dword [esp + 0x20]
mov dword [esp + 0x14], edx
lea edx, [ebp*8]
add edi, edx
dec ecx
mov dword [esp + 0x20], edi
mov dword [esp + 0x3c], ecx
jne 0x40e790
lea ecx, [esi + 0xcc]
call fcn.0043c9e0
mov ecx, dword [esi + 0xc4]
call fcn.0043c9e0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret 4