void cdflib_cdfchi(const int *which, double *p, double *q, double *x,
                   double *df, int *status, double *bound) {
  static const double tol = 1.0e-8;
  static const double atol = 1.0e-50;
  static const double zero = 1.0e-300;
  static const double inf = 1.0e300;
  static const int K1 = 1;
  double K2 = 0.0e0;
  double K4 = 0.5e0;
  double K5 = 5.0e0;
  double fx, cum, ccum, pq, porq = 0;
  unsigned long qhi, qleft, qporq;
  double T3, T6, T7, T8, T9, T10, T11;
  *status = 0;
  *bound = 0.0;
  if (!(*which < 1 || *which > 3)) {
    goto S30;
  }
  if (!(*which < 1)) {
    goto S10;
  }
  *bound = 1.0e0;
  goto S20;
S10:
  *bound = 3.0e0;
S20:
  *status = -1;
  return;
S30:
  if (*which == 1) {
    goto S70;
  }
  if (!(*p < 0.0e0 || *p > 1.0e0)) {
    goto S60;
  }
  if (!(*p < 0.0e0)) {
    goto S40;
  }
  *bound = 0.0e0;
  goto S50;
S40:
  *bound = 1.0e0;
S50:
  *status = -2;
  return;
S70:
S60:
  if (*which == 1) {
    goto S110;
  }
  if (!(*q <= 0.0e0 || *q > 1.0e0)) {
    goto S100;
  }
  if (!(*q <= 0.0e0)) {
    goto S80;
  }
  *bound = 0.0e0;
  goto S90;
S80:
  *bound = 1.0e0;
S90:
  *status = -3;
  return;
S110:
S100:
  if (*which == 2) {
    goto S130;
  }
  if (!(*x < 0.0e0)) {
    goto S120;
  }
  *bound = 0.0e0;
  *status = -4;
  return;
S130:
S120:
  if (*which == 3) {
    goto S150;
  }
  if (!(*df <= 0.0e0)) {
    goto S140;
  }
  *bound = 0.0e0;
  *status = -5;
  return;
S150:
S140:
  if (*which == 1) {
    goto S190;
  }
  pq = *p + *q;
  if (!(fabs(pq - 0.5e0 - 0.5e0) > 3.0e0 * dpmpar(K1))) {
    goto S180;
  }
  if (!(pq < 0.0e0)) {
    goto S160;
  }
  *bound = 0.0e0;
  goto S170;
S160:
  *bound = 1.0e0;
S170:
  *status = 3;
  return;
S190:
S180:
  if (*which == 1) {
    goto S220;
  }
  qporq = *p <= *q;
  if (!qporq) {
    goto S200;
  }
  porq = *p;
  goto S210;
S200:
  porq = *q;
S220:
S210:
  if (1 == *which) {
    *status = 0;
    cdflib_cumchi(x, df, p, q);
    if (porq > 1.5e0) {
      *status = 10;
      return;
    }
  } else if (2 == *which) {
    *x = 5.0e0;
    T3 = inf;
    T6 = atol;
    T7 = tol;
    cdflib_dstinv(&K2, &T3, &K4, &K4, &K5, &T6, &T7);
    *status = 0;
    cdflib_dinvr(status, x, &fx, &qleft, &qhi);
  S230:
    if (!(*status == 1)) {
      goto S270;
    }
    cdflib_cumchi(x, df, &cum, &ccum);
    if (!qporq) {
      goto S240;
    }
    fx = cum - *p;
    goto S250;
  S240:
    fx = ccum - *q;
  S250:
    if (!(fx + porq > 1.5e0)) {
      goto S260;
    }
    *status = 10;
    return;
  S260:
    cdflib_dinvr(status, x, &fx, &qleft, &qhi);
    goto S230;
  S270:
    if (!(*status == -1)) {
      goto S300;
    }
    if (!qleft) {
      goto S280;
    }
    *status = 1;
    *bound = 0.0e0;
    goto S290;
  S280:
    *status = 2;
    *bound = inf;
  S300:
  S290:;
  } else if (3 == *which) {
    *df = 5.0e0;
    T8 = zero;
    T9 = inf;
    T10 = atol;
    T11 = tol;
    cdflib_dstinv(&T8, &T9, &K4, &K4, &K5, &T10, &T11);
    *status = 0;
    cdflib_dinvr(status, df, &fx, &qleft, &qhi);
  S310:
    if (!(*status == 1)) {
      goto S350;
    }
    cdflib_cumchi(x, df, &cum, &ccum);
    if (!qporq) {
      goto S320;
    }
    fx = cum - *p;
    goto S330;
  S320:
    fx = ccum - *q;
  S330:
    if (!(fx + porq > 1.5e0)) {
      goto S340;
    }
    *status = 10;
    return;
  S340:
    cdflib_dinvr(status, df, &fx, &qleft, &qhi);
    goto S310;
  S350:
    if (!(*status == -1)) {
      goto S380;
    }
    if (!qleft) {
      goto S360;
    }
    *status = 1;
    *bound = zero;
    goto S370;
  S360:
    *status = 2;
    *bound = inf;
  S370:;
  }
S380:
  return;
}


x86 assembly (clang, -O0):
<cdflib_cdfchi>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe91(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe7c(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jl     11c5 <cdflib_cdfchi+0x85>
mov    -0x8(%rbp),%rax
cmpl   $0x3,(%rax)
jg     11c5 <cdflib_cdfchi+0x85>
jmp    120b <cdflib_cdfchi+0xcb>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jl     11d7 <cdflib_cdfchi+0x97>
jmp    11ec <cdflib_cdfchi+0xac>
mov    0x10(%rbp),%rax
movsd  0xe2d(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    11fc <cdflib_cdfchi+0xbc>
mov    0x10(%rbp),%rax
movsd  0xe20(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    18e8 <cdflib_cdfchi+0x7a8>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    121d <cdflib_cdfchi+0xdd>
jmp    1292 <cdflib_cdfchi+0x152>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
ja     124d <cdflib_cdfchi+0x10d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xdd2(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     124d <cdflib_cdfchi+0x10d>
jmp    1297 <cdflib_cdfchi+0x157>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
ja     1263 <cdflib_cdfchi+0x123>
jmp    1273 <cdflib_cdfchi+0x133>
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1283 <cdflib_cdfchi+0x143>
mov    0x10(%rbp),%rax
movsd  0xd91(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movl   $0xfffffffe,(%rax)
jmp    18e8 <cdflib_cdfchi+0x7a8>
jmp    1297 <cdflib_cdfchi+0x157>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    12a9 <cdflib_cdfchi+0x169>
jmp    131e <cdflib_cdfchi+0x1de>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    12d9 <cdflib_cdfchi+0x199>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xd46(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     12d9 <cdflib_cdfchi+0x199>
jmp    1323 <cdflib_cdfchi+0x1e3>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    12ef <cdflib_cdfchi+0x1af>
jmp    12ff <cdflib_cdfchi+0x1bf>
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    130f <cdflib_cdfchi+0x1cf>
mov    0x10(%rbp),%rax
movsd  0xd05(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movl   $0xfffffffd,(%rax)
jmp    18e8 <cdflib_cdfchi+0x7a8>
jmp    1323 <cdflib_cdfchi+0x1e3>
mov    -0x8(%rbp),%rax
cmpl   $0x2,(%rax)
jne    1335 <cdflib_cdfchi+0x1f5>
jmp    1365 <cdflib_cdfchi+0x225>
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
ja     134b <cdflib_cdfchi+0x20b>
jmp    136a <cdflib_cdfchi+0x22a>
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movl   $0xfffffffc,(%rax)
jmp    18e8 <cdflib_cdfchi+0x7a8>
jmp    136a <cdflib_cdfchi+0x22a>
mov    -0x8(%rbp),%rax
cmpl   $0x3,(%rax)
jne    137c <cdflib_cdfchi+0x23c>
jmp    13ac <cdflib_cdfchi+0x26c>
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    1392 <cdflib_cdfchi+0x252>
jmp    13b1 <cdflib_cdfchi+0x271>
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movl   $0xfffffffb,(%rax)
jmp    18e8 <cdflib_cdfchi+0x7a8>
jmp    13b1 <cdflib_cdfchi+0x271>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    13c3 <cdflib_cdfchi+0x283>
jmp    147d <cdflib_cdfchi+0x33d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xc23(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xc17(%rip),%xmm1
subsd  %xmm1,%xmm0
movaps 0xc54(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <dpmpar@plt>
movsd  -0xc8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0xbf0(%rip),%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
ja     143b <cdflib_cdfchi+0x2fb>
jmp    1482 <cdflib_cdfchi+0x342>
xorps  %xmm0,%xmm0
ucomisd -0x68(%rbp),%xmm0
ja     144e <cdflib_cdfchi+0x30e>
jmp    145e <cdflib_cdfchi+0x31e>
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    146e <cdflib_cdfchi+0x32e>
mov    0x10(%rbp),%rax
movsd  0xba6(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movl   $0x3,(%rax)
jmp    18e8 <cdflib_cdfchi+0x7a8>
jmp    1482 <cdflib_cdfchi+0x342>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1494 <cdflib_cdfchi+0x354>
jmp    14eb <cdflib_cdfchi+0x3ab>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    %rax,-0x88(%rbp)
cmpq   $0x0,-0x88(%rbp)
jne    14cc <cdflib_cdfchi+0x38c>
jmp    14de <cdflib_cdfchi+0x39e>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    14f0 <cdflib_cdfchi+0x3b0>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    14f0 <cdflib_cdfchi+0x3b0>
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
cmp    (%rcx),%eax
jne    154d <cdflib_cdfchi+0x40d>
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x0,%al
call   1050 <cdflib_cumchi@plt>
movsd  -0x70(%rbp),%xmm0
movsd  0xb11(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1548 <cdflib_cdfchi+0x408>
mov    -0x30(%rbp),%rax
movl   $0xa,(%rax)
jmp    18e8 <cdflib_cdfchi+0x7a8>
jmp    18de <cdflib_cdfchi+0x79e>
mov    -0x8(%rbp),%rcx
mov    $0x2,%eax
cmp    (%rcx),%eax
jne    1707 <cdflib_cdfchi+0x5c7>
mov    -0x20(%rbp),%rax
movsd  0xa96(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  0xaba(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xaa2(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xa8a(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
lea    -0x38(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0x40(%rbp),%rcx
lea    -0x48(%rbp),%r8
lea    -0x98(%rbp),%r9
lea    -0xa0(%rbp),%rax
mov    %rcx,%rdx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <cdflib_dstinv@plt>
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    -0x80(%rbp),%rcx
lea    -0x78(%rbp),%r8
mov    $0x0,%al
call   1060 <cdflib_dinvr@plt>
mov    -0x30(%rbp),%rax
cmpl   $0x1,(%rax)
je     1604 <cdflib_cdfchi+0x4c4>
jmp    16a7 <cdflib_cdfchi+0x567>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x58(%rbp),%rdx
lea    -0x60(%rbp),%rcx
mov    $0x0,%al
call   1050 <cdflib_cumchi@plt>
cmpq   $0x0,-0x88(%rbp)
jne    162e <cdflib_cdfchi+0x4ee>
jmp    1645 <cdflib_cdfchi+0x505>
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1657 <cdflib_cdfchi+0x517>
movsd  -0x60(%rbp),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  0x9d7(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1678 <cdflib_cdfchi+0x538>
jmp    1687 <cdflib_cdfchi+0x547>
mov    -0x30(%rbp),%rax
movl   $0xa,(%rax)
jmp    18e8 <cdflib_cdfchi+0x7a8>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    -0x80(%rbp),%rcx
lea    -0x78(%rbp),%r8
mov    $0x0,%al
call   1060 <cdflib_dinvr@plt>
jmp    15f2 <cdflib_cdfchi+0x4b2>
mov    -0x30(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     16b9 <cdflib_cdfchi+0x579>
jmp    16fd <cdflib_cdfchi+0x5bd>
cmpq   $0x0,-0x80(%rbp)
jne    16c9 <cdflib_cdfchi+0x589>
jmp    16e3 <cdflib_cdfchi+0x5a3>
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1702 <cdflib_cdfchi+0x5c2>
mov    -0x30(%rbp),%rax
movl   $0x2,(%rax)
mov    0x10(%rbp),%rax
movsd  0x937(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1702 <cdflib_cdfchi+0x5c2>
jmp    18d9 <cdflib_cdfchi+0x799>
mov    -0x8(%rbp),%rcx
mov    $0x3,%eax
cmp    (%rcx),%eax
jne    18d4 <cdflib_cdfchi+0x794>
mov    -0x28(%rbp),%rax
movsd  0x8dc(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  0x908(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0x8f0(%rip),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0x8d8(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0x8c0(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
lea    -0xa8(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
lea    -0x40(%rbp),%rcx
lea    -0x48(%rbp),%r8
lea    -0xb8(%rbp),%r9
lea    -0xc0(%rbp),%rax
mov    %rcx,%rdx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <cdflib_dstinv@plt>
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    -0x80(%rbp),%rcx
lea    -0x78(%rbp),%r8
mov    $0x0,%al
call   1060 <cdflib_dinvr@plt>
mov    -0x30(%rbp),%rax
cmpl   $0x1,(%rax)
je     17d1 <cdflib_cdfchi+0x691>
jmp    1874 <cdflib_cdfchi+0x734>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x58(%rbp),%rdx
lea    -0x60(%rbp),%rcx
mov    $0x0,%al
call   1050 <cdflib_cumchi@plt>
cmpq   $0x0,-0x88(%rbp)
jne    17fb <cdflib_cdfchi+0x6bb>
jmp    1812 <cdflib_cdfchi+0x6d2>
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1824 <cdflib_cdfchi+0x6e4>
movsd  -0x60(%rbp),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  0x80a(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1845 <cdflib_cdfchi+0x705>
jmp    1854 <cdflib_cdfchi+0x714>
mov    -0x30(%rbp),%rax
movl   $0xa,(%rax)
jmp    18e8 <cdflib_cdfchi+0x7a8>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    -0x80(%rbp),%rcx
lea    -0x78(%rbp),%r8
mov    $0x0,%al
call   1060 <cdflib_dinvr@plt>
jmp    17bf <cdflib_cdfchi+0x67f>
mov    -0x30(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1886 <cdflib_cdfchi+0x746>
jmp    18e3 <cdflib_cdfchi+0x7a3>
cmpq   $0x0,-0x80(%rbp)
jne    1896 <cdflib_cdfchi+0x756>
jmp    18b5 <cdflib_cdfchi+0x775>
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
mov    0x10(%rbp),%rax
movsd  0x78c(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    18cf <cdflib_cdfchi+0x78f>
mov    -0x30(%rbp),%rax
movl   $0x2,(%rax)
mov    0x10(%rbp),%rax
movsd  0x765(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    18d4 <cdflib_cdfchi+0x794>
jmp    18d9 <cdflib_cdfchi+0x799>
jmp    18de <cdflib_cdfchi+0x79e>
jmp    18e3 <cdflib_cdfchi+0x7a3>
jmp    18e8 <cdflib_cdfchi+0x7a8>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_cdfchi>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %r9,%r12
mov    %rcx,%r9
mov    0x100(%rsp),%r14
movq   $0x0,0xa8(%rsp)
movabs $0x3fe0000000000000,%rax
mov    %rax,0x80(%rsp)
movabs $0x4014000000000000,%r15
mov    %r15,0x78(%rsp)
movl   $0x0,(%r12)
movq   $0x0,(%r14)
mov    (%rdi),%eax
lea    -0x4(%rax),%ecx
cmp    $0xfffffffc,%ecx
ja     11ca <cdflib_cdfchi+0x8a>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
lea    0xe7d(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%r14)
movl   $0xffffffff,(%r12)
ff
jmp    12bb <cdflib_cdfchi+0x17b>
mov    %rdx,%rbx
mov    %rsi,%r13
cmp    $0x1,%eax
jne    11ed <cdflib_cdfchi+0xad>
xorpd  %xmm0,%xmm0
ucomisd (%r9),%xmm0
jbe    1240 <cdflib_cdfchi+0x100>
movl   $0xfffffffc,(%r12)
ff
jmp    12bb <cdflib_cdfchi+0x17b>
movsd  0x0(%r13),%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
ja     1273 <cdflib_cdfchi+0x133>
ucomisd 0xdfb(%rip),%xmm2
ja     1273 <cdflib_cdfchi+0x133>
movsd  (%rbx),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    129d <cdflib_cdfchi+0x15d>
ucomisd 0xddf(%rip),%xmm0
ja     129d <cdflib_cdfchi+0x15d>
mov    %rdi,%rbp
xorpd  %xmm1,%xmm1
cmp    $0x2,%eax
jne    12cd <cdflib_cdfchi+0x18d>
ucomisd (%r8),%xmm1
jb     12d8 <cdflib_cdfchi+0x198>
jmp    1293 <cdflib_cdfchi+0x153>
ucomisd (%r8),%xmm0
jae    1293 <cdflib_cdfchi+0x153>
movl   $0x0,(%r12)
mov    %r9,%rdi
mov    %r8,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <cdflib_cumchi@plt>
cmpltsd %xmm0,%xmm2
movsd  0xd80(%rip),%xmm0
andnpd %xmm0,%xmm2
movlpd %xmm2,(%r14)
movl   $0xfffffffe,(%r12)
ff
jmp    12bb <cdflib_cdfchi+0x17b>
movl   $0xfffffffb,(%r12)
ff
jmp    12bb <cdflib_cdfchi+0x17b>
cmpnlesd %xmm1,%xmm0
movsd  0xd56(%rip),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,(%r14)
movl   $0xfffffffd,(%r12)
ff
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
ucomisd (%r9),%xmm1
ja     11e0 <cdflib_cdfchi+0xa0>
mov    %r9,0x68(%rsp)
mov    %r8,0x70(%rsp)
mov    %rbx,0x10(%rsp)
addsd  %xmm0,%xmm2
movapd %xmm2,0x40(%rsp)
movsd  0xd0f(%rip),%xmm0
addsd  %xmm0,%xmm2
addsd  %xmm0,%xmm2
andpd  0xd17(%rip),%xmm2
movapd %xmm2,0x50(%rsp)
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <dpmpar@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xce6(%rip),%xmm0
movapd 0x50(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    1363 <cdflib_cdfchi+0x223>
xorpd  %xmm0,%xmm0
movapd 0x40(%rsp),%xmm1
cmpltsd %xmm0,%xmm1
movsd  0xcb3(%rip),%xmm0
andnpd %xmm0,%xmm1
movlpd %xmm1,(%r14)
movl   $0x3,(%r12)
jmp    12bb <cdflib_cdfchi+0x17b>
mov    0x0(%rbp),%eax
cmp    $0x1,%eax
mov    0x10(%rsp),%rbx
mov    0x70(%rsp),%r8
mov    0x68(%rsp),%r9
je     1247 <cdflib_cdfchi+0x107>
movsd  0x0(%r13),%xmm1
movsd  (%rbx),%xmm2
movapd %xmm1,%xmm3
cmplesd %xmm2,%xmm3
movapd %xmm3,%xmm0
movapd %xmm1,0x50(%rsp)
andpd  %xmm1,%xmm0
movapd %xmm2,0x40(%rsp)
andnpd %xmm2,%xmm3
orpd   %xmm0,%xmm3
movapd %xmm3,0xb0(%rsp)
cmp    $0x3,%eax
je     14d4 <cdflib_cdfchi+0x394>
cmp    $0x2,%eax
jne    12bb <cdflib_cdfchi+0x17b>
mov    %r15,(%r9)
movabs $0x7e37e43c8800759c,%rax
e4 37 7e
mov    %rax,0x28(%rsp)
movabs $0x358dee7a4ad4b81f,%rax
ee 8d 35
mov    %rax,0x20(%rsp)
movabs $0x3e45798ee2308c3a,%rax
79 45 3e
mov    %rax,0x18(%rsp)
lea    0x18(%rsp),%rax
mov    %rax,(%rsp)
lea    0xa8(%rsp),%rdi
lea    0x28(%rsp),%rsi
lea    0x80(%rsp),%rcx
lea    0x78(%rsp),%r8
mov    %r9,%r15
lea    0x20(%rsp),%r9
mov    %rcx,%rdx
xor    %eax,%eax
call   1040 <cdflib_dstinv@plt>
mov    0x10(%rsp),%rbx
movapd 0x40(%rsp),%xmm0
ucomisd 0x50(%rsp),%xmm0
movl   $0x0,(%r12)
cmovae %r13,%rbx
lea    0xa0(%rsp),%rbp
lea    0x98(%rsp),%r13
mov    %r12,%rdi
mov    %r15,%rsi
lea    0x38(%rsp),%rdx
lea    0x30(%rsp),%rcx
lea    0x90(%rsp),%r8
xor    %eax,%eax
call   1060 <cdflib_dinvr@plt>
mov    (%r12),%eax
cmp    $0x1,%eax
jne    15f6 <cdflib_cdfchi+0x4b6>
mov    %r15,%rdi
mov    0x70(%rsp),%rsi
mov    %rbp,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <cdflib_cumchi@plt>
movapd 0x40(%rsp),%xmm0
ucomisd 0x50(%rsp),%xmm0
mov    %r13,%rax
cmovae %rbp,%rax
movsd  (%rax),%xmm0
subsd  (%rbx),%xmm0
movsd  %xmm0,0x38(%rsp)
addsd  0xb0(%rsp),%xmm0
ucomisd 0xb4b(%rip),%xmm0
jbe    145a <cdflib_cdfchi+0x31a>
jmp    15e9 <cdflib_cdfchi+0x4a9>
mov    %r15,(%r8)
movabs $0x1a56e1fc2f8f359,%rax
6e a5 01
mov    %rax,0x28(%rsp)
movabs $0x7e37e43c8800759c,%rax
e4 37 7e
mov    %rax,0x20(%rsp)
movabs $0x358dee7a4ad4b81f,%rax
ee 8d 35
mov    %rax,0x18(%rsp)
movabs $0x3e45798ee2308c3a,%rax
79 45 3e
mov    %rax,0x88(%rsp)
lea    0x88(%rsp),%rax
mov    %rax,(%rsp)
lea    0x28(%rsp),%rdi
lea    0x20(%rsp),%rsi
lea    0x80(%rsp),%rcx
mov    %r8,%r15
lea    0x78(%rsp),%r8
lea    0x18(%rsp),%r9
mov    %rcx,%rdx
xor    %eax,%eax
call   1040 <cdflib_dstinv@plt>
mov    0x10(%rsp),%rbx
movapd 0x40(%rsp),%xmm0
ucomisd 0x50(%rsp),%xmm0
movl   $0x0,(%r12)
cmovae %r13,%rbx
lea    0xa0(%rsp),%rbp
lea    0x98(%rsp),%r13
mov    %r12,%rdi
mov    %r15,%rsi
lea    0x38(%rsp),%rdx
lea    0x30(%rsp),%rcx
lea    0x90(%rsp),%r8
xor    %eax,%eax
call   1060 <cdflib_dinvr@plt>
mov    (%r12),%eax
cmp    $0x1,%eax
jne    161b <cdflib_cdfchi+0x4db>
mov    0x68(%rsp),%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <cdflib_cumchi@plt>
movapd 0x40(%rsp),%xmm0
ucomisd 0x50(%rsp),%xmm0
mov    %r13,%rax
cmovae %rbp,%rax
movsd  (%rax),%xmm0
subsd  (%rbx),%xmm0
movsd  %xmm0,0x38(%rsp)
addsd  0xb0(%rsp),%xmm0
ucomisd 0xa31(%rip),%xmm0
jbe    1578 <cdflib_cdfchi+0x438>
movl   $0xa,(%r12)
jmp    12bb <cdflib_cdfchi+0x17b>
cmp    $0xffffffff,%eax
jne    12bb <cdflib_cdfchi+0x17b>
cmpq   $0x0,0x30(%rsp)
je     1640 <cdflib_cdfchi+0x500>
movl   $0x1,(%r12)
movq   $0x0,(%r14)
jmp    12bb <cdflib_cdfchi+0x17b>
cmp    $0xffffffff,%eax
jne    12bb <cdflib_cdfchi+0x17b>
cmpq   $0x0,0x30(%rsp)
je     1640 <cdflib_cdfchi+0x500>
movl   $0x1,(%r12)
movabs $0x1a56e1fc2f8f359,%rax
6e a5 01
jmp    1652 <cdflib_cdfchi+0x512>
movl   $0x2,(%r12)
movabs $0x7e37e43c8800759c,%rax
e4 37 7e
mov    %rax,(%r14)
jmp    12bb <cdflib_cdfchi+0x17b>

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

LLVM IR (-O2):
define void @cdflib_cdfchi(i32* nocapture %0, double* %1, double* %2, double* %3, double* %4, i32* %5, double* nocapture writeonly %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i64
%15 = alloca i64
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = bitcast double* %8 to i8*
store double 0.000000e+00, double* %8
%24 = bitcast double* %9 to i8*
store double 5.000000e-01, double* %9
%25 = bitcast double* %10 to i8*
store double 5.000000e+00, double* %10
%26 = bitcast double* %11 to i8*
%27 = bitcast double* %12 to i8*
%28 = bitcast double* %13 to i8*
%29 = bitcast i64* %14 to i8*
%30 = bitcast i64* %15 to i8*
%31 = bitcast double* %16 to i8*
%32 = bitcast double* %17 to i8*
%33 = bitcast double* %18 to i8*
%34 = bitcast double* %19 to i8*
%35 = bitcast double* %20 to i8*
%36 = bitcast double* %21 to i8*
%37 = bitcast double* %22 to i8*
store i32 0, i32* %5
store double 0.000000e+00, double* %6
%38 = load i32, i32* %0
%39 = add i32 %38, -4
%40 = icmp ult i32 %39, -3
br i1 %40, label %41, label %44
41: ; preds = %7
%42 = icmp slt i32 %38, 1
%43 = select i1 %42, double 1.000000e+00, double 3.000000e+00
store double %43, double* %6
store i32 -1, i32* %5
br label %141
44: ; preds = %7
%45 = icmp eq i32 %38, 1
br i1 %45, label %66, label %46
46: ; preds = %44
%47 = load double, double* %1
%48 = fcmp olt double %47, 0.000000e+00
%49 = fcmp ogt double %47, 1.000000e+00
%50 = or i1 %48, %49
br i1 %50, label %51, label %53
51: ; preds = %46
%52 = select i1 %48, double 0.000000e+00, double 1.000000e+00
store double %52, double* %6
store i32 -2, i32* %5
br label %141
53: ; preds = %46
%54 = load double, double* %2
%55 = fcmp ole double %54, 0.000000e+00
%56 = fcmp ogt double %54, 1.000000e+00
%57 = or i1 %55, %56
br i1 %57, label %58, label %61
58: ; preds = %53
%59 = fcmp ugt double %54, 0.000000e+00
%60 = select i1 %59, double 1.000000e+00, double 0.000000e+00
store double %60, double* %6
store i32 -3, i32* %5
br label %141
61: ; preds = %53
%62 = icmp eq i32 %38, 2
br i1 %62, label %70, label %63
63: ; preds = %61
%64 = load double, double* %3
%65 = fcmp olt double %64, 0.000000e+00
br i1 %65, label %69, label %77
66: ; preds = %44
%67 = load double, double* %3
%68 = fcmp olt double %67, 0.000000e+00
br i1 %68, label %69, label %73
69: ; preds = %66, %63
store i32 -4, i32* %5
br label %141
70: ; preds = %61
%71 = load double, double* %4
%72 = fcmp ugt double %71, 0.000000e+00
br i1 %72, label %77, label %76
73: ; preds = %66
%74 = load double, double* %4
%75 = fcmp ugt double %74, 0.000000e+00
br i1 %75, label %92, label %76
76: ; preds = %73, %70
store i32 -5, i32* %5
br label %141
77: ; preds = %70, %63
%78 = fadd double %47, %54
%79 = fadd double %78, -5.000000e-01
%80 = fadd double %79, -5.000000e-01
%81 = tail call double @llvm.fabs.f64(double %80)
%82 = tail call i32 (i32, ...) bitcast (i32 (...)* @dpmpar to i32 (i32, ...)*)(i32 1)
%83 = sitofp i32 %82 to double
%84 = fmul double %83, 3.000000e+00
%85 = fcmp ogt double %81, %84
br i1 %85, label %86, label %89
86: ; preds = %77
%87 = fcmp olt double %78, 0.000000e+00
%88 = select i1 %87, double 0.000000e+00, double 1.000000e+00
store double %88, double* %6
store i32 3, i32* %5
br label %141
89: ; preds = %77
%90 = load i32, i32* %0
%91 = icmp eq i32 %90, 1
br i1 %91, label %92, label %94
92: ; preds = %73, %89
store i32 0, i32* %5
%93 = tail call i32 (double*, double*, double*, double*, ...) bitcast (i32 (...)* @cdflib_cumchi to i32 (double*, double*, double*, double*, ...)*)(double* %3, double* %4, double* %1, double* %2)
br label %141
94: ; preds = %89
%95 = load double, double* %1
%96 = load double, double* %2
%97 = fcmp ole double %95, %96
%98 = select i1 %97, double %95, double %96
switch i32 %90, label %141 [
i32 3, label %120
i32 2, label %99
]
99: ; preds = %94
store double 5.000000e+00, double* %3
store double 1.000000e+300, double* %16
store double 1.000000e-50, double* %17
store double 1.000000e-08, double* %18
%100 = call i32 (double*, double*, double*, double*, double*, double*, double*, ...) bitcast (i32 (...)* @cdflib_dstinv to i32 (double*, double*, double*, double*, double*, double*, double*, ...)*)(double* %8, double* %16, double* %9, double* %9, double* %10, double* %17, double* %18)
store i32 0, i32* %5
%101 = select i1 %97, double* %1, double* %2
br label %102
102: ; preds = %105, %99
%103 = call i32 (i32*, double*, double*, i64*, i64*, ...) bitcast (i32 (...)* @cdflib_dinvr to i32 (i32*, double*, double*, i64*, i64*, ...)*)(i32* %5, double* %3, double* %11, i64* %15, i64* %14)
%104 = load i32, i32* %5
switch i32 %104, label %141 [
i32 1, label %105
i32 -1, label %115
]
105: ; preds = %102
%106 = call i32 (double*, double*, double*, double*, ...) bitcast (i32 (...)* @cdflib_cumchi to i32 (double*, double*, double*, double*, ...)*)(double* %3, double* %4, double* %12, double* %13)
%107 = load double, double* %13
%108 = load double, double* %12
%109 = select i1 %97, double %108, double %107
%110 = load double, double* %101
%111 = fsub double %109, %110
store double %111, double* %11
%112 = fadd double %98, %111
%113 = fcmp ogt double %112, 1.500000e+00
br i1 %113, label %114, label %102
114: ; preds = %105
store i32 10, i32* %5
br label %141
115: ; preds = %102
%116 = load i64, i64* %15
%117 = icmp eq i64 %116, 0
br i1 %117, label %119, label %118
118: ; preds = %115
store i32 1, i32* %5
store double 0.000000e+00, double* %6
br label %141
119: ; preds = %115
store i32 2, i32* %5
store double 1.000000e+300, double* %6
br label %141
120: ; preds = %94
store double 5.000000e+00, double* %4
store double 1.000000e-300, double* %19
store double 1.000000e+300, double* %20
store double 1.000000e-50, double* %21
store double 1.000000e-08, double* %22
%121 = call i32 (double*, double*, double*, double*, double*, double*, double*, ...) bitcast (i32 (...)* @cdflib_dstinv to i32 (double*, double*, double*, double*, double*, double*, double*, ...)*)(double* %19, double* %20, double* %9, double* %9, double* %10, double* %21, double* %22)
store i32 0, i32* %5
%122 = select i1 %97, double* %1, double* %2
br label %123
123: ; preds = %126, %120
%124 = call i32 (i32*, double*, double*, i64*, i64*, ...) bitcast (i32 (...)* @cdflib_dinvr to i32 (i32*, double*, double*, i64*, i64*, ...)*)(i32* %5, double* %4, double* %11, i64* %15, i64* %14)
%125 = load i32, i32* %5
switch i32 %125, label %141 [
i32 1, label %126
i32 -1, label %136
]
126: ; preds = %123
%127 = call i32 (double*, double*, double*, double*, ...) bitcast (i32 (...)* @cdflib_cumchi to i32 (double*, double*, double*, double*, ...)*)(double* %3, double* %4, double* %12, double* %13)
%128 = load double, double* %13
%129 = load double, double* %12
%130 = select i1 %97, double %129, double %128
%131 = load double, double* %122
%132 = fsub double %130, %131
store double %132, double* %11
%133 = fadd double %98, %132
%134 = fcmp ogt double %133, 1.500000e+00
br i1 %134, label %135, label %123
135: ; preds = %126
store i32 10, i32* %5
br label %141
136: ; preds = %123
%137 = load i64, i64* %15
%138 = icmp eq i64 %137, 0
br i1 %138, label %140, label %139
139: ; preds = %136
store i32 1, i32* %5
store double 1.000000e-300, double* %6
br label %141
140: ; preds = %136
store i32 2, i32* %5
store double 1.000000e+300, double* %6
br label %141
141: ; preds = %102, %123, %92, %119, %118, %139, %140, %94, %135, %114, %86, %76, %69, %58, %51, %41
ret void
}