#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 */
int atan(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sunDeclination(double *, int);
int main(int argc, char **argv) {
  double delta;
  int day;
  printf("SunDeclination,\tDay\n");
  for (day = 0; day < 365; day++) {
    sunDeclination(&delta, day);
    delta = (delta * 180) / (4 * atan(1));
    printf("%f\t%d\n", delta, day);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x16d,-0x1c(%rbp)
jge    11c9 <main+0x99>
mov    -0x1c(%rbp),%esi
lea    -0x18(%rbp),%rdi
call   1030 <sunDeclination@plt>
movsd  0xe84(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x1,%edi
call   1050 <atan@plt>
movsd  -0x28(%rbp),%xmm0
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%esi
lea    0xe69(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115b <main+0x2b>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
mov    %rsp,%r14
lea    0xea7(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <sunDeclination@plt>
movsd  (%rsp),%xmm0
mulsd  0xe79(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%edi
call   1060 <atan@plt>
shl    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movapd %xmm1,%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x16d,%ebx
jne    1170 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"SunDeclination,\09Day\0A\00"
@.str.1 = [7 x i8] c"%f\09%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %9
9: ; preds = %24, %2
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 365
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i32, i32* %7
%14 = call i32 @sunDeclination(double* %6, i32 %13)
%15 = load double, double* %6
%16 = fmul double %15, 1.800000e+02
%17 = call i32 @atan(i32 1)
%18 = mul nsw i32 4, %17
%19 = sitofp i32 %18 to double
%20 = fdiv double %16, %19
store double %20, double* %6
%21 = load double, double* %6
%22 = load i32, i32* %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %21, i32 %22)
br label %24
24: ; preds = %12
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %9
27: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%f\09%d\0A\00"
@str = [20 x i8] c"SunDeclination,\09Day\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %2, %6
%7 = phi i32 [ 0, %2 ], [ %16, %6 ]
%8 = call i32 @sunDeclination(double* %3, i32 %7)
%9 = load double, double* %3
%10 = fmul double %9, 1.800000e+02
%11 = call i32 @atan(i32 1)
%12 = shl nsw i32 %11, 2
%13 = sitofp i32 %12 to double
%14 = fdiv double %10, %13
store double %14, double* %3
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %14, i32 %7)
%16 = add nuw nsw i32 %7, 1
%17 = icmp eq i32 %16, 365
br i1 %17, label %18, label %6
18: ; preds = %6
ret i32 0
}