#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__ LnGamma(double);
int /*<<< orphan*/ error2(char *);
double exp(scalar_t__);
double pow(double, double);
double DFGamma(double x, double alpha, double beta) {
  if (alpha <= 0 || beta <= 0)
    error2("err in DFGamma()");
  if (alpha > 100)
    error2("large alpha in DFGamma()");
  return pow(beta * x, alpha) / x * exp(-beta * x - LnGamma(alpha));
}


x86 assembly (clang, -O0):
<DFGamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jae    1173 <DFGamma+0x33>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     117f <DFGamma+0x3f>
lea    0xe8e(%rip),%rdi
call   1030 <error2@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe74(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a2 <DFGamma+0x62>
lea    0xe7c(%rip),%rdi
call   1030 <error2@plt>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <pow@plt>
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <LnGamma@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
cvtsi2sd %rax,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DFGamma>:
sub    $0x28,%rsp
movaps %xmm2,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm1,(%rsp)
ucomisd %xmm1,%xmm0
jae    1166 <DFGamma+0x26>
ucomisd 0x10(%rsp),%xmm0
jb     1172 <DFGamma+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <error2@plt>
movsd  (%rsp),%xmm0
ucomisd 0xe81(%rip),%xmm0
jbe    118d <DFGamma+0x4d>
lea    0xea9(%rip),%rdi
call   1030 <error2@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1050 <pow@plt>
divsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movaps 0x10(%rsp),%xmm0
xorps  0xe55(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1060 <LnGamma@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movapd 0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
call   1040 <exp@plt>
mulsd  0x20(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"err in DFGamma()\00"
@.str.1 = [25 x i8] c"large alpha in DFGamma()\00"
define double @DFGamma(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = fcmp ole double %7, 0.000000e+00
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load double, double* %6
%11 = fcmp ole double %10, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %9, %3
%13 = call i32 @error2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = load double, double* %5
%16 = fcmp ogt double %15, 1.000000e+02
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @error2(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
%20 = load double, double* %6
%21 = load double, double* %4
%22 = fmul double %20, %21
%23 = load double, double* %5
%24 = call double @pow(double %22, double %23)
%25 = load double, double* %4
%26 = fdiv double %24, %25
%27 = load double, double* %6
%28 = fneg double %27
%29 = load double, double* %4
%30 = load double, double* %5
%31 = call i64 @LnGamma(double %30)
%32 = sitofp i64 %31 to double
%33 = fneg double %32
%34 = call double @llvm.fmuladd.f64(double %28, double %29, double %33)
%35 = fptosi double %34 to i64
%36 = call double @exp(i64 %35)
%37 = fmul double %26, %36
ret double %37
}

LLVM IR (-O2):
@.str = [17 x i8] c"err in DFGamma()\00"
@.str.1 = [25 x i8] c"large alpha in DFGamma()\00"
define double @DFGamma(double %0, double %1, double %2) {
%4 = fcmp ole double %1, 0.000000e+00
%5 = fcmp ole double %2, 0.000000e+00
%6 = or i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @error2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %3, %7
%10 = fcmp ogt double %1, 1.000000e+02
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = tail call i32 @error2(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = fmul double %0, %2
%15 = tail call double @pow(double %14, double %1)
%16 = fdiv double %15, %0
%17 = fneg double %2
%18 = tail call i64 @LnGamma(double %1)
%19 = sitofp i64 %18 to double
%20 = fneg double %19
%21 = tail call double @llvm.fmuladd.f64(double %17, double %0, double %20)
%22 = fptosi double %21 to i64
%23 = tail call double @exp(i64 %22)
%24 = fmul double %16, %23
ret double %24
}