float fThottleCorrection(float t, float a, float b) {
  float cosa = 1.0 - (a * a * 0.4);
  float cosb = 1.0 - (b * b * 0.4);
  cosa *= cosb;
  if (cosa < 0.6)
    cosa = 0.6;
  t -= 1000;
  t /= cosa;
  t += 1000;
  if (t > 1950)
    t = 1950;
  return t;
}


x86 assembly (clang, -O0):
<fThottleCorrection>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xec8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe82(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe41(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11d6 <fThottleCorrection+0xd6>
movss  0xe47(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xe3d(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xe19(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xdfe(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1234 <fThottleCorrection+0x134>
movss  0xded(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fThottleCorrection>:
unpcklps %xmm2,%xmm1
mulps  %xmm1,%xmm1
cvtps2pd %xmm1,%xmm1
mulpd  0xeef(%rip),%xmm1
addpd  0xef7(%rip),%xmm1
cvtpd2ps %xmm1,%xmm2
movapd %xmm2,%xmm1
shufps $0x55,%xmm2,%xmm1
mulss  %xmm2,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm1,%xmm2
movsd  0xee8(%rip),%xmm3
ucomisd %xmm2,%xmm3
jbe    1146 <fThottleCorrection+0x46>
movss  0xee2(%rip),%xmm1
addss  0xede(%rip),%xmm0
divss  %xmm1,%xmm0
addss  0xed6(%rip),%xmm0
movss  0xed2(%rip),%xmm1
minss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fThottleCorrection(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %5
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = fpext float %11 to double
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double %13, double 4.000000e-01, double 1.000000e+00)
%15 = fptrunc double %14 to float
store float %15, float* %7
%16 = load float, float* %6
%17 = load float, float* %6
%18 = fmul float %16, %17
%19 = fpext float %18 to double
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %20, double 4.000000e-01, double 1.000000e+00)
%22 = fptrunc double %21 to float
store float %22, float* %8
%23 = load float, float* %8
%24 = load float, float* %7
%25 = fmul float %24, %23
store float %25, float* %7
%26 = load float, float* %7
%27 = fpext float %26 to double
%28 = fcmp olt double %27, 6.000000e-01
br i1 %28, label %29, label %30
29: ; preds = %3
store float 0x3FE3333340000000, float* %7
br label %30
30: ; preds = %29, %3
%31 = load float, float* %4
%32 = fsub float %31, 1.000000e+03
store float %32, float* %4
%33 = load float, float* %7
%34 = load float, float* %4
%35 = fdiv float %34, %33
store float %35, float* %4
%36 = load float, float* %4
%37 = fadd float %36, 1.000000e+03
store float %37, float* %4
%38 = load float, float* %4
%39 = fcmp ogt float %38, 1.950000e+03
br i1 %39, label %40, label %41
40: ; preds = %30
store float 1.950000e+03, float* %4
br label %41
41: ; preds = %40, %30
%42 = load float, float* %4
ret float %42
}

LLVM IR (-O2):
define float @fThottleCorrection(float %0, float %1, float %2) {
%4 = insertelement <2 x float> poison, float %1, i64 0
%5 = insertelement <2 x float> %4, float %2, i64 1
%6 = fmul <2 x float> %5, %5
%7 = fpext <2 x float> %6 to <2 x double>
%8 = fneg <2 x double> %7
%9 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %8, <2 x double> <double 4.000000e-01, double 4.000000e-01>, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
%10 = fptrunc <2 x double> %9 to <2 x float>
%11 = shufflevector <2 x float> %10, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%12 = fmul <2 x float> %11, %10
%13 = extractelement <2 x float> %12, i64 0
%14 = fpext float %13 to double
%15 = fcmp olt double %14, 6.000000e-01
%16 = select i1 %15, float 0x3FE3333340000000, float %13
%17 = fadd float %0, -1.000000e+03
%18 = fdiv float %17, %16
%19 = fadd float %18, 1.000000e+03
%20 = fcmp ogt float %19, 1.950000e+03
%21 = select i1 %20, float 1.950000e+03, float %19
ret float %21
}