void cdflib_cdfgam(const int *which, double *p, double *q, double *x,
                   double *shape, double *scale, 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 K5 = 0.5e0;
  double K6 = 5.0e0;
  double xx, fx, xscale, cum, ccum, pq, porq = 0;
  int ierr;
  unsigned long qhi, qleft, qporq;
  double T2, T3, T4, T7, T8, T9;
  *status = 0;
  *bound = 0.0;
  if (!(*which < 1 || *which > 4)) {
    goto S30;
  }
  if (!(*which < 1)) {
    goto S10;
  }
  *bound = 1.0e0;
  goto S20;
S10:
  *bound = 4.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 (!(*shape <= 0.0e0)) {
    goto S140;
  }
  *bound = 0.0e0;
  *status = -5;
  return;
S150:
S140:
  if (*which == 4) {
    goto S170;
  }
  if (!(*scale <= 0.0e0)) {
    goto S160;
  }
  *bound = 0.0e0;
  *status = -6;
  return;
S170:
S160:
  if (*which == 1) {
    goto S210;
  }
  pq = *p + *q;
  if (!(fabs(pq - 0.5e0 - 0.5e0) > 3.0e0 * dpmpar(K1))) {
    goto S200;
  }
  if (!(pq < 0.0e0)) {
    goto S180;
  }
  *bound = 0.0e0;
  goto S190;
S180:
  *bound = 1.0e0;
S190:
  *status = 3;
  return;
S210:
S200:
  if (*which == 1) {
    goto S240;
  }
  qporq = *p <= *q;
  if (!qporq) {
    goto S220;
  }
  porq = *p;
  goto S230;
S220:
  porq = *q;
S240:
S230:
  if (1 == *which) {
    *status = 0;
    xscale = *x * *scale;
    cdflib_cumgam(&xscale, shape, p, q);
    if (porq > 1.5e0) {
      *status = 10;
    }
  } else if (2 == *which) {
    T2 = -1.0e0;
    cdflib_gamma_inc_inv(shape, &xx, &T2, p, q, &ierr);
    if (ierr < 0.0e0) {
      *status = 10;
      return;
    } else {
      *x = xx / *scale;
      *status = 0;
    }
  } else if (3 == *which) {
    *shape = 5.0e0;
    xscale = *x * *scale;
    T3 = zero;
    T4 = inf;
    T7 = atol;
    T8 = tol;
    cdflib_dstinv(&T3, &T4, &K5, &K5, &K6, &T7, &T8);
    *status = 0;
    cdflib_dinvr(status, shape, &fx, &qleft, &qhi);
  S250:
    if (!(*status == 1)) {
      goto S290;
    }
    cdflib_cumgam(&xscale, shape, &cum, &ccum);
    if (!qporq) {
      goto S260;
    }
    fx = cum - *p;
    goto S270;
  S260:
    fx = ccum - *q;
  S270:
    if (!((qporq && cum > 1.5e0) || (!qporq && ccum > 1.5e0))) {
      goto S280;
    }
    *status = 10;
    return;
  S280:
    cdflib_dinvr(status, shape, &fx, &qleft, &qhi);
    goto S250;
  S290:
    if (!(*status == -1)) {
      goto S320;
    }
    if (!qleft) {
      goto S300;
    }
    *status = 1;
    *bound = zero;
    goto S310;
  S300:
    *status = 2;
    *bound = inf;
  S320:
  S310:;
  } else if (4 == *which) {
    T9 = -1.0e0;
    cdflib_gamma_inc_inv(shape, &xx, &T9, p, q, &ierr);
    if (ierr < 0.0e0) {
      *status = 10;
      return;
    } else {
      *scale = xx / *x;
      *status = 0;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<cdflib_cdfgam>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    0x18(%rbp),%rax
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)
movsd  0xe85(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe70(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jl     11d1 <cdflib_cdfgam+0x81>
mov    -0x8(%rbp),%rax
cmpl   $0x4,(%rax)
jg     11d1 <cdflib_cdfgam+0x81>
jmp    1217 <cdflib_cdfgam+0xc7>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jl     11e3 <cdflib_cdfgam+0x93>
jmp    11f8 <cdflib_cdfgam+0xa8>
mov    0x18(%rbp),%rax
movsd  0xe21(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1208 <cdflib_cdfgam+0xb8>
mov    0x18(%rbp),%rax
movsd  0xe4c(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    18f8 <cdflib_cdfgam+0x7a8>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1229 <cdflib_cdfgam+0xd9>
jmp    129e <cdflib_cdfgam+0x14e>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
ja     1259 <cdflib_cdfgam+0x109>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xdc6(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1259 <cdflib_cdfgam+0x109>
jmp    12a3 <cdflib_cdfgam+0x153>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
ja     126f <cdflib_cdfgam+0x11f>
jmp    127f <cdflib_cdfgam+0x12f>
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    128f <cdflib_cdfgam+0x13f>
mov    0x18(%rbp),%rax
movsd  0xd85(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0xfffffffe,(%rax)
jmp    18f8 <cdflib_cdfgam+0x7a8>
jmp    12a3 <cdflib_cdfgam+0x153>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    12b5 <cdflib_cdfgam+0x165>
jmp    132a <cdflib_cdfgam+0x1da>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    12e5 <cdflib_cdfgam+0x195>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xd3a(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     12e5 <cdflib_cdfgam+0x195>
jmp    132f <cdflib_cdfgam+0x1df>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    12fb <cdflib_cdfgam+0x1ab>
jmp    130b <cdflib_cdfgam+0x1bb>
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    131b <cdflib_cdfgam+0x1cb>
mov    0x18(%rbp),%rax
movsd  0xcf9(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0xfffffffd,(%rax)
jmp    18f8 <cdflib_cdfgam+0x7a8>
jmp    132f <cdflib_cdfgam+0x1df>
mov    -0x8(%rbp),%rax
cmpl   $0x2,(%rax)
jne    1341 <cdflib_cdfgam+0x1f1>
jmp    1371 <cdflib_cdfgam+0x221>
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
ja     1357 <cdflib_cdfgam+0x207>
jmp    1376 <cdflib_cdfgam+0x226>
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0xfffffffc,(%rax)
jmp    18f8 <cdflib_cdfgam+0x7a8>
jmp    1376 <cdflib_cdfgam+0x226>
mov    -0x8(%rbp),%rax
cmpl   $0x3,(%rax)
jne    1388 <cdflib_cdfgam+0x238>
jmp    13b8 <cdflib_cdfgam+0x268>
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    139e <cdflib_cdfgam+0x24e>
jmp    13bd <cdflib_cdfgam+0x26d>
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0xfffffffb,(%rax)
jmp    18f8 <cdflib_cdfgam+0x7a8>
jmp    13bd <cdflib_cdfgam+0x26d>
mov    -0x8(%rbp),%rax
cmpl   $0x4,(%rax)
jne    13cf <cdflib_cdfgam+0x27f>
jmp    13ff <cdflib_cdfgam+0x2af>
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    13e5 <cdflib_cdfgam+0x295>
jmp    1404 <cdflib_cdfgam+0x2b4>
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0xfffffffa,(%rax)
jmp    18f8 <cdflib_cdfgam+0x7a8>
jmp    1404 <cdflib_cdfgam+0x2b4>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1416 <cdflib_cdfgam+0x2c6>
jmp    14d0 <cdflib_cdfgam+0x380>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  0xbd0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xbc4(%rip),%xmm1
subsd  %xmm1,%xmm0
movaps 0xc11(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <dpmpar@plt>
movsd  -0xd0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0xb9d(%rip),%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
ja     148e <cdflib_cdfgam+0x33e>
jmp    14d5 <cdflib_cdfgam+0x385>
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
ja     14a1 <cdflib_cdfgam+0x351>
jmp    14b1 <cdflib_cdfgam+0x361>
mov    0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    14c1 <cdflib_cdfgam+0x371>
mov    0x18(%rbp),%rax
movsd  0xb53(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0x3,(%rax)
jmp    18f8 <cdflib_cdfgam+0x7a8>
jmp    14d5 <cdflib_cdfgam+0x385>
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jne    14e7 <cdflib_cdfgam+0x397>
jmp    153e <cdflib_cdfgam+0x3ee>
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,-0x98(%rbp)
cmpq   $0x0,-0x98(%rbp)
jne    151f <cdflib_cdfgam+0x3cf>
jmp    1531 <cdflib_cdfgam+0x3e1>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1543 <cdflib_cdfgam+0x3f3>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1543 <cdflib_cdfgam+0x3f3>
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
cmp    (%rcx),%eax
jne    15b0 <cdflib_cdfgam+0x460>
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x58(%rbp),%rdi
mov    $0x0,%al
call   1030 <cdflib_cumgam@plt>
movsd  -0x78(%rbp),%xmm0
movsd  0xab1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15ab <cdflib_cdfgam+0x45b>
mov    0x10(%rbp),%rax
movl   $0xa,(%rax)
jmp    18f3 <cdflib_cdfgam+0x7a3>
mov    -0x8(%rbp),%rcx
mov    $0x2,%eax
cmp    (%rcx),%eax
jne    1638 <cdflib_cdfgam+0x4e8>
movsd  0xa57(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    -0x48(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
lea    -0x7c(%rbp),%r9
mov    $0x0,%al
call   1060 <cdflib_gamma_inc_inv@plt>
cvtsi2sdl -0x7c(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1614 <cdflib_cdfgam+0x4c4>
mov    0x10(%rbp),%rax
movl   $0xa,(%rax)
jmp    18f8 <cdflib_cdfgam+0x7a8>
movsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
divsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    18ee <cdflib_cdfgam+0x79e>
mov    -0x8(%rbp),%rcx
mov    $0x3,%eax
cmp    (%rcx),%eax
jne    185c <cdflib_cdfgam+0x70c>
mov    -0x28(%rbp),%rax
movsd  0x9ab(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0x9ca(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0x9b2(%rip),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0x99a(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0x982(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
lea    -0xa8(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
lea    -0x38(%rbp),%rcx
lea    -0x40(%rbp),%r8
lea    -0xb8(%rbp),%r9
lea    -0xc0(%rbp),%rax
mov    %rcx,%rdx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1050 <cdflib_dstinv@plt>
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    -0x90(%rbp),%rcx
lea    -0x88(%rbp),%r8
mov    $0x0,%al
call   1070 <cdflib_dinvr@plt>
mov    0x10(%rbp),%rax
cmpl   $0x1,(%rax)
je     171d <cdflib_cdfgam+0x5cd>
jmp    17f4 <cdflib_cdfgam+0x6a4>
mov    -0x28(%rbp),%rsi
lea    -0x58(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    -0x68(%rbp),%rcx
mov    $0x0,%al
call   1030 <cdflib_cumgam@plt>
cmpq   $0x0,-0x98(%rbp)
jne    1747 <cdflib_cdfgam+0x5f7>
jmp    175e <cdflib_cdfgam+0x60e>
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1770 <cdflib_cdfgam+0x620>
movsd  -0x68(%rbp),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpq   $0x0,-0x98(%rbp)
je     1795 <cdflib_cdfgam+0x645>
movsd  -0x60(%rbp),%xmm0
movsd  0x8bd(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     17bf <cdflib_cdfgam+0x66f>
cmpq   $0x0,-0x98(%rbp)
jne    17ba <cdflib_cdfgam+0x66a>
movsd  -0x68(%rbp),%xmm0
movsd  0x898(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     17bf <cdflib_cdfgam+0x66f>
jmp    17ce <cdflib_cdfgam+0x67e>
mov    0x10(%rbp),%rax
movl   $0xa,(%rax)
jmp    18f8 <cdflib_cdfgam+0x7a8>
mov    0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    -0x90(%rbp),%rcx
lea    -0x88(%rbp),%r8
mov    $0x0,%al
call   1070 <cdflib_dinvr@plt>
jmp    170b <cdflib_cdfgam+0x5bb>
mov    0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1806 <cdflib_cdfgam+0x6b6>
jmp    1852 <cdflib_cdfgam+0x702>
cmpq   $0x0,-0x90(%rbp)
jne    1819 <cdflib_cdfgam+0x6c9>
jmp    1838 <cdflib_cdfgam+0x6e8>
mov    0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    0x18(%rbp),%rax
movsd  0x811(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1857 <cdflib_cdfgam+0x707>
mov    0x10(%rbp),%rax
movl   $0x2,(%rax)
mov    0x18(%rbp),%rax
movsd  0x7ea(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1857 <cdflib_cdfgam+0x707>
jmp    18e9 <cdflib_cdfgam+0x799>
mov    -0x8(%rbp),%rcx
mov    $0x4,%eax
cmp    (%rcx),%eax
jne    18e4 <cdflib_cdfgam+0x794>
movsd  0x7ab(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    -0x48(%rbp),%rsi
lea    -0xc8(%rbp),%rdx
lea    -0x7c(%rbp),%r9
mov    $0x0,%al
call   1060 <cdflib_gamma_inc_inv@plt>
cvtsi2sdl -0x7c(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    18c0 <cdflib_cdfgam+0x770>
mov    0x10(%rbp),%rax
movl   $0xa,(%rax)
jmp    18f8 <cdflib_cdfgam+0x7a8>
movsd  -0x48(%rbp),%xmm0
mov    -0x20(%rbp),%rax
divsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    18e4 <cdflib_cdfgam+0x794>
jmp    18e9 <cdflib_cdfgam+0x799>
jmp    18ee <cdflib_cdfgam+0x79e>
jmp    18f3 <cdflib_cdfgam+0x7a3>
jmp    18f8 <cdflib_cdfgam+0x7a8>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_cdfgam>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    0xe8(%rsp),%rsi
mov    0xe0(%rsp),%rdx
movabs $0x3fe0000000000000,%rax
mov    %rax,0x98(%rsp)
movabs $0x4014000000000000,%r12
mov    %r12,0x90(%rsp)
movl   $0x0,(%rdx)
movq   $0x0,(%rsi)
mov    (%rdi),%eax
lea    -0x5(%rax),%ecx
cmp    $0xfffffffb,%ecx
ja     11d7 <cdflib_cdfgam+0x87>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
lea    0xe6d(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rsi)
movl   $0xffffffff,(%rdx)
jmp    13d9 <cdflib_cdfgam+0x289>
mov    %r9,%r13
mov    %rdi,%r14
cmp    $0x1,%eax
jne    11f8 <cdflib_cdfgam+0xa8>
xorpd  %xmm0,%xmm0
ucomisd (%r15),%xmm0
jbe    1242 <cdflib_cdfgam+0xf2>
movl   $0xfffffffc,(%rdx)
jmp    13d9 <cdflib_cdfgam+0x289>
movsd  (%rbx),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     130f <cdflib_cdfgam+0x1bf>
ucomisd 0xdee(%rip),%xmm0
ja     130f <cdflib_cdfgam+0x1bf>
movsd  0x0(%rbp),%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm2,%xmm1
jae    132f <cdflib_cdfgam+0x1df>
ucomisd 0xdcd(%rip),%xmm2
ja     132f <cdflib_cdfgam+0x1df>
cmp    $0x2,%eax
jne    134f <cdflib_cdfgam+0x1ff>
xorpd  %xmm1,%xmm1
ucomisd (%r8),%xmm1
jae    13d3 <cdflib_cdfgam+0x283>
movsd  0x0(%r13),%xmm0
ucomisd %xmm0,%xmm1
jae    1373 <cdflib_cdfgam+0x223>
cmp    $0x1,%eax
je     13a0 <cdflib_cdfgam+0x250>
movsd  (%rbx),%xmm0
movsd  0x0(%rbp),%xmm2
mov    %r8,0x18(%rsp)
mov    %rbx,0x28(%rsp)
mov    %rbp,0x30(%rsp)
addsd  %xmm0,%xmm2
movapd %xmm2,0x40(%rsp)
movsd  0xd74(%rip),%xmm0
addsd  %xmm0,%xmm2
addsd  %xmm0,%xmm2
andpd  0xd7c(%rip),%xmm2
movapd %xmm2,0x50(%rsp)
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <dpmpar@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xd4b(%rip),%xmm0
movapd 0x50(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    137b <cdflib_cdfgam+0x22b>
xorpd  %xmm0,%xmm0
movapd 0x40(%rsp),%xmm1
cmpltsd %xmm0,%xmm1
movsd  0xd14(%rip),%xmm0
andnpd %xmm0,%xmm1
mov    0xe8(%rsp),%rax
movlpd %xmm1,(%rax)
mov    0xe0(%rsp),%rax
movl   $0x3,(%rax)
jmp    13d9 <cdflib_cdfgam+0x289>
cmpltsd %xmm1,%xmm0
movsd  0xce4(%rip),%xmm1
andnpd %xmm1,%xmm0
movlpd %xmm0,(%rsi)
movl   $0xfffffffe,(%rdx)
jmp    13d9 <cdflib_cdfgam+0x289>
cmpnlesd %xmm1,%xmm2
movsd  0xcc4(%rip),%xmm0
andpd  %xmm2,%xmm0
movlpd %xmm0,(%rsi)
movl   $0xfffffffd,(%rdx)
jmp    13d9 <cdflib_cdfgam+0x289>
xorpd  %xmm1,%xmm1
ucomisd (%r15),%xmm1
ja     11ed <cdflib_cdfgam+0x9d>
xorpd  %xmm1,%xmm1
cmp    $0x3,%eax
jne    13c8 <cdflib_cdfgam+0x278>
ucomisd 0x0(%r13),%xmm1
jb     1273 <cdflib_cdfgam+0x123>
movl   $0xfffffffa,(%rdx)
jmp    13d9 <cdflib_cdfgam+0x289>
mov    (%r14),%eax
cmp    $0x1,%eax
mov    0xe0(%rsp),%rdx
jne    13eb <cdflib_cdfgam+0x29b>
movsd  0x0(%r13),%xmm0
mov    0x30(%rsp),%rbp
mov    0x28(%rsp),%rbx
mov    0x18(%rsp),%r8
movl   $0x0,(%rdx)
mulsd  (%r15),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
mov    %r8,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1030 <cdflib_cumgam@plt>
jmp    13d9 <cdflib_cdfgam+0x289>
ucomisd (%r8),%xmm1
jb     1273 <cdflib_cdfgam+0x123>
movl   $0xfffffffb,(%rdx)
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x2,%eax
je     1450 <cdflib_cdfgam+0x300>
cmp    $0x3,%eax
je     14b3 <cdflib_cdfgam+0x363>
cmp    $0x4,%eax
jne    13d9 <cdflib_cdfgam+0x289>
movabs $0xbff0000000000000,%rax
mov    %rax,0x10(%rsp)
lea    0x20(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x38(%rsp),%r9
mov    0x18(%rsp),%rdi
mov    0x28(%rsp),%rcx
mov    0x30(%rsp),%r8
xor    %eax,%eax
call   1060 <cdflib_gamma_inc_inv@plt>
cmpl   $0x0,0x38(%rsp)
js     1621 <cdflib_cdfgam+0x4d1>
movsd  0x20(%rsp),%xmm0
divsd  (%r15),%xmm0
movsd  %xmm0,0x0(%r13)
jmp    14a0 <cdflib_cdfgam+0x350>
movabs $0xbff0000000000000,%rax
mov    %rax,0x10(%rsp)
lea    0x20(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x38(%rsp),%r9
mov    0x18(%rsp),%rdi
mov    0x28(%rsp),%rcx
mov    0x30(%rsp),%r8
xor    %eax,%eax
call   1060 <cdflib_gamma_inc_inv@plt>
cmpl   $0x0,0x38(%rsp)
js     1621 <cdflib_cdfgam+0x4d1>
movsd  0x20(%rsp),%xmm0
divsd  0x0(%r13),%xmm0
movsd  %xmm0,(%r15)
mov    0xe0(%rsp),%rax
movl   $0x0,(%rax)
jmp    13d9 <cdflib_cdfgam+0x289>
mov    0x28(%rsp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x50(%rsp)
mov    0x30(%rsp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x40(%rsp)
mov    0x18(%rsp),%rbp
mov    %r12,0x0(%rbp)
movsd  (%r15),%xmm0
mulsd  0x0(%r13),%xmm0
movsd  %xmm0,0x10(%rsp)
movabs $0x1a56e1fc2f8f359,%r12
6e a5 01
mov    %r12,0x78(%rsp)
movabs $0x7e37e43c8800759c,%r13
e4 37 7e
mov    %r13,0x70(%rsp)
movabs $0x358dee7a4ad4b81f,%rax
ee 8d 35
mov    %rax,0x68(%rsp)
movabs $0x3e45798ee2308c3a,%rax
79 45 3e
mov    %rax,0x60(%rsp)
lea    0x60(%rsp),%rax
mov    %rax,(%rsp)
lea    0x78(%rsp),%rdi
lea    0x70(%rsp),%rsi
lea    0x98(%rsp),%rcx
lea    0x90(%rsp),%r8
lea    0x68(%rsp),%r9
mov    %rcx,%rdx
xor    %eax,%eax
call   1050 <cdflib_dstinv@plt>
mov    0xe0(%rsp),%rax
movl   $0x0,(%rax)
lea    0x80(%rsp),%r15
lea    0xa0(%rsp),%rbx
lea    0x88(%rsp),%r14
jmp    15b1 <cdflib_cdfgam+0x461>
movsd  0x38(%rsp),%xmm0
ucomisd 0xa89(%rip),%xmm0
mov    0x28(%rsp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    0xe0(%rsp),%rax
mov    0x18(%rsp),%rbp
ja     165e <cdflib_cdfgam+0x50e>
mov    0xe0(%rsp),%rdi
mov    %rbp,%rsi
lea    0x20(%rsp),%rdx
mov    %r15,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1070 <cdflib_dinvr@plt>
mov    0xe0(%rsp),%rcx
mov    (%rcx),%eax
cmp    $0x1,%eax
jne    1634 <cdflib_cdfgam+0x4e4>
lea    0x10(%rsp),%rdi
mov    %rbp,%rsi
lea    0x38(%rsp),%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <cdflib_cumgam@plt>
movsd  0x40(%rsp),%xmm0
ucomisd 0x50(%rsp),%xmm0
jae    1581 <cdflib_cdfgam+0x431>
movsd  0x88(%rsp),%xmm0
ucomisd 0xa01(%rip),%xmm0
mov    0x30(%rsp),%rax
jmp    1594 <cdflib_cdfgam+0x444>
mov    0xe0(%rsp),%rax
movl   $0xa,(%rax)
jmp    13d9 <cdflib_cdfgam+0x289>
cmp    $0xffffffff,%eax
jne    13d9 <cdflib_cdfgam+0x289>
cmpq   $0x0,0x80(%rsp)
je     1669 <cdflib_cdfgam+0x519>
movl   $0x1,(%rcx)
mov    0xe8(%rsp),%rax
mov    %r12,(%rax)
jmp    13d9 <cdflib_cdfgam+0x289>
movl   $0xa,(%rax)
jmp    13d9 <cdflib_cdfgam+0x289>
movl   $0x2,(%rcx)
mov    0xe8(%rsp),%rax
mov    %r13,(%rax)
jmp    13d9 <cdflib_cdfgam+0x289>

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

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