#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 elevation_from_hour_angle(double, int /*<<< orphan*/, double);
double equation_of_time(double);
double julian_centuries_to_julian_day(double);
double radians(double);
double round(double);
int /*<<< orphan*/ solar_declination(double);
double solar_elevation_from_time(double tm, double latitude, double longitude) {
  double rc = julian_centuries_to_julian_day(tm);
  rc = (rc - round(rc) - 0.5) * 1440;
  rc = 720.0 - rc - equation_of_time(tm);
  rc = radians(rc / 4.0 - longitude);
  return elevation_from_hour_angle(latitude, solar_declination(tm), rc);
}


x86 assembly (clang, -O0):
<solar_elevation_from_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <julian_centuries_to_julian_day@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <round@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe56(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe3d(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1080 <equation_of_time@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe03(%rip),%xmm1
divsd  %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <radians@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <solar_declination@plt>
movsd  -0x28(%rbp),%xmm0
mov    %eax,%edi
movsd  -0x20(%rbp),%xmm1
call   1070 <elevation_from_hour_angle@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solar_elevation_from_time>:
sub    $0x28,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1040 <julian_centuries_to_julian_day@plt>
movsd  %xmm0,0x8(%rsp)
call   1050 <round@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
addsd  0xe68(%rip),%xmm1
mulsd  0xe68(%rip),%xmm1
addsd  0xe68(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1080 <equation_of_time@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe4d(%rip),%xmm1
subsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm0
call   1030 <radians@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <solar_declination@plt>
movsd  0x20(%rsp),%xmm0
mov    %eax,%edi
movsd  0x8(%rsp),%xmm1
add    $0x28,%rsp
jmp    1070 <elevation_from_hour_angle@plt>

LLVM IR (-O0):
define double @solar_elevation_from_time(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 @julian_centuries_to_julian_day(double %8)
store double %9, double* %7
%10 = load double, double* %7
%11 = load double, double* %7
%12 = call double @llvm.round.f64(double %11)
%13 = fsub double %10, %12
%14 = fsub double %13, 5.000000e-01
%15 = fmul double %14, 1.440000e+03
store double %15, double* %7
%16 = load double, double* %7
%17 = fsub double 7.200000e+02, %16
%18 = load double, double* %4
%19 = call double @equation_of_time(double %18)
%20 = fsub double %17, %19
store double %20, double* %7
%21 = load double, double* %7
%22 = fdiv double %21, 4.000000e+00
%23 = load double, double* %6
%24 = fsub double %22, %23
%25 = call double @radians(double %24)
store double %25, double* %7
%26 = load double, double* %5
%27 = load double, double* %4
%28 = call i32 @solar_declination(double %27)
%29 = load double, double* %7
%30 = call double @elevation_from_hour_angle(double %26, i32 %28, double %29)
ret double %30
}

LLVM IR (-O2):
define double @solar_elevation_from_time(double %0, double %1, double %2) {
%4 = tail call double @julian_centuries_to_julian_day(double %0)
%5 = tail call double @llvm.round.f64(double %4)
%6 = fsub double %4, %5
%7 = fadd double %6, -5.000000e-01
%8 = fmul double %7, 1.440000e+03
%9 = fsub double 7.200000e+02, %8
%10 = tail call double @equation_of_time(double %0)
%11 = fsub double %9, %10
%12 = fmul double %11, 2.500000e-01
%13 = fsub double %12, %2
%14 = tail call double @radians(double %13)
%15 = tail call i32 @solar_declination(double %0)
%16 = tail call double @elevation_from_hour_angle(double %1, i32 %15, double %14)
ret double %16
}