#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 exp(float);
double fabs(float);
float gammln(float);
float log(float);
void gcf(float *gammcf, float a, float x, float *gln) {
  void nrerror(char error_text[]);
  int i;
  float an, b, c, d, del, h;
  *gln = gammln(a);
  b = x + 1.0 - a;
  c = 1.0 / 1.0e-30;
  d = 1.0 / b;
  h = d;
  for (i = 1; i <= 9000; i++) {
    an = -i * (i - a);
    b += 2.0;
    d = an * d + b;
    if (fabs(d) < 1.0e-30)
      d = 1.0e-30;
    c = b + an / c;
    if (fabs(c) < 1.0e-30)
      c = 1.0e-30;
    d = 1.0 / d;
    del = d * c;
    h *= del;
    if (fabs(del - 1.0) < 3.0e-7)
      break;
  }
  if (i > 9000)
    nrerror("a too large,ITMAX too small in gcf");
  *gammcf = exp(-x + a * log(x) - (*gln)) * h;
}


x86 assembly (clang, -O0):
<gcf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
call   1070 <gammln@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe73(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xe71(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe3b(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x2328,-0x1c(%rbp)
jg     133d <gcf+0x1ed>
xor    %eax,%eax
sub    -0x1c(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtsi2ssl -0x1c(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdf3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x24(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xdad(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1272 <gcf+0x122>
movss  0xdb7(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x24(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
divss  -0x28(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xd69(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12b6 <gcf+0x166>
movss  0xd73(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd39(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
mulss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcfd(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xcfd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    132a <gcf+0x1da>
jmp    133d <gcf+0x1ed>
jmp    132f <gcf+0x1df>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e3 <gcf+0x93>
cmpl   $0x2328,-0x1c(%rbp)
jle    1356 <gcf+0x206>
lea    0xcd7(%rip),%rdi
call   1030 <nrerror@plt>
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movss  -0x3c(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x38(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
call   1050 <exp@plt>
mulss  -0x34(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcf>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r15
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0xc(%rsp)
mov    %rdi,%r14
call   1070 <gammln@plt>
movss  %xmm0,(%r15)
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe78(%rip),%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0xe73(%rip),%xmm0
movss  %xmm1,0x14(%rsp)
divss  %xmm1,%xmm0
movss  0xe65(%rip),%xmm1
mov    $0x1,%ebp
mov    $0xffffffff,%ebx
movss  %xmm0,0x10(%rsp)
movaps %xmm0,%xmm2
movss  %xmm1,0x18(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
subss  0xc(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x14(%rsp),%xmm3
addss  0xe24(%rip),%xmm3
movss  %xmm3,0x14(%rsp)
mulss  %xmm1,%xmm2
movaps %xmm2,%xmm0
addss  %xmm3,%xmm0
movss  %xmm0,0x1c(%rsp)
call   1040 <fabs@plt>
movsd  %xmm0,0x20(%rsp)
movss  0x4(%rsp),%xmm0
divss  0x18(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
call   1040 <fabs@plt>
movsd  0xdc5(%rip),%xmm1
ucomisd %xmm0,%xmm1
movss  0xdd5(%rip),%xmm1
ja     1257 <gcf+0x107>
movss  0x4(%rsp),%xmm1
movsd  0xda9(%rip),%xmm0
ucomisd 0x20(%rsp),%xmm0
movss  0xdaf(%rip),%xmm0
ja     127d <gcf+0x12d>
movss  0xda1(%rip),%xmm0
divss  0x1c(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
movss  %xmm1,0x18(%rsp)
mulss  %xmm1,%xmm0
movss  0x10(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x10(%rsp)
addss  0xd83(%rip),%xmm0
call   1040 <fabs@plt>
movsd  0xd5e(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     12dc <gcf+0x18c>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    $0xffffdcd7,%ebx
movss  0x4(%rsp),%xmm2
jne    11d0 <gcf+0x80>
lea    0xd55(%rip),%rdi
call   1030 <nrerror@plt>
movss  0x8(%rsp),%xmm0
call   1060 <log@plt>
mulss  0xc(%rsp),%xmm0
subss  0x8(%rsp),%xmm0
subss  (%r15),%xmm0
call   1050 <exp@plt>
movss  0x10(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"a too large,ITMAX too small in gcf\00"
define void @gcf(float* %0, float %1, float %2, float* %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float*
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float* %3, float** %8
%16 = load float, float* %6
%17 = call float @gammln(float %16)
%18 = load float*, float** %8
store float %17, float* %18
%19 = load float, float* %7
%20 = fpext float %19 to double
%21 = fadd double %20, 1.000000e+00
%22 = load float, float* %6
%23 = fpext float %22 to double
%24 = fsub double %21, %23
%25 = fptrunc double %24 to float
store float %25, float* %11
store float 0x46293E5940000000, float* %12
%26 = load float, float* %11
%27 = fpext float %26 to double
%28 = fdiv double 1.000000e+00, %27
%29 = fptrunc double %28 to float
store float %29, float* %13
%30 = load float, float* %13
store float %30, float* %15
store i32 1, i32* %9
br label %31
31: ; preds = %84, %4
%32 = load i32, i32* %9
%33 = icmp sle i32 %32, 9000
br i1 %33, label %34, label %87
34: ; preds = %31
%35 = load i32, i32* %9
%36 = sub nsw i32 0, %35
%37 = sitofp i32 %36 to float
%38 = load i32, i32* %9
%39 = sitofp i32 %38 to float
%40 = load float, float* %6
%41 = fsub float %39, %40
%42 = fmul float %37, %41
store float %42, float* %10
%43 = load float, float* %11
%44 = fpext float %43 to double
%45 = fadd double %44, 2.000000e+00
%46 = fptrunc double %45 to float
store float %46, float* %11
%47 = load float, float* %10
%48 = load float, float* %13
%49 = load float, float* %11
%50 = call float @llvm.fmuladd.f32(float %47, float %48, float %49)
store float %50, float* %13
%51 = load float, float* %13
%52 = call double @fabs(float %51)
%53 = fcmp olt double %52, 1.000000e-30
br i1 %53, label %54, label %55
54: ; preds = %34
store float 0x39B4484C00000000, float* %13
br label %55
55: ; preds = %54, %34
%56 = load float, float* %11
%57 = load float, float* %10
%58 = load float, float* %12
%59 = fdiv float %57, %58
%60 = fadd float %56, %59
store float %60, float* %12
%61 = load float, float* %12
%62 = call double @fabs(float %61)
%63 = fcmp olt double %62, 1.000000e-30
br i1 %63, label %64, label %65
64: ; preds = %55
store float 0x39B4484C00000000, float* %12
br label %65
65: ; preds = %64, %55
%66 = load float, float* %13
%67 = fpext float %66 to double
%68 = fdiv double 1.000000e+00, %67
%69 = fptrunc double %68 to float
store float %69, float* %13
%70 = load float, float* %13
%71 = load float, float* %12
%72 = fmul float %70, %71
store float %72, float* %14
%73 = load float, float* %14
%74 = load float, float* %15
%75 = fmul float %74, %73
store float %75, float* %15
%76 = load float, float* %14
%77 = fpext float %76 to double
%78 = fsub double %77, 1.000000e+00
%79 = fptrunc double %78 to float
%80 = call double @fabs(float %79)
%81 = fcmp olt double %80, 3.000000e-07
br i1 %81, label %82, label %83
82: ; preds = %65
br label %87
83: ; preds = %65
br label %84
84: ; preds = %83
%85 = load i32, i32* %9
%86 = add nsw i32 %85, 1
store i32 %86, i32* %9
br label %31
87: ; preds = %82, %31
%88 = load i32, i32* %9
%89 = icmp sgt i32 %88, 9000
br i1 %89, label %90, label %91
90: ; preds = %87
br label %91
91: ; preds = %90, %87
%92 = load float, float* %7
%93 = fneg float %92
%94 = load float, float* %6
%95 = load float, float* %7
%96 = call float @log(float %95)
%97 = call float @llvm.fmuladd.f32(float %94, float %96, float %93)
%98 = load float*, float** %8
%99 = load float, float* %98
%100 = fsub float %97, %99
%101 = call float @exp(float %100)
%102 = load float, float* %15
%103 = fmul float %101, %102
%104 = load float*, float** %5
store float %103, float* %104
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"a too large,ITMAX too small in gcf\00"
define void @gcf(float* nocapture writeonly %0, float %1, float %2, float* nocapture %3) {
%5 = tail call float @gammln(float %1)
store float %5, float* %3
%6 = fpext float %2 to double
%7 = fadd double %6, 1.000000e+00
%8 = fpext float %1 to double
%9 = fsub double %7, %8
%10 = fptrunc double %9 to float
%11 = fdiv float 1.000000e+00, %10
br label %15
12: ; preds = %15
%13 = add nuw nsw i32 %17, 1
%14 = icmp eq i32 %13, 9001
br i1 %14, label %42, label %15
15: ; preds = %4, %12
%16 = phi float [ %11, %4 ], [ %38, %12 ]
%17 = phi i32 [ 1, %4 ], [ %13, %12 ]
%18 = phi float [ %11, %4 ], [ %36, %12 ]
%19 = phi float [ 0x46293E5940000000, %4 ], [ %34, %12 ]
%20 = phi float [ %10, %4 ], [ %26, %12 ]
%21 = sub nsw i32 0, %17
%22 = sitofp i32 %21 to float
%23 = sitofp i32 %17 to float
%24 = fsub float %23, %1
%25 = fmul float %24, %22
%26 = fadd float %20, 2.000000e+00
%27 = tail call float @llvm.fmuladd.f32(float %25, float %18, float %26)
%28 = tail call double @fabs(float %27)
%29 = fcmp olt double %28, 1.000000e-30
%30 = fdiv float %25, %19
%31 = fadd float %26, %30
%32 = tail call double @fabs(float %31)
%33 = fcmp olt double %32, 1.000000e-30
%34 = select i1 %33, float 0x39B4484C00000000, float %31
%35 = fdiv float 1.000000e+00, %27
%36 = select i1 %29, float 0x46293E5940000000, float %35
%37 = fmul float %36, %34
%38 = fmul float %16, %37
%39 = fadd float %37, -1.000000e+00
%40 = tail call double @fabs(float %39)
%41 = fcmp olt double %40, 3.000000e-07
br i1 %41, label %43, label %12
42: ; preds = %12
tail call void @nrerror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %43
43: ; preds = %15, %42
%44 = fneg float %2
%45 = tail call float @log(float %2)
%46 = tail call float @llvm.fmuladd.f32(float %1, float %45, float %44)
%47 = load float, float* %3
%48 = fsub float %46, %47
%49 = tail call float @exp(float %48)
%50 = fmul float %38, %49
store float %50, float* %0
ret void
}