#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 /*<<< orphan*/ DegToRad(double);
double RadToDeg(int /*<<< orphan*/);
int /*<<< orphan*/ atan(int);
int cos(int /*<<< orphan*/);
int sin(int /*<<< orphan*/);
double calculateDec(double latitude, double SDTime) {
  if (SDTime > 12)
    SDTime -= 12;
  return RadToDeg(atan((cos(DegToRad(latitude)) / sin(DegToRad(latitude))) *
                       cos(DegToRad(SDTime))));
}


x86 assembly (clang, -O0):
<calculateDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe91(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    118f <calculateDec+0x3f>
movsd  -0x10(%rbp),%xmm0
movsd  0xe7a(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <DegToRad@plt>
mov    %eax,%edi
call   1070 <cos@plt>
mov    %eax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <DegToRad@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <DegToRad@plt>
mov    %eax,%edi
call   1070 <cos@plt>
mov    -0x14(%rbp),%edi
imul   %eax,%edi
call   1060 <atan@plt>
mov    %eax,%edi
call   1030 <RadToDeg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateDec>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xe9d(%rip),%xmm3
addsd  %xmm1,%xmm3
movsd  0xe99(%rip),%xmm2
cmpltsd %xmm1,%xmm2
andpd  %xmm2,%xmm3
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
movapd %xmm2,0x10(%rsp)
call   1040 <DegToRad@plt>
mov    %eax,%edi
call   1070 <cos@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1040 <DegToRad@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%ebx
movaps 0x10(%rsp),%xmm0
call   1040 <DegToRad@plt>
mov    %eax,%edi
call   1070 <cos@plt>
imul   %eax,%ebx
mov    %ebx,%edi
call   1060 <atan@plt>
mov    %eax,%edi
add    $0x20,%rsp
pop    %rbx
jmp    1030 <RadToDeg@plt>

LLVM IR (-O0):
define double @calculateDec(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp ogt double %5, 1.200000e+01
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load double, double* %4
%9 = fsub double %8, 1.200000e+01
store double %9, double* %4
br label %10
10: ; preds = %7, %2
%11 = load double, double* %3
%12 = call i32 @DegToRad(double %11)
%13 = call i32 @cos(i32 %12)
%14 = load double, double* %3
%15 = call i32 @DegToRad(double %14)
%16 = call i32 @sin(i32 %15)
%17 = sdiv i32 %13, %16
%18 = load double, double* %4
%19 = call i32 @DegToRad(double %18)
%20 = call i32 @cos(i32 %19)
%21 = mul nsw i32 %17, %20
%22 = call i32 @atan(i32 %21)
%23 = call double @RadToDeg(i32 %22)
ret double %23
}

LLVM IR (-O2):
define double @calculateDec(double %0, double %1) {
%3 = fcmp ogt double %1, 1.200000e+01
%4 = fadd double %1, -1.200000e+01
%5 = select i1 %3, double %4, double %1
%6 = tail call i32 @DegToRad(double %0)
%7 = tail call i32 @cos(i32 %6)
%8 = tail call i32 @DegToRad(double %0)
%9 = tail call i32 @sin(i32 %8)
%10 = sdiv i32 %7, %9
%11 = tail call i32 @DegToRad(double %5)
%12 = tail call i32 @cos(i32 %11)
%13 = mul nsw i32 %12, %10
%14 = tail call i32 @atan(i32 %13)
%15 = tail call double @RadToDeg(i32 %14)
ret double %15
}