#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 atan2(double, double);
double cos(double);
double reb_tools_M_to_E(double, double);
double sin(double);
double sqrt(double);
void reb_tools_solve_kepler_pal(double h, double k, double lambda, double *p,
                                double *q) {
  double e2 = h * h + k * k;
  if (e2 < 0.3 * 0.3) {
    double pn = 0;
    double qn = 0;
    int n = 0;
    double f = 0.;
    do {
      double f0 =
          qn * cos(pn) + pn * sin(pn) - (k * cos(lambda) + h * sin(lambda));
      double f1 =
          -qn * sin(pn) + pn * cos(pn) - (k * sin(lambda) - h * cos(lambda));
      double fac = 1. / (qn - 1.);
      double fd00 = fac * (qn * cos(pn) - cos(pn) + pn * sin(pn));
      double fd01 = fac * (pn * cos(pn) - qn * sin(pn) + sin(pn));
      double fd10 = fac * (-sin(pn));
      double fd11 = fac * (-cos(pn));
      qn -= fd00 * f0 + fd10 * f1;
      pn -= fd01 * f0 + fd11 * f1;
      f = sqrt(f0 * f0 + f1 * f1);
    } while (n++ < 50 && f > 1e-15);
    *p = pn;
    *q = qn;
  } else {
    double pomega = atan2(h, k);
    double M = lambda - pomega;
    double e = sqrt(e2);
    double E = reb_tools_M_to_E(e, M);
    *p = e * sin(E);
    *q = e * cos(E);
  }
}


x86 assembly (clang, -O0):
<reb_tools_solve_kepler_pal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe65(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1688 <reb_tools_solve_kepler_pal+0x538>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0x178(%rbp),%xmm1
ff
movsd  -0x170(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x168(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0x160(%rbp),%xmm2
ff
movsd  -0x158(%rbp),%xmm1
ff
movsd  -0x150(%rbp),%xmm3
ff
movaps %xmm0,%xmm4
movsd  -0x148(%rbp),%xmm0
ff
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1060 <cos@plt>
movsd  -0x140(%rbp),%xmm1
ff
movsd  -0x138(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x130(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1060 <cos@plt>
movsd  -0x128(%rbp),%xmm2
ff
movsd  -0x120(%rbp),%xmm1
ff
movsd  -0x118(%rbp),%xmm3
ff
movaps %xmm0,%xmm4
movsd  -0x110(%rbp),%xmm0
ff
mulsd  %xmm4,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  0xc62(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xc56(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1060 <cos@plt>
movsd  -0x108(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0xf8(%rbp),%xmm1
ff
movsd  -0xf0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0xe0(%rbp),%xmm1
ff
movsd  -0xd8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xc0(%rbp),%xmm0
ff
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x44(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
xor    %eax,%eax
cmp    $0x32,%ecx
mov    %al,-0x179(%rbp)
jge    165b <reb_tools_solve_kepler_pal+0x50b>
movsd  -0x50(%rbp),%xmm0
movsd  0x9c2(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x179(%rbp)
mov    -0x179(%rbp),%al
test   $0x1,%al
jne    11c5 <reb_tools_solve_kepler_pal+0x75>
movsd  -0x38(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    174b <reb_tools_solve_kepler_pal+0x5fb>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <atan2@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
subsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
call   1030 <reb_tools_M_to_E@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x190(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x188(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reb_tools_solve_kepler_pal>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0xe83(%rip),%xmm3
ucomisd %xmm4,%xmm3
movsd  %xmm2,0x18(%rsp)
jbe    14a9 <reb_tools_solve_kepler_pal+0x359>
unpcklpd %xmm0,%xmm0
movapd %xmm0,0xa0(%rsp)
movapd %xmm1,0xd0(%rsp)
unpcklpd %xmm1,%xmm0
movapd %xmm0,0xc0(%rsp)
xorpd  %xmm2,%xmm2
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
movapd %xmm2,0x70(%rsp)
unpckhpd %xmm2,%xmm2
movapd %xmm2,(%rsp)
movapd %xmm2,%xmm0
call   1060 <cos@plt>
movapd %xmm0,0x30(%rsp)
movaps (%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,0x40(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
call   1050 <sin@plt>
movapd 0x70(%rsp),%xmm2
movapd %xmm2,%xmm1
unpckhpd 0xa0(%rsp),%xmm1
movapd 0x40(%rsp),%xmm3
unpcklpd %xmm0,%xmm3
mulpd  %xmm1,%xmm3
movapd %xmm2,%xmm0
unpcklpd 0xd0(%rsp),%xmm0
movapd 0x30(%rsp),%xmm1
unpcklpd 0x20(%rsp),%xmm1
mulpd  %xmm0,%xmm1
addpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
movapd %xmm2,%xmm1
movapd 0xdc9(%rip),%xmm0
xorpd  %xmm0,%xmm1
shufpd $0x2,0xc0(%rsp),%xmm1
movapd %xmm1,0x40(%rsp)
movaps (%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,0x20(%rsp)
movaps (%rsp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,0x60(%rsp)
movsd  0x18(%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,0x50(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <cos@plt>
xorpd  0xd76(%rip),%xmm0
movapd 0x70(%rsp),%xmm2
movapd %xmm2,%xmm1
shufpd $0x1,%xmm0,%xmm1
movapd 0x60(%rsp),%xmm0
shufpd $0x2,0xa0(%rsp),%xmm0
mulpd  %xmm1,%xmm0
movapd 0x20(%rsp),%xmm1
unpcklpd 0x50(%rsp),%xmm1
mulpd  0x40(%rsp),%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
movapd %xmm2,%xmm0
addsd  0xcf7(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
movaps (%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x60(%rsp)
movaps (%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x90(%rsp)
movaps (%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,0x40(%rsp)
movaps (%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x98(%rsp)
movaps (%rsp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,0x88(%rsp)
movaps (%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,0xe0(%rsp)
movaps (%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,0xf0(%rsp)
movapd (%rsp),%xmm0
call   1060 <cos@plt>
movapd %xmm0,%xmm7
movapd 0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm1
movapd 0x30(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xc66(%rip),%xmm0
jb     13d0 <reb_tools_solve_kepler_pal+0x280>
sqrtsd %xmm0,%xmm0
jmp    13e7 <reb_tools_solve_kepler_pal+0x297>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm7,0xb0(%rsp)
call   1070 <sqrt@plt>
movapd 0xb0(%rsp),%xmm7
movsd  0xc21(%rip),%xmm1
divsd  0x50(%rsp),%xmm1
movapd 0x70(%rsp),%xmm2
movsd  0x60(%rsp),%xmm5
mulsd  %xmm2,%xmm5
subsd  0x90(%rsp),%xmm5
movapd (%rsp),%xmm3
movapd 0x40(%rsp),%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm5,%xmm4
movsd  0x88(%rsp),%xmm6
mulsd  %xmm2,%xmm6
movsd  0x98(%rsp),%xmm5
mulsd  %xmm3,%xmm5
subsd  %xmm6,%xmm5
movapd 0xe0(%rsp),%xmm3
addsd  %xmm5,%xmm3
unpcklpd %xmm3,%xmm4
unpcklpd %xmm1,%xmm1
mulpd  %xmm1,%xmm4
movapd 0xf0(%rsp),%xmm5
unpcklpd %xmm7,%xmm5
mulpd  %xmm1,%xmm5
movapd 0x20(%rsp),%xmm3
unpcklpd %xmm3,%xmm3
mulpd  %xmm5,%xmm3
movapd 0x30(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
mulpd  %xmm4,%xmm1
subpd  %xmm3,%xmm1
subpd  %xmm1,%xmm2
cmp    $0x31,%ebp
ja     14a3 <reb_tools_solve_kepler_pal+0x353>
add    $0x1,%ebp
ucomisd 0xb7b(%rip),%xmm0
ja     11c0 <reb_tools_solve_kepler_pal+0x70>
movhpd %xmm2,(%rbx)
jmp    151c <reb_tools_solve_kepler_pal+0x3cc>
movapd %xmm4,(%rsp)
call   1040 <atan2@plt>
movapd (%rsp),%xmm2
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     14d5 <reb_tools_solve_kepler_pal+0x385>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    14ea <reb_tools_solve_kepler_pal+0x39a>
movapd %xmm2,%xmm0
movsd  %xmm1,0x18(%rsp)
call   1070 <sqrt@plt>
movsd  0x18(%rsp),%xmm1
movsd  %xmm0,(%rsp)
call   1030 <reb_tools_M_to_E@plt>
movsd  %xmm0,0x30(%rsp)
call   1050 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x30(%rsp),%xmm0
call   1060 <cos@plt>
movapd %xmm0,%xmm2
mulsd  (%rsp),%xmm2
movsd  %xmm2,(%r14)
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @reb_tools_solve_kepler_pal(double %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%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
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double* %3, double** %9
store double* %4, double** %10
%27 = load double, double* %6
%28 = load double, double* %6
%29 = load double, double* %7
%30 = load double, double* %7
%31 = fmul double %29, %30
%32 = call double @llvm.fmuladd.f64(double %27, double %28, double %31)
store double %32, double* %11
%33 = load double, double* %11
%34 = fcmp olt double %33, 0x3FB70A3D70A3D70A
br i1 %34, label %35, label %150
35: ; preds = %5
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
store i32 0, i32* %14
store double 0.000000e+00, double* %15
br label %36
36: ; preds = %143, %35
%37 = load double, double* %13
%38 = load double, double* %12
%39 = call double @cos(double %38)
%40 = load double, double* %12
%41 = load double, double* %12
%42 = call double @sin(double %41)
%43 = fmul double %40, %42
%44 = call double @llvm.fmuladd.f64(double %37, double %39, double %43)
%45 = load double, double* %7
%46 = load double, double* %8
%47 = call double @cos(double %46)
%48 = load double, double* %6
%49 = load double, double* %8
%50 = call double @sin(double %49)
%51 = fmul double %48, %50
%52 = call double @llvm.fmuladd.f64(double %45, double %47, double %51)
%53 = fsub double %44, %52
store double %53, double* %16
%54 = load double, double* %13
%55 = fneg double %54
%56 = load double, double* %12
%57 = call double @sin(double %56)
%58 = load double, double* %12
%59 = load double, double* %12
%60 = call double @cos(double %59)
%61 = fmul double %58, %60
%62 = call double @llvm.fmuladd.f64(double %55, double %57, double %61)
%63 = load double, double* %7
%64 = load double, double* %8
%65 = call double @sin(double %64)
%66 = load double, double* %6
%67 = load double, double* %8
%68 = call double @cos(double %67)
%69 = fmul double %66, %68
%70 = fneg double %69
%71 = call double @llvm.fmuladd.f64(double %63, double %65, double %70)
%72 = fsub double %62, %71
store double %72, double* %17
%73 = load double, double* %13
%74 = fsub double %73, 1.000000e+00
%75 = fdiv double 1.000000e+00, %74
store double %75, double* %18
%76 = load double, double* %18
%77 = load double, double* %13
%78 = load double, double* %12
%79 = call double @cos(double %78)
%80 = load double, double* %12
%81 = call double @cos(double %80)
%82 = fneg double %81
%83 = call double @llvm.fmuladd.f64(double %77, double %79, double %82)
%84 = load double, double* %12
%85 = load double, double* %12
%86 = call double @sin(double %85)
%87 = call double @llvm.fmuladd.f64(double %84, double %86, double %83)
%88 = fmul double %76, %87
store double %88, double* %19
%89 = load double, double* %18
%90 = load double, double* %12
%91 = load double, double* %12
%92 = call double @cos(double %91)
%93 = load double, double* %13
%94 = load double, double* %12
%95 = call double @sin(double %94)
%96 = fmul double %93, %95
%97 = fneg double %96
%98 = call double @llvm.fmuladd.f64(double %90, double %92, double %97)
%99 = load double, double* %12
%100 = call double @sin(double %99)
%101 = fadd double %98, %100
%102 = fmul double %89, %101
store double %102, double* %20
%103 = load double, double* %18
%104 = load double, double* %12
%105 = call double @sin(double %104)
%106 = fneg double %105
%107 = fmul double %103, %106
store double %107, double* %21
%108 = load double, double* %18
%109 = load double, double* %12
%110 = call double @cos(double %109)
%111 = fneg double %110
%112 = fmul double %108, %111
store double %112, double* %22
%113 = load double, double* %19
%114 = load double, double* %16
%115 = load double, double* %21
%116 = load double, double* %17
%117 = fmul double %115, %116
%118 = call double @llvm.fmuladd.f64(double %113, double %114, double %117)
%119 = load double, double* %13
%120 = fsub double %119, %118
store double %120, double* %13
%121 = load double, double* %20
%122 = load double, double* %16
%123 = load double, double* %22
%124 = load double, double* %17
%125 = fmul double %123, %124
%126 = call double @llvm.fmuladd.f64(double %121, double %122, double %125)
%127 = load double, double* %12
%128 = fsub double %127, %126
store double %128, double* %12
%129 = load double, double* %16
%130 = load double, double* %16
%131 = load double, double* %17
%132 = load double, double* %17
%133 = fmul double %131, %132
%134 = call double @llvm.fmuladd.f64(double %129, double %130, double %133)
%135 = call double @sqrt(double %134)
store double %135, double* %15
br label %136
136: ; preds = %36
%137 = load i32, i32* %14
%138 = add nsw i32 %137, 1
store i32 %138, i32* %14
%139 = icmp slt i32 %137, 50
br i1 %139, label %140, label %143
140: ; preds = %136
%141 = load double, double* %15
%142 = fcmp ogt double %141, 1.000000e-15
br label %143
143: ; preds = %140, %136
%144 = phi i1 [ false, %136 ], [ %142, %140 ]
br i1 %144, label %36, label %145
145: ; preds = %143
%146 = load double, double* %12
%147 = load double*, double** %9
store double %146, double* %147
%148 = load double, double* %13
%149 = load double*, double** %10
store double %148, double* %149
br label %172
150: ; preds = %5
%151 = load double, double* %6
%152 = load double, double* %7
%153 = call double @atan2(double %151, double %152)
store double %153, double* %23
%154 = load double, double* %8
%155 = load double, double* %23
%156 = fsub double %154, %155
store double %156, double* %24
%157 = load double, double* %11
%158 = call double @sqrt(double %157)
store double %158, double* %25
%159 = load double, double* %25
%160 = load double, double* %24
%161 = call double @reb_tools_M_to_E(double %159, double %160)
store double %161, double* %26
%162 = load double, double* %25
%163 = load double, double* %26
%164 = call double @sin(double %163)
%165 = fmul double %162, %164
%166 = load double*, double** %9
store double %165, double* %166
%167 = load double, double* %25
%168 = load double, double* %26
%169 = call double @cos(double %168)
%170 = fmul double %167, %169
%171 = load double*, double** %10
store double %170, double* %171
br label %172
172: ; preds = %150, %145
ret void
}

LLVM IR (-O2):
define void @reb_tools_solve_kepler_pal(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = fmul double %1, %1
%7 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %6)
%8 = fcmp olt double %7, 0x3FB70A3D70A3D70A
br i1 %8, label %9, label %89
9: ; preds = %5
%10 = insertelement <2 x double> poison, double %0, i64 1
%11 = insertelement <2 x double> poison, double %1, i64 1
br label %12
12: ; preds = %9, %12
%13 = phi i32 [ %82, %12 ], [ 0, %9 ]
%14 = phi <2 x double> [ %77, %12 ], [ zeroinitializer, %9 ]
%15 = extractelement <2 x double> %14, i64 1
%16 = tail call double @cos(double %15)
%17 = tail call double @sin(double %15)
%18 = extractelement <2 x double> %14, i64 0
%19 = tail call double @cos(double %2)
%20 = tail call double @sin(double %2)
%21 = shufflevector <2 x double> %10, <2 x double> %14, <2 x i32> <i32 3, i32 1>
%22 = insertelement <2 x double> poison, double %17, i64 0
%23 = insertelement <2 x double> %22, double %20, i64 1
%24 = fmul <2 x double> %21, %23
%25 = insertelement <2 x double> %14, double %1, i64 1
%26 = insertelement <2 x double> poison, double %16, i64 0
%27 = insertelement <2 x double> %26, double %19, i64 1
%28 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> %27, <2 x double> %24)
%29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%30 = fsub <2 x double> %28, %29
%31 = extractelement <2 x double> %30, i64 0
%32 = fneg double %18
%33 = tail call double @sin(double %15)
%34 = tail call double @cos(double %15)
%35 = tail call double @sin(double %2)
%36 = tail call double @cos(double %2)
%37 = fneg double %36
%38 = insertelement <2 x double> poison, double %15, i64 0
%39 = insertelement <2 x double> %38, double %37, i64 1
%40 = insertelement <2 x double> %10, double %34, i64 0
%41 = fmul <2 x double> %39, %40
%42 = insertelement <2 x double> %11, double %32, i64 0
%43 = insertelement <2 x double> poison, double %33, i64 0
%44 = insertelement <2 x double> %43, double %35, i64 1
%45 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %42, <2 x double> %44, <2 x double> %41)
%46 = shufflevector <2 x double> %45, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%47 = fsub <2 x double> %45, %46
%48 = fadd double %18, -1.000000e+00
%49 = fdiv double 1.000000e+00, %48
%50 = tail call double @cos(double %15)
%51 = tail call double @cos(double %15)
%52 = fneg double %51
%53 = tail call double @llvm.fmuladd.f64(double %18, double %50, double %52)
%54 = tail call double @sin(double %15)
%55 = tail call double @llvm.fmuladd.f64(double %15, double %54, double %53)
%56 = tail call double @cos(double %15)
%57 = tail call double @sin(double %15)
%58 = fmul double %57, %32
%59 = tail call double @llvm.fmuladd.f64(double %15, double %56, double %58)
%60 = tail call double @sin(double %15)
%61 = fadd double %60, %59
%62 = insertelement <2 x double> poison, double %49, i64 0
%63 = shufflevector <2 x double> %62, <2 x double> poison, <2 x i32> zeroinitializer
%64 = insertelement <2 x double> poison, double %55, i64 0
%65 = insertelement <2 x double> %64, double %61, i64 1
%66 = fmul <2 x double> %63, %65
%67 = tail call double @sin(double %15)
%68 = tail call double @cos(double %15)
%69 = insertelement <2 x double> poison, double %67, i64 0
%70 = insertelement <2 x double> %69, double %68, i64 1
%71 = fneg <2 x double> %70
%72 = fmul <2 x double> %63, %71
%73 = shufflevector <2 x double> %47, <2 x double> undef, <2 x i32> zeroinitializer
%74 = fmul <2 x double> %73, %72
%75 = shufflevector <2 x double> %30, <2 x double> undef, <2 x i32> zeroinitializer
%76 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %66, <2 x double> %75, <2 x double> %74)
%77 = fsub <2 x double> %14, %76
%78 = fmul <2 x double> %47, %47
%79 = extractelement <2 x double> %78, i64 0
%80 = tail call double @llvm.fmuladd.f64(double %31, double %31, double %79)
%81 = tail call double @sqrt(double %80)
%82 = add nuw nsw i32 %13, 1
%83 = icmp ult i32 %13, 50
%84 = fcmp ogt double %81, 1.000000e-15
%85 = select i1 %83, i1 %84, i1 false
br i1 %85, label %12, label %86
86: ; preds = %12
%87 = extractelement <2 x double> %77, i64 1
store double %87, double* %3
%88 = extractelement <2 x double> %77, i64 0
br label %98
89: ; preds = %5
%90 = tail call double @atan2(double %0, double %1)
%91 = fsub double %2, %90
%92 = tail call double @sqrt(double %7)
%93 = tail call double @reb_tools_M_to_E(double %92, double %91)
%94 = tail call double @sin(double %93)
%95 = fmul double %92, %94
store double %95, double* %3
%96 = tail call double @cos(double %93)
%97 = fmul double %92, %96
br label %98
98: ; preds = %89, %86
%99 = phi double [ %97, %89 ], [ %88, %86 ]
store double %99, double* %4
ret void
}