#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_XG(int, double, double *);
void twobody_XG_lub(int n, double l, double s, double *XG11, double *XG12) {
  if (n % 2 != 0)
    n--;
  double *f = (double *)malloc(sizeof(double) * (n + 1));
  if (f == NULL) {
    fprintf(stderr, "twobody_XG_lub"
                    " : malloc error for "
                    "f"
                    "\n");
    exit(1);
  };
  twobody_XG(n, l, f);
  *XG11 = 0.0;
  *XG12 = 0.0;
  double l1 = 1.0 + l;
  double l13 = l1 * l1 * l1;
  double g1, g2, g3;
  g1 = 3.0 * l * l / l13;
  g2 = 0.3 * l * (1.0 + l * (12.0 - 4.0 * l)) / l13;
  g3 =
      (5.0 + l * (181.0 + l * (-453.0 + l * (566.0 - 65.0 * l)))) / 140.0 / l13;
  double s1, s2, s3, s4, s5;
  double ls2, ls5;
  s1 = 2.0 * s / (s * s - 4.0);
  s2 = (s + 2.0) / (s - 2.0);
  s3 = (s * s - 4.0) / 4.0;
  s4 = 4.0 / (s * s - 4.0);
  s5 = s * s / (s * s - 4.0);
  ls2 = log(s2);
  ls5 = log(s5);
  *XG11 = g1 * s1 + (g2 + g3 * s3) * ls2 - g3 * s;
  *XG12 = -g1 * s4 - (g2 + g3 * s3) * ls5 + g3;
  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 + 4.0 * g3 / (double)(m * (m + 2));
      *XG12 -= f[m] / s1lm + a * s2m;
    } else {
      a = -g1 - 2.0 * g2 / (double)m + 4.0 * g3 / (double)(m * (m + 2));
      *XG11 += f[m] / s1lm + a * s2m;
    }
    s1lm *= s1l;
    s2m *= s21;
  }
  *XG12 *= 4.0 / l1 / l1;
  free(f);
}


x86 assembly (clang, -O0):
<twobody_XG_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_XG_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_XG_lub+0x7e>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%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_XG@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  0xe2d(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe09(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xdaa(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xdde(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd86(%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  -0x10(%rbp),%xmm3
movsd  0xd90(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd8c(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd6c(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd54(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd3c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xd28(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xcf2(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xce7(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xcc2(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xcb0(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc9d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xc99(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xc72(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xc6e(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc3d(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm4
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x78(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm4
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x90(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x58(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  0xb29(%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  0xaf8(%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    16f2 <twobody_XG_lub+0x592>
mov    -0xbc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1606 <twobody_XG_lub+0x4a6>
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xa87(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
cvtsi2sdl -0xbc(%rbp),%xmm2
ff
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  0xa82(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
mov    -0xbc(%rbp),%eax
mov    -0xbc(%rbp),%ecx
add    $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),%xmm0
divsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    16ae <twobody_XG_lub+0x54e>
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0x9d6(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
cvtsi2sdl -0xbc(%rbp),%xmm2
ff
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  0x9d1(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
mov    -0xbc(%rbp),%eax
mov    -0xbc(%rbp),%ecx
add    $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    -0x20(%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    152f <twobody_XG_lub+0x3cf>
movsd  0x91e(%rip),%xmm0
divsd  -0x38(%rbp),%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_XG_lub>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
movsd  %xmm1,0x8(%rsp)
movaps %xmm0,0x10(%rsp)
mov    %edi,%r12d
lea    0x0(,%r12,8),%edi
or     $0x8,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     148c <twobody_XG_lub+0x32c>
mov    %rax,%rbx
and    $0xfffffffe,%r12d
mov    %r12d,%edi
movaps 0x10(%rsp),%xmm0
mov    %rax,%rsi
call   1040 <twobody_XG@plt>
movsd  0xe46(%rip),%xmm1
movapd 0x10(%rsp),%xmm6
movapd %xmm6,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,0x70(%rsp)
movapd %xmm6,%xmm0
unpcklpd %xmm2,%xmm0
movapd 0xe92(%rip),%xmm3
unpcklpd %xmm2,%xmm3
mulpd  %xmm0,%xmm3
mulpd  %xmm0,%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
divsd  %xmm0,%xmm3
movapd %xmm3,0x60(%rsp)
movsd  0xe04(%rip),%xmm2
mulsd  %xmm6,%xmm2
movsd  0xe00(%rip),%xmm3
movapd %xmm6,%xmm4
mulsd  %xmm3,%xmm4
addsd  0xdf8(%rip),%xmm4
mulsd  %xmm6,%xmm4
movsd  0xdf4(%rip),%xmm5
mulsd  %xmm6,%xmm5
addsd  0xdf0(%rip),%xmm5
addsd  %xmm1,%xmm4
mulsd  %xmm6,%xmm5
addsd  0xde8(%rip),%xmm5
mulsd  %xmm2,%xmm4
mulsd  %xmm6,%xmm5
addsd  0xde0(%rip),%xmm5
divsd  %xmm0,%xmm4
movapd %xmm4,0x50(%rsp)
mulsd  %xmm6,%xmm5
addsd  0xdd2(%rip),%xmm5
divsd  0xdd2(%rip),%xmm5
divsd  %xmm0,%xmm5
movsd  %xmm5,0x48(%rsp)
movsd  0x8(%rsp),%xmm4
movapd %xmm4,%xmm0
addsd  %xmm4,%xmm0
movapd %xmm4,%xmm2
mulsd  %xmm4,%xmm2
movapd %xmm2,%xmm1
movapd %xmm2,%xmm5
addsd  %xmm3,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm4,%xmm0
addsd  0xd98(%rip),%xmm0
movsd  0xd98(%rip),%xmm2
addsd  %xmm4,%xmm2
divsd  %xmm2,%xmm0
movsd  0xd90(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x38(%rsp)
divsd  %xmm1,%xmm3
movsd  %xmm3,0x40(%rsp)
divsd  %xmm1,%xmm5
movsd  %xmm5,0x28(%rsp)
call   1070 <log@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x28(%rsp),%xmm0
call   1070 <log@plt>
movsd  0x48(%rsp),%xmm11
movapd 0x50(%rsp),%xmm9
movapd 0x60(%rsp),%xmm10
movapd 0x70(%rsp),%xmm8
movsd  0x38(%rsp),%xmm1
mulsd  %xmm11,%xmm1
addsd  %xmm9,%xmm1
movsd  0x30(%rsp),%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm1,%xmm3
movsd  0x10(%rsp),%xmm2
mulsd  %xmm10,%xmm2
addsd  %xmm4,%xmm2
movapd %xmm11,%xmm1
mulsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm2
movsd  0x40(%rsp),%xmm1
movsd  %xmm2,(%r15)
mulsd  %xmm0,%xmm3
mulsd  %xmm10,%xmm1
subsd  %xmm3,%xmm1
addsd  %xmm11,%xmm1
movsd  %xmm1,(%r14)
cmp    $0x2,%r12d
jl     145b <twobody_XG_lub+0x2fb>
xorpd  0xcef(%rip),%xmm10
movapd %xmm8,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xca8(%rip),%xmm7
divsd  %xmm1,%xmm7
mulsd  0xcb3(%rip),%xmm11
addsd  %xmm9,%xmm9
mov    %r12d,%eax
mov    $0x1,%ecx
mov    $0x3,%edx
movapd %xmm7,%xmm1
movapd %xmm0,%xmm2
jmp    13fe <twobody_XG_lub+0x29e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  (%r15),%xmm3
movsd  %xmm3,(%r15)
mulsd  %xmm0,%xmm2
mulsd  %xmm7,%xmm1
add    $0x1,%rcx
add    $0x1,%edx
cmp    %rcx,%rax
je     1456 <twobody_XG_lub+0x2f6>
xorps  %xmm3,%xmm3
cvtsi2sd %ecx,%xmm3
movapd %xmm9,%xmm4
divsd  %xmm3,%xmm4
movapd %xmm10,%xmm5
mov    %edx,%esi
imul   %ecx,%esi
xorps  %xmm6,%xmm6
cvtsi2sd %esi,%xmm6
subsd  %xmm4,%xmm5
movapd %xmm11,%xmm3
divsd  %xmm6,%xmm3
addsd  %xmm5,%xmm3
movsd  (%rbx,%rcx,8),%xmm4
divsd  %xmm2,%xmm4
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
test   $0x1,%cl
jne    13e0 <twobody_XG_lub+0x280>
movsd  (%r14),%xmm4
subsd  %xmm3,%xmm4
movsd  %xmm4,(%r14)
jmp    13ea <twobody_XG_lub+0x28a>
movsd  (%r14),%xmm1
movsd  0xc05(%rip),%xmm0
divsd  %xmm8,%xmm0
divsd  %xmm8,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
mov    %rbx,%rdi
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>
mov    0x2b4d(%rip),%rax
mov    (%rax),%edi
lea    0xbf4(%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_XG_lub : malloc error for f\0A\00"
define void @twobody_XG_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_XG(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 3.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 3.000000e-01, %70
%72 = load double, double* %7
%73 = load double, double* %7
%74 = call double @llvm.fmuladd.f64(double -4.000000e+00, double %73, double 1.200000e+01)
%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 = call double @llvm.fmuladd.f64(double -6.500000e+01, double %82, double 5.660000e+02)
%84 = call double @llvm.fmuladd.f64(double %81, double %83, double -4.530000e+02)
%85 = call double @llvm.fmuladd.f64(double %80, double %84, double 1.810000e+02)
%86 = call double @llvm.fmuladd.f64(double %79, double %85, double 5.000000e+00)
%87 = fdiv double %86, 1.400000e+02
%88 = load double, double* %13
%89 = fdiv double %87, %88
store double %89, double* %16
%90 = load double, double* %8
%91 = fmul double 2.000000e+00, %90
%92 = load double, double* %8
%93 = load double, double* %8
%94 = call double @llvm.fmuladd.f64(double %92, double %93, double -4.000000e+00)
%95 = fdiv double %91, %94
store double %95, double* %17
%96 = load double, double* %8
%97 = fadd double %96, 2.000000e+00
%98 = load double, double* %8
%99 = fsub double %98, 2.000000e+00
%100 = fdiv double %97, %99
store double %100, double* %18
%101 = load double, double* %8
%102 = load double, double* %8
%103 = call double @llvm.fmuladd.f64(double %101, double %102, double -4.000000e+00)
%104 = fdiv double %103, 4.000000e+00
store double %104, double* %19
%105 = load double, double* %8
%106 = load double, double* %8
%107 = call double @llvm.fmuladd.f64(double %105, double %106, double -4.000000e+00)
%108 = fdiv double 4.000000e+00, %107
store double %108, double* %20
%109 = load double, double* %8
%110 = load double, double* %8
%111 = fmul double %109, %110
%112 = load double, double* %8
%113 = load double, double* %8
%114 = call double @llvm.fmuladd.f64(double %112, double %113, double -4.000000e+00)
%115 = fdiv double %111, %114
store double %115, double* %21
%116 = load double, double* %18
%117 = call double @log(double %116)
store double %117, double* %22
%118 = load double, double* %21
%119 = call double @log(double %118)
store double %119, double* %23
%120 = load double, double* %14
%121 = load double, double* %17
%122 = load double, double* %15
%123 = load double, double* %16
%124 = load double, double* %19
%125 = call double @llvm.fmuladd.f64(double %123, double %124, double %122)
%126 = load double, double* %22
%127 = fmul double %125, %126
%128 = call double @llvm.fmuladd.f64(double %120, double %121, double %127)
%129 = load double, double* %16
%130 = load double, double* %8
%131 = fneg double %129
%132 = call double @llvm.fmuladd.f64(double %131, double %130, double %128)
%133 = load double*, double** %9
store double %132, double* %133
%134 = load double, double* %14
%135 = fneg double %134
%136 = load double, double* %20
%137 = load double, double* %15
%138 = load double, double* %16
%139 = load double, double* %19
%140 = call double @llvm.fmuladd.f64(double %138, double %139, double %137)
%141 = load double, double* %23
%142 = fmul double %140, %141
%143 = fneg double %142
%144 = call double @llvm.fmuladd.f64(double %135, double %136, double %143)
%145 = load double, double* %16
%146 = fadd double %144, %145
%147 = load double*, double** %10
store double %146, double* %147
%148 = load double, double* %8
%149 = load double, double* %7
%150 = fadd double 1.000000e+00, %149
%151 = fmul double %148, %150
store double %151, double* %24
%152 = load double, double* %24
store double %152, double* %25
%153 = load double, double* %8
%154 = fdiv double 2.000000e+00, %153
store double %154, double* %26
%155 = load double, double* %26
store double %155, double* %27
store i32 1, i32* %29
br label %156
156: ; preds = %233, %50
%157 = load i32, i32* %29
%158 = load i32, i32* %6
%159 = icmp slt i32 %157, %158
br i1 %159, label %160, label %236
160: ; preds = %156
%161 = load i32, i32* %29
%162 = srem i32 %161, 2
%163 = icmp eq i32 %162, 0
br i1 %163, label %164, label %195
164: ; preds = %160
%165 = load double, double* %14
%166 = fneg double %165
%167 = load double, double* %15
%168 = fmul double 2.000000e+00, %167
%169 = load i32, i32* %29
%170 = sitofp i32 %169 to double
%171 = fdiv double %168, %170
%172 = fsub double %166, %171
%173 = load double, double* %16
%174 = fmul double 4.000000e+00, %173
%175 = load i32, i32* %29
%176 = load i32, i32* %29
%177 = add nsw i32 %176, 2
%178 = mul nsw i32 %175, %177
%179 = sitofp i32 %178 to double
%180 = fdiv double %174, %179
%181 = fadd double %172, %180
store double %181, double* %28
%182 = load double*, double** %11
%183 = load i32, i32* %29
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
%186 = load double, double* %185
%187 = load double, double* %25
%188 = fdiv double %186, %187
%189 = load double, double* %28
%190 = load double, double* %27
%191 = call double @llvm.fmuladd.f64(double %189, double %190, double %188)
%192 = load double*, double** %10
%193 = load double, double* %192
%194 = fsub double %193, %191
store double %194, double* %192
br label %226
195: ; preds = %160
%196 = load double, double* %14
%197 = fneg double %196
%198 = load double, double* %15
%199 = fmul double 2.000000e+00, %198
%200 = load i32, i32* %29
%201 = sitofp i32 %200 to double
%202 = fdiv double %199, %201
%203 = fsub double %197, %202
%204 = load double, double* %16
%205 = fmul double 4.000000e+00, %204
%206 = load i32, i32* %29
%207 = load i32, i32* %29
%208 = add nsw i32 %207, 2
%209 = mul nsw i32 %206, %208
%210 = sitofp i32 %209 to double
%211 = fdiv double %205, %210
%212 = fadd double %203, %211
store double %212, double* %28
%213 = load double*, double** %11
%214 = load i32, i32* %29
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds double, double* %213, i64 %215
%217 = load double, double* %216
%218 = load double, double* %25
%219 = fdiv double %217, %218
%220 = load double, double* %28
%221 = load double, double* %27
%222 = call double @llvm.fmuladd.f64(double %220, double %221, double %219)
%223 = load double*, double** %9
%224 = load double, double* %223
%225 = fadd double %224, %222
store double %225, double* %223
br label %226
226: ; preds = %195, %164
%227 = load double, double* %24
%228 = load double, double* %25
%229 = fmul double %228, %227
store double %229, double* %25
%230 = load double, double* %26
%231 = load double, double* %27
%232 = fmul double %231, %230
store double %232, double* %27
br label %233
233: ; preds = %226
%234 = load i32, i32* %29
%235 = add nsw i32 %234, 1
store i32 %235, i32* %29
br label %156
236: ; preds = %156
%237 = load double, double* %12
%238 = fdiv double 4.000000e+00, %237
%239 = load double, double* %12
%240 = fdiv double %238, %239
%241 = load double*, double** %10
%242 = load double, double* %241
%243 = fmul double %242, %240
store double %243, double* %241
%244 = load double*, double** %11
%245 = call i32 @free(double* %244)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"twobody_XG_lub : malloc error for f\0A\00"
define void @twobody_XG_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_XG(i32 %6, double %1, double* %10)
%18 = fadd double %1, 1.000000e+00
%19 = insertelement <2 x double> poison, double %1, i64 0
%20 = insertelement <2 x double> %19, double %18, i64 1
%21 = insertelement <2 x double> <double 3.000000e+00, double poison>, double %18, i64 1
%22 = fmul <2 x double> %20, %21
%23 = fmul <2 x double> %22, %20
%24 = extractelement <2 x double> %23, i64 0
%25 = extractelement <2 x double> %23, i64 1
%26 = fdiv double %24, %25
%27 = fmul double %1, 3.000000e-01
%28 = tail call double @llvm.fmuladd.f64(double %1, double -4.000000e+00, double 1.200000e+01)
%29 = tail call double @llvm.fmuladd.f64(double %1, double %28, double 1.000000e+00)
%30 = fmul double %27, %29
%31 = fdiv double %30, %25
%32 = tail call double @llvm.fmuladd.f64(double %1, double -6.500000e+01, double 5.660000e+02)
%33 = tail call double @llvm.fmuladd.f64(double %1, double %32, double -4.530000e+02)
%34 = tail call double @llvm.fmuladd.f64(double %1, double %33, double 1.810000e+02)
%35 = tail call double @llvm.fmuladd.f64(double %1, double %34, double 5.000000e+00)
%36 = fdiv double %35, 1.400000e+02
%37 = fdiv double %36, %25
%38 = fmul double %2, 2.000000e+00
%39 = tail call double @llvm.fmuladd.f64(double %2, double %2, double -4.000000e+00)
%40 = fdiv double %38, %39
%41 = fadd double %2, 2.000000e+00
%42 = fadd double %2, -2.000000e+00
%43 = fdiv double %41, %42
%44 = fmul double %39, 2.500000e-01
%45 = fdiv double 4.000000e+00, %39
%46 = fmul double %2, %2
%47 = fdiv double %46, %39
%48 = tail call double @log(double %43)
%49 = tail call double @log(double %47)
%50 = tail call double @llvm.fmuladd.f64(double %37, double %44, double %31)
%51 = fmul double %50, %48
%52 = tail call double @llvm.fmuladd.f64(double %26, double %40, double %51)
%53 = fneg double %37
%54 = tail call double @llvm.fmuladd.f64(double %53, double %2, double %52)
store double %54, double* %3
%55 = fneg double %26
%56 = fneg double %50
%57 = fmul double %49, %56
%58 = tail call double @llvm.fmuladd.f64(double %55, double %45, double %57)
%59 = fadd double %37, %58
store double %59, double* %4
%60 = fmul double %18, %2
%61 = fdiv double 2.000000e+00, %2
%62 = icmp sgt i32 %6, 1
br i1 %62, label %63, label %99
63: ; preds = %16
%64 = fmul double %31, 2.000000e+00
%65 = fmul double %37, 4.000000e+00
%66 = zext i32 %6 to i64
br label %67
67: ; preds = %63, %92
%68 = phi i64 [ 1, %63 ], [ %95, %92 ]
%69 = phi double [ %61, %63 ], [ %94, %92 ]
%70 = phi double [ %60, %63 ], [ %93, %92 ]
%71 = trunc i64 %68 to i32
%72 = and i32 %71, 1
%73 = icmp eq i32 %72, 0
%74 = sitofp i32 %71 to double
%75 = fdiv double %64, %74
%76 = fsub double %55, %75
%77 = add nuw nsw i32 %71, 2
%78 = mul nsw i32 %77, %71
%79 = sitofp i32 %78 to double
%80 = fdiv double %65, %79
%81 = fadd double %76, %80
%82 = getelementptr inbounds double, double* %10, i64 %68
%83 = load double, double* %82
%84 = fdiv double %83, %70
%85 = tail call double @llvm.fmuladd.f64(double %81, double %69, double %84)
br i1 %73, label %86, label %89
86: ; preds = %67
%87 = load double, double* %4
%88 = fsub double %87, %85
store double %88, double* %4
br label %92
89: ; preds = %67
%90 = load double, double* %3
%91 = fadd double %90, %85
store double %91, double* %3
br label %92
92: ; preds = %89, %86
%93 = fmul double %60, %70
%94 = fmul double %61, %69
%95 = add nuw nsw i64 %68, 1
%96 = icmp eq i64 %95, %66
br i1 %96, label %97, label %67
97: ; preds = %92
%98 = load double, double* %4
br label %99
99: ; preds = %97, %16
%100 = phi double [ %98, %97 ], [ %59, %16 ]
%101 = fdiv double 4.000000e+00, %18
%102 = fdiv double %101, %18
%103 = fmul double %102, %100
store double %103, double* %4
%104 = tail call i32 @free(double* %10)
ret void
}