#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(int);
int cos(double);
int sin(double);
void solarAltitude(double *solarAlt, double sunDeclination, double latitude,
                   double localHourAngle) {
  *solarAlt = asin(sin(sunDeclination) * sin(latitude) +
                   cos(sunDeclination) * cos(latitude) * cos(localHourAngle));
}


x86 assembly (clang, -O0):
<solarAltitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <cos@plt>
mov    %eax,-0x2c(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x24(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <cos@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
imul   %ecx,%eax
add    %eax,%edi
call   1040 <asin@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solarAltitude>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %rdi,%r14
call   1030 <sin@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
imul   %eax,%ebp
movsd  0x10(%rsp),%xmm0
call   1050 <cos@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
imul   %eax,%ebx
movsd  0x18(%rsp),%xmm0
call   1050 <cos@plt>
imul   %eax,%ebx
add    %ebp,%ebx
mov    %ebx,%edi
call   1040 <asin@plt>
movsd  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @solarAltitude(double* %0, double %1, double %2, double %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double* %0, double** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = call i32 @sin(double %9)
%11 = load double, double* %7
%12 = call i32 @sin(double %11)
%13 = mul nsw i32 %10, %12
%14 = load double, double* %6
%15 = call i32 @cos(double %14)
%16 = load double, double* %7
%17 = call i32 @cos(double %16)
%18 = mul nsw i32 %15, %17
%19 = load double, double* %8
%20 = call i32 @cos(double %19)
%21 = mul nsw i32 %18, %20
%22 = add nsw i32 %13, %21
%23 = call double @asin(i32 %22)
%24 = load double*, double** %5
store double %23, double* %24
ret void
}

LLVM IR (-O2):
define void @solarAltitude(double* nocapture writeonly %0, double %1, double %2, double %3) {
%5 = tail call i32 @sin(double %1)
%6 = tail call i32 @sin(double %2)
%7 = mul nsw i32 %6, %5
%8 = tail call i32 @cos(double %1)
%9 = tail call i32 @cos(double %2)
%10 = mul nsw i32 %9, %8
%11 = tail call i32 @cos(double %3)
%12 = mul nsw i32 %10, %11
%13 = add nsw i32 %12, %7
%14 = tail call double @asin(i32 %13)
store double %14, double* %0
ret void
}