#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 calculate_sunrise(int, int, int, float, float, float);
double calculate_sunset(int, int, int, float, float, float);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, ...);
int /*<<< orphan*/ stdout;
double within(int, int);
void test() {
  int year = 2016;
  int month = 11;
  int day = 28;
  float lat = 45.502177;
  float lng = -73.567085;
  float utc_offset = -5.0;
  fprintf(stdout, "within for 5 and 21 yields %f \n", within(5, 21));
  fprintf(stdout, "within for -5 and 21 yields %f \n", within(-5, 21));
  fprintf(stdout, "within for 26 and 21 yields %f \n", within(26, 21));
  fprintf(stdout, "calculate_sunrise for %d %d %d %f %f %f yields %f \n", year,
          month, day, lat, lng, utc_offset,
          calculate_sunrise(year, month, day, lat, lng, utc_offset));
  fprintf(stdout, "calculate_sunset for %d %d %d %f %f %f yields %f \n", year,
          month, day, lat, lng, utc_offset,
          calculate_sunset(year, month, day, lat, lng, utc_offset));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x7e0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
movl   $0x1c,-0xc(%rbp)
movss  0xea0(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe8f(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe7e(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    0x2e52(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    $0x5,%edi
mov    $0x15,%esi
call   1030 <within@plt>
mov    -0x74(%rbp),%edi
cvttsd2si %xmm0,%edx
lea    0xe5c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e22(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    $0xfffffffb,%edi
mov    $0x15,%esi
call   1030 <within@plt>
mov    -0x70(%rbp),%edi
cvttsd2si %xmm0,%edx
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2df2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    $0x1a,%edi
mov    $0x15,%esi
call   1030 <within@plt>
mov    -0x6c(%rbp),%edi
cvttsd2si %xmm0,%edx
lea    0xe3d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2dc2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1060 <calculate_sunrise@plt>
mov    -0x68(%rbp),%edi
mov    -0x64(%rbp),%edx
mov    -0x60(%rbp),%ecx
mov    -0x5c(%rbp),%r8d
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
lea    0xdcc(%rip),%rsi
mov    $0x4,%al
call   1050 <fprintf@plt>
mov    0x2d30(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1040 <calculate_sunset@plt>
mov    -0x40(%rbp),%edi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%r8d
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x20(%rbp),%xmm0
lea    0xd6e(%rip),%rsi
mov    $0x4,%al
call   1050 <fprintf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
push   %rax
mov    0x2e95(%rip),%r14
mov    (%r14),%ebx
mov    $0x5,%edi
mov    $0x15,%esi
call   1030 <within@plt>
cvttsd2si %xmm0,%edx
lea    0xec0(%rip),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%ebx
mov    $0xfffffffb,%edi
mov    $0x15,%esi
call   1030 <within@plt>
cvttsd2si %xmm0,%edx
lea    0xeba(%rip),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%ebx
mov    $0x1a,%edi
mov    $0x15,%esi
call   1030 <within@plt>
cvttsd2si %xmm0,%edx
lea    0xeb5(%rip),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%ebx
movss  0xe38(%rip),%xmm0
movss  0xe34(%rip),%xmm1
movss  0xe30(%rip),%xmm2
mov    $0x7e0,%edi
mov    $0xb,%esi
mov    $0x1c,%edx
call   1060 <calculate_sunrise@plt>
movaps %xmm0,%xmm3
lea    0xe94(%rip),%rsi
movsd  0xe12(%rip),%xmm0
movsd  0xe12(%rip),%xmm1
movsd  0xe12(%rip),%xmm2
mov    %ebx,%edi
mov    $0x7e0,%edx
mov    $0xb,%ecx
mov    $0x1c,%r8d
mov    $0x4,%al
call   1050 <fprintf@plt>
mov    (%r14),%ebx
mov    $0x7e0,%edi
mov    $0xb,%esi
mov    $0x1c,%edx
movss  0xdbf(%rip),%xmm0
movss  0xdbb(%rip),%xmm1
movss  0xdb7(%rip),%xmm2
call   1040 <calculate_sunset@plt>
movaps %xmm0,%xmm3
lea    0xe5e(%rip),%rsi
mov    %ebx,%edi
mov    $0x7e0,%edx
mov    $0xb,%ecx
mov    $0x1c,%r8d
movsd  0xd96(%rip),%xmm0
movsd  0xd96(%rip),%xmm1
movsd  0xd96(%rip),%xmm2
mov    $0x4,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [32 x i8] c"within for 5 and 21 yields %f \0A\00"
@.str.1 = [33 x i8] c"within for -5 and 21 yields %f \0A\00"
@.str.2 = [33 x i8] c"within for 26 and 21 yields %f \0A\00"
@.str.3 = [52 x i8] c"calculate_sunrise for %d %d %d %f %f %f yields %f \0A\00"
@.str.4 = [51 x i8] c"calculate_sunset for %d %d %d %f %f %f yields %f \0A\00"
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 2016, i32* %1
store i32 11, i32* %2
store i32 28, i32* %3
store float 0x4046C04760000000, float* %4
store float 0xC052644B20000000, float* %5
store float -5.000000e+00, float* %6
%7 = load i32, i32* @stdout
%8 = call double @within(i32 5, i32 21)
%9 = fptosi double %8 to i32
%10 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stdout
%12 = call double @within(i32 -5, i32 21)
%13 = fptosi double %12 to i32
%14 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* @stdout
%16 = call double @within(i32 26, i32 21)
%17 = fptosi double %16 to i32
%18 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = load i32, i32* @stdout
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = load float, float* %4
%24 = fpext float %23 to double
%25 = load float, float* %5
%26 = fpext float %25 to double
%27 = load float, float* %6
%28 = fpext float %27 to double
%29 = load i32, i32* %1
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = load float, float* %4
%33 = load float, float* %5
%34 = load float, float* %6
%35 = call double @calculate_sunrise(i32 %29, i32 %30, i32 %31, float %32, float %33, float %34)
%36 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 %20, i32 %21, i32 %22, double %24, double %26, double %28, double %35)
%37 = load i32, i32* @stdout
%38 = load i32, i32* %1
%39 = load i32, i32* %2
%40 = load i32, i32* %3
%41 = load float, float* %4
%42 = fpext float %41 to double
%43 = load float, float* %5
%44 = fpext float %43 to double
%45 = load float, float* %6
%46 = fpext float %45 to double
%47 = load i32, i32* %1
%48 = load i32, i32* %2
%49 = load i32, i32* %3
%50 = load float, float* %4
%51 = load float, float* %5
%52 = load float, float* %6
%53 = call double @calculate_sunset(i32 %47, i32 %48, i32 %49, float %50, float %51, float %52)
%54 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0), i32 %38, i32 %39, i32 %40, double %42, double %44, double %46, double %53)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [32 x i8] c"within for 5 and 21 yields %f \0A\00"
@.str.1 = [33 x i8] c"within for -5 and 21 yields %f \0A\00"
@.str.2 = [33 x i8] c"within for 26 and 21 yields %f \0A\00"
@.str.3 = [52 x i8] c"calculate_sunrise for %d %d %d %f %f %f yields %f \0A\00"
@.str.4 = [51 x i8] c"calculate_sunset for %d %d %d %f %f %f yields %f \0A\00"
define void @test() {
%1 = load i32, i32* @stdout
%2 = tail call double @within(i32 5, i32 21)
%3 = fptosi double %2 to i32
%4 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call double @within(i32 -5, i32 21)
%7 = fptosi double %6 to i32
%8 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stdout
%10 = tail call double @within(i32 26, i32 21)
%11 = fptosi double %10 to i32
%12 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @stdout
%14 = tail call double @calculate_sunrise(i32 2016, i32 11, i32 28, float 0x4046C04760000000, float 0xC052644B20000000, float -5.000000e+00)
%15 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 2016, i32 11, i32 28, double 0x4046C04760000000, double 0xC052644B20000000, double -5.000000e+00, double %14)
%16 = load i32, i32* @stdout
%17 = tail call double @calculate_sunset(i32 2016, i32 11, i32 28, float 0x4046C04760000000, float 0xC052644B20000000, float -5.000000e+00)
%18 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0), i32 2016, i32 11, i32 28, double 0x4046C04760000000, double 0xC052644B20000000, double -5.000000e+00, double %17)
ret void
}