#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 getCoolingRate(int, int, double const *, int const *, int const *,
                      double const *, double const, double const *, int const,
                      double const, double **, double **, double *,
                      double const *);
double finestruct_cooling_SA(const double T, const int slabInd,
                             const double ymolThis, const double HDens,
                             const double HpDens, const double H2Dens,
                             const double *dx, double **popDensFsThis,
                             double **coolingFsThis) {
  const double weights[3 + 1] = {0.0, 5.0, 3.0, 1.0};
  const int lower[3 + 1] = {0, 1, 2, 1};
  const int upper[3 + 1] = {0, 2, 3, 3};
  const double energy[3 + 1] = {0.0, 0e0, 571e0, 826e0};
  const double EinsA[3 + 1] = {0.0, 1.4e-3, 3.0e-4, 7.1e-8};
  const double col_H2[3 + 1] = {0.0, 7.5e-10, 4.2e-10, 7.1e-10};
  const double col_Hp[3 + 1] = {0.0, 3.3e-8, 1.2e-8, 3.3e-8};
  const double col_H[3 + 1] = {0.0, 7.5e-10, 4.2e-10, 7.1e-10};
  int i;
  double CulArr[3 + 1], cool;
  for (i = 1; i <= 3; i++)
    CulArr[i] = HpDens * col_Hp[i] + HDens * col_H[i] + H2Dens * col_H2[i];
  cool = getCoolingRate(3, 3, weights, lower, upper, energy, T, EinsA, slabInd,
                        ymolThis, popDensFsThis, coolingFsThis, CulArr, dx);
  return cool;
}


x86 assembly (clang, -O0):
<finestruct_cooling_SA>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x198,%rsp
movsd  %xmm0,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm2,-0x38(%rbp)
movsd  %xmm3,-0x40(%rbp)
movsd  %xmm4,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
mov    %rdx,-0x58(%rbp)
mov    %rcx,-0x60(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xf25(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xf1f(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xf19(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xf13(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    0xe6d(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xe67(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    0xe61(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xe5b(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0xe55(%rip),%rax
mov    %rax,-0xe0(%rbp)
mov    0xe4f(%rip),%rax
mov    %rax,-0xd8(%rbp)
mov    0xe49(%rip),%rax
mov    %rax,-0xd0(%rbp)
mov    0xe43(%rip),%rax
mov    %rax,-0xc8(%rbp)
mov    0xe3d(%rip),%rax
mov    %rax,-0x100(%rbp)
mov    0xe37(%rip),%rax
mov    %rax,-0xf8(%rbp)
mov    0xe31(%rip),%rax
mov    %rax,-0xf0(%rbp)
mov    0xe2b(%rip),%rax
mov    %rax,-0xe8(%rbp)
mov    0xe25(%rip),%rax
mov    %rax,-0x120(%rbp)
mov    0xe1f(%rip),%rax
mov    %rax,-0x118(%rbp)
mov    0xe19(%rip),%rax
mov    %rax,-0x110(%rbp)
mov    0xe13(%rip),%rax
mov    %rax,-0x108(%rbp)
mov    0xdcd(%rip),%rax
mov    %rax,-0x140(%rbp)
mov    0xdc7(%rip),%rax
mov    %rax,-0x138(%rbp)
mov    0xdc1(%rip),%rax
mov    %rax,-0x130(%rbp)
mov    0xdbb(%rip),%rax
mov    %rax,-0x128(%rbp)
movl   $0x1,-0x144(%rbp)
cmpl   $0x3,-0x144(%rbp)
jg     134e <finestruct_cooling_SA+0x23e>
movsd  -0x40(%rbp),%xmm1
movslq -0x144(%rbp),%rax
movsd  -0x120(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x38(%rbp),%xmm0
movslq -0x144(%rbp),%rax
mulsd  -0x140(%rbp,%rax,8),%xmm0
ff ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movslq -0x144(%rbp),%rax
movsd  -0x100(%rbp,%rax,8),%xmm2
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x144(%rbp),%rax
movsd  %xmm0,-0x170(%rbp,%rax,8)
ff ff
mov    -0x144(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x144(%rbp)
jmp    12ce <finestruct_cooling_SA+0x1be>
lea    -0x80(%rbp),%rdx
lea    -0x90(%rbp),%rcx
lea    -0xa0(%rbp),%r8
lea    -0xc0(%rbp),%r9
movsd  -0x20(%rbp),%xmm0
lea    -0xe0(%rbp),%r15
mov    -0x24(%rbp),%r14d
movsd  -0x30(%rbp),%xmm1
mov    -0x58(%rbp),%rbx
mov    -0x60(%rbp),%r11
lea    -0x170(%rbp),%r10
mov    -0x50(%rbp),%rax
mov    $0x3,%esi
mov    %esi,%edi
mov    %r15,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   1030 <getCoolingRate@plt>
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x178(%rbp),%xmm0
ff
add    $0x198,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<finestruct_cooling_SA>:
push   %r15
push   %r14
push   %rbx
sub    $0xa0,%rsp
mov    %rcx,%r11
mov    %rdx,%r10
mov    %rsi,%rbx
mov    %edi,%r14d
movaps 0xf31(%rip),%xmm5
movaps %xmm5,0x90(%rsp)
movaps 0xf12(%rip),%xmm5
movaps %xmm5,0x80(%rsp)
movaps 0xed3(%rip),%xmm5
movaps %xmm5,0x10(%rsp)
movaps 0xed7(%rip),%xmm5
movaps %xmm5,(%rsp)
movaps 0xf1c(%rip),%xmm5
movaps %xmm5,0x70(%rsp)
movaps 0xf00(%rip),%xmm5
movaps %xmm5,0x60(%rsp)
movaps 0xf24(%rip),%xmm5
movaps %xmm5,0x50(%rsp)
movaps 0xf08(%rip),%xmm5
movaps %xmm5,0x40(%rsp)
movapd %xmm2,%xmm5
unpcklpd %xmm2,%xmm5
movapd 0xe63(%rip),%xmm6
mulpd  %xmm6,%xmm5
movapd %xmm3,%xmm7
unpcklpd %xmm3,%xmm7
mulpd  0xe5f(%rip),%xmm7
addpd  %xmm5,%xmm7
movapd %xmm4,%xmm5
unpcklpd %xmm4,%xmm5
mulpd  %xmm6,%xmm5
addpd  %xmm7,%xmm5
movupd %xmm5,0x28(%rsp)
movsd  0xe6d(%rip),%xmm5
mulsd  %xmm5,%xmm2
mulsd  0xe69(%rip),%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm5,%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,0x38(%rsp)
lea    0x20(%rsp),%rax
lea    0x40(%rsp),%r15
lea    0x80(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rsp,%r8
lea    0x60(%rsp),%r9
mov    $0x3,%edi
mov    $0x3,%esi
push   %rbx
push   %rax
push   %r11
push   %r10
push   %r14
push   %r15
call   1030 <getCoolingRate@plt>
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.finestruct_cooling_SA.weights = [4 x double] [double 0.000000e+00, double 5.000000e+00, double 3.000000e+00, double 1.000000e+00]
@__const.finestruct_cooling_SA.lower = [4 x i32] [i32 0, i32 1, i32 2, i32 1]
@__const.finestruct_cooling_SA.upper = [4 x i32] [i32 0, i32 2, i32 3, i32 3]
@__const.finestruct_cooling_SA.energy = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 5.710000e+02, double 8.260000e+02]
@__const.finestruct_cooling_SA.EinsA = [4 x double] [double 0.000000e+00, double 1.400000e-03, double 3.000000e-04, double 7.100000e-08]
@__const.finestruct_cooling_SA.col_H2 = [4 x double] [double 0.000000e+00, double 0x3E09C511DC3A41DF, double 4.200000e-10, double 7.100000e-10]
@__const.finestruct_cooling_SA.col_Hp = [4 x double] [double 0.000000e+00, double 3.300000e-08, double 1.200000e-08, double 3.300000e-08]
@__const.finestruct_cooling_SA.col_H = [4 x double] [double 0.000000e+00, double 0x3E09C511DC3A41DF, double 4.200000e-10, double 7.100000e-10]
define double @finestruct_cooling_SA(double %0, i32 %1, double %2, double %3, double %4, double %5, double* %6, double** %7, double** %8) {
%10 = alloca double
%11 = alloca i32
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double*
%17 = alloca double**
%18 = alloca double**
%19 = alloca [4 x double]
%20 = alloca [4 x i32]
%21 = alloca [4 x i32]
%22 = alloca [4 x double]
%23 = alloca [4 x double]
%24 = alloca [4 x double]
%25 = alloca [4 x double]
%26 = alloca [4 x double]
%27 = alloca i32
%28 = alloca [4 x double]
%29 = alloca double
store double %0, double* %10
store i32 %1, i32* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double* %6, double** %16
store double** %7, double*** %17
store double** %8, double*** %18
%30 = bitcast [4 x double]* %19 to i8*
%31 = bitcast [4 x i32]* %20 to i8*
%32 = bitcast [4 x i32]* %21 to i8*
%33 = bitcast [4 x double]* %22 to i8*
%34 = bitcast [4 x double]* %23 to i8*
%35 = bitcast [4 x double]* %24 to i8*
%36 = bitcast [4 x double]* %25 to i8*
%37 = bitcast [4 x double]* %26 to i8*
store i32 1, i32* %27
br label %38
38: ; preds = %63, %9
%39 = load i32, i32* %27
%40 = icmp sle i32 %39, 3
br i1 %40, label %41, label %66
41: ; preds = %38
%42 = load double, double* %14
%43 = load i32, i32* %27
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [4 x double], [4 x double]* %25, i64 0, i64 %44
%46 = load double, double* %45
%47 = load double, double* %13
%48 = load i32, i32* %27
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [4 x double], [4 x double]* %26, i64 0, i64 %49
%51 = load double, double* %50
%52 = fmul double %47, %51
%53 = call double @llvm.fmuladd.f64(double %42, double %46, double %52)
%54 = load double, double* %15
%55 = load i32, i32* %27
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [4 x double], [4 x double]* %24, i64 0, i64 %56
%58 = load double, double* %57
%59 = call double @llvm.fmuladd.f64(double %54, double %58, double %53)
%60 = load i32, i32* %27
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [4 x double], [4 x double]* %28, i64 0, i64 %61
store double %59, double* %62
br label %63
63: ; preds = %41
%64 = load i32, i32* %27
%65 = add nsw i32 %64, 1
store i32 %65, i32* %27
br label %38
66: ; preds = %38
%67 = getelementptr inbounds [4 x double], [4 x double]* %19, i64 0, i64 0
%68 = getelementptr inbounds [4 x i32], [4 x i32]* %20, i64 0, i64 0
%69 = getelementptr inbounds [4 x i32], [4 x i32]* %21, i64 0, i64 0
%70 = getelementptr inbounds [4 x double], [4 x double]* %22, i64 0, i64 0
%71 = load double, double* %10
%72 = getelementptr inbounds [4 x double], [4 x double]* %23, i64 0, i64 0
%73 = load i32, i32* %11
%74 = load double, double* %12
%75 = load double**, double*** %17
%76 = load double**, double*** %18
%77 = getelementptr inbounds [4 x double], [4 x double]* %28, i64 0, i64 0
%78 = load double*, double** %16
%79 = call double @getCoolingRate(i32 3, i32 3, double* %67, i32* %68, i32* %69, double* %70, double %71, double* %72, i32 %73, double %74, double** %75, double** %76, double* %77, double* %78)
store double %79, double* %29
%80 = load double, double* %29
ret double %80
}

LLVM IR (-O2):
@__const.finestruct_cooling_SA.weights = [4 x double] [double 0.000000e+00, double 5.000000e+00, double 3.000000e+00, double 1.000000e+00]
@__const.finestruct_cooling_SA.lower = [4 x i32] [i32 0, i32 1, i32 2, i32 1]
@__const.finestruct_cooling_SA.upper = [4 x i32] [i32 0, i32 2, i32 3, i32 3]
@__const.finestruct_cooling_SA.energy = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 5.710000e+02, double 8.260000e+02]
@__const.finestruct_cooling_SA.EinsA = [4 x double] [double 0.000000e+00, double 1.400000e-03, double 3.000000e-04, double 7.100000e-08]
define double @finestruct_cooling_SA(double %0, i32 %1, double %2, double %3, double %4, double %5, double* %6, double** %7, double** %8) {
%10 = alloca [4 x double]
%11 = alloca [4 x i32]
%12 = alloca [4 x i32]
%13 = alloca [4 x double]
%14 = alloca [4 x double]
%15 = alloca [4 x double]
%16 = bitcast [4 x double]* %10 to i8*
%17 = bitcast [4 x i32]* %11 to i8*
%18 = bitcast [4 x i32]* %12 to i8*
%19 = bitcast [4 x double]* %13 to i8*
%20 = bitcast [4 x double]* %14 to i8*
%21 = bitcast [4 x double]* %15 to i8*
%22 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 1
%23 = insertelement <2 x double> poison, double %3, i64 0
%24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> zeroinitializer
%25 = fmul <2 x double> %24, <double 0x3E09C511DC3A41DF, double 4.200000e-10>
%26 = insertelement <2 x double> poison, double %4, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %27, <2 x double> <double 3.300000e-08, double 1.200000e-08>, <2 x double> %25)
%29 = insertelement <2 x double> poison, double %5, i64 0
%30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> zeroinitializer
%31 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %30, <2 x double> <double 0x3E09C511DC3A41DF, double 4.200000e-10>, <2 x double> %28)
%32 = bitcast double* %22 to <2 x double>*
store <2 x double> %31, <2 x double>* %32
%33 = fmul double %3, 7.100000e-10
%34 = tail call double @llvm.fmuladd.f64(double %4, double 3.300000e-08, double %33)
%35 = tail call double @llvm.fmuladd.f64(double %5, double 7.100000e-10, double %34)
%36 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
store double %35, double* %36
%37 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%38 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
%39 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 0
%40 = getelementptr inbounds [4 x double], [4 x double]* %13, i64 0, i64 0
%41 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%42 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%43 = call double @getCoolingRate(i32 3, i32 3, double* %37, i32* %38, i32* %39, double* %40, double %0, double* %41, i32 %1, double %2, double** %7, double** %8, double* %42, double* %6)
ret double %43
}