#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 asin(double);
double cos(double);
double radians(double);
double sin(double);
double elevation_from_hour_angle(double latitude, double declination,
                                 double hour_angle) {
  double rc = cos(radians(latitude));
  rc *= cos(hour_angle) * cos(declination);
  rc += sin(radians(latitude)) * sin(declination);
  return asin(rc);
}


x86 assembly (clang, -O0):
<elevation_from_hour_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <radians@plt>
call   1060 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <radians@plt>
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <asin@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elevation_from_hour_angle>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1050 <radians@plt>
call   1060 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0x8(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <radians@plt>
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
jmp    1040 <asin@plt>

LLVM IR (-O0):
define double @elevation_from_hour_angle(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = call double @radians(double %8)
%10 = call double @cos(double %9)
store double %10, double* %7
%11 = load double, double* %6
%12 = call double @cos(double %11)
%13 = load double, double* %5
%14 = call double @cos(double %13)
%15 = fmul double %12, %14
%16 = load double, double* %7
%17 = fmul double %16, %15
store double %17, double* %7
%18 = load double, double* %4
%19 = call double @radians(double %18)
%20 = call double @sin(double %19)
%21 = load double, double* %5
%22 = call double @sin(double %21)
%23 = load double, double* %7
%24 = call double @llvm.fmuladd.f64(double %20, double %22, double %23)
store double %24, double* %7
%25 = load double, double* %7
%26 = call double @asin(double %25)
ret double %26
}

LLVM IR (-O2):
define double @elevation_from_hour_angle(double %0, double %1, double %2) {
%4 = tail call double @radians(double %0)
%5 = tail call double @cos(double %4)
%6 = tail call double @cos(double %2)
%7 = tail call double @cos(double %1)
%8 = fmul double %6, %7
%9 = fmul double %5, %8
%10 = tail call double @radians(double %0)
%11 = tail call double @sin(double %10)
%12 = tail call double @sin(double %1)
%13 = tail call double @llvm.fmuladd.f64(double %11, double %12, double %9)
%14 = tail call double @asin(double %13)
ret double %14
}