#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double exp(double);
int fix(double);
double log(double);
double sin(double);
double gamma(double x) {
  double y, oup, fact, sum, y2, yi, z, nsum, dsum;
  int swi, n, i;
  double spi = 0.9189385332046727417803297;
  double pi = 3.1415926535897932384626434;
  double xmax = 171.624e+0;
  double xinf = 1.79e308;
  double eps = 2.22e-16;
  double xninf = 1.79e-308;
  double num[8] = {-1.71618513886549492533811e+0, 2.47656508055759199108314e+1,
                   -3.79804256470945635097577e+2, 6.29331155312818442661052e+2,
                   8.66966202790413211295064e+2,  -3.14512729688483675254357e+4,
                   -3.61444134186911729807069e+4, 6.64561438202405440627855e+4};
  double den[8] = {
      -3.08402300119738975254353e+1, 3.15350626979604161529144e+2,
      -1.01515636749021914166146e+3, -3.10777167157231109440444e+3,
      2.25381184209801510330112e+4,  4.75584627752788110767815e+3,
      -1.34659959864969306392456e+5, -1.15132259675553483497211e+5};
  double c[7] = {-1.910444077728e-03,
                 8.4171387781295e-04,
                 -5.952379913043012e-04,
                 7.93650793500350248e-04,
                 -2.777777777777681622553e-03,
                 8.333333333333333331554247e-02,
                 5.7083835261e-03};
  y = x;
  swi = 0;
  fact = 1.0;
  n = 0;
  if (y < 0.) {
    y = -x;
    yi = fix(y);
    oup = y - yi;
    if (oup != 0.0) {
      if (yi != fix(yi * .5) * 2.) {
        swi = 1;
      }
      fact = -pi / sin(pi * oup);
      y += 1.;
    } else {
      return xinf;
    }
  }
  if (y < eps) {
    if (y >= xninf) {
      oup = 1.0 / y;
    } else {
      return xinf;
    }
  } else if (y < 12.) {
    yi = y;
    if (y < 1.) {
      z = y;
      y += 1.;
    } else {
      n = (int)y - 1;
      y -= (double)n;
      z = y - 1.0;
    }
    nsum = 0.;
    dsum = 1.;
    for (i = 0; i < 8; ++i) {
      nsum = (nsum + num[i]) * z;
      dsum = dsum * z + den[i];
    }
    oup = nsum / dsum + 1.;
    if (yi < y) {
      oup /= yi;
    } else if (yi > y) {
      for (i = 0; i < n; ++i) {
        oup *= y;
        y += 1.;
      }
    }
  } else {
    if (y <= xmax) {
      y2 = y * y;
      sum = c[6];
      for (i = 0; i < 6; ++i) {
        sum = sum / y2 + c[i];
      }
      sum = sum / y - y + spi;
      sum += (y - .5) * log(y);
      oup = exp(sum);
    } else {
      return (xinf);
    }
  }
  if (swi) {
    oup = -oup;
  }
  if (fact != 1.) {
    oup = fact / oup;
  }
  return oup;
}


x86 assembly (clang, -O0):
<gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe9e(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xe89(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xe59(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
lea    -0xe0(%rbp),%rdi
lea    0xe8b(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x120(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x160(%rbp),%rdi
lea    0xedb(%rip),%rsi
mov    $0x38,%edx
call   1040 <memcpy@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x5c(%rbp)
movsd  0xde8(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x60(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    135a <gamma+0x20a>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <fix@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1292 <gamma+0x142>
jp     1292 <gamma+0x142>
jmp    1343 <gamma+0x1f3>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  0xd99(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
call   1070 <fix@plt>
movsd  -0x168(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
movsd  0xd73(%rip),%xmm2
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    12de <gamma+0x18e>
jp     12de <gamma+0x18e>
jmp    12e5 <gamma+0x195>
movl   $0x1,-0x5c(%rbp)
movsd  -0x78(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x170(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xccc(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1355 <gamma+0x205>
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    16ad <gamma+0x55d>
jmp    135a <gamma+0x20a>
movsd  -0x18(%rbp),%xmm1
movsd  -0x90(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    13b2 <gamma+0x262>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jb     139b <gamma+0x24b>
movsd  0xc74(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13ad <gamma+0x25d>
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    16ad <gamma+0x55d>
jmp    1647 <gamma+0x4f7>
movsd  0xc8e(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1553 <gamma+0x403>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xc29(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1403 <gamma+0x2b3>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xc0c(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1437 <gamma+0x2e7>
cvttsd2si -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x60(%rbp)
cvtsi2sdl -0x60(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xbd2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xbb9(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0x8,-0x64(%rbp)
jge    14ab <gamma+0x35b>
movsd  -0x50(%rbp),%xmm0
movslq -0x64(%rbp),%rax
addsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movslq -0x64(%rbp),%rax
movsd  -0x120(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1453 <gamma+0x303>
movsd  -0x50(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  0xb43(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    14f2 <gamma+0x3a2>
movsd  -0x40(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    154e <gamma+0x3fe>
movsd  -0x40(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1549 <gamma+0x3f9>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    1544 <gamma+0x3f4>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xad4(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1509 <gamma+0x3b9>
jmp    1549 <gamma+0x3f9>
jmp    154e <gamma+0x3fe>
jmp    1642 <gamma+0x4f2>
movsd  -0x18(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     162b <gamma+0x4db>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x130(%rbp),%xmm0
ff
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0x6,-0x64(%rbp)
jge    15be <gamma+0x46e>
movsd  -0x30(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
movslq -0x64(%rbp),%rax
addsd  -0x160(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x30(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    158a <gamma+0x43a>
movsd  -0x30(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xa5c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm2
movsd  -0x178(%rbp),%xmm0
ff
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
jmp    163d <gamma+0x4ed>
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    16ad <gamma+0x55d>
jmp    1642 <gamma+0x4f2>
jmp    1647 <gamma+0x4f7>
cmpl   $0x0,-0x5c(%rbp)
je     1672 <gamma+0x522>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0x981(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1694 <gamma+0x544>
jp     1694 <gamma+0x544>
jmp    16a3 <gamma+0x553>
movsd  -0x28(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma>:
push   %rbx
sub    $0x30,%rsp
movapd %xmm0,%xmm6
xorpd  %xmm0,%xmm0
ucomisd %xmm6,%xmm0
jbe    11f8 <gamma+0xb8>
movapd 0xfc1(%rip),%xmm0
xorpd  %xmm6,%xmm0
movapd %xmm0,0x10(%rsp)
movapd %xmm6,0x20(%rsp)
call   1060 <fix@plt>
cvtsi2sd %eax,%xmm1
movapd 0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
ucomisd 0xf88(%rip),%xmm0
jne    1198 <gamma+0x58>
jnp    126d <gamma+0x12d>
movsd  0xe70(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm1,0x8(%rsp)
call   1060 <fix@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
cmpneqsd 0x8(%rsp),%xmm0
movq   %xmm0,%rbx
and    $0x1,%ebx
movapd 0x10(%rsp),%xmm0
mulsd  0xe41(%rip),%xmm0
call   1030 <sin@plt>
movsd  0xe3c(%rip),%xmm5
divsd  %xmm0,%xmm5
movsd  0xe10(%rip),%xmm6
subsd  0x20(%rsp),%xmm6
jmp    1202 <gamma+0xc2>
movsd  0xe00(%rip),%xmm5
xor    %ebx,%ebx
movsd  0xe1e(%rip),%xmm0
ucomisd %xmm6,%xmm0
jbe    122b <gamma+0xeb>
ucomisd 0xef8(%rip),%xmm6
jb     126d <gamma+0x12d>
movsd  0xdde(%rip),%xmm0
divsd  %xmm6,%xmm0
jmp    149d <gamma+0x35d>
movsd  0xdfd(%rip),%xmm0
ucomisd %xmm6,%xmm0
jbe    125b <gamma+0x11b>
movsd  0xdbf(%rip),%xmm1
ucomisd %xmm6,%xmm1
jbe    127a <gamma+0x13a>
movsd  0xdb1(%rip),%xmm2
addsd  %xmm6,%xmm2
xor    %eax,%eax
movapd %xmm6,%xmm3
jmp    129c <gamma+0x15c>
movsd  0xdd5(%rip),%xmm0
ucomisd %xmm6,%xmm0
jae    137b <gamma+0x23b>
movsd  0xd93(%rip),%xmm0
jmp    14bd <gamma+0x37d>
cvttsd2si %xmm6,%eax
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm6,%xmm2
subsd  %xmm0,%xmm2
movsd  0xdf0(%rip),%xmm3
addsd  %xmm2,%xmm3
movsd  0xdec(%rip),%xmm0
mulsd  %xmm3,%xmm0
movsd  0xde8(%rip),%xmm4
addsd  %xmm3,%xmm4
addsd  0xde4(%rip),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm4
addsd  0xddc(%rip),%xmm4
addsd  0xddc(%rip),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm4
addsd  0xdd4(%rip),%xmm4
addsd  0xdd4(%rip),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm4
addsd  0xdcc(%rip),%xmm4
addsd  0xdcc(%rip),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm4
addsd  0xdc4(%rip),%xmm4
addsd  0xdc4(%rip),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm4
addsd  0xdbc(%rip),%xmm4
addsd  0xdbc(%rip),%xmm0
mulsd  %xmm3,%xmm4
addsd  0xdb8(%rip),%xmm4
mulsd  %xmm3,%xmm0
addsd  0xdb4(%rip),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm4
addsd  0xdac(%rip),%xmm4
divsd  %xmm4,%xmm0
addsd  0xc98(%rip),%xmm0
ucomisd %xmm6,%xmm2
jbe    1426 <gamma+0x2e6>
divsd  %xmm6,%xmm0
jmp    149d <gamma+0x35d>
movapd %xmm6,%xmm0
mulsd  %xmm6,%xmm0
movsd  0xcb5(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xcb1(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xcad(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xca9(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xca5(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xca1(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xc9d(%rip),%xmm1
divsd  %xmm6,%xmm1
subsd  %xmm6,%xmm1
addsd  0xc95(%rip),%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0xc8f(%rip),%xmm0
addsd  %xmm6,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm6,%xmm0
movsd  %xmm5,0x10(%rsp)
call   1050 <log@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
call   1040 <exp@plt>
movsd  0x10(%rsp),%xmm5
jmp    149d <gamma+0x35d>
ucomisd %xmm2,%xmm6
jbe    149d <gamma+0x35d>
test   %eax,%eax
jle    149d <gamma+0x35d>
lea    -0x1(%rax),%edx
mov    %eax,%ecx
and    $0x7,%ecx
cmp    $0x7,%edx
jb     1485 <gamma+0x345>
and    $0xfffffff8,%eax
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
add    $0xfffffff8,%eax
jne    1440 <gamma+0x300>
test   %ecx,%ecx
je     149d <gamma+0x35d>
nopl   0x0(%rax)
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
add    $0xffffffff,%ecx
jne    1490 <gamma+0x350>
test   %ebx,%ebx
je     14a9 <gamma+0x369>
xorpd  0xc77(%rip),%xmm0
ucomisd 0xb4f(%rip),%xmm5
jne    14b5 <gamma+0x375>
jnp    14bd <gamma+0x37d>
divsd  %xmm0,%xmm5
movapd %xmm5,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.gamma.num = [8 x double] [double 0xBFFB757E8C54EFB2, double 0x4038C401B0F21AC9, double 0xC077BCDE3C0884ED, double 0x4083AAA634C1B39D, double 0x408B17BAC8875108, double 0xC0DEB6D178525524, double 0xC0E1A60D3AB9D5C5, double 0x40F039824D1673DA]
@__const.gamma.den = [8 x double] [double 0xC03ED71950668BAB, double 0x4073B59C2B0927EC, double 0xC08FB9403D994531, double 0xC0A8478B18894CA8, double 0x40D602879435973A, double 0x40B293D8A5A4E197, double 0xC100701FADCDAF5E, double 0xC0FC1BC427A18D9D]
@__const.gamma.c = [7 x double] [double 0xBF5F4CFBB56B5FF7, double 0x3F4B94CEC9F537D1, double 0xBF438137DA5DD682, double 0x3F4A01A019EC73CF, double 0xBF66C16C16C16B39, double 0x3FB5555555555555, double 0x3F7761AC88EC07D7]
define double @gamma(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca [8 x double]
%23 = alloca [8 x double]
%24 = alloca [7 x double]
store double %0, double* %3
store double 0x3FED67F1C864BEB5, double* %16
store double 0x400921FB54442D18, double* %17
store double 1.716240e+02, double* %18
store double 1.790000e+308, double* %19
store double 2.220000e-16, double* %20
store double 1.790000e-308, double* %21
%25 = bitcast [8 x double]* %22 to i8*
%26 = bitcast [8 x double]* %23 to i8*
%27 = bitcast [7 x double]* %24 to i8*
%28 = load double, double* %3
store double %28, double* %4
store i32 0, i32* %13
store double 1.000000e+00, double* %6
store i32 0, i32* %14
%29 = load double, double* %4
%30 = fcmp olt double %29, 0.000000e+00
br i1 %30, label %31, label %64
31: ; preds = %1
%32 = load double, double* %3
%33 = fneg double %32
store double %33, double* %4
%34 = load double, double* %4
%35 = call i32 @fix(double %34)
%36 = sitofp i32 %35 to double
store double %36, double* %9
%37 = load double, double* %4
%38 = load double, double* %9
%39 = fsub double %37, %38
store double %39, double* %5
%40 = load double, double* %5
%41 = fcmp une double %40, 0.000000e+00
br i1 %41, label %42, label %61
42: ; preds = %31
%43 = load double, double* %9
%44 = load double, double* %9
%45 = fmul double %44, 5.000000e-01
%46 = call i32 @fix(double %45)
%47 = sitofp i32 %46 to double
%48 = fmul double %47, 2.000000e+00
%49 = fcmp une double %43, %48
br i1 %49, label %50, label %51
50: ; preds = %42
store i32 1, i32* %13
br label %51
51: ; preds = %50, %42
%52 = load double, double* %17
%53 = fneg double %52
%54 = load double, double* %17
%55 = load double, double* %5
%56 = fmul double %54, %55
%57 = call double @sin(double %56)
%58 = fdiv double %53, %57
store double %58, double* %6
%59 = load double, double* %4
%60 = fadd double %59, 1.000000e+00
store double %60, double* %4
br label %63
61: ; preds = %31
%62 = load double, double* %19
store double %62, double* %2
br label %215
63: ; preds = %51
br label %64
64: ; preds = %63, %1
%65 = load double, double* %4
%66 = load double, double* %20
%67 = fcmp olt double %65, %66
br i1 %67, label %68, label %78
68: ; preds = %64
%69 = load double, double* %4
%70 = load double, double* %21
%71 = fcmp oge double %69, %70
br i1 %71, label %72, label %75
72: ; preds = %68
%73 = load double, double* %4
%74 = fdiv double 1.000000e+00, %73
store double %74, double* %5
br label %77
75: ; preds = %68
%76 = load double, double* %19
store double %76, double* %2
br label %215
77: ; preds = %72
br label %200
78: ; preds = %64
%79 = load double, double* %4
%80 = fcmp olt double %79, 1.200000e+01
br i1 %80, label %81, label %155
81: ; preds = %78
%82 = load double, double* %4
store double %82, double* %9
%83 = load double, double* %4
%84 = fcmp olt double %83, 1.000000e+00
br i1 %84, label %85, label %89
85: ; preds = %81
%86 = load double, double* %4
store double %86, double* %10
%87 = load double, double* %4
%88 = fadd double %87, 1.000000e+00
store double %88, double* %4
br label %99
89: ; preds = %81
%90 = load double, double* %4
%91 = fptosi double %90 to i32
%92 = sub nsw i32 %91, 1
store i32 %92, i32* %14
%93 = load i32, i32* %14
%94 = sitofp i32 %93 to double
%95 = load double, double* %4
%96 = fsub double %95, %94
store double %96, double* %4
%97 = load double, double* %4
%98 = fsub double %97, 1.000000e+00
store double %98, double* %10
br label %99
99: ; preds = %89, %85
store double 0.000000e+00, double* %11
store double 1.000000e+00, double* %12
store i32 0, i32* %15
br label %100
100: ; preds = %119, %99
%101 = load i32, i32* %15
%102 = icmp slt i32 %101, 8
br i1 %102, label %103, label %122
103: ; preds = %100
%104 = load double, double* %11
%105 = load i32, i32* %15
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [8 x double], [8 x double]* %22, i64 0, i64 %106
%108 = load double, double* %107
%109 = fadd double %104, %108
%110 = load double, double* %10
%111 = fmul double %109, %110
store double %111, double* %11
%112 = load double, double* %12
%113 = load double, double* %10
%114 = load i32, i32* %15
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [8 x double], [8 x double]* %23, i64 0, i64 %115
%117 = load double, double* %116
%118 = call double @llvm.fmuladd.f64(double %112, double %113, double %117)
store double %118, double* %12
br label %119
119: ; preds = %103
%120 = load i32, i32* %15
%121 = add nsw i32 %120, 1
store i32 %121, i32* %15
br label %100
122: ; preds = %100
%123 = load double, double* %11
%124 = load double, double* %12
%125 = fdiv double %123, %124
%126 = fadd double %125, 1.000000e+00
store double %126, double* %5
%127 = load double, double* %9
%128 = load double, double* %4
%129 = fcmp olt double %127, %128
br i1 %129, label %130, label %134
130: ; preds = %122
%131 = load double, double* %9
%132 = load double, double* %5
%133 = fdiv double %132, %131
store double %133, double* %5
br label %154
134: ; preds = %122
%135 = load double, double* %9
%136 = load double, double* %4
%137 = fcmp ogt double %135, %136
br i1 %137, label %138, label %153
138: ; preds = %134
store i32 0, i32* %15
br label %139
139: ; preds = %149, %138
%140 = load i32, i32* %15
%141 = load i32, i32* %14
%142 = icmp slt i32 %140, %141
br i1 %142, label %143, label %152
143: ; preds = %139
%144 = load double, double* %4
%145 = load double, double* %5
%146 = fmul double %145, %144
store double %146, double* %5
%147 = load double, double* %4
%148 = fadd double %147, 1.000000e+00
store double %148, double* %4
br label %149
149: ; preds = %143
%150 = load i32, i32* %15
%151 = add nsw i32 %150, 1
store i32 %151, i32* %15
br label %139
152: ; preds = %139
br label %153
153: ; preds = %152, %134
br label %154
154: ; preds = %153, %130
br label %199
155: ; preds = %78
%156 = load double, double* %4
%157 = load double, double* %18
%158 = fcmp ole double %156, %157
br i1 %158, label %159, label %196
159: ; preds = %155
%160 = load double, double* %4
%161 = load double, double* %4
%162 = fmul double %160, %161
store double %162, double* %8
%163 = getelementptr inbounds [7 x double], [7 x double]* %24, i64 0, i64 6
%164 = load double, double* %163
store double %164, double* %7
store i32 0, i32* %15
br label %165
165: ; preds = %177, %159
%166 = load i32, i32* %15
%167 = icmp slt i32 %166, 6
br i1 %167, label %168, label %180
168: ; preds = %165
%169 = load double, double* %7
%170 = load double, double* %8
%171 = fdiv double %169, %170
%172 = load i32, i32* %15
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds [7 x double], [7 x double]* %24, i64 0, i64 %173
%175 = load double, double* %174
%176 = fadd double %171, %175
store double %176, double* %7
br label %177
177: ; preds = %168
%178 = load i32, i32* %15
%179 = add nsw i32 %178, 1
store i32 %179, i32* %15
br label %165
180: ; preds = %165
%181 = load double, double* %7
%182 = load double, double* %4
%183 = fdiv double %181, %182
%184 = load double, double* %4
%185 = fsub double %183, %184
%186 = load double, double* %16
%187 = fadd double %185, %186
store double %187, double* %7
%188 = load double, double* %4
%189 = fsub double %188, 5.000000e-01
%190 = load double, double* %4
%191 = call double @log(double %190)
%192 = load double, double* %7
%193 = call double @llvm.fmuladd.f64(double %189, double %191, double %192)
store double %193, double* %7
%194 = load double, double* %7
%195 = call double @exp(double %194)
store double %195, double* %5
br label %198
196: ; preds = %155
%197 = load double, double* %19
store double %197, double* %2
br label %215
198: ; preds = %180
br label %199
199: ; preds = %198, %154
br label %200
200: ; preds = %199, %77
%201 = load i32, i32* %13
%202 = icmp ne i32 %201, 0
br i1 %202, label %203, label %206
203: ; preds = %200
%204 = load double, double* %5
%205 = fneg double %204
store double %205, double* %5
br label %206
206: ; preds = %203, %200
%207 = load double, double* %6
%208 = fcmp une double %207, 1.000000e+00
br i1 %208, label %209, label %213
209: ; preds = %206
%210 = load double, double* %6
%211 = load double, double* %5
%212 = fdiv double %210, %211
store double %212, double* %5
br label %213
213: ; preds = %209, %206
%214 = load double, double* %5
store double %214, double* %2
br label %215
215: ; preds = %213, %196, %75, %61
%216 = load double, double* %2
ret double %216
}

LLVM IR (-O2):
define double @gamma(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %20
3: ; preds = %1
%4 = fneg double %0
%5 = tail call i32 @fix(double %4)
%6 = sitofp i32 %5 to double
%7 = fsub double %4, %6
%8 = fcmp une double %7, 0.000000e+00
br i1 %8, label %9, label %149
9: ; preds = %3
%10 = fmul double %6, 5.000000e-01
%11 = tail call i32 @fix(double %10)
%12 = sitofp i32 %11 to double
%13 = fmul double %12, 2.000000e+00
%14 = fcmp une double %13, %6
%15 = zext i1 %14 to i32
%16 = fmul double %7, 0x400921FB54442D18
%17 = tail call double @sin(double %16)
%18 = fdiv double 0xC00921FB54442D18, %17
%19 = fsub double 1.000000e+00, %0
br label %20
20: ; preds = %9, %1
%21 = phi i32 [ %15, %9 ], [ 0, %1 ]
%22 = phi double [ %18, %9 ], [ 1.000000e+00, %1 ]
%23 = phi double [ %19, %9 ], [ %0, %1 ]
%24 = fcmp olt double %23, 2.220000e-16
br i1 %24, label %25, label %29
25: ; preds = %20
%26 = fcmp ult double %23, 1.790000e-308
br i1 %26, label %149, label %27
27: ; preds = %25
%28 = fdiv double 1.000000e+00, %23
br label %141
29: ; preds = %20
%30 = fcmp olt double %23, 1.200000e+01
br i1 %30, label %31, label %105
31: ; preds = %29
%32 = fcmp olt double %23, 1.000000e+00
br i1 %32, label %33, label %35
33: ; preds = %31
%34 = fadd double %23, 1.000000e+00
br label %41
35: ; preds = %31
%36 = fptosi double %23 to i32
%37 = add nsw i32 %36, -1
%38 = sitofp i32 %37 to double
%39 = fsub double %23, %38
%40 = fadd double %39, -1.000000e+00
br label %41
41: ; preds = %35, %33
%42 = phi double [ %23, %33 ], [ %40, %35 ]
%43 = phi i32 [ 0, %33 ], [ %37, %35 ]
%44 = phi double [ %34, %33 ], [ %39, %35 ]
%45 = fmul double %42, 0xBFFB757E8C54EFB2
%46 = fadd double %42, 0xC03ED71950668BAB
%47 = fadd double %45, 0x4038C401B0F21AC9
%48 = fmul double %42, %47
%49 = tail call double @llvm.fmuladd.f64(double %46, double %42, double 0x4073B59C2B0927EC)
%50 = fadd double %48, 0xC077BCDE3C0884ED
%51 = fmul double %42, %50
%52 = tail call double @llvm.fmuladd.f64(double %49, double %42, double 0xC08FB9403D994531)
%53 = fadd double %51, 0x4083AAA634C1B39D
%54 = fmul double %42, %53
%55 = tail call double @llvm.fmuladd.f64(double %52, double %42, double 0xC0A8478B18894CA8)
%56 = fadd double %54, 0x408B17BAC8875108
%57 = fmul double %42, %56
%58 = tail call double @llvm.fmuladd.f64(double %55, double %42, double 0x40D602879435973A)
%59 = fadd double %57, 0xC0DEB6D178525524
%60 = fmul double %42, %59
%61 = tail call double @llvm.fmuladd.f64(double %58, double %42, double 0x40B293D8A5A4E197)
%62 = fadd double %60, 0xC0E1A60D3AB9D5C5
%63 = fmul double %42, %62
%64 = tail call double @llvm.fmuladd.f64(double %61, double %42, double 0xC100701FADCDAF5E)
%65 = fadd double %63, 0x40F039824D1673DA
%66 = fmul double %42, %65
%67 = tail call double @llvm.fmuladd.f64(double %64, double %42, double 0xC0FC1BC427A18D9D)
%68 = fdiv double %66, %67
%69 = fadd double %68, 1.000000e+00
%70 = fcmp olt double %23, %44
br i1 %70, label %71, label %73
71: ; preds = %41
%72 = fdiv double %69, %23
br label %141
73: ; preds = %41
%74 = fcmp ogt double %23, %44
%75 = icmp sgt i32 %43, 0
%76 = select i1 %74, i1 %75, i1 false
br i1 %76, label %77, label %141
77: ; preds = %73
%78 = add i32 %43, -1
%79 = and i32 %43, 7
%80 = icmp ult i32 %78, 7
br i1 %80, label %128, label %81
81: ; preds = %77
%82 = and i32 %43, -8
br label %83
83: ; preds = %83, %81
%84 = phi double [ %44, %81 ], [ %102, %83 ]
%85 = phi double [ %69, %81 ], [ %101, %83 ]
%86 = phi i32 [ 0, %81 ], [ %103, %83 ]
%87 = fmul double %85, %84
%88 = fadd double %84, 1.000000e+00
%89 = fmul double %87, %88
%90 = fadd double %88, 1.000000e+00
%91 = fmul double %89, %90
%92 = fadd double %90, 1.000000e+00
%93 = fmul double %91, %92
%94 = fadd double %92, 1.000000e+00
%95 = fmul double %93, %94
%96 = fadd double %94, 1.000000e+00
%97 = fmul double %95, %96
%98 = fadd double %96, 1.000000e+00
%99 = fmul double %97, %98
%100 = fadd double %98, 1.000000e+00
%101 = fmul double %99, %100
%102 = fadd double %100, 1.000000e+00
%103 = add i32 %86, 8
%104 = icmp eq i32 %103, %82
br i1 %104, label %128, label %83
105: ; preds = %29
%106 = fcmp ugt double %23, 1.716240e+02
br i1 %106, label %149, label %107
107: ; preds = %105
%108 = fmul double %23, %23
%109 = fdiv double 0x3F7761AC88EC07D7, %108
%110 = fadd double %109, 0xBF5F4CFBB56B5FF7
%111 = fdiv double %110, %108
%112 = fadd double %111, 0x3F4B94CEC9F537D1
%113 = fdiv double %112, %108
%114 = fadd double %113, 0xBF438137DA5DD682
%115 = fdiv double %114, %108
%116 = fadd double %115, 0x3F4A01A019EC73CF
%117 = fdiv double %116, %108
%118 = fadd double %117, 0xBF66C16C16C16B39
%119 = fdiv double %118, %108
%120 = fadd double %119, 0x3FB5555555555555
%121 = fdiv double %120, %23
%122 = fsub double %121, %23
%123 = fadd double %122, 0x3FED67F1C864BEB5
%124 = fadd double %23, -5.000000e-01
%125 = tail call double @log(double %23)
%126 = tail call double @llvm.fmuladd.f64(double %124, double %125, double %123)
%127 = tail call double @exp(double %126)
br label %141
128: ; preds = %83, %77
%129 = phi double [ undef, %77 ], [ %101, %83 ]
%130 = phi double [ %44, %77 ], [ %102, %83 ]
%131 = phi double [ %69, %77 ], [ %101, %83 ]
%132 = icmp eq i32 %79, 0
br i1 %132, label %141, label %133
133: ; preds = %128, %133
%134 = phi double [ %138, %133 ], [ %130, %128 ]
%135 = phi double [ %137, %133 ], [ %131, %128 ]
%136 = phi i32 [ %139, %133 ], [ 0, %128 ]
%137 = fmul double %135, %134
%138 = fadd double %134, 1.000000e+00
%139 = add i32 %136, 1
%140 = icmp eq i32 %139, %79
br i1 %140, label %141, label %133
141: ; preds = %128, %133, %107, %73, %71, %27
%142 = phi double [ %28, %27 ], [ %72, %71 ], [ %69, %73 ], [ %127, %107 ], [ %129, %128 ], [ %137, %133 ]
%143 = icmp eq i32 %21, 0
%144 = fneg double %142
%145 = select i1 %143, double %142, double %144
%146 = fcmp une double %22, 1.000000e+00
%147 = fdiv double %22, %145
%148 = select i1 %146, double %147, double %145
br label %149
149: ; preds = %105, %25, %3, %141
%150 = phi double [ %148, %141 ], [ 1.790000e+308, %3 ], [ 1.790000e+308, %25 ], [ 1.790000e+308, %105 ]
ret double %150
}