#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 asin(double);
double sin(double);
double tan(double);
void sun_coords(double jd, double *ra, double *dec) {
  double n, L, g, epsilon, lambda, t;
  n = jd - 2451545.0;
  L = 280.460 + 0.9856474 * n;
  g = 357.528 + 0.9856003 * n;
  while (L < 0)
    L += 360.0;
  while (L > 360.0)
    L -= 360.0;
  while (g < 0)
    g += 360.0;
  while (g > 360.0)
    g -= 360.0;
  lambda = L + 1.915 * sin(g / 57.29577951) + 0.020 * sin(2 * g / 57.29577951);
  epsilon = 23.439 - 0.0000004 * n;
  t = tan(epsilon / (2.0 * 57.29577951));
  t *= t;
  *ra = lambda - 57.29577951 * t * sin(2.0 * lambda / 57.29577951) +
        57.29577951 * sin(4.0 * lambda / 57.29577951) * t * t / 2.0;
  *dec = 57.29577951 *
         asin(sin(epsilon / 57.29577951) * sin(lambda / 57.29577951));
  return;
}


x86 assembly (clang, -O0):
<sun_coords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecb(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe73(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    11c7 <sun_coords+0x97>
movsd  0xe70(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11a2 <sun_coords+0x72>
jmp    11cc <sun_coords+0x9c>
movsd  -0x28(%rbp),%xmm0
movsd  0xe4f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11fe <sun_coords+0xce>
movsd  -0x28(%rbp),%xmm0
movsd  0xe38(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11cc <sun_coords+0x9c>
jmp    1203 <sun_coords+0xd3>
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1228 <sun_coords+0xf8>
movsd  0xe0f(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1203 <sun_coords+0xd3>
jmp    122d <sun_coords+0xfd>
movsd  -0x30(%rbp),%xmm0
movsd  0xdee(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    125f <sun_coords+0x12f>
movsd  -0x30(%rbp),%xmm0
movsd  0xdd7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    122d <sun_coords+0xfd>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xdba(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  -0x78(%rbp),%xmm1
movsd  0xddc(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xd97(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  0xd82(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  -0x70(%rbp),%xmm1
movsd  0xd9c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xd72(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd6e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xd48(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <tan@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xd01(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xcf7(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0xce2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xcb0(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0xc93(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
movsd  0xc7a(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  0xc6c(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
movsd  0xc47(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xc2c(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <asin@plt>
movaps %xmm0,%xmm1
movsd  0xc07(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sun_coords>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
addsd  0xebb(%rip),%xmm0
movsd  0xebb(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xeb7(%rip),%xmm3
movsd  0xeb7(%rip),%xmm2
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm3,%xmm0
jbe    118a <sun_coords+0x5a>
movsd  0xeab(%rip),%xmm1
nopl   (%rax)
addsd  %xmm1,%xmm3
ucomisd %xmm3,%xmm0
ja     1180 <sun_coords+0x50>
addsd  0xe8e(%rip),%xmm2
ucomisd 0xe8e(%rip),%xmm3
jbe    11ba <sun_coords+0x8a>
movsd  0xe8c(%rip),%xmm0
movsd  0xe7c(%rip),%xmm1
nopl   0x0(%rax)
addsd  %xmm0,%xmm3
ucomisd %xmm1,%xmm3
ja     11b0 <sun_coords+0x80>
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
jbe    11da <sun_coords+0xaa>
movsd  0xe5c(%rip),%xmm1
nopl   0x0(%rax)
addsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm0
ja     11d0 <sun_coords+0xa0>
ucomisd 0xe46(%rip),%xmm2
movsd  %xmm3,0x8(%rsp)
jbe    120a <sun_coords+0xda>
movsd  0xe3e(%rip),%xmm0
movsd  0xe2e(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
addsd  %xmm0,%xmm2
ucomisd %xmm1,%xmm2
ja     1200 <sun_coords+0xd0>
movsd  %xmm2,0x18(%rsp)
movapd %xmm2,%xmm0
divsd  0xe1c(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0xe17(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
addsd  %xmm0,%xmm0
divsd  0xdf1(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0xdf4(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xde2(%rip),%xmm0
addsd  0xde2(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
divsd  0xddc(%rip),%xmm0
call   1050 <tan@plt>
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
divsd  0xd93(%rip),%xmm0
call   1030 <sin@plt>
movsd  0xdb6(%rip),%xmm2
mulsd  0x18(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm2
movsd  %xmm2,0x20(%rsp)
movsd  0xd9c(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  0xd58(%rip),%xmm0
call   1030 <sin@plt>
movsd  0xd4b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x18(%rsp),%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
mulsd  0xd71(%rip),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  0xd04(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
call   1040 <asin@plt>
mulsd  0xcec(%rip),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sun_coords(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%13 = load double, double* %4
%14 = fsub double %13, 0x4142B42C80000000
store double %14, double* %7
%15 = load double, double* %7
%16 = call double @llvm.fmuladd.f64(double 0x3FEF8A6C6A8C65D4, double %15, double 2.804600e+02)
store double %16, double* %8
%17 = load double, double* %7
%18 = call double @llvm.fmuladd.f64(double 0x3FEF8A09A3EDB072, double %17, double 3.575280e+02)
store double %18, double* %9
br label %19
19: ; preds = %22, %3
%20 = load double, double* %8
%21 = fcmp olt double %20, 0.000000e+00
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load double, double* %8
%24 = fadd double %23, 3.600000e+02
store double %24, double* %8
br label %19
25: ; preds = %19
br label %26
26: ; preds = %29, %25
%27 = load double, double* %8
%28 = fcmp ogt double %27, 3.600000e+02
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load double, double* %8
%31 = fsub double %30, 3.600000e+02
store double %31, double* %8
br label %26
32: ; preds = %26
br label %33
33: ; preds = %36, %32
%34 = load double, double* %9
%35 = fcmp olt double %34, 0.000000e+00
br i1 %35, label %36, label %39
36: ; preds = %33
%37 = load double, double* %9
%38 = fadd double %37, 3.600000e+02
store double %38, double* %9
br label %33
39: ; preds = %33
br label %40
40: ; preds = %43, %39
%41 = load double, double* %9
%42 = fcmp ogt double %41, 3.600000e+02
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load double, double* %9
%45 = fsub double %44, 3.600000e+02
store double %45, double* %9
br label %40
46: ; preds = %40
%47 = load double, double* %8
%48 = load double, double* %9
%49 = fdiv double %48, 0x404CA5DC1A5D2372
%50 = call double @sin(double %49)
%51 = call double @llvm.fmuladd.f64(double 1.915000e+00, double %50, double %47)
%52 = load double, double* %9
%53 = fmul double 2.000000e+00, %52
%54 = fdiv double %53, 0x404CA5DC1A5D2372
%55 = call double @sin(double %54)
%56 = call double @llvm.fmuladd.f64(double 2.000000e-02, double %55, double %51)
store double %56, double* %11
%57 = load double, double* %7
%58 = call double @llvm.fmuladd.f64(double -4.000000e-07, double %57, double 2.343900e+01)
store double %58, double* %10
%59 = load double, double* %10
%60 = fdiv double %59, 0x405CA5DC1A5D2372
%61 = call double @tan(double %60)
store double %61, double* %12
%62 = load double, double* %12
%63 = load double, double* %12
%64 = fmul double %63, %62
store double %64, double* %12
%65 = load double, double* %11
%66 = load double, double* %12
%67 = fmul double 0x404CA5DC1A5D2372, %66
%68 = load double, double* %11
%69 = fmul double 2.000000e+00, %68
%70 = fdiv double %69, 0x404CA5DC1A5D2372
%71 = call double @sin(double %70)
%72 = fneg double %67
%73 = call double @llvm.fmuladd.f64(double %72, double %71, double %65)
%74 = load double, double* %11
%75 = fmul double 4.000000e+00, %74
%76 = fdiv double %75, 0x404CA5DC1A5D2372
%77 = call double @sin(double %76)
%78 = fmul double 0x404CA5DC1A5D2372, %77
%79 = load double, double* %12
%80 = fmul double %78, %79
%81 = load double, double* %12
%82 = fmul double %80, %81
%83 = fdiv double %82, 2.000000e+00
%84 = fadd double %73, %83
%85 = load double*, double** %5
store double %84, double* %85
%86 = load double, double* %10
%87 = fdiv double %86, 0x404CA5DC1A5D2372
%88 = call double @sin(double %87)
%89 = load double, double* %11
%90 = fdiv double %89, 0x404CA5DC1A5D2372
%91 = call double @sin(double %90)
%92 = fmul double %88, %91
%93 = call double @asin(double %92)
%94 = fmul double 0x404CA5DC1A5D2372, %93
%95 = load double*, double** %6
store double %94, double* %95
ret void
}

LLVM IR (-O2):
define void @sun_coords(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = fadd double %0, 0xC142B42C80000000
%5 = tail call double @llvm.fmuladd.f64(double %4, double 0x3FEF8A6C6A8C65D4, double 2.804600e+02)
%6 = tail call double @llvm.fmuladd.f64(double %4, double 0x3FEF8A09A3EDB072, double 3.575280e+02)
%7 = fcmp olt double %5, 0.000000e+00
br i1 %7, label %11, label %8
8: ; preds = %11, %3
%9 = phi double [ %5, %3 ], [ %13, %11 ]
%10 = fcmp ogt double %9, 3.600000e+02
br i1 %10, label %18, label %15
11: ; preds = %3, %11
%12 = phi double [ %13, %11 ], [ %5, %3 ]
%13 = fadd double %12, 3.600000e+02
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %11, label %8
15: ; preds = %18, %8
%16 = phi double [ %9, %8 ], [ %20, %18 ]
%17 = fcmp olt double %6, 0.000000e+00
br i1 %17, label %25, label %22
18: ; preds = %8, %18
%19 = phi double [ %20, %18 ], [ %9, %8 ]
%20 = fadd double %19, -3.600000e+02
%21 = fcmp ogt double %20, 3.600000e+02
br i1 %21, label %18, label %15
22: ; preds = %25, %15
%23 = phi double [ %6, %15 ], [ %27, %25 ]
%24 = fcmp ogt double %23, 3.600000e+02
br i1 %24, label %29, label %33
25: ; preds = %15, %25
%26 = phi double [ %27, %25 ], [ %6, %15 ]
%27 = fadd double %26, 3.600000e+02
%28 = fcmp olt double %27, 0.000000e+00
br i1 %28, label %25, label %22
29: ; preds = %22, %29
%30 = phi double [ %31, %29 ], [ %23, %22 ]
%31 = fadd double %30, -3.600000e+02
%32 = fcmp ogt double %31, 3.600000e+02
br i1 %32, label %29, label %33
33: ; preds = %29, %22
%34 = phi double [ %23, %22 ], [ %31, %29 ]
%35 = fdiv double %34, 0x404CA5DC1A5D2372
%36 = tail call double @sin(double %35)
%37 = tail call double @llvm.fmuladd.f64(double %36, double 1.915000e+00, double %16)
%38 = fmul double %34, 2.000000e+00
%39 = fdiv double %38, 0x404CA5DC1A5D2372
%40 = tail call double @sin(double %39)
%41 = tail call double @llvm.fmuladd.f64(double %40, double 2.000000e-02, double %37)
%42 = tail call double @llvm.fmuladd.f64(double %4, double -4.000000e-07, double 2.343900e+01)
%43 = fdiv double %42, 0x405CA5DC1A5D2372
%44 = tail call double @tan(double %43)
%45 = fmul double %44, %44
%46 = fmul double %41, 2.000000e+00
%47 = fdiv double %46, 0x404CA5DC1A5D2372
%48 = tail call double @sin(double %47)
%49 = fmul double %45, 0xC04CA5DC1A5D2372
%50 = tail call double @llvm.fmuladd.f64(double %49, double %48, double %41)
%51 = fmul double %41, 4.000000e+00
%52 = fdiv double %51, 0x404CA5DC1A5D2372
%53 = tail call double @sin(double %52)
%54 = fmul double %53, 0x404CA5DC1A5D2372
%55 = fmul double %45, %54
%56 = fmul double %45, %55
%57 = fmul double %56, 5.000000e-01
%58 = fadd double %50, %57
store double %58, double* %1
%59 = fdiv double %42, 0x404CA5DC1A5D2372
%60 = tail call double @sin(double %59)
%61 = fdiv double %41, 0x404CA5DC1A5D2372
%62 = tail call double @sin(double %61)
%63 = fmul double %60, %62
%64 = tail call double @asin(double %63)
%65 = fmul double %64, 0x404CA5DC1A5D2372
store double %65, double* %2
ret void
}