#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 LnGamma(double);
double PointNormal(double);
int /*<<< orphan*/ assert(int);
double exp(double);
double fabs(double);
double log(double);
double pow(double, double);
double sqrt(double);
double PointChi2(double prob, double v) {
  double e = .5e-6, aa = .6931471805, p = prob, g, TINY_PROB = 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;
  int doL3;
  assert(v > 0);
  if (p < TINY_PROB)
    return 0.0;
  if (p > 1.0 - TINY_PROB)
    return 9999.0;
  xx = v / 2;
  g = LnGamma(xx);
  c = xx - 1;
  if (v < -1.24 * log(p)) {
    ch = pow((p * xx * exp(g + xx * aa)), 1 / xx);
    if (ch - e < 0)
      return (ch);
  } else {
    doL3 = 1;
    if (v <= .32) {
      ch = 0.4;
      a = log(1 - p);
      for (;;) {
        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) {
          doL3 = 0;
          break;
        }
      }
    }
    if (doL3) {
      x = PointNormal(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);
    }
  }
  do {
    q = ch;
    p1 = .5 * ch;
    t = IncompleteGamma(p1, xx, g);
    assert(t >= 0);
    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))))));
  } while (fabs(q / ch - 1) > e);
  return ch;
}


x86 assembly (clang, -O0):
<PointChi2>:
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  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    123e <PointChi2+0xbe>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bc0 <PointChi2+0xa40>
movsd  -0x30(%rbp),%xmm0
movsd  0xdcd(%rip),%xmm1
subsd  -0x40(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    126c <PointChi2+0xec>
movsd  0xf1e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bc0 <PointChi2+0xa40>
movsd  -0x18(%rbp),%xmm0
movsd  0xdaf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
call   10a0 <LnGamma@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xd7a(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1060 <log@plt>
movsd  -0xd0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  0xd4f(%rip),%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    135e <PointChi2+0x1de>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x38(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  0xcf4(%rip),%xmm1
divsd  -0x48(%rbp),%xmm1
call   1070 <pow@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1359 <PointChi2+0x1d9>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bc0 <PointChi2+0xa40>
jmp    1668 <PointChi2+0x4e8>
movl   $0x1,-0xc4(%rbp)
movsd  0xcc0(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1518 <PointChi2+0x398>
movsd  0xcb5(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xc88(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xcba(%rip),%xmm1
addsd  -0x58(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc51(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xc96(%rip),%xmm2
addsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc5d(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xc5f(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  -0x70(%rbp),%xmm1
movsd  0xc46(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  0xc20(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xc1c(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xbfc(%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  0xbcb(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <exp@plt>
mulsd  -0x78(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  0xb6a(%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  0xb41(%rip),%xmm0
subsd  %xmm0,%xmm1
movaps 0xcae(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xb52(%rip),%xmm0
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     150e <PointChi2+0x38e>
movl   $0x0,-0xc4(%rbp)
jmp    1513 <PointChi2+0x393>
jmp    139f <PointChi2+0x21f>
jmp    1518 <PointChi2+0x398>
cmpl   $0x0,-0xc4(%rbp)
je     1663 <PointChi2+0x4e3>
movsd  -0x30(%rbp),%xmm0
call   1080 <PointNormal@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xb51(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  0xa91(%rip),%xmm1
addsd  %xmm1,%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  0xac0(%rip),%xmm1
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xabd(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xab9(%rip),%xmm2
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    165e <PointChi2+0x4de>
movsd  0xa33(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  0xa3c(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
call   1060 <log@plt>
movsd  -0xf8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xf0(%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  0xa43(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1663 <PointChi2+0x4e3>
jmp    1668 <PointChi2+0x4e8>
jmp    166d <PointChi2+0x4ed>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0x9c9(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
call   1030 <IncompleteGamma@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x30(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x100(%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,-0x110(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1060 <log@plt>
movsd  -0x110(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x108(%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  -0x100(%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  0x8a8(%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  0x9a2(%rip),%xmm5
mulsd  %xmm5,%xmm4
movsd  0x99e(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0x8f6(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0x96e(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x956(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x8fe(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x912(%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  0x902(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0x8fe(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0x8de(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x8c6(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x8ae(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x82a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  0x86f(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0x86b(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x84b(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x833(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x7cf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  0x7f9(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x7f5(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0x7d5(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  0x7aa(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0x7a6(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0x786(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x72a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
movsd  0x749(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0x745(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  0x717(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0x713(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x6ef(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  0x6c1(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x6bd(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x69d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x689(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  0x618(%rip),%xmm1
mulsd  -0x80(%rbp),%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  0x5cf(%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  0x47c(%rip),%xmm1
subsd  %xmm1,%xmm0
movaps 0x5e9(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x20(%rbp),%xmm0
ja     166d <PointChi2+0x4ed>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PointChi2>:
sub    $0xa8,%rsp
movsd  %xmm0,0x18(%rsp)
xorpd  %xmm0,%xmm0
xor    %edi,%edi
movsd  %xmm1,(%rsp)
ucomisd %xmm0,%xmm1
seta   %dil
call   1040 <assert@plt>
xorpd  %xmm1,%xmm1
movsd  0xe4f(%rip),%xmm0
movsd  0x18(%rsp),%xmm2
ucomisd %xmm2,%xmm0
ja     1826 <PointChi2+0x6a6>
movapd %xmm2,%xmm0
ucomisd 0xe43(%rip),%xmm2
jbe    11dc <PointChi2+0x5c>
movsd  0xe31(%rip),%xmm1
jmp    1826 <PointChi2+0x6a6>
movsd  0xe34(%rip),%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
call   10a0 <LnGamma@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0xe1e(%rip),%xmm0
addsd  0x28(%rsp),%xmm0
movapd %xmm0,0x50(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <log@plt>
mulsd  0xe07(%rip),%xmm0
ucomisd (%rsp),%xmm0
jbe    128f <PointChi2+0x10f>
movsd  0x28(%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe33(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x20(%rsp),%xmm0
call   1050 <exp@plt>
mulsd  (%rsp),%xmm0
movsd  0xdd7(%rip),%xmm1
divsd  0x28(%rsp),%xmm1
call   1070 <pow@plt>
movapd %xmm0,%xmm2
addsd  0xe30(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
movapd %xmm2,%xmm1
jbe    1522 <PointChi2+0x3a2>
jmp    1826 <PointChi2+0x6a6>
movsd  0xd99(%rip),%xmm0
ucomisd (%rsp),%xmm0
jae    12d4 <PointChi2+0x154>
movsd  0x18(%rsp),%xmm0
call   1080 <PointNormal@plt>
movapd %xmm0,%xmm2
movsd  0xdd3(%rip),%xmm1
divsd  (%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     146f <PointChi2+0x2ef>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1490 <PointChi2+0x310>
movsd  0xd5c(%rip),%xmm0
subsd  0x18(%rsp),%xmm0
call   1060 <log@plt>
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0xa0(%rsp)
movsd  0xd42(%rip),%xmm0
movsd  0xd72(%rip),%xmm1
mulsd  0x50(%rsp),%xmm1
movsd  %xmm1,0x98(%rsp)
movapd %xmm0,%xmm2
nopl   0x0(%rax)
movapd %xmm2,0x30(%rsp)
movapd %xmm0,%xmm3
addsd  0xd16(%rip),%xmm0
movapd 0xe66(%rip),%xmm1
unpcklpd %xmm0,%xmm1
movapd %xmm3,%xmm4
addsd  0xd06(%rip),%xmm4
mulsd  %xmm3,%xmm4
movsd  0xd02(%rip),%xmm2
addsd  %xmm2,%xmm4
mulsd  %xmm3,%xmm4
movapd %xmm4,(%rsp)
movapd %xmm3,%xmm4
unpcklpd %xmm3,%xmm4
mulpd  %xmm1,%xmm4
addpd  0xe39(%rip),%xmm4
movapd %xmm4,0x40(%rsp)
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
movapd %xmm4,%xmm1
divsd  %xmm0,%xmm1
addsd  0xccb(%rip),%xmm1
movapd 0xe23(%rip),%xmm0
unpcklpd %xmm1,%xmm0
movapd %xmm0,0x80(%rsp)
movapd %xmm3,%xmm0
movapd %xmm3,0x70(%rsp)
movapd %xmm3,%xmm1
mulsd  0xca8(%rip),%xmm1
addsd  0xca8(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm1,0x60(%rsp)
mulsd  0xc3a(%rip),%xmm0
addsd  0xa0(%rsp),%xmm0
addsd  0x98(%rsp),%xmm0
call   1050 <exp@plt>
movapd 0x30(%rsp),%xmm2
movapd (%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  0xbd8(%rip),%xmm1
andpd  0xd80(%rip),%xmm1
addsd  0xc28(%rip),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
movapd %xmm2,%xmm0
jb     1320 <PointChi2+0x1a0>
jmp    1522 <PointChi2+0x3a2>
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  0xb9c(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  0xbc0(%rip),%xmm1
movapd %xmm2,%xmm0
call   1070 <pow@plt>
movapd %xmm0,%xmm2
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm2
mulsd  0xbca(%rip),%xmm0
addsd  0xbca(%rip),%xmm0
ucomisd %xmm0,%xmm2
jbe    1522 <PointChi2+0x3a2>
movsd  0xb5c(%rip),%xmm0
subsd  0x18(%rsp),%xmm0
movapd %xmm2,0x30(%rsp)
call   1060 <log@plt>
movsd  %xmm0,(%rsp)
movapd 0x30(%rsp),%xmm0
mulsd  0xb18(%rip),%xmm0
call   1060 <log@plt>
mulsd  0x50(%rsp),%xmm0
movsd  (%rsp),%xmm2
subsd  %xmm0,%xmm2
addsd  0x20(%rsp),%xmm2
mulsd  0xb7e(%rip),%xmm2
movsd  0xb4e(%rip),%xmm0
mulsd  0x28(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
movapd 0xc99(%rip),%xmm1
movapd 0x50(%rsp),%xmm0
xorpd  %xmm0,%xmm1
movapd %xmm1,0x70(%rsp)
movsd  0xb51(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xb4d(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xb49(%rip),%xmm1
divsd  0xb49(%rip),%xmm1
movsd  %xmm1,0x60(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
movapd %xmm2,0x30(%rsp)
movsd  0xa7a(%rip),%xmm0
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
movapd %xmm2,%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
call   1030 <IncompleteGamma@plt>
movsd  %xmm0,0x40(%rsp)
xor    %edi,%edi
ucomisd 0xbcc(%rip),%xmm0
setae  %dil
call   1040 <assert@plt>
movsd  0x18(%rsp),%xmm0
subsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  (%rsp),%xmm0
addsd  0x80(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movapd 0x30(%rsp),%xmm0
call   1060 <log@plt>
mulsd  0x70(%rsp),%xmm0
addsd  (%rsp),%xmm0
call   1050 <exp@plt>
mulsd  0x40(%rsp),%xmm0
movapd %xmm0,%xmm13
xorpd  0xbb7(%rip),%xmm13
movapd 0x30(%rsp),%xmm12
divsd  %xmm12,%xmm13
movapd 0x50(%rsp),%xmm10
movapd %xmm10,%xmm8
mulsd  %xmm13,%xmm8
movapd %xmm0,%xmm9
mulsd  0x9c4(%rip),%xmm9
movapd %xmm9,%xmm5
addsd  %xmm8,%xmm5
movapd %xmm5,%xmm4
mulsd  0xa66(%rip),%xmm4
addsd  0xa66(%rip),%xmm4
mulsd  %xmm5,%xmm4
movsd  0xa61(%rip),%xmm11
addsd  %xmm11,%xmm4
mulsd  %xmm5,%xmm4
addsd  0xa58(%rip),%xmm4
mulsd  %xmm5,%xmm4
addsd  0xa54(%rip),%xmm4
mulsd  %xmm5,%xmm4
movapd %xmm5,%xmm6
mulsd  0xa5c(%rip),%xmm6
addsd  0xa5c(%rip),%xmm6
mulsd  %xmm5,%xmm6
addsd  0xa58(%rip),%xmm6
mulsd  %xmm5,%xmm6
addsd  0xa54(%rip),%xmm6
mulsd  %xmm5,%xmm6
movapd %xmm5,%xmm7
mulsd  0xa54(%rip),%xmm7
addsd  0xa54(%rip),%xmm7
mulsd  %xmm5,%xmm7
addsd  0xa50(%rip),%xmm7
mulsd  %xmm5,%xmm7
movapd %xmm5,%xmm3
mulsd  0xa48(%rip),%xmm3
addsd  0xa48(%rip),%xmm3
mulsd  %xmm5,%xmm3
addsd  0xa44(%rip),%xmm3
movapd %xmm5,%xmm2
mulsd  0xa40(%rip),%xmm2
addsd  0xa40(%rip),%xmm2
mulsd  %xmm5,%xmm2
addsd  0xa3c(%rip),%xmm2
mulsd  %xmm10,%xmm2
addsd  %xmm3,%xmm2
movapd %xmm5,%xmm3
mulsd  0xa2f(%rip),%xmm3
addsd  %xmm11,%xmm3
mulsd  0xa2a(%rip),%xmm5
addsd  0xa2a(%rip),%xmm5
mulsd  %xmm10,%xmm5
addsd  %xmm3,%xmm5
movsd  0x9b8(%rip),%xmm10
divsd  %xmm10,%xmm5
movapd %xmm13,%xmm1
mulsd  0x60(%rsp),%xmm1
addsd  %xmm5,%xmm1
divsd  0x93c(%rip),%xmm2
mulsd  %xmm13,%xmm1
addsd  %xmm2,%xmm1
movsd  0x95b(%rip),%xmm2
addsd  %xmm2,%xmm7
divsd  %xmm10,%xmm7
mulsd  %xmm13,%xmm1
addsd  %xmm7,%xmm1
movsd  0x949(%rip),%xmm3
addsd  %xmm3,%xmm6
divsd  %xmm10,%xmm6
mulsd  %xmm13,%xmm1
addsd  %xmm6,%xmm1
mulsd  %xmm13,%xmm1
addsd  %xmm2,%xmm4
divsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm9
addsd  %xmm4,%xmm1
mulsd  %xmm8,%xmm1
addsd  0x84b(%rip),%xmm9
addsd  %xmm9,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm12,%xmm0
addsd  %xmm12,%xmm1
divsd  %xmm1,%xmm0
addsd  0x814(%rip),%xmm0
andpd  0x9bc(%rip),%xmm0
ucomisd 0x974(%rip),%xmm0
movapd %xmm1,%xmm2
ja     1590 <PointChi2+0x410>
movapd %xmm1,%xmm0
add    $0xa8,%rsp
ret

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

LLVM IR (-O2):
define double @PointChi2(double %0, double %1) {
%3 = fcmp ogt double %1, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = fcmp olt double %0, 0x3EB0C6F7A0B5ED8D
br i1 %6, label %148, label %7
7: ; preds = %2
%8 = fcmp ogt double %0, 0x3FEFFFFDE7210BE9
br i1 %8, label %148, label %9
9: ; preds = %7
%10 = fmul double %1, 5.000000e-01
%11 = tail call double @LnGamma(double %10)
%12 = fadd double %10, -1.000000e+00
%13 = tail call double @log(double %0)
%14 = fmul double %13, -1.240000e+00
%15 = fcmp ogt double %14, %1
br i1 %15, label %16, label %25
16: ; preds = %9
%17 = fmul double %10, %0
%18 = tail call double @llvm.fmuladd.f64(double %10, double 0x3FE62E42FEF1FCCC, double %11)
%19 = tail call double @exp(double %18)
%20 = fmul double %17, %19
%21 = fdiv double 1.000000e+00, %10
%22 = tail call double @pow(double %20, double %21)
%23 = fadd double %22, -5.000000e-07
%24 = fcmp olt double %23, 0.000000e+00
br i1 %24, label %148, label %86
25: ; preds = %9
%26 = fcmp ugt double %1, 3.200000e-01
br i1 %26, label %67, label %27
27: ; preds = %25
%28 = fsub double 1.000000e+00, %0
%29 = tail call double @log(double %28)
%30 = fadd double %11, %29
br label %31
31: ; preds = %31, %27
%32 = phi double [ 4.000000e-01, %27 ], [ %61, %31 ]
%33 = fadd double %32, 4.670000e+00
%34 = fadd double %32, 6.660000e+00
%35 = tail call double @llvm.fmuladd.f64(double %32, double %34, double 6.730000e+00)
%36 = fmul double %32, %35
%37 = insertelement <2 x double> poison, double %32, i64 0
%38 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> zeroinitializer
%39 = insertelement <2 x double> <double 2.000000e+00, double poison>, double %33, i64 1
%40 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %39, <2 x double> <double 4.670000e+00, double 1.000000e+00>)
%41 = extractelement <2 x double> %40, i64 0
%42 = extractelement <2 x double> %40, i64 1
%43 = fdiv double %41, %42
%44 = fadd double %43, -5.000000e-01
%45 = tail call double @llvm.fmuladd.f64(double %32, double 3.000000e+00, double 1.332000e+01)
%46 = tail call double @llvm.fmuladd.f64(double %32, double %45, double 6.730000e+00)
%47 = tail call double @llvm.fmuladd.f64(double %32, double 5.000000e-01, double %30)
%48 = tail call double @llvm.fmuladd.f64(double %12, double 0x3FE62E42FEF1FCCC, double %47)
%49 = tail call double @exp(double %48)
%50 = fmul double %49, %36
%51 = insertelement <2 x double> poison, double %50, i64 0
%52 = insertelement <2 x double> %51, double %46, i64 1
%53 = insertelement <2 x double> poison, double %42, i64 0
%54 = insertelement <2 x double> %53, double %36, i64 1
%55 = fdiv <2 x double> %52, %54
%56 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %44, i64 1
%57 = fsub <2 x double> %56, %55
%58 = extractelement <2 x double> %57, i64 0
%59 = extractelement <2 x double> %57, i64 1
%60 = fdiv double %58, %59
%61 = fsub double %32, %60
%62 = fdiv double %32, %61
%63 = fadd double %62, -1.000000e+00
%64 = tail call double @llvm.fabs.f64(double %63)
%65 = fadd double %64, -1.000000e-02
%66 = fcmp ugt double %65, 0.000000e+00
br i1 %66, label %31, label %86
67: ; preds = %25
%68 = tail call double @PointNormal(double %0)
%69 = fdiv double 2.222220e-01, %1
%70 = tail call double @sqrt(double %69)
%71 = tail call double @llvm.fmuladd.f64(double %68, double %70, double 1.000000e+00)
%72 = fsub double %71, %69
%73 = tail call double @pow(double %72, double 3.000000e+00)
%74 = fmul double %73, %1
%75 = tail call double @llvm.fmuladd.f64(double %1, double 2.200000e+00, double 6.000000e+00)
%76 = fcmp ogt double %74, %75
br i1 %76, label %77, label %86
77: ; preds = %67
%78 = fsub double 1.000000e+00, %0
%79 = tail call double @log(double %78)
%80 = fmul double %74, 5.000000e-01
%81 = tail call double @log(double %80)
%82 = fneg double %12
%83 = tail call double @llvm.fmuladd.f64(double %82, double %81, double %79)
%84 = fadd double %11, %83
%85 = fmul double %84, -2.000000e+00
br label %86
86: ; preds = %31, %77, %67, %16
%87 = phi double [ %22, %16 ], [ %85, %77 ], [ %74, %67 ], [ %61, %31 ]
%88 = tail call double @llvm.fmuladd.f64(double %10, double 0x3FE62E42FEF1FCCC, double %11)
%89 = fneg double %12
%90 = tail call double @llvm.fmuladd.f64(double %12, double 1.270000e+02, double 3.460000e+02)
%91 = tail call double @llvm.fmuladd.f64(double %12, double %90, double 1.200000e+02)
%92 = fdiv double %91, 5.040000e+03
br label %93
93: ; preds = %93, %86
%94 = phi double [ %87, %86 ], [ %143, %93 ]
%95 = fmul double %94, 5.000000e-01
%96 = tail call double @IncompleteGamma(double %95, double %10, double %11)
%97 = fcmp oge double %96, 0.000000e+00
%98 = zext i1 %97 to i32
%99 = tail call i32 @assert(i32 %98)
%100 = fsub double %0, %96
%101 = fadd double %88, %95
%102 = tail call double @log(double %94)
%103 = tail call double @llvm.fmuladd.f64(double %89, double %102, double %101)
%104 = tail call double @exp(double %103)
%105 = fmul double %100, %104
%106 = fneg double %105
%107 = fdiv double %106, %94
%108 = fmul double %12, %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 %12, 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 %12, 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 %92, 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 %94)
%144 = fdiv double %94, %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 %93, label %148
148: ; preds = %93, %16, %7, %2
%149 = phi double [ 0.000000e+00, %2 ], [ 9.999000e+03, %7 ], [ %22, %16 ], [ %143, %93 ]
ret double %149
}