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

Disassembly:
push ebp
push edi
push esi
mov esi, ecx
push ebx
mov ebx, eax
sub esp, 0x4c
mov eax, dword [eax]
mov edi, dword [ebx + 8]
mov ecx, dword [ebx + 0xc]
mov dword [esp + 0x28], edx
mov edx, dword [esp + 0x74]
mov dword [esp + 0x24], eax
mov eax, dword [ebx + 4]
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], ecx
mov ecx, dword [ebx + 0x18]
mov dword [esp + 0x34], eax
mov eax, dword [eax + 0x38]
mov dword [esp + 0x20], ecx
mov ecx, dword [ebx + 0x20]
movsx eax, word [eax + edi*2]
mov dword [esp + 0x38], ecx
lea edi, [eax + edx*8]
mov eax, dword [esp + 0x78]
mov edx, edi
sar edx, 1
test eax, eax
setne byte [esp + 0x1c]
je 0x40e522
cmp dword [esp + 0x64], 2
je 0x40e767
mov eax, dword [esp + 0x68]
sub edx, 4
mov ecx, dword [esp + 0x64]
mov eax, dword [eax]
lea ecx, [ecx + ecx - 1]
imul edx, ecx
mov ebp, eax
sub ebp, edi
mov edi, ebp
sub edi, 0x20
add eax, edx
cdq
idiv ecx
lea ecx, [ebp - 0x1f]
cmp ecx, eax
mov ecx, 0x40
cmovle eax, edi
mov edi, 1
cmp eax, 0x40
cmovle ecx, eax
cmp ecx, 3
jle 0x40e582
mov eax, ecx
and eax, 7
movsx edi, word [eax + eax + 0x4243a0]
sar ecx, 3
mov eax, 0xe
sub eax, ecx
mov ecx, eax
sar edi, cl
add edi, 1
and edi, 0xfffffffe
cmp byte [esp + 0x1c], 0
je 0x40e599
mov eax, dword [esp + 0x30]
cmp dword [esp + 0x2c], eax
mov eax, 1
cmovge edi, eax
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x40e7e3
mov eax, dword [esp + 0x20]
xor ebp, ebp
mov dword [esp], eax
call fcn.00413620
cmp edi, 1
mov dword [esp + 0x30], eax
je 0x40ead8
cmp byte [esp + 0x1c], 0
jne 0x40e780
cmp dword [esp + 0x70], 1
jle 0x40e910
mov edx, dword [esp + 0x24]
lea eax, [edi + 1]
test edx, edx
je 0x40e9d8
mov dword [esp + 8], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 4], ebp
mov dword [esp], eax
call fcn.00419630
lea esi, [esi]
mov eax, ebp
shl eax, 0xe
cdq
idiv edi
cmp byte [esp + 0x1c], 0
mov ebp, eax
je 0x40e8c1
mov ecx, dword [esp + 0x24]
test ecx, ecx
je 0x40e8c1
test eax, eax
je 0x40e990
mov edx, dword [esp + 0x64]
xor eax, eax
fld dword [0x42443c]
test edx, edx
jle 0x40e662
mov edx, dword [esp + 0x60]
mov ecx, dword [esp + 0x64]
fld dword [esi + eax*4]
fmul st(1)
fld dword [edx + eax*4]
fmul st(2)
fld st(1)
fadd st(1)
fstp dword [esi + eax*4]
fsubrp st(1)
fstp dword [edx + eax*4]
add eax, 1
cmp eax, ecx
jne 0x40e641
fstp st(0)
jmp 0x40e664
fstp st(0)
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call fcn.00413620
mov ebx, eax
mov eax, dword [esp + 0x68]
sub ebx, dword [esp + 0x30]
sub dword [eax], ebx
cmp ebp, 0x4000
je 0x40e960
movsx eax, bp
call fcn.0040e2c0
cwde
mov esi, eax
mov dword [esp + 0x1c], eax
mov eax, 0x4000
bsr edi, esi
sub eax, ebp
xor edi, 0x1f
cwde
call fcn.0040e2c0
mov edx, esi
cwde
bsr esi, eax
mov dword [esp + 0x20], esi
xor dword [esp + 0x20], 0x1f
mov esi, dword [esp + 0x20]
lea ecx, [esi - 0x11]
mov esi, eax
shl esi, cl
lea ecx, [edi - 0x11]
movsx esi, si
shl edx, cl
movsx ecx, dx
mov edx, dword [esp + 0x64]
mov dword [esp + 0x24], ecx
sub edi, dword [esp + 0x20]
lea ecx, [edx - 1]
imul edx, esi, 0xfffff5db
shl edi, 0xb
shl ecx, 7
movsx ecx, cx
add edx, 0x4000
sar edx, 0xf
add dx, 0x1efc
movzx edx, dx
imul edx, esi
mov esi, dword [esp + 0x24]
add edx, 0x4000
sar edx, 0xf
add edi, edx
imul edx, esi, 0xfffff5db
add edx, 0x4000
sar edx, 0xf
add dx, 0x1efc
movzx edx, dx
imul edx, esi
add edx, 0x4000
sar edx, 0xf
sub edi, edx
movsx edi, di
imul ecx, edi
xor edi, edi
add ecx, 0x4000
sar ecx, 0xf
mov edx, dword [esp + 0x28]
mov esi, dword [esp + 0x1c]
mov dword [edx], edi
mov dword [edx + 4], esi
mov dword [edx + 8], eax
mov dword [edx + 0xc], ecx
mov dword [edx + 0x10], ebp
mov dword [edx + 0x14], ebx
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x68]
sub edx, 0x10
mov ecx, 2
mov eax, dword [eax]
jmp 0x40e533
cmp dword [esp + 0x64], 2
jle 0x40e5d6
mov ebx, edi
shr ebx, 0x1f
add ebx, edi
sar ebx, 1
lea edx, [ebx + 1]
lea ecx, [edx + edx*2]
lea eax, [ecx + ebx]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x24]
test eax, eax
je 0x40e850
cmp ebp, ebx
jle 0x40e840
mov eax, ebp
lea edx, [ebp - 1]
sub eax, ebx
sub edx, ebx
add eax, ecx
add edx, ecx
mov ebx, dword [esp + 0x3c]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 4], edx
mov dword [esp + 0xc], ebx
mov dword [esp], eax
call fcn.00419430
jmp 0x40e600
mov eax, dword [esp + 0x64]
mov dword [esp], esi
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x78]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x60]
mov dword [esp + 4], eax
call fcn.004116c0
mov ebp, eax
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call fcn.00413620
cmp edi, 1
mov dword [esp + 0x30], eax
je 0x40eb42
imul ebp, edi
add ebp, 0x2000
sar ebp, 0xe
cmp byte [esp + 0x1c], 0
je 0x40e5cb
jmp 0x40e780
lea eax, [ebp + ebp*2 + 3]
lea edx, [eax - 3]
jmp 0x40e7c2
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x1c], edx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call fcn.00408350
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x1c]
cmp ecx, eax
mov esi, eax
jle 0x40eaa3
mov ebp, 0x55555556
imul ebp
sar esi, 0x1f
mov ebp, edx
sub ebp, esi
cmp ebp, ebx
jg 0x40ea91
lea eax, [ebp + ebp*2 + 3]
lea edx, [eax - 3]
mov esi, dword [esp + 0x3c]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 4], edx
mov dword [esp + 0xc], esi
mov dword [esp], eax
call fcn.004083d0
mov eax, ebp
shl eax, 0xe
cdq
idiv edi
mov ebp, eax
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call fcn.00413620
mov ebx, eax
mov eax, dword [esp + 0x68]
sub ebx, dword [esp + 0x30]
sub dword [eax], ebx
test ebp, ebp
jne 0x40e67c
xor edi, edi
movzx ecx, byte [esp + 0x6c]
mov eax, 1
xor ebp, ebp
mov esi, dword [esp + 0x7c]
mov dword [esp + 0x1c], 0x7fff
shl eax, cl
mov ecx, 0xffffc000
sub eax, 1
and dword [esi], eax
xor eax, eax
jmp 0x40e746
mov edx, edi
mov eax, dword [esp + 0x24]
sar edx, 1
lea ebx, [edx + 1]
mov ecx, ebx
imul ecx, ebx
test eax, eax
je 0x40ea10
cmp ebp, edx
jg 0x40e9f0
lea edx, [ebp + 1]
mov eax, ebp
imul eax, edx
sar eax, 1
add edx, eax
mov dword [esp + 4], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp], eax
call fcn.00419430
jmp 0x40e600
movzx ecx, byte [esp + 0x6c]
mov eax, 1
xor edi, edi
mov esi, dword [esp + 0x7c]
mov dword [esp + 0x1c], 0
shl eax, cl
sub eax, 1
shl eax, cl
mov ecx, 0x4000
and dword [esi], eax
mov eax, 0x7fff
jmp 0x40e746
mov ebx, dword [esp + 0x64]
mov edx, esi
xor edi, edi
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x60]
mov eax, dword [eax + 8]
mov dword [esp + 8], ebx
mov ebx, dword [esp + 0x2c]
mov dword [esp + 4], ebx
mov ebx, dword [esp + 0x38]
mov dword [esp], ebx
call fcn.0040e410
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call fcn.00413620
mov ebx, eax
mov eax, dword [esp + 0x68]
sub ebx, dword [esp + 0x30]
sub dword [eax], ebx
jmp 0x40e8e3
mov dword [esp + 4], eax
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call fcn.00408520
mov ebp, eax
jmp 0x40e8b7
lea edx, [edi + 1]
mov ebx, ecx
lea eax, [edi + 2]
sub edx, ebp
sub eax, ebp
imul eax, edx
sar eax, 1
sub ebx, eax
mov eax, ebx
jmp 0x40e93a
mov eax, dword [esp + 0x20]
mov dword [esp + 4], ecx
mov dword [esp + 0x24], edx
mov dword [esp + 0x1c], ecx
mov dword [esp], eax
call fcn.00408350
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x1c]
imul edx, ebx
sar edx, 1
cmp eax, edx
jl 0x40eab4
mov esi, ecx
sub esi, eax
lea eax, [esi*8 - 7]
mov dword [esp], eax
lea ebx, [edi + 1]
mov dword [esp + 0x1c], ecx
lea ebp, [ebx + ebx]
call fcn.00419940
mov ecx, dword [esp + 0x1c]
mov esi, ecx
sub ebp, eax
shr ebp, 1
lea eax, [edi + 2]
sub ebx, ebp
sub eax, ebp
mov edx, ebx
imul eax, ebx
sar eax, 1
sub esi, eax
mov eax, esi
add edx, eax
mov dword [esp + 4], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp], eax
call fcn.004083d0
jmp 0x40e8b7
mov eax, ebp
lea edx, [ebp - 1]
sub eax, ebx
sub edx, ebx
add eax, ecx
add edx, ecx
jmp 0x40e89b
mov eax, ebx
not eax
lea ebp, [eax + eax*2]
add esi, ebp
lea ebp, [edx + esi]
jmp 0x40e88c
lea eax, [eax*8 + 1]
mov dword [esp], eax
call fcn.00419940
mov ecx, dword [esp + 0x1c]
lea ebp, [eax - 1]
shr ebp, 1
lea edx, [ebp + 1]
mov eax, ebp
imul eax, edx
sar eax, 1
jmp 0x40ea72
xor ebp, ebp
cmp byte [esp + 0x1c], 0
je 0x40e8c1
xor edi, edi
mov eax, dword [esp + 0x68]
cmp dword [eax], 0x10
jle 0x40eb20
cmp dword [ebx + 0x1c], 0x10
jle 0x40eb20
mov ebx, dword [esp + 0x24]
test ebx, ebx
je 0x40eb27
mov eax, dword [esp + 0x20]
mov dword [esp + 8], 2
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.00419500
jmp 0x40e9bb
xor edi, edi
jmp 0x40e9bb
mov eax, dword [esp + 0x20]
mov dword [esp + 4], 2
mov dword [esp], eax
call fcn.00408410
mov edi, eax
jmp 0x40e9bb
cmp byte [esp + 0x1c], 0
je 0x40e8c1
xor eax, eax
cmp ebp, 0x2000
setg al
mov edi, eax
jle 0x40eb7e
mov ebp, dword [esp + 0x64]
test ebp, ebp
jle 0x40eb7e
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x64]
lea edx, [eax + edx*4]
nop
fld dword [eax]
add eax, 4
fchs
fstp dword [eax - 4]
cmp eax, edx
jne 0x40eb70
mov ecx, dword [esp + 0x64]
mov edx, esi
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 8]
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x2c]
mov dword [esp + 4], ecx
mov ecx, dword [esp + 0x38]
mov dword [esp], ecx
mov ecx, dword [esp + 0x60]
call fcn.0040e410
jmp 0x40eae7