#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 pow(double const, double);
double finestruct_cooling_SiP(const double T, const int slabInd,
                              const double ymolThis, const double elecDens,
                              const double HDens, const double H2Dens,
                              const double *dx, double **popDensFsThis,
                              double **coolingFsThis) {
  const double weights[2 + 1] = {0.0, 2.0, 4.0};
  const int lower[1 + 1] = {0, 1};
  const int upper[1 + 1] = {0, 2};
  const double energy[2 + 1] = {0.0, 0e0, 414e0};
  const double EinsA[1 + 1] = {0.0, 2.1e-4};
  const double col_e[1 + 1] = {0.0, 1.2e-5 * pow(T, -0.5)};
  const double col_H[1 + 1] = {0.0, 6.5e-10};
  const double col_H2[1 + 1] = {0.0, 6.5e-10};
  int i;
  double CulArr[1 + 1], cool;
  for (i = 1; i <= 1; i++)
    CulArr[i] = elecDens * col_e[i] + HDens * col_H[i] + H2Dens * col_H2[i];
  cool = getCoolingRate(2, 1, weights, lower, upper, energy, T, EinsA, slabInd,
                        ymolThis, popDensFsThis, coolingFsThis, CulArr, dx);
  return cool;
}


x86 assembly (clang, -O0):
<finestruct_cooling_SiP>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x138,%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    0xec1(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe90(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xe8a(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xe9e(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0xe98(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xe94(%rip),%rax
mov    %rax,-0xb8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xe15(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xdfd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    0xe5a(%rip),%rax
mov    %rax,-0xe0(%rbp)
mov    0xe54(%rip),%rax
mov    %rax,-0xd8(%rbp)
mov    0xe3e(%rip),%rax
mov    %rax,-0xf0(%rbp)
mov    0xe38(%rip),%rax
mov    %rax,-0xe8(%rbp)
movl   $0x1,-0xf4(%rbp)
cmpl   $0x1,-0xf4(%rbp)
jg     12d1 <finestruct_cooling_SiP+0x1b1>
movsd  -0x38(%rbp),%xmm1
movslq -0xf4(%rbp),%rax
movsd  -0xd0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x40(%rbp),%xmm0
movslq -0xf4(%rbp),%rax
mulsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movslq -0xf4(%rbp),%rax
movsd  -0xf0(%rbp,%rax,8),%xmm2
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0xf4(%rbp),%rax
movsd  %xmm0,-0x110(%rbp,%rax,8)
ff ff
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
jmp    1251 <finestruct_cooling_SiP+0x131>
lea    -0x80(%rbp),%rdx
lea    -0x88(%rbp),%rcx
lea    -0x90(%rbp),%r8
lea    -0xb0(%rbp),%r9
movsd  -0x20(%rbp),%xmm0
lea    -0xc0(%rbp),%r15
mov    -0x24(%rbp),%r14d
movsd  -0x30(%rbp),%xmm1
mov    -0x58(%rbp),%rbx
mov    -0x60(%rbp),%r11
lea    -0x110(%rbp),%r10
mov    -0x50(%rbp),%rax
mov    $0x2,%edi
mov    $0x1,%esi
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,-0x118(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
add    $0x138,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<finestruct_cooling_SiP>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
movsd  %xmm4,0x20(%rsp)
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x28(%rsp)
mov    %edi,%r12d
movsd  %xmm0,0x18(%rsp)
mov    0xed1(%rip),%rax
mov    %rax,0x90(%rsp)
movaps 0xeb2(%rip),%xmm1
movaps %xmm1,0x80(%rsp)
movabs $0x100000000,%rax
mov    %rax,0x38(%rsp)
movabs $0x200000000,%rax
mov    %rax,0x30(%rsp)
mov    0xeb5(%rip),%rax
mov    %rax,0x70(%rsp)
movaps 0xe99(%rip),%xmm1
movaps %xmm1,0x60(%rsp)
movaps 0xead(%rip),%xmm1
movaps %xmm1,0x50(%rsp)
movsd  0xe40(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xe3b(%rip),%xmm0
movsd  0xe3b(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  %xmm1,%xmm2
mulsd  0x10(%rsp),%xmm0
addsd  %xmm2,%xmm0
movsd  0x20(%rsp),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x48(%rsp)
lea    0x40(%rsp),%rax
lea    0x50(%rsp),%r10
lea    0x80(%rsp),%rdx
lea    0x38(%rsp),%rcx
lea    0x30(%rsp),%r8
lea    0x60(%rsp),%r9
mov    $0x2,%edi
mov    $0x1,%esi
movsd  0x18(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
push   %rbx
push   %rax
push   %r15
push   %r14
push   %r12
push   %r10
call   1030 <getCoolingRate@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.finestruct_cooling_SiP.weights = [3 x double] [double 0.000000e+00, double 2.000000e+00, double 4.000000e+00]
@__const.finestruct_cooling_SiP.lower = [2 x i32] [i32 0, i32 1]
@__const.finestruct_cooling_SiP.upper = [2 x i32] [i32 0, i32 2]
@__const.finestruct_cooling_SiP.energy = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 4.140000e+02]
@__const.finestruct_cooling_SiP.EinsA = [2 x double] [double 0.000000e+00, double 2.100000e-04]
@__const.finestruct_cooling_SiP.col_H = [2 x double] [double 0.000000e+00, double 6.500000e-10]
@__const.finestruct_cooling_SiP.col_H2 = [2 x double] [double 0.000000e+00, double 6.500000e-10]
define double @finestruct_cooling_SiP(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 [3 x double]
%20 = alloca [2 x i32]
%21 = alloca [2 x i32]
%22 = alloca [3 x double]
%23 = alloca [2 x double]
%24 = alloca [2 x double]
%25 = alloca [2 x double]
%26 = alloca [2 x double]
%27 = alloca i32
%28 = alloca [2 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 [3 x double]* %19 to i8*
%31 = bitcast [2 x i32]* %20 to i8*
%32 = bitcast [2 x i32]* %21 to i8*
%33 = bitcast [3 x double]* %22 to i8*
%34 = bitcast [2 x double]* %23 to i8*
%35 = getelementptr inbounds [2 x double], [2 x double]* %24, i64 0, i64 0
store double 0.000000e+00, double* %35
%36 = getelementptr inbounds double, double* %35, i64 1
%37 = load double, double* %10
%38 = call double @pow(double %37, double -5.000000e-01)
%39 = fmul double 1.200000e-05, %38
store double %39, double* %36
%40 = bitcast [2 x double]* %25 to i8*
%41 = bitcast [2 x double]* %26 to i8*
store i32 1, i32* %27
br label %42
42: ; preds = %67, %9
%43 = load i32, i32* %27
%44 = icmp sle i32 %43, 1
br i1 %44, label %45, label %70
45: ; preds = %42
%46 = load double, double* %13
%47 = load i32, i32* %27
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [2 x double], [2 x double]* %24, i64 0, i64 %48
%50 = load double, double* %49
%51 = load double, double* %14
%52 = load i32, i32* %27
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [2 x double], [2 x double]* %25, i64 0, i64 %53
%55 = load double, double* %54
%56 = fmul double %51, %55
%57 = call double @llvm.fmuladd.f64(double %46, double %50, double %56)
%58 = load double, double* %15
%59 = load i32, i32* %27
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [2 x double], [2 x double]* %26, i64 0, i64 %60
%62 = load double, double* %61
%63 = call double @llvm.fmuladd.f64(double %58, double %62, double %57)
%64 = load i32, i32* %27
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [2 x double], [2 x double]* %28, i64 0, i64 %65
store double %63, double* %66
br label %67
67: ; preds = %45
%68 = load i32, i32* %27
%69 = add nsw i32 %68, 1
store i32 %69, i32* %27
br label %42
70: ; preds = %42
%71 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 0
%72 = getelementptr inbounds [2 x i32], [2 x i32]* %20, i64 0, i64 0
%73 = getelementptr inbounds [2 x i32], [2 x i32]* %21, i64 0, i64 0
%74 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 0, i64 0
%75 = load double, double* %10
%76 = getelementptr inbounds [2 x double], [2 x double]* %23, i64 0, i64 0
%77 = load i32, i32* %11
%78 = load double, double* %12
%79 = load double**, double*** %17
%80 = load double**, double*** %18
%81 = getelementptr inbounds [2 x double], [2 x double]* %28, i64 0, i64 0
%82 = load double*, double** %16
%83 = call double @getCoolingRate(i32 2, i32 1, double* %71, i32* %72, i32* %73, double* %74, double %75, double* %76, i32 %77, double %78, double** %79, double** %80, double* %81, double* %82)
store double %83, double* %29
%84 = load double, double* %29
ret double %84
}

LLVM IR (-O2):
@__const.finestruct_cooling_SiP.weights = [3 x double] [double 0.000000e+00, double 2.000000e+00, double 4.000000e+00]
@__const.finestruct_cooling_SiP.energy = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 4.140000e+02]
@__const.finestruct_cooling_SiP.EinsA = [2 x double] [double 0.000000e+00, double 2.100000e-04]
define double @finestruct_cooling_SiP(double %0, i32 %1, double %2, double %3, double %4, double %5, double* %6, double** %7, double** %8) {
%10 = alloca [3 x double]
%11 = alloca i64
%12 = alloca i64
%13 = alloca [3 x double]
%14 = alloca [2 x double]
%15 = alloca [2 x double]
%16 = bitcast [3 x double]* %10 to i8*
%17 = bitcast i64* %11 to i8*
store i64 4294967296, i64* %11
%18 = bitcast i64* %12 to i8*
store i64 8589934592, i64* %12
%19 = bitcast [3 x double]* %13 to i8*
%20 = bitcast [2 x double]* %14 to i8*
%21 = tail call double @pow(double %0, double -5.000000e-01)
%22 = fmul double %21, 1.200000e-05
%23 = bitcast [2 x double]* %15 to i8*
%24 = fmul double %4, 6.500000e-10
%25 = tail call double @llvm.fmuladd.f64(double %3, double %22, double %24)
%26 = tail call double @llvm.fmuladd.f64(double %5, double 6.500000e-10, double %25)
%27 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 0, i64 1
store double %26, double* %27
%28 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
%29 = bitcast i64* %11 to i32*
%30 = bitcast i64* %12 to i32*
%31 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
%32 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%33 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 0, i64 0
%34 = call double @getCoolingRate(i32 2, i32 1, double* %28, i32* %29, i32* %30, double* %31, double %0, double* %32, i32 %1, double %2, double** %7, double** %8, double* %33, double* %6)
ret double %34
}