#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 */
int /*<<< orphan*/ myWarn_Loc(int, char *, int, char *);
double normInv(double);
double probNormDist(double);
double probNormBound(double prob, double left) {
  double lftProb;
  if ((left < 0) || (prob > .5) || (prob < 0)) {
    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",
               296, "need: left >= 0, 0 <= prob <= .5\n");
    return .5;
  }
  lftProb = probNormDist(left);
  if (prob + lftProb > .5) {
    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",
               301, "'left' is too far right for requested prob.\n");
    return .5;
  }
  prob += lftProb;
  return normInv(prob + .5);
}


x86 assembly (clang, -O0):
<probNormBound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     1175 <probNormBound+0x45>
movsd  -0x10(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1175 <probNormBound+0x45>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11a4 <probNormBound+0x74>
mov    $0x3,%edi
lea    0xe87(%rip),%rsi
mov    $0x128,%edx
lea    0xf14(%rip),%rcx
call   1040 <myWarn_Loc@plt>
movsd  0xe66(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1224 <probNormBound+0xf4>
movsd  -0x18(%rbp),%xmm0
call   1050 <probNormDist@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xe3b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11fe <probNormBound+0xce>
mov    $0x3,%edi
lea    0xe2d(%rip),%rsi
mov    $0x12d,%edx
lea    0xedc(%rip),%rcx
call   1040 <myWarn_Loc@plt>
movsd  0xe0c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1224 <probNormBound+0xf4>
movsd  -0x20(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xdeb(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <normInv@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<probNormBound>:
push   %rax
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
ja     118a <probNormBound+0x5a>
ucomisd 0xeb9(%rip),%xmm2
ja     118a <probNormBound+0x5a>
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     118a <probNormBound+0x5a>
movapd %xmm1,%xmm0
movsd  %xmm2,(%rsp)
call   1050 <probNormDist@plt>
addsd  (%rsp),%xmm0
ucomisd 0xe92(%rip),%xmm0
jbe    11b1 <probNormBound+0x81>
lea    0xe91(%rip),%rsi
lea    0xf45(%rip),%rcx
mov    $0x3,%edi
mov    $0x12d,%edx
jmp    11a2 <probNormBound+0x72>
lea    0xe77(%rip),%rsi
lea    0xf09(%rip),%rcx
mov    $0x3,%edi
mov    $0x128,%edx
call   1040 <myWarn_Loc@plt>
movsd  0xe51(%rip),%xmm0
pop    %rax
ret
addsd  0xe47(%rip),%xmm0
pop    %rax
jmp    1030 <normInv@plt>

LLVM IR (-O0):
@.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 = [34 x i8] c"need: left >= 0, 0 <= prob <= .5\0A\00"
@.str.2 = [45 x i8] c"'left' is too far right for requested prob.\0A\00"
define double @probNormBound(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %5
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load double, double* %4
%11 = fcmp ogt double %10, 5.000000e-01
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load double, double* %4
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %15, label %17
15: ; preds = %12, %9, %2
%16 = call i32 @myWarn_Loc(i32 3, i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 296, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store double 5.000000e-01, double* %3
br label %33
17: ; preds = %12
%18 = load double, double* %5
%19 = call double @probNormDist(double %18)
store double %19, double* %6
%20 = load double, double* %4
%21 = load double, double* %6
%22 = fadd double %20, %21
%23 = fcmp ogt double %22, 5.000000e-01
br i1 %23, label %24, label %26
24: ; preds = %17
%25 = call i32 @myWarn_Loc(i32 3, i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 301, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
store double 5.000000e-01, double* %3
br label %33
26: ; preds = %17
%27 = load double, double* %6
%28 = load double, double* %4
%29 = fadd double %28, %27
store double %29, double* %4
%30 = load double, double* %4
%31 = fadd double %30, 5.000000e-01
%32 = call double @normInv(double %31)
store double %32, double* %3
br label %33
33: ; preds = %26, %24, %15
%34 = load double, double* %3
ret double %34
}

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 = [34 x i8] c"need: left >= 0, 0 <= prob <= .5\0A\00"
@.str.2 = [45 x i8] c"'left' is too far right for requested prob.\0A\00"
define double @probNormBound(double %0, double %1) {
%3 = fcmp olt double %1, 0.000000e+00
%4 = fcmp ogt double %0, 5.000000e-01
%5 = or i1 %4, %3
%6 = fcmp olt double %0, 0.000000e+00
%7 = or i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @myWarn_Loc(i32 3, i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 296, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %19
10: ; preds = %2
%11 = tail call double @probNormDist(double %1)
%12 = fadd double %11, %0
%13 = fcmp ogt double %12, 5.000000e-01
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = tail call i32 @myWarn_Loc(i32 3, i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 301, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
br label %19
16: ; preds = %10
%17 = fadd double %12, 5.000000e-01
%18 = tail call double @normInv(double %17)
br label %19
19: ; preds = %16, %14, %8
%20 = phi double [ 5.000000e-01, %8 ], [ 5.000000e-01, %14 ], [ %18, %16 ]
ret double %20
}