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


x86 assembly (clang, -O0):
<contr_nuc_attr>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%eax
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    132d <contr_nuc_attr+0x21d>
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    131a <contr_nuc_attr+0x20a>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    0x50(%rbp),%eax
jge    1307 <contr_nuc_attr+0x1f7>
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    0x58(%rbp),%rax
movslq -0x74(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
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
mov    -0x10(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
movsd  -0x50(%rbp),%xmm5
movsd  -0x58(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm7
mov    0x30(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm12
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
mov    0x20(%rbp),%rax
movslq -0x70(%rbp),%r10
movsd  (%rax,%r10,8),%xmm11
mov    0x60(%rbp),%rax
movslq -0x74(%rbp),%r10
mov    (%rax,%r10,8),%rax
movsd  (%rax),%xmm10
mov    0x60(%rbp),%rax
movslq -0x74(%rbp),%r10
mov    (%rax,%r10,8),%rax
movsd  0x8(%rax),%xmm9
mov    0x60(%rbp),%rax
movslq -0x74(%rbp),%r10
mov    (%rax,%r10,8),%rax
movsd  0x10(%rax),%xmm8
movsd  %xmm12,(%rsp)
movsd  %xmm11,0x8(%rsp)
movsd  %xmm10,0x10(%rsp)
movsd  %xmm9,0x18(%rsp)
movsd  %xmm8,0x20(%rsp)
call   1030 <nuclear_attraction@plt>
movaps %xmm0,%xmm2
movsd  -0x80(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11af <contr_nuc_attr+0x9f>
jmp    130c <contr_nuc_attr+0x1fc>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    119c <contr_nuc_attr+0x8c>
jmp    131f <contr_nuc_attr+0x20f>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1189 <contr_nuc_attr+0x79>
movsd  -0x68(%rbp),%xmm0
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contr_nuc_attr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
test   %edi,%edi
jle    1384 <contr_nuc_attr+0x274>
movapd %xmm3,%xmm8
movapd %xmm0,%xmm9
mov    %rsi,%rax
mov    0x128(%rsp),%rsi
mov    0x110(%rsp),%rbx
mov    0x108(%rsp),%r14
mov    0x100(%rsp),%r13
mov    0xf8(%rsp),%r15
mov    0xf0(%rsp),%rbp
mov    %edi,%edi
mov    %rdi,0x40(%rsp)
xorpd  %xmm0,%xmm0
xor    %edi,%edi
mov    %rdi,0x28(%rsp)
movsd  %xmm5,0x98(%rsp)
movsd  %xmm4,0x90(%rsp)
movsd  %xmm3,0x88(%rsp)
movsd  %xmm2,0x80(%rsp)
movsd  %xmm1,0x78(%rsp)
movsd  %xmm9,0x70(%rsp)
mov    %rdx,0x68(%rsp)
mov    %rcx,0x60(%rsp)
mov    %r8,0x58(%rsp)
mov    %rax,0x50(%rsp)
mov    %r9,0x48(%rsp)
jmp    11ec <contr_nuc_attr+0xdc>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x28(%rsp),%r12
add    $0x1,%r12
mov    %r12,%rdi
mov    %r12,0x28(%rsp)
cmp    0x40(%rsp),%r12
je     1388 <contr_nuc_attr+0x278>
cmpl   $0x0,0xe8(%rsp)
jle    11d0 <contr_nuc_attr+0xc0>
xor    %edi,%edi
jmp    1218 <contr_nuc_attr+0x108>
nopw   0x0(%rax,%rax,1)
mov    0x38(%rsp),%r12
add    $0x1,%r12
mov    0xe8(%rsp),%edi
cmp    %rdi,%r12
mov    %r12,%rdi
je     11d0 <contr_nuc_attr+0xc0>
cmpl   $0x0,0x120(%rsp)
mov    %rdi,0x38(%rsp)
jle    1200 <contr_nuc_attr+0xf0>
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,0x30(%rsp)
mov    0x28(%rsp),%r11
movsd  (%rdx,%r11,8),%xmm0
mov    0x38(%rsp),%r10
mulsd  (%r15,%r10,8),%xmm0
xorps  %xmm3,%xmm3
cvtsi2sdl (%rsi,%r12,4),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0xa0(%rsp)
movsd  (%rcx,%r11,8),%xmm3
mov    (%r8,%r11,4),%edi
mov    (%r9,%r11,4),%esi
mov    0xe0(%rsp),%rcx
mov    (%rcx,%r11,4),%edx
movsd  (%rax,%r11,8),%xmm4
movsd  0x0(%r13,%r10,8),%xmm0
mov    (%r14,%r10,4),%ecx
mov    (%rbx,%r10,4),%r8d
mov    0x130(%rsp),%rax
mov    (%rax,%r12,8),%rax
movups (%rax),%xmm6
movsd  0x10(%rax),%xmm7
mov    0x118(%rsp),%rax
mov    (%rax,%r10,4),%r9d
movsd  0x0(%rbp,%r10,8),%xmm5
movsd  %xmm7,0x20(%rsp)
movups %xmm6,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
movsd  %xmm0,(%rsp)
movapd %xmm9,%xmm0
movapd %xmm8,%xmm5
movsd  0x90(%rsp),%xmm6
movsd  0x98(%rsp),%xmm7
mov    %rbx,%rbp
mov    %r13,%r15
mov    %r14,%r13
call   1030 <nuclear_attraction@plt>
mov    %r15,%r13
mov    0xf8(%rsp),%r15
mov    0x128(%rsp),%rsi
mov    0xf0(%rsp),%rbp
mov    0x50(%rsp),%rax
mov    0x68(%rsp),%rdx
mov    0x60(%rsp),%rcx
movsd  0x70(%rsp),%xmm9
movsd  0x78(%rsp),%xmm1
movsd  0x80(%rsp),%xmm2
mov    0x58(%rsp),%r8
mov    0x48(%rsp),%r9
movsd  0x88(%rsp),%xmm8
mulsd  0xa0(%rsp),%xmm0
movsd  0x30(%rsp),%xmm3
addsd  %xmm0,%xmm3
movsd  %xmm3,0x30(%rsp)
movsd  0x30(%rsp),%xmm0
add    $0x1,%r12
mov    0x120(%rsp),%edi
cmp    %r12,%rdi
jne    1230 <contr_nuc_attr+0x120>
jmp    1200 <contr_nuc_attr+0xf0>
xorpd  %xmm0,%xmm0
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define double @contr_nuc_attr(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, i32 %20, i32* nocapture %21, double** nocapture %22) {
%24 = icmp sgt i32 %0, 0
br i1 %24, label %25, label %90
25: ; preds = %23
%26 = icmp sgt i32 %10, 0
%27 = icmp sgt i32 %20, 0
%28 = zext i32 %0 to i64
%29 = zext i32 %10 to i64
%30 = zext i32 %20 to i64
br label %31
31: ; preds = %25, %86
%32 = phi i64 [ 0, %25 ], [ %88, %86 ]
%33 = phi double [ 0.000000e+00, %25 ], [ %87, %86 ]
br i1 %26, label %34, label %86
34: ; preds = %31
%35 = getelementptr inbounds double, double* %2, i64 %32
%36 = getelementptr inbounds double, double* %3, i64 %32
%37 = getelementptr inbounds i32, i32* %7, i64 %32
%38 = getelementptr inbounds i32, i32* %8, i64 %32
%39 = getelementptr inbounds i32, i32* %9, i64 %32
%40 = getelementptr inbounds double, double* %1, i64 %32
br label %41
41: ; preds = %34, %82
%42 = phi i64 [ 0, %34 ], [ %84, %82 ]
%43 = phi double [ %33, %34 ], [ %83, %82 ]
br i1 %27, label %44, label %82
44: ; preds = %41
%45 = getelementptr inbounds double, double* %12, i64 %42
%46 = getelementptr inbounds double, double* %13, i64 %42
%47 = getelementptr inbounds i32, i32* %17, i64 %42
%48 = getelementptr inbounds i32, i32* %18, i64 %42
%49 = getelementptr inbounds i32, i32* %19, i64 %42
%50 = getelementptr inbounds double, double* %11, i64 %42
br label %51
51: ; preds = %44, %51
%52 = phi i64 [ 0, %44 ], [ %80, %51 ]
%53 = phi double [ %43, %44 ], [ %79, %51 ]
%54 = load double, double* %35
%55 = load double, double* %45
%56 = fmul double %54, %55
%57 = getelementptr inbounds i32, i32* %21, i64 %52
%58 = load i32, i32* %57
%59 = sitofp i32 %58 to double
%60 = fmul double %56, %59
%61 = load double, double* %36
%62 = load i32, i32* %37
%63 = load i32, i32* %38
%64 = load i32, i32* %39
%65 = load double, double* %40
%66 = load double, double* %46
%67 = load i32, i32* %47
%68 = load i32, i32* %48
%69 = load i32, i32* %49
%70 = load double, double* %50
%71 = getelementptr inbounds double*, double** %22, i64 %52
%72 = load double*, double** %71
%73 = load double, double* %72
%74 = getelementptr inbounds double, double* %72, i64 1
%75 = load double, double* %74
%76 = getelementptr inbounds double, double* %72, i64 2
%77 = load double, double* %76
%78 = tail call double @nuclear_attraction(double %4, double %5, double %6, double %61, i32 %62, i32 %63, i32 %64, double %65, double %14, double %15, double %16, double %66, i32 %67, i32 %68, i32 %69, double %70, double %73, double %75, double %77)
%79 = tail call double @llvm.fmuladd.f64(double %60, double %78, double %53)
%80 = add nuw nsw i64 %52, 1
%81 = icmp eq i64 %80, %30
br i1 %81, label %82, label %51
82: ; preds = %51, %41
%83 = phi double [ %43, %41 ], [ %79, %51 ]
%84 = add nuw nsw i64 %42, 1
%85 = icmp eq i64 %84, %29
br i1 %85, label %86, label %41
86: ; preds = %82, %31
%87 = phi double [ %33, %31 ], [ %83, %82 ]
%88 = add nuw nsw i64 %32, 1
%89 = icmp eq i64 %88, %28
br i1 %89, label %90, label %31
90: ; preds = %86, %23
%91 = phi double [ 0.000000e+00, %23 ], [ %87, %86 ]
ret double %91
}