#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_distr(double, double, double, char const *);
double beta_distr_density(double, double, double, char const *);
int /*<<< orphan*/ exit(int);
double fabs(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
double beta_distr_inv(double a, double b, double p, const char *prompt) {
  static double last_a = -1, last_b, last_p = -1, last_x = -1;
  static double last_last_a = -1, last_last_b = -1, last_last_p = -1,
                last_last_x = -1;
  double xx, x;
  static const double eps = 1e-10;
  if (a <= 0 || b <= 0 || p <= 0 || p >= 1) {
    fprintf(stderr,
            "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
            "\"beta_distr_inv\")\n",
            prompt);
    exit(4);
  }
  if ((((a) != (a)) || ((last_a) != (last_a))
           ? (((a) != (a)) && ((last_a) != (last_a)) ? 1 : 0)
           : !(a < last_a || last_a < a)) &&
      (((b) != (b)) || ((last_b) != (last_b))
           ? (((b) != (b)) && ((last_b) != (last_b)) ? 1 : 0)
           : !(b < last_b || last_b < b)) &&
      (((p) != (p)) || ((last_p) != (last_p))
           ? (((p) != (p)) && ((last_p) != (last_p)) ? 1 : 0)
           : !(p < last_p || last_p < p)))
    return last_x;
  if ((((a) != (a)) || ((last_last_a) != (last_last_a))
           ? (((a) != (a)) && ((last_last_a) != (last_last_a)) ? 1 : 0)
           : !(a < last_last_a || last_last_a < a)) &&
      (((b) != (b)) || ((last_last_b) != (last_last_b))
           ? (((b) != (b)) && ((last_last_b) != (last_last_b)) ? 1 : 0)
           : !(b < last_last_b || last_last_b < b)) &&
      (((p) != (p)) || ((last_last_p) != (last_last_p))
           ? (((p) != (p)) && ((last_last_p) != (last_last_p)) ? 1 : 0)
           : !(p < last_last_p || last_last_p < p)))
    return last_last_x;
  x = a / (a + b);
  while (1) {
    xx = x - (beta_distr(a, b, x, prompt) - p) /
                 beta_distr_density(a, b, x, prompt);
    if (fabs(xx - x) < x * eps)
      break;
    if (xx <= 0)
      x /= 2;
    else if (xx >= 1)
      x = (1 + x) / 2;
    else
      x = xx;
  }
  last_last_a = last_a;
  last_last_b = last_b;
  last_last_p = last_p;
  last_last_x = last_x;
  last_a = a;
  last_b = b;
  last_p = p;
  last_x = x;
  return x;
}


x86 assembly (clang, -O0):
<beta_distr_inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jae    119c <beta_distr_inv+0x5c>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jae    119c <beta_distr_inv+0x5c>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jae    119c <beta_distr_inv+0x5c>
movsd  -0x20(%rbp),%xmm0
movsd  0xe6e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11bf <beta_distr_inv+0x7f>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xe88(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x4,%edi
call   1060 <exit@plt>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    11f6 <beta_distr_inv+0xb6>
jp     11f6 <beta_distr_inv+0xb6>
movsd  0x2e63(%rip),%xmm0
ucomisd 0x2e5b(%rip),%xmm0
jne    11f6 <beta_distr_inv+0xb6>
jp     11f6 <beta_distr_inv+0xb6>
jmp    1250 <beta_distr_inv+0x110>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1211 <beta_distr_inv+0xd1>
jp     1211 <beta_distr_inv+0xd1>
jmp    1241 <beta_distr_inv+0x101>
movsd  0x2e27(%rip),%xmm0
ucomisd 0x2e1f(%rip),%xmm0
jne    1232 <beta_distr_inv+0xf2>
jp     1232 <beta_distr_inv+0xf2>
jmp    1241 <beta_distr_inv+0x101>
mov    $0x1,%al
test   $0x1,%al
jne    127e <beta_distr_inv+0x13e>
jmp    140e <beta_distr_inv+0x2ce>
xor    %eax,%eax
test   $0x1,%al
jne    127e <beta_distr_inv+0x13e>
jmp    140e <beta_distr_inv+0x2ce>
movsd  -0x10(%rbp),%xmm1
movsd  0x2de3(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     140e <beta_distr_inv+0x2ce>
movsd  0x2dd1(%rip),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     140e <beta_distr_inv+0x2ce>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    12b5 <beta_distr_inv+0x175>
jp     12b5 <beta_distr_inv+0x175>
movsd  0x2de4(%rip),%xmm0
ucomisd 0x2ddc(%rip),%xmm0
jne    12b5 <beta_distr_inv+0x175>
jp     12b5 <beta_distr_inv+0x175>
jmp    130f <beta_distr_inv+0x1cf>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    12d0 <beta_distr_inv+0x190>
jp     12d0 <beta_distr_inv+0x190>
jmp    1300 <beta_distr_inv+0x1c0>
movsd  0x2da8(%rip),%xmm0
ucomisd 0x2da0(%rip),%xmm0
jne    12f1 <beta_distr_inv+0x1b1>
jp     12f1 <beta_distr_inv+0x1b1>
jmp    1300 <beta_distr_inv+0x1c0>
mov    $0x1,%al
test   $0x1,%al
jne    133d <beta_distr_inv+0x1fd>
jmp    140e <beta_distr_inv+0x2ce>
xor    %eax,%eax
test   $0x1,%al
jne    133d <beta_distr_inv+0x1fd>
jmp    140e <beta_distr_inv+0x2ce>
movsd  -0x18(%rbp),%xmm1
movsd  0x2d64(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     140e <beta_distr_inv+0x2ce>
movsd  0x2d52(%rip),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     140e <beta_distr_inv+0x2ce>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    1374 <beta_distr_inv+0x234>
jp     1374 <beta_distr_inv+0x234>
movsd  0x2ced(%rip),%xmm0
ucomisd 0x2ce5(%rip),%xmm0
jne    1374 <beta_distr_inv+0x234>
jp     1374 <beta_distr_inv+0x234>
jmp    13ce <beta_distr_inv+0x28e>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    138f <beta_distr_inv+0x24f>
jp     138f <beta_distr_inv+0x24f>
jmp    13bf <beta_distr_inv+0x27f>
movsd  0x2cb1(%rip),%xmm0
ucomisd 0x2ca9(%rip),%xmm0
jne    13b0 <beta_distr_inv+0x270>
jp     13b0 <beta_distr_inv+0x270>
jmp    13bf <beta_distr_inv+0x27f>
mov    $0x1,%al
test   $0x1,%al
jne    13fc <beta_distr_inv+0x2bc>
jmp    140e <beta_distr_inv+0x2ce>
xor    %eax,%eax
test   $0x1,%al
jne    13fc <beta_distr_inv+0x2bc>
jmp    140e <beta_distr_inv+0x2ce>
movsd  -0x20(%rbp),%xmm1
movsd  0x2c6d(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     140e <beta_distr_inv+0x2ce>
movsd  0x2c5b(%rip),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     140e <beta_distr_inv+0x2ce>
movsd  0x2c4c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    17f9 <beta_distr_inv+0x6b9>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1445 <beta_distr_inv+0x305>
jp     1445 <beta_distr_inv+0x305>
movsd  0x2c2c(%rip),%xmm0
ucomisd 0x2c24(%rip),%xmm0
jne    1445 <beta_distr_inv+0x305>
jp     1445 <beta_distr_inv+0x305>
jmp    149f <beta_distr_inv+0x35f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1460 <beta_distr_inv+0x320>
jp     1460 <beta_distr_inv+0x320>
jmp    1490 <beta_distr_inv+0x350>
movsd  0x2bf0(%rip),%xmm0
ucomisd 0x2be8(%rip),%xmm0
jne    1481 <beta_distr_inv+0x341>
jp     1481 <beta_distr_inv+0x341>
jmp    1490 <beta_distr_inv+0x350>
mov    $0x1,%al
test   $0x1,%al
jne    14cd <beta_distr_inv+0x38d>
jmp    165d <beta_distr_inv+0x51d>
xor    %eax,%eax
test   $0x1,%al
jne    14cd <beta_distr_inv+0x38d>
jmp    165d <beta_distr_inv+0x51d>
movsd  -0x10(%rbp),%xmm1
movsd  0x2bac(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     165d <beta_distr_inv+0x51d>
movsd  0x2b9a(%rip),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     165d <beta_distr_inv+0x51d>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1504 <beta_distr_inv+0x3c4>
jp     1504 <beta_distr_inv+0x3c4>
movsd  0x2b75(%rip),%xmm0
ucomisd 0x2b6d(%rip),%xmm0
jne    1504 <beta_distr_inv+0x3c4>
jp     1504 <beta_distr_inv+0x3c4>
jmp    155e <beta_distr_inv+0x41e>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    151f <beta_distr_inv+0x3df>
jp     151f <beta_distr_inv+0x3df>
jmp    154f <beta_distr_inv+0x40f>
movsd  0x2b39(%rip),%xmm0
ucomisd 0x2b31(%rip),%xmm0
jne    1540 <beta_distr_inv+0x400>
jp     1540 <beta_distr_inv+0x400>
jmp    154f <beta_distr_inv+0x40f>
mov    $0x1,%al
test   $0x1,%al
jne    158c <beta_distr_inv+0x44c>
jmp    165d <beta_distr_inv+0x51d>
xor    %eax,%eax
test   $0x1,%al
jne    158c <beta_distr_inv+0x44c>
jmp    165d <beta_distr_inv+0x51d>
movsd  -0x18(%rbp),%xmm1
movsd  0x2af5(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     165d <beta_distr_inv+0x51d>
movsd  0x2ae3(%rip),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     165d <beta_distr_inv+0x51d>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    15c3 <beta_distr_inv+0x483>
jp     15c3 <beta_distr_inv+0x483>
movsd  0x2abe(%rip),%xmm0
ucomisd 0x2ab6(%rip),%xmm0
jne    15c3 <beta_distr_inv+0x483>
jp     15c3 <beta_distr_inv+0x483>
jmp    161d <beta_distr_inv+0x4dd>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    15de <beta_distr_inv+0x49e>
jp     15de <beta_distr_inv+0x49e>
jmp    160e <beta_distr_inv+0x4ce>
movsd  0x2a82(%rip),%xmm0
ucomisd 0x2a7a(%rip),%xmm0
jne    15ff <beta_distr_inv+0x4bf>
jp     15ff <beta_distr_inv+0x4bf>
jmp    160e <beta_distr_inv+0x4ce>
mov    $0x1,%al
test   $0x1,%al
jne    164b <beta_distr_inv+0x50b>
jmp    165d <beta_distr_inv+0x51d>
xor    %eax,%eax
test   $0x1,%al
jne    164b <beta_distr_inv+0x50b>
jmp    165d <beta_distr_inv+0x51d>
movsd  -0x20(%rbp),%xmm1
movsd  0x2a3e(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     165d <beta_distr_inv+0x51d>
movsd  0x2a2c(%rip),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     165d <beta_distr_inv+0x51d>
movsd  0x2a1d(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    17f9 <beta_distr_inv+0x6b9>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
call   1040 <beta_distr@plt>
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
mov    -0x28(%rbp),%rdi
call   1030 <beta_distr_density@plt>
movsd  -0x48(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
subsd  -0x38(%rbp),%xmm1
movaps 0x93c(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x918(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1704 <beta_distr_inv+0x5c4>
jmp    177b <beta_distr_inv+0x63b>
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     172d <beta_distr_inv+0x5ed>
movsd  -0x38(%rbp),%xmm0
movsd  0x8f1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1776 <beta_distr_inv+0x636>
movsd  -0x30(%rbp),%xmm0
movsd  0x8c6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1767 <beta_distr_inv+0x627>
movsd  0x8b4(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  0x8b7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1771 <beta_distr_inv+0x631>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1776 <beta_distr_inv+0x636>
jmp    1675 <beta_distr_inv+0x535>
movsd  0x28bd(%rip),%xmm0
movsd  %xmm0,0x28cd(%rip)
movsd  0x28ed(%rip),%xmm0
movsd  %xmm0,0x28c5(%rip)
movsd  0x28a5(%rip),%xmm0
movsd  %xmm0,0x28bd(%rip)
movsd  0x289d(%rip),%xmm0
movsd  %xmm0,0x28b5(%rip)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,0x2878(%rip)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,0x28ab(%rip)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,0x2866(%rip)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,0x2861(%rip)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beta_distr_inv>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
ucomisd 0xe9f(%rip),%xmm2
jae    120b <beta_distr_inv+0xcb>
xorpd  %xmm0,%xmm0
ucomisd 0x8(%rsp),%xmm0
jae    120b <beta_distr_inv+0xcb>
ucomisd (%rsp),%xmm0
jae    120b <beta_distr_inv+0xcb>
xorpd  %xmm0,%xmm0
ucomisd 0x10(%rsp),%xmm0
jae    120b <beta_distr_inv+0xcb>
movsd  0x8(%rsp),%xmm0
ucomisd %xmm0,%xmm0
movsd  0x2ea0(%rip),%xmm0
jp     122d <beta_distr_inv+0xed>
ucomisd %xmm0,%xmm0
jp     1253 <beta_distr_inv+0x113>
ucomisd 0x8(%rsp),%xmm0
jne    1253 <beta_distr_inv+0x113>
movsd  (%rsp),%xmm0
ucomisd %xmm0,%xmm0
movsd  0x2eb3(%rip),%xmm0
jp     1239 <beta_distr_inv+0xf9>
ucomisd %xmm0,%xmm0
jp     1247 <beta_distr_inv+0x107>
ucomisd (%rsp),%xmm0
jne    1247 <beta_distr_inv+0x107>
movsd  0x10(%rsp),%xmm0
ucomisd %xmm0,%xmm0
movsd  0x2e5a(%rip),%xmm0
jp     1241 <beta_distr_inv+0x101>
ucomisd %xmm0,%xmm0
jp     1247 <beta_distr_inv+0x107>
ucomisd 0x10(%rsp),%xmm0
jne    1247 <beta_distr_inv+0x107>
movsd  0x2e4a(%rip),%xmm2
jmp    141a <beta_distr_inv+0x2da>
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
lea    0xe15(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    $0x4,%edi
call   1060 <exit@plt>
ucomisd %xmm0,%xmm0
jnp    12b8 <beta_distr_inv+0x178>
jmp    11bc <beta_distr_inv+0x7c>
ucomisd %xmm0,%xmm0
jnp    1247 <beta_distr_inv+0x107>
jmp    11dc <beta_distr_inv+0x9c>
ucomisd %xmm0,%xmm0
jp     11fe <beta_distr_inv+0xbe>
movsd  0x8(%rsp),%xmm0
ucomisd %xmm0,%xmm0
jp     12b8 <beta_distr_inv+0x178>
movsd  0x2dfd(%rip),%xmm0
ucomisd %xmm0,%xmm0
jp     12d6 <beta_distr_inv+0x196>
ucomisd 0x8(%rsp),%xmm0
jne    12d6 <beta_distr_inv+0x196>
movsd  (%rsp),%xmm0
ucomisd %xmm0,%xmm0
movsd  0x2de6(%rip),%xmm0
jp     12c8 <beta_distr_inv+0x188>
ucomisd %xmm0,%xmm0
jp     12d6 <beta_distr_inv+0x196>
ucomisd (%rsp),%xmm0
jne    12d6 <beta_distr_inv+0x196>
movsd  0x10(%rsp),%xmm0
ucomisd %xmm0,%xmm0
movsd  0x2dcd(%rip),%xmm0
jp     12d0 <beta_distr_inv+0x190>
ucomisd %xmm0,%xmm0
jp     12d6 <beta_distr_inv+0x196>
ucomisd 0x10(%rsp),%xmm0
jne    12d6 <beta_distr_inv+0x196>
movsd  0x2dbd(%rip),%xmm2
jmp    141a <beta_distr_inv+0x2da>
movsd  0x2d98(%rip),%xmm0
ucomisd %xmm0,%xmm0
jnp    12d6 <beta_distr_inv+0x196>
jmp    1269 <beta_distr_inv+0x129>
ucomisd %xmm0,%xmm0
jnp    12d6 <beta_distr_inv+0x196>
jmp    1289 <beta_distr_inv+0x149>
ucomisd %xmm0,%xmm0
jp     12ab <beta_distr_inv+0x16b>
movsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
addsd  (%rsp),%xmm0
movapd %xmm1,%xmm3
divsd  %xmm0,%xmm3
jmp    1304 <beta_distr_inv+0x1c4>
nop
addsd  0xd08(%rip),%xmm2
mulsd  0xd10(%rip),%xmm2
movapd %xmm2,%xmm3
movsd  %xmm3,0x28(%rsp)
movapd %xmm3,%xmm2
movsd  %xmm3,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
mov    %rbx,%rdi
call   1040 <beta_distr@plt>
subsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
mov    %rbx,%rdi
call   1030 <beta_distr_density@plt>
movsd  0x28(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
subsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
subsd  %xmm2,%xmm0
andpd  0xcaa(%rip),%xmm0
movapd %xmm2,%xmm1
mulsd  0xc86(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     13a9 <beta_distr_inv+0x269>
xorpd  %xmm0,%xmm0
ucomisd %xmm3,%xmm0
jae    12f8 <beta_distr_inv+0x1b8>
ucomisd 0xc62(%rip),%xmm3
jb     1304 <beta_distr_inv+0x1c4>
jmp    12f0 <beta_distr_inv+0x1b0>
movsd  0x2c8f(%rip),%xmm0
movsd  %xmm0,0x2c9f(%rip)
movsd  0x2cbf(%rip),%xmm0
movsd  %xmm0,0x2c97(%rip)
movsd  0x2c77(%rip),%xmm0
movsd  %xmm0,0x2c8f(%rip)
movsd  0x2c6f(%rip),%xmm0
movsd  %xmm0,0x2c87(%rip)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x2c49(%rip)
movsd  (%rsp),%xmm0
movsd  %xmm0,0x2c7c(%rip)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x2c36(%rip)
movsd  %xmm2,0x2c36(%rip)
movapd %xmm2,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@beta_distr_inv.last_a = internal global double -1.000000e+00
@beta_distr_inv.last_b = internal global double 0.000000e+00
@beta_distr_inv.last_p = internal global double -1.000000e+00
@beta_distr_inv.last_x = internal global double -1.000000e+00
@beta_distr_inv.last_last_a = internal global double -1.000000e+00
@beta_distr_inv.last_last_b = internal global double -1.000000e+00
@beta_distr_inv.last_last_p = internal global double -1.000000e+00
@beta_distr_inv.last_last_x = internal global double -1.000000e+00
@beta_distr_inv.eps = internal constant double 1.000000e-10
@stderr = global i32 0
@.str = [75 x i8] c"%s: IMPLEMENTATION ERROR! (Invalid argument in function \22beta_distr_inv\22)\0A\00"
define double @beta_distr_inv(double %0, double %1, double %2, i8* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i8*
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store i8* %3, i8** %9
%12 = load double, double* %6
%13 = fcmp ole double %12, 0.000000e+00
br i1 %13, label %23, label %14
14: ; preds = %4
%15 = load double, double* %7
%16 = fcmp ole double %15, 0.000000e+00
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = load double, double* %8
%19 = fcmp ole double %18, 0.000000e+00
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load double, double* %8
%22 = fcmp oge double %21, 1.000000e+00
br i1 %22, label %23, label %28
23: ; preds = %20, %17, %14, %4
%24 = load i32, i32* @stderr
%25 = load i8*, i8** %9
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = call i32 @exit(i32 4)
unreachable
28: ; preds = %20
%29 = load double, double* %6
%30 = load double, double* %6
%31 = fcmp une double %29, %30
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load double, double* @beta_distr_inv.last_a
%34 = load double, double* @beta_distr_inv.last_a
%35 = fcmp une double %33, %34
br i1 %35, label %36, label %46
36: ; preds = %32, %28
%37 = load double, double* %6
%38 = load double, double* %6
%39 = fcmp une double %37, %38
br i1 %39, label %40, label %45
40: ; preds = %36
%41 = load double, double* @beta_distr_inv.last_a
%42 = load double, double* @beta_distr_inv.last_a
%43 = fcmp une double %41, %42
br i1 %43, label %44, label %45
44: ; preds = %40
br i1 true, label %54, label %108
45: ; preds = %40, %36
br i1 false, label %54, label %108
46: ; preds = %32
%47 = load double, double* %6
%48 = load double, double* @beta_distr_inv.last_a
%49 = fcmp olt double %47, %48
br i1 %49, label %108, label %50
50: ; preds = %46
%51 = load double, double* @beta_distr_inv.last_a
%52 = load double, double* %6
%53 = fcmp olt double %51, %52
br i1 %53, label %108, label %54
54: ; preds = %50, %45, %44
%55 = load double, double* %7
%56 = load double, double* %7
%57 = fcmp une double %55, %56
br i1 %57, label %62, label %58
58: ; preds = %54
%59 = load double, double* @beta_distr_inv.last_b
%60 = load double, double* @beta_distr_inv.last_b
%61 = fcmp une double %59, %60
br i1 %61, label %62, label %72
62: ; preds = %58, %54
%63 = load double, double* %7
%64 = load double, double* %7
%65 = fcmp une double %63, %64
br i1 %65, label %66, label %71
66: ; preds = %62
%67 = load double, double* @beta_distr_inv.last_b
%68 = load double, double* @beta_distr_inv.last_b
%69 = fcmp une double %67, %68
br i1 %69, label %70, label %71
70: ; preds = %66
br i1 true, label %80, label %108
71: ; preds = %66, %62
br i1 false, label %80, label %108
72: ; preds = %58
%73 = load double, double* %7
%74 = load double, double* @beta_distr_inv.last_b
%75 = fcmp olt double %73, %74
br i1 %75, label %108, label %76
76: ; preds = %72
%77 = load double, double* @beta_distr_inv.last_b
%78 = load double, double* %7
%79 = fcmp olt double %77, %78
br i1 %79, label %108, label %80
80: ; preds = %76, %71, %70
%81 = load double, double* %8
%82 = load double, double* %8
%83 = fcmp une double %81, %82
br i1 %83, label %88, label %84
84: ; preds = %80
%85 = load double, double* @beta_distr_inv.last_p
%86 = load double, double* @beta_distr_inv.last_p
%87 = fcmp une double %85, %86
br i1 %87, label %88, label %98
88: ; preds = %84, %80
%89 = load double, double* %8
%90 = load double, double* %8
%91 = fcmp une double %89, %90
br i1 %91, label %92, label %97
92: ; preds = %88
%93 = load double, double* @beta_distr_inv.last_p
%94 = load double, double* @beta_distr_inv.last_p
%95 = fcmp une double %93, %94
br i1 %95, label %96, label %97
96: ; preds = %92
br i1 true, label %106, label %108
97: ; preds = %92, %88
br i1 false, label %106, label %108
98: ; preds = %84
%99 = load double, double* %8
%100 = load double, double* @beta_distr_inv.last_p
%101 = fcmp olt double %99, %100
br i1 %101, label %108, label %102
102: ; preds = %98
%103 = load double, double* @beta_distr_inv.last_p
%104 = load double, double* %8
%105 = fcmp olt double %103, %104
br i1 %105, label %108, label %106
106: ; preds = %102, %97, %96
%107 = load double, double* @beta_distr_inv.last_x
store double %107, double* %5
br label %245
108: ; preds = %102, %98, %97, %96, %76, %72, %71, %70, %50, %46, %45, %44
%109 = load double, double* %6
%110 = load double, double* %6
%111 = fcmp une double %109, %110
br i1 %111, label %116, label %112
112: ; preds = %108
%113 = load double, double* @beta_distr_inv.last_last_a
%114 = load double, double* @beta_distr_inv.last_last_a
%115 = fcmp une double %113, %114
br i1 %115, label %116, label %126
116: ; preds = %112, %108
%117 = load double, double* %6
%118 = load double, double* %6
%119 = fcmp une double %117, %118
br i1 %119, label %120, label %125
120: ; preds = %116
%121 = load double, double* @beta_distr_inv.last_last_a
%122 = load double, double* @beta_distr_inv.last_last_a
%123 = fcmp une double %121, %122
br i1 %123, label %124, label %125
124: ; preds = %120
br i1 true, label %134, label %188
125: ; preds = %120, %116
br i1 false, label %134, label %188
126: ; preds = %112
%127 = load double, double* %6
%128 = load double, double* @beta_distr_inv.last_last_a
%129 = fcmp olt double %127, %128
br i1 %129, label %188, label %130
130: ; preds = %126
%131 = load double, double* @beta_distr_inv.last_last_a
%132 = load double, double* %6
%133 = fcmp olt double %131, %132
br i1 %133, label %188, label %134
134: ; preds = %130, %125, %124
%135 = load double, double* %7
%136 = load double, double* %7
%137 = fcmp une double %135, %136
br i1 %137, label %142, label %138
138: ; preds = %134
%139 = load double, double* @beta_distr_inv.last_last_b
%140 = load double, double* @beta_distr_inv.last_last_b
%141 = fcmp une double %139, %140
br i1 %141, label %142, label %152
142: ; preds = %138, %134
%143 = load double, double* %7
%144 = load double, double* %7
%145 = fcmp une double %143, %144
br i1 %145, label %146, label %151
146: ; preds = %142
%147 = load double, double* @beta_distr_inv.last_last_b
%148 = load double, double* @beta_distr_inv.last_last_b
%149 = fcmp une double %147, %148
br i1 %149, label %150, label %151
150: ; preds = %146
br i1 true, label %160, label %188
151: ; preds = %146, %142
br i1 false, label %160, label %188
152: ; preds = %138
%153 = load double, double* %7
%154 = load double, double* @beta_distr_inv.last_last_b
%155 = fcmp olt double %153, %154
br i1 %155, label %188, label %156
156: ; preds = %152
%157 = load double, double* @beta_distr_inv.last_last_b
%158 = load double, double* %7
%159 = fcmp olt double %157, %158
br i1 %159, label %188, label %160
160: ; preds = %156, %151, %150
%161 = load double, double* %8
%162 = load double, double* %8
%163 = fcmp une double %161, %162
br i1 %163, label %168, label %164
164: ; preds = %160
%165 = load double, double* @beta_distr_inv.last_last_p
%166 = load double, double* @beta_distr_inv.last_last_p
%167 = fcmp une double %165, %166
br i1 %167, label %168, label %178
168: ; preds = %164, %160
%169 = load double, double* %8
%170 = load double, double* %8
%171 = fcmp une double %169, %170
br i1 %171, label %172, label %177
172: ; preds = %168
%173 = load double, double* @beta_distr_inv.last_last_p
%174 = load double, double* @beta_distr_inv.last_last_p
%175 = fcmp une double %173, %174
br i1 %175, label %176, label %177
176: ; preds = %172
br i1 true, label %186, label %188
177: ; preds = %172, %168
br i1 false, label %186, label %188
178: ; preds = %164
%179 = load double, double* %8
%180 = load double, double* @beta_distr_inv.last_last_p
%181 = fcmp olt double %179, %180
br i1 %181, label %188, label %182
182: ; preds = %178
%183 = load double, double* @beta_distr_inv.last_last_p
%184 = load double, double* %8
%185 = fcmp olt double %183, %184
br i1 %185, label %188, label %186
186: ; preds = %182, %177, %176
%187 = load double, double* @beta_distr_inv.last_last_x
store double %187, double* %5
br label %245
188: ; preds = %182, %178, %177, %176, %156, %152, %151, %150, %130, %126, %125, %124
%189 = load double, double* %6
%190 = load double, double* %6
%191 = load double, double* %7
%192 = fadd double %190, %191
%193 = fdiv double %189, %192
store double %193, double* %11
br label %194
194: ; preds = %188, %234
%195 = load double, double* %11
%196 = load double, double* %6
%197 = load double, double* %7
%198 = load double, double* %11
%199 = load i8*, i8** %9
%200 = call double @beta_distr(double %196, double %197, double %198, i8* %199)
%201 = load double, double* %8
%202 = fsub double %200, %201
%203 = load double, double* %6
%204 = load double, double* %7
%205 = load double, double* %11
%206 = load i8*, i8** %9
%207 = call double @beta_distr_density(double %203, double %204, double %205, i8* %206)
%208 = fdiv double %202, %207
%209 = fsub double %195, %208
store double %209, double* %10
%210 = load double, double* %10
%211 = load double, double* %11
%212 = fsub double %210, %211
%213 = call double @llvm.fabs.f64(double %212)
%214 = load double, double* %11
%215 = fmul double %214, 1.000000e-10
%216 = fcmp olt double %213, %215
br i1 %216, label %217, label %218
217: ; preds = %194
br label %235
218: ; preds = %194
%219 = load double, double* %10
%220 = fcmp ole double %219, 0.000000e+00
br i1 %220, label %221, label %224
221: ; preds = %218
%222 = load double, double* %11
%223 = fdiv double %222, 2.000000e+00
store double %223, double* %11
br label %234
224: ; preds = %218
%225 = load double, double* %10
%226 = fcmp oge double %225, 1.000000e+00
br i1 %226, label %227, label %231
227: ; preds = %224
%228 = load double, double* %11
%229 = fadd double 1.000000e+00, %228
%230 = fdiv double %229, 2.000000e+00
store double %230, double* %11
br label %233
231: ; preds = %224
%232 = load double, double* %10
store double %232, double* %11
br label %233
233: ; preds = %231, %227
br label %234
234: ; preds = %233, %221
br label %194
235: ; preds = %217
%236 = load double, double* @beta_distr_inv.last_a
store double %236, double* @beta_distr_inv.last_last_a
%237 = load double, double* @beta_distr_inv.last_b
store double %237, double* @beta_distr_inv.last_last_b
%238 = load double, double* @beta_distr_inv.last_p
store double %238, double* @beta_distr_inv.last_last_p
%239 = load double, double* @beta_distr_inv.last_x
store double %239, double* @beta_distr_inv.last_last_x
%240 = load double, double* %6
store double %240, double* @beta_distr_inv.last_a
%241 = load double, double* %7
store double %241, double* @beta_distr_inv.last_b
%242 = load double, double* %8
store double %242, double* @beta_distr_inv.last_p
%243 = load double, double* %11
store double %243, double* @beta_distr_inv.last_x
%244 = load double, double* %11
store double %244, double* %5
br label %245
245: ; preds = %235, %186, %106
%246 = load double, double* %5
ret double %246
}

LLVM IR (-O2):
@beta_distr_inv.last_a = internal unnamed_addr global double -1.000000e+00
@beta_distr_inv.last_b = internal unnamed_addr global double 0.000000e+00
@beta_distr_inv.last_p = internal unnamed_addr global double -1.000000e+00
@beta_distr_inv.last_x = internal unnamed_addr global double -1.000000e+00
@beta_distr_inv.last_last_a = internal unnamed_addr global double -1.000000e+00
@beta_distr_inv.last_last_b = internal unnamed_addr global double -1.000000e+00
@beta_distr_inv.last_last_p = internal unnamed_addr global double -1.000000e+00
@beta_distr_inv.last_last_x = internal unnamed_addr global double -1.000000e+00
@stderr = global i32 0
@.str = [75 x i8] c"%s: IMPLEMENTATION ERROR! (Invalid argument in function \22beta_distr_inv\22)\0A\00"
define double @beta_distr_inv(double %0, double %1, double %2, i8* %3) {
%5 = fcmp ole double %0, 0.000000e+00
%6 = fcmp ole double %1, 0.000000e+00
%7 = or i1 %5, %6
%8 = fcmp ole double %2, 0.000000e+00
%9 = or i1 %7, %8
%10 = fcmp oge double %2, 1.000000e+00
%11 = or i1 %10, %9
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %3)
%15 = tail call i32 @exit(i32 4)
unreachable
16: ; preds = %4
%17 = fcmp uno double %0, 0.000000e+00
%18 = load double, double* @beta_distr_inv.last_a
br i1 %17, label %23, label %19
19: ; preds = %16
%20 = fcmp ord double %18, 0.000000e+00
%21 = fcmp ueq double %18, %0
%22 = and i1 %20, %21
br i1 %22, label %25, label %46
23: ; preds = %16
%24 = fcmp uno double %18, 0.000000e+00
br i1 %24, label %25, label %51
25: ; preds = %19, %23
%26 = fcmp uno double %1, 0.000000e+00
%27 = load double, double* @beta_distr_inv.last_b
br i1 %26, label %32, label %28
28: ; preds = %25
%29 = fcmp ord double %27, 0.000000e+00
%30 = fcmp ueq double %27, %1
%31 = and i1 %29, %30
br i1 %31, label %34, label %45
32: ; preds = %25
%33 = fcmp uno double %27, 0.000000e+00
br i1 %33, label %34, label %45
34: ; preds = %28, %32
%35 = fcmp uno double %2, 0.000000e+00
%36 = load double, double* @beta_distr_inv.last_p
br i1 %35, label %41, label %37
37: ; preds = %34
%38 = fcmp ord double %36, 0.000000e+00
%39 = fcmp ueq double %36, %2
%40 = and i1 %38, %39
br i1 %40, label %43, label %45
41: ; preds = %34
%42 = fcmp uno double %36, 0.000000e+00
br i1 %42, label %43, label %45
43: ; preds = %37, %41
%44 = load double, double* @beta_distr_inv.last_x
br label %104
45: ; preds = %37, %28, %41, %32
br i1 %17, label %51, label %46
46: ; preds = %19, %45
%47 = load double, double* @beta_distr_inv.last_last_a
%48 = fcmp ord double %47, 0.000000e+00
%49 = fcmp ueq double %47, %0
%50 = and i1 %48, %49
br i1 %50, label %54, label %74
51: ; preds = %23, %45
%52 = load double, double* @beta_distr_inv.last_last_a
%53 = fcmp uno double %52, 0.000000e+00
br i1 %53, label %54, label %74
54: ; preds = %46, %51
%55 = fcmp uno double %1, 0.000000e+00
%56 = load double, double* @beta_distr_inv.last_last_b
br i1 %55, label %61, label %57
57: ; preds = %54
%58 = fcmp ord double %56, 0.000000e+00
%59 = fcmp ueq double %56, %1
%60 = and i1 %58, %59
br i1 %60, label %63, label %74
61: ; preds = %54
%62 = fcmp uno double %56, 0.000000e+00
br i1 %62, label %63, label %74
63: ; preds = %57, %61
%64 = fcmp uno double %2, 0.000000e+00
%65 = load double, double* @beta_distr_inv.last_last_p
br i1 %64, label %70, label %66
66: ; preds = %63
%67 = fcmp ord double %65, 0.000000e+00
%68 = fcmp ueq double %65, %2
%69 = and i1 %67, %68
br i1 %69, label %72, label %74
70: ; preds = %63
%71 = fcmp uno double %65, 0.000000e+00
br i1 %71, label %72, label %74
72: ; preds = %66, %70
%73 = load double, double* @beta_distr_inv.last_last_x
br label %104
74: ; preds = %66, %57, %46, %70, %61, %51
%75 = fadd double %0, %1
%76 = fdiv double %0, %75
br label %77
77: ; preds = %94, %74
%78 = phi double [ %76, %74 ], [ %95, %94 ]
%79 = tail call double @beta_distr(double %0, double %1, double %78, i8* %3)
%80 = fsub double %79, %2
%81 = tail call double @beta_distr_density(double %0, double %1, double %78, i8* %3)
%82 = fdiv double %80, %81
%83 = fsub double %78, %82
%84 = fsub double %83, %78
%85 = tail call double @llvm.fabs.f64(double %84)
%86 = fmul double %78, 1.000000e-10
%87 = fcmp olt double %85, %86
br i1 %87, label %99, label %88
88: ; preds = %77
%89 = fcmp ugt double %83, 0.000000e+00
br i1 %89, label %92, label %90
90: ; preds = %88
%91 = fmul double %78, 5.000000e-01
br label %94
92: ; preds = %88
%93 = fcmp ult double %83, 1.000000e+00
br i1 %93, label %94, label %96
94: ; preds = %92, %96, %90
%95 = phi double [ %91, %90 ], [ %98, %96 ], [ %83, %92 ]
br label %77
96: ; preds = %92
%97 = fadd double %78, 1.000000e+00
%98 = fmul double %97, 5.000000e-01
br label %94
99: ; preds = %77
%100 = load double, double* @beta_distr_inv.last_a
store double %100, double* @beta_distr_inv.last_last_a
%101 = load double, double* @beta_distr_inv.last_b
store double %101, double* @beta_distr_inv.last_last_b
%102 = load double, double* @beta_distr_inv.last_p
store double %102, double* @beta_distr_inv.last_last_p
%103 = load double, double* @beta_distr_inv.last_x
store double %103, double* @beta_distr_inv.last_last_x
store double %0, double* @beta_distr_inv.last_a
store double %1, double* @beta_distr_inv.last_b
store double %2, double* @beta_distr_inv.last_p
store double %78, double* @beta_distr_inv.last_x
br label %104
104: ; preds = %99, %72, %43
%105 = phi double [ %44, %43 ], [ %73, %72 ], [ %78, %99 ]
ret double %105
}