#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*/ cdflib_cumnor(double *, double *, double *);
double cdflib_dinvnr(double *, double *);
double dpmpar(int const);
double fabs(double);
void cdflib_cdfnor(const int *which, double *p, double *q, double *x,
                   double *mean, double *sd, int *status, double *bound) {
  static const int K1 = 1;
  double z, pq;
  *status = 0;
  *bound = 0.0;
  *status = 0;
  if (!(*which < 1 || *which > 4)) {
    goto S30;
  }
  if (!(*which < 1)) {
    goto S10;
  }
  *bound = 1.0e0;
  goto S20;
S10:
  *bound = 4.0e0;
S20:
  *status = -1;
  return;
S30:
  if (*which == 1) {
    goto S70;
  }
  if (!(*p <= 0.0e0 || *p > 1.0e0)) {
    goto S60;
  }
  if (!(*p <= 0.0e0)) {
    goto S40;
  }
  *bound = 0.0e0;
  goto S50;
S40:
  *bound = 1.0e0;
S50:
  *status = -2;
  return;
S70:
S60:
  if (*which == 1) {
    goto S110;
  }
  if (!(*q <= 0.0e0 || *q > 1.0e0)) {
    goto S100;
  }
  if (!(*q <= 0.0e0)) {
    goto S80;
  }
  *bound = 0.0e0;
  goto S90;
S80:
  *bound = 1.0e0;
S90:
  *status = -3;
  return;
S110:
S100:
  if (*which == 1) {
    goto S150;
  }
  pq = *p + *q;
  if (!(fabs(pq - 0.5e0 - 0.5e0) > 3.0e0 * dpmpar(K1))) {
    goto S140;
  }
  if (!(pq < 0.0e0)) {
    goto S120;
  }
  *bound = 0.0e0;
  goto S130;
S120:
  *bound = 1.0e0;
S130:
  *status = 3;
  return;
S150:
S140:
  if (*which == 4) {
    goto S170;
  }
  if (!(*sd <= 0.0e0)) {
    goto S160;
  }
  *bound = 0.0e0;
  *status = -6;
  return;
S170:
S160:
  if (1 == *which) {
    z = (*x - *mean) / *sd;
    cdflib_cumnor(&z, p, q);
  } else if (2 == *which) {
    z = cdflib_dinvnr(p, q);
    *x = *sd * z + *mean;
  } else if (3 == *which) {
    z = cdflib_dinvnr(p, q);
    *mean = *x - *sd * z;
  } else if (4 == *which) {
    z = cdflib_dinvnr(p, q);
    *sd = (*x - *mean) / z;
  }
  return;
}


x86 assembly (clang, -O0):
<cdflib_cdfnor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jl     1196 <cdflib_cdfnor+0x66>
mov    -0x8(%rbp),%rax
cmpl   $0x4,(%rax)
jg     1196 <cdflib_cdfnor+0x66>
jmp    11dc <cdflib_cdfnor+0xac>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jl     11a8 <cdflib_cdfnor+0x78>
jmp    11bd <cdflib_cdfnor+0x8d>
mov    0x18(%rbp),%rax
movsd  0xe4c(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    11cd <cdflib_cdfnor+0x9d>
mov    0x18(%rbp),%rax
movsd  0xe4f(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    154c <cdflib_cdfnor+0x41c>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    11ee <cdflib_cdfnor+0xbe>
jmp    1263 <cdflib_cdfnor+0x133>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    121e <cdflib_cdfnor+0xee>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xdf1(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     121e <cdflib_cdfnor+0xee>
jmp    1268 <cdflib_cdfnor+0x138>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    1234 <cdflib_cdfnor+0x104>
jmp    1244 <cdflib_cdfnor+0x114>
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1254 <cdflib_cdfnor+0x124>
mov    0x18(%rbp),%rax
movsd  0xdb0(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0xfffffffe,(%rax)
jmp    154c <cdflib_cdfnor+0x41c>
jmp    1268 <cdflib_cdfnor+0x138>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    127a <cdflib_cdfnor+0x14a>
jmp    12ef <cdflib_cdfnor+0x1bf>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    12aa <cdflib_cdfnor+0x17a>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xd65(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     12aa <cdflib_cdfnor+0x17a>
jmp    12f4 <cdflib_cdfnor+0x1c4>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    12c0 <cdflib_cdfnor+0x190>
jmp    12d0 <cdflib_cdfnor+0x1a0>
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    12e0 <cdflib_cdfnor+0x1b0>
mov    0x18(%rbp),%rax
movsd  0xd24(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0xfffffffd,(%rax)
jmp    154c <cdflib_cdfnor+0x41c>
jmp    12f4 <cdflib_cdfnor+0x1c4>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1306 <cdflib_cdfnor+0x1d6>
jmp    13b7 <cdflib_cdfnor+0x287>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xce8(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xcdc(%rip),%xmm1
subsd  %xmm1,%xmm0
movaps 0xce1(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    $0x1,%edi
call   1040 <dpmpar@plt>
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movsd  0xca6(%rip),%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
ja     1375 <cdflib_cdfnor+0x245>
jmp    13bc <cdflib_cdfnor+0x28c>
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
ja     1388 <cdflib_cdfnor+0x258>
jmp    1398 <cdflib_cdfnor+0x268>
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    13a8 <cdflib_cdfnor+0x278>
mov    0x18(%rbp),%rax
movsd  0xc5c(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0x3,(%rax)
jmp    154c <cdflib_cdfnor+0x41c>
jmp    13bc <cdflib_cdfnor+0x28c>
mov    -0x8(%rbp),%rax
cmpl   $0x4,(%rax)
jne    13ce <cdflib_cdfnor+0x29e>
jmp    13fe <cdflib_cdfnor+0x2ce>
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    13e4 <cdflib_cdfnor+0x2b4>
jmp    1403 <cdflib_cdfnor+0x2d3>
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0xfffffffa,(%rax)
jmp    154c <cdflib_cdfnor+0x41c>
jmp    1403 <cdflib_cdfnor+0x2d3>
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
cmp    (%rcx),%eax
jne    1447 <cdflib_cdfnor+0x317>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x38(%rbp),%rdi
call   1050 <cdflib_cumnor@plt>
jmp    1547 <cdflib_cdfnor+0x417>
mov    -0x8(%rbp),%rcx
mov    $0x2,%eax
cmp    (%rcx),%eax
jne    1494 <cdflib_cdfnor+0x364>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <cdflib_dinvnr@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1542 <cdflib_cdfnor+0x412>
mov    -0x8(%rbp),%rcx
mov    $0x3,%eax
cmp    (%rcx),%eax
jne    14f8 <cdflib_cdfnor+0x3c8>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <cdflib_dinvnr@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    153d <cdflib_cdfnor+0x40d>
mov    -0x8(%rbp),%rcx
mov    $0x4,%eax
cmp    (%rcx),%eax
jne    1538 <cdflib_cdfnor+0x408>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <cdflib_dinvnr@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    153d <cdflib_cdfnor+0x40d>
jmp    1542 <cdflib_cdfnor+0x412>
jmp    1547 <cdflib_cdfnor+0x417>
jmp    154c <cdflib_cdfnor+0x41c>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_cdfnor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rdx,%r12
mov    0x88(%rsp),%r15
mov    0x80(%rsp),%r14
movq   $0x0,(%r15)
movl   $0x0,(%r14)
mov    (%rdi),%edx
lea    -0x5(%rdx),%eax
cmp    $0xfffffffb,%eax
ja     118d <cdflib_cdfnor+0x5d>
xor    %eax,%eax
test   %edx,%edx
setle  %al
lea    0xeb9(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%r15)
movl   $0xffffffff,(%r14)
jmp    13a1 <cdflib_cdfnor+0x271>
mov    %r9,%r13
mov    %rsi,%rbx
mov    $0x1,%eax
cmp    $0x1,%edx
jne    11fb <cdflib_cdfnor+0xcb>
movsd  0x0(%r13),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    12c0 <cdflib_cdfnor+0x190>
mov    %rcx,%rbp
mov    %r8,%r14
cmp    $0x3,%eax
je     1317 <cdflib_cdfnor+0x1e7>
cmp    $0x2,%eax
je     133e <cdflib_cdfnor+0x20e>
cmp    $0x1,%eax
jne    13a1 <cdflib_cdfnor+0x271>
movsd  0x0(%rbp),%xmm1
subsd  (%r14),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1050 <cdflib_cumnor@plt>
jmp    13a1 <cdflib_cdfnor+0x271>
movsd  (%rbx),%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
jae    12d3 <cdflib_cdfnor+0x1a3>
ucomisd 0xdeb(%rip),%xmm2
ja     12d3 <cdflib_cdfnor+0x1a3>
movsd  (%r12),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    12f5 <cdflib_cdfnor+0x1c5>
ucomisd 0xdc9(%rip),%xmm0
ja     12f5 <cdflib_cdfnor+0x1c5>
mov    %rdi,%rbp
mov    %rcx,0x10(%rsp)
mov    %r8,0x18(%rsp)
addsd  %xmm0,%xmm2
movapd %xmm2,0x20(%rsp)
movsd  0xdac(%rip),%xmm0
addsd  %xmm0,%xmm2
addsd  %xmm0,%xmm2
andpd  0xdb4(%rip),%xmm2
movapd %xmm2,0x30(%rsp)
mov    $0x1,%edi
call   1040 <dpmpar@plt>
mulsd  0xd8c(%rip),%xmm0
movapd 0x30(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    1361 <cdflib_cdfnor+0x231>
xorpd  %xmm0,%xmm0
movapd 0x20(%rsp),%xmm1
cmpltsd %xmm0,%xmm1
movsd  0xd55(%rip),%xmm0
andnpd %xmm0,%xmm1
movlpd %xmm1,(%r15)
movl   $0x3,(%r14)
jmp    13a1 <cdflib_cdfnor+0x271>
movq   $0x0,(%r15)
movl   $0xfffffffa,(%r14)
jmp    13a1 <cdflib_cdfnor+0x271>
cmpnlesd %xmm0,%xmm2
movsd  0xd20(%rip),%xmm0
andpd  %xmm2,%xmm0
movlpd %xmm0,(%r15)
movl   $0xfffffffe,(%r14)
jmp    13a1 <cdflib_cdfnor+0x271>
cmpnlesd %xmm1,%xmm0
movsd  0xcfe(%rip),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,(%r15)
movl   $0xfffffffd,(%r14)
jmp    13a1 <cdflib_cdfnor+0x271>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <cdflib_dinvnr@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x0(%rbp),%xmm1
mulsd  0x0(%r13),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
jmp    13a1 <cdflib_cdfnor+0x271>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <cdflib_dinvnr@plt>
movsd  %xmm0,0x8(%rsp)
mulsd  0x0(%r13),%xmm0
addsd  (%r14),%xmm0
movsd  %xmm0,0x0(%rbp)
jmp    13a1 <cdflib_cdfnor+0x271>
mov    0x0(%rbp),%eax
cmp    $0x4,%eax
mov    0x18(%rsp),%r8
mov    0x10(%rsp),%rcx
jne    119d <cdflib_cdfnor+0x6d>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r8,%rbx
mov    %rcx,%rbp
call   1030 <cdflib_dinvnr@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x0(%rbp),%xmm1
subsd  (%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%r13)
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@cdflib_cdfnor.K1 = internal constant i32 1
define void @cdflib_cdfnor(i32* %0, double* %1, double* %2, double* %3, double* %4, double* %5, i32* %6, double* %7) {
%9 = alloca i32*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32*
%16 = alloca double*
%17 = alloca double
%18 = alloca double
store i32* %0, i32** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store i32* %6, i32** %15
store double* %7, double** %16
%19 = load i32*, i32** %15
store i32 0, i32* %19
%20 = load double*, double** %16
store double 0.000000e+00, double* %20
%21 = load i32*, i32** %15
store i32 0, i32* %21
%22 = load i32*, i32** %9
%23 = load i32, i32* %22
%24 = icmp slt i32 %23, 1
br i1 %24, label %30, label %25
25: ; preds = %8
%26 = load i32*, i32** %9
%27 = load i32, i32* %26
%28 = icmp sgt i32 %27, 4
br i1 %28, label %30, label %29
29: ; preds = %25
br label %41
30: ; preds = %25, %8
%31 = load i32*, i32** %9
%32 = load i32, i32* %31
%33 = icmp slt i32 %32, 1
br i1 %33, label %35, label %34
34: ; preds = %30
br label %37
35: ; preds = %30
%36 = load double*, double** %16
store double 1.000000e+00, double* %36
br label %39
37: ; preds = %34
%38 = load double*, double** %16
store double 4.000000e+00, double* %38
br label %39
39: ; preds = %37, %35
%40 = load i32*, i32** %15
store i32 -1, i32* %40
br label %204
41: ; preds = %29
%42 = load i32*, i32** %9
%43 = load i32, i32* %42
%44 = icmp eq i32 %43, 1
br i1 %44, label %45, label %46
45: ; preds = %41
br label %66
46: ; preds = %41
%47 = load double*, double** %10
%48 = load double, double* %47
%49 = fcmp ole double %48, 0.000000e+00
br i1 %49, label %55, label %50
50: ; preds = %46
%51 = load double*, double** %10
%52 = load double, double* %51
%53 = fcmp ogt double %52, 1.000000e+00
br i1 %53, label %55, label %54
54: ; preds = %50
br label %67
55: ; preds = %50, %46
%56 = load double*, double** %10
%57 = load double, double* %56
%58 = fcmp ole double %57, 0.000000e+00
br i1 %58, label %60, label %59
59: ; preds = %55
br label %62
60: ; preds = %55
%61 = load double*, double** %16
store double 0.000000e+00, double* %61
br label %64
62: ; preds = %59
%63 = load double*, double** %16
store double 1.000000e+00, double* %63
br label %64
64: ; preds = %62, %60
%65 = load i32*, i32** %15
store i32 -2, i32* %65
br label %204
66: ; preds = %45
br label %67
67: ; preds = %66, %54
%68 = load i32*, i32** %9
%69 = load i32, i32* %68
%70 = icmp eq i32 %69, 1
br i1 %70, label %71, label %72
71: ; preds = %67
br label %92
72: ; preds = %67
%73 = load double*, double** %11
%74 = load double, double* %73
%75 = fcmp ole double %74, 0.000000e+00
br i1 %75, label %81, label %76
76: ; preds = %72
%77 = load double*, double** %11
%78 = load double, double* %77
%79 = fcmp ogt double %78, 1.000000e+00
br i1 %79, label %81, label %80
80: ; preds = %76
br label %93
81: ; preds = %76, %72
%82 = load double*, double** %11
%83 = load double, double* %82
%84 = fcmp ole double %83, 0.000000e+00
br i1 %84, label %86, label %85
85: ; preds = %81
br label %88
86: ; preds = %81
%87 = load double*, double** %16
store double 0.000000e+00, double* %87
br label %90
88: ; preds = %85
%89 = load double*, double** %16
store double 1.000000e+00, double* %89
br label %90
90: ; preds = %88, %86
%91 = load i32*, i32** %15
store i32 -3, i32* %91
br label %204
92: ; preds = %71
br label %93
93: ; preds = %92, %80
%94 = load i32*, i32** %9
%95 = load i32, i32* %94
%96 = icmp eq i32 %95, 1
br i1 %96, label %97, label %98
97: ; preds = %93
br label %122
98: ; preds = %93
%99 = load double*, double** %10
%100 = load double, double* %99
%101 = load double*, double** %11
%102 = load double, double* %101
%103 = fadd double %100, %102
store double %103, double* %18
%104 = load double, double* %18
%105 = fsub double %104, 5.000000e-01
%106 = fsub double %105, 5.000000e-01
%107 = call double @llvm.fabs.f64(double %106)
%108 = call double @dpmpar(i32 1)
%109 = fmul double 3.000000e+00, %108
%110 = fcmp ogt double %107, %109
br i1 %110, label %112, label %111
111: ; preds = %98
br label %123
112: ; preds = %98
%113 = load double, double* %18
%114 = fcmp olt double %113, 0.000000e+00
br i1 %114, label %116, label %115
115: ; preds = %112
br label %118
116: ; preds = %112
%117 = load double*, double** %16
store double 0.000000e+00, double* %117
br label %120
118: ; preds = %115
%119 = load double*, double** %16
store double 1.000000e+00, double* %119
br label %120
120: ; preds = %118, %116
%121 = load i32*, i32** %15
store i32 3, i32* %121
br label %204
122: ; preds = %97
br label %123
123: ; preds = %122, %111
%124 = load i32*, i32** %9
%125 = load i32, i32* %124
%126 = icmp eq i32 %125, 4
br i1 %126, label %127, label %128
127: ; preds = %123
br label %136
128: ; preds = %123
%129 = load double*, double** %14
%130 = load double, double* %129
%131 = fcmp ole double %130, 0.000000e+00
br i1 %131, label %133, label %132
132: ; preds = %128
br label %137
133: ; preds = %128
%134 = load double*, double** %16
store double 0.000000e+00, double* %134
%135 = load i32*, i32** %15
store i32 -6, i32* %135
br label %204
136: ; preds = %127
br label %137
137: ; preds = %136, %132
%138 = load i32*, i32** %9
%139 = load i32, i32* %138
%140 = icmp eq i32 1, %139
br i1 %140, label %141, label %153
141: ; preds = %137
%142 = load double*, double** %12
%143 = load double, double* %142
%144 = load double*, double** %13
%145 = load double, double* %144
%146 = fsub double %143, %145
%147 = load double*, double** %14
%148 = load double, double* %147
%149 = fdiv double %146, %148
store double %149, double* %17
%150 = load double*, double** %10
%151 = load double*, double** %11
%152 = call i32 @cdflib_cumnor(double* %17, double* %150, double* %151)
br label %203
153: ; preds = %137
%154 = load i32*, i32** %9
%155 = load i32, i32* %154
%156 = icmp eq i32 2, %155
br i1 %156, label %157, label %168
157: ; preds = %153
%158 = load double*, double** %10
%159 = load double*, double** %11
%160 = call double @cdflib_dinvnr(double* %158, double* %159)
store double %160, double* %17
%161 = load double*, double** %14
%162 = load double, double* %161
%163 = load double, double* %17
%164 = load double*, double** %13
%165 = load double, double* %164
%166 = call double @llvm.fmuladd.f64(double %162, double %163, double %165)
%167 = load double*, double** %12
store double %166, double* %167
br label %202
168: ; preds = %153
%169 = load i32*, i32** %9
%170 = load i32, i32* %169
%171 = icmp eq i32 3, %170
br i1 %171, label %172, label %184
172: ; preds = %168
%173 = load double*, double** %10
%174 = load double*, double** %11
%175 = call double @cdflib_dinvnr(double* %173, double* %174)
store double %175, double* %17
%176 = load double*, double** %12
%177 = load double, double* %176
%178 = load double*, double** %14
%179 = load double, double* %178
%180 = load double, double* %17
%181 = fneg double %179
%182 = call double @llvm.fmuladd.f64(double %181, double %180, double %177)
%183 = load double*, double** %13
store double %182, double* %183
br label %201
184: ; preds = %168
%185 = load i32*, i32** %9
%186 = load i32, i32* %185
%187 = icmp eq i32 4, %186
br i1 %187, label %188, label %200
188: ; preds = %184
%189 = load double*, double** %10
%190 = load double*, double** %11
%191 = call double @cdflib_dinvnr(double* %189, double* %190)
store double %191, double* %17
%192 = load double*, double** %12
%193 = load double, double* %192
%194 = load double*, double** %13
%195 = load double, double* %194
%196 = fsub double %193, %195
%197 = load double, double* %17
%198 = fdiv double %196, %197
%199 = load double*, double** %14
store double %198, double* %199
br label %200
200: ; preds = %188, %184
br label %201
201: ; preds = %200, %172
br label %202
202: ; preds = %201, %157
br label %203
203: ; preds = %202, %141
br label %204
204: ; preds = %203, %133, %120, %90, %64, %39
ret void
}

LLVM IR (-O2):
define void @cdflib_cdfnor(i32* nocapture %0, double* %1, double* %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, i32* nocapture writeonly %6, double* nocapture writeonly %7) {
%9 = alloca double
%10 = bitcast double* %9 to i8*
store double 0.000000e+00, double* %7
store i32 0, i32* %6
%11 = load i32, i32* %0
%12 = add i32 %11, -5
%13 = icmp ult i32 %12, -4
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = icmp slt i32 %11, 1
%16 = select i1 %15, double 1.000000e+00, double 4.000000e+00
store double %16, double* %7
store i32 -1, i32* %6
br label %78
17: ; preds = %8
%18 = icmp eq i32 %11, 1
br i1 %18, label %49, label %19
19: ; preds = %17
%20 = load double, double* %1
%21 = fcmp ole double %20, 0.000000e+00
%22 = fcmp ogt double %20, 1.000000e+00
%23 = or i1 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = fcmp ugt double %20, 0.000000e+00
%26 = select i1 %25, double 1.000000e+00, double 0.000000e+00
store double %26, double* %7
store i32 -2, i32* %6
br label %78
27: ; preds = %19
%28 = load double, double* %2
%29 = fcmp ole double %28, 0.000000e+00
%30 = fcmp ogt double %28, 1.000000e+00
%31 = or i1 %29, %30
br i1 %31, label %32, label %35
32: ; preds = %27
%33 = fcmp ugt double %28, 0.000000e+00
%34 = select i1 %33, double 1.000000e+00, double 0.000000e+00
store double %34, double* %7
store i32 -3, i32* %6
br label %78
35: ; preds = %27
%36 = fadd double %20, %28
%37 = fadd double %36, -5.000000e-01
%38 = fadd double %37, -5.000000e-01
%39 = tail call double @llvm.fabs.f64(double %38)
%40 = tail call double @dpmpar(i32 1)
%41 = fmul double %40, 3.000000e+00
%42 = fcmp ogt double %39, %41
br i1 %42, label %43, label %46
43: ; preds = %35
%44 = fcmp olt double %36, 0.000000e+00
%45 = select i1 %44, double 0.000000e+00, double 1.000000e+00
store double %45, double* %7
store i32 3, i32* %6
br label %78
46: ; preds = %35
%47 = load i32, i32* %0
%48 = icmp eq i32 %47, 4
br i1 %48, label %72, label %49
49: ; preds = %17, %46
%50 = phi i32 [ %47, %46 ], [ 1, %17 ]
%51 = load double, double* %5
%52 = fcmp ugt double %51, 0.000000e+00
br i1 %52, label %54, label %53
53: ; preds = %49
store double 0.000000e+00, double* %7
store i32 -6, i32* %6
br label %78
54: ; preds = %49
switch i32 %50, label %78 [
i32 1, label %55
i32 2, label %61
i32 3, label %66
]
55: ; preds = %54
%56 = load double, double* %3
%57 = load double, double* %4
%58 = fsub double %56, %57
%59 = fdiv double %58, %51
store double %59, double* %9
%60 = call i32 @cdflib_cumnor(double* %9, double* %1, double* %2)
br label %78
61: ; preds = %54
%62 = tail call double @cdflib_dinvnr(double* %1, double* %2)
store double %62, double* %9
%63 = load double, double* %5
%64 = load double, double* %4
%65 = tail call double @llvm.fmuladd.f64(double %63, double %62, double %64)
store double %65, double* %3
br label %78
66: ; preds = %54
%67 = tail call double @cdflib_dinvnr(double* %1, double* %2)
store double %67, double* %9
%68 = load double, double* %3
%69 = load double, double* %5
%70 = fneg double %69
%71 = tail call double @llvm.fmuladd.f64(double %70, double %67, double %68)
store double %71, double* %4
br label %78
72: ; preds = %46
%73 = tail call double @cdflib_dinvnr(double* %1, double* %2)
store double %73, double* %9
%74 = load double, double* %3
%75 = load double, double* %4
%76 = fsub double %74, %75
%77 = fdiv double %76, %73
store double %77, double* %5
br label %78
78: ; preds = %55, %66, %72, %61, %54, %53, %43, %32, %24, %14
ret void
}