#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 fabs(double);
double gp_exp(scalar_t__);
scalar_t__ lngamma(double);
double log(double);
double confrac(double a, double b, double x) {
  double Alo = 0.0;
  double Ahi;
  double Aev;
  double Aod;
  double Blo = 1.0;
  double Bhi = 1.0;
  double Bod = 1.0;
  double Bev = 1.0;
  double f;
  double fold;
  double Apb = a + b;
  double d;
  int i;
  int j;
  Ahi = gp_exp(lngamma((Apb)) + a * log(x) + b * log(1.0 - x) -
               lngamma((a + 1.0)) - lngamma((b)));
  for (i = 0, j = 1, f = Ahi; i <= 200; i++, j++) {
    d = a + j + i;
    Aev = -(a + i) * (Apb + i) * x / d / (d - 1.0);
    Aod = j * (b - j) * x / d / (d + 1.0);
    Alo = Bev * Ahi + Aev * Alo;
    Blo = Bev * Bhi + Aev * Blo;
    Ahi = Bod * Alo + Aod * Ahi;
    Bhi = Bod * Blo + Aod * Bhi;
    if (fabs(Bhi) < 1.0E-08)
      Bhi = 0.0;
    if (Bhi != 0.0) {
      fold = f;
      f = Ahi / Bhi;
      if (fabs(f - fold) < fabs(f) * 1.0E-08)
        return f;
    }
  }
  return -1.0;
}


x86 assembly (clang, -O0):
<confrac>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe7f(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1040 <lngamma@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1050 <log@plt>
movsd  -0xb8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xe05(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1050 <log@plt>
movsd  -0xa8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xdd0(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1040 <lngamma@plt>
movsd  -0x98(%rbp),%xmm0
ff
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1040 <lngamma@plt>
movsd  -0x90(%rbp),%xmm0
ff
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <gp_exp@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x1,-0x88(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0xc8,-0x84(%rbp)
jg     14c6 <confrac+0x396>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x88(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
cvtsi2sdl -0x84(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x84(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x78(%rbp),%xmm1
cvtsi2sdl -0x84(%rbp),%xmm2
ff
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  0xcdf(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
cvtsi2sdl -0x88(%rbp),%xmm0
ff
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x88(%rbp),%xmm2
ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x80(%rbp),%xmm0
movsd  0xca3(%rip),%xmm1
addsd  -0x80(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movaps 0xc25(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xc09(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1419 <confrac+0x2e9>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1436 <confrac+0x306>
jp     1436 <confrac+0x306>
jmp    149e <confrac+0x36e>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm1
subsd  -0x70(%rbp),%xmm1
movaps 0xbc0(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
movaps 0xbb0(%rip),%xmm2
pand   %xmm2,%xmm0
movsd  0xb94(%rip),%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1499 <confrac+0x369>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14d3 <confrac+0x3a3>
jmp    149e <confrac+0x36e>
jmp    14a3 <confrac+0x373>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    129b <confrac+0x16b>
movsd  0xb3a(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confrac>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
call   1040 <lngamma@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <log@plt>
mulsd  0x10(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe7b(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
call   1050 <log@plt>
mulsd  0x18(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xe52(%rip),%xmm0
call   1040 <lngamma@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <lngamma@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
call   1030 <gp_exp@plt>
movsd  0x8(%rsp),%xmm15
mov    $0x1,%eax
movsd  0xe04(%rip),%xmm11
movapd 0xe23(%rip),%xmm10
movsd  0xdfa(%rip),%xmm13
movapd 0xe11(%rip),%xmm12
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm14
movsd  0xdd0(%rip),%xmm5
movapd %xmm5,%xmm4
movapd %xmm5,%xmm9
movsd  0x10(%rsp),%xmm8
jmp    1260 <confrac+0x130>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x2(%rax),%ecx
cmp    $0xc8,%eax
mov    %ecx,%eax
je     1343 <confrac+0x213>
xorps  %xmm7,%xmm7
cvtsi2sd %eax,%xmm7
movsd  0x18(%rsp),%xmm1
subsd  %xmm7,%xmm1
mulsd  %xmm7,%xmm1
addsd  %xmm8,%xmm7
add    $0xffffffff,%eax
xorps  %xmm6,%xmm6
cvtsi2sd %eax,%xmm6
addsd  %xmm6,%xmm7
movsd  0x20(%rsp),%xmm3
addsd  %xmm6,%xmm3
addsd  %xmm8,%xmm6
xorpd  0xd81(%rip),%xmm6
mulsd  %xmm3,%xmm6
mulsd  %xmm15,%xmm6
divsd  %xmm7,%xmm6
movapd %xmm7,%xmm3
addsd  %xmm11,%xmm3
divsd  %xmm3,%xmm6
mulsd  %xmm15,%xmm1
divsd  %xmm7,%xmm1
addsd  %xmm9,%xmm7
divsd  %xmm7,%xmm1
mulsd  %xmm6,%xmm2
mulsd  %xmm6,%xmm4
addsd  %xmm0,%xmm2
addsd  %xmm5,%xmm4
mulsd  %xmm1,%xmm0
mulsd  %xmm5,%xmm1
addsd  %xmm4,%xmm1
movapd %xmm1,%xmm5
andpd  %xmm10,%xmm5
cmpltsd %xmm13,%xmm5
andnpd %xmm1,%xmm5
addsd  %xmm2,%xmm0
ucomisd 0xd12(%rip),%xmm5
jne    130e <confrac+0x1de>
jnp    1250 <confrac+0x120>
movapd %xmm0,%xmm1
divsd  %xmm5,%xmm1
movapd %xmm1,%xmm3
subsd  %xmm14,%xmm3
andpd  %xmm12,%xmm3
movapd %xmm1,%xmm6
andpd  %xmm12,%xmm6
mulsd  %xmm13,%xmm6
ucomisd %xmm3,%xmm6
movapd %xmm1,%xmm14
jbe    1250 <confrac+0x120>
jmp    1348 <confrac+0x218>
movapd %xmm11,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @confrac(double %0, double %1, double %2) {
%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 double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca i32
%21 = alloca i32
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double 0.000000e+00, double* %8
store double 1.000000e+00, double* %12
store double 1.000000e+00, double* %13
store double 1.000000e+00, double* %14
store double 1.000000e+00, double* %15
%22 = load double, double* %5
%23 = load double, double* %6
%24 = fadd double %22, %23
store double %24, double* %18
%25 = load double, double* %18
%26 = call i64 @lngamma(double %25)
%27 = sitofp i64 %26 to double
%28 = load double, double* %5
%29 = load double, double* %7
%30 = call double @log(double %29)
%31 = call double @llvm.fmuladd.f64(double %28, double %30, double %27)
%32 = load double, double* %6
%33 = load double, double* %7
%34 = fsub double 1.000000e+00, %33
%35 = call double @log(double %34)
%36 = call double @llvm.fmuladd.f64(double %32, double %35, double %31)
%37 = load double, double* %5
%38 = fadd double %37, 1.000000e+00
%39 = call i64 @lngamma(double %38)
%40 = sitofp i64 %39 to double
%41 = fsub double %36, %40
%42 = load double, double* %6
%43 = call i64 @lngamma(double %42)
%44 = sitofp i64 %43 to double
%45 = fsub double %41, %44
%46 = fptosi double %45 to i64
%47 = call double @gp_exp(i64 %46)
store double %47, double* %9
store i32 0, i32* %20
store i32 1, i32* %21
%48 = load double, double* %9
store double %48, double* %16
br label %49
49: ; preds = %139, %3
%50 = load i32, i32* %20
%51 = icmp sle i32 %50, 200
br i1 %51, label %52, label %144
52: ; preds = %49
%53 = load double, double* %5
%54 = load i32, i32* %21
%55 = sitofp i32 %54 to double
%56 = fadd double %53, %55
%57 = load i32, i32* %20
%58 = sitofp i32 %57 to double
%59 = fadd double %56, %58
store double %59, double* %19
%60 = load double, double* %5
%61 = load i32, i32* %20
%62 = sitofp i32 %61 to double
%63 = fadd double %60, %62
%64 = fneg double %63
%65 = load double, double* %18
%66 = load i32, i32* %20
%67 = sitofp i32 %66 to double
%68 = fadd double %65, %67
%69 = fmul double %64, %68
%70 = load double, double* %7
%71 = fmul double %69, %70
%72 = load double, double* %19
%73 = fdiv double %71, %72
%74 = load double, double* %19
%75 = fsub double %74, 1.000000e+00
%76 = fdiv double %73, %75
store double %76, double* %10
%77 = load i32, i32* %21
%78 = sitofp i32 %77 to double
%79 = load double, double* %6
%80 = load i32, i32* %21
%81 = sitofp i32 %80 to double
%82 = fsub double %79, %81
%83 = fmul double %78, %82
%84 = load double, double* %7
%85 = fmul double %83, %84
%86 = load double, double* %19
%87 = fdiv double %85, %86
%88 = load double, double* %19
%89 = fadd double %88, 1.000000e+00
%90 = fdiv double %87, %89
store double %90, double* %11
%91 = load double, double* %15
%92 = load double, double* %9
%93 = load double, double* %10
%94 = load double, double* %8
%95 = fmul double %93, %94
%96 = call double @llvm.fmuladd.f64(double %91, double %92, double %95)
store double %96, double* %8
%97 = load double, double* %15
%98 = load double, double* %13
%99 = load double, double* %10
%100 = load double, double* %12
%101 = fmul double %99, %100
%102 = call double @llvm.fmuladd.f64(double %97, double %98, double %101)
store double %102, double* %12
%103 = load double, double* %14
%104 = load double, double* %8
%105 = load double, double* %11
%106 = load double, double* %9
%107 = fmul double %105, %106
%108 = call double @llvm.fmuladd.f64(double %103, double %104, double %107)
store double %108, double* %9
%109 = load double, double* %14
%110 = load double, double* %12
%111 = load double, double* %11
%112 = load double, double* %13
%113 = fmul double %111, %112
%114 = call double @llvm.fmuladd.f64(double %109, double %110, double %113)
store double %114, double* %13
%115 = load double, double* %13
%116 = call double @llvm.fabs.f64(double %115)
%117 = fcmp olt double %116, 1.000000e-08
br i1 %117, label %118, label %119
118: ; preds = %52
store double 0.000000e+00, double* %13
br label %119
119: ; preds = %118, %52
%120 = load double, double* %13
%121 = fcmp une double %120, 0.000000e+00
br i1 %121, label %122, label %138
122: ; preds = %119
%123 = load double, double* %16
store double %123, double* %17
%124 = load double, double* %9
%125 = load double, double* %13
%126 = fdiv double %124, %125
store double %126, double* %16
%127 = load double, double* %16
%128 = load double, double* %17
%129 = fsub double %127, %128
%130 = call double @llvm.fabs.f64(double %129)
%131 = load double, double* %16
%132 = call double @llvm.fabs.f64(double %131)
%133 = fmul double %132, 1.000000e-08
%134 = fcmp olt double %130, %133
br i1 %134, label %135, label %137
135: ; preds = %122
%136 = load double, double* %16
store double %136, double* %4
br label %145
137: ; preds = %122
br label %138
138: ; preds = %137, %119
br label %139
139: ; preds = %138
%140 = load i32, i32* %20
%141 = add nsw i32 %140, 1
store i32 %141, i32* %20
%142 = load i32, i32* %21
%143 = add nsw i32 %142, 1
store i32 %143, i32* %21
br label %49
144: ; preds = %49
store double -1.000000e+00, double* %4
br label %145
145: ; preds = %144, %135
%146 = load double, double* %4
ret double %146
}

LLVM IR (-O2):
define double @confrac(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = tail call i64 @lngamma(double %4)
%6 = sitofp i64 %5 to double
%7 = tail call double @log(double %2)
%8 = tail call double @llvm.fmuladd.f64(double %0, double %7, double %6)
%9 = fsub double 1.000000e+00, %2
%10 = tail call double @log(double %9)
%11 = tail call double @llvm.fmuladd.f64(double %1, double %10, double %8)
%12 = fadd double %0, 1.000000e+00
%13 = tail call i64 @lngamma(double %12)
%14 = sitofp i64 %13 to double
%15 = fsub double %11, %14
%16 = tail call i64 @lngamma(double %1)
%17 = sitofp i64 %16 to double
%18 = fsub double %15, %17
%19 = fptosi double %18 to i64
%20 = tail call double @gp_exp(i64 %19)
br label %21
21: ; preds = %3, %66
%22 = phi i32 [ 1, %3 ], [ %69, %66 ]
%23 = phi i32 [ 0, %3 ], [ %68, %66 ]
%24 = phi double [ 0.000000e+00, %3 ], [ %48, %66 ]
%25 = phi double [ %20, %3 ], [ %52, %66 ]
%26 = phi double [ %20, %3 ], [ %67, %66 ]
%27 = phi double [ 1.000000e+00, %3 ], [ %50, %66 ]
%28 = phi double [ 1.000000e+00, %3 ], [ %57, %66 ]
%29 = sitofp i32 %22 to double
%30 = fadd double %29, %0
%31 = sitofp i32 %23 to double
%32 = fadd double %30, %31
%33 = fadd double %31, %0
%34 = fneg double %33
%35 = fadd double %4, %31
%36 = fmul double %35, %34
%37 = fmul double %36, %2
%38 = fdiv double %37, %32
%39 = fadd double %32, -1.000000e+00
%40 = fdiv double %38, %39
%41 = fsub double %1, %29
%42 = fmul double %41, %29
%43 = fmul double %42, %2
%44 = fdiv double %43, %32
%45 = fadd double %32, 1.000000e+00
%46 = fdiv double %44, %45
%47 = fmul double %24, %40
%48 = fadd double %25, %47
%49 = fmul double %27, %40
%50 = fadd double %28, %49
%51 = fmul double %25, %46
%52 = fadd double %48, %51
%53 = fmul double %28, %46
%54 = fadd double %50, %53
%55 = tail call double @llvm.fabs.f64(double %54)
%56 = fcmp olt double %55, 1.000000e-08
%57 = select i1 %56, double 0.000000e+00, double %54
%58 = fcmp une double %57, 0.000000e+00
br i1 %58, label %59, label %66
59: ; preds = %21
%60 = fdiv double %52, %57
%61 = fsub double %60, %26
%62 = tail call double @llvm.fabs.f64(double %61)
%63 = tail call double @llvm.fabs.f64(double %60)
%64 = fmul double %63, 1.000000e-08
%65 = fcmp olt double %62, %64
br i1 %65, label %71, label %66
66: ; preds = %21, %59
%67 = phi double [ %60, %59 ], [ %26, %21 ]
%68 = add nuw nsw i32 %23, 1
%69 = add nuw nsw i32 %22, 1
%70 = icmp eq i32 %68, 201
br i1 %70, label %71, label %21
71: ; preds = %66, %59
%72 = phi double [ %60, %59 ], [ -1.000000e+00, %66 ]
ret double %72
}