#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 */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int GST(int /*<<< orphan*/);
int /*<<< orphan*/ ecliptic_to_equatorial(double, double, double *, double *);
double sun_ecliptic_longitude(int /*<<< orphan*/);
void GetSunPos(time_t ssue, double *lat, double *lon) {
  double lambda;
  double alpha, delta;
  double tmp;
  lambda = sun_ecliptic_longitude(ssue);
  ecliptic_to_equatorial(lambda, 0.0, &alpha, &delta);
  tmp = alpha - ((2 * 3.141592653) / 24) * GST(ssue);
  if (tmp < -3.141592653) {
    do
      tmp += (2 * 3.141592653);
    while (tmp < -3.141592653);
  } else if (tmp > 3.141592653) {
    do
      tmp -= (2 * 3.141592653);
    while (tmp < -3.141592653);
  }
  *lon = tmp;
  *lat = delta;
}


x86 assembly (clang, -O0):
<GetSunPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sun_ecliptic_longitude@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <ecliptic_to_equatorial@plt>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <GST@plt>
movsd  -0x40(%rbp),%xmm1
cvtsi2sd %eax,%xmm0
movsd  0xe80(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe63(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    11d7 <GetSunPos+0xa7>
jmp    11ad <GetSunPos+0x7d>
movsd  0xe63(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe39(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
ja     11ad <GetSunPos+0x7d>
jmp    1226 <GetSunPos+0xf6>
movsd  -0x38(%rbp),%xmm0
movsd  0xe2c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1221 <GetSunPos+0xf1>
jmp    11f3 <GetSunPos+0xc3>
movsd  -0x38(%rbp),%xmm0
movsd  0xe18(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xdef(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
ja     11f3 <GetSunPos+0xc3>
jmp    1221 <GetSunPos+0xf1>
jmp    1226 <GetSunPos+0xf6>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSunPos>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1040 <sun_ecliptic_longitude@plt>
lea    0x18(%rsp),%rdi
lea    0x10(%rsp),%rsi
xorps  %xmm1,%xmm1
call   1030 <ecliptic_to_equatorial@plt>
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
call   1050 <GST@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe87(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  0xe81(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11ac <GetSunPos+0x7c>
movsd  0xe8b(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nop
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
ja     11a0 <GetSunPos+0x70>
jmp    11ca <GetSunPos+0x9a>
ucomisd 0xe5c(%rip),%xmm0
jbe    11ca <GetSunPos+0x9a>
movsd  0xe5a(%rip),%xmm2
xchg   %ax,%ax
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
ja     11c0 <GetSunPos+0x90>
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @GetSunPos(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%11 = load i32, i32* %4
%12 = call double @sun_ecliptic_longitude(i32 %11)
store double %12, double* %7
%13 = load double, double* %7
%14 = call i32 @ecliptic_to_equatorial(double %13, double 0.000000e+00, double* %8, double* %9)
%15 = load double, double* %8
%16 = load i32, i32* %4
%17 = call i32 @GST(i32 %16)
%18 = sitofp i32 %17 to double
%19 = call double @llvm.fmuladd.f64(double 0xBFD0C152381FF0D0, double %18, double %15)
store double %19, double* %10
%20 = load double, double* %10
%21 = fcmp olt double %20, 0xC00921FB542FE938
br i1 %21, label %22, label %30
22: ; preds = %3
br label %23
23: ; preds = %26, %22
%24 = load double, double* %10
%25 = fadd double %24, 0x401921FB542FE938
store double %25, double* %10
br label %26
26: ; preds = %23
%27 = load double, double* %10
%28 = fcmp olt double %27, 0xC00921FB542FE938
br i1 %28, label %23, label %29
29: ; preds = %26
br label %42
30: ; preds = %3
%31 = load double, double* %10
%32 = fcmp ogt double %31, 0x400921FB542FE938
br i1 %32, label %33, label %41
33: ; preds = %30
br label %34
34: ; preds = %37, %33
%35 = load double, double* %10
%36 = fsub double %35, 0x401921FB542FE938
store double %36, double* %10
br label %37
37: ; preds = %34
%38 = load double, double* %10
%39 = fcmp olt double %38, 0xC00921FB542FE938
br i1 %39, label %34, label %40
40: ; preds = %37
br label %41
41: ; preds = %40, %30
br label %42
42: ; preds = %41, %29
%43 = load double, double* %10
%44 = load double*, double** %6
store double %43, double* %44
%45 = load double, double* %9
%46 = load double*, double** %5
store double %45, double* %46
ret void
}

LLVM IR (-O2):
define void @GetSunPos(i32 %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %4 to i8*
%7 = bitcast double* %5 to i8*
%8 = tail call double @sun_ecliptic_longitude(i32 %0)
%9 = call i32 @ecliptic_to_equatorial(double %8, double 0.000000e+00, double* %4, double* %5)
%10 = load double, double* %4
%11 = call i32 @GST(i32 %0)
%12 = sitofp i32 %11 to double
%13 = call double @llvm.fmuladd.f64(double %12, double 0xBFD0C152381FF0D0, double %10)
%14 = fcmp olt double %13, 0xC00921FB542FE938
br i1 %14, label %15, label %19
15: ; preds = %3, %15
%16 = phi double [ %17, %15 ], [ %13, %3 ]
%17 = fadd double %16, 0x401921FB542FE938
%18 = fcmp olt double %17, 0xC00921FB542FE938
br i1 %18, label %15, label %25
19: ; preds = %3
%20 = fcmp ogt double %13, 0x400921FB542FE938
br i1 %20, label %21, label %25
21: ; preds = %19, %21
%22 = phi double [ %23, %21 ], [ %13, %19 ]
%23 = fadd double %22, 0xC01921FB542FE938
%24 = fcmp olt double %23, 0xC00921FB542FE938
br i1 %24, label %21, label %25
25: ; preds = %21, %15, %19
%26 = phi double [ %13, %19 ], [ %17, %15 ], [ %23, %21 ]
store double %26, double* %2
%27 = load double, double* %5
store double %27, double* %1
ret void
}