#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_YB(int, double, double *);
void twobody_YB_lub(int n, double l, double s, double *YB11, double *YB12) {
  if (n % 2 != 0)
    n--;
  double *f = (double *)malloc(sizeof(double) * (n + 1));
  if (f == NULL) {
    fprintf(stderr, "twobody_YB_lub"
                    " : malloc error for "
                    "f"
                    "\n");
    exit(1);
  };
  twobody_YB(n, l, f);
  *YB11 = 0.0;
  *YB12 = 0.0;
  double l1 = 1.0 + l;
  double l12 = l1 * l1;
  double g2, g3;
  g2 = -0.2 * l * (4.0 + l) / l12;
  g3 = -0.004 * (32.0 + l * (-33.0 + l * (83.0 + l * 43.0))) / l12;
  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);
  *YB11 = g2 * ls2 + g3 * s1 * ls2 + 4.0 * g3 / s;
  *YB12 = -g2 * ls1 - g3 * s1 * ls1;
  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));
      }
      *YB12 += f[m] / s1lm + a * s2m;
    } else {
      a = -2.0 * g2 / (double)m + 4.0 * g3 / (double)(m * (m - 2));
      *YB11 += f[m] / s1lm + a * s2m;
    }
    s1lm *= s1l;
    s2m *= s21;
  }
  *YB12 *= -4.0 / l12;
  free(f);
}


x86 assembly (clang, -O0):
<twobody_YB_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_YB_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   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11de <twobody_YB_lub+0x7e>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x30(%rbp),%rsi
call   1070 <twobody_YB@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
movsd  %xmm0,-0x40(%rbp)
movsd  0xe12(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xdd5(%rip),%xmm1
addsd  -0x10(%rbp),%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  0xdcb(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xdc7(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
movsd  0xda7(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd8f(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd7b(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd5d(%rip),%xmm1
divsd  -0x18(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xd43(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd2a(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xd18(%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  0xcfc(%rip),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xce8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcd4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x50(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xc83(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
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  -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    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  0xc01(%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  0xbd0(%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    1623 <twobody_YB_lub+0x4c3>
mov    -0xb4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1557 <twobody_YB_lub+0x3f7>
movsd  0xbcb(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0xb4(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
cmpl   $0x2,-0xb4(%rbp)
jne    14df <twobody_YB_lub+0x37f>
movsd  0xb5d(%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    1516 <twobody_YB_lub+0x3b6>
movsd  0xb29(%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    -0x28(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    15df <twobody_YB_lub+0x47f>
movsd  0xaf1(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0xb4(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  0xa98(%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    -0x20(%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    1457 <twobody_YB_lub+0x2f7>
movsd  0xa1d(%rip),%xmm0
divsd  -0x40(%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_YB_lub>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    %edi,%r12d
lea    0x0(,%r12,8),%edi
or     $0x8,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1446 <twobody_YB_lub+0x2e6>
mov    %rax,%rbx
and    $0xfffffffe,%r12d
mov    %r12d,%edi
movsd  (%rsp),%xmm0
mov    %rax,%rsi
call   1070 <twobody_YB@plt>
movsd  0xe49(%rip),%xmm0
movsd  (%rsp),%xmm6
movapd %xmm6,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm0,%xmm3
movsd  %xmm1,0x10(%rsp)
mulsd  %xmm1,%xmm1
movsd  0xe2e(%rip),%xmm0
mulsd  %xmm6,%xmm0
movsd  0xe2a(%rip),%xmm2
movapd %xmm6,%xmm4
movsd  0xe26(%rip),%xmm5
mulsd  %xmm6,%xmm5
addsd  0xe22(%rip),%xmm5
addsd  %xmm2,%xmm4
mulsd  %xmm6,%xmm5
addsd  0xe1a(%rip),%xmm5
mulsd  %xmm0,%xmm4
mulsd  %xmm6,%xmm5
addsd  0xe12(%rip),%xmm5
divsd  %xmm1,%xmm4
movapd %xmm4,0x40(%rsp)
mulsd  0xe08(%rip),%xmm5
movsd  %xmm1,(%rsp)
divsd  %xmm1,%xmm5
movapd %xmm5,0x30(%rsp)
movapd %xmm2,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
subsd  %xmm0,%xmm3
movsd  %xmm3,0x28(%rsp)
movapd %xmm1,%xmm2
addsd  0xdd9(%rip),%xmm2
movsd  0xdd9(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
movapd %xmm3,%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <log@plt>
movapd 0x30(%rsp),%xmm7
movapd 0x40(%rsp),%xmm6
movsd  0x28(%rsp),%xmm2
mulsd  %xmm7,%xmm2
movsd  0x20(%rsp),%xmm3
movapd %xmm3,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm2
mulsd  %xmm6,%xmm0
addsd  %xmm2,%xmm0
mulsd  0xd41(%rip),%xmm7
movapd %xmm7,%xmm2
divsd  0x8(%rsp),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%r14)
movapd 0xd86(%rip),%xmm0
xorpd  %xmm6,%xmm0
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%r15)
cmp    $0x2,%r12d
jl     1356 <twobody_YB_lub+0x1f6>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm8
mulsd  %xmm0,%xmm8
movsd  0xd25(%rip),%xmm5
divsd  %xmm0,%xmm5
addsd  %xmm6,%xmm6
movapd 0xd45(%rip),%xmm0
xorpd  %xmm7,%xmm0
subsd  %xmm6,%xmm0
movsd  0x8(%rbx),%xmm1
divsd  %xmm8,%xmm1
mulsd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
addsd  (%r14),%xmm0
movsd  %xmm0,(%r14)
jne    137f <twobody_YB_lub+0x21f>
movsd  (%r15),%xmm0
movsd  0xd02(%rip),%xmm1
divsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r15)
mov    %rbx,%rdi
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>
movsd  0xcc9(%rip),%xmm2
mulsd  %xmm7,%xmm2
movapd %xmm8,%xmm0
mulsd  %xmm8,%xmm0
movapd %xmm5,%xmm1
mulsd  %xmm5,%xmm1
movsd  0xcb3(%rip),%xmm3
mulsd  %xmm6,%xmm3
addsd  %xmm2,%xmm3
movsd  0x10(%rbx),%xmm2
divsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
addsd  (%r15),%xmm3
mov    %r12d,%eax
movsd  %xmm3,(%r15)
mov    $0x3,%ecx
mov    $0x1,%edx
jmp    1428 <twobody_YB_lub+0x2c8>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rsi
mulsd  %xmm8,%xmm0
mulsd  %xmm5,%xmm1
xorps  %xmm3,%xmm3
cvtsi2sd %ecx,%xmm3
movapd %xmm6,%xmm4
divsd  %xmm3,%xmm4
subsd  %xmm4,%xmm2
movsd  (%rbx,%rcx,8),%xmm3
divsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
addsd  (%rsi),%xmm2
movsd  %xmm2,(%rsi)
add    $0x1,%rcx
add    $0x1,%edx
cmp    %rcx,%rax
je     1351 <twobody_YB_lub+0x1f1>
mov    %edx,%esi
imul   %ecx,%esi
xorps  %xmm3,%xmm3
cvtsi2sd %esi,%xmm3
movapd %xmm7,%xmm2
divsd  %xmm3,%xmm2
test   $0x1,%cl
jne    13e0 <twobody_YB_lub+0x280>
mov    %r15,%rsi
jmp    13e3 <twobody_YB_lub+0x283>
mov    0x2b93(%rip),%rax
mov    (%rax),%edi
lea    0xc2a(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"twobody_YB_lub : malloc error for f\0A\00"
define void @twobody_YB_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_YB(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
store double %60, double* %13
%61 = load double, double* %7
%62 = fmul double -2.000000e-01, %61
%63 = load double, double* %7
%64 = fadd double 4.000000e+00, %63
%65 = fmul double %62, %64
%66 = load double, double* %13
%67 = fdiv double %65, %66
store double %67, double* %14
%68 = load double, double* %7
%69 = load double, double* %7
%70 = load double, double* %7
%71 = call double @llvm.fmuladd.f64(double %70, double 4.300000e+01, double 8.300000e+01)
%72 = call double @llvm.fmuladd.f64(double %69, double %71, double -3.300000e+01)
%73 = call double @llvm.fmuladd.f64(double %68, double %72, double 3.200000e+01)
%74 = fmul double -4.000000e-03, %73
%75 = load double, double* %13
%76 = fdiv double %74, %75
store double %76, double* %15
%77 = load double, double* %8
%78 = fdiv double 4.000000e+00, %77
%79 = load double, double* %8
%80 = fdiv double %78, %79
%81 = fsub double 1.000000e+00, %80
store double %81, double* %16
%82 = load double, double* %8
%83 = fadd double %82, 2.000000e+00
%84 = load double, double* %8
%85 = fsub double %84, 2.000000e+00
%86 = fdiv double %83, %85
store double %86, double* %17
%87 = load double, double* %8
%88 = load double, double* %8
%89 = fmul double %87, %88
store double %89, double* %18
%90 = load double, double* %18
%91 = fdiv double 1.000000e+00, %90
store double %91, double* %19
%92 = load double, double* %8
%93 = load double, double* %8
%94 = fmul double %92, %93
%95 = fdiv double %94, 4.000000e+00
%96 = fsub double %95, 1.000000e+00
store double %96, double* %20
%97 = load double, double* %16
%98 = call double @log(double %97)
store double %98, double* %21
%99 = load double, double* %17
%100 = call double @log(double %99)
store double %100, double* %22
%101 = load double, double* %14
%102 = load double, double* %22
%103 = load double, double* %15
%104 = load double, double* %16
%105 = fmul double %103, %104
%106 = load double, double* %22
%107 = fmul double %105, %106
%108 = call double @llvm.fmuladd.f64(double %101, double %102, double %107)
%109 = load double, double* %15
%110 = fmul double 4.000000e+00, %109
%111 = load double, double* %8
%112 = fdiv double %110, %111
%113 = fadd double %108, %112
%114 = load double*, double** %9
store double %113, double* %114
%115 = load double, double* %14
%116 = fneg double %115
%117 = load double, double* %21
%118 = load double, double* %15
%119 = load double, double* %16
%120 = fmul double %118, %119
%121 = load double, double* %21
%122 = fmul double %120, %121
%123 = fneg double %122
%124 = call double @llvm.fmuladd.f64(double %116, double %117, double %123)
%125 = load double*, double** %10
store double %124, double* %125
%126 = load double, double* %8
%127 = load double, double* %7
%128 = fadd double 1.000000e+00, %127
%129 = fmul double %126, %128
store double %129, double* %23
%130 = load double, double* %23
store double %130, double* %24
%131 = load double, double* %8
%132 = fdiv double 2.000000e+00, %131
store double %132, double* %25
%133 = load double, double* %25
store double %133, double* %26
store i32 1, i32* %28
br label %134
134: ; preds = %219, %49
%135 = load i32, i32* %28
%136 = load i32, i32* %6
%137 = icmp slt i32 %135, %136
br i1 %137, label %138, label %222
138: ; preds = %134
%139 = load i32, i32* %28
%140 = srem i32 %139, 2
%141 = icmp eq i32 %140, 0
br i1 %141, label %142, label %184
142: ; preds = %138
%143 = load double, double* %14
%144 = fmul double -2.000000e+00, %143
%145 = load i32, i32* %28
%146 = sitofp i32 %145 to double
%147 = fdiv double %144, %146
store double %147, double* %27
%148 = load i32, i32* %28
%149 = icmp eq i32 %148, 2
br i1 %149, label %150, label %159
150: ; preds = %142
%151 = load double, double* %15
%152 = fmul double 4.000000e+00, %151
%153 = load i32, i32* %28
%154 = mul nsw i32 -2, %153
%155 = sitofp i32 %154 to double
%156 = fdiv double %152, %155
%157 = load double, double* %27
%158 = fadd double %157, %156
store double %158, double* %27
br label %170
159: ; preds = %142
%160 = load double, double* %15
%161 = fmul double 4.000000e+00, %160
%162 = load i32, i32* %28
%163 = load i32, i32* %28
%164 = sub nsw i32 %163, 2
%165 = mul nsw i32 %162, %164
%166 = sitofp i32 %165 to double
%167 = fdiv double %161, %166
%168 = load double, double* %27
%169 = fadd double %168, %167
store double %169, double* %27
br label %170
170: ; preds = %159, %150
%171 = load double*, double** %11
%172 = load i32, i32* %28
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds double, double* %171, i64 %173
%175 = load double, double* %174
%176 = load double, double* %24
%177 = fdiv double %175, %176
%178 = load double, double* %27
%179 = load double, double* %26
%180 = call double @llvm.fmuladd.f64(double %178, double %179, double %177)
%181 = load double*, double** %10
%182 = load double, double* %181
%183 = fadd double %182, %180
store double %183, double* %181
br label %212
184: ; preds = %138
%185 = load double, double* %14
%186 = fmul double -2.000000e+00, %185
%187 = load i32, i32* %28
%188 = sitofp i32 %187 to double
%189 = fdiv double %186, %188
%190 = load double, double* %15
%191 = fmul double 4.000000e+00, %190
%192 = load i32, i32* %28
%193 = load i32, i32* %28
%194 = sub nsw i32 %193, 2
%195 = mul nsw i32 %192, %194
%196 = sitofp i32 %195 to double
%197 = fdiv double %191, %196
%198 = fadd double %189, %197
store double %198, double* %27
%199 = load double*, double** %11
%200 = load i32, i32* %28
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %199, i64 %201
%203 = load double, double* %202
%204 = load double, double* %24
%205 = fdiv double %203, %204
%206 = load double, double* %27
%207 = load double, double* %26
%208 = call double @llvm.fmuladd.f64(double %206, double %207, double %205)
%209 = load double*, double** %9
%210 = load double, double* %209
%211 = fadd double %210, %208
store double %211, double* %209
br label %212
212: ; preds = %184, %170
%213 = load double, double* %23
%214 = load double, double* %24
%215 = fmul double %214, %213
store double %215, double* %24
%216 = load double, double* %25
%217 = load double, double* %26
%218 = fmul double %217, %216
store double %218, double* %26
br label %219
219: ; preds = %212
%220 = load i32, i32* %28
%221 = add nsw i32 %220, 1
store i32 %221, i32* %28
br label %134
222: ; preds = %134
%223 = load double, double* %13
%224 = fdiv double -4.000000e+00, %223
%225 = load double*, double** %10
%226 = load double, double* %225
%227 = fmul double %226, %224
store double %227, double* %225
%228 = load double*, double** %11
%229 = call i32 @free(double* %228)
ret void
}

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