#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*/ kinetic_energy(int, double *, double *);
void leapfrog(int num_dim, double *x, double *g, double *p, int num_steps,
              double epsilon, double *sigma, double *log_ratio,
              void (*neg_logpost)(int *, double *, double *, double *),
              double *llik) {
  double ke, pe, h0, h1, dh;
  int i, j;
  pe = ke = dh = 0;
  kinetic_energy(num_dim, p, &ke);
  neg_logpost(&num_dim, x, &pe, g);
  h0 = ke + pe;
  for (i = 0; i < num_steps; ++i) {
    for (j = 0; j < num_dim; ++j) {
      p[j] = p[j] - 0.5 * epsilon * sigma[j] * g[j];
      x[j] = x[j] + epsilon * sigma[j] * p[j];
    }
    neg_logpost(&num_dim, x, &pe, g);
    for (j = 0; j < num_dim; ++j) {
      p[j] = p[j] - 0.5 * epsilon * sigma[j] * g[j];
    }
    kinetic_energy(num_dim, p, &ke);
    h1 = ke + pe;
    dh = h1 - h0;
    if (-dh <= *log_ratio) {
      break;
    }
  }
  *log_ratio = dh;
  *llik = -pe;
}


x86 assembly (clang, -O0):
<leapfrog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <kinetic_energy@plt>
mov    0x18(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x48(%rbp),%rdx
call   *%rax
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    136d <leapfrog+0x25d>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1262 <leapfrog+0x152>
mov    -0x20(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xe38(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x68(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x30(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x68(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11a7 <leapfrog+0x97>
mov    0x18(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x48(%rbp),%rdx
call   *%rax
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12f9 <leapfrog+0x1e9>
mov    -0x20(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xd60(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x68(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    127f <leapfrog+0x16f>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <kinetic_energy@plt>
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     135a <leapfrog+0x24a>
jmp    136d <leapfrog+0x25d>
jmp    135f <leapfrog+0x24f>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1194 <leapfrog+0x84>
movsd  -0x60(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapfrog>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9,%rbx
movaps %xmm0,0x30(%rsp)
mov    %r8d,%r13d
mov    %rcx,%rbp
mov    %rdx,%r15
mov    %rsi,%r12
mov    0xb0(%rsp),%r14
mov    %edi,0xc(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x18(%rsp),%rdx
mov    %rcx,%rsi
call   1030 <kinetic_energy@plt>
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rdx
mov    %r12,%rsi
mov    %r15,%rcx
call   *0xb8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    %r13d,0x24(%rsp)
test   %r13d,%r13d
jle    14f4 <leapfrog+0x3e4>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0xe64(%rip),%xmm4
movapd 0x30(%rsp),%xmm3
mulsd  %xmm3,%xmm4
movapd %xmm4,%xmm5
unpcklpd %xmm4,%xmm5
movapd %xmm3,%xmm6
unpcklpd %xmm3,%xmm6
xor    %r13d,%r13d
movapd %xmm4,0x50(%rsp)
movapd %xmm5,0x40(%rsp)
movapd %xmm6,0x60(%rsp)
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    131d <leapfrog+0x20d>
cmp    $0x1,%eax
jne    11f0 <leapfrog+0xe0>
xor    %ecx,%ecx
jmp    12e0 <leapfrog+0x1d0>
nopl   0x0(%rax,%rax,1)
lea    (%r12,%rax,8),%rsi
cmp    %rbp,%rsi
seta   0xb(%rsp)
lea    0x0(,%rax,8),%rdi
add    %rbp,%rdi
cmp    %r12,%rdi
seta   %r11b
lea    (%rbx,%rax,8),%rdx
cmp    %rbp,%rdx
seta   %r10b
cmp    %rbx,%rdi
seta   %r9b
lea    (%r15,%rax,8),%rcx
cmp    %rbp,%rcx
seta   %r8b
cmp    %r15,%rdi
seta   0xa(%rsp)
cmp    %r12,%rdx
seta   %dil
cmp    %rbx,%rsi
seta   %dl
cmp    %r12,%rcx
seta   %r14b
cmp    %r15,%rsi
seta   %sil
test   %r11b,0xb(%rsp)
jne    12d0 <leapfrog+0x1c0>
and    %r9b,%r10b
jne    12d0 <leapfrog+0x1c0>
and    0xa(%rsp),%r8b
jne    12d0 <leapfrog+0x1c0>
and    %dl,%dil
jne    12d0 <leapfrog+0x1c0>
mov    $0x0,%ecx
and    %sil,%r14b
mov    0xb0(%rsp),%r14
jne    12e0 <leapfrog+0x1d0>
mov    %eax,%ecx
and    $0xfffffffe,%ecx
xor    %edx,%edx
nop
movupd 0x0(%rbp,%rdx,8),%xmm0
movupd (%rbx,%rdx,8),%xmm1
movupd (%r15,%rdx,8),%xmm2
mulpd  %xmm5,%xmm1
mulpd  %xmm2,%xmm1
addpd  %xmm0,%xmm1
movupd %xmm1,0x0(%rbp,%rdx,8)
movupd (%r12,%rdx,8),%xmm0
movupd (%rbx,%rdx,8),%xmm2
mulpd  %xmm6,%xmm2
mulpd  %xmm1,%xmm2
addpd  %xmm0,%xmm2
movupd %xmm2,(%r12,%rdx,8)
add    $0x2,%rdx
cmp    %rdx,%rcx
jne    1280 <leapfrog+0x170>
cmp    %rax,%rcx
jne    12e0 <leapfrog+0x1d0>
jmp    131d <leapfrog+0x20d>
xor    %ecx,%ecx
mov    0xb0(%rsp),%r14
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm0
mulsd  %xmm4,%xmm0
mulsd  (%r15,%rcx,8),%xmm0
addsd  0x0(%rbp,%rcx,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rcx,8)
movsd  (%rbx,%rcx,8),%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r12,%rcx,8),%xmm1
movsd  %xmm1,(%r12,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    12e0 <leapfrog+0x1d0>
lea    0xc(%rsp),%rdi
mov    %r12,%rsi
lea    0x10(%rsp),%rdx
mov    %r15,%rcx
call   *0xb8(%rsp)
movapd 0x40(%rsp),%xmm7
movapd 0x50(%rsp),%xmm6
mov    0xc(%rsp),%edi
test   %edi,%edi
jle    1491 <leapfrog+0x381>
cmp    $0x4,%edi
jb     1410 <leapfrog+0x300>
lea    (%rbx,%rdi,8),%rax
cmp    %rbp,%rax
seta   %sil
lea    0x0(,%rdi,8),%rdx
add    %rbp,%rdx
cmp    %rbx,%rdx
seta   %al
lea    (%r15,%rdi,8),%rcx
cmp    %rbp,%rcx
seta   %cl
cmp    %r15,%rdx
seta   %dl
test   %al,%sil
jne    1410 <leapfrog+0x300>
mov    $0x0,%eax
and    %dl,%cl
jne    1412 <leapfrog+0x302>
mov    %edi,%eax
and    $0xfffffffc,%eax
lea    0x0(,%rdi,8),%rcx
and    $0xffffffffffffffe0,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
movupd 0x0(%rbp,%rdx,1),%xmm0
movupd 0x10(%rbp,%rdx,1),%xmm1
movupd (%rbx,%rdx,1),%xmm2
movupd 0x10(%rbx,%rdx,1),%xmm3
movupd (%r15,%rdx,1),%xmm4
movupd 0x10(%r15,%rdx,1),%xmm5
mulpd  %xmm7,%xmm2
mulpd  %xmm4,%xmm2
addpd  %xmm0,%xmm2
mulpd  %xmm7,%xmm3
mulpd  %xmm5,%xmm3
addpd  %xmm1,%xmm3
movupd %xmm2,0x0(%rbp,%rdx,1)
movupd %xmm3,0x10(%rbp,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%rcx
jne    13b0 <leapfrog+0x2a0>
cmp    %rdi,%rax
jne    1412 <leapfrog+0x302>
jmp    1491 <leapfrog+0x381>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
mov    %rax,%rcx
test   $0x1,%dil
je     143d <leapfrog+0x32d>
movsd  (%rbx,%rax,8),%xmm0
mulsd  %xmm6,%xmm0
mulsd  (%r15,%rax,8),%xmm0
addsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
mov    %rax,%rcx
or     $0x1,%rcx
not    %rax
add    %rdi,%rax
je     1491 <leapfrog+0x381>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rbx,%rcx,8),%xmm0
mulsd  %xmm6,%xmm0
mulsd  (%r15,%rcx,8),%xmm0
addsd  0x0(%rbp,%rcx,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rcx,8)
movsd  0x8(%rbx,%rcx,8),%xmm0
mulsd  %xmm6,%xmm0
mulsd  0x8(%r15,%rcx,8),%xmm0
addsd  0x8(%rbp,%rcx,8),%xmm0
movsd  %xmm0,0x8(%rbp,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rdi
jne    1450 <leapfrog+0x340>
mov    %rbp,%rsi
lea    0x18(%rsp),%rdx
call   1030 <kinetic_energy@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
addsd  %xmm0,%xmm1
subsd  0x28(%rsp),%xmm1
movapd %xmm1,%xmm2
xorpd  0xb50(%rip),%xmm2
movsd  (%r14),%xmm3
ucomisd %xmm2,%xmm3
jae    14f8 <leapfrog+0x3e8>
add    $0x1,%r13d
cmp    0x24(%rsp),%r13d
movapd 0x30(%rsp),%xmm3
movapd 0x50(%rsp),%xmm4
movapd 0x40(%rsp),%xmm5
movapd 0x60(%rsp),%xmm6
jl     11d0 <leapfrog+0xc0>
jmp    14f8 <leapfrog+0x3e8>
xorpd  %xmm1,%xmm1
movsd  %xmm1,(%r14)
xorpd  0xb0b(%rip),%xmm0
mov    0xc0(%rsp),%rax
movlpd %xmm0,(%rax)
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @leapfrog(i32 %0, double* %1, double* %2, double* %3, i32 %4, double %5, double* %6, double* %7, void (i32*, double*, double*, double*)* %8, double* %9) {
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
%16 = alloca double
%17 = alloca double*
%18 = alloca double*
%19 = alloca void (i32*, double*, double*, double*)*
%20 = alloca double*
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca i32
%27 = alloca i32
store i32 %0, i32* %11
store double* %1, double** %12
store double* %2, double** %13
store double* %3, double** %14
store i32 %4, i32* %15
store double %5, double* %16
store double* %6, double** %17
store double* %7, double** %18
store void (i32*, double*, double*, double*)* %8, void (i32*, double*, double*, double*)** %19
store double* %9, double** %20
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %21
store double 0.000000e+00, double* %22
%28 = load i32, i32* %11
%29 = load double*, double** %14
%30 = call i32 @kinetic_energy(i32 %28, double* %29, double* %21)
%31 = load void (i32*, double*, double*, double*)*, void (i32*, double*, double*, double*)** %19
%32 = load double*, double** %12
%33 = load double*, double** %13
%34 = load double, double* %21
%35 = load double, double* %22
%36 = fadd double %34, %35
store double %36, double* %23
store i32 0, i32* %26
br label %37
37: ; preds = %149, %10
%38 = load i32, i32* %26
%39 = load i32, i32* %15
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %152
41: ; preds = %37
store i32 0, i32* %27
br label %42
42: ; preds = %93, %41
%43 = load i32, i32* %27
%44 = load i32, i32* %11
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %96
46: ; preds = %42
%47 = load double*, double** %14
%48 = load i32, i32* %27
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %47, i64 %49
%51 = load double, double* %50
%52 = load double, double* %16
%53 = fmul double 5.000000e-01, %52
%54 = load double*, double** %17
%55 = load i32, i32* %27
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
%58 = load double, double* %57
%59 = fmul double %53, %58
%60 = load double*, double** %13
%61 = load i32, i32* %27
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = fneg double %59
%66 = call double @llvm.fmuladd.f64(double %65, double %64, double %51)
%67 = load double*, double** %14
%68 = load i32, i32* %27
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %67, i64 %69
store double %66, double* %70
%71 = load double*, double** %12
%72 = load i32, i32* %27
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %71, i64 %73
%75 = load double, double* %74
%76 = load double, double* %16
%77 = load double*, double** %17
%78 = load i32, i32* %27
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %77, i64 %79
%81 = load double, double* %80
%82 = fmul double %76, %81
%83 = load double*, double** %14
%84 = load i32, i32* %27
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %83, i64 %85
%87 = load double, double* %86
%88 = call double @llvm.fmuladd.f64(double %82, double %87, double %75)
%89 = load double*, double** %12
%90 = load i32, i32* %27
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %89, i64 %91
store double %88, double* %92
br label %93
93: ; preds = %46
%94 = load i32, i32* %27
%95 = add nsw i32 %94, 1
store i32 %95, i32* %27
br label %42
96: ; preds = %42
%97 = load void (i32*, double*, double*, double*)*, void (i32*, double*, double*, double*)** %19
%98 = load double*, double** %12
%99 = load double*, double** %13
store i32 0, i32* %27
br label %100
100: ; preds = %129, %96
%101 = load i32, i32* %27
%102 = load i32, i32* %11
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %132
104: ; preds = %100
%105 = load double*, double** %14
%106 = load i32, i32* %27
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %105, i64 %107
%109 = load double, double* %108
%110 = load double, double* %16
%111 = fmul double 5.000000e-01, %110
%112 = load double*, double** %17
%113 = load i32, i32* %27
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %112, i64 %114
%116 = load double, double* %115
%117 = fmul double %111, %116
%118 = load double*, double** %13
%119 = load i32, i32* %27
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
%122 = load double, double* %121
%123 = fneg double %117
%124 = call double @llvm.fmuladd.f64(double %123, double %122, double %109)
%125 = load double*, double** %14
%126 = load i32, i32* %27
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %125, i64 %127
store double %124, double* %128
br label %129
129: ; preds = %104
%130 = load i32, i32* %27
%131 = add nsw i32 %130, 1
store i32 %131, i32* %27
br label %100
132: ; preds = %100
%133 = load i32, i32* %11
%134 = load double*, double** %14
%135 = call i32 @kinetic_energy(i32 %133, double* %134, double* %21)
%136 = load double, double* %21
%137 = load double, double* %22
%138 = fadd double %136, %137
store double %138, double* %24
%139 = load double, double* %24
%140 = load double, double* %23
%141 = fsub double %139, %140
store double %141, double* %25
%142 = load double, double* %25
%143 = fneg double %142
%144 = load double*, double** %18
%145 = load double, double* %144
%146 = fcmp ole double %143, %145
br i1 %146, label %147, label %148
147: ; preds = %132
br label %152
148: ; preds = %132
br label %149
149: ; preds = %148
%150 = load i32, i32* %26
%151 = add nsw i32 %150, 1
store i32 %151, i32* %26
br label %37
152: ; preds = %147, %37
%153 = load double, double* %25
%154 = load double*, double** %18
store double %153, double* %154
%155 = load double, double* %22
%156 = fneg double %155
%157 = load double*, double** %20
store double %156, double* %157
ret void
}

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