#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 */
scalar_t__ Gamma_Function_Max_Arg();
long double logl(int);
int xGamma_Function(long double);
long double xLn_Gamma_Function(long double);
long double xLn_Beta_Function(long double a, long double b) {
  if ((a + b) <= (long double)Gamma_Function_Max_Arg()) {
    if (a == 1.0L && b == 1.0L)
      return 0.0L;
    else
      return logl(xGamma_Function(a) /
                  (xGamma_Function(a + b) / xGamma_Function(b)));
  }
  return xLn_Gamma_Function(a) + xLn_Gamma_Function(b) -
         xLn_Gamma_Function(a + b);
}


x86 assembly (clang, -O0):
<xLn_Beta_Function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
faddp  %st,%st(1)
fstpt  -0x44(%rbp)
xor    %eax,%eax
call   1040 <Gamma_Function_Max_Arg@plt>
fldt   -0x44(%rbp)
mov    %rax,-0x38(%rbp)
fildll -0x38(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jb     1215 <xLn_Beta_Function+0xd5>
jmp    1182 <xLn_Beta_Function+0x42>
fldt   -0x20(%rbp)
fld1
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    11c4 <xLn_Beta_Function+0x84>
jp     11c4 <xLn_Beta_Function+0x84>
jmp    119e <xLn_Beta_Function+0x5e>
fldt   -0x30(%rbp)
fld1
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    11c4 <xLn_Beta_Function+0x84>
jp     11c4 <xLn_Beta_Function+0x84>
jmp    11ba <xLn_Beta_Function+0x7a>
fldz
fstpt  -0x10(%rbp)
jmp    1254 <xLn_Beta_Function+0x114>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <xGamma_Function@plt>
mov    %eax,-0x48(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <xGamma_Function@plt>
mov    %eax,-0x4c(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <xGamma_Function@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <logl@plt>
fstpt  -0x10(%rbp)
jmp    1254 <xLn_Beta_Function+0x114>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <xLn_Gamma_Function@plt>
fstpt  -0x64(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <xLn_Gamma_Function@plt>
fldt   -0x64(%rbp)
faddp  %st,%st(1)
fstpt  -0x58(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <xLn_Gamma_Function@plt>
fldt   -0x58(%rbp)
fsubp  %st,%st(1)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xLn_Beta_Function>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
fldt   0x70(%rsp)
fldt   0x60(%rsp)
fld    %st(1)
fstpt  0x1c(%rsp)
fld    %st(0)
fstpt  0x28(%rsp)
faddp  %st,%st(1)
fstpt  0x34(%rsp)
xor    %eax,%eax
call   1040 <Gamma_Function_Max_Arg@plt>
fldt   0x34(%rsp)
mov    %rax,0x40(%rsp)
fildll 0x40(%rsp)
fucomip %st(1),%st
fstp   %st(0)
jae    11b8 <xLn_Beta_Function+0x78>
fldt   0x28(%rsp)
fstpt  (%rsp)
call   1060 <xLn_Gamma_Function@plt>
fstpt  0x28(%rsp)
fldt   0x1c(%rsp)
fstpt  (%rsp)
call   1060 <xLn_Gamma_Function@plt>
fldt   0x28(%rsp)
faddp  %st,%st(1)
fstpt  0x1c(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1060 <xLn_Gamma_Function@plt>
fldt   0x1c(%rsp)
fsubp  %st,%st(1)
fldz
fldz
jmp    11e0 <xLn_Beta_Function+0xa0>
fldt   0x1c(%rsp)
fstp   %st(0)
fld1
fldt   0x28(%rsp)
fucomi %st(1),%st
fldz
fxch   %st(2)
fxch   %st(1)
jne    11eb <xLn_Beta_Function+0xab>
jp     11eb <xLn_Beta_Function+0xab>
fldt   0x1c(%rsp)
fucomip %st(2),%st
fstp   %st(1)
fldz
fxch   %st(1)
jne    11eb <xLn_Beta_Function+0xab>
jp     11eb <xLn_Beta_Function+0xab>
fstp   %st(1)
fstp   %st(0)
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret
fstp   %st(2)
fstp   %st(0)
fstpt  (%rsp)
call   1050 <xGamma_Function@plt>
mov    %eax,%ebx
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1050 <xGamma_Function@plt>
mov    %eax,%ebp
fldt   0x1c(%rsp)
fstpt  (%rsp)
call   1050 <xGamma_Function@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x48,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <logl@plt>

LLVM IR (-O0):
define x86_fp80 @xLn_Beta_Function(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
%6 = load x86_fp80, x86_fp80* %4
%7 = load x86_fp80, x86_fp80* %5
%8 = fadd x86_fp80 %6, %7
%9 = call i64 (...) @Gamma_Function_Max_Arg()
%10 = sitofp i64 %9 to x86_fp80
%11 = fcmp ole x86_fp80 %8, %10
br i1 %11, label %12, label %31
12: ; preds = %2
%13 = load x86_fp80, x86_fp80* %4
%14 = fcmp oeq x86_fp80 %13, 0xK3FFF8000000000000000
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load x86_fp80, x86_fp80* %5
%17 = fcmp oeq x86_fp80 %16, 0xK3FFF8000000000000000
br i1 %17, label %18, label %19
18: ; preds = %15
store x86_fp80 0xK00000000000000000000, x86_fp80* %3
br label %42
19: ; preds = %15, %12
%20 = load x86_fp80, x86_fp80* %4
%21 = call i32 @xGamma_Function(x86_fp80 %20)
%22 = load x86_fp80, x86_fp80* %4
%23 = load x86_fp80, x86_fp80* %5
%24 = fadd x86_fp80 %22, %23
%25 = call i32 @xGamma_Function(x86_fp80 %24)
%26 = load x86_fp80, x86_fp80* %5
%27 = call i32 @xGamma_Function(x86_fp80 %26)
%28 = sdiv i32 %25, %27
%29 = sdiv i32 %21, %28
%30 = call x86_fp80 @logl(i32 %29)
store x86_fp80 %30, x86_fp80* %3
br label %42
31: ; preds = %2
%32 = load x86_fp80, x86_fp80* %4
%33 = call x86_fp80 @xLn_Gamma_Function(x86_fp80 %32)
%34 = load x86_fp80, x86_fp80* %5
%35 = call x86_fp80 @xLn_Gamma_Function(x86_fp80 %34)
%36 = fadd x86_fp80 %33, %35
%37 = load x86_fp80, x86_fp80* %4
%38 = load x86_fp80, x86_fp80* %5
%39 = fadd x86_fp80 %37, %38
%40 = call x86_fp80 @xLn_Gamma_Function(x86_fp80 %39)
%41 = fsub x86_fp80 %36, %40
store x86_fp80 %41, x86_fp80* %3
br label %42
42: ; preds = %31, %19, %18
%43 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %43
}

LLVM IR (-O2):
define x86_fp80 @xLn_Beta_Function(x86_fp80 %0, x86_fp80 %1) {
%3 = fadd x86_fp80 %0, %1
%4 = tail call i64 (...) @Gamma_Function_Max_Arg()
%5 = sitofp i64 %4 to x86_fp80
%6 = fcmp ugt x86_fp80 %3, %5
br i1 %6, label %18, label %7
7: ; preds = %2
%8 = fcmp oeq x86_fp80 %0, 0xK3FFF8000000000000000
%9 = fcmp oeq x86_fp80 %1, 0xK3FFF8000000000000000
%10 = and i1 %8, %9
br i1 %10, label %24, label %11
11: ; preds = %7
%12 = tail call i32 @xGamma_Function(x86_fp80 %0)
%13 = tail call i32 @xGamma_Function(x86_fp80 %3)
%14 = tail call i32 @xGamma_Function(x86_fp80 %1)
%15 = sdiv i32 %13, %14
%16 = sdiv i32 %12, %15
%17 = tail call x86_fp80 @logl(i32 %16)
br label %24
18: ; preds = %2
%19 = tail call x86_fp80 @xLn_Gamma_Function(x86_fp80 %0)
%20 = tail call x86_fp80 @xLn_Gamma_Function(x86_fp80 %1)
%21 = fadd x86_fp80 %19, %20
%22 = tail call x86_fp80 @xLn_Gamma_Function(x86_fp80 %3)
%23 = fsub x86_fp80 %21, %22
br label %24
24: ; preds = %7, %18, %11
%25 = phi x86_fp80 [ %17, %11 ], [ %23, %18 ], [ 0xK00000000000000000000, %7 ]
ret x86_fp80 %25
}