#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 sin(int);
double su_solar_distance_factor2(double jday) {
  double t;
  t = (2. * 3.14159265358979323846264338327 * jday) / 365.;
  return 1.000110 + 0.034221 * cos(t) + 0.001280 * sin(t) +
         0.000719 * cos(2. * t) + 0.000077 * sin(2. * t);
}


x86 assembly (clang, -O0):
<su_solar_distance_factor2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xf03(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeee(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%edi
call   1040 <cos@plt>
movsd  0xec3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebf(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cvttsd2si -0x10(%rbp),%edi
call   1030 <sin@plt>
movsd  -0x28(%rbp),%xmm1
movsd  0xe8f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe6a(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xe57(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe3a(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe17(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<su_solar_distance_factor2>:
push   %rbx
sub    $0x10,%rsp
mulsd  0xed3(%rip),%xmm0
divsd  0xed3(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%ebx
mov    %ebx,%edi
call   1040 <cos@plt>
mulsd  0xec2(%rip),%xmm0
addsd  0xec2(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
call   1030 <sin@plt>
mulsd  0xeb6(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%ebx
mov    %ebx,%edi
call   1040 <cos@plt>
mulsd  0xe97(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1030 <sin@plt>
mulsd  0xe85(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @su_solar_distance_factor2(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 0x401921FB54442D18, %4
%6 = fdiv double %5, 3.650000e+02
store double %6, double* %3
%7 = load double, double* %3
%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* %3
%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* %3
%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* %3
%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)
ret double %24
}

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