#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 erfc(double);
double exp(double);
int log(int);
int /*<<< orphan*/ myWarn_Loc(int, char *, int, char *);
double sqrt(int);
double normInv(double p) {
  static const double A[] = {-3.969683028665376e+01, 2.209460984245205e+02,
                             -2.759285104469687e+02, 1.383577518672690e+02,
                             -3.066479806614716e+01, 2.506628277459239e+00};
  static const double B[] = {-5.447609879822406e+01, 1.615858368580409e+02,
                             -1.556989798598866e+02, 6.680131188771972e+01,
                             -1.328068155288572e+01};
  static const double C[] = {-7.784894002430293e-03, -3.223964580411365e-01,
                             -2.400758277161838e+00, -2.549732539343734e+00,
                             4.374664141464968e+00,  2.938163982698783e+00};
  static const double D[] = {7.784695709041462e-03, 3.224671290700398e-01,
                             2.445134137142996e+00, 3.754408661907416e+00};
  static const double p_low = 0.02425;
  static const double p_high = 0.97575;
  double x;
  double q;
  double r;
  double e;
  double u;
  if ((p > 0) && (p < p_low)) {
    q = sqrt(-2 * log(p));
    x = ((((((C[0] * q + C[1]) * q + C[2]) * q + C[3]) * q + C[4]) * q + C[5]) /
         ((((D[0] * q + D[1]) * q + D[2]) * q + D[3]) * q + 1));
  } else if ((p >= p_low) && (p <= p_high)) {
    q = p - 0.5;
    r = q * q;
    x = ((((((A[0] * r + A[1]) * r + A[2]) * r + A[3]) * r + A[4]) * r + A[5]) *
         q /
         (((((B[0] * r + B[1]) * r + B[2]) * r + B[3]) * r + B[4]) * r + 1));
  } else if ((p > p_high) && (p < 1)) {
    q = sqrt(-2 * log(1 - p));
    x = -(
        (((((C[0] * q + C[1]) * q + C[2]) * q + C[3]) * q + C[4]) * q + C[5]) /
        ((((D[0] * q + D[1]) * q + D[2]) * q + D[3]) * q + 1));
  } else {
    myWarn_Loc(3,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/brianmckenna/rex2nc/refs/"
               "heads/master/src/libaat/probability.c",
               238, "p is out of the valid range\n");
    return 0;
  }
  e = 0.5 * erfc(-x / sqrt(2)) - p;
  u = e * sqrt(2 * 3.14159265358979323846) * exp(x * x / 2);
  x = x - u / (1 + x * u / 2);
  return x;
}


x86 assembly (clang, -O0):
<normInv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1277 <normInv+0x127>
movsd  0xe89(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1277 <normInv+0x127>
cvttsd2si -0x10(%rbp),%edi
call   1040 <log@plt>
imul   $0xfffffffe,%eax,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xee7(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xeda(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xecd(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xec0(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xeb3(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  0xea6(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  0xe99(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  0xe8c(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xdab(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1531 <normInv+0x3e1>
movsd  -0x10(%rbp),%xmm0
movsd  0xd7c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     13bb <normInv+0x26b>
movsd  0xd72(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     13bb <normInv+0x26b>
movsd  -0x10(%rbp),%xmm0
movsd  0xd6a(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xd62(%rip),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  0xd5d(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  0xd50(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  0xd43(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  0xd36(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  0xd29(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xd1c(%rip),%xmm1
movsd  -0x28(%rbp),%xmm3
movsd  0xd17(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x28(%rbp),%xmm3
movsd  0xd0a(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x28(%rbp),%xmm3
movsd  0xcfd(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x28(%rbp),%xmm3
movsd  0xcf0(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc67(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    152c <normInv+0x3dc>
movsd  -0x10(%rbp),%xmm0
movsd  0xc40(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14fd <normInv+0x3ad>
movsd  0xc36(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    14fd <normInv+0x3ad>
movsd  0xc23(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
imul   $0xfffffffe,%eax,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xc7d(%rip),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xc78(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xc6b(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xc5e(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xc51(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xc44(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xc3c(%rip),%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  0xc37(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  0xc2a(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  0xc1d(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xb3c(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1527 <normInv+0x3d7>
mov    $0x3,%edi
lea    0xbe7(%rip),%rsi
mov    $0xee,%edx
lea    0xc74(%rip),%rcx
call   1060 <myWarn_Loc@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1632 <normInv+0x4e2>
jmp    152c <normInv+0x3dc>
jmp    1531 <normInv+0x3e1>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    $0x2,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1070 <erfc@plt>
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xa87(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    $0x6,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xa4b(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
mulsd  -0x38(%rbp),%xmm3
movsd  0xa15(%rip),%xmm2
divsd  %xmm2,%xmm3
movsd  0x9f9(%rip),%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normInv>:
sub    $0x38,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11f6 <normInv+0xa6>
movsd  0xe96(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11f6 <normInv+0xa6>
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
lea    (%rax,%rax,1),%edi
neg    %edi
call   1050 <sqrt@plt>
movsd  0xe83(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe7f(%rip),%xmm1
unpcklpd %xmm0,%xmm1
movapd 0xf33(%rip),%xmm3
movsd  %xmm0,%xmm3
mulpd  %xmm1,%xmm3
addpd  0xf33(%rip),%xmm3
unpcklpd %xmm0,%xmm0
mulpd  %xmm0,%xmm3
addpd  0xf33(%rip),%xmm3
mulpd  %xmm0,%xmm3
addpd  0xf37(%rip),%xmm3
mulpd  %xmm0,%xmm3
addpd  0xf3b(%rip),%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
divsd  %xmm0,%xmm3
jmp    138a <normInv+0x23a>
ucomisd 0xe02(%rip),%xmm0
jb     12c5 <normInv+0x175>
movsd  0xdfc(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     12c5 <normInv+0x175>
movsd  0xe4a(%rip),%xmm1
movsd  %xmm0,0x8(%rsp)
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe38(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xe34(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xe30(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xe2c(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xe28(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xe24(%rip),%xmm3
movsd  0xe24(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe20(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe1c(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe18(%rip),%xmm2
mulsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm2
addsd  0xe10(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xd54(%rip),%xmm2
divsd  %xmm2,%xmm3
jmp    138a <normInv+0x23a>
ucomisd 0xd3b(%rip),%xmm0
jbe    1435 <normInv+0x2e5>
movsd  0xd35(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1435 <normInv+0x2e5>
movsd  %xmm0,0x8(%rsp)
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <log@plt>
lea    (%rax,%rax,1),%edi
neg    %edi
call   1050 <sqrt@plt>
movsd  0xd0e(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xd0a(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xd06(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xd02(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xcfe(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  0xcfa(%rip),%xmm3
movsd  0xcfa(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xcf6(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xcf2(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xcee(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xc92(%rip),%xmm1
xorpd  0xd4a(%rip),%xmm3
divsd  %xmm1,%xmm3
movapd %xmm3,0x20(%rsp)
movapd 0xd38(%rip),%xmm0
xorpd  %xmm3,%xmm0
movapd %xmm0,0x10(%rsp)
mov    $0x2,%edi
call   1050 <sqrt@plt>
movapd 0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1070 <erfc@plt>
mulsd  0xd01(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x6,%edi
call   1050 <sqrt@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movapd 0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xccd(%rip),%xmm0
call   1030 <exp@plt>
movapd 0x20(%rsp),%xmm2
mulsd  0x10(%rsp),%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xcac(%rip),%xmm1
addsd  0xbec(%rip),%xmm1
divsd  %xmm1,%xmm0
subsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
add    $0x38,%rsp
ret
lea    0xcf4(%rip),%rsi
lea    0xd86(%rip),%rcx
mov    $0x3,%edi
mov    $0xee,%edx
call   1060 <myWarn_Loc@plt>
xorpd  %xmm2,%xmm2
jmp    142c <normInv+0x2dc>

LLVM IR (-O0):
@normInv.A = internal constant [6 x double] [double 0xC043D931BC1E0525, double 0x406B9E467034039B, double 0xC0713EDB2DC53B99, double 0x40614B72B40B401B, double 0xC03EAA3034C08BCD, double 0x40040D9320575479]
@normInv.B = internal constant [5 x double] [double 0xC04B3CF0CE3004C4, double 0x406432BF2CF04277, double 0xC063765E0B02D8D2, double 0x4050B348B1A7E9BE, double 0xC02A8FB57E147826]
@normInv.C = internal constant [6 x double] [double 0xBF7FE30D924ACFE0, double 0xBFD4A224C0E881B8, double 0xC00334C0C1701758, double 0xC00465DA2C703A1A, double 0x40117FA7F4EA4DC7, double 0x4007815C1E3FCFA2]
@normInv.D = internal constant [4 x double] [double 0x3F7FE2D857AC9FD4, double 0x3FD4A34D2B590364, double 0x40038FA27C8AE616, double 0x400E09076895B119]
@normInv.p_low = internal constant double 2.425000e-02
@normInv.p_high = internal constant double 9.757500e-01
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/brianmckenna/rex2nc/refs/heads/master/src/libaat/probability.c\00"
@.str.1 = [29 x i8] c"p is out of the valid range\0A\00"
define double @normInv(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
%9 = load double, double* %3
%10 = fcmp ogt double %9, 0.000000e+00
br i1 %10, label %11, label %49
11: ; preds = %1
%12 = load double, double* %3
%13 = fcmp olt double %12, 2.425000e-02
br i1 %13, label %14, label %49
14: ; preds = %11
%15 = load double, double* %3
%16 = fptosi double %15 to i32
%17 = call i32 @log(i32 %16)
%18 = mul nsw i32 -2, %17
%19 = call double @sqrt(i32 %18)
store double %19, double* %5
%20 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 0)
%21 = load double, double* %5
%22 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 1)
%23 = call double @llvm.fmuladd.f64(double %20, double %21, double %22)
%24 = load double, double* %5
%25 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 2)
%26 = call double @llvm.fmuladd.f64(double %23, double %24, double %25)
%27 = load double, double* %5
%28 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 3)
%29 = call double @llvm.fmuladd.f64(double %26, double %27, double %28)
%30 = load double, double* %5
%31 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 4)
%32 = call double @llvm.fmuladd.f64(double %29, double %30, double %31)
%33 = load double, double* %5
%34 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 5)
%35 = call double @llvm.fmuladd.f64(double %32, double %33, double %34)
%36 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @normInv.D, i64 0, i64 0)
%37 = load double, double* %5
%38 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @normInv.D, i64 0, i64 1)
%39 = call double @llvm.fmuladd.f64(double %36, double %37, double %38)
%40 = load double, double* %5
%41 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @normInv.D, i64 0, i64 2)
%42 = call double @llvm.fmuladd.f64(double %39, double %40, double %41)
%43 = load double, double* %5
%44 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @normInv.D, i64 0, i64 3)
%45 = call double @llvm.fmuladd.f64(double %42, double %43, double %44)
%46 = load double, double* %5
%47 = call double @llvm.fmuladd.f64(double %45, double %46, double 1.000000e+00)
%48 = fdiv double %35, %47
store double %48, double* %4
br label %142
49: ; preds = %11, %1
%50 = load double, double* %3
%51 = fcmp oge double %50, 2.425000e-02
br i1 %51, label %52, label %95
52: ; preds = %49
%53 = load double, double* %3
%54 = fcmp ole double %53, 9.757500e-01
br i1 %54, label %55, label %95
55: ; preds = %52
%56 = load double, double* %3
%57 = fsub double %56, 5.000000e-01
store double %57, double* %5
%58 = load double, double* %5
%59 = load double, double* %5
%60 = fmul double %58, %59
store double %60, double* %6
%61 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.A, i64 0, i64 0)
%62 = load double, double* %6
%63 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.A, i64 0, i64 1)
%64 = call double @llvm.fmuladd.f64(double %61, double %62, double %63)
%65 = load double, double* %6
%66 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.A, i64 0, i64 2)
%67 = call double @llvm.fmuladd.f64(double %64, double %65, double %66)
%68 = load double, double* %6
%69 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.A, i64 0, i64 3)
%70 = call double @llvm.fmuladd.f64(double %67, double %68, double %69)
%71 = load double, double* %6
%72 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.A, i64 0, i64 4)
%73 = call double @llvm.fmuladd.f64(double %70, double %71, double %72)
%74 = load double, double* %6
%75 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.A, i64 0, i64 5)
%76 = call double @llvm.fmuladd.f64(double %73, double %74, double %75)
%77 = load double, double* %5
%78 = fmul double %76, %77
%79 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @normInv.B, i64 0, i64 0)
%80 = load double, double* %6
%81 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @normInv.B, i64 0, i64 1)
%82 = call double @llvm.fmuladd.f64(double %79, double %80, double %81)
%83 = load double, double* %6
%84 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @normInv.B, i64 0, i64 2)
%85 = call double @llvm.fmuladd.f64(double %82, double %83, double %84)
%86 = load double, double* %6
%87 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @normInv.B, i64 0, i64 3)
%88 = call double @llvm.fmuladd.f64(double %85, double %86, double %87)
%89 = load double, double* %6
%90 = load double, double* getelementptr inbounds ([5 x double], [5 x double]* @normInv.B, i64 0, i64 4)
%91 = call double @llvm.fmuladd.f64(double %88, double %89, double %90)
%92 = load double, double* %6
%93 = call double @llvm.fmuladd.f64(double %91, double %92, double 1.000000e+00)
%94 = fdiv double %78, %93
store double %94, double* %4
br label %141
95: ; preds = %52, %49
%96 = load double, double* %3
%97 = fcmp ogt double %96, 9.757500e-01
br i1 %97, label %98, label %138
98: ; preds = %95
%99 = load double, double* %3
%100 = fcmp olt double %99, 1.000000e+00
br i1 %100, label %101, label %138
101: ; preds = %98
%102 = load double, double* %3
%103 = fsub double 1.000000e+00, %102
%104 = fptosi double %103 to i32
%105 = call i32 @log(i32 %104)
%106 = mul nsw i32 -2, %105
%107 = call double @sqrt(i32 %106)
store double %107, double* %5
%108 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 0)
%109 = load double, double* %5
%110 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 1)
%111 = call double @llvm.fmuladd.f64(double %108, double %109, double %110)
%112 = load double, double* %5
%113 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 2)
%114 = call double @llvm.fmuladd.f64(double %111, double %112, double %113)
%115 = load double, double* %5
%116 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 3)
%117 = call double @llvm.fmuladd.f64(double %114, double %115, double %116)
%118 = load double, double* %5
%119 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 4)
%120 = call double @llvm.fmuladd.f64(double %117, double %118, double %119)
%121 = load double, double* %5
%122 = load double, double* getelementptr inbounds ([6 x double], [6 x double]* @normInv.C, i64 0, i64 5)
%123 = call double @llvm.fmuladd.f64(double %120, double %121, double %122)
%124 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @normInv.D, i64 0, i64 0)
%125 = load double, double* %5
%126 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @normInv.D, i64 0, i64 1)
%127 = call double @llvm.fmuladd.f64(double %124, double %125, double %126)
%128 = load double, double* %5
%129 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @normInv.D, i64 0, i64 2)
%130 = call double @llvm.fmuladd.f64(double %127, double %128, double %129)
%131 = load double, double* %5
%132 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @normInv.D, i64 0, i64 3)
%133 = call double @llvm.fmuladd.f64(double %130, double %131, double %132)
%134 = load double, double* %5
%135 = call double @llvm.fmuladd.f64(double %133, double %134, double 1.000000e+00)
%136 = fdiv double %123, %135
%137 = fneg double %136
store double %137, double* %4
br label %140
138: ; preds = %98, %95
%139 = call i32 @myWarn_Loc(i32 3, i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 238, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store double 0.000000e+00, double* %2
br label %170
140: ; preds = %101
br label %141
141: ; preds = %140, %55
br label %142
142: ; preds = %141, %14
%143 = load double, double* %4
%144 = fneg double %143
%145 = call double @sqrt(i32 2)
%146 = fdiv double %144, %145
%147 = call double @erfc(double %146)
%148 = load double, double* %3
%149 = fneg double %148
%150 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %147, double %149)
store double %150, double* %7
%151 = load double, double* %7
%152 = call double @sqrt(i32 6)
%153 = fmul double %151, %152
%154 = load double, double* %4
%155 = load double, double* %4
%156 = fmul double %154, %155
%157 = fdiv double %156, 2.000000e+00
%158 = call double @exp(double %157)
%159 = fmul double %153, %158
store double %159, double* %8
%160 = load double, double* %4
%161 = load double, double* %8
%162 = load double, double* %4
%163 = load double, double* %8
%164 = fmul double %162, %163
%165 = fdiv double %164, 2.000000e+00
%166 = fadd double 1.000000e+00, %165
%167 = fdiv double %161, %166
%168 = fsub double %160, %167
store double %168, double* %4
%169 = load double, double* %4
store double %169, double* %2
br label %170
170: ; preds = %142, %138
%171 = load double, double* %2
ret double %171
}

LLVM IR (-O2):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/brianmckenna/rex2nc/refs/heads/master/src/libaat/probability.c\00"
@.str.1 = [29 x i8] c"p is out of the valid range\0A\00"
define double @normInv(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 2.425000e-02
%4 = and i1 %2, %3
br i1 %4, label %5, label %23
5: ; preds = %1
%6 = fptosi double %0 to i32
%7 = tail call i32 @log(i32 %6)
%8 = mul nsw i32 %7, -2
%9 = tail call double @sqrt(i32 %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0xBF7FE30D924ACFE0, double 0xBFD4A224C0E881B8)
%11 = insertelement <2 x double> poison, double %10, i64 0
%12 = insertelement <2 x double> %11, double %9, i64 1
%13 = insertelement <2 x double> <double poison, double 0x3F7FE2D857AC9FD4>, double %9, i64 0
%14 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> %13, <2 x double> <double 0xC00334C0C1701758, double 0x3FD4A34D2B590364>)
%15 = insertelement <2 x double> poison, double %9, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %16, <2 x double> <double 0xC00465DA2C703A1A, double 0x40038FA27C8AE616>)
%18 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %17, <2 x double> %16, <2 x double> <double 0x40117FA7F4EA4DC7, double 0x400E09076895B119>)
%19 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> %16, <2 x double> <double 0x4007815C1E3FCFA2, double 1.000000e+00>)
%20 = extractelement <2 x double> %19, i64 0
%21 = extractelement <2 x double> %19, i64 1
%22 = fdiv double %20, %21
br label %65
23: ; preds = %1
%24 = fcmp oge double %0, 2.425000e-02
%25 = fcmp ole double %0, 9.757500e-01
%26 = and i1 %24, %25
br i1 %26, label %27, label %42
27: ; preds = %23
%28 = fadd double %0, -5.000000e-01
%29 = fmul double %28, %28
%30 = tail call double @llvm.fmuladd.f64(double %29, double 0xC043D931BC1E0525, double 0x406B9E467034039B)
%31 = tail call double @llvm.fmuladd.f64(double %30, double %29, double 0xC0713EDB2DC53B99)
%32 = tail call double @llvm.fmuladd.f64(double %31, double %29, double 0x40614B72B40B401B)
%33 = tail call double @llvm.fmuladd.f64(double %32, double %29, double 0xC03EAA3034C08BCD)
%34 = tail call double @llvm.fmuladd.f64(double %33, double %29, double 0x40040D9320575479)
%35 = fmul double %28, %34
%36 = tail call double @llvm.fmuladd.f64(double %29, double 0xC04B3CF0CE3004C4, double 0x406432BF2CF04277)
%37 = tail call double @llvm.fmuladd.f64(double %36, double %29, double 0xC063765E0B02D8D2)
%38 = tail call double @llvm.fmuladd.f64(double %37, double %29, double 0x4050B348B1A7E9BE)
%39 = tail call double @llvm.fmuladd.f64(double %38, double %29, double 0xC02A8FB57E147826)
%40 = tail call double @llvm.fmuladd.f64(double %39, double %29, double 1.000000e+00)
%41 = fdiv double %35, %40
br label %65
42: ; preds = %23
%43 = fcmp ogt double %0, 9.757500e-01
%44 = fcmp olt double %0, 1.000000e+00
%45 = and i1 %43, %44
br i1 %45, label %46, label %63
46: ; preds = %42
%47 = fsub double 1.000000e+00, %0
%48 = fptosi double %47 to i32
%49 = tail call i32 @log(i32 %48)
%50 = mul nsw i32 %49, -2
%51 = tail call double @sqrt(i32 %50)
%52 = tail call double @llvm.fmuladd.f64(double %51, double 0xBF7FE30D924ACFE0, double 0xBFD4A224C0E881B8)
%53 = tail call double @llvm.fmuladd.f64(double %52, double %51, double 0xC00334C0C1701758)
%54 = tail call double @llvm.fmuladd.f64(double %53, double %51, double 0xC00465DA2C703A1A)
%55 = tail call double @llvm.fmuladd.f64(double %54, double %51, double 0x40117FA7F4EA4DC7)
%56 = tail call double @llvm.fmuladd.f64(double %55, double %51, double 0x4007815C1E3FCFA2)
%57 = tail call double @llvm.fmuladd.f64(double %51, double 0x3F7FE2D857AC9FD4, double 0x3FD4A34D2B590364)
%58 = tail call double @llvm.fmuladd.f64(double %57, double %51, double 0x40038FA27C8AE616)
%59 = tail call double @llvm.fmuladd.f64(double %58, double %51, double 0x400E09076895B119)
%60 = tail call double @llvm.fmuladd.f64(double %59, double %51, double 1.000000e+00)
%61 = fneg double %56
%62 = fdiv double %61, %60
br label %65
63: ; preds = %42
%64 = tail call i32 @myWarn_Loc(i32 3, i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 238, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %84
65: ; preds = %27, %46, %5
%66 = phi double [ %22, %5 ], [ %41, %27 ], [ %62, %46 ]
%67 = fneg double %66
%68 = tail call double @sqrt(i32 2)
%69 = fdiv double %67, %68
%70 = tail call double @erfc(double %69)
%71 = fneg double %0
%72 = tail call double @llvm.fmuladd.f64(double %70, double 5.000000e-01, double %71)
%73 = tail call double @sqrt(i32 6)
%74 = fmul double %72, %73
%75 = fmul double %66, %66
%76 = fmul double %75, 5.000000e-01
%77 = tail call double @exp(double %76)
%78 = fmul double %74, %77
%79 = fmul double %66, %78
%80 = fmul double %79, 5.000000e-01
%81 = fadd double %80, 1.000000e+00
%82 = fdiv double %78, %81
%83 = fsub double %66, %82
br label %84
84: ; preds = %65, %63
%85 = phi double [ %83, %65 ], [ 0.000000e+00, %63 ]
ret double %85
}