#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);
double fabs(double);
double log(double);
void gcf(double *gammcf, double a, double x, double *gln) {
  double gammln(double xx);
  void nrerror(char error_text[]);
  int i;
  double 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 <= 100; 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 > 100)
    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    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <gammln@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe8c(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe7d(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe68(%rip),%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jg     12f3 <gcf+0x1b3>
xor    %eax,%eax
sub    -0x24(%rbp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe37(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
movaps 0xe1d(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xdf1(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1236 <gcf+0xf6>
movsd  0xddf(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
divsd  -0x40(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm1
movaps 0xdd6(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xdaa(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    127d <gcf+0x13d>
movsd  0xd98(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xd7b(%rip),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  0xd46(%rip),%xmm0
subsd  %xmm0,%xmm1
movaps 0xd6b(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd4f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12e0 <gcf+0x1a0>
jmp    12f3 <gcf+0x1b3>
jmp    12e5 <gcf+0x1a5>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b3 <gcf+0x73>
cmpl   $0x64,-0x24(%rbp)
jle    1309 <gcf+0x1c9>
lea    0xd3c(%rip),%rdi
call   1030 <nrerror@plt>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <log@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm0
call   1040 <exp@plt>
mulsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcf>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %rdi,%r14
call   1060 <gammln@plt>
movsd  0x10(%rsp),%xmm14
movsd  %xmm0,(%rbx)
movsd  0xe8e(%rip),%xmm8
movsd  0x8(%rsp),%xmm1
addsd  %xmm8,%xmm1
subsd  %xmm14,%xmm1
movapd %xmm8,%xmm4
divsd  %xmm1,%xmm4
movsd  0xe74(%rip),%xmm12
mov    $0x1,%eax
mov    $0xffffffff,%ecx
movsd  0xe69(%rip),%xmm9
movapd 0xe81(%rip),%xmm0
movsd  0xe61(%rip),%xmm5
movsd  0xe60(%rip),%xmm10
movapd 0xe67(%rip),%xmm11
movsd  0xe56(%rip),%xmm13
movapd %xmm4,%xmm6
movapd %xmm12,%xmm2
nopl   0x0(%rax,%rax,1)
xorps  %xmm3,%xmm3
cvtsi2sd %ecx,%xmm3
xorps  %xmm7,%xmm7
cvtsi2sd %eax,%xmm7
subsd  %xmm14,%xmm7
mulsd  %xmm3,%xmm7
addsd  %xmm9,%xmm1
mulsd  %xmm7,%xmm6
movapd %xmm6,%xmm3
addsd  %xmm1,%xmm3
movapd %xmm3,%xmm6
andpd  %xmm0,%xmm6
ucomisd %xmm6,%xmm5
movapd %xmm12,%xmm6
ja     1224 <gcf+0xe4>
movapd %xmm8,%xmm6
divsd  %xmm3,%xmm6
divsd  %xmm2,%xmm7
addsd  %xmm1,%xmm7
movapd %xmm7,%xmm2
andpd  %xmm0,%xmm2
cmpltsd %xmm5,%xmm2
movapd %xmm2,%xmm3
andnpd %xmm7,%xmm3
andpd  %xmm5,%xmm2
orpd   %xmm3,%xmm2
movapd %xmm6,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm3,%xmm4
addsd  %xmm10,%xmm3
andpd  %xmm11,%xmm3
ucomisd %xmm3,%xmm13
ja     128b <gcf+0x14b>
add    $0x1,%eax
add    $0xffffffff,%ecx
cmp    $0xffffff9b,%ecx
jne    11e0 <gcf+0xa0>
lea    0xdc4(%rip),%rdi
movsd  %xmm4,(%rsp)
call   1030 <nrerror@plt>
movsd  (%rsp),%xmm4
movsd  %xmm4,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <log@plt>
mulsd  0x10(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
subsd  (%rbx),%xmm0
call   1040 <exp@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

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