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

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