#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 computeMetastableCoolingRate(int, int, double const *, int const *,
                                    int const *, double const *, double const *,
                                    double const *, double *, double const,
                                    double const, double const, double const);
double metastable_cooling_OI(const double densThis, const double Hdens,
                             const double elecDens, const double T) {
  const double weights[3 + 1] = {0.0, 1.0, 5.0, 9.0};
  const int lower[3 + 1] = {0, 2, 1, 1};
  const int upper[3 + 1] = {0, 3, 2, 3};
  const double energy[3 + 1] = {0.0, 2.3e4, 2.6e4, 4.9e4};
  const double EinsA[3 + 1] = {0.0, 6.7e-3, 1.3, 6.7e-2};
  const double elec_a[3 + 1] = {0.0, 5.1e-9, 5.2e-9, 2.5e-9};
  double elec_b[3 + 1];
  if (T < 1e4) {
    elec_b[1] = 0.57;
    elec_b[2] = 0.57;
    elec_b[3] = 0.57;
  }
  if (T >= 1e4) {
    elec_b[1] = 0.17;
    elec_b[2] = 0.15;
    elec_b[3] = 0.13;
  }
  return computeMetastableCoolingRate(3, 3, weights, lower, upper, energy,
                                      EinsA, elec_a, elec_b, densThis, Hdens,
                                      elecDens, T);
}


x86 assembly (clang, -O0):
<metastable_cooling_OI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    0xefa(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xef7(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xef4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xef1(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xf4e(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xf4b(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xf48(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xf45(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xeb6(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xe9e(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xe98(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    0xe92(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xe8c(%rip),%rax
mov    %rax,-0xa8(%rbp)
movsd  0xdd5(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1266 <metastable_cooling_OI+0x156>
movsd  0xdca(%rip),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  0xdba(%rip),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  0xdaa(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xd8d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     12ad <metastable_cooling_OI+0x19d>
movsd  0xd9b(%rip),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  0xd83(%rip),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  0xd6b(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
lea    -0x40(%rbp),%rdx
lea    -0x50(%rbp),%rcx
lea    -0x60(%rbp),%r8
lea    -0x80(%rbp),%r9
lea    -0xa0(%rbp),%r11
lea    -0xc0(%rbp),%r10
lea    -0xe0(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mov    $0x3,%esi
mov    %esi,%edi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <computeMetastableCoolingRate@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metastable_cooling_OI>:
sub    $0xc8,%rsp
movaps 0xf42(%rip),%xmm4
movaps %xmm4,0xb0(%rsp)
movaps 0xf23(%rip),%xmm4
movaps %xmm4,0xa0(%rsp)
movaps 0xef4(%rip),%xmm4
movaps %xmm4,0x30(%rsp)
movaps 0xef8(%rip),%xmm4
movaps %xmm4,0x20(%rsp)
movaps 0xf2c(%rip),%xmm4
movaps %xmm4,0x90(%rsp)
movaps 0xf0d(%rip),%xmm4
movaps %xmm4,0x80(%rsp)
movaps 0xf2e(%rip),%xmm4
movaps %xmm4,0x70(%rsp)
movaps 0xf12(%rip),%xmm4
movaps %xmm4,0x60(%rsp)
movaps 0xf36(%rip),%xmm4
movaps %xmm4,0x50(%rsp)
movaps 0xf1a(%rip),%xmm4
movaps %xmm4,0x40(%rsp)
movsd  0xe5d(%rip),%xmm4
ucomisd %xmm3,%xmm4
jbe    11c6 <metastable_cooling_OI+0xb6>
movapd 0xe5f(%rip),%xmm4
movupd %xmm4,0x8(%rsp)
movabs $0x3fe23d70a3d70a3d,%rax
3d e2 3f
mov    %rax,0x18(%rsp)
ucomisd 0xe32(%rip),%xmm3
jb     11ed <metastable_cooling_OI+0xdd>
movapd 0xe48(%rip),%xmm4
movupd %xmm4,0x8(%rsp)
movabs $0x3fc0a3d70a3d70a4,%rax
a3 c0 3f
mov    %rax,0x18(%rsp)
sub    $0x8,%rsp
lea    0x8(%rsp),%rax
lea    0x48(%rsp),%r10
lea    0x68(%rsp),%r11
lea    0xa8(%rsp),%rdx
lea    0x38(%rsp),%rcx
lea    0x28(%rsp),%r8
lea    0x88(%rsp),%r9
mov    $0x3,%edi
mov    $0x3,%esi
push   %rax
push   %r10
push   %r11
call   1030 <computeMetastableCoolingRate@plt>
add    $0xe8,%rsp
ret

LLVM IR (-O0):
@__const.metastable_cooling_OI.weights = [4 x double] [double 0.000000e+00, double 1.000000e+00, double 5.000000e+00, double 9.000000e+00]
@__const.metastable_cooling_OI.lower = [4 x i32] [i32 0, i32 2, i32 1, i32 1]
@__const.metastable_cooling_OI.upper = [4 x i32] [i32 0, i32 3, i32 2, i32 3]
@__const.metastable_cooling_OI.energy = [4 x double] [double 0.000000e+00, double 2.300000e+04, double 2.600000e+04, double 4.900000e+04]
@__const.metastable_cooling_OI.EinsA = [4 x double] [double 0.000000e+00, double 6.700000e-03, double 1.300000e+00, double 6.700000e-02]
@__const.metastable_cooling_OI.elec_a = [4 x double] [double 0.000000e+00, double 5.100000e-09, double 5.200000e-09, double 2.500000e-09]
define double @metastable_cooling_OI(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca [4 x double]
%10 = alloca [4 x i32]
%11 = alloca [4 x i32]
%12 = alloca [4 x double]
%13 = alloca [4 x double]
%14 = alloca [4 x double]
%15 = alloca [4 x double]
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%16 = bitcast [4 x double]* %9 to i8*
%17 = bitcast [4 x i32]* %10 to i8*
%18 = bitcast [4 x i32]* %11 to i8*
%19 = bitcast [4 x double]* %12 to i8*
%20 = bitcast [4 x double]* %13 to i8*
%21 = bitcast [4 x double]* %14 to i8*
%22 = load double, double* %8
%23 = fcmp olt double %22, 1.000000e+04
br i1 %23, label %24, label %28
24: ; preds = %4
%25 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 1
store double 5.700000e-01, double* %25
%26 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
store double 5.700000e-01, double* %26
%27 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
store double 5.700000e-01, double* %27
br label %28
28: ; preds = %24, %4
%29 = load double, double* %8
%30 = fcmp oge double %29, 1.000000e+04
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 1
store double 1.700000e-01, double* %32
%33 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
store double 1.500000e-01, double* %33
%34 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
store double 1.300000e-01, double* %34
br label %35
35: ; preds = %31, %28
%36 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%37 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 0
%38 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
%39 = getelementptr inbounds [4 x double], [4 x double]* %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 = load double, double* %5
%44 = load double, double* %6
%45 = load double, double* %7
%46 = load double, double* %8
%47 = call double @computeMetastableCoolingRate(i32 3, i32 3, double* %36, i32* %37, i32* %38, double* %39, double* %40, double* %41, double* %42, double %43, double %44, double %45, double %46)
ret double %47
}

LLVM IR (-O2):
@__const.metastable_cooling_OI.weights = [4 x double] [double 0.000000e+00, double 1.000000e+00, double 5.000000e+00, double 9.000000e+00]
@__const.metastable_cooling_OI.lower = [4 x i32] [i32 0, i32 2, i32 1, i32 1]
@__const.metastable_cooling_OI.upper = [4 x i32] [i32 0, i32 3, i32 2, i32 3]
@__const.metastable_cooling_OI.energy = [4 x double] [double 0.000000e+00, double 2.300000e+04, double 2.600000e+04, double 4.900000e+04]
@__const.metastable_cooling_OI.EinsA = [4 x double] [double 0.000000e+00, double 6.700000e-03, double 1.300000e+00, double 6.700000e-02]
@__const.metastable_cooling_OI.elec_a = [4 x double] [double 0.000000e+00, double 5.100000e-09, double 5.200000e-09, double 2.500000e-09]
define double @metastable_cooling_OI(double %0, double %1, double %2, double %3) {
%5 = alloca [4 x double]
%6 = alloca [4 x i32]
%7 = alloca [4 x i32]
%8 = alloca [4 x double]
%9 = alloca [4 x double]
%10 = alloca [4 x double]
%11 = alloca [4 x double]
%12 = bitcast [4 x double]* %5 to i8*
%13 = bitcast [4 x i32]* %6 to i8*
%14 = bitcast [4 x i32]* %7 to i8*
%15 = bitcast [4 x double]* %8 to i8*
%16 = bitcast [4 x double]* %9 to i8*
%17 = bitcast [4 x double]* %10 to i8*
%18 = bitcast [4 x double]* %11 to i8*
%19 = fcmp olt double %3, 1.000000e+04
br i1 %19, label %20, label %24
20: ; preds = %4
%21 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%22 = bitcast double* %21 to <2 x double>*
store <2 x double> <double 5.700000e-01, double 5.700000e-01>, <2 x double>* %22
%23 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 3
store double 5.700000e-01, double* %23
br label %24
24: ; preds = %20, %4
%25 = fcmp ult double %3, 1.000000e+04
br i1 %25, label %30, label %26
26: ; preds = %24
%27 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%28 = bitcast double* %27 to <2 x double>*
store <2 x double> <double 1.700000e-01, double 1.500000e-01>, <2 x double>* %28
%29 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 3
store double 1.300000e-01, double* %29
br label %30
30: ; preds = %26, %24
%31 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%34 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 0
%35 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%36 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%37 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%38 = call double @computeMetastableCoolingRate(i32 3, i32 3, double* %31, i32* %32, i32* %33, double* %34, double* %35, double* %36, double* %37, double %0, double %1, double %2, double %3)
ret double %38
}