#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 overlap(double, int, int, int, double, double, double, double, int, int,
            int, double, double, double);
double kinetic(double alpha1, int l1, int m1, int n1, double xa, double ya,
               double za, double alpha2, int l2, int m2, int n2, double xb,
               double yb, double zb) {
  double term0, term1, term2;
  term0 =
      alpha2 * (2 * (l2 + m2 + n2) + 3) *
      overlap(alpha1, l1, m1, n1, xa, ya, za, alpha2, l2, m2, n2, xb, yb, zb);
  term1 = -2 * alpha2 * alpha2 *
          (overlap(alpha1, l1, m1, n1, xa, ya, za, alpha2, l2 + 2, m2, n2, xb,
                   yb, zb) +
           overlap(alpha1, l1, m1, n1, xa, ya, za, alpha2, l2, m2 + 2, n2, xb,
                   yb, zb) +
           overlap(alpha1, l1, m1, n1, xa, ya, za, alpha2, l2, m2, n2 + 2, xb,
                   yb, zb));
  term2 = -0.5 * (((l2 < 2) ? 0
                            : l2 * (l2 - 1) *
                                  overlap(alpha1, l1, m1, n1, xa, ya, za,
                                          alpha2, l2 - 2, m2, n2, xb, yb, zb)) +
                  ((m2 < 2) ? 0
                            : m2 * (m2 - 1) *
                                  overlap(alpha1, l1, m1, n1, xa, ya, za,
                                          alpha2, l2, m2 - 2, n2, xb, yb, zb)) +
                  ((n2 < 2) ? 0
                            : n2 * (n2 - 1) *
                                  overlap(alpha1, l1, m1, n1, xa, ya, za,
                                          alpha2, l2, m2, n2 - 2, xb, yb, zb)));
  return term0 + term1 + term2;
}


x86 assembly (clang, -O0):
<kinetic>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
mov    %ecx,-0x3c(%rbp)
mov    %r8d,-0x40(%rbp)
mov    %r9d,-0x44(%rbp)
movsd  %xmm5,-0x50(%rbp)
movsd  %xmm6,-0x58(%rbp)
movsd  %xmm7,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x3c(%rbp),%eax
add    -0x40(%rbp),%eax
add    -0x44(%rbp),%eax
shl    $0x1,%eax
add    $0x3,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
mov    -0x44(%rbp),%r9d
movsd  -0x50(%rbp),%xmm5
movsd  -0x58(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm7
call   1030 <overlap@plt>
movsd  -0x98(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe27(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
mov    -0x3c(%rbp),%ecx
add    $0x2,%ecx
mov    -0x40(%rbp),%r8d
mov    -0x44(%rbp),%r9d
movsd  -0x50(%rbp),%xmm5
movsd  -0x58(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm7
call   1030 <overlap@plt>
mov    %eax,-0x8c(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
add    $0x2,%r8d
mov    -0x44(%rbp),%r9d
movsd  -0x50(%rbp),%xmm5
movsd  -0x58(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm7
call   1030 <overlap@plt>
mov    %eax,%ecx
mov    -0x8c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x7c(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
mov    -0x44(%rbp),%r9d
add    $0x2,%r9d
movsd  -0x50(%rbp),%xmm5
movsd  -0x58(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm7
call   1030 <overlap@plt>
movsd  -0x88(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    -0x7c(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
cmpl   $0x2,-0x3c(%rbp)
jge    12ff <kinetic+0x1ef>
xor    %eax,%eax
mov    %eax,-0x9c(%rbp)
jmp    1366 <kinetic+0x256>
mov    -0x3c(%rbp),%eax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0xa0(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
mov    -0x3c(%rbp),%ecx
sub    $0x2,%ecx
mov    -0x40(%rbp),%r8d
mov    -0x44(%rbp),%r9d
movsd  -0x50(%rbp),%xmm5
movsd  -0x58(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm7
call   1030 <overlap@plt>
mov    %eax,%ecx
mov    -0xa0(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
mov    %eax,-0xa4(%rbp)
cmpl   $0x2,-0x40(%rbp)
jge    1389 <kinetic+0x279>
xor    %eax,%eax
mov    %eax,-0xa8(%rbp)
jmp    13f1 <kinetic+0x2e1>
mov    -0x40(%rbp),%eax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0xac(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
sub    $0x2,%r8d
mov    -0x44(%rbp),%r9d
movsd  -0x50(%rbp),%xmm5
movsd  -0x58(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm7
call   1030 <overlap@plt>
mov    %eax,%ecx
mov    -0xac(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0xa8(%rbp)
mov    -0xa4(%rbp),%eax
mov    -0xa8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xb0(%rbp)
cmpl   $0x2,-0x44(%rbp)
jge    141c <kinetic+0x30c>
xor    %eax,%eax
mov    %eax,-0xb4(%rbp)
jmp    1484 <kinetic+0x374>
mov    -0x44(%rbp),%eax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0xb8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
mov    -0x44(%rbp),%r9d
sub    $0x2,%r9d
movsd  -0x50(%rbp),%xmm5
movsd  -0x58(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm7
call   1030 <overlap@plt>
mov    %eax,%ecx
mov    -0xb8(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0xb4(%rbp)
mov    -0xb0(%rbp),%eax
mov    -0xb4(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xb6a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kinetic>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
movsd  %xmm7,0x48(%rsp)
movsd  %xmm6,0x40(%rsp)
movsd  %xmm5,0x38(%rsp)
mov    %r9d,%r14d
mov    %r8d,%r13d
mov    %ecx,%r15d
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,0x30(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  %xmm1,0x20(%rsp)
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%ebx
movsd  %xmm0,0x18(%rsp)
call   1030 <overlap@plt>
mov    %eax,0x64(%rsp)
lea    0x2(%r15),%ecx
movsd  0x18(%rsp),%xmm0
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12d,%edx
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
mov    %r13d,%r8d
mov    %r14d,%r9d
movsd  0x38(%rsp),%xmm5
movsd  0x40(%rsp),%xmm6
movsd  0x48(%rsp),%xmm7
call   1030 <overlap@plt>
mov    %eax,0x60(%rsp)
lea    0x2(%r13),%r8d
movsd  0x18(%rsp),%xmm0
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12d,%edx
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
mov    %r15d,%ecx
mov    %r14d,%r9d
movsd  0x38(%rsp),%xmm5
movsd  0x40(%rsp),%xmm6
movsd  0x48(%rsp),%xmm7
call   1030 <overlap@plt>
mov    %eax,0x5c(%rsp)
lea    0x2(%r14),%r9d
movsd  0x18(%rsp),%xmm0
mov    %ebx,%edi
mov    %ebp,0x10(%rsp)
mov    %ebp,%esi
mov    %r12d,0x14(%rsp)
mov    %r12d,%edx
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
mov    %r15d,%ecx
mov    %r13d,%r8d
movsd  0x38(%rsp),%xmm5
movsd  0x40(%rsp),%xmm6
movsd  0x48(%rsp),%xmm7
call   1030 <overlap@plt>
mov    %eax,0x58(%rsp)
xor    %ebp,%ebp
mov    $0x0,%eax
cmp    $0x2,%r15d
jl     12b0 <kinetic+0x1a0>
lea    -0x1(%r15),%r12d
imul   %r15d,%r12d
lea    -0x2(%r15),%ecx
movsd  0x18(%rsp),%xmm0
mov    %ebx,%edi
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
mov    %r13d,%r8d
mov    %r14d,%r9d
movsd  0x38(%rsp),%xmm5
movsd  0x40(%rsp),%xmm6
movsd  0x48(%rsp),%xmm7
call   1030 <overlap@plt>
imul   %r12d,%eax
mov    %eax,0x54(%rsp)
cmp    $0x2,%r13d
jl     1311 <kinetic+0x201>
lea    -0x1(%r13),%r12d
imul   %r13d,%r12d
lea    -0x2(%r13),%r8d
movsd  0x18(%rsp),%xmm0
mov    %ebx,%edi
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
mov    %r15d,%ecx
mov    %r14d,%r9d
movsd  0x38(%rsp),%xmm5
movsd  0x40(%rsp),%xmm6
movsd  0x48(%rsp),%xmm7
call   1030 <overlap@plt>
mov    %eax,%ebp
imul   %r12d,%ebp
xor    %eax,%eax
cmp    $0x2,%r14d
jl     136e <kinetic+0x25e>
lea    -0x1(%r14),%r12d
imul   %r14d,%r12d
lea    -0x2(%r14),%r9d
movsd  0x18(%rsp),%xmm0
mov    %ebx,%edi
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
mov    %r15d,%ecx
mov    %r13d,%r8d
movsd  0x38(%rsp),%xmm5
movsd  0x40(%rsp),%xmm6
movsd  0x48(%rsp),%xmm7
call   1030 <overlap@plt>
imul   %r12d,%eax
movsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
mov    0x5c(%rsp),%ecx
add    0x60(%rsp),%ecx
add    0x58(%rsp),%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mulsd  %xmm0,%xmm1
add    %r15d,%r13d
add    %r14d,%r13d
lea    0x3(%r13,%r13,1),%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
add    0x54(%rsp),%ebp
mulsd  %xmm2,%xmm0
xorps  %xmm2,%xmm2
cvtsi2sdl 0x64(%rsp),%xmm2
add    %eax,%ebp
mulsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
subsd  %xmm1,%xmm2
mulsd  0xc2d(%rip),%xmm0
addsd  %xmm2,%xmm0
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define double @kinetic(double %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6, double %7, i32 %8, i32 %9, i32 %10, double %11, double %12, double %13) {
%15 = tail call i32 @overlap(double %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6, double %7, i32 %8, i32 %9, i32 %10, double %11, double %12, double %13)
%16 = add nsw i32 %8, 2
%17 = tail call i32 @overlap(double %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6, double %7, i32 %16, i32 %9, i32 %10, double %11, double %12, double %13)
%18 = add nsw i32 %9, 2
%19 = tail call i32 @overlap(double %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6, double %7, i32 %8, i32 %18, i32 %10, double %11, double %12, double %13)
%20 = add nsw i32 %10, 2
%21 = tail call i32 @overlap(double %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6, double %7, i32 %8, i32 %9, i32 %20, double %11, double %12, double %13)
%22 = icmp slt i32 %8, 2
br i1 %22, label %29, label %23
23: ; preds = %14
%24 = add nsw i32 %8, -1
%25 = mul nsw i32 %24, %8
%26 = add nsw i32 %8, -2
%27 = tail call i32 @overlap(double %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6, double %7, i32 %26, i32 %9, i32 %10, double %11, double %12, double %13)
%28 = mul nsw i32 %25, %27
br label %29
29: ; preds = %14, %23
%30 = phi i32 [ %28, %23 ], [ 0, %14 ]
%31 = icmp slt i32 %9, 2
br i1 %31, label %38, label %32
32: ; preds = %29
%33 = add nsw i32 %9, -1
%34 = mul nsw i32 %33, %9
%35 = add nsw i32 %9, -2
%36 = tail call i32 @overlap(double %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6, double %7, i32 %8, i32 %35, i32 %10, double %11, double %12, double %13)
%37 = mul nsw i32 %34, %36
br label %38
38: ; preds = %29, %32
%39 = phi i32 [ %37, %32 ], [ 0, %29 ]
%40 = icmp slt i32 %10, 2
br i1 %40, label %47, label %41
41: ; preds = %38
%42 = add nsw i32 %10, -1
%43 = mul nsw i32 %42, %10
%44 = add nsw i32 %10, -2
%45 = tail call i32 @overlap(double %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6, double %7, i32 %8, i32 %9, i32 %44, double %11, double %12, double %13)
%46 = mul nsw i32 %43, %45
br label %47
47: ; preds = %38, %41
%48 = phi i32 [ %46, %41 ], [ 0, %38 ]
%49 = add nsw i32 %39, %30
%50 = fmul double %7, 2.000000e+00
%51 = fmul double %50, %7
%52 = add nsw i32 %19, %17
%53 = add nsw i32 %52, %21
%54 = sitofp i32 %53 to double
%55 = fmul double %51, %54
%56 = add nsw i32 %9, %8
%57 = add nsw i32 %56, %10
%58 = shl nsw i32 %57, 1
%59 = add nsw i32 %58, 3
%60 = sitofp i32 %59 to double
%61 = fmul double %60, %7
%62 = sitofp i32 %15 to double
%63 = fmul double %61, %62
%64 = add nsw i32 %49, %48
%65 = sitofp i32 %64 to double
%66 = fmul double %65, 5.000000e-01
%67 = fsub double %63, %55
%68 = fsub double %67, %66
ret double %68
}