double BetaCF(alpha, beta, x)
double alpha, beta, x;
{
  int m;
  double qap, qam, qab, em, tem, d, bz, bp, bpp, ap, app, aold,
      bm = 1.0, az = 1.0, am = 1.0;
  qab = alpha + beta;
  qap = alpha + 1.0;
  qam = alpha - 1.0;
  bz = 1.0 - (qab * x / qap);
  for (m = 1; m <= 100; m++) {
    em = (double)m;
    tem = em + em;
    d = em * (beta - em) * x / ((qam + tem) * (alpha + tem));
    ap = az + d * am;
    bp = bz + d * bm;
    d = -(alpha + em) * (qab + em) * x / ((qap + tem) * (alpha + tem));
    app = ap + d * az;
    bpp = bp + d * bz;
    aold = az;
    am = ap / bpp;
    bm = bp / bpp;
    az = app / bpp;
    bz = 1.0;
    if (fabs(az - aold) < (1.0e-7 * fabs(az)))
      return az;
  }
  printf("Internal error in 'BetaCF': MAX_ITER exceeded\n");
  return 0.0;
}


x86 assembly (clang, -O0):
<BetaCF>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xebe(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe8f(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe78(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x40(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  -0x30(%rbp),%xmm1
movsd  0xe58(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jg     13a1 <BetaCF+0x291>
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x48(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
addsd  -0x50(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
addsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x58(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x40(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  -0x50(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
addsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xccd(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x98(%rbp),%xmm1
ff
subsd  -0x88(%rbp),%xmm1
ff
movaps 0xcc1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
movaps 0xcae(%rip),%xmm0
pand   %xmm0,%xmm2
movsd  0xc9a(%rip),%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    138e <BetaCF+0x27e>
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    13b7 <BetaCF+0x2a7>
jmp    1393 <BetaCF+0x283>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b8 <BetaCF+0xa8>
lea    0xc78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BetaCF>:
push   %rax
movapd %xmm0,%xmm13
addsd  %xmm1,%xmm13
movsd  0xedd(%rip),%xmm3
movapd %xmm0,%xmm10
addsd  %xmm3,%xmm10
movsd  0xed2(%rip),%xmm12
addsd  %xmm0,%xmm12
movapd %xmm13,%xmm4
mulsd  %xmm2,%xmm4
divsd  %xmm10,%xmm4
subsd  %xmm4,%xmm3
movapd 0xecb(%rip),%xmm7
unpcklpd %xmm3,%xmm7
movapd 0xece(%rip),%xmm15
mov    $0x1,%eax
movapd 0xed0(%rip),%xmm8
movapd 0xed7(%rip),%xmm11
movsd  0xe8e(%rip),%xmm9
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
movapd %xmm3,%xmm5
addsd  %xmm3,%xmm5
movapd %xmm1,%xmm6
subsd  %xmm3,%xmm6
mulsd  %xmm3,%xmm6
mulsd  %xmm2,%xmm6
movapd %xmm12,%xmm4
addsd  %xmm5,%xmm4
movapd %xmm10,%xmm14
addsd  %xmm5,%xmm14
addsd  %xmm0,%xmm5
mulsd  %xmm5,%xmm4
divsd  %xmm4,%xmm6
unpcklpd %xmm6,%xmm6
mulpd  %xmm15,%xmm6
addpd  %xmm7,%xmm6
movapd %xmm13,%xmm4
addsd  %xmm3,%xmm4
addsd  %xmm0,%xmm3
xorpd  %xmm8,%xmm3
mulsd  %xmm4,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm14,%xmm5
divsd  %xmm5,%xmm3
unpcklpd %xmm3,%xmm3
mulpd  %xmm7,%xmm3
addpd  %xmm6,%xmm3
movapd %xmm3,%xmm4
unpckhpd %xmm3,%xmm4
divsd  %xmm4,%xmm3
movapd %xmm3,%xmm5
subsd  %xmm7,%xmm5
andpd  %xmm11,%xmm5
movapd %xmm3,%xmm7
andpd  %xmm11,%xmm7
mulsd  %xmm9,%xmm7
ucomisd %xmm5,%xmm7
ja     1269 <BetaCF+0x159>
divpd  %xmm4,%xmm6
add    $0x1,%eax
shufpd $0x2,0xe19(%rip),%xmm3
movapd %xmm3,%xmm7
movapd %xmm6,%xmm15
cmp    $0x65,%eax
jne    1190 <BetaCF+0x80>
lea    0xe10(%rip),%rdi
call   1030 <puts@plt>
xorpd  %xmm3,%xmm3
movapd %xmm3,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Internal error in 'BetaCF': MAX_ITER exceeded\0A\00"
define double @BetaCF(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%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
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double 1.000000e+00, double* %21
store double 1.000000e+00, double* %22
store double 1.000000e+00, double* %23
%24 = load double, double* %5
%25 = load double, double* %6
%26 = fadd double %24, %25
store double %26, double* %11
%27 = load double, double* %5
%28 = fadd double %27, 1.000000e+00
store double %28, double* %9
%29 = load double, double* %5
%30 = fsub double %29, 1.000000e+00
store double %30, double* %10
%31 = load double, double* %11
%32 = load double, double* %7
%33 = fmul double %31, %32
%34 = load double, double* %9
%35 = fdiv double %33, %34
%36 = fsub double 1.000000e+00, %35
store double %36, double* %15
store i32 1, i32* %8
br label %37
37: ; preds = %116, %3
%38 = load i32, i32* %8
%39 = icmp sle i32 %38, 100
br i1 %39, label %40, label %119
40: ; preds = %37
%41 = load i32, i32* %8
%42 = sitofp i32 %41 to double
store double %42, double* %12
%43 = load double, double* %12
%44 = load double, double* %12
%45 = fadd double %43, %44
store double %45, double* %13
%46 = load double, double* %12
%47 = load double, double* %6
%48 = load double, double* %12
%49 = fsub double %47, %48
%50 = fmul double %46, %49
%51 = load double, double* %7
%52 = fmul double %50, %51
%53 = load double, double* %10
%54 = load double, double* %13
%55 = fadd double %53, %54
%56 = load double, double* %5
%57 = load double, double* %13
%58 = fadd double %56, %57
%59 = fmul double %55, %58
%60 = fdiv double %52, %59
store double %60, double* %14
%61 = load double, double* %22
%62 = load double, double* %14
%63 = load double, double* %23
%64 = call double @llvm.fmuladd.f64(double %62, double %63, double %61)
store double %64, double* %18
%65 = load double, double* %15
%66 = load double, double* %14
%67 = load double, double* %21
%68 = call double @llvm.fmuladd.f64(double %66, double %67, double %65)
store double %68, double* %16
%69 = load double, double* %5
%70 = load double, double* %12
%71 = fadd double %69, %70
%72 = fneg double %71
%73 = load double, double* %11
%74 = load double, double* %12
%75 = fadd double %73, %74
%76 = fmul double %72, %75
%77 = load double, double* %7
%78 = fmul double %76, %77
%79 = load double, double* %9
%80 = load double, double* %13
%81 = fadd double %79, %80
%82 = load double, double* %5
%83 = load double, double* %13
%84 = fadd double %82, %83
%85 = fmul double %81, %84
%86 = fdiv double %78, %85
store double %86, double* %14
%87 = load double, double* %18
%88 = load double, double* %14
%89 = load double, double* %22
%90 = call double @llvm.fmuladd.f64(double %88, double %89, double %87)
store double %90, double* %19
%91 = load double, double* %16
%92 = load double, double* %14
%93 = load double, double* %15
%94 = call double @llvm.fmuladd.f64(double %92, double %93, double %91)
store double %94, double* %17
%95 = load double, double* %22
store double %95, double* %20
%96 = load double, double* %18
%97 = load double, double* %17
%98 = fdiv double %96, %97
store double %98, double* %23
%99 = load double, double* %16
%100 = load double, double* %17
%101 = fdiv double %99, %100
store double %101, double* %21
%102 = load double, double* %19
%103 = load double, double* %17
%104 = fdiv double %102, %103
store double %104, double* %22
store double 1.000000e+00, double* %15
%105 = load double, double* %22
%106 = load double, double* %20
%107 = fsub double %105, %106
%108 = call double @llvm.fabs.f64(double %107)
%109 = load double, double* %22
%110 = call double @llvm.fabs.f64(double %109)
%111 = fmul double 0x3E7AD7F29ABCAF48, %110
%112 = fcmp olt double %108, %111
br i1 %112, label %113, label %115
113: ; preds = %40
%114 = load double, double* %22
store double %114, double* %4
br label %121
115: ; preds = %40
br label %116
116: ; preds = %115
%117 = load i32, i32* %8
%118 = add nsw i32 %117, 1
store i32 %118, i32* %8
br label %37
119: ; preds = %37
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
store double 0.000000e+00, double* %4
br label %121
121: ; preds = %119, %113
%122 = load double, double* %4
ret double %122
}

LLVM IR (-O2):
@str = [46 x i8] c"Internal error in 'BetaCF': MAX_ITER exceeded\00"
define double @BetaCF(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fadd double %0, 1.000000e+00
%6 = fadd double %0, -1.000000e+00
%7 = fmul double %4, %2
%8 = fdiv double %7, %5
%9 = fsub double 1.000000e+00, %8
%10 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %9, i64 1
br label %11
11: ; preds = %3, %47
%12 = phi i32 [ 1, %3 ], [ %51, %47 ]
%13 = phi <2 x double> [ %10, %3 ], [ %53, %47 ]
%14 = phi <2 x double> [ <double 1.000000e+00, double 1.000000e+00>, %3 ], [ %50, %47 ]
%15 = sitofp i32 %12 to double
%16 = fadd double %15, %15
%17 = fsub double %1, %15
%18 = fmul double %17, %15
%19 = fmul double %18, %2
%20 = fadd double %6, %16
%21 = fadd double %16, %0
%22 = fmul double %20, %21
%23 = fdiv double %19, %22
%24 = insertelement <2 x double> poison, double %23, i64 0
%25 = shufflevector <2 x double> %24, <2 x double> poison, <2 x i32> zeroinitializer
%26 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> %14, <2 x double> %13)
%27 = fadd double %15, %0
%28 = fneg double %27
%29 = fadd double %4, %15
%30 = fmul double %29, %28
%31 = fmul double %30, %2
%32 = fadd double %5, %16
%33 = fmul double %32, %21
%34 = fdiv double %31, %33
%35 = insertelement <2 x double> poison, double %34, i64 0
%36 = shufflevector <2 x double> %35, <2 x double> poison, <2 x i32> zeroinitializer
%37 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %36, <2 x double> %13, <2 x double> %26)
%38 = extractelement <2 x double> %37, i64 0
%39 = extractelement <2 x double> %37, i64 1
%40 = fdiv double %38, %39
%41 = extractelement <2 x double> %13, i64 0
%42 = fsub double %40, %41
%43 = tail call double @llvm.fabs.f64(double %42)
%44 = tail call double @llvm.fabs.f64(double %40)
%45 = fmul double %44, 0x3E7AD7F29ABCAF48
%46 = fcmp olt double %43, %45
br i1 %46, label %56, label %47
47: ; preds = %11
%48 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> %14, <2 x double> %13)
%49 = shufflevector <2 x double> %37, <2 x double> undef, <2 x i32> <i32 1, i32 1>
%50 = fdiv <2 x double> %48, %49
%51 = add nuw nsw i32 %12, 1
%52 = icmp eq i32 %51, 101
%53 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %40, i64 0
br i1 %52, label %54, label %11
54: ; preds = %47
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
br label %56
56: ; preds = %11, %54
%57 = phi double [ 0.000000e+00, %54 ], [ %40, %11 ]
ret double %57
}