#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_YA(int, double, double *);
void twobody_YA_lub(int n, double l, double s, double *YA11, double *YA12) {
  if (n % 2 != 0)
    n--;
  double *f = (double *)malloc(sizeof(double) * (n + 1));
  if (f == NULL) {
    fprintf(stderr, "twobody_YA_lub"
                    " : malloc error for "
                    "f"
                    "\n");
    exit(1);
  };
  twobody_YA(n, l, f);
  *YA11 = 0.0;
  *YA12 = 0.0;
  double l1 = 1.0 + l;
  double l13 = l1 * l1 * l1;
  double g2, g3;
  g2 = (4.0 / 15.0) * l * (2.0 + l * (1.0 + l * 2.0)) / l13;
  g3 = (2.0 / 375.0) *
       (16.0 + l * (-45.0 + l * (58.0 + l * (-45.0 + l * 16.0)))) / l13;
  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);
  *YA11 = -g2 * ls1 - g3 * s1 * ls1 + f[0];
  *YA12 = 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 = -2.0 * g2 / (double)m;
      if (m == 2) {
        a += 4.0 * g3 / (double)(-2 * m);
      } else {
        a += 4.0 * g3 / (double)(m * (m - 2));
      }
      *YA11 += f[m] / s1lm + a * s2m;
    } else {
      a = -2.0 * g2 / (double)m + 4.0 * g3 / (double)(m * (m - 2));
      *YA12 += f[m] / s1lm + a * s2m;
    }
    s1lm *= s1l;
    s2m *= s21;
  }
  *YA12 *= -2.0 / l1;
  free(f);
}


x86 assembly (clang, -O0):
<twobody_YA_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_YA_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_YA_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_YA@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  0xe05(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
addsd  %xmm2,%xmm2
movsd  0xdba(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xda2(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movsd  0xd94(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd90(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd88(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
movsd  0xd70(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd58(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd44(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd26(%rip),%xmm1
divsd  -0x18(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xd0c(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xcf3(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xce1(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xcc5(%rip),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xcb1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc9d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
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  -0x48(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xbed(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  0xbc2(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xb91(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movl   $0x1,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1662 <twobody_YA_lub+0x502>
mov    -0xb4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1596 <twobody_YA_lub+0x436>
movsd  0xb7c(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0xb4(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
cmpl   $0x2,-0xb4(%rbp)
jne    151e <twobody_YA_lub+0x3be>
movsd  0xb1e(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
imul   $0xfffffffe,-0xb4(%rbp),%eax
ff ff ff
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
addsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
jmp    1555 <twobody_YA_lub+0x3f5>
movsd  0xaea(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0xb4(%rbp),%eax
mov    -0xb4(%rbp),%ecx
sub    $0x2,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
addsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0xb4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
divsd  -0x98(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    161e <twobody_YA_lub+0x4be>
movsd  0xaa2(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0xb4(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  0xa59(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
mov    -0xb4(%rbp),%eax
mov    -0xb4(%rbp),%ecx
sub    $0x2,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0xb4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
divsd  -0x98(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1496 <twobody_YA_lub+0x336>
movsd  0x9d6(%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_YA_lub>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %edi,%r12d
lea    0x0(,%r12,8),%edi
or     $0x8,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1476 <twobody_YA_lub+0x316>
mov    %rax,%rbx
and    $0xfffffffe,%r12d
mov    %r12d,%edi
movsd  0x10(%rsp),%xmm0
mov    %rax,%rsi
call   1040 <twobody_YA@plt>
movq   $0x0,(%r14)
movq   $0x0,(%r15)
movsd  0xe39(%rip),%xmm4
movsd  0x10(%rsp),%xmm6
movapd %xmm6,%xmm1
addsd  %xmm4,%xmm1
movsd  %xmm1,0x38(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe19(%rip),%xmm1
mulsd  %xmm6,%xmm1
movapd %xmm6,%xmm2
addsd  %xmm6,%xmm2
addsd  %xmm4,%xmm2
mulsd  %xmm6,%xmm2
movsd  0xe05(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm5
movsd  0xdf9(%rip),%xmm1
movapd %xmm6,%xmm7
mulsd  %xmm1,%xmm7
movsd  0xdf1(%rip),%xmm2
addsd  %xmm2,%xmm7
mulsd  %xmm6,%xmm7
addsd  0xde9(%rip),%xmm7
divsd  %xmm0,%xmm5
movapd %xmm5,0x40(%rsp)
mulsd  %xmm6,%xmm7
addsd  %xmm2,%xmm7
mulsd  %xmm6,%xmm7
addsd  %xmm1,%xmm7
mulsd  0xdcf(%rip),%xmm7
divsd  %xmm0,%xmm7
movapd %xmm7,0x10(%rsp)
movsd  0xdc5(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm4,%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x30(%rsp)
movapd %xmm2,%xmm4
addsd  %xmm3,%xmm4
movsd  0xda1(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm4
movsd  %xmm4,0x20(%rsp)
call   1070 <log@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x20(%rsp),%xmm0
call   1070 <log@plt>
movapd 0x10(%rsp),%xmm7
movapd 0x40(%rsp),%xmm9
movsd  0x38(%rsp),%xmm8
movapd 0xd81(%rip),%xmm1
xorpd  %xmm9,%xmm1
movsd  0x30(%rsp),%xmm2
mulsd  %xmm7,%xmm2
movsd  0x28(%rsp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm3
subsd  %xmm3,%xmm1
addsd  (%rbx),%xmm1
movsd  %xmm1,(%r14)
mulsd  %xmm0,%xmm2
mulsd  %xmm9,%xmm0
addsd  %xmm2,%xmm0
mulsd  0xd1a(%rip),%xmm7
movapd %xmm7,%xmm1
divsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r15)
cmp    $0x2,%r12d
jl     138a <twobody_YA_lub+0x22a>
movapd %xmm8,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcc2(%rip),%xmm6
divsd  %xmm1,%xmm6
addsd  %xmm9,%xmm9
movapd 0xd01(%rip),%xmm1
xorpd  %xmm7,%xmm1
subsd  %xmm9,%xmm1
movsd  0x8(%rbx),%xmm2
divsd  %xmm0,%xmm2
mulsd  %xmm6,%xmm1
addsd  %xmm2,%xmm1
addsd  (%r15),%xmm1
movsd  %xmm1,(%r15)
jne    13b3 <twobody_YA_lub+0x253>
movsd  (%r15),%xmm1
movsd  0xcae(%rip),%xmm0
divsd  %xmm8,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%r15)
mov    %rbx,%rdi
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>
movsd  0xc8d(%rip),%xmm3
mulsd  %xmm7,%xmm3
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm6,%xmm2
mulsd  %xmm6,%xmm2
movsd  0xc79(%rip),%xmm4
mulsd  %xmm9,%xmm4
addsd  %xmm3,%xmm4
movsd  0x10(%rbx),%xmm3
divsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
addsd  (%r14),%xmm4
mov    %r12d,%eax
movsd  %xmm4,(%r14)
mov    $0x3,%ecx
mov    $0x1,%edx
jmp    1458 <twobody_YA_lub+0x2f8>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rsi
mulsd  %xmm0,%xmm1
mulsd  %xmm6,%xmm2
xorps  %xmm4,%xmm4
cvtsi2sd %ecx,%xmm4
movapd %xmm9,%xmm5
divsd  %xmm4,%xmm5
subsd  %xmm5,%xmm3
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     1385 <twobody_YA_lub+0x225>
mov    %edx,%esi
imul   %ecx,%esi
xorps  %xmm4,%xmm4
cvtsi2sd %esi,%xmm4
movapd %xmm7,%xmm3
divsd  %xmm4,%xmm3
test   $0x1,%cl
jne    1410 <twobody_YA_lub+0x2b0>
mov    %r14,%rsi
jmp    1413 <twobody_YA_lub+0x2b3>
mov    0x2b63(%rip),%rax
mov    (%rax),%edi
lea    0xbea(%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_YA_lub : malloc error for f\0A\00"
define void @twobody_YA_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 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
%29 = load i32, i32* %6
%30 = srem i32 %29, 2
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %5
%33 = load i32, i32* %6
%34 = add nsw i32 %33, -1
store i32 %34, i32* %6
br label %35
35: ; preds = %32, %5
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = mul i64 8, %38
%40 = trunc i64 %39 to i32
%41 = call i64 @malloc(i32 %40)
%42 = inttoptr i64 %41 to double*
store double* %42, double** %11
%43 = load double*, double** %11
%44 = icmp eq double* %43, null
br i1 %44, label %45, label %49
45: ; preds = %35
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %35
%50 = load i32, i32* %6
%51 = load double, double* %7
%52 = load double*, double** %11
%53 = call i32 @twobody_YA(i32 %50, double %51, double* %52)
%54 = load double*, double** %9
store double 0.000000e+00, double* %54
%55 = load double*, double** %10
store double 0.000000e+00, double* %55
%56 = load double, double* %7
%57 = fadd double 1.000000e+00, %56
store double %57, double* %12
%58 = load double, double* %12
%59 = load double, double* %12
%60 = fmul double %58, %59
%61 = load double, double* %12
%62 = fmul double %60, %61
store double %62, double* %13
%63 = load double, double* %7
%64 = fmul double 0x3FD1111111111111, %63
%65 = load double, double* %7
%66 = load double, double* %7
%67 = call double @llvm.fmuladd.f64(double %66, double 2.000000e+00, double 1.000000e+00)
%68 = call double @llvm.fmuladd.f64(double %65, double %67, double 2.000000e+00)
%69 = fmul double %64, %68
%70 = load double, double* %13
%71 = fdiv double %69, %70
store double %71, double* %14
%72 = load double, double* %7
%73 = load double, double* %7
%74 = load double, double* %7
%75 = load double, double* %7
%76 = call double @llvm.fmuladd.f64(double %75, double 1.600000e+01, double -4.500000e+01)
%77 = call double @llvm.fmuladd.f64(double %74, double %76, double 5.800000e+01)
%78 = call double @llvm.fmuladd.f64(double %73, double %77, double -4.500000e+01)
%79 = call double @llvm.fmuladd.f64(double %72, double %78, double 1.600000e+01)
%80 = fmul double 0x3F75D867C3ECE2A5, %79
%81 = load double, double* %13
%82 = fdiv double %80, %81
store double %82, double* %15
%83 = load double, double* %8
%84 = fdiv double 4.000000e+00, %83
%85 = load double, double* %8
%86 = fdiv double %84, %85
%87 = fsub double 1.000000e+00, %86
store double %87, double* %16
%88 = load double, double* %8
%89 = fadd double %88, 2.000000e+00
%90 = load double, double* %8
%91 = fsub double %90, 2.000000e+00
%92 = fdiv double %89, %91
store double %92, double* %17
%93 = load double, double* %8
%94 = load double, double* %8
%95 = fmul double %93, %94
store double %95, double* %18
%96 = load double, double* %18
%97 = fdiv double 1.000000e+00, %96
store double %97, double* %19
%98 = load double, double* %8
%99 = load double, double* %8
%100 = fmul double %98, %99
%101 = fdiv double %100, 4.000000e+00
%102 = fsub double %101, 1.000000e+00
store double %102, double* %20
%103 = load double, double* %16
%104 = call double @log(double %103)
store double %104, double* %21
%105 = load double, double* %17
%106 = call double @log(double %105)
store double %106, double* %22
%107 = load double, double* %14
%108 = fneg double %107
%109 = load double, double* %21
%110 = load double, double* %15
%111 = load double, double* %16
%112 = fmul double %110, %111
%113 = load double, double* %21
%114 = fmul double %112, %113
%115 = fneg double %114
%116 = call double @llvm.fmuladd.f64(double %108, double %109, double %115)
%117 = load double*, double** %11
%118 = getelementptr inbounds double, double* %117, i64 0
%119 = load double, double* %118
%120 = fadd double %116, %119
%121 = load double*, double** %9
store double %120, double* %121
%122 = load double, double* %14
%123 = load double, double* %22
%124 = load double, double* %15
%125 = load double, double* %16
%126 = fmul double %124, %125
%127 = load double, double* %22
%128 = fmul double %126, %127
%129 = call double @llvm.fmuladd.f64(double %122, double %123, double %128)
%130 = load double, double* %15
%131 = fmul double 4.000000e+00, %130
%132 = load double, double* %8
%133 = fdiv double %131, %132
%134 = fadd double %129, %133
%135 = load double*, double** %10
store double %134, double* %135
%136 = load double, double* %8
%137 = load double, double* %7
%138 = fadd double 1.000000e+00, %137
%139 = fmul double %136, %138
store double %139, double* %23
%140 = load double, double* %23
store double %140, double* %24
%141 = load double, double* %8
%142 = fdiv double 2.000000e+00, %141
store double %142, double* %25
%143 = load double, double* %25
store double %143, double* %26
store i32 1, i32* %28
br label %144
144: ; preds = %229, %49
%145 = load i32, i32* %28
%146 = load i32, i32* %6
%147 = icmp slt i32 %145, %146
br i1 %147, label %148, label %232
148: ; preds = %144
%149 = load i32, i32* %28
%150 = srem i32 %149, 2
%151 = icmp eq i32 %150, 0
br i1 %151, label %152, label %194
152: ; preds = %148
%153 = load double, double* %14
%154 = fmul double -2.000000e+00, %153
%155 = load i32, i32* %28
%156 = sitofp i32 %155 to double
%157 = fdiv double %154, %156
store double %157, double* %27
%158 = load i32, i32* %28
%159 = icmp eq i32 %158, 2
br i1 %159, label %160, label %169
160: ; preds = %152
%161 = load double, double* %15
%162 = fmul double 4.000000e+00, %161
%163 = load i32, i32* %28
%164 = mul nsw i32 -2, %163
%165 = sitofp i32 %164 to double
%166 = fdiv double %162, %165
%167 = load double, double* %27
%168 = fadd double %167, %166
store double %168, double* %27
br label %180
169: ; preds = %152
%170 = load double, double* %15
%171 = fmul double 4.000000e+00, %170
%172 = load i32, i32* %28
%173 = load i32, i32* %28
%174 = sub nsw i32 %173, 2
%175 = mul nsw i32 %172, %174
%176 = sitofp i32 %175 to double
%177 = fdiv double %171, %176
%178 = load double, double* %27
%179 = fadd double %178, %177
store double %179, double* %27
br label %180
180: ; preds = %169, %160
%181 = load double*, double** %11
%182 = load i32, i32* %28
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds double, double* %181, i64 %183
%185 = load double, double* %184
%186 = load double, double* %24
%187 = fdiv double %185, %186
%188 = load double, double* %27
%189 = load double, double* %26
%190 = call double @llvm.fmuladd.f64(double %188, double %189, double %187)
%191 = load double*, double** %9
%192 = load double, double* %191
%193 = fadd double %192, %190
store double %193, double* %191
br label %222
194: ; preds = %148
%195 = load double, double* %14
%196 = fmul double -2.000000e+00, %195
%197 = load i32, i32* %28
%198 = sitofp i32 %197 to double
%199 = fdiv double %196, %198
%200 = load double, double* %15
%201 = fmul double 4.000000e+00, %200
%202 = load i32, i32* %28
%203 = load i32, i32* %28
%204 = sub nsw i32 %203, 2
%205 = mul nsw i32 %202, %204
%206 = sitofp i32 %205 to double
%207 = fdiv double %201, %206
%208 = fadd double %199, %207
store double %208, double* %27
%209 = load double*, double** %11
%210 = load i32, i32* %28
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds double, double* %209, i64 %211
%213 = load double, double* %212
%214 = load double, double* %24
%215 = fdiv double %213, %214
%216 = load double, double* %27
%217 = load double, double* %26
%218 = call double @llvm.fmuladd.f64(double %216, double %217, double %215)
%219 = load double*, double** %10
%220 = load double, double* %219
%221 = fadd double %220, %218
store double %221, double* %219
br label %222
222: ; preds = %194, %180
%223 = load double, double* %23
%224 = load double, double* %24
%225 = fmul double %224, %223
store double %225, double* %24
%226 = load double, double* %25
%227 = load double, double* %26
%228 = fmul double %227, %226
store double %228, double* %26
br label %229
229: ; preds = %222
%230 = load i32, i32* %28
%231 = add nsw i32 %230, 1
store i32 %231, i32* %28
br label %144
232: ; preds = %144
%233 = load double, double* %12
%234 = fdiv double -2.000000e+00, %233
%235 = load double*, double** %10
%236 = load double, double* %235
%237 = fmul double %236, %234
store double %237, double* %235
%238 = load double*, double** %11
%239 = call i32 @free(double* %238)
ret void
}

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