double drag_cd_gl(double mach) {
  if (mach > 1.0)
    return 0.286629 + mach * (0.3588930 - mach * 0.0610598);
  else if (mach >= 0.8)
    return 1.59969 + mach * (-3.9465500 + mach * 2.831370);
  else
    return 0.333118 + mach * (-0.498448 + mach * 0.474774);
}


x86 assembly (clang, -O0):
<drag_cd_gl>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1173 <drag_cd_gl+0x73>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xeff(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xefb(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xedb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11fd <drag_cd_gl+0xfd>
movsd  -0x10(%rbp),%xmm0
movsd  0xe88(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11c6 <drag_cd_gl+0xc6>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe94(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe90(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe70(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11fd <drag_cd_gl+0xfd>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe40(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe3c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drag_cd_gl>:
ucomisd 0xef8(%rip),%xmm0
jbe    112f <drag_cd_gl+0x2f>
movsd  0xf2e(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf2a(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf26(%rip),%xmm1
movapd %xmm1,%xmm0
ret
ucomisd 0xed1(%rip),%xmm0
jae    115e <drag_cd_gl+0x5e>
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee3(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xedf(%rip),%xmm1
movapd %xmm1,%xmm0
ret
movsd  0xeaa(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xea6(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xea2(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @drag_cd_gl(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 1.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fneg double %8
%10 = call double @llvm.fmuladd.f64(double %9, double 6.105980e-02, double 3.588930e-01)
%11 = call double @llvm.fmuladd.f64(double %7, double %10, double 2.866290e-01)
store double %11, double* %2
br label %25
12: ; preds = %1
%13 = load double, double* %3
%14 = fcmp oge double %13, 8.000000e-01
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load double, double* %3
%17 = load double, double* %3
%18 = call double @llvm.fmuladd.f64(double %17, double 2.831370e+00, double -3.946550e+00)
%19 = call double @llvm.fmuladd.f64(double %16, double %18, double 1.599690e+00)
store double %19, double* %2
br label %25
20: ; preds = %12
%21 = load double, double* %3
%22 = load double, double* %3
%23 = call double @llvm.fmuladd.f64(double %22, double 4.747740e-01, double -4.984480e-01)
%24 = call double @llvm.fmuladd.f64(double %21, double %23, double 3.331180e-01)
store double %24, double* %2
br label %25
25: ; preds = %20, %15, %6
%26 = load double, double* %2
ret double %26
}

LLVM IR (-O2):
define double @drag_cd_gl(double %0) {
%2 = fcmp ogt double %0, 1.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg double %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double 6.105980e-02, double 3.588930e-01)
%6 = tail call double @llvm.fmuladd.f64(double %0, double %5, double 2.866290e-01)
br label %15
7: ; preds = %1
%8 = fcmp ult double %0, 8.000000e-01
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = tail call double @llvm.fmuladd.f64(double %0, double 2.831370e+00, double -3.946550e+00)
%11 = tail call double @llvm.fmuladd.f64(double %0, double %10, double 1.599690e+00)
br label %15
12: ; preds = %7
%13 = tail call double @llvm.fmuladd.f64(double %0, double 4.747740e-01, double -4.984480e-01)
%14 = tail call double @llvm.fmuladd.f64(double %0, double %13, double 3.331180e-01)
br label %15
15: ; preds = %12, %9, %3
%16 = phi double [ %6, %3 ], [ %11, %9 ], [ %14, %12 ]
ret double %16
}