#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_CP(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, 92e0};
  const double EinsA[1 + 1] = {0.0, 2.4e-6};
  const double col_e[1 + 1] = {0.0, 1.4e-6 * pow(T, -0.37)};
  const double col_H[1 + 1] = {0.0, 5.8e-10 * pow(T, 0.02)};
  const double col_H2[1 + 1] = {0.0, 3.1e-10 * pow(T, 0.1)};
  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_CP>:
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    0xee1(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0xb8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xe35(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe1d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xdf1(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xdd9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xdad(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xd95(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movl   $0x1,-0xf4(%rbp)
cmpl   $0x1,-0xf4(%rbp)
jg     1301 <finestruct_cooling_CP+0x1e1>
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    1281 <finestruct_cooling_CP+0x161>
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_CP>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
movsd  %xmm4,0x30(%rsp)
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  %xmm1,0x38(%rsp)
mov    %edi,%r12d
movsd  %xmm0,0x8(%rsp)
mov    0xee1(%rip),%rax
mov    %rax,0xa0(%rsp)
movaps 0xec2(%rip),%xmm1
movaps %xmm1,0x90(%rsp)
movabs $0x100000000,%rax
mov    %rax,0x48(%rsp)
movabs $0x200000000,%rax
mov    %rax,0x40(%rsp)
mov    0xec5(%rip),%rax
mov    %rax,0x80(%rsp)
movaps 0xea6(%rip),%xmm1
movaps %xmm1,0x70(%rsp)
movaps 0xeba(%rip),%xmm1
movaps %xmm1,0x60(%rsp)
movsd  0xe3d(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xe38(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0xe32(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xe27(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xe21(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xe16(%rip),%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  0x20(%rsp),%xmm2
movsd  0x18(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm1
addsd  %xmm2,%xmm1
mulsd  0x30(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x58(%rsp)
lea    0x50(%rsp),%rax
lea    0x60(%rsp),%r10
lea    0x90(%rsp),%rdx
lea    0x48(%rsp),%rcx
lea    0x40(%rsp),%r8
lea    0x70(%rsp),%r9
mov    $0x2,%edi
mov    $0x1,%esi
movsd  0x8(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
push   %rbx
push   %rax
push   %r15
push   %r14
push   %r12
push   %r10
call   1030 <getCoolingRate@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.finestruct_cooling_CP.weights = [3 x double] [double 0.000000e+00, double 2.000000e+00, double 4.000000e+00]
@__const.finestruct_cooling_CP.lower = [2 x i32] [i32 0, i32 1]
@__const.finestruct_cooling_CP.upper = [2 x i32] [i32 0, i32 2]
@__const.finestruct_cooling_CP.energy = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 9.200000e+01]
@__const.finestruct_cooling_CP.EinsA = [2 x double] [double 0.000000e+00, double 2.400000e-06]
define double @finestruct_cooling_CP(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 -3.700000e-01)
%39 = fmul double 1.400000e-06, %38
store double %39, double* %36
%40 = getelementptr inbounds [2 x double], [2 x double]* %25, i64 0, i64 0
store double 0.000000e+00, double* %40
%41 = getelementptr inbounds double, double* %40, i64 1
%42 = load double, double* %10
%43 = call double @pow(double %42, double 2.000000e-02)
%44 = fmul double 0x3E03EDBBE4560327, %43
store double %44, double* %41
%45 = getelementptr inbounds [2 x double], [2 x double]* %26, i64 0, i64 0
store double 0.000000e+00, double* %45
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = load double, double* %10
%48 = call double @pow(double %47, double 1.000000e-01)
%49 = fmul double 3.100000e-10, %48
store double %49, double* %46
store i32 1, i32* %27
br label %50
50: ; preds = %75, %9
%51 = load i32, i32* %27
%52 = icmp sle i32 %51, 1
br i1 %52, label %53, label %78
53: ; preds = %50
%54 = load double, double* %13
%55 = load i32, i32* %27
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [2 x double], [2 x double]* %24, i64 0, i64 %56
%58 = load double, double* %57
%59 = load double, double* %14
%60 = load i32, i32* %27
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [2 x double], [2 x double]* %25, i64 0, i64 %61
%63 = load double, double* %62
%64 = fmul double %59, %63
%65 = call double @llvm.fmuladd.f64(double %54, double %58, double %64)
%66 = load double, double* %15
%67 = load i32, i32* %27
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [2 x double], [2 x double]* %26, i64 0, i64 %68
%70 = load double, double* %69
%71 = call double @llvm.fmuladd.f64(double %66, double %70, double %65)
%72 = load i32, i32* %27
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [2 x double], [2 x double]* %28, i64 0, i64 %73
store double %71, double* %74
br label %75
75: ; preds = %53
%76 = load i32, i32* %27
%77 = add nsw i32 %76, 1
store i32 %77, i32* %27
br label %50
78: ; preds = %50
%79 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 0
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %20, i64 0, i64 0
%81 = getelementptr inbounds [2 x i32], [2 x i32]* %21, i64 0, i64 0
%82 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 0, i64 0
%83 = load double, double* %10
%84 = getelementptr inbounds [2 x double], [2 x double]* %23, i64 0, i64 0
%85 = load i32, i32* %11
%86 = load double, double* %12
%87 = load double**, double*** %17
%88 = load double**, double*** %18
%89 = getelementptr inbounds [2 x double], [2 x double]* %28, i64 0, i64 0
%90 = load double*, double** %16
%91 = call double @getCoolingRate(i32 2, i32 1, double* %79, i32* %80, i32* %81, double* %82, double %83, double* %84, i32 %85, double %86, double** %87, double** %88, double* %89, double* %90)
store double %91, double* %29
%92 = load double, double* %29
ret double %92
}

LLVM IR (-O2):
@__const.finestruct_cooling_CP.weights = [3 x double] [double 0.000000e+00, double 2.000000e+00, double 4.000000e+00]
@__const.finestruct_cooling_CP.energy = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 9.200000e+01]
@__const.finestruct_cooling_CP.EinsA = [2 x double] [double 0.000000e+00, double 2.400000e-06]
define double @finestruct_cooling_CP(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 -3.700000e-01)
%22 = fmul double %21, 1.400000e-06
%23 = tail call double @pow(double %0, double 2.000000e-02)
%24 = fmul double %23, 0x3E03EDBBE4560327
%25 = tail call double @pow(double %0, double 1.000000e-01)
%26 = fmul double %25, 3.100000e-10
%27 = bitcast [2 x double]* %15 to i8*
%28 = fmul double %24, %4
%29 = tail call double @llvm.fmuladd.f64(double %3, double %22, double %28)
%30 = tail call double @llvm.fmuladd.f64(double %5, double %26, double %29)
%31 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 0, i64 1
store double %30, double* %31
%32 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
%33 = bitcast i64* %11 to i32*
%34 = bitcast i64* %12 to i32*
%35 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
%36 = getelementptr inbounds [2 x double], [2 x double]* %14, i64 0, i64 0
%37 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 0, i64 0
%38 = call double @getCoolingRate(i32 2, i32 1, double* %32, i32* %33, i32* %34, double* %35, double %0, double* %36, i32 %1, double %2, double** %7, double** %8, double* %37, double* %6)
ret double %38
}