void cdflib_gamma_rat1(const double *a, const double *x, const double *r,
                       double *p, double *q, const double *eps) {
  static const int K2 = 0;
  double a2n, a2nm1, am0, an, an0, b2n, b2nm1, c, cma, g, h, j, l, sum, t, tol,
      w, z, T1, T3;
  if (*a * *x == 0.0e0) {
    goto S120;
  }
  if (*a == 0.5e0) {
    goto S100;
  }
  if (*x < 1.1e0) {
    goto S10;
  }
  goto S60;
S10:
  an = 3.0e0;
  c = *x;
  sum = *x / (*a + 3.0e0);
  tol = 0.1e0 * *eps / (*a + 1.0e0);
S20:
  an += 1.0e0;
  c = -(c * (*x / an));
  t = c / (*a + an);
  sum += t;
  if (fabs(t) > tol) {
    goto S20;
  }
  j = *a * *x *
      ((sum / 6.0e0 - 0.5e0 / (*a + 2.0e0)) * *x + 1.0e0 / (*a + 1.0e0));
  z = *a * log(*x);
  h = cdflib_gam1(a);
  g = 1.0e0 + h;
  if (*x < 0.25e0) {
    goto S30;
  }
  if (*a < *x / 2.59e0) {
    goto S50;
  }
  goto S40;
S30:
  if (z > -.13394e0) {
    goto S50;
  }
S40:
  w = exp(z);
  *p = w * g * (0.5e0 + (0.5e0 - j));
  *q = 0.5e0 + (0.5e0 - *p);
  return;
S50:
  l = cdflib_rexp(&z);
  w = 0.5e0 + (0.5e0 + l);
  *q = (w * j - l) * g - h;
  if (*q < 0.0e0) {
    goto S90;
  }
  *p = 0.5e0 + (0.5e0 - *q);
  return;
S60:
  a2nm1 = a2n = 1.0e0;
  b2nm1 = *x;
  b2n = *x + (1.0e0 - *a);
  c = 1.0e0;
S70:
  a2nm1 = *x * a2n + c * a2nm1;
  b2nm1 = *x * b2n + c * b2nm1;
  am0 = a2nm1 / b2nm1;
  c += 1.0e0;
  cma = c - *a;
  a2n = a2nm1 + cma * a2n;
  b2n = b2nm1 + cma * b2n;
  an0 = a2n / b2n;
  if (fabs(an0 - am0) >= *eps * an0) {
    goto S70;
  }
  *q = *r * an0;
  *p = 0.5e0 + (0.5e0 - *q);
  return;
S80:
  *p = 0.0e0;
  *q = 1.0e0;
  return;
S90:
  *p = 1.0e0;
  *q = 0.0e0;
  return;
S100:
  if (*x >= 0.25e0) {
    goto S110;
  }
  T1 = sqrt(*x);
  *p = cdflib_error_f(&T1);
  *q = 0.5e0 + (0.5e0 - *p);
  return;
S110:
  T3 = sqrt(*x);
  *q = cdflib_error_fc(&K2, &T3);
  *p = 0.5e0 + (0.5e0 - *q);
  return;
S120:
  if (*x <= *a) {
    goto S80;
  }
  goto S90;
}


x86 assembly (clang, -O0):
<cdflib_gamma_rat1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11bb <cdflib_gamma_rat1+0x4b>
jp     11bb <cdflib_gamma_rat1+0x4b>
jmp    184c <cdflib_gamma_rat1+0x6dc>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe35(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11e0 <cdflib_gamma_rat1+0x70>
jp     11e0 <cdflib_gamma_rat1+0x70>
jmp    1776 <cdflib_gamma_rat1+0x606>
mov    -0x10(%rbp),%rax
movsd  0xe1c(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    11fb <cdflib_gamma_rat1+0x8b>
jmp    1200 <cdflib_gamma_rat1+0x90>
jmp    15b0 <cdflib_gamma_rat1+0x440>
movsd  0xe18(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xdf2(%rip),%xmm1
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  0xdce(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xdb6(%rip),%xmm1
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xd9e(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
divsd  -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
addsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
addsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movaps 0xd5d(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0xb0(%rbp),%xmm0
ff
jbe    130a <cdflib_gamma_rat1+0x19a>
jmp    126a <cdflib_gamma_rat1+0xfa>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0xd0e(%rip),%xmm2
divsd  %xmm2,%xmm1
mov    -0x8(%rbp),%rax
movsd  0xcf6(%rip),%xmm3
addsd  (%rax),%xmm3
movsd  0xcba(%rip),%xmm2
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x8(%rbp),%rax
movsd  0xcae(%rip),%xmm4
addsd  (%rax),%xmm4
movsd  0xca2(%rip),%xmm2
divsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <cdflib_gam1@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xc37(%rip),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xc36(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1401 <cdflib_gamma_rat1+0x291>
jmp    1431 <cdflib_gamma_rat1+0x2c1>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xc27(%rip),%xmm2
divsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    142c <cdflib_gamma_rat1+0x2bc>
jmp    14c8 <cdflib_gamma_rat1+0x358>
jmp    1455 <cdflib_gamma_rat1+0x2e5>
movsd  -0xc0(%rbp),%xmm0
ff
movsd  0xc07(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1450 <cdflib_gamma_rat1+0x2e0>
jmp    14c8 <cdflib_gamma_rat1+0x358>
jmp    1455 <cdflib_gamma_rat1+0x2e5>
movsd  -0xc0(%rbp),%xmm0
ff
call   1050 <exp@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  -0x80(%rbp),%xmm0
movsd  0xb81(%rip),%xmm2
subsd  -0x90(%rbp),%xmm2
ff
movsd  0xb71(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xb55(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0xb49(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1870 <cdflib_gamma_rat1+0x700>
lea    -0xc0(%rbp),%rdi
mov    $0x0,%al
call   1040 <cdflib_rexp@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xb16(%rip),%xmm1
addsd  -0x98(%rbp),%xmm1
ff
movsd  0xb06(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    1587 <cdflib_gamma_rat1+0x417>
jmp    1756 <cdflib_gamma_rat1+0x5e6>
mov    -0x28(%rbp),%rax
movsd  0xa6d(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0xa61(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1870 <cdflib_gamma_rat1+0x700>
movsd  0xa58(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xa4b(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xa25(%rip),%xmm1
subsd  (%rax),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xa10(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0x9ac(%rip),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x68(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movaps 0x978(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x58(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     16f8 <cdflib_gamma_rat1+0x588>
jmp    1605 <cdflib_gamma_rat1+0x495>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x8e7(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0x8db(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1870 <cdflib_gamma_rat1+0x700>
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x8c3(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1870 <cdflib_gamma_rat1+0x700>
mov    -0x20(%rbp),%rax
movsd  0x8ae(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1870 <cdflib_gamma_rat1+0x700>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x8a2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1795 <cdflib_gamma_rat1+0x625>
jmp    17ed <cdflib_gamma_rat1+0x67d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
lea    -0xc8(%rbp),%rdi
mov    $0x0,%al
call   1090 <cdflib_error_f@plt>
cvtsi2sd %eax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0x830(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0x824(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1870 <cdflib_gamma_rat1+0x700>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
lea    0x857(%rip),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x0,%al
call   1080 <cdflib_error_fc@plt>
cvtsi2sd %eax,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x7d1(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0x7c5(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1870 <cdflib_gamma_rat1+0x700>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     186b <cdflib_gamma_rat1+0x6fb>
jmp    1736 <cdflib_gamma_rat1+0x5c6>
jmp    1756 <cdflib_gamma_rat1+0x5e6>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_gamma_rat1>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%r15
mov    %rcx,%r14
movsd  (%rdi),%xmm12
movsd  (%rsi),%xmm11
movapd %xmm12,%xmm4
mulsd  %xmm11,%xmm4
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm4
jne    11c5 <cdflib_gamma_rat1+0x55>
jp     11c5 <cdflib_gamma_rat1+0x55>
ucomisd %xmm11,%xmm12
jae    1243 <cdflib_gamma_rat1+0xd3>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r14)
movq   $0x0,(%r15)
jmp    153a <cdflib_gamma_rat1+0x3ca>
ucomisd 0xe32(%rip),%xmm12
jne    125c <cdflib_gamma_rat1+0xec>
jp     125c <cdflib_gamma_rat1+0xec>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm11
jb     13fc <cdflib_gamma_rat1+0x28c>
xorps  %xmm0,%xmm0
sqrtsd %xmm11,%xmm0
ucomisd 0xe46(%rip),%xmm11
jb     1423 <cdflib_gamma_rat1+0x2b3>
movsd  %xmm0,0x10(%rsp)
lea    0xe73(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1080 <cdflib_error_fc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r15)
movsd  0xdd3(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%r14)
jmp    153a <cdflib_gamma_rat1+0x3ca>
movq   $0x0,(%r14)
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r15)
jmp    153a <cdflib_gamma_rat1+0x3ca>
movsd  0xda4(%rip),%xmm0
ucomisd %xmm11,%xmm0
jbe    145f <cdflib_gamma_rat1+0x2ef>
mov    %rsi,%rbx
mov    %rdi,%r12
movsd  0xd9b(%rip),%xmm2
movapd %xmm12,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm11,%xmm0
divsd  %xmm1,%xmm0
movsd  (%r9),%xmm3
mulsd  0xd84(%rip),%xmm3
movsd  0xd6b(%rip),%xmm8
addsd  %xmm12,%xmm8
divsd  %xmm8,%xmm3
movsd  0xd58(%rip),%xmm10
movapd 0xdaf(%rip),%xmm9
movapd 0xd97(%rip),%xmm5
movapd %xmm11,%xmm6
xchg   %ax,%ax
xorpd  %xmm9,%xmm6
addsd  %xmm10,%xmm2
movapd %xmm11,%xmm7
divsd  %xmm2,%xmm7
mulsd  %xmm7,%xmm6
movapd %xmm12,%xmm7
addsd  %xmm2,%xmm7
movapd %xmm6,%xmm1
divsd  %xmm7,%xmm1
addsd  %xmm1,%xmm0
andpd  %xmm5,%xmm1
ucomisd %xmm3,%xmm1
ja     12d0 <cdflib_gamma_rat1+0x160>
divsd  0xd1a(%rip),%xmm0
movsd  0xd1a(%rip),%xmm1
addsd  %xmm12,%xmm1
movsd  0xd15(%rip),%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm10,%xmm0
divsd  %xmm8,%xmm0
mulsd  %xmm11,%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm4
movsd  %xmm4,0x20(%rsp)
movapd %xmm11,%xmm0
movsd  %xmm12,0x8(%rsp)
call   1060 <log@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <cdflib_gam1@plt>
movsd  0xc93(%rip),%xmm2
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
addsd  %xmm3,%xmm2
movsd  (%rbx),%xmm0
movsd  0xcac(%rip),%xmm1
ucomisd %xmm0,%xmm1
movsd  %xmm2,0x8(%rsp)
jbe    1546 <cdflib_gamma_rat1+0x3d6>
movsd  0x18(%rsp),%xmm0
ucomisd 0xc9e(%rip),%xmm0
ja     1560 <cdflib_gamma_rat1+0x3f0>
call   1050 <exp@plt>
movsd  0x8(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xc31(%rip),%xmm0
movapd %xmm0,%xmm1
subsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,(%r14)
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%r15)
jmp    153a <cdflib_gamma_rat1+0x3ca>
movapd %xmm11,%xmm0
movsd  %xmm11,0x8(%rsp)
call   1070 <sqrt@plt>
movsd  0x8(%rsp),%xmm11
ucomisd 0xc23(%rip),%xmm11
jae    1200 <cdflib_gamma_rat1+0x90>
movsd  %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
xor    %eax,%eax
call   1090 <cdflib_error_f@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14)
movsd  0xbb7(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%r15)
jmp    153a <cdflib_gamma_rat1+0x3ca>
movsd  0xba8(%rip),%xmm9
movapd %xmm9,%xmm7
subsd  %xmm12,%xmm7
addsd  %xmm11,%xmm7
movsd  (%r9),%xmm10
movapd 0xbdb(%rip),%xmm8
movapd %xmm9,%xmm2
movapd %xmm11,%xmm4
movapd %xmm9,%xmm5
movapd %xmm9,%xmm0
nopl   0x0(%rax)
mulsd  %xmm2,%xmm5
movapd %xmm11,%xmm6
mulsd  %xmm0,%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm2,%xmm4
movapd %xmm11,%xmm6
mulsd  %xmm7,%xmm6
addsd  %xmm6,%xmm4
addsd  %xmm9,%xmm2
movapd %xmm2,%xmm3
subsd  %xmm12,%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm5,%xmm0
mulsd  %xmm7,%xmm3
addsd  %xmm4,%xmm3
movapd %xmm0,%xmm6
unpcklpd %xmm5,%xmm6
movapd %xmm3,%xmm7
unpcklpd %xmm4,%xmm3
divpd  %xmm3,%xmm6
movapd %xmm6,%xmm3
unpckhpd %xmm6,%xmm3
movapd %xmm6,%xmm1
subsd  %xmm3,%xmm1
andpd  %xmm8,%xmm1
movapd %xmm10,%xmm3
mulsd  %xmm6,%xmm3
ucomisd %xmm3,%xmm1
jae    14a0 <cdflib_gamma_rat1+0x330>
mulsd  (%rdx),%xmm6
movsd  %xmm6,(%r15)
movsd  0xad7(%rip),%xmm0
movapd %xmm0,%xmm1
subsd  %xmm6,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
divsd  0xafa(%rip),%xmm0
ucomisd (%r12),%xmm0
movsd  0x18(%rsp),%xmm0
jbe    13b8 <cdflib_gamma_rat1+0x248>
lea    0x10(%rsp),%rdi
xor    %eax,%eax
movsd  %xmm3,0x18(%rsp)
call   1040 <cdflib_rexp@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movsd  0xa7f(%rip),%xmm0
movapd %xmm2,%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0x20(%rsp),%xmm1
subsd  %xmm2,%xmm1
mulsd  0x8(%rsp),%xmm1
subsd  0x18(%rsp),%xmm1
movsd  %xmm1,(%r15)
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm2
ja     11ac <cdflib_gamma_rat1+0x3c>
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
jmp    1239 <cdflib_gamma_rat1+0xc9>

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

LLVM IR (-O2):
@cdflib_gamma_rat1.K2 = internal constant i32 0
define void @cdflib_gamma_rat1(double* %0, double* nocapture %1, double* nocapture %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = bitcast double* %7 to i8*
%11 = bitcast double* %8 to i8*
%12 = bitcast double* %9 to i8*
%13 = load double, double* %0
%14 = load double, double* %1
%15 = fmul double %13, %14
%16 = fcmp oeq double %15, 0.000000e+00
br i1 %16, label %133, label %17
17: ; preds = %6
%18 = fcmp oeq double %13, 5.000000e-01
br i1 %18, label %120, label %19
19: ; preds = %17
%20 = fcmp olt double %14, 1.100000e+00
br i1 %20, label %21, label %83
21: ; preds = %19
%22 = fadd double %13, 3.000000e+00
%23 = fdiv double %14, %22
%24 = load double, double* %5
%25 = fmul double %24, 1.000000e-01
%26 = fadd double %13, 1.000000e+00
%27 = fdiv double %25, %26
br label %28
28: ; preds = %28, %21
%29 = phi double [ %14, %21 ], [ %35, %28 ]
%30 = phi double [ 3.000000e+00, %21 ], [ %32, %28 ]
%31 = phi double [ %23, %21 ], [ %38, %28 ]
%32 = fadd double %30, 1.000000e+00
%33 = fdiv double %14, %32
%34 = fneg double %29
%35 = fmul double %33, %34
%36 = fadd double %13, %32
%37 = fdiv double %35, %36
%38 = fadd double %31, %37
%39 = tail call double @llvm.fabs.f64(double %37)
%40 = fcmp ogt double %39, %27
br i1 %40, label %28, label %41
41: ; preds = %28
%42 = fdiv double %38, 6.000000e+00
%43 = fadd double %13, 2.000000e+00
%44 = fdiv double 5.000000e-01, %43
%45 = fsub double %42, %44
%46 = fdiv double 1.000000e+00, %26
%47 = tail call double @llvm.fmuladd.f64(double %45, double %14, double %46)
%48 = fmul double %15, %47
%49 = tail call double @log(double %14)
%50 = fmul double %13, %49
store double %50, double* %7
%51 = tail call i32 (double*, ...) bitcast (i32 (...)* @cdflib_gam1 to i32 (double*, ...)*)(double* %0)
%52 = sitofp i32 %51 to double
%53 = fadd double %52, 1.000000e+00
%54 = load double, double* %1
%55 = fcmp olt double %54, 2.500000e-01
br i1 %55, label %60, label %56
56: ; preds = %41
%57 = load double, double* %0
%58 = fdiv double %54, 2.590000e+00
%59 = fcmp olt double %57, %58
br i1 %59, label %70, label %62
60: ; preds = %41
%61 = fcmp ogt double %50, -1.339400e-01
br i1 %61, label %70, label %62
62: ; preds = %60, %56
%63 = tail call double @exp(double %50)
%64 = fmul double %53, %63
%65 = fsub double 5.000000e-01, %48
%66 = fadd double %65, 5.000000e-01
%67 = fmul double %66, %64
store double %67, double* %3
%68 = fsub double 5.000000e-01, %67
%69 = fadd double %68, 5.000000e-01
store double %69, double* %4
br label %136
70: ; preds = %60, %56
%71 = call i32 (double*, ...) bitcast (i32 (...)* @cdflib_rexp to i32 (double*, ...)*)(double* %7)
%72 = sitofp i32 %71 to double
%73 = fadd double %72, 5.000000e-01
%74 = fadd double %73, 5.000000e-01
%75 = fneg double %72
%76 = call double @llvm.fmuladd.f64(double %74, double %48, double %75)
%77 = fneg double %52
%78 = call double @llvm.fmuladd.f64(double %76, double %53, double %77)
store double %78, double* %4
%79 = fcmp olt double %78, 0.000000e+00
br i1 %79, label %119, label %80
80: ; preds = %70
%81 = fsub double 5.000000e-01, %78
%82 = fadd double %81, 5.000000e-01
store double %82, double* %3
br label %136
83: ; preds = %19
%84 = fsub double 1.000000e+00, %13
%85 = fadd double %14, %84
%86 = load double, double* %5
br label %87
87: ; preds = %87, %83
%88 = phi double [ 1.000000e+00, %83 ], [ %97, %87 ]
%89 = phi double [ %14, %83 ], [ %96, %87 ]
%90 = phi double [ %85, %83 ], [ %100, %87 ]
%91 = phi double [ 1.000000e+00, %83 ], [ %94, %87 ]
%92 = phi double [ 1.000000e+00, %83 ], [ %99, %87 ]
%93 = fmul double %88, %91
%94 = tail call double @llvm.fmuladd.f64(double %14, double %92, double %93)
%95 = fmul double %88, %89
%96 = tail call double @llvm.fmuladd.f64(double %14, double %90, double %95)
%97 = fadd double %88, 1.000000e+00
%98 = fsub double %97, %13
%99 = tail call double @llvm.fmuladd.f64(double %98, double %92, double %94)
%100 = tail call double @llvm.fmuladd.f64(double %98, double %90, double %96)
%101 = insertelement <2 x double> poison, double %99, i64 0
%102 = insertelement <2 x double> %101, double %94, i64 1
%103 = insertelement <2 x double> poison, double %100, i64 0
%104 = insertelement <2 x double> %103, double %96, i64 1
%105 = fdiv <2 x double> %102, %104
%106 = extractelement <2 x double> %105, i64 0
%107 = shufflevector <2 x double> %105, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%108 = fsub <2 x double> %105, %107
%109 = extractelement <2 x double> %108, i64 0
%110 = tail call double @llvm.fabs.f64(double %109)
%111 = fmul double %86, %106
%112 = fcmp ult double %110, %111
br i1 %112, label %113, label %87
113: ; preds = %87
%114 = extractelement <2 x double> %105, i64 0
%115 = load double, double* %2
%116 = fmul double %114, %115
store double %116, double* %4
%117 = fsub double 5.000000e-01, %116
%118 = fadd double %117, 5.000000e-01
store double %118, double* %3
br label %136
119: ; preds = %133, %70
store double 1.000000e+00, double* %3
store double 0.000000e+00, double* %4
br label %136
120: ; preds = %17
%121 = fcmp ult double %14, 2.500000e-01
%122 = tail call double @sqrt(double %14)
br i1 %121, label %123, label %128
123: ; preds = %120
store double %122, double* %8
%124 = call i32 (double*, ...) bitcast (i32 (...)* @cdflib_error_f to i32 (double*, ...)*)(double* %8)
%125 = sitofp i32 %124 to double
store double %125, double* %3
%126 = fsub double 5.000000e-01, %125
%127 = fadd double %126, 5.000000e-01
store double %127, double* %4
br label %136
128: ; preds = %120
store double %122, double* %9
%129 = call i32 (i32*, double*, ...) bitcast (i32 (...)* @cdflib_error_fc to i32 (i32*, double*, ...)*)(i32* @cdflib_gamma_rat1.K2, double* %9)
%130 = sitofp i32 %129 to double
store double %130, double* %4
%131 = fsub double 5.000000e-01, %130
%132 = fadd double %131, 5.000000e-01
store double %132, double* %3
br label %136
133: ; preds = %6
%134 = fcmp ugt double %14, %13
br i1 %134, label %119, label %135
135: ; preds = %133
store double 0.000000e+00, double* %3
store double 1.000000e+00, double* %4
br label %136
136: ; preds = %128, %123, %119, %135, %113, %80, %62
ret void
}