double airmass(double aa) {
  double sm1;
  if (aa < (3.0))
    aa = (3.0);
  aa = ((aa)*3.141592653589793 / 180.);
  sm1 = 1.0 / sin(aa) - 1.0;
  return 1.0 + sm1 * (0.9981833 - sm1 * (0.002875 + 0.0008083 * sm1));
}


x86 assembly (clang, -O0):
<airmass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <airmass+0x2d>
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xe98(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xe7c(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe78(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe41(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe29(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<airmass>:
push   %rax
movsd  0xee7(%rip),%xmm1
maxsd  %xmm0,%xmm1
mulsd  0xee3(%rip),%xmm1
divsd  0xee3(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <sin@plt>
movsd  0xeda(%rip),%xmm1
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
addsd  0xed2(%rip),%xmm2
movsd  0xed2(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  0xece(%rip),%xmm3
mulsd  %xmm2,%xmm3
movsd  0xeca(%rip),%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @airmass(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 3.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 3.000000e+00, double* %2
br label %7
7: ; preds = %6, %1
%8 = load double, double* %2
%9 = fmul double %8, 0x400921FB54442D18
%10 = fdiv double %9, 1.800000e+02
store double %10, double* %2
%11 = load double, double* %2
%12 = call double @sin(double %11)
%13 = fdiv double 1.000000e+00, %12
%14 = fsub double %13, 1.000000e+00
store double %14, double* %3
%15 = load double, double* %3
%16 = load double, double* %3
%17 = load double, double* %3
%18 = call double @llvm.fmuladd.f64(double 0x3F4A7C83085D9C93, double %17, double 2.875000e-03)
%19 = fneg double %16
%20 = call double @llvm.fmuladd.f64(double %19, double %18, double 0x3FEFF11E1A9D3A38)
%21 = call double @llvm.fmuladd.f64(double %15, double %20, double 1.000000e+00)
ret double %21
}

LLVM IR (-O2):
define double @airmass(double %0) {
%2 = fcmp olt double %0, 3.000000e+00
%3 = select i1 %2, double 3.000000e+00, double %0
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 1.800000e+02
%6 = tail call double @sin(double %5)
%7 = fdiv double 1.000000e+00, %6
%8 = fadd double %7, -1.000000e+00
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3F4A7C83085D9C93, double 2.875000e-03)
%10 = fneg double %8
%11 = tail call double @llvm.fmuladd.f64(double %10, double %9, double 0x3FEFF11E1A9D3A38)
%12 = tail call double @llvm.fmuladd.f64(double %8, double %11, double 1.000000e+00)
ret double %12
}