#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 */
int /*<<< orphan*/ assert(int);
long double pow(int, long double);
long double tgamma(long double);
long double betadist(long double x, long double alpha, long double beta) {
  assert(x >= 0);
  assert(x <= 1);
  assert(alpha > 0);
  assert(beta > 0);
  return pow(x, alpha - 1) * pow(1 - x, beta - 1) * tgamma(alpha + beta) /
         (tgamma(alpha) * tgamma(beta));
}


x86 assembly (clang, -O0):
<betadist>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldz
fld    %st(0)
fstpt  -0x88(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
movzbl %al,%edi
call   1040 <assert@plt>
fldt   -0x10(%rbp)
fld1
fld    %st(0)
fstpt  -0x7c(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
movzbl %al,%edi
call   1040 <assert@plt>
fldt   -0x88(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
movzbl %al,%edi
call   1040 <assert@plt>
fldt   -0x88(%rbp)
fldt   -0x30(%rbp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
movzbl %al,%edi
call   1040 <assert@plt>
fldt   -0x7c(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x3a(%rbp)
movzwl -0x3a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x3c(%rbp)
fldcw  -0x3c(%rbp)
fistpl -0x38(%rbp)
fldcw  -0x3a(%rbp)
mov    -0x38(%rbp),%edi
fldt   -0x20(%rbp)
fsubp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <pow@plt>
fldt   -0x7c(%rbp)
fxch   %st(1)
fstpt  -0x70(%rbp)
fldt   -0x10(%rbp)
fsubr  %st(1),%st
fnstcw -0x3e(%rbp)
movzwl -0x3e(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x40(%rbp)
fldcw  -0x40(%rbp)
fistpl -0x34(%rbp)
fldcw  -0x3e(%rbp)
mov    -0x34(%rbp),%edi
fldt   -0x30(%rbp)
fsubp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <pow@plt>
fldt   -0x70(%rbp)
fmulp  %st,%st(1)
fstpt  -0x64(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <tgamma@plt>
fldt   -0x64(%rbp)
fmulp  %st,%st(1)
fstpt  -0x4c(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <tgamma@plt>
fstpt  -0x58(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <tgamma@plt>
fldt   -0x58(%rbp)
fldt   -0x4c(%rbp)
fxch   %st(1)
fmulp  %st,%st(2)
fdivp  %st,%st(1)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<betadist>:
sub    $0x68,%rsp
fldt   0x90(%rsp)
fstpt  0x48(%rsp)
fldt   0x80(%rsp)
fstpt  0x30(%rsp)
fldt   0x70(%rsp)
fld    %st(0)
fstpt  0x20(%rsp)
fldz
fld    %st(0)
fstpt  0x3c(%rsp)
xor    %edi,%edi
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %dil
call   1040 <assert@plt>
fld1
fld    %st(0)
fstpt  0x5c(%rsp)
xor    %edi,%edi
fldt   0x20(%rsp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %dil
call   1040 <assert@plt>
xor    %edi,%edi
fldt   0x30(%rsp)
fldt   0x3c(%rsp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %dil
call   1040 <assert@plt>
xor    %edi,%edi
fldt   0x48(%rsp)
fldt   0x3c(%rsp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %dil
call   1040 <assert@plt>
fnstcw 0x1e(%rsp)
movzwl 0x1e(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x2e(%rsp)
fldcw  0x2e(%rsp)
fldt   0x20(%rsp)
fistpl 0x54(%rsp)
fldcw  0x1e(%rsp)
mov    0x54(%rsp),%edi
fldt   0x5c(%rsp)
fchs
fld    %st(0)
fstpt  0x3c(%rsp)
fldt   0x30(%rsp)
faddp  %st,%st(1)
fstpt  (%rsp)
call   1050 <pow@plt>
fldt   0x20(%rsp)
fldt   0x5c(%rsp)
fsubp  %st,%st(1)
fnstcw 0x1c(%rsp)
movzwl 0x1c(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x2c(%rsp)
fldcw  0x2c(%rsp)
fistpl 0x58(%rsp)
fldcw  0x1c(%rsp)
fstpt  0x20(%rsp)
mov    0x58(%rsp),%edi
fldt   0x48(%rsp)
fldt   0x3c(%rsp)
faddp  %st,%st(1)
fstpt  (%rsp)
call   1050 <pow@plt>
fldt   0x20(%rsp)
fmulp  %st,%st(1)
fstpt  0x20(%rsp)
fldt   0x48(%rsp)
fldt   0x30(%rsp)
faddp  %st,%st(1)
fstpt  (%rsp)
call   1030 <tgamma@plt>
fldt   0x20(%rsp)
fmulp  %st,%st(1)
fstpt  0x20(%rsp)
fldt   0x30(%rsp)
fstpt  (%rsp)
call   1030 <tgamma@plt>
fstpt  0x30(%rsp)
fldt   0x48(%rsp)
fstpt  (%rsp)
call   1030 <tgamma@plt>
fldt   0x30(%rsp)
fmulp  %st,%st(1)
fldt   0x20(%rsp)
fdivp  %st,%st(1)
add    $0x68,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @betadist(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp oge x86_fp80 %7, 0xK00000000000000000000
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load x86_fp80, x86_fp80* %4
%12 = fcmp ole x86_fp80 %11, 0xK3FFF8000000000000000
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load x86_fp80, x86_fp80* %5
%16 = fcmp ogt x86_fp80 %15, 0xK00000000000000000000
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load x86_fp80, x86_fp80* %6
%20 = fcmp ogt x86_fp80 %19, 0xK00000000000000000000
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load x86_fp80, x86_fp80* %4
%24 = fptosi x86_fp80 %23 to i32
%25 = load x86_fp80, x86_fp80* %5
%26 = fsub x86_fp80 %25, 0xK3FFF8000000000000000
%27 = call x86_fp80 @pow(i32 %24, x86_fp80 %26)
%28 = load x86_fp80, x86_fp80* %4
%29 = fsub x86_fp80 0xK3FFF8000000000000000, %28
%30 = fptosi x86_fp80 %29 to i32
%31 = load x86_fp80, x86_fp80* %6
%32 = fsub x86_fp80 %31, 0xK3FFF8000000000000000
%33 = call x86_fp80 @pow(i32 %30, x86_fp80 %32)
%34 = fmul x86_fp80 %27, %33
%35 = load x86_fp80, x86_fp80* %5
%36 = load x86_fp80, x86_fp80* %6
%37 = fadd x86_fp80 %35, %36
%38 = call x86_fp80 @tgamma(x86_fp80 %37)
%39 = fmul x86_fp80 %34, %38
%40 = load x86_fp80, x86_fp80* %5
%41 = call x86_fp80 @tgamma(x86_fp80 %40)
%42 = load x86_fp80, x86_fp80* %6
%43 = call x86_fp80 @tgamma(x86_fp80 %42)
%44 = fmul x86_fp80 %41, %43
%45 = fdiv x86_fp80 %39, %44
ret x86_fp80 %45
}

LLVM IR (-O2):
define x86_fp80 @betadist(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = fcmp oge x86_fp80 %0, 0xK00000000000000000000
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = fcmp ole x86_fp80 %0, 0xK3FFF8000000000000000
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = fcmp ogt x86_fp80 %1, 0xK00000000000000000000
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = fcmp ogt x86_fp80 %2, 0xK00000000000000000000
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = fptosi x86_fp80 %0 to i32
%17 = fadd x86_fp80 %1, 0xKBFFF8000000000000000
%18 = tail call x86_fp80 @pow(i32 %16, x86_fp80 %17)
%19 = fsub x86_fp80 0xK3FFF8000000000000000, %0
%20 = fptosi x86_fp80 %19 to i32
%21 = fadd x86_fp80 %2, 0xKBFFF8000000000000000
%22 = tail call x86_fp80 @pow(i32 %20, x86_fp80 %21)
%23 = fmul x86_fp80 %18, %22
%24 = fadd x86_fp80 %1, %2
%25 = tail call x86_fp80 @tgamma(x86_fp80 %24)
%26 = fmul x86_fp80 %23, %25
%27 = tail call x86_fp80 @tgamma(x86_fp80 %1)
%28 = tail call x86_fp80 @tgamma(x86_fp80 %2)
%29 = fmul x86_fp80 %27, %28
%30 = fdiv x86_fp80 %26, %29
ret x86_fp80 %30
}