#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 */
int LAT(int, int, double, double);
double acos(int);
int cos(double);
double declination(int);
double hour_angle(int);
int sin(double);
double solar_zenith(int time, int day, double latitude, double longitude,
                    double long_std) {
  double theta = 0, omega = 0, delta = 0, phi = latitude * 3.1415926 / 180.0;
  int lat = LAT(time, day, longitude, long_std);
  delta = 3.1415926 / 180.0 * declination(day);
  omega = 3.1415926 / 180.0 * hour_angle(lat);
  theta = acos(sin(delta) * sin(phi) + cos(delta) * cos(phi) * cos(omega));
  theta *= (180.0 / 3.1415926);
  return theta;
}


x86 assembly (clang, -O0):
<solar_zenith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe7b(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe66(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1040 <LAT@plt>
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <declination@plt>
movaps %xmm0,%xmm1
movsd  0xe2a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x44(%rbp),%edi
call   1070 <hour_angle@plt>
movaps %xmm0,%xmm1
movsd  0xe0e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
mov    %eax,-0x54(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1050 <sin@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4c(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1060 <cos@plt>
mov    -0x4c(%rbp),%edi
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
imul   %ecx,%eax
add    %eax,%edi
call   1030 <acos@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xd90(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solar_zenith>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ebx
mulsd  0xe8e(%rip),%xmm0
divsd  0xe8e(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1040 <LAT@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1080 <declination@plt>
mulsd  0xe73(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
call   1070 <hour_angle@plt>
mulsd  0xe5e(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
mov    %eax,%ebx
movsd  0x10(%rsp),%xmm0
call   1050 <sin@plt>
imul   %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ebp
movsd  0x10(%rsp),%xmm0
call   1060 <cos@plt>
mov    %eax,%r14d
movsd  0x18(%rsp),%xmm0
call   1060 <cos@plt>
imul   %eax,%ebp
imul   %r14d,%ebp
add    %ebx,%ebp
mov    %ebp,%edi
call   1030 <acos@plt>
mulsd  0xe07(%rip),%xmm0
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @solar_zenith(i32 %0, i32 %1, double %2, double %3, double %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
%16 = load double, double* %8
%17 = fmul double %16, 0x400921FB4D12D84A
%18 = fdiv double %17, 1.800000e+02
store double %18, double* %14
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = load double, double* %9
%22 = load double, double* %10
%23 = call i32 @LAT(i32 %19, i32 %20, double %21, double %22)
store i32 %23, i32* %15
%24 = load i32, i32* %7
%25 = call double @declination(i32 %24)
%26 = fmul double 0x3F91DF469D353918, %25
store double %26, double* %13
%27 = load i32, i32* %15
%28 = call double @hour_angle(i32 %27)
%29 = fmul double 0x3F91DF469D353918, %28
store double %29, double* %12
%30 = load double, double* %13
%31 = call i32 @sin(double %30)
%32 = load double, double* %14
%33 = call i32 @sin(double %32)
%34 = mul nsw i32 %31, %33
%35 = load double, double* %13
%36 = call i32 @cos(double %35)
%37 = load double, double* %14
%38 = call i32 @cos(double %37)
%39 = mul nsw i32 %36, %38
%40 = load double, double* %12
%41 = call i32 @cos(double %40)
%42 = mul nsw i32 %39, %41
%43 = add nsw i32 %34, %42
%44 = call double @acos(i32 %43)
store double %44, double* %11
%45 = load double, double* %11
%46 = fmul double %45, 0x404CA5DC22969FAA
store double %46, double* %11
%47 = load double, double* %11
ret double %47
}

LLVM IR (-O2):
define double @solar_zenith(i32 %0, i32 %1, double %2, double %3, double %4) {
%6 = fmul double %2, 0x400921FB4D12D84A
%7 = fdiv double %6, 1.800000e+02
%8 = tail call i32 @LAT(i32 %0, i32 %1, double %3, double %4)
%9 = tail call double @declination(i32 %1)
%10 = fmul double %9, 0x3F91DF469D353918
%11 = tail call double @hour_angle(i32 %8)
%12 = fmul double %11, 0x3F91DF469D353918
%13 = tail call i32 @sin(double %10)
%14 = tail call i32 @sin(double %7)
%15 = mul nsw i32 %14, %13
%16 = tail call i32 @cos(double %10)
%17 = tail call i32 @cos(double %7)
%18 = mul nsw i32 %17, %16
%19 = tail call i32 @cos(double %12)
%20 = mul nsw i32 %18, %19
%21 = add nsw i32 %20, %15
%22 = tail call double @acos(i32 %21)
%23 = fmul double %22, 0x404CA5DC22969FAA
ret double %23
}