#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*/ derivs_three(double *, double *, double *, double const *);
void leech_three_rk4(double *y, const double dt, const unsigned N,
                     const unsigned stride, const double *p, const double *kij,
                     double *output) {
  unsigned i, j, k;
  double dt2, dt6;
  double y1[9], y2[9], k1[9], k2[9], k3[9], k4[9], P[12];
  dt2 = dt / 2.;
  dt6 = dt / 6.;
  for (j = 0; j < 12; j++)
    P[j] = p[j + 1];
  for (j = 0; j < 3; j++)
    output[j] = y[3 * j];
  for (i = 1; i < N; i++) {
    for (j = 0; j < stride; j++) {
      derivs_three(y, k1, P, kij);
      for (k = 0; k < 9; k++)
        y1[k] = y[k] + k1[k] * dt2;
      derivs_three(y1, k2, P, kij);
      for (k = 0; k < 9; k++)
        y2[k] = y[k] + k2[k] * dt2;
      derivs_three(y2, k3, P, kij);
      for (k = 0; k < 9; k++)
        y2[k] = y[k] + k3[k] * dt;
      derivs_three(y2, k4, P, kij);
      for (k = 0; k < 9; k++)
        y[k] += dt6 * (k1[k] + 2. * (k2[k] + k3[k]) + k4[k]);
    }
    for (j = 0; j < 3; j++)
      output[3 * i + j] = y[3 * j];
  }
}


x86 assembly (clang, -O0):
<leech_three_rk4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0xc,-0x38(%rbp)
jae    119e <leech_three_rk4+0x8e>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%eax
movsd  %xmm0,-0x290(%rbp,%rax,8)
ff ff
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1169 <leech_three_rk4+0x59>
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x38(%rbp)
jae    11d8 <leech_three_rk4+0xc8>
mov    -0x8(%rbp),%rax
imul   $0x3,-0x38(%rbp),%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11a5 <leech_three_rk4+0x95>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    143e <leech_three_rk4+0x32e>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    13eb <leech_three_rk4+0x2db>
mov    -0x8(%rbp),%rdi
lea    -0x140(%rbp),%rsi
lea    -0x290(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <derivs_three@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x9,-0x3c(%rbp)
jae    1269 <leech_three_rk4+0x159>
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x3c(%rbp),%eax
movsd  -0x140(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x3c(%rbp),%eax
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1220 <leech_three_rk4+0x110>
lea    -0xa0(%rbp),%rdi
lea    -0x190(%rbp),%rsi
lea    -0x290(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <derivs_three@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x9,-0x3c(%rbp)
jae    12d7 <leech_three_rk4+0x1c7>
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x3c(%rbp),%eax
movsd  -0x190(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x3c(%rbp),%eax
movsd  %xmm0,-0xf0(%rbp,%rax,8)
ff ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    128e <leech_three_rk4+0x17e>
lea    -0xf0(%rbp),%rdi
lea    -0x1e0(%rbp),%rsi
lea    -0x290(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <derivs_three@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x9,-0x3c(%rbp)
jae    1345 <leech_three_rk4+0x235>
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x3c(%rbp),%eax
movsd  -0x1e0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x3c(%rbp),%eax
movsd  %xmm0,-0xf0(%rbp,%rax,8)
ff ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12fc <leech_three_rk4+0x1ec>
lea    -0xf0(%rbp),%rdi
lea    -0x230(%rbp),%rsi
lea    -0x290(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <derivs_three@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x9,-0x3c(%rbp)
jae    13d8 <leech_three_rk4+0x2c8>
movsd  -0x50(%rbp),%xmm0
mov    -0x3c(%rbp),%eax
movsd  -0x140(%rbp,%rax,8),%xmm1
ff ff
mov    -0x3c(%rbp),%eax
movsd  -0x190(%rbp,%rax,8),%xmm2
ff ff
mov    -0x3c(%rbp),%eax
addsd  -0x1e0(%rbp,%rax,8),%xmm2
ff ff
addsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
mov    -0x3c(%rbp),%eax
addsd  -0x230(%rbp,%rax,8),%xmm2
ff ff
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    136a <leech_three_rk4+0x25a>
jmp    13dd <leech_three_rk4+0x2cd>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11f2 <leech_three_rk4+0xe2>
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x38(%rbp)
jae    142b <leech_three_rk4+0x31b>
mov    -0x8(%rbp),%rax
imul   $0x3,-0x38(%rbp),%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
imul   $0x3,-0x34(%rbp),%ecx
add    -0x38(%rbp),%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    13f2 <leech_three_rk4+0x2e2>
jmp    1430 <leech_three_rk4+0x320>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11df <leech_three_rk4+0xcf>
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leech_three_rk4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2c8,%rsp
mov    %edx,0x4(%rsp)
movups 0x58(%rcx),%xmm1
movaps %xmm1,0x2b0(%rsp)
movups 0x48(%rcx),%xmm1
movaps %xmm1,0x2a0(%rsp)
movupd 0x8(%rcx),%xmm4
movups 0x18(%rcx),%xmm1
movupd 0x28(%rcx),%xmm2
movupd 0x38(%rcx),%xmm3
movapd %xmm3,0x290(%rsp)
movapd %xmm2,0x280(%rsp)
movaps %xmm1,0x270(%rsp)
movapd %xmm4,0x260(%rsp)
movsd  (%rdi),%xmm1
movsd  %xmm1,(%r9)
movsd  0x18(%rdi),%xmm1
movsd  %xmm1,0x8(%r9)
movsd  0x30(%rdi),%xmm1
mov    %r9,0x18(%rsp)
movsd  %xmm1,0x10(%r9)
cmp    $0x2,%esi
jb     15ef <leech_three_rk4+0x4df>
mov    %r8,%rbx
mov    %rdi,%rbp
movsd  0xe52(%rip),%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm0,%xmm3
divsd  0xe4a(%rip),%xmm3
mov    %esi,%eax
mov    %rax,0x10(%rsp)
movapd %xmm2,%xmm5
unpcklpd %xmm2,%xmm5
movapd %xmm0,%xmm6
unpcklpd %xmm0,%xmm6
movapd %xmm3,%xmm7
unpcklpd %xmm3,%xmm7
mov    $0x1,%edx
lea    0xe0(%rsp),%r14
lea    0x260(%rsp),%r12
lea    0x130(%rsp),%r13
movapd %xmm3,0x1b0(%rsp)
movapd %xmm7,0x1a0(%rsp)
movapd %xmm5,0x30(%rsp)
movapd %xmm6,0x190(%rsp)
movapd %xmm0,0x180(%rsp)
movapd %xmm2,0x20(%rsp)
jmp    1274 <leech_three_rk4+0x164>
nopl   0x0(%rax)
movsd  0x0(%rbp),%xmm4
mov    0x8(%rsp),%rdx
lea    (%rdx,%rdx,2),%eax
mov    0x18(%rsp),%rcx
movsd  %xmm4,(%rcx,%rax,8)
movsd  0x18(%rbp),%xmm1
lea    0x1(%rdx,%rdx,2),%eax
movsd  %xmm1,(%rcx,%rax,8)
movsd  0x30(%rbp),%xmm1
lea    (%rdx,%rdx,2),%eax
add    $0x2,%eax
movsd  %xmm1,(%rcx,%rax,8)
add    $0x1,%rdx
cmp    0x10(%rsp),%rdx
je     15ef <leech_three_rk4+0x4df>
mov    %rdx,0x8(%rsp)
mov    0x4(%rsp),%eax
mov    %eax,%r15d
test   %eax,%eax
je     1230 <leech_three_rk4+0x120>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1030 <derivs_three@plt>
movupd 0x0(%rbp),%xmm0
movapd 0xe0(%rsp),%xmm1
movapd 0x30(%rsp),%xmm2
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x210(%rsp)
movupd 0x10(%rbp),%xmm0
movapd 0xf0(%rsp),%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x220(%rsp)
movupd 0x20(%rbp),%xmm0
movapd 0x100(%rsp),%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x230(%rsp)
movupd 0x30(%rbp),%xmm0
movapd 0x110(%rsp),%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x240(%rsp)
movsd  0x120(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
addsd  0x40(%rbp),%xmm0
movsd  %xmm0,0x250(%rsp)
lea    0x210(%rsp),%rdi
lea    0x90(%rsp),%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1030 <derivs_three@plt>
movupd 0x0(%rbp),%xmm0
movapd 0x90(%rsp),%xmm1
movapd 0x30(%rsp),%xmm2
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x130(%rsp)
movupd 0x10(%rbp),%xmm0
movapd 0xa0(%rsp),%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x140(%rsp)
movupd 0x20(%rbp),%xmm0
movapd 0xb0(%rsp),%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x150(%rsp)
movupd 0x30(%rbp),%xmm0
movapd 0xc0(%rsp),%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x160(%rsp)
movsd  0xd0(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
addsd  0x40(%rbp),%xmm0
movsd  %xmm0,0x170(%rsp)
mov    %r13,%rdi
lea    0x40(%rsp),%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1030 <derivs_three@plt>
movupd 0x0(%rbp),%xmm0
movapd 0x40(%rsp),%xmm1
movapd 0x190(%rsp),%xmm2
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x130(%rsp)
movupd 0x10(%rbp),%xmm0
movapd 0x50(%rsp),%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x140(%rsp)
movupd 0x20(%rbp),%xmm0
movapd 0x60(%rsp),%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x150(%rsp)
movupd 0x30(%rbp),%xmm0
movapd 0x70(%rsp),%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x160(%rsp)
movsd  0x80(%rsp),%xmm0
mulsd  0x180(%rsp),%xmm0
addsd  0x40(%rbp),%xmm0
movsd  %xmm0,0x170(%rsp)
mov    %r13,%rdi
lea    0x1c0(%rsp),%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1030 <derivs_three@plt>
movapd 0x1a0(%rsp),%xmm7
movapd 0x90(%rsp),%xmm1
addpd  0x40(%rsp),%xmm1
addpd  %xmm1,%xmm1
addpd  0xe0(%rsp),%xmm1
addpd  0x1c0(%rsp),%xmm1
movupd 0x0(%rbp),%xmm4
mulpd  %xmm7,%xmm1
addpd  %xmm1,%xmm4
movupd 0x10(%rbp),%xmm1
movupd 0x20(%rbp),%xmm2
movupd %xmm4,0x0(%rbp)
movapd 0xa0(%rsp),%xmm3
addpd  0x50(%rsp),%xmm3
addpd  %xmm3,%xmm3
addpd  0xf0(%rsp),%xmm3
addpd  0x1d0(%rsp),%xmm3
mulpd  %xmm7,%xmm3
addpd  %xmm1,%xmm3
movupd %xmm3,0x10(%rbp)
movapd 0x1b0(%rsp),%xmm3
movapd 0xb0(%rsp),%xmm1
addpd  0x60(%rsp),%xmm1
addpd  %xmm1,%xmm1
addpd  0x100(%rsp),%xmm1
addpd  0x1e0(%rsp),%xmm1
mulpd  %xmm7,%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x20(%rbp)
movapd 0xc0(%rsp),%xmm1
addpd  0x70(%rsp),%xmm1
addpd  %xmm1,%xmm1
addpd  0x110(%rsp),%xmm1
addpd  0x1f0(%rsp),%xmm1
movupd 0x30(%rbp),%xmm2
mulpd  %xmm7,%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x30(%rbp)
movsd  0xd0(%rsp),%xmm1
addsd  0x80(%rsp),%xmm1
addsd  %xmm1,%xmm1
addsd  0x120(%rsp),%xmm1
addsd  0x200(%rsp),%xmm1
mulsd  %xmm3,%xmm1
addsd  0x40(%rbp),%xmm1
movsd  %xmm1,0x40(%rbp)
add    $0xffffffff,%r15d
jne    1290 <leech_three_rk4+0x180>
jmp    1235 <leech_three_rk4+0x125>
add    $0x2c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @leech_three_rk4(double* %0, double %1, i32 %2, i32 %3, double* %4, double* %5, double* %6) {
%8 = alloca double*
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca double
%20 = alloca [9 x double]
%21 = alloca [9 x double]
%22 = alloca [9 x double]
%23 = alloca [9 x double]
%24 = alloca [9 x double]
%25 = alloca [9 x double]
%26 = alloca [12 x double]
store double* %0, double** %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%27 = load double, double* %9
%28 = fdiv double %27, 2.000000e+00
store double %28, double* %18
%29 = load double, double* %9
%30 = fdiv double %29, 6.000000e+00
store double %30, double* %19
store i32 0, i32* %16
br label %31
31: ; preds = %44, %7
%32 = load i32, i32* %16
%33 = icmp ult i32 %32, 12
br i1 %33, label %34, label %47
34: ; preds = %31
%35 = load double*, double** %12
%36 = load i32, i32* %16
%37 = add i32 %36, 1
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds double, double* %35, i64 %38
%40 = load double, double* %39
%41 = load i32, i32* %16
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds [12 x double], [12 x double]* %26, i64 0, i64 %42
store double %40, double* %43
br label %44
44: ; preds = %34
%45 = load i32, i32* %16
%46 = add i32 %45, 1
store i32 %46, i32* %16
br label %31
47: ; preds = %31
store i32 0, i32* %16
br label %48
48: ; preds = %62, %47
%49 = load i32, i32* %16
%50 = icmp ult i32 %49, 3
br i1 %50, label %51, label %65
51: ; preds = %48
%52 = load double*, double** %8
%53 = load i32, i32* %16
%54 = mul i32 3, %53
%55 = zext i32 %54 to i64
%56 = getelementptr inbounds double, double* %52, i64 %55
%57 = load double, double* %56
%58 = load double*, double** %14
%59 = load i32, i32* %16
%60 = zext i32 %59 to i64
%61 = getelementptr inbounds double, double* %58, i64 %60
store double %57, double* %61
br label %62
62: ; preds = %51
%63 = load i32, i32* %16
%64 = add i32 %63, 1
store i32 %64, i32* %16
br label %48
65: ; preds = %48
store i32 1, i32* %15
br label %66
66: ; preds = %221, %65
%67 = load i32, i32* %15
%68 = load i32, i32* %10
%69 = icmp ult i32 %67, %68
br i1 %69, label %70, label %224
70: ; preds = %66
store i32 0, i32* %16
br label %71
71: ; preds = %196, %70
%72 = load i32, i32* %16
%73 = load i32, i32* %11
%74 = icmp ult i32 %72, %73
br i1 %74, label %75, label %199
75: ; preds = %71
%76 = load double*, double** %8
%77 = getelementptr inbounds [9 x double], [9 x double]* %22, i64 0, i64 0
%78 = getelementptr inbounds [12 x double], [12 x double]* %26, i64 0, i64 0
%79 = load double*, double** %13
%80 = call i32 @derivs_three(double* %76, double* %77, double* %78, double* %79)
store i32 0, i32* %17
br label %81
81: ; preds = %99, %75
%82 = load i32, i32* %17
%83 = icmp ult i32 %82, 9
br i1 %83, label %84, label %102
84: ; preds = %81
%85 = load double*, double** %8
%86 = load i32, i32* %17
%87 = zext i32 %86 to i64
%88 = getelementptr inbounds double, double* %85, i64 %87
%89 = load double, double* %88
%90 = load i32, i32* %17
%91 = zext i32 %90 to i64
%92 = getelementptr inbounds [9 x double], [9 x double]* %22, i64 0, i64 %91
%93 = load double, double* %92
%94 = load double, double* %18
%95 = call double @llvm.fmuladd.f64(double %93, double %94, double %89)
%96 = load i32, i32* %17
%97 = zext i32 %96 to i64
%98 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 %97
store double %95, double* %98
br label %99
99: ; preds = %84
%100 = load i32, i32* %17
%101 = add i32 %100, 1
store i32 %101, i32* %17
br label %81
102: ; preds = %81
%103 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 0
%104 = getelementptr inbounds [9 x double], [9 x double]* %23, i64 0, i64 0
%105 = getelementptr inbounds [12 x double], [12 x double]* %26, i64 0, i64 0
%106 = load double*, double** %13
%107 = call i32 @derivs_three(double* %103, double* %104, double* %105, double* %106)
store i32 0, i32* %17
br label %108
108: ; preds = %126, %102
%109 = load i32, i32* %17
%110 = icmp ult i32 %109, 9
br i1 %110, label %111, label %129
111: ; preds = %108
%112 = load double*, double** %8
%113 = load i32, i32* %17
%114 = zext i32 %113 to i64
%115 = getelementptr inbounds double, double* %112, i64 %114
%116 = load double, double* %115
%117 = load i32, i32* %17
%118 = zext i32 %117 to i64
%119 = getelementptr inbounds [9 x double], [9 x double]* %23, i64 0, i64 %118
%120 = load double, double* %119
%121 = load double, double* %18
%122 = call double @llvm.fmuladd.f64(double %120, double %121, double %116)
%123 = load i32, i32* %17
%124 = zext i32 %123 to i64
%125 = getelementptr inbounds [9 x double], [9 x double]* %21, i64 0, i64 %124
store double %122, double* %125
br label %126
126: ; preds = %111
%127 = load i32, i32* %17
%128 = add i32 %127, 1
store i32 %128, i32* %17
br label %108
129: ; preds = %108
%130 = getelementptr inbounds [9 x double], [9 x double]* %21, i64 0, i64 0
%131 = getelementptr inbounds [9 x double], [9 x double]* %24, i64 0, i64 0
%132 = getelementptr inbounds [12 x double], [12 x double]* %26, i64 0, i64 0
%133 = load double*, double** %13
%134 = call i32 @derivs_three(double* %130, double* %131, double* %132, double* %133)
store i32 0, i32* %17
br label %135
135: ; preds = %153, %129
%136 = load i32, i32* %17
%137 = icmp ult i32 %136, 9
br i1 %137, label %138, label %156
138: ; preds = %135
%139 = load double*, double** %8
%140 = load i32, i32* %17
%141 = zext i32 %140 to i64
%142 = getelementptr inbounds double, double* %139, i64 %141
%143 = load double, double* %142
%144 = load i32, i32* %17
%145 = zext i32 %144 to i64
%146 = getelementptr inbounds [9 x double], [9 x double]* %24, i64 0, i64 %145
%147 = load double, double* %146
%148 = load double, double* %9
%149 = call double @llvm.fmuladd.f64(double %147, double %148, double %143)
%150 = load i32, i32* %17
%151 = zext i32 %150 to i64
%152 = getelementptr inbounds [9 x double], [9 x double]* %21, i64 0, i64 %151
store double %149, double* %152
br label %153
153: ; preds = %138
%154 = load i32, i32* %17
%155 = add i32 %154, 1
store i32 %155, i32* %17
br label %135
156: ; preds = %135
%157 = getelementptr inbounds [9 x double], [9 x double]* %21, i64 0, i64 0
%158 = getelementptr inbounds [9 x double], [9 x double]* %25, i64 0, i64 0
%159 = getelementptr inbounds [12 x double], [12 x double]* %26, i64 0, i64 0
%160 = load double*, double** %13
%161 = call i32 @derivs_three(double* %157, double* %158, double* %159, double* %160)
store i32 0, i32* %17
br label %162
162: ; preds = %192, %156
%163 = load i32, i32* %17
%164 = icmp ult i32 %163, 9
br i1 %164, label %165, label %195
165: ; preds = %162
%166 = load double, double* %19
%167 = load i32, i32* %17
%168 = zext i32 %167 to i64
%169 = getelementptr inbounds [9 x double], [9 x double]* %22, i64 0, i64 %168
%170 = load double, double* %169
%171 = load i32, i32* %17
%172 = zext i32 %171 to i64
%173 = getelementptr inbounds [9 x double], [9 x double]* %23, i64 0, i64 %172
%174 = load double, double* %173
%175 = load i32, i32* %17
%176 = zext i32 %175 to i64
%177 = getelementptr inbounds [9 x double], [9 x double]* %24, i64 0, i64 %176
%178 = load double, double* %177
%179 = fadd double %174, %178
%180 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %179, double %170)
%181 = load i32, i32* %17
%182 = zext i32 %181 to i64
%183 = getelementptr inbounds [9 x double], [9 x double]* %25, i64 0, i64 %182
%184 = load double, double* %183
%185 = fadd double %180, %184
%186 = load double*, double** %8
%187 = load i32, i32* %17
%188 = zext i32 %187 to i64
%189 = getelementptr inbounds double, double* %186, i64 %188
%190 = load double, double* %189
%191 = call double @llvm.fmuladd.f64(double %166, double %185, double %190)
store double %191, double* %189
br label %192
192: ; preds = %165
%193 = load i32, i32* %17
%194 = add i32 %193, 1
store i32 %194, i32* %17
br label %162
195: ; preds = %162
br label %196
196: ; preds = %195
%197 = load i32, i32* %16
%198 = add i32 %197, 1
store i32 %198, i32* %16
br label %71
199: ; preds = %71
store i32 0, i32* %16
br label %200
200: ; preds = %217, %199
%201 = load i32, i32* %16
%202 = icmp ult i32 %201, 3
br i1 %202, label %203, label %220
203: ; preds = %200
%204 = load double*, double** %8
%205 = load i32, i32* %16
%206 = mul i32 3, %205
%207 = zext i32 %206 to i64
%208 = getelementptr inbounds double, double* %204, i64 %207
%209 = load double, double* %208
%210 = load double*, double** %14
%211 = load i32, i32* %15
%212 = mul i32 3, %211
%213 = load i32, i32* %16
%214 = add i32 %212, %213
%215 = zext i32 %214 to i64
%216 = getelementptr inbounds double, double* %210, i64 %215
store double %209, double* %216
br label %217
217: ; preds = %203
%218 = load i32, i32* %16
%219 = add i32 %218, 1
store i32 %219, i32* %16
br label %200
220: ; preds = %200
br label %221
221: ; preds = %220
%222 = load i32, i32* %15
%223 = add i32 %222, 1
store i32 %223, i32* %15
br label %66
224: ; preds = %66
ret void
}

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