#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 IncompleteGamma(double, double, double);
double InverseCDFNormal(double);
double LnGamma(double);
int /*<<< orphan*/ error2(char *);
double exp(double);
double fabs(double);
double log(double);
double pow(double, double);
double sqrt(double);
double InverseCDFChi2(double prob, double v) {
  double e = .5e-6, aa = .6931471805, p = prob, g, small = 1e-6;
  double xx, c, ch, a = 0, q = 0, p1 = 0, p2 = 0, t = 0, x = 0, b = 0, s1, s2,
                    s3, s4, s5, s6;
  if (p < small)
    return (0);
  if (p > 1 - small)
    return (9999);
  if (v <= 0)
    return (-1);
  g = LnGamma(v / 2);
  xx = v / 2;
  c = xx - 1;
  if (v >= -1.24 * log(p))
    goto l1;
  ch = pow((p * xx * exp(g + xx * aa)), 1 / xx);
  if (ch - e < 0)
    return (ch);
  goto l4;
l1:
  if (v > .32)
    goto l3;
  ch = 0.4;
  a = log(1 - p);
l2:
  q = ch;
  p1 = 1 + ch * (4.67 + ch);
  p2 = ch * (6.73 + ch * (6.66 + ch));
  t = -0.5 + (4.67 + 2 * ch) / p1 - (6.73 + ch * (13.32 + 3 * ch)) / p2;
  ch -= (1 - exp(a + g + .5 * ch + c * aa) * p2 / p1) / t;
  if (fabs(q / ch - 1) - .01 <= 0)
    goto l4;
  else
    goto l2;
l3:
  x = InverseCDFNormal(p);
  p1 = 0.222222 / v;
  ch = v * pow((x * sqrt(p1) + 1 - p1), 3.0);
  if (ch > 2.2 * v + 6)
    ch = -2 * (log(1 - p) - c * log(.5 * ch) + g);
l4:
  q = ch;
  p1 = .5 * ch;
  if ((t = IncompleteGamma(p1, xx, g)) < 0)
    error2("\nIncompleteGamma");
  p2 = p - t;
  t = p2 * exp(xx * aa + g + p1 - c * log(ch));
  b = t / ch;
  a = 0.5 * t - b * c;
  s1 = (210 + a * (140 + a * (105 + a * (84 + a * (70 + 60 * a))))) / 420;
  s2 = (420 + a * (735 + a * (966 + a * (1141 + 1278 * a)))) / 2520;
  s3 = (210 + a * (462 + a * (707 + 932 * a))) / 2520;
  s4 = (252 + a * (672 + 1182 * a) + c * (294 + a * (889 + 1740 * a))) / 5040;
  s5 = (84 + 264 * a + c * (175 + 606 * a)) / 2520;
  s6 = (120 + c * (346 + 127 * c)) / 5040;
  ch += t * (1 + 0.5 * t * s1 -
             b * c * (s1 - b * (s2 - b * (s3 - b * (s4 - b * (s5 - b * s6))))));
  if (fabs(q / ch - 1) > e)
    goto l4;
  return (ch);
}


x86 assembly (clang, -O0):
<InverseCDFChi2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xe73(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe5e(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe3f(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x30(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1225 <InverseCDFChi2+0xa5>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bb9 <InverseCDFChi2+0xa39>
movsd  -0x30(%rbp),%xmm0
movsd  0xde6(%rip),%xmm1
subsd  -0x40(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1253 <InverseCDFChi2+0xd3>
movsd  0xf3f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bb9 <InverseCDFChi2+0xa39>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1273 <InverseCDFChi2+0xf3>
movsd  0xf17(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bb9 <InverseCDFChi2+0xa39>
movsd  -0x18(%rbp),%xmm0
movsd  0xda8(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10a0 <LnGamma@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xd8d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xd67(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm2
movsd  -0xc8(%rbp),%xmm0
ff
movsd  0xd3c(%rip),%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     12f7 <InverseCDFChi2+0x177>
jmp    1376 <InverseCDFChi2+0x1f6>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x38(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  0xcdc(%rip),%xmm1
divsd  -0x48(%rbp),%xmm1
call   1080 <pow@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1371 <InverseCDFChi2+0x1f1>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bb9 <InverseCDFChi2+0xa39>
jmp    165e <InverseCDFChi2+0x4de>
movsd  -0x18(%rbp),%xmm0
movsd  0xcad(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1392 <InverseCDFChi2+0x212>
jmp    1520 <InverseCDFChi2+0x3a0>
movsd  0xc9e(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xc71(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xca3(%rip),%xmm1
addsd  -0x58(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc3a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xc7f(%rip),%xmm2
addsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc46(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xc48(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  -0x70(%rbp),%xmm1
movsd  0xc2f(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  0xc09(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xc05(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xbe5(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  -0x78(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xbb4(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <exp@plt>
mulsd  -0x78(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  0xb53(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  -0x80(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x68(%rbp),%xmm1
divsd  -0x58(%rbp),%xmm1
movsd  0xb2a(%rip),%xmm0
subsd  %xmm0,%xmm1
movaps 0xc97(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xb3b(%rip),%xmm0
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     151b <InverseCDFChi2+0x39b>
jmp    165e <InverseCDFChi2+0x4de>
jmp    13b6 <InverseCDFChi2+0x236>
movsd  -0x30(%rbp),%xmm0
call   1030 <InverseCDFNormal@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xb56(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  0xa96(%rip),%xmm1
addsd  %xmm1,%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  0xac5(%rip),%xmm1
call   1080 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xac2(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xabe(%rip),%xmm2
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1659 <InverseCDFChi2+0x4d9>
movsd  0xa38(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  0xa41(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
call   1070 <log@plt>
movsd  -0xf0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xe8(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
addsd  -0x38(%rbp),%xmm1
movsd  0xa48(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    165e <InverseCDFChi2+0x4de>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0x9d8(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
call   1040 <IncompleteGamma@plt>
movaps %xmm0,%xmm1
movsd  %xmm1,-0x80(%rbp)
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    16af <InverseCDFChi2+0x52f>
lea    0xaf6(%rip),%rdi
call   1050 <error2@plt>
movsd  -0x30(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1070 <log@plt>
movsd  -0x108(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x100(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm1
ff
mulsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0x8b4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm4
movsd  0x9ae(%rip),%xmm5
mulsd  %xmm5,%xmm4
movsd  0x9aa(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0x902(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0x97a(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x962(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x90a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x91e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  0x90e(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0x90a(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0x8ea(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x8d2(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x8ba(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x836(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  0x87b(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0x877(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x857(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x83f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x7db(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  0x805(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x801(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0x7e1(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  0x7b6(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0x7b2(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0x792(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x736(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
movsd  0x755(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0x751(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  0x723(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0x71f(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x6fb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0x6cd(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x6c9(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x6a9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x695(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  0x624(%rip),%xmm1
mulsd  -0x80(%rbp),%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0x5db(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x90(%rbp),%xmm2
ff
mulsd  -0x50(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm4
ff
movsd  -0x90(%rbp),%xmm3
ff
movsd  -0xa0(%rbp),%xmm6
ff
movsd  -0x90(%rbp),%xmm5
ff
movsd  -0xa8(%rbp),%xmm8
ff ff
movsd  -0x90(%rbp),%xmm7
ff
movsd  -0xb0(%rbp),%xmm10
ff ff
movsd  -0x90(%rbp),%xmm9
ff ff
movsd  -0xb8(%rbp),%xmm12
ff ff
movsd  -0x90(%rbp),%xmm11
ff ff
movsd  -0xc0(%rbp),%xmm13
ff ff
movq   %xmm11,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm11
mulsd  %xmm13,%xmm11
addsd  %xmm12,%xmm11
movq   %xmm9,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm9
mulsd  %xmm11,%xmm9
addsd  %xmm10,%xmm9
movq   %xmm7,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm7
mulsd  %xmm9,%xmm7
addsd  %xmm8,%xmm7
movq   %xmm5,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm5
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x68(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  0x488(%rip),%xmm1
subsd  %xmm1,%xmm0
movaps 0x5f5(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1baf <InverseCDFChi2+0xa2f>
jmp    165e <InverseCDFChi2+0x4de>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InverseCDFChi2>:
push   %rbx
sub    $0xa0,%rsp
xorpd  %xmm7,%xmm7
movsd  0xe6c(%rip),%xmm2
movsd  %xmm0,0x8(%rsp)
ucomisd %xmm0,%xmm2
ja     1292 <InverseCDFChi2+0x112>
movsd  0x8(%rsp),%xmm2
ucomisd 0xe5e(%rip),%xmm2
jbe    11c1 <InverseCDFChi2+0x41>
movsd  0xe4c(%rip),%xmm7
jmp    1292 <InverseCDFChi2+0x112>
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    128a <InverseCDFChi2+0x10a>
movsd  0xe49(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  %xmm1,0x10(%rsp)
call   10a0 <LnGamma@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0xe1e(%rip),%xmm0
addsd  0x28(%rsp),%xmm0
movapd %xmm0,0x50(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <log@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0xe09(%rip),%xmm0
ucomisd %xmm0,%xmm1
jae    129f <InverseCDFChi2+0x11f>
movsd  0x28(%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xe35(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x20(%rsp),%xmm0
call   1060 <exp@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0xdd8(%rip),%xmm1
divsd  0x28(%rsp),%xmm1
call   1080 <pow@plt>
movapd %xmm0,%xmm2
addsd  0xe31(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
movapd %xmm2,%xmm7
ja     1292 <InverseCDFChi2+0x112>
jmp    1537 <InverseCDFChi2+0x3b7>
movsd  0xd86(%rip),%xmm7
movapd %xmm7,%xmm0
add    $0xa0,%rsp
pop    %rbx
ret
ucomisd 0xd89(%rip),%xmm1
jbe    12e0 <InverseCDFChi2+0x160>
movsd  0x8(%rsp),%xmm0
call   1030 <InverseCDFNormal@plt>
movapd %xmm0,%xmm2
movsd  0xdc8(%rip),%xmm1
divsd  0x10(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1481 <InverseCDFChi2+0x301>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    14a2 <InverseCDFChi2+0x322>
movsd  0xd50(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
call   1070 <log@plt>
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x98(%rsp)
movsd  0xd36(%rip),%xmm0
movsd  0xd66(%rip),%xmm1
mulsd  0x50(%rsp),%xmm1
movsd  %xmm1,0x90(%rsp)
movapd %xmm0,%xmm2
cs nopw 0x0(%rax,%rax,1)
nop
movapd %xmm2,0x30(%rsp)
movapd %xmm0,%xmm3
addsd  0xd06(%rip),%xmm0
movapd 0xe56(%rip),%xmm1
unpcklpd %xmm0,%xmm1
movapd %xmm3,%xmm4
addsd  0xcf6(%rip),%xmm4
mulsd  %xmm3,%xmm4
movsd  0xcf2(%rip),%xmm2
addsd  %xmm2,%xmm4
mulsd  %xmm3,%xmm4
movapd %xmm4,0x10(%rsp)
movapd %xmm3,%xmm4
unpcklpd %xmm3,%xmm4
mulpd  %xmm1,%xmm4
addpd  0xe28(%rip),%xmm4
movapd %xmm4,0x40(%rsp)
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
movapd %xmm4,%xmm1
divsd  %xmm0,%xmm1
addsd  0xcba(%rip),%xmm1
movapd 0xe12(%rip),%xmm0
unpcklpd %xmm1,%xmm0
movapd %xmm0,0x80(%rsp)
movapd %xmm3,%xmm0
movapd %xmm3,0x70(%rsp)
movapd %xmm3,%xmm1
mulsd  0xc97(%rip),%xmm1
addsd  0xc97(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm1,0x60(%rsp)
mulsd  0xc31(%rip),%xmm0
addsd  0x98(%rsp),%xmm0
addsd  0x90(%rsp),%xmm0
call   1060 <exp@plt>
movapd 0x30(%rsp),%xmm2
movapd 0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
unpcklpd 0x60(%rsp),%xmm0
movapd 0x40(%rsp),%xmm3
shufpd $0x1,%xmm1,%xmm3
divpd  %xmm3,%xmm0
movapd 0x80(%rsp),%xmm1
subpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
divsd  %xmm0,%xmm1
subsd  %xmm1,%xmm2
movapd 0x70(%rsp),%xmm1
divsd  %xmm2,%xmm1
addsd  0xbbe(%rip),%xmm1
andpd  0xd6e(%rip),%xmm1
addsd  0xc16(%rip),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
movapd %xmm2,%xmm0
jb     1330 <InverseCDFChi2+0x1b0>
jmp    1537 <InverseCDFChi2+0x3b7>
movapd %xmm1,%xmm0
movsd  %xmm2,0x30(%rsp)
movsd  %xmm1,0x40(%rsp)
call   1090 <sqrt@plt>
movsd  0x40(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xb8a(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  0xbae(%rip),%xmm1
movapd %xmm2,%xmm0
call   1080 <pow@plt>
movapd %xmm0,%xmm2
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm2
mulsd  0xbb7(%rip),%xmm0
addsd  0xbb7(%rip),%xmm0
ucomisd %xmm0,%xmm2
jbe    1537 <InverseCDFChi2+0x3b7>
movsd  0xb49(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
movapd %xmm2,0x30(%rsp)
call   1070 <log@plt>
movsd  %xmm0,0x10(%rsp)
movapd 0x30(%rsp),%xmm0
mulsd  0xb0c(%rip),%xmm0
call   1070 <log@plt>
mulsd  0x50(%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
subsd  %xmm0,%xmm2
addsd  0x20(%rsp),%xmm2
mulsd  0xb69(%rip),%xmm2
movsd  0xb39(%rip),%xmm0
mulsd  0x28(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
movsd  0xb54(%rip),%xmm1
movapd 0x50(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  0xb4a(%rip),%xmm1
movapd 0xc6a(%rip),%xmm3
mulsd  %xmm0,%xmm1
addsd  0xb3e(%rip),%xmm1
xorpd  %xmm0,%xmm3
movapd %xmm3,0x60(%rsp)
divsd  0xb34(%rip),%xmm1
movsd  %xmm1,0x70(%rsp)
movsd  0xa7e(%rip),%xmm0
lea    0xc47(%rip),%rbx
jmp    180c <InverseCDFChi2+0x68c>
xchg   %ax,%ax
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0x80(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movapd 0x30(%rsp),%xmm0
call   1070 <log@plt>
mulsd  0x60(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
call   1060 <exp@plt>
mulsd  0x40(%rsp),%xmm0
movapd %xmm0,%xmm14
xorpd  0xbdb(%rip),%xmm14
movapd 0x30(%rsp),%xmm13
divsd  %xmm13,%xmm14
movapd 0x50(%rsp),%xmm10
movapd %xmm10,%xmm8
mulsd  %xmm14,%xmm8
movapd %xmm0,%xmm9
movsd  0x9f0(%rip),%xmm12
mulsd  %xmm12,%xmm9
movapd %xmm9,%xmm6
addsd  %xmm8,%xmm6
movapd %xmm6,%xmm5
mulsd  0xa85(%rip),%xmm5
addsd  0xa85(%rip),%xmm5
mulsd  %xmm6,%xmm5
movsd  0xa80(%rip),%xmm11
addsd  %xmm11,%xmm5
mulsd  %xmm6,%xmm5
addsd  0xa77(%rip),%xmm5
mulsd  %xmm6,%xmm5
addsd  0xa73(%rip),%xmm5
mulsd  %xmm6,%xmm5
movapd %xmm6,%xmm2
mulsd  0xa7b(%rip),%xmm2
addsd  0xa7b(%rip),%xmm2
mulsd  %xmm6,%xmm2
addsd  0xa77(%rip),%xmm2
mulsd  %xmm6,%xmm2
addsd  0xa73(%rip),%xmm2
mulsd  %xmm6,%xmm2
movapd %xmm6,%xmm3
mulsd  0xa73(%rip),%xmm3
addsd  0xa73(%rip),%xmm3
mulsd  %xmm6,%xmm3
addsd  0xa6f(%rip),%xmm3
mulsd  %xmm6,%xmm3
movapd %xmm6,%xmm1
mulsd  0xa67(%rip),%xmm1
addsd  0xa67(%rip),%xmm1
mulsd  %xmm6,%xmm1
addsd  0xa63(%rip),%xmm1
movapd %xmm6,%xmm4
mulsd  0xa5f(%rip),%xmm4
addsd  0xa5f(%rip),%xmm4
mulsd  %xmm6,%xmm4
addsd  0xa5b(%rip),%xmm4
mulsd  %xmm10,%xmm4
addsd  %xmm1,%xmm4
movapd %xmm6,%xmm1
mulsd  0xa4e(%rip),%xmm1
addsd  %xmm11,%xmm1
mulsd  0xa49(%rip),%xmm6
addsd  0xa49(%rip),%xmm6
mulsd  %xmm10,%xmm6
addsd  %xmm1,%xmm6
movsd  0x9d7(%rip),%xmm10
divsd  %xmm10,%xmm6
movapd %xmm14,%xmm7
mulsd  0x70(%rsp),%xmm7
addsd  %xmm6,%xmm7
divsd  0x95b(%rip),%xmm4
mulsd  %xmm14,%xmm7
addsd  %xmm4,%xmm7
movsd  0x97a(%rip),%xmm4
addsd  %xmm4,%xmm3
divsd  %xmm10,%xmm3
mulsd  %xmm14,%xmm7
addsd  %xmm3,%xmm7
movsd  0x968(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm10,%xmm2
mulsd  %xmm14,%xmm7
addsd  %xmm2,%xmm7
mulsd  %xmm14,%xmm7
addsd  %xmm4,%xmm5
divsd  %xmm3,%xmm5
mulsd  %xmm5,%xmm9
addsd  %xmm5,%xmm7
mulsd  %xmm8,%xmm7
addsd  0x86a(%rip),%xmm9
addsd  %xmm9,%xmm7
mulsd  %xmm0,%xmm7
movapd %xmm13,%xmm0
addsd  %xmm13,%xmm7
divsd  %xmm7,%xmm0
addsd  0x82b(%rip),%xmm0
andpd  0x9db(%rip),%xmm0
ucomisd 0x993(%rip),%xmm0
movapd %xmm7,%xmm2
movapd %xmm12,%xmm0
jbe    1292 <InverseCDFChi2+0x112>
movapd %xmm2,0x30(%rsp)
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
call   1040 <IncompleteGamma@plt>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    15b0 <InverseCDFChi2+0x430>
mov    %rbx,%rdi
movsd  %xmm1,0x40(%rsp)
call   1050 <error2@plt>
movsd  0x40(%rsp),%xmm1
jmp    15b0 <InverseCDFChi2+0x430>

LLVM IR (-O0):
@.str = [17 x i8] c"\0AIncompleteGamma\00"
define double @InverseCDFChi2(double %0, double %1) {
%3 = alloca double
%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 double
%15 = alloca double
%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
store double %0, double* %4
store double %1, double* %5
store double 5.000000e-07, double* %6
store double 0x3FE62E42FEF1FCCC, double* %7
%27 = load double, double* %4
store double %27, double* %8
store double 0x3EB0C6F7A0B5ED8D, double* %10
store double 0.000000e+00, double* %14
store double 0.000000e+00, double* %15
store double 0.000000e+00, double* %16
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %18
store double 0.000000e+00, double* %19
store double 0.000000e+00, double* %20
%28 = load double, double* %8
%29 = load double, double* %10
%30 = fcmp olt double %28, %29
br i1 %30, label %31, label %32
31: ; preds = %2
store double 0.000000e+00, double* %3
br label %298
32: ; preds = %2
%33 = load double, double* %8
%34 = load double, double* %10
%35 = fsub double 1.000000e+00, %34
%36 = fcmp ogt double %33, %35
br i1 %36, label %37, label %38
37: ; preds = %32
store double 9.999000e+03, double* %3
br label %298
38: ; preds = %32
%39 = load double, double* %5
%40 = fcmp ole double %39, 0.000000e+00
br i1 %40, label %41, label %42
41: ; preds = %38
store double -1.000000e+00, double* %3
br label %298
42: ; preds = %38
%43 = load double, double* %5
%44 = fdiv double %43, 2.000000e+00
%45 = call double @LnGamma(double %44)
store double %45, double* %9
%46 = load double, double* %5
%47 = fdiv double %46, 2.000000e+00
store double %47, double* %11
%48 = load double, double* %11
%49 = fsub double %48, 1.000000e+00
store double %49, double* %12
%50 = load double, double* %5
%51 = load double, double* %8
%52 = call double @log(double %51)
%53 = fmul double -1.240000e+00, %52
%54 = fcmp oge double %50, %53
br i1 %54, label %55, label %56
55: ; preds = %42
br label %76
56: ; preds = %42
%57 = load double, double* %8
%58 = load double, double* %11
%59 = fmul double %57, %58
%60 = load double, double* %9
%61 = load double, double* %11
%62 = load double, double* %7
%63 = call double @llvm.fmuladd.f64(double %61, double %62, double %60)
%64 = call double @exp(double %63)
%65 = fmul double %59, %64
%66 = load double, double* %11
%67 = fdiv double 1.000000e+00, %66
%68 = call double @pow(double %65, double %67)
store double %68, double* %13
%69 = load double, double* %13
%70 = load double, double* %6
%71 = fsub double %69, %70
%72 = fcmp olt double %71, 0.000000e+00
br i1 %72, label %73, label %75
73: ; preds = %56
%74 = load double, double* %13
store double %74, double* %3
br label %298
75: ; preds = %56
br label %167
76: ; preds = %55
%77 = load double, double* %5
%78 = fcmp ogt double %77, 3.200000e-01
br i1 %78, label %79, label %80
79: ; preds = %76
br label %135
80: ; preds = %76
store double 4.000000e-01, double* %13
%81 = load double, double* %8
%82 = fsub double 1.000000e+00, %81
%83 = call double @log(double %82)
store double %83, double* %14
br label %84
84: ; preds = %134, %80
%85 = load double, double* %13
store double %85, double* %15
%86 = load double, double* %13
%87 = load double, double* %13
%88 = fadd double 4.670000e+00, %87
%89 = call double @llvm.fmuladd.f64(double %86, double %88, double 1.000000e+00)
store double %89, double* %16
%90 = load double, double* %13
%91 = load double, double* %13
%92 = load double, double* %13
%93 = fadd double 6.660000e+00, %92
%94 = call double @llvm.fmuladd.f64(double %91, double %93, double 6.730000e+00)
%95 = fmul double %90, %94
store double %95, double* %17
%96 = load double, double* %13
%97 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %96, double 4.670000e+00)
%98 = load double, double* %16
%99 = fdiv double %97, %98
%100 = fadd double -5.000000e-01, %99
%101 = load double, double* %13
%102 = load double, double* %13
%103 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %102, double 1.332000e+01)
%104 = call double @llvm.fmuladd.f64(double %101, double %103, double 6.730000e+00)
%105 = load double, double* %17
%106 = fdiv double %104, %105
%107 = fsub double %100, %106
store double %107, double* %18
%108 = load double, double* %14
%109 = load double, double* %9
%110 = fadd double %108, %109
%111 = load double, double* %13
%112 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %111, double %110)
%113 = load double, double* %12
%114 = load double, double* %7
%115 = call double @llvm.fmuladd.f64(double %113, double %114, double %112)
%116 = call double @exp(double %115)
%117 = load double, double* %17
%118 = fmul double %116, %117
%119 = load double, double* %16
%120 = fdiv double %118, %119
%121 = fsub double 1.000000e+00, %120
%122 = load double, double* %18
%123 = fdiv double %121, %122
%124 = load double, double* %13
%125 = fsub double %124, %123
store double %125, double* %13
%126 = load double, double* %15
%127 = load double, double* %13
%128 = fdiv double %126, %127
%129 = fsub double %128, 1.000000e+00
%130 = call double @llvm.fabs.f64(double %129)
%131 = fsub double %130, 1.000000e-02
%132 = fcmp ole double %131, 0.000000e+00
br i1 %132, label %133, label %134
133: ; preds = %84
br label %167
134: ; preds = %84
br label %84
135: ; preds = %79
%136 = load double, double* %8
%137 = call double @InverseCDFNormal(double %136)
store double %137, double* %19
%138 = load double, double* %5
%139 = fdiv double 2.222220e-01, %138
store double %139, double* %16
%140 = load double, double* %5
%141 = load double, double* %19
%142 = load double, double* %16
%143 = call double @sqrt(double %142)
%144 = call double @llvm.fmuladd.f64(double %141, double %143, double 1.000000e+00)
%145 = load double, double* %16
%146 = fsub double %144, %145
%147 = call double @pow(double %146, double 3.000000e+00)
%148 = fmul double %140, %147
store double %148, double* %13
%149 = load double, double* %13
%150 = load double, double* %5
%151 = call double @llvm.fmuladd.f64(double 2.200000e+00, double %150, double 6.000000e+00)
%152 = fcmp ogt double %149, %151
br i1 %152, label %153, label %166
153: ; preds = %135
%154 = load double, double* %8
%155 = fsub double 1.000000e+00, %154
%156 = call double @log(double %155)
%157 = load double, double* %12
%158 = load double, double* %13
%159 = fmul double 5.000000e-01, %158
%160 = call double @log(double %159)
%161 = fneg double %157
%162 = call double @llvm.fmuladd.f64(double %161, double %160, double %156)
%163 = load double, double* %9
%164 = fadd double %162, %163
%165 = fmul double -2.000000e+00, %164
store double %165, double* %13
br label %166
166: ; preds = %153, %135
br label %167
167: ; preds = %295, %166, %133, %75
%168 = load double, double* %13
store double %168, double* %15
%169 = load double, double* %13
%170 = fmul double 5.000000e-01, %169
store double %170, double* %16
%171 = load double, double* %16
%172 = load double, double* %11
%173 = load double, double* %9
%174 = call double @IncompleteGamma(double %171, double %172, double %173)
store double %174, double* %18
%175 = fcmp olt double %174, 0.000000e+00
br i1 %175, label %176, label %178
176: ; preds = %167
%177 = call i32 @error2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %178
178: ; preds = %176, %167
%179 = load double, double* %8
%180 = load double, double* %18
%181 = fsub double %179, %180
store double %181, double* %17
%182 = load double, double* %17
%183 = load double, double* %11
%184 = load double, double* %7
%185 = load double, double* %9
%186 = call double @llvm.fmuladd.f64(double %183, double %184, double %185)
%187 = load double, double* %16
%188 = fadd double %186, %187
%189 = load double, double* %12
%190 = load double, double* %13
%191 = call double @log(double %190)
%192 = fneg double %189
%193 = call double @llvm.fmuladd.f64(double %192, double %191, double %188)
%194 = call double @exp(double %193)
%195 = fmul double %182, %194
store double %195, double* %18
%196 = load double, double* %18
%197 = load double, double* %13
%198 = fdiv double %196, %197
store double %198, double* %20
%199 = load double, double* %18
%200 = load double, double* %20
%201 = load double, double* %12
%202 = fmul double %200, %201
%203 = fneg double %202
%204 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %199, double %203)
store double %204, double* %14
%205 = load double, double* %14
%206 = load double, double* %14
%207 = load double, double* %14
%208 = load double, double* %14
%209 = load double, double* %14
%210 = call double @llvm.fmuladd.f64(double 6.000000e+01, double %209, double 7.000000e+01)
%211 = call double @llvm.fmuladd.f64(double %208, double %210, double 8.400000e+01)
%212 = call double @llvm.fmuladd.f64(double %207, double %211, double 1.050000e+02)
%213 = call double @llvm.fmuladd.f64(double %206, double %212, double 1.400000e+02)
%214 = call double @llvm.fmuladd.f64(double %205, double %213, double 2.100000e+02)
%215 = fdiv double %214, 4.200000e+02
store double %215, double* %21
%216 = load double, double* %14
%217 = load double, double* %14
%218 = load double, double* %14
%219 = load double, double* %14
%220 = call double @llvm.fmuladd.f64(double 1.278000e+03, double %219, double 1.141000e+03)
%221 = call double @llvm.fmuladd.f64(double %218, double %220, double 9.660000e+02)
%222 = call double @llvm.fmuladd.f64(double %217, double %221, double 7.350000e+02)
%223 = call double @llvm.fmuladd.f64(double %216, double %222, double 4.200000e+02)
%224 = fdiv double %223, 2.520000e+03
store double %224, double* %22
%225 = load double, double* %14
%226 = load double, double* %14
%227 = load double, double* %14
%228 = call double @llvm.fmuladd.f64(double 9.320000e+02, double %227, double 7.070000e+02)
%229 = call double @llvm.fmuladd.f64(double %226, double %228, double 4.620000e+02)
%230 = call double @llvm.fmuladd.f64(double %225, double %229, double 2.100000e+02)
%231 = fdiv double %230, 2.520000e+03
store double %231, double* %23
%232 = load double, double* %14
%233 = load double, double* %14
%234 = call double @llvm.fmuladd.f64(double 1.182000e+03, double %233, double 6.720000e+02)
%235 = call double @llvm.fmuladd.f64(double %232, double %234, double 2.520000e+02)
%236 = load double, double* %12
%237 = load double, double* %14
%238 = load double, double* %14
%239 = call double @llvm.fmuladd.f64(double 1.740000e+03, double %238, double 8.890000e+02)
%240 = call double @llvm.fmuladd.f64(double %237, double %239, double 2.940000e+02)
%241 = call double @llvm.fmuladd.f64(double %236, double %240, double %235)
%242 = fdiv double %241, 5.040000e+03
store double %242, double* %24
%243 = load double, double* %14
%244 = call double @llvm.fmuladd.f64(double 2.640000e+02, double %243, double 8.400000e+01)
%245 = load double, double* %12
%246 = load double, double* %14
%247 = call double @llvm.fmuladd.f64(double 6.060000e+02, double %246, double 1.750000e+02)
%248 = call double @llvm.fmuladd.f64(double %245, double %247, double %244)
%249 = fdiv double %248, 2.520000e+03
store double %249, double* %25
%250 = load double, double* %12
%251 = load double, double* %12
%252 = call double @llvm.fmuladd.f64(double 1.270000e+02, double %251, double 3.460000e+02)
%253 = call double @llvm.fmuladd.f64(double %250, double %252, double 1.200000e+02)
%254 = fdiv double %253, 5.040000e+03
store double %254, double* %26
%255 = load double, double* %18
%256 = load double, double* %18
%257 = fmul double 5.000000e-01, %256
%258 = load double, double* %21
%259 = call double @llvm.fmuladd.f64(double %257, double %258, double 1.000000e+00)
%260 = load double, double* %20
%261 = load double, double* %12
%262 = fmul double %260, %261
%263 = load double, double* %21
%264 = load double, double* %20
%265 = load double, double* %22
%266 = load double, double* %20
%267 = load double, double* %23
%268 = load double, double* %20
%269 = load double, double* %24
%270 = load double, double* %20
%271 = load double, double* %25
%272 = load double, double* %20
%273 = load double, double* %26
%274 = fneg double %272
%275 = call double @llvm.fmuladd.f64(double %274, double %273, double %271)
%276 = fneg double %270
%277 = call double @llvm.fmuladd.f64(double %276, double %275, double %269)
%278 = fneg double %268
%279 = call double @llvm.fmuladd.f64(double %278, double %277, double %267)
%280 = fneg double %266
%281 = call double @llvm.fmuladd.f64(double %280, double %279, double %265)
%282 = fneg double %264
%283 = call double @llvm.fmuladd.f64(double %282, double %281, double %263)
%284 = fneg double %262
%285 = call double @llvm.fmuladd.f64(double %284, double %283, double %259)
%286 = load double, double* %13
%287 = call double @llvm.fmuladd.f64(double %255, double %285, double %286)
store double %287, double* %13
%288 = load double, double* %15
%289 = load double, double* %13
%290 = fdiv double %288, %289
%291 = fsub double %290, 1.000000e+00
%292 = call double @llvm.fabs.f64(double %291)
%293 = load double, double* %6
%294 = fcmp ogt double %292, %293
br i1 %294, label %295, label %296
295: ; preds = %178
br label %167
296: ; preds = %178
%297 = load double, double* %13
store double %297, double* %3
br label %298
298: ; preds = %296, %73, %41, %37, %31
%299 = load double, double* %3
ret double %299
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0AIncompleteGamma\00"
define double @InverseCDFChi2(double %0, double %1) {
%3 = fcmp olt double %0, 0x3EB0C6F7A0B5ED8D
br i1 %3, label %148, label %4
4: ; preds = %2
%5 = fcmp ogt double %0, 0x3FEFFFFDE7210BE9
br i1 %5, label %148, label %6
6: ; preds = %4
%7 = fcmp ugt double %1, 0.000000e+00
br i1 %7, label %8, label %148
8: ; preds = %6
%9 = fmul double %1, 5.000000e-01
%10 = tail call double @LnGamma(double %9)
%11 = fadd double %9, -1.000000e+00
%12 = tail call double @log(double %0)
%13 = fmul double %12, -1.240000e+00
%14 = fcmp ugt double %13, %1
br i1 %14, label %15, label %24
15: ; preds = %8
%16 = fmul double %9, %0
%17 = tail call double @llvm.fmuladd.f64(double %9, double 0x3FE62E42FEF1FCCC, double %10)
%18 = tail call double @exp(double %17)
%19 = fmul double %16, %18
%20 = fdiv double 1.000000e+00, %9
%21 = tail call double @pow(double %19, double %20)
%22 = fadd double %21, -5.000000e-07
%23 = fcmp olt double %22, 0.000000e+00
br i1 %23, label %148, label %85
24: ; preds = %8
%25 = fcmp ogt double %1, 3.200000e-01
br i1 %25, label %66, label %26
26: ; preds = %24
%27 = fsub double 1.000000e+00, %0
%28 = tail call double @log(double %27)
%29 = fadd double %10, %28
br label %30
30: ; preds = %30, %26
%31 = phi double [ 4.000000e-01, %26 ], [ %60, %30 ]
%32 = fadd double %31, 4.670000e+00
%33 = fadd double %31, 6.660000e+00
%34 = tail call double @llvm.fmuladd.f64(double %31, double %33, double 6.730000e+00)
%35 = fmul double %31, %34
%36 = insertelement <2 x double> poison, double %31, i64 0
%37 = shufflevector <2 x double> %36, <2 x double> poison, <2 x i32> zeroinitializer
%38 = insertelement <2 x double> <double 2.000000e+00, double poison>, double %32, i64 1
%39 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %37, <2 x double> %38, <2 x double> <double 4.670000e+00, double 1.000000e+00>)
%40 = extractelement <2 x double> %39, i64 0
%41 = extractelement <2 x double> %39, i64 1
%42 = fdiv double %40, %41
%43 = fadd double %42, -5.000000e-01
%44 = tail call double @llvm.fmuladd.f64(double %31, double 3.000000e+00, double 1.332000e+01)
%45 = tail call double @llvm.fmuladd.f64(double %31, double %44, double 6.730000e+00)
%46 = tail call double @llvm.fmuladd.f64(double %31, double 5.000000e-01, double %29)
%47 = tail call double @llvm.fmuladd.f64(double %11, double 0x3FE62E42FEF1FCCC, double %46)
%48 = tail call double @exp(double %47)
%49 = fmul double %48, %35
%50 = insertelement <2 x double> poison, double %49, i64 0
%51 = insertelement <2 x double> %50, double %45, i64 1
%52 = insertelement <2 x double> poison, double %41, i64 0
%53 = insertelement <2 x double> %52, double %35, i64 1
%54 = fdiv <2 x double> %51, %53
%55 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %43, i64 1
%56 = fsub <2 x double> %55, %54
%57 = extractelement <2 x double> %56, i64 0
%58 = extractelement <2 x double> %56, i64 1
%59 = fdiv double %57, %58
%60 = fsub double %31, %59
%61 = fdiv double %31, %60
%62 = fadd double %61, -1.000000e+00
%63 = tail call double @llvm.fabs.f64(double %62)
%64 = fadd double %63, -1.000000e-02
%65 = fcmp ugt double %64, 0.000000e+00
br i1 %65, label %30, label %85
66: ; preds = %24
%67 = tail call double @InverseCDFNormal(double %0)
%68 = fdiv double 2.222220e-01, %1
%69 = tail call double @sqrt(double %68)
%70 = tail call double @llvm.fmuladd.f64(double %67, double %69, double 1.000000e+00)
%71 = fsub double %70, %68
%72 = tail call double @pow(double %71, double 3.000000e+00)
%73 = fmul double %72, %1
%74 = tail call double @llvm.fmuladd.f64(double %1, double 2.200000e+00, double 6.000000e+00)
%75 = fcmp ogt double %73, %74
br i1 %75, label %76, label %85
76: ; preds = %66
%77 = fsub double 1.000000e+00, %0
%78 = tail call double @log(double %77)
%79 = fmul double %73, 5.000000e-01
%80 = tail call double @log(double %79)
%81 = fneg double %11
%82 = tail call double @llvm.fmuladd.f64(double %81, double %80, double %78)
%83 = fadd double %10, %82
%84 = fmul double %83, -2.000000e+00
br label %85
85: ; preds = %30, %66, %76, %15
%86 = phi double [ %21, %15 ], [ %84, %76 ], [ %73, %66 ], [ %60, %30 ]
%87 = tail call double @llvm.fmuladd.f64(double %9, double 0x3FE62E42FEF1FCCC, double %10)
%88 = fneg double %11
%89 = tail call double @llvm.fmuladd.f64(double %11, double 1.270000e+02, double 3.460000e+02)
%90 = tail call double @llvm.fmuladd.f64(double %11, double %89, double 1.200000e+02)
%91 = fdiv double %90, 5.040000e+03
br label %92
92: ; preds = %85, %99
%93 = phi double [ %143, %99 ], [ %86, %85 ]
%94 = fmul double %93, 5.000000e-01
%95 = tail call double @IncompleteGamma(double %94, double %9, double %10)
%96 = fcmp olt double %95, 0.000000e+00
br i1 %96, label %97, label %99
97: ; preds = %92
%98 = tail call i32 @error2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %99
99: ; preds = %97, %92
%100 = fsub double %0, %95
%101 = fadd double %87, %94
%102 = tail call double @log(double %93)
%103 = tail call double @llvm.fmuladd.f64(double %88, double %102, double %101)
%104 = tail call double @exp(double %103)
%105 = fmul double %100, %104
%106 = fneg double %105
%107 = fdiv double %106, %93
%108 = fmul double %11, %107
%109 = tail call double @llvm.fmuladd.f64(double %105, double 5.000000e-01, double %108)
%110 = tail call double @llvm.fmuladd.f64(double %109, double 6.000000e+01, double 7.000000e+01)
%111 = tail call double @llvm.fmuladd.f64(double %109, double %110, double 8.400000e+01)
%112 = tail call double @llvm.fmuladd.f64(double %109, double %111, double 1.050000e+02)
%113 = tail call double @llvm.fmuladd.f64(double %109, double %112, double 1.400000e+02)
%114 = tail call double @llvm.fmuladd.f64(double %109, double %113, double 2.100000e+02)
%115 = fdiv double %114, 4.200000e+02
%116 = tail call double @llvm.fmuladd.f64(double %109, double 1.278000e+03, double 1.141000e+03)
%117 = tail call double @llvm.fmuladd.f64(double %109, double %116, double 9.660000e+02)
%118 = tail call double @llvm.fmuladd.f64(double %109, double %117, double 7.350000e+02)
%119 = tail call double @llvm.fmuladd.f64(double %109, double %118, double 4.200000e+02)
%120 = fdiv double %119, 2.520000e+03
%121 = tail call double @llvm.fmuladd.f64(double %109, double 9.320000e+02, double 7.070000e+02)
%122 = tail call double @llvm.fmuladd.f64(double %109, double %121, double 4.620000e+02)
%123 = tail call double @llvm.fmuladd.f64(double %109, double %122, double 2.100000e+02)
%124 = fdiv double %123, 2.520000e+03
%125 = tail call double @llvm.fmuladd.f64(double %109, double 1.182000e+03, double 6.720000e+02)
%126 = tail call double @llvm.fmuladd.f64(double %109, double %125, double 2.520000e+02)
%127 = tail call double @llvm.fmuladd.f64(double %109, double 1.740000e+03, double 8.890000e+02)
%128 = tail call double @llvm.fmuladd.f64(double %109, double %127, double 2.940000e+02)
%129 = tail call double @llvm.fmuladd.f64(double %11, double %128, double %126)
%130 = fdiv double %129, 5.040000e+03
%131 = tail call double @llvm.fmuladd.f64(double %109, double 2.640000e+02, double 8.400000e+01)
%132 = tail call double @llvm.fmuladd.f64(double %109, double 6.060000e+02, double 1.750000e+02)
%133 = tail call double @llvm.fmuladd.f64(double %11, double %132, double %131)
%134 = fdiv double %133, 2.520000e+03
%135 = fmul double %105, 5.000000e-01
%136 = tail call double @llvm.fmuladd.f64(double %135, double %115, double 1.000000e+00)
%137 = tail call double @llvm.fmuladd.f64(double %107, double %91, double %134)
%138 = tail call double @llvm.fmuladd.f64(double %107, double %137, double %130)
%139 = tail call double @llvm.fmuladd.f64(double %107, double %138, double %124)
%140 = tail call double @llvm.fmuladd.f64(double %107, double %139, double %120)
%141 = tail call double @llvm.fmuladd.f64(double %107, double %140, double %115)
%142 = tail call double @llvm.fmuladd.f64(double %108, double %141, double %136)
%143 = tail call double @llvm.fmuladd.f64(double %105, double %142, double %93)
%144 = fdiv double %93, %143
%145 = fadd double %144, -1.000000e+00
%146 = tail call double @llvm.fabs.f64(double %145)
%147 = fcmp ogt double %146, 5.000000e-07
br i1 %147, label %92, label %148
148: ; preds = %99, %15, %6, %4, %2
%149 = phi double [ 0.000000e+00, %2 ], [ 9.999000e+03, %4 ], [ -1.000000e+00, %6 ], [ %21, %15 ], [ %143, %99 ]
ret double %149
}