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

Disassembly:
sub esp, 0x2c
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x5c]
cdq
and edx, 3
push ebx
add eax, edx
push ebp
sar eax, 2
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x4c]
cdq
sub eax, edx
push esi
sar eax, 1
mov esi, ecx
push edi
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 + 0x68]
sub edx, edi
mov edi, dword [esp + 0x64]
sub eax, edx
imul ebx, dword [esp + 0x60]
mov dword [esp + 0x64], eax
mov ebp, dword [esp + 0x48]
fild dword [esp + 0x64]
mov dword [esp + 0x64], ecx
add ebx, edi
fild dword [esp + 0x64]
mov edi, dword [esp + 0x5c]
mov dword [esp + 0x10], ebp
add ebx, edi
mov dword [esp + 0x48], 0
fpatan
mov dword [esp + 0x14], esi
mov dword [esp + 0x1c], edx
mov dword [esp + 0x68], ebx
fmul qword [0x45e220]
call fcn.00451430
mov esi, dword [esp + 0x74]
mov ecx, esi
sub ecx, eax
mov dword [esp + 0x64], ecx
fild dword [esp + 0x64]
fild dword [esp + 0x6c]
fstp qword [esp + 0x24]
fild dword [esp + 0x14]
fsub qword [esp + 0x24]
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 edi, eax
push edi
call fcn.0041dae0
fmul qword [esp + 0x20]
add esp, 4
fsubr qword [esp + 0x24]
fstp qword [esp + 0x24]
push edi
call fcn.0041daa0
fmul qword [esp + 0x20]
add esp, 4
fadd qword [esp + 0x14]
push esi
fstp qword [esp + 0x18]
call fcn.0041dae0
fstp qword [esp + 0x20]
add esp, 4
push esi
call fcn.0041daa0
add esp, 4
add esi, 0x10e
fchs
fstp qword [esp + 0x2c]
push esi
call fcn.0041dae0
fstp qword [esp + 0x38]
add esp, 4
push esi
call fcn.0041daa0
mov eax, dword [esp + 0x5c]
add esp, 4
test eax, eax
fchs
jle 0x40d2f0
fld qword [esp + 0x24]
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(1)
jle 0x40d2cb
mov dword [esp + 0x6c], eax
mov al, byte [ebx]
fxch st(1)
fadd st(3)
fxch st(1)
fadd qword [esp + 0x2c]
test al, al
je 0x40d283
fld st(1)
fsub qword [0x45e228]
call fcn.00451430
fld st(0)
fsub qword [0x45e228]
mov edi, eax
call fcn.00451430
fld st(0)
mov esi, eax
call fcn.00451430
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x78]
cmp edi, dword [eax]
jl 0x40d283
cmp edi, dword [eax + 8]
jg 0x40d283
cmp esi, dword [eax + 4]
jl 0x40d283
cmp esi, dword [eax + 0xc]
jg 0x40d283
mov edx, esi
mov eax, dword [esp + 0x40]
imul edx, dword [esp + 0x44]
add edx, edi
mov edi, dword [esp + 0x50]
lea ecx, [eax + edx*4]
mov eax, dword [edi + 0x404]
xor edx, edx
mov dl, byte [ebp]
mov edx, dword [eax + edx*4]
mov eax, dword [esp + 0x28]
cmp esi, eax
mov dword [ecx], edx
je 0x40d283
mov edx, dword [esp + 0x78]
cmp eax, dword [edx + 4]
jl 0x40d283
mov esi, dword [esp + 0x44]
mov edx, dword [edi + 0x404]
xor eax, eax
mov al, byte [ebp]
shl esi, 2
mov eax, dword [edx + eax*4]
sub ecx, esi
mov dword [ecx], eax
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x54]
inc eax
cmp eax, ecx
mov dword [esp + 0x48], eax
jl 0x40d2ba
mov ebp, dword [esp + 0x10]
mov ecx, dword [esp + 0x4c]
mov ebx, dword [esp + 0x68]
mov eax, dword [esp + 0x60]
add ebp, ecx
add ebx, eax
mov dword [esp + 0x48], 0
mov dword [esp + 0x10], ebp
mov dword [esp + 0x68], ebx
jmp 0x40d2bc
inc ebp
inc ebx
mov eax, dword [esp + 0x6c]
dec eax
mov dword [esp + 0x6c], eax
jne 0x40d1e1
fstp st(0)
mov eax, dword [esp + 0x70]
fstp st(0)
fld qword [esp + 0x34]
fld st(4)
fxch st(1)
faddp st(4)
dec eax
mov dword [esp + 0x70], eax
faddp st(1)
jne 0x40d1cd
fstp st(0)
fstp st(0)
fstp st(0)
pop edi
pop esi
pop ebp
pop ebx
fstp st(0)
add esp, 0x2c
ret