#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 declination(int day) {
  double delta = 0, angle = 0;
  angle = dayangle(day);
  delta = 0.006918 - 0.399912 * cos(angle) + 0.070257 * sin(angle) -
          0.006758 * cos(2 * angle) + 0.000907 * sin(2 * angle) -
          0.002697 * cos(3 * angle) + 0.00148 * sin(3 * angle);
  delta *= 180.0 / 3.1415926;
  return delta;
}


x86 assembly (clang, -O0):
<declination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
cvttsd2si -0x18(%rbp),%edi
call   1030 <sin@plt>
movsd  -0x40(%rbp),%xmm1
movsd  0xea2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe7d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
movsd  -0x38(%rbp),%xmm1
movsd  0xe6a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe4d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0x30(%rbp),%xmm1
movsd  0xe2a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe05(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
movsd  -0x28(%rbp),%xmm1
movsd  0xdf2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xdd5(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xdb2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xd95(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<declination>:
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,(%rsp)
mov    %ebx,%edi
call   1030 <sin@plt>
mulsd  0xe71(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe61(%rip),%xmm0
cvttsd2si %xmm0,%ebx
mov    %ebx,%edi
call   1050 <cos@plt>
mulsd  0xe56(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1030 <sin@plt>
mulsd  0xe44(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0xe3e(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @declination(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.999120e-01, double %9, double 0x3F7C560C7C0F4517)
%11 = load double, double* %4
%12 = fptosi double %11 to i32
%13 = call double @sin(i32 %12)
%14 = call double @llvm.fmuladd.f64(double 7.025700e-02, 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 -6.758000e-03, 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 9.070000e-04, double %23, double %19)
%25 = load double, double* %4
%26 = fmul double 3.000000e+00, %25
%27 = fptosi double %26 to i32
%28 = call double @cos(i32 %27)
%29 = call double @llvm.fmuladd.f64(double -2.697000e-03, double %28, double %24)
%30 = load double, double* %4
%31 = fmul double 3.000000e+00, %30
%32 = fptosi double %31 to i32
%33 = call double @sin(i32 %32)
%34 = call double @llvm.fmuladd.f64(double 1.480000e-03, double %33, double %29)
store double %34, double* %3
%35 = load double, double* %3
%36 = fmul double %35, 0x404CA5DC22969FAA
store double %36, double* %3
%37 = load double, double* %3
ret double %37
}

LLVM IR (-O2):
define double @declination(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.999120e-01, double 0x3F7C560C7C0F4517)
%6 = tail call double @sin(i32 %3)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 7.025700e-02, 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 -6.758000e-03, double %7)
%12 = tail call double @sin(i32 %9)
%13 = tail call double @llvm.fmuladd.f64(double %12, double 9.070000e-04, double %11)
%14 = fmul double %2, 3.000000e+00
%15 = fptosi double %14 to i32
%16 = tail call double @cos(i32 %15)
%17 = tail call double @llvm.fmuladd.f64(double %16, double -2.697000e-03, double %13)
%18 = tail call double @sin(i32 %15)
%19 = tail call double @llvm.fmuladd.f64(double %18, double 1.480000e-03, double %17)
%20 = fmul double %19, 0x404CA5DC22969FAA
ret double %20
}