#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);
void localHourAngle(double *tau, double Ts, double deltaT1, double deltaT2,
                    int timeStep) {
  if (Ts < 43200.0) {
    *tau = ((Ts / 3600) + 12 - deltaT1 + deltaT2) * 15 * (4 * atan(1) / 180);
  } else {
    *tau = ((Ts / 3600) - 12 - deltaT1 + deltaT2) * 15 * (4 * atan(1) / 180);
  }
  return;
}


x86 assembly (clang, -O0):
<localHourAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
movsd  0xeca(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11a8 <localHourAngle+0x98>
movsd  -0x10(%rbp),%xmm0
movsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    $0x1,%edi
call   1030 <atan@plt>
movsd  -0x30(%rbp),%xmm0
shl    $0x2,%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    120a <localHourAngle+0xfa>
movsd  -0x10(%rbp),%xmm0
movsd  0xe63(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe4f(%rip),%xmm1
subsd  %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xe31(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x1,%edi
call   1030 <atan@plt>
movsd  -0x38(%rbp),%xmm0
shl    $0x2,%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localHourAngle>:
push   %rbx
sub    $0x10,%rsp
movsd  0xee3(%rip),%xmm3
xor    %eax,%eax
ucomisd %xmm0,%xmm3
seta   %al
divsd  0xeda(%rip),%xmm0
mov    %rdi,%rbx
lea    0xee0(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
subsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
mulsd  0xec3(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%edi
call   1030 <atan@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @localHourAngle(double* %0, double %1, double %2, double %3, i32 %4) {
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
store double* %0, double** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i32 %4, i32* %10
%11 = load double, double* %7
%12 = fcmp olt double %11, 4.320000e+04
br i1 %12, label %13, label %28
13: ; preds = %5
%14 = load double, double* %7
%15 = fdiv double %14, 3.600000e+03
%16 = fadd double %15, 1.200000e+01
%17 = load double, double* %8
%18 = fsub double %16, %17
%19 = load double, double* %9
%20 = fadd double %18, %19
%21 = fmul double %20, 1.500000e+01
%22 = call i32 @atan(i32 1)
%23 = mul nsw i32 4, %22
%24 = sdiv i32 %23, 180
%25 = sitofp i32 %24 to double
%26 = fmul double %21, %25
%27 = load double*, double** %6
store double %26, double* %27
br label %43
28: ; preds = %5
%29 = load double, double* %7
%30 = fdiv double %29, 3.600000e+03
%31 = fsub double %30, 1.200000e+01
%32 = load double, double* %8
%33 = fsub double %31, %32
%34 = load double, double* %9
%35 = fadd double %33, %34
%36 = fmul double %35, 1.500000e+01
%37 = call i32 @atan(i32 1)
%38 = mul nsw i32 4, %37
%39 = sdiv i32 %38, 180
%40 = sitofp i32 %39 to double
%41 = fmul double %36, %40
%42 = load double*, double** %6
store double %41, double* %42
br label %43
43: ; preds = %28, %13
ret void
}

LLVM IR (-O2):
define void @localHourAngle(double* nocapture writeonly %0, double %1, double %2, double %3, i32 %4) {
%6 = fcmp olt double %1, 4.320000e+04
%7 = fdiv double %1, 3.600000e+03
%8 = select i1 %6, double 1.200000e+01, double -1.200000e+01
%9 = fadd double %7, %8
%10 = fsub double %9, %2
%11 = fadd double %10, %3
%12 = fmul double %11, 1.500000e+01
%13 = tail call i32 @atan(i32 1)
%14 = sdiv i32 %13, 45
%15 = sitofp i32 %14 to double
%16 = fmul double %12, %15
store double %16, double* %0
ret void
}