#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 */
double exp(double const);
double gamm(double const);
double pow(double const, double const);
double dgamma(const double x, const double alpha, const double beta) {
  return pow(beta, alpha) * pow(x, alpha - 1.0) * exp(-beta * x) / gamm(alpha);
}


x86 assembly (clang, -O0):
<dgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe93(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <gamm@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgamma>:
sub    $0x38,%rsp
movaps %xmm2,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm2,%xmm0
call   1040 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xea5(%rip),%xmm1
addsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movapd 0x20(%rsp),%xmm0
xorpd  0xe8a(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1050 <gamm@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @dgamma(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* %6
%8 = load double, double* %5
%9 = call double @pow(double %7, double %8)
%10 = load double, double* %4
%11 = load double, double* %5
%12 = fsub double %11, 1.000000e+00
%13 = call double @pow(double %10, double %12)
%14 = fmul double %9, %13
%15 = load double, double* %6
%16 = fneg double %15
%17 = load double, double* %4
%18 = fmul double %16, %17
%19 = call double @exp(double %18)
%20 = fmul double %14, %19
%21 = load double, double* %5
%22 = call double @gamm(double %21)
%23 = fdiv double %20, %22
ret double %23
}

LLVM IR (-O2):
define double @dgamma(double %0, double %1, double %2) {
%4 = tail call double @pow(double %2, double %1)
%5 = fadd double %1, -1.000000e+00
%6 = tail call double @pow(double %0, double %5)
%7 = fmul double %4, %6
%8 = fneg double %2
%9 = fmul double %8, %0
%10 = tail call double @exp(double %9)
%11 = fmul double %7, %10
%12 = tail call double @gamm(double %1)
%13 = fdiv double %11, %12
ret double %13
}