#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 incbetf(double, double, float);
int /*<<< orphan*/ mtherr(char *, int);
float fdtrcf(int ia, int ib, float xx) {
  float x, a, b, w;
  x = xx;
  if ((ia < 1) || (ib < 1) || (x < 0.0)) {
    mtherr("fdtrcf", 1);
    return (0.0);
  }
  a = ia;
  b = ib;
  w = b / (b + a * x);
  return (incbetf(0.5 * b, 0.5 * a, w));
}


x86 assembly (clang, -O0):
<fdtrcf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1167 <fdtrcf+0x47>
cmpl   $0x1,-0xc(%rbp)
jl     1167 <fdtrcf+0x47>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1185 <fdtrcf+0x65>
lea    0xe9a(%rip),%rdi
mov    $0x1,%esi
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11f7 <fdtrcf+0xd7>
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe31(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe1c(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  -0x20(%rbp),%xmm2
call   1030 <incbetf@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdtrcf>:
push   %rax
test   %edi,%edi
jle    116a <fdtrcf+0x4a>
test   %esi,%esi
jle    116a <fdtrcf+0x4a>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     116a <fdtrcf+0x4a>
xorps  %xmm1,%xmm1
cvtsi2ss %edi,%xmm1
cvtsi2ss %esi,%xmm2
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
cvtss2sd %xmm2,%xmm3
divss  %xmm0,%xmm2
movsd  0xeac(%rip),%xmm0
mulsd  %xmm0,%xmm3
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm3,%xmm0
pop    %rax
jmp    1030 <incbetf@plt>
lea    0xe97(%rip),%rdi
mov    $0x1,%esi
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"fdtrcf\00"
define float @fdtrcf(i32 %0, i32 %1, float %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store float %2, float* %7
%12 = load float, float* %7
store float %12, float* %8
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 1
br i1 %14, label %22, label %15
15: ; preds = %3
%16 = load i32, i32* %6
%17 = icmp slt i32 %16, 1
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = load float, float* %8
%20 = fpext float %19 to double
%21 = fcmp olt double %20, 0.000000e+00
br i1 %21, label %22, label %24
22: ; preds = %18, %15, %3
%23 = call i32 @mtherr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
store float 0.000000e+00, float* %4
br label %43
24: ; preds = %18
%25 = load i32, i32* %5
%26 = sitofp i32 %25 to float
store float %26, float* %9
%27 = load i32, i32* %6
%28 = sitofp i32 %27 to float
store float %28, float* %10
%29 = load float, float* %10
%30 = load float, float* %10
%31 = load float, float* %9
%32 = load float, float* %8
%33 = call float @llvm.fmuladd.f32(float %31, float %32, float %30)
%34 = fdiv float %29, %33
store float %34, float* %11
%35 = load float, float* %10
%36 = fpext float %35 to double
%37 = fmul double 5.000000e-01, %36
%38 = load float, float* %9
%39 = fpext float %38 to double
%40 = fmul double 5.000000e-01, %39
%41 = load float, float* %11
%42 = call float @incbetf(double %37, double %40, float %41)
store float %42, float* %4
br label %43
43: ; preds = %24, %22
%44 = load float, float* %4
ret float %44
}

LLVM IR (-O2):
@.str = [7 x i8] c"fdtrcf\00"
define float @fdtrcf(i32 %0, i32 %1, float %2) {
%4 = icmp slt i32 %0, 1
%5 = icmp slt i32 %1, 1
%6 = or i1 %4, %5
%7 = fcmp olt float %2, 0.000000e+00
%8 = or i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 @mtherr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
br label %21
11: ; preds = %3
%12 = sitofp i32 %0 to float
%13 = sitofp i32 %1 to float
%14 = tail call float @llvm.fmuladd.f32(float %12, float %2, float %13)
%15 = fdiv float %13, %14
%16 = fpext float %13 to double
%17 = fmul double %16, 5.000000e-01
%18 = fpext float %12 to double
%19 = fmul double %18, 5.000000e-01
%20 = tail call float @incbetf(double %17, double %19, float %15)
br label %21
21: ; preds = %11, %9
%22 = phi float [ 0.000000e+00, %9 ], [ %20, %11 ]
ret float %22
}