#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double sin(double);
void airmass(double aa, double *Xp) {
  double sm1;
  if (aa < ((3.0) * 3.141592653589793 / 180.))
    aa = ((3.0) * 3.141592653589793 / 180.);
  sm1 = 1.0 / sin(aa) - 1.0;
  *Xp = 1.0 + sm1 * (0.9981833 - sm1 * (0.002875 + 0.0008083 * sm1));
}


x86 assembly (clang, -O0):
<airmass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  0xed7(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1141 <airmass+0x31>
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  0xe96(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe92(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe5b(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe43(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<airmass>:
push   %rbx
mov    %rdi,%rbx
movsd  0xee4(%rip),%xmm1
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <sin@plt>
movsd  0xed7(%rip),%xmm1
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
addsd  0xecf(%rip),%xmm2
movsd  0xecf(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xecb(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  0xec7(%rip),%xmm3
subsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @airmass(double %0, double* nocapture writeonly %1) {
%3 = fcmp olt double %0, 0x3FAACEE9F37BEBD5
%4 = select i1 %3, double 0x3FAACEE9F37BEBD5, double %0
%5 = tail call double @sin(double %4)
%6 = fdiv double 1.000000e+00, %5
%7 = fadd double %6, -1.000000e+00
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3F4A7C83085D9C93, double 2.875000e-03)
%9 = fneg double %7
%10 = tail call double @llvm.fmuladd.f64(double %9, double %8, double 0x3FEFF11E1A9D3A38)
%11 = tail call double @llvm.fmuladd.f64(double %7, double %10, double 1.000000e+00)
store double %11, double* %1
ret void
}