#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 beta_log(double, double);
double betacdf(double, double, double);
int /*<<< orphan*/ exit(int);
double exp(double);
double log(double);
double pow(double, int);
int /*<<< orphan*/ printf(char *);
double r8_max(double, double);
double sqrt(double);
double betainv(double alpha, double p, double q) {
  double a;
  double acu;
  double adj;
  double fpu;
  double g;
  double h;
  int iex;
  int indx;
  double pp;
  double prev;
  double qq;
  double r;
  double s;
  double sae = -37.0;
  double sq;
  double t;
  double tx;
  double value;
  double w;
  double xin;
  double y;
  double yprev;
  double beta;
  beta = beta_log(p, q);
  fpu = pow(10.0, sae);
  value = alpha;
  if (p < 0.0 || q < 0.0) {
    printf("parameters should be non-negatve and real");
    exit(1);
  }
  if (alpha < 0.0 || 1.0 < alpha) {
    printf("probability values must lie between 0 and 1");
    exit(1);
  }
  if (alpha == 0.0) {
    value = 0.0;
    return value;
  }
  if (alpha == 1.0) {
    value = 1.0;
    return value;
  }
  if (0.5 < alpha) {
    a = 1.0 - alpha;
    pp = q;
    qq = p;
    indx = 1;
  } else {
    a = alpha;
    pp = p;
    qq = q;
    indx = 0;
  }
  r = sqrt(-log(a * a));
  y = r - (2.30753 + 0.27061 * r) / (1.0 + (0.99229 + 0.04481 * r) * r);
  if (1.0 < pp && 1.0 < qq) {
    r = (y * y - 3.0) / 6.0;
    s = 1.0 / (pp + pp - 1.0);
    t = 1.0 / (qq + qq - 1.0);
    h = 2.0 / (s + t);
    w = y * sqrt(h + r) / h - (t - s) * (r + 5.0 / 6.0 - 2.0 / (3.0 * h));
    value = pp / (pp + qq * exp(w + w));
  } else {
    r = qq + qq;
    t = 1.0 / (9.0 * qq);
    t = r * pow(1.0 - t + y * sqrt(t), 3);
    if (t <= 0.0) {
      value = 1.0 - exp((log((1.0 - a) * qq) + beta) / qq);
    } else {
      t = (4.0 * pp + r - 2.0) / t;
      if (t <= 1.0) {
        value = exp((log(a * pp) + beta) / pp);
      } else {
        value = 1.0 - 2.0 / (t + 1.0);
      }
    }
  }
  r = 1.0 - pp;
  t = 1.0 - qq;
  yprev = 0.0;
  sq = 1.0;
  prev = 1.0;
  if (value < 0.0001) {
    value = 0.0001;
  }
  if (0.9999 < value) {
    value = 0.9999;
  }
  iex = (int)r8_max(-5.0 / pp / pp - 1.0 / pow(a, 0.2) - 13.0, sae);
  acu = pow(10.0, iex);
  for (;;) {
    y = betacdf(value, pp, qq);
    xin = value;
    y = (y - a) * exp(beta + r * log(xin) + t * log(1.0 - xin));
    if (y * yprev <= 0.0) {
      prev = r8_max(sq, fpu);
    }
    g = 1.0;
    for (;;) {
      for (;;) {
        adj = g * y;
        sq = adj * adj;
        if (sq < prev) {
          tx = value - adj;
          if (0.0 <= tx && tx <= 1.0) {
            break;
          }
        }
        g = g / 3.0;
      }
      if (prev <= acu) {
        if (indx) {
          value = 1.0 - value;
        }
        return value;
      }
      if (y * y <= acu) {
        if (indx) {
          value = 1.0 - value;
        }
        return value;
      }
      if (tx != 0.0 && tx != 1.0) {
        break;
      }
      g = g / 3.0;
    }
    if (tx == value) {
      break;
    }
    value = tx;
    yprev = y;
  }
  if (indx) {
    value = 1.0 - value;
  }
  return value;
}


x86 assembly (clang, -O0):
<betainv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  0xe56(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1070 <beta_log@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
cvttsd2si -0x88(%rbp),%edi
ff
movsd  0xe1f(%rip),%xmm0
call   1090 <pow@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     1214 <betainv+0x84>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    122a <betainv+0x9a>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     124f <betainv+0xbf>
movsd  -0x10(%rbp),%xmm0
movsd  0xdcb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1265 <betainv+0xd5>
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    129a <betainv+0x10a>
jp     129a <betainv+0x10a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    1bbc <betainv+0xa2c>
movsd  -0x10(%rbp),%xmm0
movsd  0xd69(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12d9 <betainv+0x149>
jp     12d9 <betainv+0x149>
movsd  0xd51(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    1bbc <betainv+0xa2c>
movsd  -0x10(%rbp),%xmm0
movsd  0xd32(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1322 <betainv+0x192>
movsd  0xd18(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x1,-0x58(%rbp)
jmp    1347 <betainv+0x1b7>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1080 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   10a0 <sqrt@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
movsd  0xca7(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xca3(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x78(%rbp),%xmm2
movsd  0xc7a(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xc76(%rip),%xmm3
addsd  %xmm3,%xmm2
movsd  -0x78(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xc49(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  0xc28(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15a7 <betainv+0x417>
movsd  -0x70(%rbp),%xmm0
movsd  0xc11(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15a7 <betainv+0x417>
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xc0(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  0xc4b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xc37(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm1
addsd  -0x60(%rbp),%xmm1
movsd  0xbc4(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xbb8(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm1
addsd  -0x70(%rbp),%xmm1
movsd  0xb9d(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xb91(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x80(%rbp),%xmm1
addsd  -0x98(%rbp),%xmm1
ff
movsd  0xba8(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
call   10a0 <sqrt@plt>
movsd  -0xf0(%rbp),%xmm1
ff
mulsd  %xmm0,%xmm1
divsd  -0x50(%rbp),%xmm1
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
movsd  0xb72(%rip),%xmm2
addsd  -0x78(%rbp),%xmm2
movsd  0xb5d(%rip),%xmm4
mulsd  -0x50(%rbp),%xmm4
movsd  0xb40(%rip),%xmm3
divsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
addsd  -0xb0(%rbp),%xmm0
ff
call   1050 <exp@plt>
movsd  -0xe8(%rbp),%xmm1
ff
movsd  -0xe0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    175f <betainv+0x5cf>
movsd  -0x70(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xa82(%rip),%xmm1
mulsd  -0x70(%rbp),%xmm1
movsd  0xa45(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  0xa24(%rip),%xmm0
subsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
call   10a0 <sqrt@plt>
movsd  -0x108(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x100(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x3,%edi
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jb     16ab <betainv+0x51b>
movsd  0x9a2(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
call   1080 <log@plt>
addsd  -0xd0(%rbp),%xmm0
ff
divsd  -0x70(%rbp),%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  0x976(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    175a <betainv+0x5ca>
movsd  -0x60(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
movsd  0x993(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x97b(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0x927(%rip),%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jb     1725 <betainv+0x595>
movsd  -0x28(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
call   1080 <log@plt>
addsd  -0xd0(%rbp),%xmm0
ff
divsd  -0x60(%rbp),%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    1755 <betainv+0x5c5>
movsd  0x8e3(%rip),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  0x90b(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0x8c7(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    175a <betainv+0x5ca>
jmp    175f <betainv+0x5cf>
movsd  0x8a9(%rip),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0x897(%rip),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0x877(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0x867(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0x8c2(%rip),%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jbe    17d4 <betainv+0x644>
movsd  0x8ac(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0x89c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    17fe <betainv+0x66e>
movsd  0x88a(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0x88a(%rip),%xmm0
divsd  -0x60(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
xor    %edi,%edi
call   1090 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x110(%rbp),%xmm0
ff
movsd  0x7d9(%rip),%xmm1
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  0x841(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x88(%rbp),%xmm1
ff
call   1040 <r8_max@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%edi
movsd  0x796(%rip),%xmm0
call   1090 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x60(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
call   1060 <betacdf@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
call   1080 <log@plt>
movsd  -0x138(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x130(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x120(%rbp)
ff
movsd  0x6f3(%rip),%xmm0
subsd  -0xb8(%rbp),%xmm0
ff
call   1080 <log@plt>
movsd  -0x128(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x120(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x118(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm1
ff
mulsd  -0xc8(%rbp),%xmm1
ff
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1995 <betainv+0x805>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x40(%rbp),%xmm1
call   1040 <r8_max@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  0x673(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    19a7 <betainv+0x817>
movsd  -0x48(%rbp),%xmm0
mulsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1a2c <betainv+0x89c>
movsd  -0xa8(%rbp),%xmm0
ff
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1a27 <betainv+0x897>
movsd  0x5fc(%rip),%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jb     1a27 <betainv+0x897>
jmp    1a47 <betainv+0x8b7>
jmp    1a2c <betainv+0x89c>
movsd  -0x48(%rbp),%xmm0
movsd  0x61f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    19a7 <betainv+0x817>
movsd  -0x68(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1a8f <betainv+0x8ff>
cmpl   $0x0,-0x58(%rbp)
je     1a7d <betainv+0x8ed>
movsd  0x5a3(%rip),%xmm0
subsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    1bbc <betainv+0xa2c>
movsd  -0xc0(%rbp),%xmm1
ff
mulsd  -0xc0(%rbp),%xmm1
ff
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1ae2 <betainv+0x952>
cmpl   $0x0,-0x58(%rbp)
je     1ad0 <betainv+0x940>
movsd  0x550(%rip),%xmm0
subsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    1bbc <betainv+0xa2c>
movsd  -0xa0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1b02 <betainv+0x972>
jp     1b02 <betainv+0x972>
jmp    1b2c <betainv+0x99c>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0x4fe(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1b27 <betainv+0x997>
jp     1b27 <betainv+0x997>
jmp    1b2c <betainv+0x99c>
jmp    1b47 <betainv+0x9b7>
movsd  -0x48(%rbp),%xmm0
movsd  0x51f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    19a2 <betainv+0x812>
movsd  -0xa0(%rbp),%xmm0
ff
ucomisd -0xa8(%rbp),%xmm0
ff
jne    1b68 <betainv+0x9d8>
jp     1b68 <betainv+0x9d8>
jmp    1b8d <betainv+0x9fd>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    1874 <betainv+0x6e4>
cmpl   $0x0,-0x58(%rbp)
je     1baf <betainv+0xa1f>
movsd  0x471(%rip),%xmm0
subsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<betainv>:
sub    $0xc8,%rsp
movapd %xmm2,0x10(%rsp)
movaps %xmm1,0x20(%rsp)
movsd  %xmm0,0x38(%rsp)
movaps %xmm1,%xmm0
movapd %xmm2,%xmm1
call   1070 <beta_log@plt>
movsd  %xmm0,0x58(%rsp)
movsd  0xe3e(%rip),%xmm0
mov    $0xffffffdb,%edi
call   1090 <pow@plt>
movapd 0x20(%rsp),%xmm6
movapd 0x10(%rsp),%xmm5
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm6,%xmm0
ja     184e <betainv+0x6be>
ucomisd %xmm5,%xmm0
ja     184e <betainv+0x6be>
xorpd  %xmm0,%xmm0
movsd  0x38(%rsp),%xmm1
ucomisd %xmm1,%xmm0
ja     1857 <betainv+0x6c7>
ucomisd 0xdf8(%rip),%xmm1
ja     1857 <betainv+0x6c7>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    122a <betainv+0x9a>
jp     122a <betainv+0x9a>
add    $0xc8,%rsp
ret
movsd  0xdd6(%rip),%xmm0
ucomisd %xmm0,%xmm1
jne    123a <betainv+0xaa>
jnp    1222 <betainv+0x92>
xor    %eax,%eax
ucomisd 0xdcc(%rip),%xmm1
seta   %al
movsd  0xdb9(%rip),%xmm3
movd   %eax,%xmm0
pshufd $0x44,%xmm0,%xmm0
psllq  $0x3f,%xmm0
psrad  $0x1f,%xmm0
pshufd $0xf5,%xmm0,%xmm0
movapd %xmm6,%xmm4
unpcklpd %xmm5,%xmm4
unpcklpd %xmm6,%xmm5
andpd  %xmm0,%xmm4
andnpd %xmm5,%xmm0
movsd  %xmm2,0xa0(%rsp)
ja     128c <betainv+0xfc>
movapd %xmm1,%xmm3
jmp    1290 <betainv+0x100>
subsd  %xmm1,%xmm3
orpd   %xmm0,%xmm4
movapd %xmm4,0x20(%rsp)
movsd  %xmm3,0x8(%rsp)
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
call   1080 <log@plt>
movapd %xmm0,%xmm1
movapd 0xde7(%rip),%xmm0
xorpd  %xmm1,%xmm0
movsd  0xd53(%rip),%xmm2
ucomisd %xmm1,%xmm2
jb     12d4 <betainv+0x144>
xorps  %xmm3,%xmm3
sqrtsd %xmm0,%xmm3
jmp    12dd <betainv+0x14d>
call   10a0 <sqrt@plt>
movapd %xmm0,%xmm3
movsd  0xd3b(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  0xd37(%rip),%xmm0
movsd  0xd37(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xd33(%rip),%xmm1
mulsd  %xmm3,%xmm1
movsd  0xcf7(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
subsd  %xmm0,%xmm3
movapd 0x20(%rsp),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
movapd %xmm1,0x40(%rsp)
ucomisd %xmm2,%xmm1
jbe    13b5 <betainv+0x225>
ucomisd 0xcc9(%rip),%xmm0
jbe    13b5 <betainv+0x225>
movapd %xmm3,%xmm2
mulsd  %xmm3,%xmm2
addsd  0xd07(%rip),%xmm2
addpd  %xmm0,%xmm0
addpd  0xd53(%rip),%xmm0
movapd 0xd5b(%rip),%xmm4
divpd  %xmm0,%xmm4
movapd %xmm4,%xmm5
unpckhpd %xmm4,%xmm5
movapd %xmm5,%xmm0
addsd  %xmm4,%xmm0
shufpd $0x2,0xd4e(%rip),%xmm2
movapd 0xd56(%rip),%xmm1
unpcklpd %xmm0,%xmm1
divpd  %xmm1,%xmm2
movapd %xmm2,%xmm6
unpckhpd %xmm2,%xmm6
movapd %xmm6,%xmm0
addsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     13f2 <betainv+0x262>
sqrtsd %xmm0,%xmm0
jmp    143d <betainv+0x2ad>
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp)
movsd  0xc75(%rip),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
divsd  %xmm1,%xmm0
subsd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     14b1 <betainv+0x321>
sqrtsd %xmm0,%xmm0
jmp    14cc <betainv+0x33c>
movsd  %xmm3,(%rsp)
movapd %xmm2,0x10(%rsp)
movapd %xmm4,0x60(%rsp)
movapd %xmm5,0x90(%rsp)
movapd %xmm6,0x80(%rsp)
call   10a0 <sqrt@plt>
movapd 0x80(%rsp),%xmm6
movapd 0x90(%rsp),%xmm5
movapd 0x60(%rsp),%xmm4
movapd 0x10(%rsp),%xmm2
movsd  (%rsp),%xmm3
mulsd  %xmm0,%xmm3
divsd  %xmm6,%xmm3
subsd  %xmm5,%xmm4
mulsd  0xc0f(%rip),%xmm6
movsd  0xbf7(%rip),%xmm0
divsd  %xmm6,%xmm0
addsd  0xc03(%rip),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm4,%xmm2
subsd  %xmm2,%xmm3
addsd  %xmm3,%xmm3
movapd %xmm3,%xmm0
call   1050 <exp@plt>
movapd %xmm0,%xmm1
movapd 0x20(%rsp),%xmm3
mulsd  %xmm3,%xmm1
movapd 0x40(%rsp),%xmm5
addsd  %xmm5,%xmm1
movapd %xmm5,%xmm0
divsd  %xmm1,%xmm0
movsd  0xb62(%rip),%xmm2
movsd  0x8(%rsp),%xmm4
jmp    15cf <betainv+0x43f>
movsd  %xmm3,(%rsp)
movsd  %xmm2,0x60(%rsp)
call   10a0 <sqrt@plt>
movsd  0x60(%rsp),%xmm2
movsd  (%rsp),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
movapd %xmm3,%xmm0
mov    $0x3,%edi
call   1090 <pow@plt>
movapd 0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1545 <betainv+0x3b5>
movsd  0xb4a(%rip),%xmm1
movapd 0x40(%rsp),%xmm5
mulsd  %xmm5,%xmm1
addsd  %xmm2,%xmm1
addsd  0xb3c(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xae8(%rip),%xmm2
ucomisd %xmm1,%xmm2
movsd  0x8(%rsp),%xmm4
jae    1597 <betainv+0x407>
addsd  %xmm2,%xmm1
movsd  0xb18(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
jmp    15c9 <betainv+0x439>
movsd  0xabb(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
call   1080 <log@plt>
addsd  0x58(%rsp),%xmm0
divsd  0x20(%rsp),%xmm0
call   1050 <exp@plt>
movsd  0x8(%rsp),%xmm4
movapd 0x20(%rsp),%xmm3
movsd  0xa85(%rip),%xmm2
movapd %xmm0,%xmm1
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
movapd 0x40(%rsp),%xmm5
jmp    15cf <betainv+0x43f>
mulsd  %xmm5,%xmm4
movapd %xmm4,%xmm0
call   1080 <log@plt>
addsd  0x58(%rsp),%xmm0
divsd  0x40(%rsp),%xmm0
call   1050 <exp@plt>
movapd 0x40(%rsp),%xmm5
movsd  0x8(%rsp),%xmm4
movsd  0xa3f(%rip),%xmm2
movapd 0x20(%rsp),%xmm3
movapd %xmm2,%xmm1
subsd  %xmm5,%xmm1
movsd  %xmm1,0xc0(%rsp)
subsd  %xmm3,%xmm2
movsd  %xmm2,0xb8(%rsp)
movsd  0xa7b(%rip),%xmm1
maxsd  %xmm0,%xmm1
movsd  0xa77(%rip),%xmm0
minsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
movsd  0xa6d(%rip),%xmm0
divsd  %xmm5,%xmm0
divsd  %xmm5,%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm4,%xmm0
xor    %edi,%edi
call   1090 <pow@plt>
movsd  0x9d5(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
addsd  0xa40(%rip),%xmm0
movsd  0xa40(%rip),%xmm1
call   1040 <r8_max@plt>
cvttsd2si %xmm0,%edi
movsd  0x99f(%rip),%xmm0
call   1090 <pow@plt>
movapd 0x10(%rsp),%xmm7
movaps 0x40(%rsp),%xmm1
movaps 0x20(%rsp),%xmm2
movsd  0x98a(%rip),%xmm5
movapd %xmm5,%xmm12
movapd %xmm5,%xmm3
xorpd  %xmm13,%xmm13
movsd  %xmm0,0xb0(%rsp)
movsd  %xmm3,0xa8(%rsp)
movsd  %xmm12,(%rsp)
movsd  %xmm13,0x60(%rsp)
movapd %xmm7,%xmm0
movapd %xmm7,0x10(%rsp)
call   1060 <betacdf@plt>
subsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x90(%rsp)
movapd 0x10(%rsp),%xmm0
call   1080 <log@plt>
mulsd  0xc0(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
movsd  0x914(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
movapd %xmm0,0x70(%rsp)
call   1080 <log@plt>
mulsd  0xb8(%rsp),%xmm0
addsd  0x80(%rsp),%xmm0
call   1050 <exp@plt>
movsd  (%rsp),%xmm12
xorpd  %xmm10,%xmm10
movapd %xmm0,%xmm13
mulsd  0x90(%rsp),%xmm13
movsd  0x60(%rsp),%xmm0
mulsd  %xmm13,%xmm0
ucomisd %xmm0,%xmm10
jb     1775 <betainv+0x5e5>
movsd  0xa8(%rsp),%xmm0
movsd  0xa0(%rsp),%xmm1
movsd  %xmm13,(%rsp)
call   1040 <r8_max@plt>
movsd  (%rsp),%xmm13
xorpd  %xmm10,%xmm10
movapd %xmm0,%xmm12
movapd %xmm13,%xmm8
mulsd  %xmm13,%xmm8
movsd  0x880(%rip),%xmm11
movapd %xmm11,%xmm5
movaps 0x20(%rsp),%xmm2
movaps 0x40(%rsp),%xmm1
movapd 0x10(%rsp),%xmm9
movsd  0xb0(%rsp),%xmm0
movsd  0x8b1(%rip),%xmm6
jmp    17c4 <betainv+0x634>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
divsd  %xmm6,%xmm5
movapd %xmm13,%xmm4
mulsd  %xmm5,%xmm4
movapd %xmm4,%xmm3
mulsd  %xmm4,%xmm3
ucomisd %xmm3,%xmm12
jbe    17c0 <betainv+0x630>
movapd %xmm9,%xmm7
subsd  %xmm4,%xmm7
ucomisd %xmm10,%xmm7
jb     17c0 <betainv+0x630>
ucomisd %xmm7,%xmm11
jb     17c0 <betainv+0x630>
ucomisd %xmm12,%xmm0
jae    1824 <betainv+0x694>
ucomisd %xmm8,%xmm0
jae    1824 <betainv+0x694>
ucomisd %xmm10,%xmm7
jne    180a <betainv+0x67a>
jnp    17c0 <betainv+0x630>
ucomisd %xmm11,%xmm7
jne    1813 <betainv+0x683>
jnp    17c0 <betainv+0x630>
ucomisd %xmm9,%xmm7
jne    1695 <betainv+0x505>
jp     1695 <betainv+0x505>
movsd  0x7e4(%rip),%xmm0
cmpltsd 0x38(%rsp),%xmm0
movapd 0x70(%rsp),%xmm1
andpd  %xmm0,%xmm1
andnpd %xmm9,%xmm0
orpd   %xmm1,%xmm0
add    $0xc8,%rsp
ret
lea    0x89b(%rip),%rdi
jmp    185e <betainv+0x6ce>
lea    0x8bc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"parameters should be non-negatve and real\00"
@.str.1 = [44 x i8] c"probability values must lie between 0 and 1\00"
define double @betainv(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double -3.700000e+01, double* %21
%31 = load double, double* %6
%32 = load double, double* %7
%33 = call double @beta_log(double %31, double %32)
store double %33, double* %30
%34 = load double, double* %21
%35 = fptosi double %34 to i32
%36 = call double @pow(double 1.000000e+01, i32 %35)
store double %36, double* %11
%37 = load double, double* %5
store double %37, double* %25
%38 = load double, double* %6
%39 = fcmp olt double %38, 0.000000e+00
br i1 %39, label %43, label %40
40: ; preds = %3
%41 = load double, double* %7
%42 = fcmp olt double %41, 0.000000e+00
br i1 %42, label %43, label %46
43: ; preds = %40, %3
%44 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %40
%47 = load double, double* %5
%48 = fcmp olt double %47, 0.000000e+00
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = load double, double* %5
%51 = fcmp olt double 1.000000e+00, %50
br i1 %51, label %52, label %55
52: ; preds = %49, %46
%53 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%54 = call i32 @exit(i32 1)
unreachable
55: ; preds = %49
%56 = load double, double* %5
%57 = fcmp oeq double %56, 0.000000e+00
br i1 %57, label %58, label %60
58: ; preds = %55
store double 0.000000e+00, double* %25
%59 = load double, double* %25
store double %59, double* %4
br label %335
60: ; preds = %55
%61 = load double, double* %5
%62 = fcmp oeq double %61, 1.000000e+00
br i1 %62, label %63, label %65
63: ; preds = %60
store double 1.000000e+00, double* %25
%64 = load double, double* %25
store double %64, double* %4
br label %335
65: ; preds = %60
%66 = load double, double* %5
%67 = fcmp olt double 5.000000e-01, %66
br i1 %67, label %68, label %73
68: ; preds = %65
%69 = load double, double* %5
%70 = fsub double 1.000000e+00, %69
store double %70, double* %8
%71 = load double, double* %7
store double %71, double* %16
%72 = load double, double* %6
store double %72, double* %18
store i32 1, i32* %15
br label %77
73: ; preds = %65
%74 = load double, double* %5
store double %74, double* %8
%75 = load double, double* %6
store double %75, double* %16
%76 = load double, double* %7
store double %76, double* %18
store i32 0, i32* %15
br label %77
77: ; preds = %73, %68
%78 = load double, double* %8
%79 = load double, double* %8
%80 = fmul double %78, %79
%81 = call double @log(double %80)
%82 = fneg double %81
%83 = call double @sqrt(double %82)
store double %83, double* %19
%84 = load double, double* %19
%85 = load double, double* %19
%86 = call double @llvm.fmuladd.f64(double 2.706100e-01, double %85, double 2.307530e+00)
%87 = load double, double* %19
%88 = call double @llvm.fmuladd.f64(double 4.481000e-02, double %87, double 9.922900e-01)
%89 = load double, double* %19
%90 = call double @llvm.fmuladd.f64(double %88, double %89, double 1.000000e+00)
%91 = fdiv double %86, %90
%92 = fsub double %84, %91
store double %92, double* %28
%93 = load double, double* %16
%94 = fcmp olt double 1.000000e+00, %93
br i1 %94, label %95, label %145
95: ; preds = %77
%96 = load double, double* %18
%97 = fcmp olt double 1.000000e+00, %96
br i1 %97, label %98, label %145
98: ; preds = %95
%99 = load double, double* %28
%100 = load double, double* %28
%101 = call double @llvm.fmuladd.f64(double %99, double %100, double -3.000000e+00)
%102 = fdiv double %101, 6.000000e+00
store double %102, double* %19
%103 = load double, double* %16
%104 = load double, double* %16
%105 = fadd double %103, %104
%106 = fsub double %105, 1.000000e+00
%107 = fdiv double 1.000000e+00, %106
store double %107, double* %20
%108 = load double, double* %18
%109 = load double, double* %18
%110 = fadd double %108, %109
%111 = fsub double %110, 1.000000e+00
%112 = fdiv double 1.000000e+00, %111
store double %112, double* %23
%113 = load double, double* %20
%114 = load double, double* %23
%115 = fadd double %113, %114
%116 = fdiv double 2.000000e+00, %115
store double %116, double* %13
%117 = load double, double* %28
%118 = load double, double* %13
%119 = load double, double* %19
%120 = fadd double %118, %119
%121 = call double @sqrt(double %120)
%122 = fmul double %117, %121
%123 = load double, double* %13
%124 = fdiv double %122, %123
%125 = load double, double* %23
%126 = load double, double* %20
%127 = fsub double %125, %126
%128 = load double, double* %19
%129 = fadd double %128, 0x3FEAAAAAAAAAAAAB
%130 = load double, double* %13
%131 = fmul double 3.000000e+00, %130
%132 = fdiv double 2.000000e+00, %131
%133 = fsub double %129, %132
%134 = fneg double %127
%135 = call double @llvm.fmuladd.f64(double %134, double %133, double %124)
store double %135, double* %26
%136 = load double, double* %16
%137 = load double, double* %16
%138 = load double, double* %18
%139 = load double, double* %26
%140 = load double, double* %26
%141 = fadd double %139, %140
%142 = call double @exp(double %141)
%143 = call double @llvm.fmuladd.f64(double %138, double %142, double %137)
%144 = fdiv double %136, %143
store double %144, double* %25
br label %201
145: ; preds = %95, %77
%146 = load double, double* %18
%147 = load double, double* %18
%148 = fadd double %146, %147
store double %148, double* %19
%149 = load double, double* %18
%150 = fmul double 9.000000e+00, %149
%151 = fdiv double 1.000000e+00, %150
store double %151, double* %23
%152 = load double, double* %19
%153 = load double, double* %23
%154 = fsub double 1.000000e+00, %153
%155 = load double, double* %28
%156 = load double, double* %23
%157 = call double @sqrt(double %156)
%158 = call double @llvm.fmuladd.f64(double %155, double %157, double %154)
%159 = call double @pow(double %158, i32 3)
%160 = fmul double %152, %159
store double %160, double* %23
%161 = load double, double* %23
%162 = fcmp ole double %161, 0.000000e+00
br i1 %162, label %163, label %175
163: ; preds = %145
%164 = load double, double* %8
%165 = fsub double 1.000000e+00, %164
%166 = load double, double* %18
%167 = fmul double %165, %166
%168 = call double @log(double %167)
%169 = load double, double* %30
%170 = fadd double %168, %169
%171 = load double, double* %18
%172 = fdiv double %170, %171
%173 = call double @exp(double %172)
%174 = fsub double 1.000000e+00, %173
store double %174, double* %25
br label %200
175: ; preds = %145
%176 = load double, double* %16
%177 = load double, double* %19
%178 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %176, double %177)
%179 = fsub double %178, 2.000000e+00
%180 = load double, double* %23
%181 = fdiv double %179, %180
store double %181, double* %23
%182 = load double, double* %23
%183 = fcmp ole double %182, 1.000000e+00
br i1 %183, label %184, label %194
184: ; preds = %175
%185 = load double, double* %8
%186 = load double, double* %16
%187 = fmul double %185, %186
%188 = call double @log(double %187)
%189 = load double, double* %30
%190 = fadd double %188, %189
%191 = load double, double* %16
%192 = fdiv double %190, %191
%193 = call double @exp(double %192)
store double %193, double* %25
br label %199
194: ; preds = %175
%195 = load double, double* %23
%196 = fadd double %195, 1.000000e+00
%197 = fdiv double 2.000000e+00, %196
%198 = fsub double 1.000000e+00, %197
store double %198, double* %25
br label %199
199: ; preds = %194, %184
br label %200
200: ; preds = %199, %163
br label %201
201: ; preds = %200, %98
%202 = load double, double* %16
%203 = fsub double 1.000000e+00, %202
store double %203, double* %19
%204 = load double, double* %18
%205 = fsub double 1.000000e+00, %204
store double %205, double* %23
store double 0.000000e+00, double* %29
store double 1.000000e+00, double* %22
store double 1.000000e+00, double* %17
%206 = load double, double* %25
%207 = fcmp olt double %206, 1.000000e-04
br i1 %207, label %208, label %209
208: ; preds = %201
store double 1.000000e-04, double* %25
br label %209
209: ; preds = %208, %201
%210 = load double, double* %25
%211 = fcmp olt double 9.999000e-01, %210
br i1 %211, label %212, label %213
212: ; preds = %209
store double 9.999000e-01, double* %25
br label %213
213: ; preds = %212, %209
%214 = load double, double* %16
%215 = fdiv double -5.000000e+00, %214
%216 = load double, double* %16
%217 = fdiv double %215, %216
%218 = load double, double* %8
%219 = call double @pow(double %218, i32 0)
%220 = fdiv double 1.000000e+00, %219
%221 = fsub double %217, %220
%222 = fsub double %221, 1.300000e+01
%223 = load double, double* %21
%224 = call double @r8_max(double %222, double %223)
%225 = fptosi double %224 to i32
store i32 %225, i32* %14
%226 = load i32, i32* %14
%227 = call double @pow(double 1.000000e+01, i32 %226)
store double %227, double* %9
br label %228
228: ; preds = %324, %213
%229 = load double, double* %25
%230 = load double, double* %16
%231 = load double, double* %18
%232 = call double @betacdf(double %229, double %230, double %231)
store double %232, double* %28
%233 = load double, double* %25
store double %233, double* %27
%234 = load double, double* %28
%235 = load double, double* %8
%236 = fsub double %234, %235
%237 = load double, double* %30
%238 = load double, double* %19
%239 = load double, double* %27
%240 = call double @log(double %239)
%241 = call double @llvm.fmuladd.f64(double %238, double %240, double %237)
%242 = load double, double* %23
%243 = load double, double* %27
%244 = fsub double 1.000000e+00, %243
%245 = call double @log(double %244)
%246 = call double @llvm.fmuladd.f64(double %242, double %245, double %241)
%247 = call double @exp(double %246)
%248 = fmul double %236, %247
store double %248, double* %28
%249 = load double, double* %28
%250 = load double, double* %29
%251 = fmul double %249, %250
%252 = fcmp ole double %251, 0.000000e+00
br i1 %252, label %253, label %257
253: ; preds = %228
%254 = load double, double* %22
%255 = load double, double* %11
%256 = call double @r8_max(double %254, double %255)
store double %256, double* %17
br label %257
257: ; preds = %253, %228
store double 1.000000e+00, double* %12
br label %258
258: ; preds = %316, %257
br label %259
259: ; preds = %280, %258
%260 = load double, double* %12
%261 = load double, double* %28
%262 = fmul double %260, %261
store double %262, double* %10
%263 = load double, double* %10
%264 = load double, double* %10
%265 = fmul double %263, %264
store double %265, double* %22
%266 = load double, double* %22
%267 = load double, double* %17
%268 = fcmp olt double %266, %267
br i1 %268, label %269, label %280
269: ; preds = %259
%270 = load double, double* %25
%271 = load double, double* %10
%272 = fsub double %270, %271
store double %272, double* %24
%273 = load double, double* %24
%274 = fcmp ole double 0.000000e+00, %273
br i1 %274, label %275, label %279
275: ; preds = %269
%276 = load double, double* %24
%277 = fcmp ole double %276, 1.000000e+00
br i1 %277, label %278, label %279
278: ; preds = %275
br label %283
279: ; preds = %275, %269
br label %280
280: ; preds = %279, %259
%281 = load double, double* %12
%282 = fdiv double %281, 3.000000e+00
store double %282, double* %12
br label %259
283: ; preds = %278
%284 = load double, double* %17
%285 = load double, double* %9
%286 = fcmp ole double %284, %285
br i1 %286, label %287, label %295
287: ; preds = %283
%288 = load i32, i32* %15
%289 = icmp ne i32 %288, 0
br i1 %289, label %290, label %293
290: ; preds = %287
%291 = load double, double* %25
%292 = fsub double 1.000000e+00, %291
store double %292, double* %25
br label %293
293: ; preds = %290, %287
%294 = load double, double* %25
store double %294, double* %4
br label %335
295: ; preds = %283
%296 = load double, double* %28
%297 = load double, double* %28
%298 = fmul double %296, %297
%299 = load double, double* %9
%300 = fcmp ole double %298, %299
br i1 %300, label %301, label %309
301: ; preds = %295
%302 = load i32, i32* %15
%303 = icmp ne i32 %302, 0
br i1 %303, label %304, label %307
304: ; preds = %301
%305 = load double, double* %25
%306 = fsub double 1.000000e+00, %305
store double %306, double* %25
br label %307
307: ; preds = %304, %301
%308 = load double, double* %25
store double %308, double* %4
br label %335
309: ; preds = %295
%310 = load double, double* %24
%311 = fcmp une double %310, 0.000000e+00
br i1 %311, label %312, label %316
312: ; preds = %309
%313 = load double, double* %24
%314 = fcmp une double %313, 1.000000e+00
br i1 %314, label %315, label %316
315: ; preds = %312
br label %319
316: ; preds = %312, %309
%317 = load double, double* %12
%318 = fdiv double %317, 3.000000e+00
store double %318, double* %12
br label %258
319: ; preds = %315
%320 = load double, double* %24
%321 = load double, double* %25
%322 = fcmp oeq double %320, %321
br i1 %322, label %323, label %324
323: ; preds = %319
br label %327
324: ; preds = %319
%325 = load double, double* %24
store double %325, double* %25
%326 = load double, double* %28
store double %326, double* %29
br label %228
327: ; preds = %323
%328 = load i32, i32* %15
%329 = icmp ne i32 %328, 0
br i1 %329, label %330, label %333
330: ; preds = %327
%331 = load double, double* %25
%332 = fsub double 1.000000e+00, %331
store double %332, double* %25
br label %333
333: ; preds = %330, %327
%334 = load double, double* %25
store double %334, double* %4
br label %335
335: ; preds = %333, %307, %293, %63, %58
%336 = load double, double* %4
ret double %336
}

LLVM IR (-O2):
@.str = [42 x i8] c"parameters should be non-negatve and real\00"
@.str.1 = [44 x i8] c"probability values must lie between 0 and 1\00"
define double @betainv(double %0, double %1, double %2) {
%4 = tail call double @beta_log(double %1, double %2)
%5 = tail call double @pow(double 1.000000e+01, i32 -37)
%6 = fcmp olt double %1, 0.000000e+00
%7 = fcmp olt double %2, 0.000000e+00
%8 = or i1 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %3
%13 = fcmp olt double %0, 0.000000e+00
%14 = fcmp ogt double %0, 1.000000e+00
%15 = or i1 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %12
%20 = fcmp oeq double %0, 0.000000e+00
br i1 %20, label %178, label %21
21: ; preds = %19
%22 = fcmp oeq double %0, 1.000000e+00
br i1 %22, label %178, label %23
23: ; preds = %21
%24 = fcmp ogt double %0, 5.000000e-01
%25 = fsub double 1.000000e+00, %0
%26 = insertelement <2 x i1> poison, i1 %24, i64 0
%27 = shufflevector <2 x i1> %26, <2 x i1> poison, <2 x i32> zeroinitializer
%28 = insertelement <2 x double> poison, double %1, i64 0
%29 = insertelement <2 x double> %28, double %2, i64 1
%30 = insertelement <2 x double> poison, double %2, i64 0
%31 = insertelement <2 x double> %30, double %1, i64 1
%32 = select <2 x i1> %27, <2 x double> %29, <2 x double> %31
%33 = select i1 %24, double %25, double %0
%34 = fmul double %33, %33
%35 = tail call double @log(double %34)
%36 = fneg double %35
%37 = tail call double @sqrt(double %36)
%38 = tail call double @llvm.fmuladd.f64(double %37, double 2.706100e-01, double 2.307530e+00)
%39 = tail call double @llvm.fmuladd.f64(double %37, double 4.481000e-02, double 9.922900e-01)
%40 = tail call double @llvm.fmuladd.f64(double %39, double %37, double 1.000000e+00)
%41 = fdiv double %38, %40
%42 = fsub double %37, %41
%43 = extractelement <2 x double> %32, i64 1
%44 = fcmp ogt double %43, 1.000000e+00
%45 = extractelement <2 x double> %32, i64 0
%46 = fcmp ogt double %45, 1.000000e+00
%47 = and i1 %44, %46
br i1 %47, label %48, label %78
48: ; preds = %23
%49 = tail call double @llvm.fmuladd.f64(double %42, double %42, double -3.000000e+00)
%50 = fadd <2 x double> %32, %32
%51 = fadd <2 x double> %50, <double -1.000000e+00, double -1.000000e+00>
%52 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %51
%53 = extractelement <2 x double> %52, i64 0
%54 = extractelement <2 x double> %52, i64 1
%55 = fadd double %54, %53
%56 = insertelement <2 x double> <double poison, double 2.000000e+00>, double %49, i64 0
%57 = insertelement <2 x double> <double 6.000000e+00, double poison>, double %55, i64 1
%58 = fdiv <2 x double> %56, %57
%59 = extractelement <2 x double> %58, i64 0
%60 = extractelement <2 x double> %58, i64 1
%61 = fadd double %60, %59
%62 = tail call double @sqrt(double %61)
%63 = fmul double %42, %62
%64 = fdiv double %63, %60
%65 = fsub double %53, %54
%66 = extractelement <2 x double> %58, i64 1
%67 = fmul double %66, 3.000000e+00
%68 = fdiv double 2.000000e+00, %67
%69 = extractelement <2 x double> %58, i64 0
%70 = fadd double %69, 0x3FEAAAAAAAAAAAAB
%71 = fsub double %70, %68
%72 = fneg double %65
%73 = tail call double @llvm.fmuladd.f64(double %72, double %71, double %64)
%74 = fadd double %73, %73
%75 = tail call double @exp(double %74)
%76 = tail call double @llvm.fmuladd.f64(double %45, double %75, double %43)
%77 = fdiv double %43, %76
br label %112
78: ; preds = %23
%79 = fadd <2 x double> %32, %32
%80 = extractelement <2 x double> %79, i64 0
%81 = fmul double %45, 9.000000e+00
%82 = fdiv double 1.000000e+00, %81
%83 = fsub double 1.000000e+00, %82
%84 = tail call double @sqrt(double %82)
%85 = tail call double @llvm.fmuladd.f64(double %42, double %84, double %83)
%86 = tail call double @pow(double %85, i32 3)
%87 = fmul double %80, %86
%88 = fcmp ugt double %87, 0.000000e+00
br i1 %88, label %97, label %89
89: ; preds = %78
%90 = fsub double 1.000000e+00, %33
%91 = fmul double %90, %45
%92 = tail call double @log(double %91)
%93 = fadd double %4, %92
%94 = fdiv double %93, %45
%95 = tail call double @exp(double %94)
%96 = fsub double 1.000000e+00, %95
br label %112
97: ; preds = %78
%98 = tail call double @llvm.fmuladd.f64(double %43, double 4.000000e+00, double %80)
%99 = fadd double %98, -2.000000e+00
%100 = fdiv double %99, %87
%101 = fcmp ugt double %100, 1.000000e+00
br i1 %101, label %108, label %102
102: ; preds = %97
%103 = fmul double %33, %43
%104 = tail call double @log(double %103)
%105 = fadd double %4, %104
%106 = fdiv double %105, %43
%107 = tail call double @exp(double %106)
br label %112
108: ; preds = %97
%109 = fadd double %100, 1.000000e+00
%110 = fdiv double 2.000000e+00, %109
%111 = fsub double 1.000000e+00, %110
br label %112
112: ; preds = %89, %108, %102, %48
%113 = phi double [ %77, %48 ], [ %96, %89 ], [ %107, %102 ], [ %111, %108 ]
%114 = fsub double 1.000000e+00, %43
%115 = fsub double 1.000000e+00, %45
%116 = fcmp olt double %113, 1.000000e-04
%117 = select i1 %116, double 1.000000e-04, double %113
%118 = fcmp ogt double %117, 9.999000e-01
%119 = select i1 %118, double 9.999000e-01, double %117
%120 = fdiv double -5.000000e+00, %43
%121 = fdiv double %120, %43
%122 = tail call double @pow(double %33, i32 0)
%123 = fdiv double 1.000000e+00, %122
%124 = fsub double %121, %123
%125 = fadd double %124, -1.300000e+01
%126 = tail call double @r8_max(double %125, double -3.700000e+01)
%127 = fptosi double %126 to i32
%128 = tail call double @pow(double 1.000000e+01, i32 %127)
br label %129
129: ; preds = %174, %112
%130 = phi double [ 1.000000e+00, %112 ], [ %148, %174 ]
%131 = phi double [ 1.000000e+00, %112 ], [ %155, %174 ]
%132 = phi double [ %119, %112 ], [ %158, %174 ]
%133 = phi double [ 0.000000e+00, %112 ], [ %142, %174 ]
%134 = tail call double @betacdf(double %132, double %43, double %45)
%135 = fsub double %134, %33
%136 = tail call double @log(double %132)
%137 = tail call double @llvm.fmuladd.f64(double %114, double %136, double %4)
%138 = fsub double 1.000000e+00, %132
%139 = tail call double @log(double %138)
%140 = tail call double @llvm.fmuladd.f64(double %115, double %139, double %137)
%141 = tail call double @exp(double %140)
%142 = fmul double %135, %141
%143 = fmul double %133, %142
%144 = fcmp ugt double %143, 0.000000e+00
br i1 %144, label %147, label %145
145: ; preds = %129
%146 = tail call double @r8_max(double %131, double %5)
br label %147
147: ; preds = %145, %129
%148 = phi double [ %146, %145 ], [ %130, %129 ]
%149 = fcmp ugt double %148, %128
%150 = fmul double %142, %142
%151 = fcmp ugt double %150, %128
br label %152
152: ; preds = %162, %147
%153 = phi double [ 1.000000e+00, %147 ], [ %163, %162 ]
%154 = fmul double %142, %153
%155 = fmul double %154, %154
%156 = fcmp olt double %155, %148
br i1 %156, label %157, label %162
157: ; preds = %152
%158 = fsub double %132, %154
%159 = fcmp oge double %158, 0.000000e+00
%160 = fcmp ole double %158, 1.000000e+00
%161 = and i1 %159, %160
br i1 %161, label %164, label %162
162: ; preds = %170, %152, %157
%163 = fdiv double %153, 3.000000e+00
br label %152
164: ; preds = %157
br i1 %149, label %167, label %165
165: ; preds = %164
%166 = select i1 %24, double %138, double %132
br label %178
167: ; preds = %164
br i1 %151, label %170, label %168
168: ; preds = %167
%169 = select i1 %24, double %138, double %132
br label %178
170: ; preds = %167
%171 = fcmp une double %158, 0.000000e+00
%172 = fcmp une double %158, 1.000000e+00
%173 = and i1 %171, %172
br i1 %173, label %174, label %162
174: ; preds = %170
%175 = fcmp oeq double %158, %132
br i1 %175, label %176, label %129
176: ; preds = %174
%177 = select i1 %24, double %138, double %132
br label %178
178: ; preds = %21, %19, %176, %168, %165
%179 = phi double [ %166, %165 ], [ %169, %168 ], [ %177, %176 ], [ 0.000000e+00, %19 ], [ 1.000000e+00, %21 ]
ret double %179
}