#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 calcEccentricityEarthOrbit(double);
int /*<<< orphan*/ calcGeomMeanAnomalySun(double);
int /*<<< orphan*/ calcGeomMeanLongSun(double);
int /*<<< orphan*/ calcObliquityCorrection(double);
double cos(double);
double deg2rad(int /*<<< orphan*/);
double rad2deg(double);
double sin(double);
double tan(double);
double calcEquationOfTime(double t) {
  double l0 = deg2rad(calcGeomMeanLongSun(t));
  double e = calcEccentricityEarthOrbit(t);
  double m = deg2rad(calcGeomMeanAnomalySun(t));
  double y = tan(deg2rad(calcObliquityCorrection(t)) / 2.0);
  double sinm = sin(m);
  y *= y;
  return rad2deg(y * sin(2.0 * l0) - 2.0 * e * sinm +
                 4.0 * e * y * sinm * cos(2.0 * l0) -
                 0.5 * y * y * sin(4.0 * l0) - 1.25 * e * e * sin(2.0 * m)) *
         4.0;
}


x86 assembly (clang, -O0):
<calcEquationOfTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1070 <calcGeomMeanLongSun@plt>
mov    %eax,%edi
call   1040 <deg2rad@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1080 <calcEccentricityEarthOrbit@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <calcGeomMeanAnomalySun@plt>
mov    %eax,%edi
call   1040 <deg2rad@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <calcObliquityCorrection@plt>
mov    %eax,%edi
call   1040 <deg2rad@plt>
movsd  0xe17(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10a0 <tan@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xdd9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1060 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
movsd  0xdbf(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xd81(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd6d(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   10b0 <cos@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd51(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd22(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1060 <sin@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xcef(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xcd0(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1090 <rad2deg@plt>
movsd  0xc85(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcEquationOfTime>:
sub    $0x38,%rsp
movsd  %xmm0,(%rsp)
call   1070 <calcGeomMeanLongSun@plt>
mov    %eax,%edi
call   1040 <deg2rad@plt>
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1080 <calcEccentricityEarthOrbit@plt>
movsd  %xmm0,0x18(%rsp)
movsd  (%rsp),%xmm0
call   1050 <calcGeomMeanAnomalySun@plt>
mov    %eax,%edi
call   1040 <deg2rad@plt>
movsd  %xmm0,0x28(%rsp)
movsd  (%rsp),%xmm0
call   1030 <calcObliquityCorrection@plt>
mov    %eax,%edi
call   1040 <deg2rad@plt>
mulsd  0xe15(%rip),%xmm0
call   10a0 <tan@plt>
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
call   1060 <sin@plt>
movsd  0xdd7(%rip),%xmm4
movsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm4
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm4
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm4,%xmm0
movsd  %xmm0,0x30(%rsp)
mulsd  0xdb0(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   10b0 <cos@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0xd77(%rip),%xmm0
call   1060 <sin@plt>
movsd  0xd72(%rip),%xmm1
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
addsd  %xmm0,%xmm0
call   1060 <sin@plt>
movsd  0xd47(%rip),%xmm1
movsd  0x18(%rsp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
addsd  (%rsp),%xmm0
call   1090 <rad2deg@plt>
mulsd  0xd13(%rip),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @calcEquationOfTime(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
%8 = load double, double* %2
%9 = call i32 @calcGeomMeanLongSun(double %8)
%10 = call double @deg2rad(i32 %9)
store double %10, double* %3
%11 = load double, double* %2
%12 = call double @calcEccentricityEarthOrbit(double %11)
store double %12, double* %4
%13 = load double, double* %2
%14 = call i32 @calcGeomMeanAnomalySun(double %13)
%15 = call double @deg2rad(i32 %14)
store double %15, double* %5
%16 = load double, double* %2
%17 = call i32 @calcObliquityCorrection(double %16)
%18 = call double @deg2rad(i32 %17)
%19 = fdiv double %18, 2.000000e+00
%20 = call double @tan(double %19)
store double %20, double* %6
%21 = load double, double* %5
%22 = call double @sin(double %21)
store double %22, double* %7
%23 = load double, double* %6
%24 = load double, double* %6
%25 = fmul double %24, %23
store double %25, double* %6
%26 = load double, double* %6
%27 = load double, double* %3
%28 = fmul double 2.000000e+00, %27
%29 = call double @sin(double %28)
%30 = load double, double* %4
%31 = fmul double 2.000000e+00, %30
%32 = load double, double* %7
%33 = fmul double %31, %32
%34 = fneg double %33
%35 = call double @llvm.fmuladd.f64(double %26, double %29, double %34)
%36 = load double, double* %4
%37 = fmul double 4.000000e+00, %36
%38 = load double, double* %6
%39 = fmul double %37, %38
%40 = load double, double* %7
%41 = fmul double %39, %40
%42 = load double, double* %3
%43 = fmul double 2.000000e+00, %42
%44 = call double @cos(double %43)
%45 = call double @llvm.fmuladd.f64(double %41, double %44, double %35)
%46 = load double, double* %6
%47 = fmul double 5.000000e-01, %46
%48 = load double, double* %6
%49 = fmul double %47, %48
%50 = load double, double* %3
%51 = fmul double 4.000000e+00, %50
%52 = call double @sin(double %51)
%53 = fneg double %49
%54 = call double @llvm.fmuladd.f64(double %53, double %52, double %45)
%55 = load double, double* %4
%56 = fmul double 1.250000e+00, %55
%57 = load double, double* %4
%58 = fmul double %56, %57
%59 = load double, double* %5
%60 = fmul double 2.000000e+00, %59
%61 = call double @sin(double %60)
%62 = fneg double %58
%63 = call double @llvm.fmuladd.f64(double %62, double %61, double %54)
%64 = call double @rad2deg(double %63)
%65 = fmul double %64, 4.000000e+00
ret double %65
}

LLVM IR (-O2):
define double @calcEquationOfTime(double %0) {
%2 = tail call i32 @calcGeomMeanLongSun(double %0)
%3 = tail call double @deg2rad(i32 %2)
%4 = tail call double @calcEccentricityEarthOrbit(double %0)
%5 = tail call i32 @calcGeomMeanAnomalySun(double %0)
%6 = tail call double @deg2rad(i32 %5)
%7 = tail call i32 @calcObliquityCorrection(double %0)
%8 = tail call double @deg2rad(i32 %7)
%9 = fmul double %8, 5.000000e-01
%10 = tail call double @tan(double %9)
%11 = tail call double @sin(double %6)
%12 = fmul double %10, %10
%13 = fmul double %3, 2.000000e+00
%14 = tail call double @sin(double %13)
%15 = fmul double %4, -2.000000e+00
%16 = fmul double %15, %11
%17 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %16)
%18 = fmul double %4, 4.000000e+00
%19 = fmul double %18, %12
%20 = fmul double %11, %19
%21 = tail call double @cos(double %13)
%22 = tail call double @llvm.fmuladd.f64(double %20, double %21, double %17)
%23 = fmul double %3, 4.000000e+00
%24 = tail call double @sin(double %23)
%25 = fmul double %12, -5.000000e-01
%26 = fmul double %12, %25
%27 = tail call double @llvm.fmuladd.f64(double %26, double %24, double %22)
%28 = fmul double %6, 2.000000e+00
%29 = tail call double @sin(double %28)
%30 = fmul double %4, -1.250000e+00
%31 = fmul double %4, %30
%32 = tail call double @llvm.fmuladd.f64(double %31, double %29, double %27)
%33 = tail call double @rad2deg(double %32)
%34 = fmul double %33, 4.000000e+00
ret double %34
}