#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 *dvector(int /*<<< orphan*/, int);
double erf1(double *);
double exp(double);
double fabs(double);
int /*<<< orphan*/ free_dvector(double *, int /*<<< orphan*/);
double log(double);
int /*<<< orphan*/ mexErrMsgTxt(char *);
double sqrt(double);
double erfinv(double y) {
  double *a, *b, *c, *d;
  double z, x, x2;
  a = dvector(0, 3);
  b = dvector(0, 3);
  c = dvector(0, 3);
  d = dvector(0, 1);
  a[0] = 0.8862268990;
  a[1] = -1.6453496210;
  a[2] = 0.9146248930;
  a[3] = -0.1405433310;
  b[0] = -2.118377725;
  b[1] = 1.442710462;
  b[2] = -0.329097515;
  b[3] = 0.012229801;
  c[0] = -1.970840454;
  c[1] = -1.624906493;
  c[2] = 3.429567803;
  c[3] = 1.641345311;
  d[0] = 3.543889200;
  d[1] = 1.637067800;
  if (fabs(y) < 0.70) {
    z = y * y;
    x = y * (((a[3] * z + a[2]) * z + a[1]) * z + a[0]) /
        ((((b[3] * z + b[2]) * z + b[1]) * z + b[0]) * z + 1.0);
  } else if (y > 0.70 && y < 1.00) {
    z = sqrt(-log((1.0 - y) / 2.0));
    x = (((c[3] * z + c[2]) * z + c[1]) * z + c[0]) /
        ((d[1] * z + d[0]) * z + 1.0);
  } else if (y < -0.70 && y > -1.0) {
    z = sqrt(-log((1.0 + y) / 2.0));
    x = -(((c[3] * z + c[2]) * z + c[1]) * z + c[0]) /
        ((d[1] * z + d[0]) * z + 1.0);
  } else {
    mexErrMsgTxt("erfinv --Illegal Argument to Inverse \n");
  }
  free_dvector(a, 0);
  free_dvector(b, 0);
  free_dvector(c, 0);
  free_dvector(d, 0);
  x2 = x * x;
  x = x - (erf1(&x) - y) / (2.0 / sqrt(3.14159265358979) * exp(-x2));
  x = x - (erf1(&x) - y) / (2.0 / sqrt(3.14159265358979) * exp(-x2));
  return x;
}


x86 assembly (clang, -O0):
<erfinv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <dvector@plt>
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <dvector@plt>
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <dvector@plt>
mov    %rax,-0x20(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <dvector@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xea7(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe8f(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe76(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe5d(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x18(%rbp),%rax
movsd  0xe44(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xe2c(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  0xe13(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
movsd  0xdfa(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x20(%rbp),%rax
movsd  0xde1(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xdc9(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movsd  0xdb0(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
movsd  0xd97(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x28(%rbp),%rax
movsd  0xd7e(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0xd66(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x8(%rbp),%xmm1
movaps 0xded(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd41(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1398 <erfinv+0x228>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
movsd  -0x30(%rbp),%xmm3
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm3
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm3
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm1
movsd  -0x30(%rbp),%xmm3
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm3
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm3
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xcf2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    15ad <erfinv+0x43d>
movsd  -0x8(%rbp),%xmm0
movsd  0xc5b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    148c <erfinv+0x31c>
movsd  0xcc1(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    148c <erfinv+0x31c>
movsd  0xcae(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xcb9(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1070 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x30(%rbp),%xmm3
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xbfe(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    15a8 <erfinv+0x438>
movsd  0xbec(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1597 <erfinv+0x427>
movsd  -0x8(%rbp),%xmm0
movsd  0xbdc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1597 <erfinv+0x427>
movsd  0xbba(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xbc5(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1070 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x30(%rbp),%xmm3
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xaf3(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    15a3 <erfinv+0x433>
lea    0xb12(%rip),%rdi
call   1050 <mexErrMsgTxt@plt>
jmp    15a8 <erfinv+0x438>
jmp    15ad <erfinv+0x43d>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1060 <free_dvector@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1060 <free_dvector@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1060 <free_dvector@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
call   1060 <free_dvector@plt>
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
lea    -0x38(%rbp),%rdi
call   1080 <erf1@plt>
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xa8b(%rip),%xmm0
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xa73(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  -0x70(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
lea    -0x38(%rbp),%rdi
call   1080 <erf1@plt>
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xa09(%rip),%xmm0
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0x9f1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erfinv>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
movaps %xmm0,0x20(%rsp)
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <dvector@plt>
mov    %rax,%r14
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <dvector@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <dvector@plt>
mov    %rax,%r15
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <dvector@plt>
movapd 0x20(%rsp),%xmm2
mov    %rax,%r12
movaps 0xe37(%rip),%xmm0
movups %xmm0,(%r14)
movaps 0xe3c(%rip),%xmm0
movups %xmm0,0x10(%r14)
movaps 0xe40(%rip),%xmm0
movups %xmm0,(%rbx)
movaps 0xe46(%rip),%xmm0
movups %xmm0,0x10(%rbx)
movaps 0xe4b(%rip),%xmm0
movups %xmm0,(%r15)
movaps 0xe50(%rip),%xmm0
movups %xmm0,0x10(%r15)
movaps 0xe54(%rip),%xmm0
movups %xmm0,(%rax)
movapd 0xe59(%rip),%xmm0
andpd  %xmm2,%xmm0
movsd  0xe7d(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1298 <erfinv+0x128>
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  0x18(%r14),%xmm3
mulsd  %xmm0,%xmm3
addsd  0x10(%r14),%xmm3
mulsd  %xmm0,%xmm3
addsd  0x8(%r14),%xmm3
mulsd  %xmm0,%xmm3
addsd  (%r14),%xmm3
movsd  0x18(%rbx),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rbx),%xmm1
mulsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm1
addsd  0x8(%rbx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe25(%rip),%xmm1
divsd  %xmm1,%xmm3
movapd %xmm3,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
jmp    140b <erfinv+0x29b>
ucomisd 0xe00(%rip),%xmm2
jbe    12e5 <erfinv+0x175>
movsd  0xdfe(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    12e5 <erfinv+0x175>
subsd  %xmm2,%xmm0
mulsd  0xe04(%rip),%xmm0
call   1070 <log@plt>
movapd %xmm0,%xmm1
movapd 0xdb3(%rip),%xmm0
xorpd  %xmm1,%xmm0
movsd  0xdef(%rip),%xmm2
ucomisd %xmm1,%xmm2
jb     1357 <erfinv+0x1e7>
sqrtsd %xmm0,%xmm0
jmp    135c <erfinv+0x1ec>
movsd  0xdc3(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    133a <erfinv+0x1ca>
ucomisd 0xdbd(%rip),%xmm2
jbe    133a <erfinv+0x1ca>
movsd  0xda3(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  0xdaf(%rip),%xmm0
call   1070 <log@plt>
movapd %xmm0,%xmm1
movapd 0xd5e(%rip),%xmm0
xorpd  %xmm1,%xmm0
movsd  0xd9a(%rip),%xmm2
ucomisd %xmm1,%xmm2
jb     13ae <erfinv+0x23e>
sqrtsd %xmm0,%xmm0
jmp    13b3 <erfinv+0x243>
lea    0xd97(%rip),%rdi
call   1050 <mexErrMsgTxt@plt>
movsd  0x8(%rsp),%xmm0
movapd %xmm0,0x10(%rsp)
jmp    140b <erfinv+0x29b>
call   1090 <sqrt@plt>
movsd  0x18(%r15),%xmm2
mulsd  %xmm0,%xmm2
addsd  0x10(%r15),%xmm2
movhpd 0x8(%r12),%xmm2
unpcklpd %xmm0,%xmm0
movsd  0x8(%r15),%xmm1
movhpd (%r12),%xmm1
mulpd  %xmm0,%xmm2
addpd  %xmm1,%xmm2
movapd 0xcfd(%rip),%xmm1
movlpd (%r15),%xmm1
mulpd  %xmm0,%xmm2
addpd  %xmm1,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
divsd  %xmm0,%xmm2
jmp    13ff <erfinv+0x28f>
call   1090 <sqrt@plt>
movsd  0x18(%r15),%xmm2
mulsd  %xmm0,%xmm2
addsd  0x10(%r15),%xmm2
mulsd  %xmm0,%xmm2
addsd  0x8(%r15),%xmm2
mulsd  %xmm0,%xmm2
addsd  (%r15),%xmm2
xorpd  0xca2(%rip),%xmm2
movsd  0x8(%r12),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r12),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xcad(%rip),%xmm1
divsd  %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
mov    %r14,%rdi
xor    %esi,%esi
call   1060 <free_dvector@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <free_dvector@plt>
mov    %r15,%rdi
xor    %esi,%esi
call   1060 <free_dvector@plt>
mov    %r12,%rdi
xor    %esi,%esi
call   1060 <free_dvector@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <erf1@plt>
subsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
movapd 0xc2c(%rip),%xmm0
movapd 0x10(%rsp),%xmm1
xorpd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0x40(%rsp)
call   1030 <exp@plt>
mulsd  0xc5b(%rip),%xmm0
movsd  0x38(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd 0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1080 <erf1@plt>
subsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movapd 0x40(%rsp),%xmm0
call   1030 <exp@plt>
mulsd  0xc14(%rip),%xmm0
movsd  0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd 0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [39 x i8] c"erfinv --Illegal Argument to Inverse \0A\00"
define double @erfinv(double %0) {
%2 = alloca double
%3 = alloca double*
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %2
%10 = call double* @dvector(i32 0, i32 3)
store double* %10, double** %3
%11 = call double* @dvector(i32 0, i32 3)
store double* %11, double** %4
%12 = call double* @dvector(i32 0, i32 3)
store double* %12, double** %5
%13 = call double* @dvector(i32 0, i32 1)
store double* %13, double** %6
%14 = load double*, double** %3
%15 = getelementptr inbounds double, double* %14, i64 0
store double 0x3FEC5BF883814BBC, double* %15
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 1
store double 0xBFFA535A1FCAE55B, double* %17
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 2
store double 0x3FED449B6C715C28, double* %19
%20 = load double*, double** %3
%21 = getelementptr inbounds double, double* %20, i64 3
store double 0xBFC1FD52E9286F82, double* %21
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 0
store double 0xC000F270054B995C, double* %23
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 1
store double 0x3FF7155790BE315C, double* %25
%26 = load double*, double** %4
%27 = getelementptr inbounds double, double* %26, i64 2
store double 0xBFD50FEF0607ABF1, double* %27
%28 = load double*, double** %4
%29 = getelementptr inbounds double, double* %28, i64 3
store double 0x3F890BF01AA717A9, double* %29
%30 = load double*, double** %5
%31 = getelementptr inbounds double, double* %30, i64 0
store double 0xBFFF888FFFF9054B, double* %31
%32 = load double*, double** %5
%33 = getelementptr inbounds double, double* %32, i64 1
store double 0xBFF9FF9DF367E38B, double* %33
%34 = load double*, double** %5
%35 = getelementptr inbounds double, double* %34, i64 2
store double 0x400B6FC13E8A6585, double* %35
%36 = load double*, double** %5
%37 = getelementptr inbounds double, double* %36, i64 3
store double 0x3FFA42F34D0301D7, double* %37
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 0
store double 0x400C59E294B52E4B, double* %39
%40 = load double*, double** %6
%41 = getelementptr inbounds double, double* %40, i64 1
store double 0x3FFA316E01655ACE, double* %41
%42 = load double, double* %2
%43 = call double @llvm.fabs.f64(double %42)
%44 = fcmp olt double %43, 0x3FE6666666666666
br i1 %44, label %45, label %90
45: ; preds = %1
%46 = load double, double* %2
%47 = load double, double* %2
%48 = fmul double %46, %47
store double %48, double* %7
%49 = load double, double* %2
%50 = load double*, double** %3
%51 = getelementptr inbounds double, double* %50, i64 3
%52 = load double, double* %51
%53 = load double, double* %7
%54 = load double*, double** %3
%55 = getelementptr inbounds double, double* %54, i64 2
%56 = load double, double* %55
%57 = call double @llvm.fmuladd.f64(double %52, double %53, double %56)
%58 = load double, double* %7
%59 = load double*, double** %3
%60 = getelementptr inbounds double, double* %59, i64 1
%61 = load double, double* %60
%62 = call double @llvm.fmuladd.f64(double %57, double %58, double %61)
%63 = load double, double* %7
%64 = load double*, double** %3
%65 = getelementptr inbounds double, double* %64, i64 0
%66 = load double, double* %65
%67 = call double @llvm.fmuladd.f64(double %62, double %63, double %66)
%68 = fmul double %49, %67
%69 = load double*, double** %4
%70 = getelementptr inbounds double, double* %69, i64 3
%71 = load double, double* %70
%72 = load double, double* %7
%73 = load double*, double** %4
%74 = getelementptr inbounds double, double* %73, i64 2
%75 = load double, double* %74
%76 = call double @llvm.fmuladd.f64(double %71, double %72, double %75)
%77 = load double, double* %7
%78 = load double*, double** %4
%79 = getelementptr inbounds double, double* %78, i64 1
%80 = load double, double* %79
%81 = call double @llvm.fmuladd.f64(double %76, double %77, double %80)
%82 = load double, double* %7
%83 = load double*, double** %4
%84 = getelementptr inbounds double, double* %83, i64 0
%85 = load double, double* %84
%86 = call double @llvm.fmuladd.f64(double %81, double %82, double %85)
%87 = load double, double* %7
%88 = call double @llvm.fmuladd.f64(double %86, double %87, double 1.000000e+00)
%89 = fdiv double %68, %88
store double %89, double* %8
br label %179
90: ; preds = %1
%91 = load double, double* %2
%92 = fcmp ogt double %91, 0x3FE6666666666666
br i1 %92, label %93, label %132
93: ; preds = %90
%94 = load double, double* %2
%95 = fcmp olt double %94, 1.000000e+00
br i1 %95, label %96, label %132
96: ; preds = %93
%97 = load double, double* %2
%98 = fsub double 1.000000e+00, %97
%99 = fdiv double %98, 2.000000e+00
%100 = call double @log(double %99)
%101 = fneg double %100
%102 = call double @sqrt(double %101)
store double %102, double* %7
%103 = load double*, double** %5
%104 = getelementptr inbounds double, double* %103, i64 3
%105 = load double, double* %104
%106 = load double, double* %7
%107 = load double*, double** %5
%108 = getelementptr inbounds double, double* %107, i64 2
%109 = load double, double* %108
%110 = call double @llvm.fmuladd.f64(double %105, double %106, double %109)
%111 = load double, double* %7
%112 = load double*, double** %5
%113 = getelementptr inbounds double, double* %112, i64 1
%114 = load double, double* %113
%115 = call double @llvm.fmuladd.f64(double %110, double %111, double %114)
%116 = load double, double* %7
%117 = load double*, double** %5
%118 = getelementptr inbounds double, double* %117, i64 0
%119 = load double, double* %118
%120 = call double @llvm.fmuladd.f64(double %115, double %116, double %119)
%121 = load double*, double** %6
%122 = getelementptr inbounds double, double* %121, i64 1
%123 = load double, double* %122
%124 = load double, double* %7
%125 = load double*, double** %6
%126 = getelementptr inbounds double, double* %125, i64 0
%127 = load double, double* %126
%128 = call double @llvm.fmuladd.f64(double %123, double %124, double %127)
%129 = load double, double* %7
%130 = call double @llvm.fmuladd.f64(double %128, double %129, double 1.000000e+00)
%131 = fdiv double %120, %130
store double %131, double* %8
br label %178
132: ; preds = %93, %90
%133 = load double, double* %2
%134 = fcmp olt double %133, 0xBFE6666666666666
br i1 %134, label %135, label %175
135: ; preds = %132
%136 = load double, double* %2
%137 = fcmp ogt double %136, -1.000000e+00
br i1 %137, label %138, label %175
138: ; preds = %135
%139 = load double, double* %2
%140 = fadd double 1.000000e+00, %139
%141 = fdiv double %140, 2.000000e+00
%142 = call double @log(double %141)
%143 = fneg double %142
%144 = call double @sqrt(double %143)
store double %144, double* %7
%145 = load double*, double** %5
%146 = getelementptr inbounds double, double* %145, i64 3
%147 = load double, double* %146
%148 = load double, double* %7
%149 = load double*, double** %5
%150 = getelementptr inbounds double, double* %149, i64 2
%151 = load double, double* %150
%152 = call double @llvm.fmuladd.f64(double %147, double %148, double %151)
%153 = load double, double* %7
%154 = load double*, double** %5
%155 = getelementptr inbounds double, double* %154, i64 1
%156 = load double, double* %155
%157 = call double @llvm.fmuladd.f64(double %152, double %153, double %156)
%158 = load double, double* %7
%159 = load double*, double** %5
%160 = getelementptr inbounds double, double* %159, i64 0
%161 = load double, double* %160
%162 = call double @llvm.fmuladd.f64(double %157, double %158, double %161)
%163 = fneg double %162
%164 = load double*, double** %6
%165 = getelementptr inbounds double, double* %164, i64 1
%166 = load double, double* %165
%167 = load double, double* %7
%168 = load double*, double** %6
%169 = getelementptr inbounds double, double* %168, i64 0
%170 = load double, double* %169
%171 = call double @llvm.fmuladd.f64(double %166, double %167, double %170)
%172 = load double, double* %7
%173 = call double @llvm.fmuladd.f64(double %171, double %172, double 1.000000e+00)
%174 = fdiv double %163, %173
store double %174, double* %8
br label %177
175: ; preds = %135, %132
%176 = call i32 @mexErrMsgTxt(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %177
177: ; preds = %175, %138
br label %178
178: ; preds = %177, %96
br label %179
179: ; preds = %178, %45
%180 = load double*, double** %3
%181 = call i32 @free_dvector(double* %180, i32 0)
%182 = load double*, double** %4
%183 = call i32 @free_dvector(double* %182, i32 0)
%184 = load double*, double** %5
%185 = call i32 @free_dvector(double* %184, i32 0)
%186 = load double*, double** %6
%187 = call i32 @free_dvector(double* %186, i32 0)
%188 = load double, double* %8
%189 = load double, double* %8
%190 = fmul double %188, %189
store double %190, double* %9
%191 = load double, double* %8
%192 = call double @erf1(double* %8)
%193 = load double, double* %2
%194 = fsub double %192, %193
%195 = call double @sqrt(double 0x400921FB54442D11)
%196 = fdiv double 2.000000e+00, %195
%197 = load double, double* %9
%198 = fneg double %197
%199 = call double @exp(double %198)
%200 = fmul double %196, %199
%201 = fdiv double %194, %200
%202 = fsub double %191, %201
store double %202, double* %8
%203 = load double, double* %8
%204 = call double @erf1(double* %8)
%205 = load double, double* %2
%206 = fsub double %204, %205
%207 = call double @sqrt(double 0x400921FB54442D11)
%208 = fdiv double 2.000000e+00, %207
%209 = load double, double* %9
%210 = fneg double %209
%211 = call double @exp(double %210)
%212 = fmul double %208, %211
%213 = fdiv double %206, %212
%214 = fsub double %203, %213
store double %214, double* %8
%215 = load double, double* %8
ret double %215
}

LLVM IR (-O2):
@.str = [39 x i8] c"erfinv --Illegal Argument to Inverse \0A\00"
define double @erfinv(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = tail call double* @dvector(i32 0, i32 3)
%5 = tail call double* @dvector(i32 0, i32 3)
%6 = tail call double* @dvector(i32 0, i32 3)
%7 = tail call double* @dvector(i32 0, i32 1)
%8 = bitcast double* %4 to <2 x double>*
store <2 x double> <double 0x3FEC5BF883814BBC, double 0xBFFA535A1FCAE55B>, <2 x double>* %8
%9 = getelementptr inbounds double, double* %4, i64 2
%10 = bitcast double* %9 to <2 x double>*
store <2 x double> <double 0x3FED449B6C715C28, double 0xBFC1FD52E9286F82>, <2 x double>* %10
%11 = bitcast double* %5 to <2 x double>*
store <2 x double> <double 0xC000F270054B995C, double 0x3FF7155790BE315C>, <2 x double>* %11
%12 = getelementptr inbounds double, double* %5, i64 2
%13 = bitcast double* %12 to <2 x double>*
store <2 x double> <double 0xBFD50FEF0607ABF1, double 0x3F890BF01AA717A9>, <2 x double>* %13
%14 = getelementptr inbounds double, double* %6, i64 1
%15 = bitcast double* %6 to <2 x double>*
store <2 x double> <double 0xBFFF888FFFF9054B, double 0xBFF9FF9DF367E38B>, <2 x double>* %15
%16 = getelementptr inbounds double, double* %6, i64 2
%17 = getelementptr inbounds double, double* %6, i64 3
%18 = bitcast double* %16 to <2 x double>*
store <2 x double> <double 0x400B6FC13E8A6585, double 0x3FFA42F34D0301D7>, <2 x double>* %18
%19 = getelementptr inbounds double, double* %7, i64 1
%20 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 0x400C59E294B52E4B, double 0x3FFA316E01655ACE>, <2 x double>* %20
%21 = tail call double @llvm.fabs.f64(double %0)
%22 = fcmp olt double %21, 0x3FE6666666666666
br i1 %22, label %23, label %46
23: ; preds = %1
%24 = getelementptr inbounds double, double* %5, i64 3
%25 = getelementptr inbounds double, double* %5, i64 1
%26 = getelementptr inbounds double, double* %4, i64 3
%27 = getelementptr inbounds double, double* %4, i64 1
%28 = fmul double %0, %0
%29 = load double, double* %26
%30 = load double, double* %9
%31 = tail call double @llvm.fmuladd.f64(double %29, double %28, double %30)
%32 = load double, double* %27
%33 = tail call double @llvm.fmuladd.f64(double %31, double %28, double %32)
%34 = load double, double* %4
%35 = tail call double @llvm.fmuladd.f64(double %33, double %28, double %34)
%36 = fmul double %35, %0
%37 = load double, double* %24
%38 = load double, double* %12
%39 = tail call double @llvm.fmuladd.f64(double %37, double %28, double %38)
%40 = load double, double* %25
%41 = tail call double @llvm.fmuladd.f64(double %39, double %28, double %40)
%42 = load double, double* %5
%43 = tail call double @llvm.fmuladd.f64(double %41, double %28, double %42)
%44 = tail call double @llvm.fmuladd.f64(double %43, double %28, double 1.000000e+00)
%45 = fdiv double %36, %44
store double %45, double* %2
br label %101
46: ; preds = %1
%47 = fcmp ogt double %0, 0x3FE6666666666666
%48 = fcmp olt double %0, 1.000000e+00
%49 = and i1 %47, %48
br i1 %49, label %50, label %75
50: ; preds = %46
%51 = fsub double 1.000000e+00, %0
%52 = fmul double %51, 5.000000e-01
%53 = tail call double @log(double %52)
%54 = fneg double %53
%55 = tail call double @sqrt(double %54)
%56 = load double, double* %17
%57 = load double, double* %16
%58 = tail call double @llvm.fmuladd.f64(double %56, double %55, double %57)
%59 = load double, double* %14
%60 = load double, double* %6
%61 = load double, double* %19
%62 = load double, double* %7
%63 = insertelement <2 x double> poison, double %58, i64 0
%64 = insertelement <2 x double> %63, double %61, i64 1
%65 = insertelement <2 x double> poison, double %55, i64 0
%66 = shufflevector <2 x double> %65, <2 x double> poison, <2 x i32> zeroinitializer
%67 = insertelement <2 x double> poison, double %59, i64 0
%68 = insertelement <2 x double> %67, double %62, i64 1
%69 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %64, <2 x double> %66, <2 x double> %68)
%70 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %60, i64 0
%71 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %69, <2 x double> %66, <2 x double> %70)
%72 = extractelement <2 x double> %71, i64 0
%73 = extractelement <2 x double> %71, i64 1
%74 = fdiv double %72, %73
store double %74, double* %2
br label %101
75: ; preds = %46
%76 = fcmp olt double %0, 0xBFE6666666666666
%77 = fcmp ogt double %0, -1.000000e+00
%78 = and i1 %76, %77
br i1 %78, label %79, label %98
79: ; preds = %75
%80 = fadd double %0, 1.000000e+00
%81 = fmul double %80, 5.000000e-01
%82 = tail call double @log(double %81)
%83 = fneg double %82
%84 = tail call double @sqrt(double %83)
%85 = load double, double* %17
%86 = load double, double* %16
%87 = tail call double @llvm.fmuladd.f64(double %85, double %84, double %86)
%88 = load double, double* %14
%89 = tail call double @llvm.fmuladd.f64(double %87, double %84, double %88)
%90 = load double, double* %6
%91 = tail call double @llvm.fmuladd.f64(double %89, double %84, double %90)
%92 = fneg double %91
%93 = load double, double* %19
%94 = load double, double* %7
%95 = tail call double @llvm.fmuladd.f64(double %93, double %84, double %94)
%96 = tail call double @llvm.fmuladd.f64(double %95, double %84, double 1.000000e+00)
%97 = fdiv double %92, %96
store double %97, double* %2
br label %101
98: ; preds = %75
%99 = tail call i32 @mexErrMsgTxt(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%100 = load double, double* %2
br label %101
101: ; preds = %50, %98, %79, %23
%102 = phi double [ %74, %50 ], [ %100, %98 ], [ %97, %79 ], [ %45, %23 ]
%103 = tail call i32 @free_dvector(double* %4, i32 0)
%104 = tail call i32 @free_dvector(double* %5, i32 0)
%105 = tail call i32 @free_dvector(double* %6, i32 0)
%106 = tail call i32 @free_dvector(double* %7, i32 0)
%107 = call double @erf1(double* %2)
%108 = fsub double %107, %0
%109 = fneg double %102
%110 = fmul double %102, %109
%111 = call double @exp(double %110)
%112 = fmul double %111, 0x3FF20DD750429B6F
%113 = fdiv double %108, %112
%114 = fsub double %102, %113
store double %114, double* %2
%115 = call double @erf1(double* %2)
%116 = fsub double %115, %0
%117 = call double @exp(double %110)
%118 = fmul double %117, 0x3FF20DD750429B6F
%119 = fdiv double %116, %118
%120 = fsub double %114, %119
ret double %120
}