#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*/ printf(char *, double);
double r8_gamma_(double *);
double r8_lbeta_(double *, double *);
int main() {
  double x[] = {3.0};
  double res_gamma = r8_gamma_(x);
  printf("gamma fn: %.4f\n", res_gamma);
  double a[] = {2.0};
  double b[] = {3.0};
  double res_lbeta = r8_lbeta_(a, b);
  printf("gamma fn: %.4f\n", res_lbeta);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1050 <r8_gamma_@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    0xe98(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <r8_lbeta_@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x4008000000000000,%rbx
mov    %rbx,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   1050 <r8_gamma_@plt>
lea    0xea9(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movabs $0x4000000000000000,%rax
mov    %rax,0x8(%rsp)
mov    %rbx,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <r8_lbeta_@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.x = [1 x double] [double 3.000000e+00]
@.str = [16 x i8] c"gamma fn: %.4f\0A\00"
@__const.main.a = [1 x double] [double 2.000000e+00]
@__const.main.b = [1 x double] [double 3.000000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x double]
%3 = alloca double
%4 = alloca [1 x double]
%5 = alloca [1 x double]
%6 = alloca double
store i32 0, i32* %1
%7 = bitcast [1 x double]* %2 to i8*
%8 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%9 = call double @r8_gamma_(double* %8)
store double %9, double* %3
%10 = load double, double* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %10)
%12 = bitcast [1 x double]* %4 to i8*
%13 = bitcast [1 x double]* %5 to i8*
%14 = getelementptr inbounds [1 x double], [1 x double]* %4, i64 0, i64 0
%15 = getelementptr inbounds [1 x double], [1 x double]* %5, i64 0, i64 0
%16 = call double @r8_lbeta_(double* %14, double* %15)
store double %16, double* %6
%17 = load double, double* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"gamma fn: %.4f\0A\00"
define i32 @main() {
%1 = alloca [1 x double]
%2 = alloca [1 x double]
%3 = alloca [1 x double]
%4 = bitcast [1 x double]* %1 to i8*
%5 = bitcast [1 x double]* %1 to i64*
store i64 4613937818241073152, i64* %5
%6 = getelementptr inbounds [1 x double], [1 x double]* %1, i64 0, i64 0
%7 = call double @r8_gamma_(double* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %7)
%9 = bitcast [1 x double]* %2 to i8*
%10 = bitcast [1 x double]* %2 to i64*
store i64 4611686018427387904, i64* %10
%11 = bitcast [1 x double]* %3 to i8*
%12 = bitcast [1 x double]* %3 to i64*
store i64 4613937818241073152, i64* %12
%13 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%14 = getelementptr inbounds [1 x double], [1 x double]* %3, i64 0, i64 0
%15 = call double @r8_lbeta_(double* %13, double* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %15)
ret i32 0
}