#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(double *);
double log(double);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ twobody_XA(int, double, double *);
void twobody_XA_lub(int n, double l, double s, double *XA11, double *XA12) {
  if (n % 2 != 0)
    n--;
  double *f = (double *)malloc(sizeof(double) * (n + 1));
  if (f == NULL) {
    fprintf(stderr, "twobody_XA_lub"
                    " : malloc error for "
                    "f"
                    "\n");
    exit(1);
  };
  twobody_XA(n, l, f);
  *XA11 = 0.0;
  *XA12 = 0.0;
  double l1 = 1.0 + l;
  double l13 = l1 * l1 * l1;
  double g1, g2, g3;
  g1 = 2.0 * l * l / l13;
  g2 = 0.2 * l * (1.0 + l * (7.0 + l)) / l13;
  g3 = (1.0 + l * (18.0 + l * (-29.0 + l * (18.0 + l)))) / l13 / 42.0;
  double s1, s2, s3, s4, s5, ls1, ls2;
  s1 = 1.0 - 4.0 / s / s;
  s2 = (s + 2.0) / (s - 2.0);
  s3 = s * s;
  s4 = 1.0 / s3;
  s5 = s * s / 4.0 - 1.0;
  ls1 = log(s1);
  ls2 = log(s2);
  *XA11 = g1 / s1 - g2 * ls1 - g3 * s1 * ls1 + f[0] - g1;
  *XA12 = 2.0 / s * g1 / s1 + g2 * ls2 + g3 * s1 * ls2 + 4.0 * g3 / s;
  double s1l = s * (1.0 + l);
  double s1lm = s1l;
  double s21 = 2.0 / s;
  double s2m = s21;
  double a;
  int m;
  for (m = 1; m < n; m++) {
    if (m % 2 == 0) {
      a = -g1 - 2.0 * g2 / (double)m;
      if (m == 2) {
        a += 4.0 * g3 / (double)(-2 * m);
      } else {
        a += 4.0 * g3 / (double)(m * (m - 2));
      }
      *XA11 += f[m] / s1lm + a * s2m;
    } else {
      a = -g1 - 2.0 * g2 / (double)m + 4.0 * g3 / (double)(m * (m - 2));
      *XA12 += f[m] / s1lm + a * s2m;
    }
    s1lm *= s1l;
    s2m *= s21;
  }
  *XA12 *= -2.0 / l1;
  free(f);
}


x86 assembly (clang, -O0):
<twobody_XA_lub>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     119d <twobody_XA_lub+0x3d>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11de <twobody_XA_lub+0x7e>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
lea    0xe79(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x30(%rbp),%rsi
call   1040 <twobody_XA@plt>
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  0xdfb(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xdcd(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xde9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xdcf(%rip),%xmm2
addsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd96(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xd85(%rip),%xmm3
addsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd7c(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd64(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd3c(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xd3b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd22(%rip),%xmm1
divsd  -0x18(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xd08(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xcef(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xcdd(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xcc1(%rip),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xcad(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc99(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm2
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
addsd  (%rax),%xmm0
subsd  -0x48(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xbe0(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xbaa(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  0xb7f(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xb4e(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movl   $0x1,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    16e5 <twobody_XA_lub+0x585>
mov    -0xbc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    15f9 <twobody_XA_lub+0x499>
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xadd(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
cvtsi2sdl -0xbc(%rbp),%xmm2
ff
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
cmpl   $0x2,-0xbc(%rbp)
jne    1581 <twobody_XA_lub+0x421>
movsd  0xabb(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
imul   $0xfffffffe,-0xbc(%rbp),%eax
ff ff ff
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    15b8 <twobody_XA_lub+0x458>
movsd  0xa87(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0xbc(%rbp),%eax
mov    -0xbc(%rbp),%ecx
sub    $0x2,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
divsd  -0xa0(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    16a1 <twobody_XA_lub+0x541>
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0x9e3(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
cvtsi2sdl -0xbc(%rbp),%xmm2
ff
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  0x9d6(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
mov    -0xbc(%rbp),%eax
mov    -0xbc(%rbp),%ecx
sub    $0x2,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
divsd  -0xa0(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    14d9 <twobody_XA_lub+0x379>
movsd  0x953(%rip),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twobody_XA_lub>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
movaps %xmm1,0x30(%rsp)
movsd  %xmm0,(%rsp)
mov    %edi,%r12d
lea    0x0(,%r12,8),%edi
or     $0x8,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     14bf <twobody_XA_lub+0x35f>
mov    %rax,%rbx
and    $0xfffffffe,%r12d
mov    %r12d,%edi
movsd  (%rsp),%xmm0
mov    %rax,%rsi
call   1040 <twobody_XA@plt>
movq   $0x0,(%r14)
movq   $0x0,(%r15)
movsd  0xe3c(%rip),%xmm0
movsd  (%rsp),%xmm4
movapd %xmm4,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x28(%rsp)
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm1,%xmm2
movapd %xmm4,%xmm1
addsd  %xmm4,%xmm1
mulsd  %xmm4,%xmm1
movapd %xmm1,0x50(%rsp)
movsd  0xe07(%rip),%xmm1
mulsd  %xmm4,%xmm1
movsd  0xe03(%rip),%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm4,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm3
divsd  %xmm2,%xmm3
movsd  %xmm3,0x20(%rsp)
movapd %xmm2,0x40(%rsp)
movsd  0xde3(%rip),%xmm1
movapd %xmm4,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm4,%xmm3
addsd  0xdd7(%rip),%xmm3
mulsd  %xmm4,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm4,%xmm3
addsd  %xmm0,%xmm3
divsd  %xmm2,%xmm3
divsd  0xdc3(%rip),%xmm3
movsd  %xmm3,(%rsp)
movsd  0xdbe(%rip),%xmm1
movapd 0x30(%rsp),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0xda6(%rip),%xmm3
addsd  %xmm2,%xmm3
movsd  0xda2(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm3
movsd  %xmm3,0x8(%rsp)
call   1070 <log@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <log@plt>
movsd  (%rsp),%xmm10
movsd  0x20(%rsp),%xmm9
movsd  0x28(%rsp),%xmm8
movapd 0xd82(%rip),%xmm1
unpcklpd 0x50(%rsp),%xmm1
movapd 0x30(%rsp),%xmm7
movapd %xmm7,%xmm2
unpcklpd 0x40(%rsp),%xmm2
divpd  %xmm2,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
movapd %xmm2,%xmm3
movsd  0x18(%rsp),%xmm5
divsd  %xmm5,%xmm3
movapd %xmm9,%xmm4
movsd  0x10(%rsp),%xmm6
mulsd  %xmm6,%xmm4
subsd  %xmm4,%xmm3
movapd %xmm5,%xmm4
mulsd  %xmm10,%xmm4
mulsd  %xmm4,%xmm6
subsd  %xmm6,%xmm3
addsd  (%rbx),%xmm3
subsd  %xmm2,%xmm3
movsd  %xmm3,(%r14)
movapd %xmm1,%xmm3
mulsd  %xmm2,%xmm3
divsd  %xmm5,%xmm3
movapd %xmm9,%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm0,%xmm4
addsd  %xmm5,%xmm4
mulsd  0xcc7(%rip),%xmm10
movapd %xmm10,%xmm0
divsd  %xmm7,%xmm0
addsd  %xmm4,%xmm0
movsd  %xmm0,(%r15)
cmp    $0x2,%r12d
jl     13c3 <twobody_XA_lub+0x263>
mulsd  %xmm8,%xmm7
xorpd  0xce2(%rip),%xmm2
addsd  %xmm9,%xmm9
movapd %xmm2,%xmm0
subsd  %xmm9,%xmm0
subsd  %xmm10,%xmm0
movsd  0x8(%rbx),%xmm3
divsd  %xmm7,%xmm3
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
addsd  (%r15),%xmm0
movsd  %xmm0,(%r15)
jne    13ec <twobody_XA_lub+0x28c>
movsd  (%r15),%xmm0
movsd  0xc75(%rip),%xmm1
divsd  %xmm8,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r15)
mov    %rbx,%rdi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>
movsd  0xc54(%rip),%xmm4
mulsd  %xmm10,%xmm4
movapd %xmm7,%xmm0
mulsd  %xmm7,%xmm0
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
movsd  0xc3f(%rip),%xmm5
mulsd  %xmm9,%xmm5
addsd  %xmm2,%xmm5
addsd  %xmm4,%xmm5
movsd  0x10(%rbx),%xmm4
divsd  %xmm0,%xmm4
mulsd  %xmm3,%xmm5
addsd  %xmm4,%xmm5
addsd  (%r14),%xmm5
mov    %r12d,%eax
movsd  %xmm5,(%r14)
mov    $0x3,%ecx
mov    $0x1,%edx
jmp    14a0 <twobody_XA_lub+0x340>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rsi
mulsd  %xmm7,%xmm0
mulsd  %xmm1,%xmm3
xorps  %xmm5,%xmm5
cvtsi2sd %ecx,%xmm5
movapd %xmm9,%xmm6
divsd  %xmm5,%xmm6
movapd %xmm2,%xmm5
subsd  %xmm6,%xmm5
addsd  %xmm4,%xmm5
movsd  (%rbx,%rcx,8),%xmm4
divsd  %xmm0,%xmm4
mulsd  %xmm3,%xmm5
addsd  %xmm4,%xmm5
addsd  (%rsi),%xmm5
movsd  %xmm5,(%rsi)
add    $0x1,%rcx
add    $0x1,%edx
cmp    %rcx,%rax
je     13be <twobody_XA_lub+0x25e>
mov    %edx,%esi
imul   %ecx,%esi
xorps  %xmm5,%xmm5
cvtsi2sd %esi,%xmm5
movapd %xmm10,%xmm4
divsd  %xmm5,%xmm4
test   $0x1,%cl
jne    1450 <twobody_XA_lub+0x2f0>
mov    %r14,%rsi
jmp    1453 <twobody_XA_lub+0x2f3>
mov    0x2b1a(%rip),%rax
mov    (%rax),%edi
lea    0xbb1(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"twobody_XA_lub : malloc error for f\0A\00"
define void @twobody_XA_lub(i32 %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca double
%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 i32
store i32 %0, i32* %6
store double %1, double* %7
store double %2, double* %8
store double* %3, double** %9
store double* %4, double** %10
%30 = load i32, i32* %6
%31 = srem i32 %30, 2
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %5
%34 = load i32, i32* %6
%35 = add nsw i32 %34, -1
store i32 %35, i32* %6
br label %36
36: ; preds = %33, %5
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = mul i64 8, %39
%41 = trunc i64 %40 to i32
%42 = call i64 @malloc(i32 %41)
%43 = inttoptr i64 %42 to double*
store double* %43, double** %11
%44 = load double*, double** %11
%45 = icmp eq double* %44, null
br i1 %45, label %46, label %50
46: ; preds = %36
%47 = load i32, i32* @stderr
%48 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %36
%51 = load i32, i32* %6
%52 = load double, double* %7
%53 = load double*, double** %11
%54 = call i32 @twobody_XA(i32 %51, double %52, double* %53)
%55 = load double*, double** %9
store double 0.000000e+00, double* %55
%56 = load double*, double** %10
store double 0.000000e+00, double* %56
%57 = load double, double* %7
%58 = fadd double 1.000000e+00, %57
store double %58, double* %12
%59 = load double, double* %12
%60 = load double, double* %12
%61 = fmul double %59, %60
%62 = load double, double* %12
%63 = fmul double %61, %62
store double %63, double* %13
%64 = load double, double* %7
%65 = fmul double 2.000000e+00, %64
%66 = load double, double* %7
%67 = fmul double %65, %66
%68 = load double, double* %13
%69 = fdiv double %67, %68
store double %69, double* %14
%70 = load double, double* %7
%71 = fmul double 2.000000e-01, %70
%72 = load double, double* %7
%73 = load double, double* %7
%74 = fadd double 7.000000e+00, %73
%75 = call double @llvm.fmuladd.f64(double %72, double %74, double 1.000000e+00)
%76 = fmul double %71, %75
%77 = load double, double* %13
%78 = fdiv double %76, %77
store double %78, double* %15
%79 = load double, double* %7
%80 = load double, double* %7
%81 = load double, double* %7
%82 = load double, double* %7
%83 = fadd double 1.800000e+01, %82
%84 = call double @llvm.fmuladd.f64(double %81, double %83, double -2.900000e+01)
%85 = call double @llvm.fmuladd.f64(double %80, double %84, double 1.800000e+01)
%86 = call double @llvm.fmuladd.f64(double %79, double %85, double 1.000000e+00)
%87 = load double, double* %13
%88 = fdiv double %86, %87
%89 = fdiv double %88, 4.200000e+01
store double %89, double* %16
%90 = load double, double* %8
%91 = fdiv double 4.000000e+00, %90
%92 = load double, double* %8
%93 = fdiv double %91, %92
%94 = fsub double 1.000000e+00, %93
store double %94, double* %17
%95 = load double, double* %8
%96 = fadd double %95, 2.000000e+00
%97 = load double, double* %8
%98 = fsub double %97, 2.000000e+00
%99 = fdiv double %96, %98
store double %99, double* %18
%100 = load double, double* %8
%101 = load double, double* %8
%102 = fmul double %100, %101
store double %102, double* %19
%103 = load double, double* %19
%104 = fdiv double 1.000000e+00, %103
store double %104, double* %20
%105 = load double, double* %8
%106 = load double, double* %8
%107 = fmul double %105, %106
%108 = fdiv double %107, 4.000000e+00
%109 = fsub double %108, 1.000000e+00
store double %109, double* %21
%110 = load double, double* %17
%111 = call double @log(double %110)
store double %111, double* %22
%112 = load double, double* %18
%113 = call double @log(double %112)
store double %113, double* %23
%114 = load double, double* %14
%115 = load double, double* %17
%116 = fdiv double %114, %115
%117 = load double, double* %15
%118 = load double, double* %22
%119 = fneg double %117
%120 = call double @llvm.fmuladd.f64(double %119, double %118, double %116)
%121 = load double, double* %16
%122 = load double, double* %17
%123 = fmul double %121, %122
%124 = load double, double* %22
%125 = fneg double %123
%126 = call double @llvm.fmuladd.f64(double %125, double %124, double %120)
%127 = load double*, double** %11
%128 = getelementptr inbounds double, double* %127, i64 0
%129 = load double, double* %128
%130 = fadd double %126, %129
%131 = load double, double* %14
%132 = fsub double %130, %131
%133 = load double*, double** %9
store double %132, double* %133
%134 = load double, double* %8
%135 = fdiv double 2.000000e+00, %134
%136 = load double, double* %14
%137 = fmul double %135, %136
%138 = load double, double* %17
%139 = fdiv double %137, %138
%140 = load double, double* %15
%141 = load double, double* %23
%142 = call double @llvm.fmuladd.f64(double %140, double %141, double %139)
%143 = load double, double* %16
%144 = load double, double* %17
%145 = fmul double %143, %144
%146 = load double, double* %23
%147 = call double @llvm.fmuladd.f64(double %145, double %146, double %142)
%148 = load double, double* %16
%149 = fmul double 4.000000e+00, %148
%150 = load double, double* %8
%151 = fdiv double %149, %150
%152 = fadd double %147, %151
%153 = load double*, double** %10
store double %152, double* %153
%154 = load double, double* %8
%155 = load double, double* %7
%156 = fadd double 1.000000e+00, %155
%157 = fmul double %154, %156
store double %157, double* %24
%158 = load double, double* %24
store double %158, double* %25
%159 = load double, double* %8
%160 = fdiv double 2.000000e+00, %159
store double %160, double* %26
%161 = load double, double* %26
store double %161, double* %27
store i32 1, i32* %29
br label %162
162: ; preds = %253, %50
%163 = load i32, i32* %29
%164 = load i32, i32* %6
%165 = icmp slt i32 %163, %164
br i1 %165, label %166, label %256
166: ; preds = %162
%167 = load i32, i32* %29
%168 = srem i32 %167, 2
%169 = icmp eq i32 %168, 0
br i1 %169, label %170, label %215
170: ; preds = %166
%171 = load double, double* %14
%172 = fneg double %171
%173 = load double, double* %15
%174 = fmul double 2.000000e+00, %173
%175 = load i32, i32* %29
%176 = sitofp i32 %175 to double
%177 = fdiv double %174, %176
%178 = fsub double %172, %177
store double %178, double* %28
%179 = load i32, i32* %29
%180 = icmp eq i32 %179, 2
br i1 %180, label %181, label %190
181: ; preds = %170
%182 = load double, double* %16
%183 = fmul double 4.000000e+00, %182
%184 = load i32, i32* %29
%185 = mul nsw i32 -2, %184
%186 = sitofp i32 %185 to double
%187 = fdiv double %183, %186
%188 = load double, double* %28
%189 = fadd double %188, %187
store double %189, double* %28
br label %201
190: ; preds = %170
%191 = load double, double* %16
%192 = fmul double 4.000000e+00, %191
%193 = load i32, i32* %29
%194 = load i32, i32* %29
%195 = sub nsw i32 %194, 2
%196 = mul nsw i32 %193, %195
%197 = sitofp i32 %196 to double
%198 = fdiv double %192, %197
%199 = load double, double* %28
%200 = fadd double %199, %198
store double %200, double* %28
br label %201
201: ; preds = %190, %181
%202 = load double*, double** %11
%203 = load i32, i32* %29
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds double, double* %202, i64 %204
%206 = load double, double* %205
%207 = load double, double* %25
%208 = fdiv double %206, %207
%209 = load double, double* %28
%210 = load double, double* %27
%211 = call double @llvm.fmuladd.f64(double %209, double %210, double %208)
%212 = load double*, double** %9
%213 = load double, double* %212
%214 = fadd double %213, %211
store double %214, double* %212
br label %246
215: ; preds = %166
%216 = load double, double* %14
%217 = fneg double %216
%218 = load double, double* %15
%219 = fmul double 2.000000e+00, %218
%220 = load i32, i32* %29
%221 = sitofp i32 %220 to double
%222 = fdiv double %219, %221
%223 = fsub double %217, %222
%224 = load double, double* %16
%225 = fmul double 4.000000e+00, %224
%226 = load i32, i32* %29
%227 = load i32, i32* %29
%228 = sub nsw i32 %227, 2
%229 = mul nsw i32 %226, %228
%230 = sitofp i32 %229 to double
%231 = fdiv double %225, %230
%232 = fadd double %223, %231
store double %232, double* %28
%233 = load double*, double** %11
%234 = load i32, i32* %29
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds double, double* %233, i64 %235
%237 = load double, double* %236
%238 = load double, double* %25
%239 = fdiv double %237, %238
%240 = load double, double* %28
%241 = load double, double* %27
%242 = call double @llvm.fmuladd.f64(double %240, double %241, double %239)
%243 = load double*, double** %10
%244 = load double, double* %243
%245 = fadd double %244, %242
store double %245, double* %243
br label %246
246: ; preds = %215, %201
%247 = load double, double* %24
%248 = load double, double* %25
%249 = fmul double %248, %247
store double %249, double* %25
%250 = load double, double* %26
%251 = load double, double* %27
%252 = fmul double %251, %250
store double %252, double* %27
br label %253
253: ; preds = %246
%254 = load i32, i32* %29
%255 = add nsw i32 %254, 1
store i32 %255, i32* %29
br label %162
256: ; preds = %162
%257 = load double, double* %12
%258 = fdiv double -2.000000e+00, %257
%259 = load double*, double** %10
%260 = load double, double* %259
%261 = fmul double %260, %258
store double %261, double* %259
%262 = load double*, double** %11
%263 = call i32 @free(double* %262)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"twobody_XA_lub : malloc error for f\0A\00"
define void @twobody_XA_lub(i32 %0, double %1, double %2, double* nocapture %3, double* nocapture %4) {
%6 = and i32 %0, -2
%7 = shl i32 %0, 3
%8 = or i32 %7, 8
%9 = tail call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to double*
%11 = icmp eq i64 %9, 0
br i1 %11, label %12, label %16
12: ; preds = %5
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %5
%17 = tail call i32 @twobody_XA(i32 %6, double %1, double* %10)
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
%18 = fadd double %1, 1.000000e+00
%19 = fmul double %18, %18
%20 = fmul double %18, %19
%21 = fmul double %1, 2.000000e+00
%22 = fmul double %21, %1
%23 = fmul double %1, 2.000000e-01
%24 = fadd double %1, 7.000000e+00
%25 = tail call double @llvm.fmuladd.f64(double %1, double %24, double 1.000000e+00)
%26 = fmul double %23, %25
%27 = fdiv double %26, %20
%28 = fadd double %1, 1.800000e+01
%29 = tail call double @llvm.fmuladd.f64(double %1, double %28, double -2.900000e+01)
%30 = tail call double @llvm.fmuladd.f64(double %1, double %29, double 1.800000e+01)
%31 = tail call double @llvm.fmuladd.f64(double %1, double %30, double 1.000000e+00)
%32 = fdiv double %31, %20
%33 = fdiv double %32, 4.200000e+01
%34 = fdiv double 4.000000e+00, %2
%35 = fdiv double %34, %2
%36 = fsub double 1.000000e+00, %35
%37 = fadd double %2, 2.000000e+00
%38 = fadd double %2, -2.000000e+00
%39 = fdiv double %37, %38
%40 = tail call double @log(double %36)
%41 = tail call double @log(double %39)
%42 = insertelement <2 x double> <double 2.000000e+00, double poison>, double %22, i64 1
%43 = insertelement <2 x double> poison, double %2, i64 0
%44 = insertelement <2 x double> %43, double %20, i64 1
%45 = fdiv <2 x double> %42, %44
%46 = extractelement <2 x double> %45, i64 1
%47 = fdiv double %46, %36
%48 = fneg double %27
%49 = tail call double @llvm.fmuladd.f64(double %48, double %40, double %47)
%50 = fmul double %36, %33
%51 = fneg double %50
%52 = tail call double @llvm.fmuladd.f64(double %51, double %40, double %49)
%53 = load double, double* %10
%54 = fadd double %52, %53
%55 = fsub double %54, %46
store double %55, double* %3
%56 = extractelement <2 x double> %45, i64 0
%57 = fmul double %56, %46
%58 = fdiv double %57, %36
%59 = tail call double @llvm.fmuladd.f64(double %27, double %41, double %58)
%60 = tail call double @llvm.fmuladd.f64(double %50, double %41, double %59)
%61 = fmul double %33, 4.000000e+00
%62 = fdiv double %61, %2
%63 = fadd double %62, %60
store double %63, double* %4
%64 = fmul double %18, %2
%65 = icmp sgt i32 %6, 1
br i1 %65, label %66, label %129
66: ; preds = %16
%67 = fneg double %46
%68 = fmul double %27, 2.000000e+00
%69 = fmul double %61, -2.500000e-01
%70 = zext i32 %6 to i64
%71 = fsub double %67, %68
%72 = fneg double %61
%73 = fadd double %71, %72
%74 = getelementptr inbounds double, double* %10, i64 1
%75 = load double, double* %74
%76 = fdiv double %75, %64
%77 = tail call double @llvm.fmuladd.f64(double %73, double %56, double %76)
%78 = load double, double* %4
%79 = fadd double %78, %77
store double %79, double* %4
%80 = fmul double %64, %64
%81 = fmul double %56, %56
%82 = icmp eq i32 %6, 2
br i1 %82, label %127, label %83
83: ; preds = %66
%84 = fmul double %68, 5.000000e-01
%85 = fsub double %67, %84
%86 = fadd double %85, %69
%87 = getelementptr inbounds double, double* %10, i64 2
%88 = load double, double* %87
%89 = fdiv double %88, %80
%90 = tail call double @llvm.fmuladd.f64(double %86, double %81, double %89)
%91 = load double, double* %3
%92 = fadd double %91, %90
store double %92, double* %3
br label %93
93: ; preds = %83, %115
%94 = phi i64 [ 3, %83 ], [ %125, %115 ]
%95 = phi double [ %81, %83 ], [ %98, %115 ]
%96 = phi double [ %80, %83 ], [ %97, %115 ]
%97 = fmul double %64, %96
%98 = fmul double %56, %95
%99 = trunc i64 %94 to i32
%100 = and i32 %99, 1
%101 = icmp eq i32 %100, 0
%102 = sitofp i32 %99 to double
%103 = fdiv double %68, %102
%104 = fsub double %67, %103
br i1 %101, label %105, label %110
105: ; preds = %93
%106 = add nsw i32 %99, -2
%107 = mul nsw i32 %106, %99
%108 = sitofp i32 %107 to double
%109 = fdiv double %61, %108
br label %115
110: ; preds = %93
%111 = add nsw i32 %99, -2
%112 = mul nsw i32 %111, %99
%113 = sitofp i32 %112 to double
%114 = fdiv double %61, %113
br label %115
115: ; preds = %105, %110
%116 = phi double [ %114, %110 ], [ %109, %105 ]
%117 = phi double* [ %4, %110 ], [ %3, %105 ]
%118 = fadd double %104, %116
%119 = getelementptr inbounds double, double* %10, i64 %94
%120 = load double, double* %119
%121 = fdiv double %120, %97
%122 = tail call double @llvm.fmuladd.f64(double %118, double %98, double %121)
%123 = load double, double* %117
%124 = fadd double %123, %122
store double %124, double* %117
%125 = add nuw nsw i64 %94, 1
%126 = icmp eq i64 %125, %70
br i1 %126, label %127, label %93
127: ; preds = %115, %66
%128 = load double, double* %4
br label %129
129: ; preds = %127, %16
%130 = phi double [ %128, %127 ], [ %63, %16 ]
%131 = fdiv double -2.000000e+00, %18
%132 = fmul double %131, %130
store double %132, double* %4
%133 = tail call i32 @free(double* %10)
ret void
}