void moon_colong(double jd, double lt, double lg, double *cp, double *kp,
                 double *ap, double *sp) {
  double RAD = .0174533;
  double T;
  double T2;
  double L, M, R, LAM0;
  double F, L1, OM, LAM, B, DR, LAMH, BH;
  double L0, B0;
  double TEMP;
  double C0;
  double PSI;
  double NUM, DEN;
  double I, K;
  double THETA, ETA;
  double H;
  T = (jd - 2451545) / 36525.0;
  T2 = T * T;
  Sun(RAD, T, T2, &L, &M, &R, &LAM0);
  Moon(RAD, T, T2, LAM0, R, M, &F, &L1, &OM, &LAM, &B, &DR, &LAMH, &BH);
  Librations(RAD, LAMH, BH, OM, F, L, L1, &L0, &B0);
  if (sp)
    *sp = B0;
  TEMP = L0 / 360;
  L0 = ((TEMP) - (int)(TEMP)) * 360;
  if (L0 < 0)
    L0 = L0 + 360;
  if (L0 <= 90)
    C0 = 90 - L0;
  else
    C0 = 450 - L0;
  if (cp) {
    *cp = ((C0)*3.141592653589793 / 180.);
    range(cp, 2 * 3.141592653589793);
  }
  if (kp) {
    TEMP = cos(B * RAD) * cos(LAM - LAM0 * RAD);
    PSI = acos(TEMP);
    NUM = R * sin(PSI);
    DEN = DR - R * TEMP;
    I = atan(NUM / DEN);
    if (NUM * DEN < 0)
      I = I + 3.14159;
    if (NUM < 0)
      I = I + 3.14159;
    K = (1 + cos(I)) / 2;
    *kp = K;
  }
  if (ap) {
    THETA = lt;
    ETA = lg;
    C0 = C0 * RAD;
    TEMP = sin(B0) * sin(THETA) + cos(B0) * cos(THETA) * sin(C0 + ETA);
    H = asin(TEMP);
    *ap = H;
  }
}


x86 assembly (clang, -O0):
<moon_colong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
movsd  0xe4e(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe34(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe20(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
lea    -0x58(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x68(%rbp),%rdx
lea    -0x70(%rbp),%rcx
mov    $0x3,%al
call   10b0 <Sun@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm4
movsd  -0x60(%rbp),%xmm5
lea    -0x78(%rbp),%rdi
lea    -0x80(%rbp),%rsi
lea    -0x88(%rbp),%rdx
lea    -0x90(%rbp),%rcx
lea    -0x98(%rbp),%r8
lea    -0xa0(%rbp),%r9
lea    -0xa8(%rbp),%r10
lea    -0xb0(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x6,%al
call   1030 <Moon@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0x88(%rbp),%xmm3
ff
movsd  -0x78(%rbp),%xmm4
movsd  -0x58(%rbp),%xmm5
movsd  -0x80(%rbp),%xmm6
lea    -0xb8(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
mov    $0x7,%al
call   1050 <Librations@plt>
cmpq   $0x0,-0x38(%rbp)
je     12da <moon_colong+0x14a>
movsd  -0xc0(%rbp),%xmm0
ff
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xb8(%rbp),%xmm0
ff
movsd  0xd2e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
cvttsd2si -0xc8(%rbp),%eax
ff
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  0xd02(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    134b <moon_colong+0x1bb>
movsd  0xcdd(%rip),%xmm0
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xccd(%rip),%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jb     137e <moon_colong+0x1ee>
movsd  0xcb7(%rip),%xmm0
subsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    1396 <moon_colong+0x206>
movsd  0xca2(%rip),%xmm0
subsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
cmpq   $0x0,-0x20(%rbp)
je     13d8 <moon_colong+0x248>
movsd  0xc97(%rip),%xmm0
mulsd  -0xd0(%rbp),%xmm0
ff
movsd  0xc7f(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rdi
movsd  0xc5f(%rip),%xmm0
mov    $0x1,%al
call   1090 <range@plt>
cmpq   $0x0,-0x28(%rbp)
je     1587 <moon_colong+0x3f7>
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x40(%rbp),%xmm0
call   10a0 <cos@plt>
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   10a0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x120(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
call   1040 <acos@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x118(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0x68(%rbp),%xmm0
movsd  -0xc8(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
divsd  -0xe8(%rbp),%xmm0
ff
call   1070 <atan@plt>
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xe0(%rbp),%xmm1
ff
mulsd  -0xe8(%rbp),%xmm1
ff
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    151e <moon_colong+0x38e>
movsd  0xb3a(%rip),%xmm0
addsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0xe0(%rbp),%xmm0
ff
jbe    1547 <moon_colong+0x3b7>
movsd  0xb11(%rip),%xmm0
addsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
call   10a0 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xaf9(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xae5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,-0x30(%rbp)
je     168d <moon_colong+0x4fd>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
call   1060 <sin@plt>
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
call   1060 <sin@plt>
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
call   10a0 <cos@plt>
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
call   10a0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x140(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
addsd  -0x108(%rbp),%xmm0
ff
call   1060 <sin@plt>
movsd  -0x138(%rbp),%xmm1
ff
movsd  -0x130(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x128(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
call   1080 <asin@plt>
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moon_colong>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc8,%rsp
addsd  0xe5a(%rip),%xmm0
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
movsd  %xmm2,0x70(%rsp)
movsd  %xmm1,0x28(%rsp)
divsd  0xe42(%rip),%xmm0
movapd %xmm0,%xmm2
movapd %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0xe2a(%rip),%xmm0
lea    0xc0(%rsp),%rdi
lea    0xb8(%rsp),%rsi
lea    0x38(%rsp),%rdx
lea    0x60(%rsp),%rcx
mov    $0x3,%al
call   10b0 <Sun@plt>
movsd  0x60(%rsp),%xmm3
movsd  0x38(%rsp),%xmm4
movsd  0xb8(%rsp),%xmm5
lea    0x78(%rsp),%r10
lea    0x80(%rsp),%r11
lea    0xb0(%rsp),%rdi
lea    0xa8(%rsp),%rsi
lea    0xa0(%rsp),%rdx
lea    0x98(%rsp),%rcx
lea    0x90(%rsp),%r8
lea    0x88(%rsp),%r9
movsd  0xdaf(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x6,%al
push   %r10
push   %r11
call   1030 <Moon@plt>
add    $0x10,%rsp
movsd  0x80(%rsp),%xmm1
movsd  0x78(%rsp),%xmm2
movsd  0xa0(%rsp),%xmm3
movsd  0xb0(%rsp),%xmm4
movsd  0xc0(%rsp),%xmm5
movsd  0xa8(%rsp),%xmm6
lea    0x58(%rsp),%rdi
lea    0x30(%rsp),%rsi
movsd  0xd4f(%rip),%xmm0
mov    $0x7,%al
call   1050 <Librations@plt>
test   %rbx,%rbx
je     12d7 <moon_colong+0x147>
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x58(%rsp),%xmm0
movsd  0xd33(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttpd2dq %xmm0,%xmm2
cvtdq2pd %xmm2,%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
movsd  0xd02(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm3,%xmm0
setb   %al
movlpd %xmm3,0x58(%rsp)
lea    0xd24(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm1
subsd  %xmm3,%xmm1
test   %r12,%r12
movsd  %xmm1,0x8(%rsp)
je     137a <moon_colong+0x1ea>
movsd  0xcd8(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  0xcd4(%rip),%xmm0
movsd  %xmm0,(%r12)
movsd  0xcce(%rip),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1090 <range@plt>
movsd  0x8(%rsp),%xmm1
test   %r15,%r15
je     148b <moon_colong+0x2fb>
movsd  0x90(%rsp),%xmm0
movsd  0xc7c(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   10a0 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x98(%rsp),%xmm0
movsd  0xc5c(%rip),%xmm1
mulsd  0x60(%rsp),%xmm1
subsd  %xmm1,%xmm0
call   10a0 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1040 <acos@plt>
movsd  0x38(%rsp),%xmm1
movsd  %xmm1,0x40(%rsp)
call   1060 <sin@plt>
mulsd  0x40(%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
movsd  0x88(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
mulsd  0x38(%rsp),%xmm1
subsd  %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
divsd  %xmm2,%xmm0
call   1070 <atan@plt>
movapd 0x40(%rsp),%xmm4
movapd 0x10(%rsp),%xmm5
mulsd  %xmm4,%xmm5
movsd  0xc0f(%rip),%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm2,%xmm5
movapd %xmm5,%xmm3
andnpd %xmm0,%xmm3
addsd  %xmm1,%xmm0
andpd  %xmm5,%xmm0
orpd   %xmm3,%xmm0
movapd %xmm4,%xmm3
cmpltsd %xmm2,%xmm3
movapd %xmm3,%xmm2
andnpd %xmm0,%xmm2
addsd  %xmm1,%xmm0
andpd  %xmm3,%xmm0
orpd   %xmm2,%xmm0
call   10a0 <cos@plt>
movsd  0x8(%rsp),%xmm1
addsd  0xbca(%rip),%xmm0
mulsd  0xbca(%rip),%xmm0
movsd  %xmm0,(%r15)
test   %r14,%r14
je     151d <moon_colong+0x38d>
mulsd  0xb74(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x28(%rsp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x30(%rsp),%xmm0
call   10a0 <cos@plt>
movsd  %xmm0,0x68(%rsp)
movsd  0x28(%rsp),%xmm0
call   10a0 <cos@plt>
mulsd  0x68(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0x70(%rsp),%xmm0
call   1060 <sin@plt>
mulsd  0x28(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
call   1080 <asin@plt>
movsd  %xmm0,(%r14)
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @moon_colong(double %0, double %1, double %2, double* %3, double* %4, double* %5, double* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double* %3, double** %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
store double 1.745330e-02, double* %15
%42 = load double, double* %8
%43 = fsub double %42, 0x4142B42C80000000
%44 = fdiv double %43, 3.652500e+04
store double %44, double* %16
%45 = load double, double* %16
%46 = load double, double* %16
%47 = fmul double %45, %46
store double %47, double* %17
%48 = load double, double* %15
%49 = load double, double* %16
%50 = load double, double* %17
%51 = call i32 (double, double, double, double*, double*, double*, double*, ...) bitcast (i32 (...)* @Sun to i32 (double, double, double, double*, double*, double*, double*, ...)*)(double %48, double %49, double %50, double* %18, double* %19, double* %20, double* %21)
%52 = load double, double* %15
%53 = load double, double* %16
%54 = load double, double* %17
%55 = load double, double* %21
%56 = load double, double* %20
%57 = load double, double* %19
%58 = call i32 (double, double, double, double, double, double, double*, double*, double*, double*, double*, double*, double*, double*, ...) bitcast (i32 (...)* @Moon to i32 (double, double, double, double, double, double, double*, double*, double*, double*, double*, double*, double*, double*, ...)*)(double %52, double %53, double %54, double %55, double %56, double %57, double* %22, double* %23, double* %24, double* %25, double* %26, double* %27, double* %28, double* %29)
%59 = load double, double* %15
%60 = load double, double* %28
%61 = load double, double* %29
%62 = load double, double* %24
%63 = load double, double* %22
%64 = load double, double* %18
%65 = load double, double* %23
%66 = call i32 (double, double, double, double, double, double, double, double*, double*, ...) bitcast (i32 (...)* @Librations to i32 (double, double, double, double, double, double, double, double*, double*, ...)*)(double %59, double %60, double %61, double %62, double %63, double %64, double %65, double* %30, double* %31)
%67 = load double*, double** %14
%68 = icmp ne double* %67, null
br i1 %68, label %69, label %72
69: ; preds = %7
%70 = load double, double* %31
%71 = load double*, double** %14
store double %70, double* %71
br label %72
72: ; preds = %69, %7
%73 = load double, double* %30
%74 = fdiv double %73, 3.600000e+02
store double %74, double* %32
%75 = load double, double* %32
%76 = load double, double* %32
%77 = fptosi double %76 to i32
%78 = sitofp i32 %77 to double
%79 = fsub double %75, %78
%80 = fmul double %79, 3.600000e+02
store double %80, double* %30
%81 = load double, double* %30
%82 = fcmp olt double %81, 0.000000e+00
br i1 %82, label %83, label %86
83: ; preds = %72
%84 = load double, double* %30
%85 = fadd double %84, 3.600000e+02
store double %85, double* %30
br label %86
86: ; preds = %83, %72
%87 = load double, double* %30
%88 = fcmp ole double %87, 9.000000e+01
br i1 %88, label %89, label %92
89: ; preds = %86
%90 = load double, double* %30
%91 = fsub double 9.000000e+01, %90
store double %91, double* %33
br label %95
92: ; preds = %86
%93 = load double, double* %30
%94 = fsub double 4.500000e+02, %93
store double %94, double* %33
br label %95
95: ; preds = %92, %89
%96 = load double*, double** %11
%97 = icmp ne double* %96, null
br i1 %97, label %98, label %105
98: ; preds = %95
%99 = load double, double* %33
%100 = fmul double %99, 0x400921FB54442D18
%101 = fdiv double %100, 1.800000e+02
%102 = load double*, double** %11
store double %101, double* %102
%103 = load double*, double** %11
%104 = call i32 (double*, double, ...) bitcast (i32 (...)* @range to i32 (double*, double, ...)*)(double* %103, double 0x401921FB54442D18)
br label %105
105: ; preds = %98, %95
%106 = load double*, double** %12
%107 = icmp ne double* %106, null
br i1 %107, label %108, label %155
108: ; preds = %105
%109 = load double, double* %26
%110 = load double, double* %15
%111 = fmul double %109, %110
%112 = call double @cos(double %111)
%113 = load double, double* %25
%114 = load double, double* %21
%115 = load double, double* %15
%116 = fneg double %114
%117 = call double @llvm.fmuladd.f64(double %116, double %115, double %113)
%118 = call double @cos(double %117)
%119 = fmul double %112, %118
store double %119, double* %32
%120 = load double, double* %32
%121 = call double @acos(double %120)
store double %121, double* %34
%122 = load double, double* %20
%123 = load double, double* %34
%124 = call double @sin(double %123)
%125 = fmul double %122, %124
store double %125, double* %35
%126 = load double, double* %27
%127 = load double, double* %20
%128 = load double, double* %32
%129 = fneg double %127
%130 = call double @llvm.fmuladd.f64(double %129, double %128, double %126)
store double %130, double* %36
%131 = load double, double* %35
%132 = load double, double* %36
%133 = fdiv double %131, %132
%134 = call double @atan(double %133)
store double %134, double* %37
%135 = load double, double* %35
%136 = load double, double* %36
%137 = fmul double %135, %136
%138 = fcmp olt double %137, 0.000000e+00
br i1 %138, label %139, label %142
139: ; preds = %108
%140 = load double, double* %37
%141 = fadd double %140, 3.141590e+00
store double %141, double* %37
br label %142
142: ; preds = %139, %108
%143 = load double, double* %35
%144 = fcmp olt double %143, 0.000000e+00
br i1 %144, label %145, label %148
145: ; preds = %142
%146 = load double, double* %37
%147 = fadd double %146, 3.141590e+00
store double %147, double* %37
br label %148
148: ; preds = %145, %142
%149 = load double, double* %37
%150 = call double @cos(double %149)
%151 = fadd double 1.000000e+00, %150
%152 = fdiv double %151, 2.000000e+00
store double %152, double* %38
%153 = load double, double* %38
%154 = load double*, double** %12
store double %153, double* %154
br label %155
155: ; preds = %148, %105
%156 = load double*, double** %13
%157 = icmp ne double* %156, null
br i1 %157, label %158, label %183
158: ; preds = %155
%159 = load double, double* %9
store double %159, double* %39
%160 = load double, double* %10
store double %160, double* %40
%161 = load double, double* %33
%162 = load double, double* %15
%163 = fmul double %161, %162
store double %163, double* %33
%164 = load double, double* %31
%165 = call double @sin(double %164)
%166 = load double, double* %39
%167 = call double @sin(double %166)
%168 = load double, double* %31
%169 = call double @cos(double %168)
%170 = load double, double* %39
%171 = call double @cos(double %170)
%172 = fmul double %169, %171
%173 = load double, double* %33
%174 = load double, double* %40
%175 = fadd double %173, %174
%176 = call double @sin(double %175)
%177 = fmul double %172, %176
%178 = call double @llvm.fmuladd.f64(double %165, double %167, double %177)
store double %178, double* %32
%179 = load double, double* %32
%180 = call double @asin(double %179)
store double %180, double* %41
%181 = load double, double* %41
%182 = load double*, double** %13
store double %181, double* %182
br label %183
183: ; preds = %158, %155
ret void
}

LLVM IR (-O2):
define void @moon_colong(double %0, double %1, double %2, double* %3, double* writeonly %4, double* writeonly %5, double* writeonly %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = bitcast double* %8 to i8*
%23 = bitcast double* %9 to i8*
%24 = bitcast double* %10 to i8*
%25 = bitcast double* %11 to i8*
%26 = bitcast double* %12 to i8*
%27 = bitcast double* %13 to i8*
%28 = bitcast double* %14 to i8*
%29 = bitcast double* %15 to i8*
%30 = bitcast double* %16 to i8*
%31 = bitcast double* %17 to i8*
%32 = bitcast double* %18 to i8*
%33 = bitcast double* %19 to i8*
%34 = bitcast double* %20 to i8*
%35 = bitcast double* %21 to i8*
%36 = fadd double %0, 0xC142B42C80000000
%37 = fdiv double %36, 3.652500e+04
%38 = fmul double %37, %37
%39 = call i32 (double, double, double, double*, double*, double*, double*, ...) bitcast (i32 (...)* @Sun to i32 (double, double, double, double*, double*, double*, double*, ...)*)(double 1.745330e-02, double %37, double %38, double* %8, double* %9, double* %10, double* %11)
%40 = load double, double* %11
%41 = load double, double* %10
%42 = load double, double* %9
%43 = call i32 (double, double, double, double, double, double, double*, double*, double*, double*, double*, double*, double*, double*, ...) bitcast (i32 (...)* @Moon to i32 (double, double, double, double, double, double, double*, double*, double*, double*, double*, double*, double*, double*, ...)*)(double 1.745330e-02, double %37, double %38, double %40, double %41, double %42, double* %12, double* %13, double* %14, double* %15, double* %16, double* %17, double* %18, double* %19)
%44 = load double, double* %18
%45 = load double, double* %19
%46 = load double, double* %14
%47 = load double, double* %12
%48 = load double, double* %8
%49 = load double, double* %13
%50 = call i32 (double, double, double, double, double, double, double, double*, double*, ...) bitcast (i32 (...)* @Librations to i32 (double, double, double, double, double, double, double, double*, double*, ...)*)(double 1.745330e-02, double %44, double %45, double %46, double %47, double %48, double %49, double* %20, double* %21)
%51 = icmp eq double* %6, null
br i1 %51, label %54, label %52
52: ; preds = %7
%53 = load double, double* %21
store double %53, double* %6
br label %54
54: ; preds = %52, %7
%55 = load double, double* %20
%56 = fdiv double %55, 3.600000e+02
%57 = fptosi double %56 to i32
%58 = sitofp i32 %57 to double
%59 = fsub double %56, %58
%60 = fmul double %59, 3.600000e+02
%61 = fcmp olt double %60, 0.000000e+00
%62 = fadd double %60, 3.600000e+02
%63 = select i1 %61, double %62, double %60
store double %63, double* %20
%64 = fcmp ugt double %63, 9.000000e+01
%65 = select i1 %64, double 4.500000e+02, double 9.000000e+01
%66 = fsub double %65, %63
%67 = icmp eq double* %3, null
br i1 %67, label %72, label %68
68: ; preds = %54
%69 = fmul double %66, 0x400921FB54442D18
%70 = fdiv double %69, 1.800000e+02
store double %70, double* %3
%71 = call i32 (double*, double, ...) bitcast (i32 (...)* @range to i32 (double*, double, ...)*)(double* %3, double 0x401921FB54442D18)
br label %72
72: ; preds = %68, %54
%73 = icmp eq double* %4, null
br i1 %73, label %104, label %74
74: ; preds = %72
%75 = load double, double* %16
%76 = fmul double %75, 1.745330e-02
%77 = call double @cos(double %76)
%78 = load double, double* %15
%79 = load double, double* %11
%80 = fneg double %79
%81 = call double @llvm.fmuladd.f64(double %80, double 1.745330e-02, double %78)
%82 = call double @cos(double %81)
%83 = fmul double %77, %82
%84 = call double @acos(double %83)
%85 = load double, double* %10
%86 = call double @sin(double %84)
%87 = fmul double %85, %86
%88 = load double, double* %17
%89 = load double, double* %10
%90 = fneg double %89
%91 = call double @llvm.fmuladd.f64(double %90, double %83, double %88)
%92 = fdiv double %87, %91
%93 = call double @atan(double %92)
%94 = fmul double %87, %91
%95 = fcmp olt double %94, 0.000000e+00
%96 = fadd double %93, 3.141590e+00
%97 = select i1 %95, double %96, double %93
%98 = fcmp olt double %87, 0.000000e+00
%99 = fadd double %97, 3.141590e+00
%100 = select i1 %98, double %99, double %97
%101 = call double @cos(double %100)
%102 = fadd double %101, 1.000000e+00
%103 = fmul double %102, 5.000000e-01
store double %103, double* %4
br label %104
104: ; preds = %74, %72
%105 = icmp eq double* %5, null
br i1 %105, label %120, label %106
106: ; preds = %104
%107 = fmul double %66, 1.745330e-02
%108 = load double, double* %21
%109 = call double @sin(double %108)
%110 = call double @sin(double %1)
%111 = load double, double* %21
%112 = call double @cos(double %111)
%113 = call double @cos(double %1)
%114 = fmul double %112, %113
%115 = fadd double %107, %2
%116 = call double @sin(double %115)
%117 = fmul double %114, %116
%118 = call double @llvm.fmuladd.f64(double %109, double %110, double %117)
%119 = call double @asin(double %118)
store double %119, double* %5
br label %120
120: ; preds = %106, %104
ret void
}