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

Disassembly:
sub esp, 0x30
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x5c]
cdq
and edx, 3
push ebx
add eax, edx
push ebp
sar eax, 2
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x40]
cdq
and edx, 3
push esi
add eax, edx
mov esi, ecx
sar eax, 2
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x50]
cdq
sub eax, edx
push edi
sar eax, 1
sub esi, eax
mov eax, dword [esp + 0x58]
cdq
sub eax, edx
sub ecx, esi
mov edi, eax
mov eax, dword [esp + 0x70]
sar edi, 1
mov edx, eax
mov ebx, dword [esp + 0x64]
sub edx, edi
mov edi, dword [esp + 0x68]
sub eax, edx
imul edi, dword [esp + 0x60]
mov dword [esp + 0x68], eax
mov ebp, dword [esp + 0x4c]
fild dword [esp + 0x68]
mov dword [esp + 0x68], ecx
add edi, ebx
fild dword [esp + 0x68]
mov ebx, dword [esp + 0x5c]
mov dword [esp + 0x10], ebp
add edi, ebx
mov dword [esp + 0x4c], 0
fpatan
mov dword [esp + 0x14], esi
mov dword [esp + 0x1c], edx
mov dword [esp + 0x48], edi
fmul qword [0x45e220]
call fcn.00451430
mov esi, dword [esp + 0x74]
mov ecx, esi
sub ecx, eax
mov dword [esp + 0x68], ecx
fild dword [esp + 0x68]
fild dword [esp + 0x6c]
fstp qword [esp + 0x28]
fild dword [esp + 0x14]
fsub qword [esp + 0x28]
fabs
fild dword [esp + 0x70]
fstp qword [esp + 0x14]
fild dword [esp + 0x1c]
fsub qword [esp + 0x14]
fabs
fld st(1)
fmul st(2)
fld st(1)
fmul st(2)
faddp st(1)
fsqrt
fstp qword [esp + 0x1c]
fstp st(0)
fstp st(0)
call fcn.00451430
mov ebx, eax
push ebx
call fcn.0041dae0
fmul qword [esp + 0x20]
add esp, 4
fsubr qword [esp + 0x28]
push ebx
fstp qword [esp + 0x2c]
call fcn.0041daa0
fmul qword [esp + 0x20]
add esp, 4
fadd qword [esp + 0x14]
push esi
fstp qword [esp + 0x20]
call fcn.0041dae0
fstp qword [esp + 0x18]
add esp, 4
push esi
call fcn.0041daa0
add esp, 4
add esi, 0x10e
fchs
fstp qword [esp + 0x30]
push esi
call fcn.0041dae0
fstp qword [esp + 0x3c]
add esp, 4
push esi
call fcn.0041daa0
mov eax, dword [esp + 0x5c]
add esp, 4
test eax, eax
fchs
jle 0x40bebe
fld qword [esp + 0x28]
fld qword [esp + 0x1c]
fld qword [esp + 0x14]
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x54]
fld st(2)
test eax, eax
fld st(2)
jle 0x40be99
mov dword [esp + 0x6c], eax
mov al, byte [edi]
fxch st(1)
fadd st(2)
fxch st(1)
fadd qword [esp + 0x30]
test al, al
je 0x40be4e
fld st(1)
fsub qword [0x45e228]
call fcn.00451430
fld st(0)
fsub qword [0x45e228]
mov ebx, eax
call fcn.00451430
fld st(0)
mov esi, eax
call fcn.00451430
mov edx, dword [esp + 0x78]
cmp ebx, dword [edx]
jl 0x40be4e
cmp ebx, dword [edx + 8]
jg 0x40be4e
cmp esi, dword [edx + 4]
jl 0x40be4e
cmp esi, dword [edx + 0xc]
jg 0x40be4e
mov ecx, esi
imul ecx, dword [esp + 0x50]
add ecx, ebx
mov ebx, dword [esp + 0x44]
cmp esi, eax
lea ecx, [ebx + ecx*4]
mov ebx, dword [ebp]
mov dword [ecx], ebx
je 0x40be4e
cmp eax, dword [edx + 4]
jl 0x40be4e
mov edx, dword [esp + 0x50]
lea eax, [edx*4]
mov edx, dword [ebp]
sub ecx, eax
mov dword [ecx], edx
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x54]
inc eax
cmp eax, ecx
mov dword [esp + 0x4c], eax
jl 0x40be86
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x24]
mov edi, dword [esp + 0x48]
mov dword [esp + 0x4c], 0
lea ebp, [eax + ecx*4]
mov eax, dword [esp + 0x60]
add edi, eax
mov dword [esp + 0x10], ebp
mov dword [esp + 0x48], edi
jmp 0x40be8a
add ebp, 4
inc edi
mov eax, dword [esp + 0x6c]
dec eax
mov dword [esp + 0x6c], eax
jne 0x40bdd2
fstp st(0)
mov eax, dword [esp + 0x70]
fstp st(0)
fld qword [esp + 0x38]
fld st(4)
fxch st(1)
faddp st(4)
dec eax
mov dword [esp + 0x70], eax
faddp st(2)
jne 0x40bdbe
fstp st(0)
fstp st(0)
fstp st(0)
pop edi
pop esi
pop ebp
pop ebx
fstp st(0)
add esp, 0x30
ret