double PPChi2(p, v, g, ifault)
double p, v, g;
int *ifault;
{
  int i, if1;
  double a, b, c, q, t, x, p1, p2, s1, s2, s3, s4, s5, s6, ch, xx, tmp;
  *ifault = 1;
  if ((p < 0.0) || (p >= 1.0))
    return -1.0;
  *ifault = 2;
  if (v <= 0.0)
    return -1.0;
  *ifault = 0;
  xx = 0.5 * v;
  c = xx - 1.0;
  if (v < -1.24 * log(p)) {
    ch = pow(p * xx * (exp(g + xx * 0.6931471806)), 1.0 / xx);
    if (ch < 5e-7)
      return ch;
  } else {
    if (v > 0.32) {
      x = PPND16(p, &if1);
      p1 = 0.222222 / v;
      tmp = x * sqrt(p1) + 1.0 - p1;
      ch = v * tmp * tmp * tmp;
      if (ch > 2.2 * v + 6.0)
        ch = -2.0 * (log(1.0 - p) - c * log(0.5 * ch) + g);
    } else {
      ch = 0.4;
      a = log(1.0 - p);
      do {
        q = ch;
        p1 = 1.0 + ch * (4.67 + ch);
        p2 = ch * (6.73 + ch * (6.66 + ch));
        t = -0.5 + (4.67 + 2.0 * ch) / p1 -
            (6.73 + ch * (13.32 + 3.0 * ch)) / p2;
        ch -= (1.0 - (exp(a + g + 0.5 * ch + c * 0.6931471806)) * p2 / p1) / t;
      } while (fabs(q / ch - 1.0) > 0.01);
    }
  }
  for (i = 1; i <= 20; ++i) {
    q = ch;
    p1 = 0.5 * ch;
    p2 = p - GammaD(p1, xx, &if1);
    if (if1 == 0) {
      t = p2 * (exp(xx * 0.6931471806 + g + p1 - c * log(ch)));
      b = t / ch;
      a = 0.5 * t - b * c;
      s1 = (210.0 +
            a * (140.0 + a * (105.0 + a * (84.0 + a * (70.0 + 60.0 * a))))) /
           420.0;
      s2 = (420.0 + a * (735.0 + a * (966.0 + a * (1141.0 + 1278.0 * a)))) /
           2520.0;
      s3 = (210.0 + a * (462.0 + a * (707.0 + 932.0 * a))) / 2520.0;
      s4 = (252.0 + a * (672.0 + 1182.0 * a) +
            c * (294.0 + a * (889.0 + 1740.0 * a))) /
           5040.0;
      s5 = (84.0 + 2264.0 * a + c * (1175.0 + 606.0 * a)) / 2520.0;
      s6 = (120.0 + c * (346.0 + 127.0 * c)) / 5040.0;
      ch += t *
            (1.0 + 0.5 * t * s1 -
             b * c * (s1 - b * (s2 - b * (s3 - b * (s4 - b * (s5 - b * s6))))));
      if (fabs(q / ch - 1.0) > 5e-7)
        return ch;
    } else {
      *ifault = 3;
      return -1.0;
    }
  }
  *ifault = 4;
  return ch;
}


x86 assembly (clang, -O0):
<PPChi2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     11ad <PPChi2+0x4d>
movsd  -0x10(%rbp),%xmm0
movsd  0xe5d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11bf <PPChi2+0x5f>
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bb3 <PPChi2+0xa53>
mov    -0x28(%rbp),%rax
movl   $0x2,(%rax)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     11e9 <PPChi2+0x89>
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bb3 <PPChi2+0xa53>
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
movsd  0xe15(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  0xde8(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movsd  -0xc0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  0xdbd(%rip),%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    12e9 <PPChi2+0x189>
movsd  -0x10(%rbp),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x20(%rbp),%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
movsd  0xda5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  0xd59(%rip),%xmm1
divsd  -0xb0(%rbp),%xmm1
ff
call   1070 <pow@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xdc4(%rip),%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jbe    12e4 <PPChi2+0x184>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    1bb3 <PPChi2+0xa53>
jmp    15fe <PPChi2+0x49e>
movsd  -0x18(%rbp),%xmm0
movsd  0xd22(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    144a <PPChi2+0x2ea>
movsd  -0x10(%rbp),%xmm0
lea    -0x30(%rbp),%rdi
mov    $0x1,%al
call   1030 <PPND16@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xd57(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   1080 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  0xca7(%rip),%xmm1
addsd  %xmm1,%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
mulsd  -0xb8(%rbp),%xmm0
ff
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x18(%rbp),%xmm1
movsd  0xcc4(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xcc0(%rip),%xmm2
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1445 <PPChi2+0x2e5>
movsd  0xc3a(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  0xc23(%rip),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
call   1060 <log@plt>
movsd  -0xe0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xd8(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
addsd  -0x20(%rbp),%xmm1
movsd  0xc47(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    15f9 <PPChi2+0x499>
movsd  0xbce(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xb9e(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0xbc2(%rip),%xmm1
addsd  -0xa8(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  0xb5e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm1
ff
movsd  0xb95(%rip),%xmm2
addsd  -0xa8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0xb59(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0xa8(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
movsd  0xb58(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  -0x68(%rbp),%xmm1
movsd  0xb3f(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  0xb13(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xb0f(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xaef(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  -0x70(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
movsd  0xaa3(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xaa6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <exp@plt>
mulsd  -0x70(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  0xa5f(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  -0x58(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
divsd  -0xa8(%rbp),%xmm0
ff
movsd  0xa2d(%rip),%xmm1
subsd  %xmm1,%xmm0
movaps 0xba2(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xa76(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1471 <PPChi2+0x311>
jmp    15f9 <PPChi2+0x499>
jmp    15fe <PPChi2+0x49e>
movl   $0x1,-0x2c(%rbp)
cmpl   $0x14,-0x2c(%rbp)
jg     1b9c <PPChi2+0xa3c>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
movsd  0x9ec(%rip),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  -0xb0(%rbp),%xmm1
ff
lea    -0x30(%rbp),%rdi
mov    $0x2,%al
call   1040 <GammaD@plt>
movsd  -0xe8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
cmpl   $0x0,-0x30(%rbp)
jne    1b6d <PPChi2+0xa0d>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0x20(%rbp),%xmm1
movsd  0x991(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
call   1060 <log@plt>
movsd  -0x100(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xf8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
divsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0x8bf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
movsd  0x9e9(%rip),%xmm5
mulsd  %xmm5,%xmm4
movsd  0x9e5(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0x93d(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0x9b5(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x99d(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x945(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x959(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movsd  0x94c(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0x948(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0x928(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x910(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x8f8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x874(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  0x8bc(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0x8b8(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x898(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x880(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x81c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  0x846(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x842(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0x822(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movsd  0x7f7(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0x7f3(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0x7d3(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x777(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x38(%rbp),%xmm1
movsd  0x796(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0x792(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  0x764(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0x760(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x73c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0x70e(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x70a(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x6ea(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x6d6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  0x635(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x60f(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  -0x48(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm3
movsd  -0x80(%rbp),%xmm6
movsd  -0x40(%rbp),%xmm5
movsd  -0x88(%rbp),%xmm8
ff ff
movsd  -0x40(%rbp),%xmm7
movsd  -0x90(%rbp),%xmm10
ff ff
movsd  -0x40(%rbp),%xmm9
movsd  -0x98(%rbp),%xmm12
ff ff
movsd  -0x40(%rbp),%xmm11
movsd  -0xa0(%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  -0xa8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
divsd  -0xa8(%rbp),%xmm0
ff
movsd  0x4cb(%rip),%xmm1
subsd  %xmm1,%xmm0
movaps 0x640(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0x53c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1b68 <PPChi2+0xa08>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    1bb3 <PPChi2+0xa53>
jmp    1b89 <PPChi2+0xa29>
mov    -0x28(%rbp),%rax
movl   $0x3,(%rax)
movsd  0x511(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bb3 <PPChi2+0xa53>
jmp    1b8e <PPChi2+0xa2e>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1605 <PPChi2+0x4a5>
mov    -0x28(%rbp),%rax
movl   $0x4,(%rax)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PPChi2>:
push   %rbp
push   %r14
push   %rbx
sub    $0xb0,%rsp
movl   $0x1,(%rdi)
xorpd  %xmm3,%xmm3
ucomisd %xmm0,%xmm3
movsd  0xe7f(%rip),%xmm3
ja     1839 <PPChi2+0x6d9>
ucomisd 0xe79(%rip),%xmm0
jae    1839 <PPChi2+0x6d9>
mov    %rdi,%rbx
movsd  %xmm2,0x40(%rsp)
movsd  %xmm0,0x8(%rsp)
movl   $0x2,(%rdi)
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    1839 <PPChi2+0x6d9>
movl   $0x0,(%rbx)
movsd  0xe4a(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x48(%rsp)
movsd  0xe28(%rip),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,0x60(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  %xmm1,0x10(%rsp)
call   1060 <log@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0xe17(%rip),%xmm0
ucomisd %xmm1,%xmm0
movsd  0x48(%rsp),%xmm0
jbe    1268 <PPChi2+0x108>
movapd %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xe3b(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x40(%rsp),%xmm0
call   1050 <exp@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0xdc6(%rip),%xmm1
divsd  0x48(%rsp),%xmm1
call   1070 <pow@plt>
movsd  0xe3b(%rip),%xmm1
ucomisd %xmm0,%xmm1
movapd %xmm0,%xmm3
jbe    1508 <PPChi2+0x3a8>
jmp    1839 <PPChi2+0x6d9>
ucomisd 0xdb0(%rip),%xmm1
jbe    12b7 <PPChi2+0x157>
lea    0x2c(%rsp),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1030 <PPND16@plt>
movsd  0x10(%rsp),%xmm2
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
movsd  0xdd7(%rip),%xmm4
divsd  %xmm2,%xmm4
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm4
jb     1453 <PPChi2+0x2f3>
xorps  %xmm0,%xmm0
sqrtsd %xmm4,%xmm0
jmp    147a <PPChi2+0x31a>
movsd  0xd49(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
call   1060 <log@plt>
addsd  0x40(%rsp),%xmm0
movsd  %xmm0,0xa8(%rsp)
movsd  0xd47(%rip),%xmm1
movsd  0xd77(%rip),%xmm0
mulsd  0x60(%rsp),%xmm0
movsd  %xmm0,0xa0(%rsp)
movapd %xmm1,%xmm0
nopl   0x0(%rax)
movapd %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
addsd  0xd1e(%rip),%xmm0
movapd %xmm1,%xmm3
movapd 0xe62(%rip),%xmm1
unpcklpd %xmm0,%xmm1
movapd %xmm3,%xmm4
addsd  0xd0a(%rip),%xmm4
mulsd  %xmm3,%xmm4
movsd  0xd06(%rip),%xmm2
addsd  %xmm2,%xmm4
mulsd  %xmm3,%xmm4
movapd %xmm4,0x30(%rsp)
movapd %xmm3,%xmm4
unpcklpd %xmm3,%xmm4
mulpd  %xmm1,%xmm4
addpd  0xe34(%rip),%xmm4
movapd %xmm4,0x50(%rsp)
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
movapd %xmm4,%xmm1
divsd  %xmm0,%xmm1
addsd  0xcce(%rip),%xmm1
movapd 0xe1e(%rip),%xmm0
unpcklpd %xmm1,%xmm0
movapd %xmm0,0x90(%rsp)
movapd %xmm3,%xmm0
movapd %xmm3,0x80(%rsp)
movapd %xmm3,%xmm1
mulsd  0xca8(%rip),%xmm1
addsd  0xca8(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm1,0x70(%rsp)
mulsd  0xc4a(%rip),%xmm0
addsd  0xa8(%rsp),%xmm0
addsd  0xa0(%rsp),%xmm0
call   1050 <exp@plt>
movapd 0x30(%rsp),%xmm1
mulsd  %xmm1,%xmm0
unpcklpd 0x70(%rsp),%xmm0
movapd 0x50(%rsp),%xmm2
shufpd $0x1,%xmm1,%xmm2
divpd  %xmm2,%xmm0
movapd 0x90(%rsp),%xmm1
subpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd 0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
movapd 0x80(%rsp),%xmm1
divsd  %xmm0,%xmm1
addsd  0xbcc(%rip),%xmm1
andpd  0xd74(%rip),%xmm1
ucomisd 0xc24(%rip),%xmm1
movapd %xmm0,%xmm1
ja     1300 <PPChi2+0x1a0>
jmp    1508 <PPChi2+0x3a8>
movapd %xmm4,%xmm0
movsd  %xmm3,0x30(%rsp)
movsd  %xmm4,0x50(%rsp)
call   1080 <sqrt@plt>
movsd  0x50(%rsp),%xmm4
movsd  0x30(%rsp),%xmm3
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm3
addsd  0xb7c(%rip),%xmm3
subsd  %xmm4,%xmm3
movapd %xmm3,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm0
mulsd  0xbd0(%rip),%xmm2
addsd  0xbd0(%rip),%xmm2
ucomisd %xmm2,%xmm0
jbe    1508 <PPChi2+0x3a8>
movapd %xmm0,0x10(%rsp)
movsd  0xb44(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x30(%rsp)
movapd 0x10(%rsp),%xmm0
mulsd  0xb2f(%rip),%xmm0
call   1060 <log@plt>
mulsd  0x60(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
subsd  %xmm0,%xmm1
addsd  0x40(%rsp),%xmm1
mulsd  0xb84(%rip),%xmm1
movapd %xmm1,%xmm0
movsd  0xb50(%rip),%xmm2
movsd  0x48(%rsp),%xmm1
mulsd  %xmm1,%xmm2
addsd  0x40(%rsp),%xmm2
movsd  %xmm2,0x90(%rsp)
movsd  0xb67(%rip),%xmm3
movapd %xmm0,%xmm2
movapd 0x60(%rsp),%xmm0
mulsd  %xmm0,%xmm3
addsd  0xb59(%rip),%xmm3
movapd 0xc71(%rip),%xmm4
mulsd  %xmm0,%xmm3
addsd  0xb4d(%rip),%xmm3
xorpd  %xmm0,%xmm4
movapd %xmm4,0x70(%rsp)
movapd %xmm2,%xmm0
divsd  0xb3f(%rip),%xmm3
movsd  %xmm3,0x80(%rsp)
mov    $0x14,%ebp
movsd  0xa89(%rip),%xmm2
lea    0x2c(%rsp),%r14
nopl   0x0(%rax)
movapd %xmm0,0x10(%rsp)
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    %r14,%rdi
mov    $0x2,%al
call   1040 <GammaD@plt>
cmpl   $0x0,0x2c(%rsp)
jne    182a <PPChi2+0x6ca>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x50(%rsp)
movsd  0x30(%rsp),%xmm0
addsd  0x90(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
movapd 0x10(%rsp),%xmm0
call   1060 <log@plt>
mulsd  0x70(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
call   1050 <exp@plt>
mulsd  0x50(%rsp),%xmm0
movapd %xmm0,%xmm10
xorpd  0xbaf(%rip),%xmm10
movapd 0x10(%rsp),%xmm13
divsd  %xmm13,%xmm10
movapd 0x60(%rsp),%xmm3
movapd %xmm3,%xmm8
mulsd  %xmm10,%xmm8
movapd %xmm0,%xmm9
movsd  0x9d5(%rip),%xmm12
mulsd  %xmm12,%xmm9
movapd %xmm9,%xmm6
addsd  %xmm8,%xmm6
movapd %xmm6,%xmm5
mulsd  0xa62(%rip),%xmm5
addsd  0xa62(%rip),%xmm5
mulsd  %xmm6,%xmm5
movsd  0xa5d(%rip),%xmm11
addsd  %xmm11,%xmm5
mulsd  %xmm6,%xmm5
addsd  0xa54(%rip),%xmm5
mulsd  %xmm6,%xmm5
addsd  0xa50(%rip),%xmm5
mulsd  %xmm6,%xmm5
movapd %xmm6,%xmm7
mulsd  0xa58(%rip),%xmm7
addsd  0xa58(%rip),%xmm7
mulsd  %xmm6,%xmm7
addsd  0xa54(%rip),%xmm7
mulsd  %xmm6,%xmm7
addsd  0xa50(%rip),%xmm7
mulsd  %xmm6,%xmm7
movapd %xmm6,%xmm2
mulsd  0xa50(%rip),%xmm2
addsd  0xa50(%rip),%xmm2
mulsd  %xmm6,%xmm2
addsd  0xa4c(%rip),%xmm2
mulsd  %xmm6,%xmm2
movapd %xmm6,%xmm1
mulsd  0xa44(%rip),%xmm1
addsd  0xa44(%rip),%xmm1
mulsd  %xmm6,%xmm1
addsd  0xa40(%rip),%xmm1
movapd %xmm6,%xmm4
mulsd  0xa3c(%rip),%xmm4
addsd  0xa3c(%rip),%xmm4
mulsd  %xmm6,%xmm4
addsd  0xa38(%rip),%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm1,%xmm4
movapd %xmm6,%xmm1
mulsd  0xa2c(%rip),%xmm1
addsd  %xmm11,%xmm1
mulsd  0xa27(%rip),%xmm6
addsd  0xa27(%rip),%xmm6
mulsd  %xmm3,%xmm6
addsd  %xmm1,%xmm6
movsd  0x9b6(%rip),%xmm11
divsd  %xmm11,%xmm6
movapd %xmm10,%xmm3
mulsd  0x80(%rsp),%xmm3
addsd  %xmm6,%xmm3
divsd  0x937(%rip),%xmm4
mulsd  %xmm10,%xmm3
addsd  %xmm4,%xmm3
movsd  0x956(%rip),%xmm1
addsd  %xmm1,%xmm2
divsd  %xmm11,%xmm2
mulsd  %xmm10,%xmm3
addsd  %xmm2,%xmm3
movsd  0x944(%rip),%xmm2
addsd  %xmm2,%xmm7
divsd  %xmm11,%xmm7
mulsd  %xmm10,%xmm3
addsd  %xmm7,%xmm3
mulsd  %xmm10,%xmm3
addsd  %xmm1,%xmm5
divsd  %xmm2,%xmm5
mulsd  %xmm5,%xmm9
addsd  %xmm5,%xmm3
mulsd  %xmm8,%xmm3
addsd  0x82e(%rip),%xmm9
addsd  %xmm9,%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm13,%xmm0
addsd  %xmm13,%xmm3
divsd  %xmm3,%xmm0
addsd  0x807(%rip),%xmm0
andpd  0x9af(%rip),%xmm0
ucomisd 0x887(%rip),%xmm0
ja     1839 <PPChi2+0x6d9>
movapd %xmm12,%xmm2
movapd %xmm3,%xmm0
add    $0xffffffff,%ebp
movsd  0x48(%rsp),%xmm1
jne    1590 <PPChi2+0x430>
mov    $0x4,%eax
jmp    1837 <PPChi2+0x6d7>
mov    $0x3,%eax
movsd  0x7c9(%rip),%xmm3
mov    %eax,(%rbx)
movapd %xmm3,%xmm0
add    $0xb0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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