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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x74
movsd xmm0, qword [0x4c09d8]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push 0x4c0ed8
push esi
movsd qword [esp + 0x80], xmm0
call fcn.0046f710
push 0x4c0ee4
fstp qword [esp + 0x74]
push esi
call fcn.0046f710
push 0x4c0ed0
push esi
fstp qword [esp + 0x78]
mov dword [esp + 0x38], 0xffffffff
mov dword [esp + 0x3c], 0xffffffff
mov dword [esp + 0x40], 0xffffffff
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], 0
mov dword [esp + 0x2c], 0
call fcn.0046f500
movsd xmm1, qword [esp + 0x80]
add esp, 0x18
movsd xmm0, qword [0x4c1030]
mov ebx, eax
comisd xmm0, xmm1
mov dword [esp + 0x10], ebx
movsd qword [esp + 0x70], xmm1
jae 0x40ecfd
comisd xmm1, xmmword [0x4c1038]
jae 0x40ecfd
xor ecx, ecx
jmp 0x40ed02
mov ecx, 1
xor eax, eax
movsd xmm0, qword [esp + 0x60]
comisd xmm1, xmmword [0x4c1048]
seta al
xor edx, edx
mov dword [esp + 0x34], eax
mov eax, dword [ebx + 0x24]
xor ebx, ebx
mov dword [esp + 0x30], edx
mov eax, dword [eax + 8]
cmp eax, 2
sete bl
mov dword [esp + 0x50], ebx
xor ebx, ebx
cmp eax, 3
sete bl
ucomisd xmm0, qword [0x4c09d8]
mov dword [esp + 0x54], ebx
mov ebx, dword [esp + 0x10]
lahf
test ah, 0x44
jnp 0x40ed58
mov edx, 1
mov dword [esp + 0x30], edx
mov eax, edx
lea esi, [ebx + 0x68]
or eax, ecx
mov edi, 3
mov dword [esp + 0x48], eax
nop dword [eax + eax]
push 0x100
push esi
call fcn.004189e0
add esp, 4
push eax
call fcn.0041a9f0
add esp, 8
add esi, 0x10
sub edi, 1
jne 0x40ed70
lea edi, [ebx + 0x28]
push 0x10000
push edi
call fcn.004189e0
add esp, 4
push eax
call fcn.0041a9f0
add esp, 8
lea esi, [ebx + 0x38]
push 0x100
push esi
call fcn.004189e0
add esp, 4
push eax
call fcn.0041a9f0
lea eax, [ebx + 0x68]
push eax
call fcn.00418a20
lea ecx, [ebx + 0x78]
mov dword [esp + 0x64], eax
push ecx
call fcn.00418a20
lea ecx, [ebx + 0x88]
mov dword [esp + 0x6c], eax
push ecx
call fcn.00418a20
push edi
mov dword [esp + 0x78], eax
call fcn.00418a20
push esi
mov dword [esp + 0x68], eax
call fcn.00418a20
lea ecx, [ebx + 0x49c]
mov dword [esp + 0x48], eax
push ecx
call fcn.004189f0
lea ecx, [ebx + 0x4ac]
push ecx
call fcn.004189f0
lea ecx, [ebx + 0x4bc]
push ecx
call fcn.004189f0
movsd xmm0, qword [esp + 0x90]
add esp, 0x28
cmp dword [esp + 0x34], 0
je 0x40ee40
call sub.api_ms_win_crt_math_l1_1_0.dll__libm_sse2_sqrt_precise
movsd qword [esp + 0x70], xmm0
movsd xmm1, qword [0x4c09d8]
comisd xmm0, xmm1
jbe 0x40ee58
divsd xmm1, xmm0
movsd qword [esp + 0x78], xmm1
xor edx, edx
mov dword [esp + 0x44], edx
cmp dword [ebx + 8], edx
jle 0x40f025
mov ecx, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x10]
add ecx, 2
add ebx, 4
mov dword [esp + 0x40], ecx
xor edi, edi
nop dword [eax]
movzx esi, byte [ecx - 2]
cmp dword [esp + 0x20], esi
jne 0x40eeb2
movzx eax, byte [ecx - 1]
cmp dword [esp + 0x24], eax
jne 0x40eeb2
movzx eax, byte [ecx]
cmp dword [esp + 0x28], eax
jne 0x40eeb2
mov eax, dword [esp + 0x38]
mov word [ebx - 2], ax
mov eax, dword [esp + 0x3c]
mov word [ebx - 4], di
jmp 0x40f006
movzx edx, byte [ecx - 1]
mov eax, esi
movzx edi, byte [ecx]
mov dword [esp + 0x20], eax
imul eax, eax, 0x101
imul esi, edx, 0x101
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], edi
imul edi, edi, 0x101
mov word [ebx - 4], ax
movzx ecx, ax
mov eax, 0xff00ff01
mul ecx
mov eax, dword [esp + 0x2c]
shr edx, 8
mov word [ebx - 2], si
mov word [ebx], di
movzx ecx, si
movzx eax, word [eax + edx*2]
mov esi, dword [esp + 0x2c]
mov word [ebx - 4], ax
mov eax, 0xff00ff01
mul ecx
movzx ecx, di
shr edx, 8
movzx eax, word [esi + edx*2]
mov word [ebx - 2], ax
mov eax, 0xff00ff01
mul ecx
shr edx, 8
cmp dword [esp + 0x48], 0
movzx eax, word [esi + edx*2]
lea esi, [ebx - 4]
mov word [ebx], ax
je 0x40ef62
push dword [esp + 0x30]
sub esp, 0x10
movsd qword [esp + 8], xmm1
movsd qword [esp], xmm0
push dword [esp + 0x60]
push esi
call fcn.00413ff0
movsd xmm0, qword [esp + 0x8c]
add esp, 0x1c
movsd xmm1, qword [esp + 0x78]
push dword [esp + 0x50]
push dword [esp + 0x58]
push dword [esp + 0x3c]
sub esp, 0x10
movsd qword [esp + 8], xmm1
movsd qword [esp], xmm0
push dword [esp + 0x2c]
push esi
call fcn.0040bf60
movzx ecx, word [esi]
mov eax, 0xff00ff01
mul ecx
movsd xmm0, qword [esp + 0x94]
movsd xmm1, qword [esp + 0x9c]
mov eax, dword [esp + 0x7c]
add esp, 0x24
movzx ecx, word [ebx - 2]
shr edx, 8
movzx edi, word [eax + edx*2]
mov eax, 0xff00ff01
mul ecx
mov eax, dword [esp + 0x5c]
movzx ecx, word [ebx]
shr edx, 8
mov word [esi], di
movzx esi, word [eax + edx*2]
mov eax, 0xff00ff01
mul ecx
mov eax, dword [esp + 0x60]
mov ecx, edi
or dword [esp + 0x1c], ecx
shr edx, 8
mov word [ebx - 2], si
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x40]
movzx eax, word [eax + edx*2]
mov edx, esi
or dword [esp + 0x18], edx
or dword [esp + 0x14], eax
mov dword [esp + 0x38], edx
mov edx, dword [esp + 0x44]
mov dword [esp + 0x3c], eax
mov word [ebx], ax
inc edx
mov eax, dword [esp + 0x10]
add ecx, 3
add ebx, 6
mov dword [esp + 0x40], ecx
mov dword [esp + 0x44], edx
cmp edx, dword [eax + 8]
jl 0x40ee80
xor ecx, ecx
mov eax, 4
cmp word [esp + 0x14], cx
pop edi
cmovne eax, ecx
mov ecx, 2
xor edx, edx
cmp word [esp + 0x14], dx
pop esi
cmovne ecx, edx
add eax, ecx
xor ecx, ecx
cmp word [esp + 0x14], cx
pop ebx
sete cl
add eax, ecx
mov esp, ebp
pop ebp
ret