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


x86 assembly (clang, -O0):
<gammadist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
fldz
fld    %st(0)
fstpt  -0x54(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
movzbl %al,%edi
call   1040 <assert@plt>
fldt   -0x54(%rbp)
fldt   -0x30(%rbp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
movzbl %al,%edi
call   1040 <assert@plt>
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fdivrp %st,%st(1)
fldt   -0x20(%rbp)
fld1
fchs
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1060 <pow@plt>
fstpt  -0x48(%rbp)
fldt   -0x10(%rbp)
fchs
fldt   -0x30(%rbp)
fdivrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <exp@plt>
fldt   -0x48(%rbp)
fmulp  %st,%st(1)
fstpt  -0x3c(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <tgamma@plt>
fldt   -0x3c(%rbp)
fldt   -0x30(%rbp)
fmulp  %st,%st(2)
fdivp  %st,%st(1)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gammadist>:
sub    $0x58,%rsp
fldt   0x60(%rsp)
fstpt  0x28(%rsp)
fldt   0x80(%rsp)
fstpt  0x34(%rsp)
fldt   0x70(%rsp)
fld    %st(0)
fstpt  0x4c(%rsp)
fldz
fld    %st(0)
fstpt  0x40(%rsp)
xor    %edi,%edi
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %dil
call   1040 <assert@plt>
xor    %edi,%edi
fldt   0x34(%rsp)
fldt   0x40(%rsp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %dil
call   1040 <assert@plt>
fldt   0x34(%rsp)
fldt   0x28(%rsp)
fdivp  %st,%st(1)
fld1
fchs
fldt   0x4c(%rsp)
faddp  %st,%st(1)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1060 <pow@plt>
fstpt  0x40(%rsp)
fldt   0x28(%rsp)
fchs
fldt   0x34(%rsp)
fdivrp %st,%st(1)
fstpt  (%rsp)
call   1050 <exp@plt>
fldt   0x40(%rsp)
fmulp  %st,%st(1)
fstpt  0x28(%rsp)
fldt   0x4c(%rsp)
fstpt  (%rsp)
call   1030 <tgamma@plt>
fldt   0x34(%rsp)
fmulp  %st,%st(1)
fldt   0x28(%rsp)
fdivp  %st,%st(1)
add    $0x58,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @gammadist(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* %5
%8 = fcmp ogt x86_fp80 %7, 0xK00000000000000000000
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load x86_fp80, x86_fp80* %6
%12 = fcmp ogt x86_fp80 %11, 0xK00000000000000000000
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load x86_fp80, x86_fp80* %4
%16 = load x86_fp80, x86_fp80* %6
%17 = fdiv x86_fp80 %15, %16
%18 = load x86_fp80, x86_fp80* %5
%19 = fsub x86_fp80 %18, 0xK3FFF8000000000000000
%20 = call x86_fp80 @pow(x86_fp80 %17, x86_fp80 %19)
%21 = load x86_fp80, x86_fp80* %4
%22 = fneg x86_fp80 %21
%23 = load x86_fp80, x86_fp80* %6
%24 = fdiv x86_fp80 %22, %23
%25 = call x86_fp80 @exp(x86_fp80 %24)
%26 = fmul x86_fp80 %20, %25
%27 = load x86_fp80, x86_fp80* %5
%28 = call x86_fp80 @tgamma(x86_fp80 %27)
%29 = load x86_fp80, x86_fp80* %6
%30 = fmul x86_fp80 %28, %29
%31 = fdiv x86_fp80 %26, %30
ret x86_fp80 %31
}

LLVM IR (-O2):
define x86_fp80 @gammadist(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = fcmp ogt x86_fp80 %1, 0xK00000000000000000000
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = fcmp ogt x86_fp80 %2, 0xK00000000000000000000
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = fdiv x86_fp80 %0, %2
%11 = fadd x86_fp80 %1, 0xKBFFF8000000000000000
%12 = tail call x86_fp80 @pow(x86_fp80 %10, x86_fp80 %11)
%13 = fneg x86_fp80 %0
%14 = fdiv x86_fp80 %13, %2
%15 = tail call x86_fp80 @exp(x86_fp80 %14)
%16 = fmul x86_fp80 %12, %15
%17 = tail call x86_fp80 @tgamma(x86_fp80 %1)
%18 = fmul x86_fp80 %17, %2
%19 = fdiv x86_fp80 %16, %18
ret x86_fp80 %19
}