#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 */
float cephes_lgamf(float);
float expf(float);
float const fabs(float);
float log(float);
float cephes_igamcf(float a, float x) {
  const float MAXLOGF = 88.72283905206835;
  const float MACHEPF = 5.9604644775390625E-8;
  const float BIG = 16777216.;
  float ans, c, yc, ax, y, z;
  float pk, pkm1, pkm2, qk, qkm1, qkm2;
  float r, t;
  ax = a * log(x) - x - cephes_lgamf(a);
  if (ax < -MAXLOGF)
    return 0.0;
  ax = expf(ax);
  y = 1.0 - a;
  z = x + y + 1.0;
  c = 0.0;
  pkm2 = 1.0;
  qkm2 = x;
  pkm1 = x + 1.0;
  qkm1 = z * x;
  ans = pkm1 / qkm1;
  do {
    c += 1.0;
    y += 1.0;
    z += 2.0;
    yc = y * c;
    pk = pkm1 * z - pkm2 * yc;
    qk = qkm1 * z - qkm2 * yc;
    if (qk != 0) {
      r = pk / qk;
      t = fabs((ans - r) / r);
      ans = r;
    } else {
      t = 1.0;
    }
    pkm2 = pkm1;
    pkm1 = pk;
    qkm2 = qkm1;
    qkm1 = qk;
    if (fabs(pk) > BIG) {
      pkm2 *= MACHEPF;
      pkm1 *= MACHEPF;
      qkm2 *= MACHEPF;
      qkm1 *= MACHEPF;
    }
  } while (t > MACHEPF);
  return ans * ax;
}


x86 assembly (clang, -O0):
<cephes_igamcf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xea1(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe90(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0xc(%rbp),%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm2
movss  -0x58(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <cephes_lgamf@plt>
movaps %xmm0,%xmm1
movss  -0x54(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xe29(%rip),%xmm0
ucomiss -0x28(%rbp),%xmm0
jbe    11ee <cephes_igamcf+0xae>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1473 <cephes_igamcf+0x333>
movss  -0x28(%rbp),%xmm0
call   1030 <expf@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe0a(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde7(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xdc2(%rip),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdaa(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x30(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x38(%rbp),%xmm0
divss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd6e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd50(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd3a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x2c(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x38(%rbp),%xmm0
movss  -0x30(%rbp),%xmm2
movss  -0x3c(%rbp),%xmm1
mulss  -0x24(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x44(%rbp),%xmm0
movss  -0x30(%rbp),%xmm2
movss  -0x48(%rbp),%xmm1
mulss  -0x24(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    137a <cephes_igamcf+0x23a>
jp     137a <cephes_igamcf+0x23a>
jmp    13b1 <cephes_igamcf+0x271>
movss  -0x34(%rbp),%xmm0
divss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x1c(%rbp),%xmm0
subss  -0x4c(%rbp),%xmm0
divss  -0x4c(%rbp),%xmm0
call   1050 <fabs@plt>
movss  %xmm0,-0x50(%rbp)
movss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    13be <cephes_igamcf+0x27e>
movss  0xc57(%rip),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x34(%rbp),%xmm0
call   1050 <fabs@plt>
movss  0xc0c(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1449 <cephes_igamcf+0x309>
movss  0xbff(%rip),%xmm0
mulss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  0xbed(%rip),%xmm0
mulss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  0xbdb(%rip),%xmm0
mulss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x48(%rbp)
movss  0xbc9(%rip),%xmm0
mulss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    144e <cephes_igamcf+0x30e>
movss  -0x50(%rbp),%xmm0
movss  0xbad(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     1299 <cephes_igamcf+0x159>
movss  -0x1c(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cephes_igamcf>:
sub    $0x28,%rsp
movaps %xmm1,0x10(%rsp)
movss  %xmm0,0x8(%rsp)
movaps %xmm1,%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movss  0x8(%rsp),%xmm0
mulss  %xmm0,%xmm1
subss  0x10(%rsp),%xmm1
movss  %xmm1,0xc(%rsp)
call   1040 <cephes_lgamf@plt>
movss  0xc(%rsp),%xmm2
subss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
movss  0xe86(%rip),%xmm1
ucomiss %xmm2,%xmm1
ja     129f <cephes_igamcf+0x16f>
movaps %xmm2,%xmm0
call   1030 <expf@plt>
movss  0xe70(%rip),%xmm13
movaps %xmm13,%xmm2
subss  0x8(%rsp),%xmm2
movaps %xmm2,%xmm4
movaps 0x10(%rsp),%xmm7
addss  %xmm7,%xmm4
addss  %xmm13,%xmm4
movaps %xmm7,%xmm1
shufps $0x0,%xmm7,%xmm1
movaps 0xe53(%rip),%xmm5
movaps %xmm5,%xmm3
unpcklps %xmm4,%xmm3
movaps %xmm1,%xmm6
addps  %xmm3,%xmm6
mulps  %xmm1,%xmm3
movaps %xmm3,%xmm1
shufps $0x1,%xmm6,%xmm1
shufps $0xe2,%xmm6,%xmm1
shufps $0x55,%xmm3,%xmm3
divss  %xmm3,%xmm6
unpcklps %xmm7,%xmm5
unpcklps %xmm4,%xmm2
xorps  %xmm8,%xmm8
movaps 0xe2f(%rip),%xmm9
movaps 0xe37(%rip),%xmm14
movss  0xe06(%rip),%xmm10
movaps 0xe36(%rip),%xmm11
movss  0xdf9(%rip),%xmm12
xorps  %xmm15,%xmm15
jmp    122c <cephes_igamcf+0xfc>
nopl   0x0(%rax)
movaps %xmm1,%xmm5
ucomiss %xmm12,%xmm7
movaps %xmm4,%xmm1
jbe    129b <cephes_igamcf+0x16b>
addss  %xmm13,%xmm15
addps  %xmm9,%xmm2
movaps %xmm2,%xmm7
mulss  %xmm15,%xmm7
shufps $0x0,%xmm7,%xmm7
mulps  %xmm5,%xmm7
movaps %xmm2,%xmm4
shufps $0x55,%xmm2,%xmm4
mulps  %xmm1,%xmm4
subps  %xmm7,%xmm4
movaps %xmm4,%xmm5
shufps $0x55,%xmm4,%xmm5
ucomiss %xmm8,%xmm5
jne    1260 <cephes_igamcf+0x130>
jnp    1280 <cephes_igamcf+0x150>
movaps %xmm4,%xmm3
divss  %xmm5,%xmm3
subss  %xmm3,%xmm6
divss  %xmm3,%xmm6
andps  %xmm14,%xmm6
movaps %xmm6,%xmm7
movaps %xmm3,%xmm6
jmp    1284 <cephes_igamcf+0x154>
nopl   0x0(%rax,%rax,1)
movaps %xmm13,%xmm7
movaps %xmm4,%xmm3
andps  %xmm14,%xmm3
ucomiss %xmm10,%xmm3
jbe    1220 <cephes_igamcf+0xf0>
mulps  %xmm11,%xmm1
mulps  %xmm11,%xmm4
jmp    1220 <cephes_igamcf+0xf0>
mulss  %xmm6,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @cephes_igamcf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
store float %0, float* %4
store float %1, float* %5
store float 0x40562E4300000000, float* %6
store float 0x3E70000000000000, float* %7
store float 0x4170000000000000, float* %8
%23 = load float, float* %4
%24 = load float, float* %5
%25 = call float @log(float %24)
%26 = load float, float* %5
%27 = fneg float %26
%28 = call float @llvm.fmuladd.f32(float %23, float %25, float %27)
%29 = load float, float* %4
%30 = call float @cephes_lgamf(float %29)
%31 = fsub float %28, %30
store float %31, float* %12
%32 = load float, float* %12
%33 = fcmp olt float %32, 0xC0562E4300000000
br i1 %33, label %34, label %35
34: ; preds = %2
store float 0.000000e+00, float* %3
br label %128
35: ; preds = %2
%36 = load float, float* %12
%37 = call float @expf(float %36)
store float %37, float* %12
%38 = load float, float* %4
%39 = fpext float %38 to double
%40 = fsub double 1.000000e+00, %39
%41 = fptrunc double %40 to float
store float %41, float* %13
%42 = load float, float* %5
%43 = load float, float* %13
%44 = fadd float %42, %43
%45 = fpext float %44 to double
%46 = fadd double %45, 1.000000e+00
%47 = fptrunc double %46 to float
store float %47, float* %14
store float 0.000000e+00, float* %10
store float 1.000000e+00, float* %17
%48 = load float, float* %5
store float %48, float* %20
%49 = load float, float* %5
%50 = fpext float %49 to double
%51 = fadd double %50, 1.000000e+00
%52 = fptrunc double %51 to float
store float %52, float* %16
%53 = load float, float* %14
%54 = load float, float* %5
%55 = fmul float %53, %54
store float %55, float* %19
%56 = load float, float* %16
%57 = load float, float* %19
%58 = fdiv float %56, %57
store float %58, float* %9
br label %59
59: ; preds = %121, %35
%60 = load float, float* %10
%61 = fpext float %60 to double
%62 = fadd double %61, 1.000000e+00
%63 = fptrunc double %62 to float
store float %63, float* %10
%64 = load float, float* %13
%65 = fpext float %64 to double
%66 = fadd double %65, 1.000000e+00
%67 = fptrunc double %66 to float
store float %67, float* %13
%68 = load float, float* %14
%69 = fpext float %68 to double
%70 = fadd double %69, 2.000000e+00
%71 = fptrunc double %70 to float
store float %71, float* %14
%72 = load float, float* %13
%73 = load float, float* %10
%74 = fmul float %72, %73
store float %74, float* %11
%75 = load float, float* %16
%76 = load float, float* %14
%77 = load float, float* %17
%78 = load float, float* %11
%79 = fmul float %77, %78
%80 = fneg float %79
%81 = call float @llvm.fmuladd.f32(float %75, float %76, float %80)
store float %81, float* %15
%82 = load float, float* %19
%83 = load float, float* %14
%84 = load float, float* %20
%85 = load float, float* %11
%86 = fmul float %84, %85
%87 = fneg float %86
%88 = call float @llvm.fmuladd.f32(float %82, float %83, float %87)
store float %88, float* %18
%89 = load float, float* %18
%90 = fcmp une float %89, 0.000000e+00
br i1 %90, label %91, label %102
91: ; preds = %59
%92 = load float, float* %15
%93 = load float, float* %18
%94 = fdiv float %92, %93
store float %94, float* %21
%95 = load float, float* %9
%96 = load float, float* %21
%97 = fsub float %95, %96
%98 = load float, float* %21
%99 = fdiv float %97, %98
%100 = call float @fabs(float %99)
store float %100, float* %22
%101 = load float, float* %21
store float %101, float* %9
br label %103
102: ; preds = %59
store float 1.000000e+00, float* %22
br label %103
103: ; preds = %102, %91
%104 = load float, float* %16
store float %104, float* %17
%105 = load float, float* %15
store float %105, float* %16
%106 = load float, float* %19
store float %106, float* %20
%107 = load float, float* %18
store float %107, float* %19
%108 = load float, float* %15
%109 = call float @fabs(float %108)
%110 = fcmp ogt float %109, 0x4170000000000000
br i1 %110, label %111, label %120
111: ; preds = %103
%112 = load float, float* %17
%113 = fmul float %112, 0x3E70000000000000
store float %113, float* %17
%114 = load float, float* %16
%115 = fmul float %114, 0x3E70000000000000
store float %115, float* %16
%116 = load float, float* %20
%117 = fmul float %116, 0x3E70000000000000
store float %117, float* %20
%118 = load float, float* %19
%119 = fmul float %118, 0x3E70000000000000
store float %119, float* %19
br label %120
120: ; preds = %111, %103
br label %121
121: ; preds = %120
%122 = load float, float* %22
%123 = fcmp ogt float %122, 0x3E70000000000000
br i1 %123, label %59, label %124
124: ; preds = %121
%125 = load float, float* %9
%126 = load float, float* %12
%127 = fmul float %125, %126
store float %127, float* %3
br label %128
128: ; preds = %124, %34
%129 = load float, float* %3
ret float %129
}

LLVM IR (-O2):
define float @cephes_igamcf(float %0, float %1) {
%3 = tail call float @log(float %1)
%4 = fneg float %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %3, float %4)
%6 = tail call float @cephes_lgamf(float %0)
%7 = fsub float %5, %6
%8 = fcmp olt float %7, 0xC0562E4300000000
br i1 %8, label %63, label %9
9: ; preds = %2
%10 = tail call float @expf(float %7)
%11 = fsub float 1.000000e+00, %0
%12 = fadd float %11, %1
%13 = fadd float %12, 1.000000e+00
%14 = insertelement <2 x float> poison, float %1, i64 0
%15 = shufflevector <2 x float> %14, <2 x float> poison, <2 x i32> zeroinitializer
%16 = insertelement <2 x float> <float 1.000000e+00, float poison>, float %13, i64 1
%17 = fadd <2 x float> %15, %16
%18 = fmul <2 x float> %15, %16
%19 = shufflevector <2 x float> %17, <2 x float> %18, <2 x i32> <i32 0, i32 3>
%20 = extractelement <2 x float> %17, i64 0
%21 = extractelement <2 x float> %18, i64 1
%22 = fdiv float %20, %21
%23 = insertelement <2 x float> <float 1.000000e+00, float poison>, float %1, i64 1
%24 = insertelement <2 x float> poison, float %11, i64 0
%25 = insertelement <2 x float> %24, float %13, i64 1
br label %26
26: ; preds = %50, %9
%27 = phi float [ 0.000000e+00, %9 ], [ %32, %50 ]
%28 = phi float [ %22, %9 ], [ %51, %50 ]
%29 = phi <2 x float> [ %19, %9 ], [ %59, %50 ]
%30 = phi <2 x float> [ %23, %9 ], [ %58, %50 ]
%31 = phi <2 x float> [ %25, %9 ], [ %33, %50 ]
%32 = fadd float %27, 1.000000e+00
%33 = fadd <2 x float> %31, <float 1.000000e+00, float 2.000000e+00>
%34 = extractelement <2 x float> %33, i64 0
%35 = fmul float %34, %32
%36 = fneg <2 x float> %30
%37 = insertelement <2 x float> poison, float %35, i64 0
%38 = shufflevector <2 x float> %37, <2 x float> poison, <2 x i32> zeroinitializer
%39 = fmul <2 x float> %38, %36
%40 = shufflevector <2 x float> %33, <2 x float> undef, <2 x i32> <i32 1, i32 1>
%41 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %29, <2 x float> %40, <2 x float> %39)
%42 = extractelement <2 x float> %41, i64 1
%43 = fcmp une float %42, 0.000000e+00
br i1 %43, label %44, label %50
44: ; preds = %26
%45 = extractelement <2 x float> %41, i64 0
%46 = fdiv float %45, %42
%47 = fsub float %28, %46
%48 = fdiv float %47, %46
%49 = tail call float @llvm.fabs.f32(float %48)
br label %50
50: ; preds = %26, %44
%51 = phi float [ %46, %44 ], [ %28, %26 ]
%52 = phi float [ %49, %44 ], [ 1.000000e+00, %26 ]
%53 = extractelement <2 x float> %41, i64 0
%54 = tail call float @llvm.fabs.f32(float %53)
%55 = fcmp ogt float %54, 0x4170000000000000
%56 = fmul <2 x float> %29, <float 0x3E70000000000000, float 0x3E70000000000000>
%57 = fmul <2 x float> %41, <float 0x3E70000000000000, float 0x3E70000000000000>
%58 = select i1 %55, <2 x float> %56, <2 x float> %29
%59 = select i1 %55, <2 x float> %57, <2 x float> %41
%60 = fcmp ogt float %52, 0x3E70000000000000
br i1 %60, label %26, label %61
61: ; preds = %50
%62 = fmul float %10, %51
br label %63
63: ; preds = %2, %61
%64 = phi float [ %62, %61 ], [ 0.000000e+00, %2 ]
ret float %64
}