#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 cos(int);
double dayangle(int);
double sin(int);
double eccentricity(int day) {
  double E0 = 0, angle = 0;
  angle = dayangle(day);
  E0 = 1.000110 + 0.034221 * cos(angle) + 0.001280 * sin(angle) +
       0.000719 * cos(2 * angle) + 0.000077 * sin(2 * angle);
  return E0;
}


x86 assembly (clang, -O0):
<eccentricity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <dayangle@plt>
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%edi
call   1050 <cos@plt>
movsd  0xeb6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvttsd2si -0x18(%rbp),%edi
call   1030 <sin@plt>
movsd  -0x30(%rbp),%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe5d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
movsd  -0x28(%rbp),%xmm1
movsd  0xe4a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe2d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xe0a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eccentricity>:
push   %rbx
sub    $0x10,%rsp
call   1040 <dayangle@plt>
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%ebx
mov    %ebx,%edi
call   1050 <cos@plt>
mulsd  0xead(%rip),%xmm0
addsd  0xead(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
call   1030 <sin@plt>
mulsd  0xea1(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%ebx
mov    %ebx,%edi
call   1050 <cos@plt>
mulsd  0xe82(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1030 <sin@plt>
mulsd  0xe70(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @eccentricity(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
%5 = load i32, i32* %2
%6 = call double @dayangle(i32 %5)
store double %6, double* %4
%7 = load double, double* %4
%8 = fptosi double %7 to i32
%9 = call double @cos(i32 %8)
%10 = call double @llvm.fmuladd.f64(double 3.422100e-02, double %9, double 1.000110e+00)
%11 = load double, double* %4
%12 = fptosi double %11 to i32
%13 = call double @sin(i32 %12)
%14 = call double @llvm.fmuladd.f64(double 1.280000e-03, double %13, double %10)
%15 = load double, double* %4
%16 = fmul double 2.000000e+00, %15
%17 = fptosi double %16 to i32
%18 = call double @cos(i32 %17)
%19 = call double @llvm.fmuladd.f64(double 7.190000e-04, double %18, double %14)
%20 = load double, double* %4
%21 = fmul double 2.000000e+00, %20
%22 = fptosi double %21 to i32
%23 = call double @sin(i32 %22)
%24 = call double @llvm.fmuladd.f64(double 7.700000e-05, double %23, double %19)
store double %24, double* %3
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @eccentricity(i32 %0) {
%2 = tail call double @dayangle(i32 %0)
%3 = fptosi double %2 to i32
%4 = tail call double @cos(i32 %3)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 3.422100e-02, double 1.000110e+00)
%6 = tail call double @sin(i32 %3)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.280000e-03, double %5)
%8 = fmul double %2, 2.000000e+00
%9 = fptosi double %8 to i32
%10 = tail call double @cos(i32 %9)
%11 = tail call double @llvm.fmuladd.f64(double %10, double 7.190000e-04, double %7)
%12 = tail call double @sin(i32 %9)
%13 = tail call double @llvm.fmuladd.f64(double %12, double 7.700000e-05, double %11)
ret double %13
}