#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_YC(int, double, double *);
void twobody_YC_lub(int n, double l, double s, double *YC11, double *YC12) {
  if (n % 2 != 0)
    n--;
  double *f = (double *)malloc(sizeof(double) * (n + 1));
  if (f == NULL) {
    fprintf(stderr, "twobody_YC_lub"
                    " : malloc error for "
                    "f"
                    "\n");
    exit(1);
  };
  twobody_YC(n, l, f);
  *YC11 = 0.0;
  *YC12 = 0.0;
  double l1 = 1.0 + l;
  double l14 = l1 * l1 * l1 * l1;
  double g2, g3, g4, g5;
  g2 = 0.4 * l / l1;
  g3 = 0.008 * (8.0 + l * (6.0 + l * 33.0)) / l1;
  g4 = 0.8 * l * l / l14;
  g5 = 0.016 * l * (43.0 + l * (-24.0 + l * 43.0)) / l14;
  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);
  *YC11 = -g2 * ls1 - g3 * s1 * ls1 + f[0];
  *YC12 = g4 * ls2 + g5 * s1 * ls2 + 4.0 * g5 / 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 = -2.0 * g2 / (double)m;
      if (m == 2) {
        a += 4.0 * g3 / (double)(-2 * m);
      } else {
        a += 4.0 * g3 / (double)(m * (m - 2));
      }
      *YC11 += f[m] / s1lm + a * s2m;
    } else {
      a = -2.0 * g4 / (double)m + 4.0 * g5 / (double)(m * (m - 2));
      *YC12 += f[m] / s1lm + a * s2m;
    }
    s1lm *= s1l;
    s2m *= s21;
  }
  *YC12 *= 8.0 / l1 / l1 / l1;
  free(f);
}


x86 assembly (clang, -O0):
<twobody_YC_lub>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%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_YC_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_YC_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_YC@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
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe20(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xdef(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xdeb(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xdcb(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xdb7(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd99(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd75(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xd4e(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd4a(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd32(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xd10(%rip),%xmm1
divsd  -0x18(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xcf6(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xcdd(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xccb(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xcaf(%rip),%xmm0
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xc9b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc87(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x50(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  -0x90(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x58(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x60(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xbcb(%rip),%xmm1
mulsd  -0x60(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  0xba0(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xb6f(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movl   $0x1,-0xc4(%rbp)
mov    -0xc4(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1684 <twobody_YC_lub+0x524>
mov    -0xc4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    15b8 <twobody_YC_lub+0x458>
movsd  0xb7a(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0xc4(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
cmpl   $0x2,-0xc4(%rbp)
jne    1540 <twobody_YC_lub+0x3e0>
movsd  0xafc(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
imul   $0xfffffffe,-0xc4(%rbp),%eax
ff ff ff
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
addsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    1577 <twobody_YC_lub+0x417>
movsd  0xac8(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0xc4(%rbp),%eax
mov    -0xc4(%rbp),%ecx
sub    $0x2,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
addsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0xc4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
divsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1640 <twobody_YC_lub+0x4e0>
movsd  0xaa0(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
cvtsi2sdl -0xc4(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  0xa37(%rip),%xmm1
mulsd  -0x60(%rbp),%xmm1
mov    -0xc4(%rbp),%eax
mov    -0xc4(%rbp),%ecx
sub    $0x2,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0xc4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
divsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    14b8 <twobody_YC_lub+0x358>
movsd  0x9b4(%rip),%xmm0
divsd  -0x38(%rbp),%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    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twobody_YC_lub>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x78,%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     150b <twobody_YC_lub+0x3ab>
mov    %rax,%rbx
and    $0xfffffffe,%r12d
mov    %r12d,%edi
movaps 0x10(%rsp),%xmm0
mov    %rax,%rsi
call   1040 <twobody_YC@plt>
movq   $0x0,(%r15)
movq   $0x0,(%r14)
movsd  0xe3b(%rip),%xmm0
movapd 0x10(%rsp),%xmm5
movapd %xmm5,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,0x40(%rsp)
movapd %xmm0,%xmm3
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  0xe1b(%rip),%xmm1
mulsd  %xmm5,%xmm1
movsd  0xe17(%rip),%xmm4
mulsd  %xmm5,%xmm4
addsd  0xe13(%rip),%xmm4
mulsd  %xmm5,%xmm4
addsd  0xe0f(%rip),%xmm4
mulsd  0xe0f(%rip),%xmm4
divsd  %xmm2,%xmm1
movapd %xmm1,0x60(%rsp)
divsd  %xmm2,%xmm4
movsd  %xmm4,0x38(%rsp)
movapd %xmm5,%xmm1
unpcklpd %xmm2,%xmm1
movapd 0xe33(%rip),%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,0x50(%rsp)
movsd  0xdcd(%rip),%xmm1
mulsd  %xmm5,%xmm1
movsd  0xdc9(%rip),%xmm2
movapd %xmm5,%xmm4
mulsd  %xmm2,%xmm4
addsd  0xdc1(%rip),%xmm4
mulsd  %xmm5,%xmm4
addsd  %xmm2,%xmm4
mulsd  %xmm1,%xmm4
divsd  %xmm0,%xmm4
movapd %xmm4,0x10(%rsp)
movsd  0xdab(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
subsd  %xmm0,%xmm3
movsd  %xmm3,0x28(%rsp)
movapd %xmm1,%xmm2
addsd  0xd8f(%rip),%xmm2
movsd  0xd8f(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,0x20(%rsp)
movapd %xmm3,%xmm0
call   1070 <log@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x20(%rsp),%xmm0
call   1070 <log@plt>
movapd 0x10(%rsp),%xmm7
movsd  0x38(%rsp),%xmm10
movapd 0x60(%rsp),%xmm9
movapd 0x40(%rsp),%xmm8
movapd 0xd6c(%rip),%xmm1
xorpd  %xmm9,%xmm1
movsd  0x28(%rsp),%xmm3
movapd %xmm3,%xmm2
mulsd  %xmm10,%xmm2
movsd  0x30(%rsp),%xmm4
mulsd  %xmm4,%xmm2
mulsd  %xmm4,%xmm1
subsd  %xmm2,%xmm1
movapd 0x50(%rsp),%xmm2
addsd  (%rbx),%xmm1
movsd  %xmm1,(%r15)
movapd %xmm3,%xmm1
mulsd  %xmm7,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xce3(%rip),%xmm7
movapd %xmm7,%xmm1
divsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
cmp    $0x2,%r12d
jl     13db <twobody_YC_lub+0x27b>
movapd %xmm8,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcbb(%rip),%xmm6
divsd  %xmm1,%xmm6
addsd  %xmm2,%xmm2
unpcklpd %xmm2,%xmm7
movapd 0xce7(%rip),%xmm1
mulpd  %xmm7,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
subsd  %xmm2,%xmm1
movsd  0x8(%rbx),%xmm2
divsd  %xmm0,%xmm2
mulsd  %xmm6,%xmm1
addsd  %xmm2,%xmm1
addsd  (%r14),%xmm1
movsd  %xmm1,(%r14)
jne    140e <twobody_YC_lub+0x2ae>
movsd  (%r14),%xmm1
movsd  0xc3d(%rip),%xmm0
divsd  %xmm8,%xmm0
divsd  %xmm8,%xmm0
divsd  %xmm8,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
mov    %rbx,%rdi
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>
addsd  %xmm9,%xmm9
mulsd  0xc2c(%rip),%xmm10
movsd  0xc3c(%rip),%xmm3
mulsd  %xmm10,%xmm3
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm6,%xmm2
mulsd  %xmm6,%xmm2
movsd  0xc27(%rip),%xmm4
mulsd  %xmm9,%xmm4
addsd  %xmm3,%xmm4
movsd  0x10(%rbx),%xmm3
divsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
addsd  (%r15),%xmm4
mov    %r12d,%eax
movsd  %xmm4,(%r15)
mov    $0x3,%ecx
mov    $0x1,%edx
jmp    14d8 <twobody_YC_lub+0x378>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%esi
imul   %ecx,%esi
xorps  %xmm4,%xmm4
cvtsi2sd %esi,%xmm4
unpcklpd %xmm3,%xmm4
movapd %xmm7,%xmm3
divpd  %xmm4,%xmm3
movapd %xmm3,%xmm4
unpckhpd %xmm3,%xmm4
subsd  %xmm4,%xmm3
mov    %r14,%rsi
mulsd  %xmm0,%xmm1
mulsd  %xmm6,%xmm2
movsd  (%rbx,%rcx,8),%xmm4
divsd  %xmm1,%xmm4
mulsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
addsd  (%rsi),%xmm3
movsd  %xmm3,(%rsi)
add    $0x1,%rcx
add    $0x1,%edx
cmp    %rcx,%rax
je     13d6 <twobody_YC_lub+0x276>
xorps  %xmm3,%xmm3
cvtsi2sd %ecx,%xmm3
test   $0x1,%cl
jne    1480 <twobody_YC_lub+0x320>
movapd %xmm9,%xmm4
divsd  %xmm3,%xmm4
mov    %edx,%esi
imul   %ecx,%esi
xorps  %xmm5,%xmm5
cvtsi2sd %esi,%xmm5
movapd %xmm10,%xmm3
divsd  %xmm5,%xmm3
subsd  %xmm4,%xmm3
mov    %r15,%rsi
jmp    14a7 <twobody_YC_lub+0x347>
mov    0x2ace(%rip),%rax
mov    (%rax),%edi
lea    0xb85(%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_YC_lub : malloc error for f\0A\00"
define void @twobody_YC_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 double
%30 = 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
%31 = load i32, i32* %6
%32 = srem i32 %31, 2
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %5
%35 = load i32, i32* %6
%36 = add nsw i32 %35, -1
store i32 %36, i32* %6
br label %37
37: ; preds = %34, %5
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = mul i64 8, %40
%42 = trunc i64 %41 to i32
%43 = call i64 @malloc(i32 %42)
%44 = inttoptr i64 %43 to double*
store double* %44, double** %11
%45 = load double*, double** %11
%46 = icmp eq double* %45, null
br i1 %46, label %47, label %51
47: ; preds = %37
%48 = load i32, i32* @stderr
%49 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%50 = call i32 @exit(i32 1)
unreachable
51: ; preds = %37
%52 = load i32, i32* %6
%53 = load double, double* %7
%54 = load double*, double** %11
%55 = call i32 @twobody_YC(i32 %52, double %53, double* %54)
%56 = load double*, double** %9
store double 0.000000e+00, double* %56
%57 = load double*, double** %10
store double 0.000000e+00, double* %57
%58 = load double, double* %7
%59 = fadd double 1.000000e+00, %58
store double %59, double* %12
%60 = load double, double* %12
%61 = load double, double* %12
%62 = fmul double %60, %61
%63 = load double, double* %12
%64 = fmul double %62, %63
%65 = load double, double* %12
%66 = fmul double %64, %65
store double %66, double* %13
%67 = load double, double* %7
%68 = fmul double 4.000000e-01, %67
%69 = load double, double* %12
%70 = fdiv double %68, %69
store double %70, double* %14
%71 = load double, double* %7
%72 = load double, double* %7
%73 = call double @llvm.fmuladd.f64(double %72, double 3.300000e+01, double 6.000000e+00)
%74 = call double @llvm.fmuladd.f64(double %71, double %73, double 8.000000e+00)
%75 = fmul double 8.000000e-03, %74
%76 = load double, double* %12
%77 = fdiv double %75, %76
store double %77, double* %15
%78 = load double, double* %7
%79 = fmul double 8.000000e-01, %78
%80 = load double, double* %7
%81 = fmul double %79, %80
%82 = load double, double* %13
%83 = fdiv double %81, %82
store double %83, double* %16
%84 = load double, double* %7
%85 = fmul double 1.600000e-02, %84
%86 = load double, double* %7
%87 = load double, double* %7
%88 = call double @llvm.fmuladd.f64(double %87, double 4.300000e+01, double -2.400000e+01)
%89 = call double @llvm.fmuladd.f64(double %86, double %88, double 4.300000e+01)
%90 = fmul double %85, %89
%91 = load double, double* %13
%92 = fdiv double %90, %91
store double %92, double* %17
%93 = load double, double* %8
%94 = fdiv double 4.000000e+00, %93
%95 = load double, double* %8
%96 = fdiv double %94, %95
%97 = fsub double 1.000000e+00, %96
store double %97, double* %18
%98 = load double, double* %8
%99 = fadd double %98, 2.000000e+00
%100 = load double, double* %8
%101 = fsub double %100, 2.000000e+00
%102 = fdiv double %99, %101
store double %102, double* %19
%103 = load double, double* %8
%104 = load double, double* %8
%105 = fmul double %103, %104
store double %105, double* %20
%106 = load double, double* %20
%107 = fdiv double 1.000000e+00, %106
store double %107, double* %21
%108 = load double, double* %8
%109 = load double, double* %8
%110 = fmul double %108, %109
%111 = fdiv double %110, 4.000000e+00
%112 = fsub double %111, 1.000000e+00
store double %112, double* %22
%113 = load double, double* %18
%114 = call double @log(double %113)
store double %114, double* %23
%115 = load double, double* %19
%116 = call double @log(double %115)
store double %116, double* %24
%117 = load double, double* %14
%118 = fneg double %117
%119 = load double, double* %23
%120 = load double, double* %15
%121 = load double, double* %18
%122 = fmul double %120, %121
%123 = load double, double* %23
%124 = fmul double %122, %123
%125 = fneg double %124
%126 = call double @llvm.fmuladd.f64(double %118, double %119, double %125)
%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** %9
store double %130, double* %131
%132 = load double, double* %16
%133 = load double, double* %24
%134 = load double, double* %17
%135 = load double, double* %18
%136 = fmul double %134, %135
%137 = load double, double* %24
%138 = fmul double %136, %137
%139 = call double @llvm.fmuladd.f64(double %132, double %133, double %138)
%140 = load double, double* %17
%141 = fmul double 4.000000e+00, %140
%142 = load double, double* %8
%143 = fdiv double %141, %142
%144 = fadd double %139, %143
%145 = load double*, double** %10
store double %144, double* %145
%146 = load double, double* %8
%147 = load double, double* %7
%148 = fadd double 1.000000e+00, %147
%149 = fmul double %146, %148
store double %149, double* %25
%150 = load double, double* %25
store double %150, double* %26
%151 = load double, double* %8
%152 = fdiv double 2.000000e+00, %151
store double %152, double* %27
%153 = load double, double* %27
store double %153, double* %28
store i32 1, i32* %30
br label %154
154: ; preds = %239, %51
%155 = load i32, i32* %30
%156 = load i32, i32* %6
%157 = icmp slt i32 %155, %156
br i1 %157, label %158, label %242
158: ; preds = %154
%159 = load i32, i32* %30
%160 = srem i32 %159, 2
%161 = icmp eq i32 %160, 0
br i1 %161, label %162, label %204
162: ; preds = %158
%163 = load double, double* %14
%164 = fmul double -2.000000e+00, %163
%165 = load i32, i32* %30
%166 = sitofp i32 %165 to double
%167 = fdiv double %164, %166
store double %167, double* %29
%168 = load i32, i32* %30
%169 = icmp eq i32 %168, 2
br i1 %169, label %170, label %179
170: ; preds = %162
%171 = load double, double* %15
%172 = fmul double 4.000000e+00, %171
%173 = load i32, i32* %30
%174 = mul nsw i32 -2, %173
%175 = sitofp i32 %174 to double
%176 = fdiv double %172, %175
%177 = load double, double* %29
%178 = fadd double %177, %176
store double %178, double* %29
br label %190
179: ; preds = %162
%180 = load double, double* %15
%181 = fmul double 4.000000e+00, %180
%182 = load i32, i32* %30
%183 = load i32, i32* %30
%184 = sub nsw i32 %183, 2
%185 = mul nsw i32 %182, %184
%186 = sitofp i32 %185 to double
%187 = fdiv double %181, %186
%188 = load double, double* %29
%189 = fadd double %188, %187
store double %189, double* %29
br label %190
190: ; preds = %179, %170
%191 = load double*, double** %11
%192 = load i32, i32* %30
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds double, double* %191, i64 %193
%195 = load double, double* %194
%196 = load double, double* %26
%197 = fdiv double %195, %196
%198 = load double, double* %29
%199 = load double, double* %28
%200 = call double @llvm.fmuladd.f64(double %198, double %199, double %197)
%201 = load double*, double** %9
%202 = load double, double* %201
%203 = fadd double %202, %200
store double %203, double* %201
br label %232
204: ; preds = %158
%205 = load double, double* %16
%206 = fmul double -2.000000e+00, %205
%207 = load i32, i32* %30
%208 = sitofp i32 %207 to double
%209 = fdiv double %206, %208
%210 = load double, double* %17
%211 = fmul double 4.000000e+00, %210
%212 = load i32, i32* %30
%213 = load i32, i32* %30
%214 = sub nsw i32 %213, 2
%215 = mul nsw i32 %212, %214
%216 = sitofp i32 %215 to double
%217 = fdiv double %211, %216
%218 = fadd double %209, %217
store double %218, double* %29
%219 = load double*, double** %11
%220 = load i32, i32* %30
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds double, double* %219, i64 %221
%223 = load double, double* %222
%224 = load double, double* %26
%225 = fdiv double %223, %224
%226 = load double, double* %29
%227 = load double, double* %28
%228 = call double @llvm.fmuladd.f64(double %226, double %227, double %225)
%229 = load double*, double** %10
%230 = load double, double* %229
%231 = fadd double %230, %228
store double %231, double* %229
br label %232
232: ; preds = %204, %190
%233 = load double, double* %25
%234 = load double, double* %26
%235 = fmul double %234, %233
store double %235, double* %26
%236 = load double, double* %27
%237 = load double, double* %28
%238 = fmul double %237, %236
store double %238, double* %28
br label %239
239: ; preds = %232
%240 = load i32, i32* %30
%241 = add nsw i32 %240, 1
store i32 %241, i32* %30
br label %154
242: ; preds = %154
%243 = load double, double* %12
%244 = fdiv double 8.000000e+00, %243
%245 = load double, double* %12
%246 = fdiv double %244, %245
%247 = load double, double* %12
%248 = fdiv double %246, %247
%249 = load double*, double** %10
%250 = load double, double* %249
%251 = fmul double %250, %248
store double %251, double* %249
%252 = load double*, double** %11
%253 = call i32 @free(double* %252)
ret void
}

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