#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 calcEquationOfTime(double);
double calcHourAngleSunset(double, double);
double calcJDFromJulianCent(double);
double calcSunDeclination(double);
double calcTimeJulianCent(double);
double radToDeg(double);
double calcSunsetUTC(double JD, double latitude, double longitude) {
  double t = calcTimeJulianCent(JD);
  double eqTime = calcEquationOfTime(t);
  double solarDec = calcSunDeclination(t);
  double hourAngle = calcHourAngleSunset(latitude, solarDec);
  double delta = longitude - radToDeg(hourAngle);
  double timeDiff = 4 * delta;
  double timeUTC = 720 + timeDiff - eqTime;
  double newt = calcTimeJulianCent(calcJDFromJulianCent(t) + timeUTC / 1440.0);
  eqTime = calcEquationOfTime(newt);
  solarDec = calcSunDeclination(newt);
  hourAngle = calcHourAngleSunset(latitude, solarDec);
  delta = longitude - radToDeg(hourAngle);
  timeDiff = 4 * delta;
  timeUTC = 720 + timeDiff - eqTime;
  return timeUTC;
}


x86 assembly (clang, -O0):
<calcSunsetUTC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1080 <calcTimeJulianCent@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <calcEquationOfTime@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <calcSunDeclination@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1060 <calcHourAngleSunset@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1070 <radToDeg@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe23(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe09(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <calcJDFromJulianCent@plt>
movsd  -0x50(%rbp),%xmm1
movsd  0xdf3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
call   1080 <calcTimeJulianCent@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1040 <calcEquationOfTime@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1050 <calcSunDeclination@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1060 <calcHourAngleSunset@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1070 <radToDeg@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xd7a(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd60(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcSunsetUTC>:
sub    $0x28,%rsp
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
call   1080 <calcTimeJulianCent@plt>
movsd  %xmm0,0x10(%rsp)
call   1040 <calcEquationOfTime@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <calcSunDeclination@plt>
movaps %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
call   1060 <calcHourAngleSunset@plt>
call   1070 <radToDeg@plt>
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe4a(%rip),%xmm1
addsd  0xe4a(%rip),%xmm1
subsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <calcJDFromJulianCent@plt>
movsd  0x8(%rsp),%xmm1
divsd  0xe2d(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1080 <calcTimeJulianCent@plt>
movsd  %xmm0,0x8(%rsp)
call   1040 <calcEquationOfTime@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <calcSunDeclination@plt>
movaps %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
call   1060 <calcHourAngleSunset@plt>
call   1070 <radToDeg@plt>
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xdd3(%rip),%xmm1
addsd  0xdd3(%rip),%xmm1
subsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @calcSunsetUTC(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%15 = load double, double* %4
%16 = call double @calcTimeJulianCent(double %15)
store double %16, double* %7
%17 = load double, double* %7
%18 = call double @calcEquationOfTime(double %17)
store double %18, double* %8
%19 = load double, double* %7
%20 = call double @calcSunDeclination(double %19)
store double %20, double* %9
%21 = load double, double* %5
%22 = load double, double* %9
%23 = call double @calcHourAngleSunset(double %21, double %22)
store double %23, double* %10
%24 = load double, double* %6
%25 = load double, double* %10
%26 = call double @radToDeg(double %25)
%27 = fsub double %24, %26
store double %27, double* %11
%28 = load double, double* %11
%29 = fmul double 4.000000e+00, %28
store double %29, double* %12
%30 = load double, double* %12
%31 = fadd double 7.200000e+02, %30
%32 = load double, double* %8
%33 = fsub double %31, %32
store double %33, double* %13
%34 = load double, double* %7
%35 = call double @calcJDFromJulianCent(double %34)
%36 = load double, double* %13
%37 = fdiv double %36, 1.440000e+03
%38 = fadd double %35, %37
%39 = call double @calcTimeJulianCent(double %38)
store double %39, double* %14
%40 = load double, double* %14
%41 = call double @calcEquationOfTime(double %40)
store double %41, double* %8
%42 = load double, double* %14
%43 = call double @calcSunDeclination(double %42)
store double %43, double* %9
%44 = load double, double* %5
%45 = load double, double* %9
%46 = call double @calcHourAngleSunset(double %44, double %45)
store double %46, double* %10
%47 = load double, double* %6
%48 = load double, double* %10
%49 = call double @radToDeg(double %48)
%50 = fsub double %47, %49
store double %50, double* %11
%51 = load double, double* %11
%52 = fmul double 4.000000e+00, %51
store double %52, double* %12
%53 = load double, double* %12
%54 = fadd double 7.200000e+02, %53
%55 = load double, double* %8
%56 = fsub double %54, %55
store double %56, double* %13
%57 = load double, double* %13
ret double %57
}

LLVM IR (-O2):
define double @calcSunsetUTC(double %0, double %1, double %2) {
%4 = tail call double @calcTimeJulianCent(double %0)
%5 = tail call double @calcEquationOfTime(double %4)
%6 = tail call double @calcSunDeclination(double %4)
%7 = tail call double @calcHourAngleSunset(double %1, double %6)
%8 = tail call double @radToDeg(double %7)
%9 = fsub double %2, %8
%10 = fmul double %9, 4.000000e+00
%11 = fadd double %10, 7.200000e+02
%12 = fsub double %11, %5
%13 = tail call double @calcJDFromJulianCent(double %4)
%14 = fdiv double %12, 1.440000e+03
%15 = fadd double %13, %14
%16 = tail call double @calcTimeJulianCent(double %15)
%17 = tail call double @calcEquationOfTime(double %16)
%18 = tail call double @calcSunDeclination(double %16)
%19 = tail call double @calcHourAngleSunset(double %1, double %18)
%20 = tail call double @radToDeg(double %19)
%21 = fsub double %2, %20
%22 = fmul double %21, 4.000000e+00
%23 = fadd double %22, 7.200000e+02
%24 = fsub double %23, %17
ret double %24
}