#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 */
double kinetic(double, int, int, int, double, double, double, double, int, int,
               int, double, double, double);
double contr_kinetic(int lena, double *aexps, double *acoefs, double *anorms,
                     double xa, double ya, double za, int *la, int *ma, int *na,
                     int lenb, double *bexps, double *bcoefs, double *bnorms,
                     double xb, double yb, double zb, int *lb, int *mb,
                     int *nb) {
  double val = 0.0;
  int i, j;
  for (i = 0; i < lena; i++) {
    for (j = 0; j < lenb; j++) {
      val += acoefs[i] * bcoefs[j] * anorms[i] * bnorms[j] *
             kinetic(aexps[i], la[i], ma[i], na[i], xa, ya, za, bexps[j], lb[j],
                     mb[j], nb[j], xb, yb, zb);
    }
  }
  return val;
}


x86 assembly (clang, -O0):
<contr_kinetic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm2,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
movsd  %xmm3,-0x50(%rbp)
movsd  %xmm4,-0x58(%rbp)
movsd  %xmm5,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1292 <contr_kinetic+0x182>
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    127f <contr_kinetic+0x16f>
mov    -0x18(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x28(%rbp),%rax
movslq -0x70(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x30(%rbp),%rax
movslq -0x70(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x48(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    0x10(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
mov    0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
mov    0x38(%rbp),%rax
movslq -0x70(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    0x40(%rbp),%rax
movslq -0x70(%rbp),%r8
mov    (%rax,%r8,4),%r8d
mov    0x48(%rbp),%rax
movslq -0x70(%rbp),%r9
mov    (%rax,%r9,4),%r9d
movsd  -0x50(%rbp),%xmm5
movsd  -0x58(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm7
call   1030 <kinetic@plt>
movaps %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1191 <contr_kinetic+0x81>
jmp    1284 <contr_kinetic+0x174>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    117e <contr_kinetic+0x6e>
movsd  -0x68(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contr_kinetic>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
test   %edi,%edi
jle    12cb <contr_kinetic+0x1bb>
movaps %xmm3,%xmm6
movaps %xmm1,%xmm3
movaps %xmm0,%xmm1
mov    0xe8(%rsp),%rbp
mov    0xe0(%rsp),%rbx
mov    0xd8(%rsp),%r13
mov    0xd0(%rsp),%r12
mov    0xc8(%rsp),%r10
mov    0xc0(%rsp),%r14
mov    0xb0(%rsp),%rax
mov    %edi,%edi
mov    %rdi,0x8(%rsp)
xorps  %xmm0,%xmm0
xor    %r11d,%r11d
movsd  %xmm5,0x60(%rsp)
movsd  %xmm4,0x58(%rsp)
movsd  %xmm6,0x50(%rsp)
movsd  %xmm2,0x48(%rsp)
movsd  %xmm3,0x40(%rsp)
movsd  %xmm1,0x38(%rsp)
mov    %rsi,0x30(%rsp)
mov    %rdx,0x28(%rsp)
mov    %rcx,0x20(%rsp)
mov    %r8,0x18(%rsp)
mov    %r9,0x10(%rsp)
jmp    11cf <contr_kinetic+0xbf>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r11
cmp    0x8(%rsp),%r11
je     12ce <contr_kinetic+0x1be>
cmpl   $0x0,0xb8(%rsp)
jle    11c0 <contr_kinetic+0xb0>
xor    %r15d,%r15d
mov    %r11,0x68(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
movsd  (%rdx,%r11,8),%xmm0
mulsd  (%r10,%r15,8),%xmm0
mulsd  (%rcx,%r11,8),%xmm0
mulsd  (%r12,%r15,8),%xmm0
movsd  %xmm0,0x70(%rsp)
movsd  (%rsi,%r11,8),%xmm0
mov    (%r8,%r11,4),%edi
mov    (%r9,%r11,4),%esi
mov    (%rax,%r11,4),%edx
movsd  (%r14,%r15,8),%xmm4
mov    0x0(%r13,%r15,4),%ecx
mov    (%rbx,%r15,4),%r8d
mov    0x0(%rbp,%r15,4),%r9d
movsd  0x38(%rsp),%xmm1
movaps %xmm3,%xmm2
movsd  0x48(%rsp),%xmm3
movaps %xmm6,%xmm5
movsd  0x58(%rsp),%xmm6
movsd  0x60(%rsp),%xmm7
call   1030 <kinetic@plt>
mov    0x68(%rsp),%r11
mov    0xb8(%rsp),%eax
mov    %rax,%rdi
mov    0xb0(%rsp),%rax
mov    0xc8(%rsp),%r10
mov    0x30(%rsp),%rsi
mov    0x28(%rsp),%rdx
mov    0x20(%rsp),%rcx
movsd  0x40(%rsp),%xmm3
mov    0x18(%rsp),%r8
mov    0x10(%rsp),%r9
movsd  0x50(%rsp),%xmm6
mulsd  0x70(%rsp),%xmm0
movsd  (%rsp),%xmm7
addsd  %xmm0,%xmm7
movsd  %xmm7,(%rsp)
movsd  (%rsp),%xmm0
add    $0x1,%r15
cmp    %r15,%rdi
jne    11f0 <contr_kinetic+0xe0>
jmp    11c0 <contr_kinetic+0xb0>
xorps  %xmm0,%xmm0
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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