#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*/ beta_cdf_(double *, double *, double *, double *);
int /*<<< orphan*/ beta_cdf_inv_(double *, double *, double *, double *);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double x[1];
  double cdf[] = {0.1808};
  double p[] = {2.0};
  double q[] = {3.0};
  beta_cdf_inv_(cdf, p, q, x);
  printf("Inv. Beta: %.4f\n", x[0]);
  double cdf_2[1];
  double x_2[] = {0.2};
  double a[] = {2.0};
  double b[] = {3.0};
  beta_cdf_(x_2, a, b, cdf_2);
  printf("Beta: %.4f\n", cdf_2[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <beta_cdf_inv_@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe9f(%rip),%rdi
call   1050 <printf@plt>
mov    0xe8b(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe70(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe6d(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    -0x38(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x48(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1040 <beta_cdf_@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xe5d(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movabs $0x3fc72474538ef34d,%rax
24 c7 3f
mov    %rax,0x38(%rsp)
movabs $0x4000000000000000,%r14
mov    %r14,0x30(%rsp)
movabs $0x4008000000000000,%rbx
mov    %rbx,0x28(%rsp)
lea    0x38(%rsp),%rdi
lea    0x30(%rsp),%rsi
lea    0x28(%rsp),%rdx
lea    0x40(%rsp),%rcx
call   1030 <beta_cdf_inv_@plt>
movsd  0x40(%rsp),%xmm0
lea    0xe76(%rip),%rdi
call   1050 <printf@plt>
movabs $0x3fc999999999999a,%rax
99 c9 3f
mov    %rax,0x18(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x8(%rsp)
lea    0x18(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x20(%rsp),%rcx
call   1040 <beta_cdf_@plt>
movsd  0x20(%rsp),%xmm0
lea    0xe37(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.cdf = [1 x double] [double 1.808000e-01]
@__const.main.p = [1 x double] [double 2.000000e+00]
@__const.main.q = [1 x double] [double 3.000000e+00]
@.str = [17 x i8] c"Inv. Beta: %.4f\0A\00"
@__const.main.x_2 = [1 x double] [double 2.000000e-01]
@__const.main.a = [1 x double] [double 2.000000e+00]
@__const.main.b = [1 x double] [double 3.000000e+00]
@.str.1 = [12 x i8] c"Beta: %.4f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x double]
%3 = alloca [1 x double]
%4 = alloca [1 x double]
%5 = alloca [1 x double]
%6 = alloca [1 x double]
%7 = alloca [1 x double]
%8 = alloca [1 x double]
%9 = alloca [1 x double]
store i32 0, i32* %1
%10 = bitcast [1 x double]* %3 to i8*
%11 = bitcast [1 x double]* %4 to i8*
%12 = bitcast [1 x double]* %5 to i8*
%13 = getelementptr inbounds [1 x double], [1 x double]* %3, i64 0, i64 0
%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 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%17 = call i32 @beta_cdf_inv_(double* %13, double* %14, double* %15, double* %16)
%18 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%19 = load double, double* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %19)
%21 = bitcast [1 x double]* %7 to i8*
%22 = bitcast [1 x double]* %8 to i8*
%23 = bitcast [1 x double]* %9 to i8*
%24 = getelementptr inbounds [1 x double], [1 x double]* %7, i64 0, i64 0
%25 = getelementptr inbounds [1 x double], [1 x double]* %8, i64 0, i64 0
%26 = getelementptr inbounds [1 x double], [1 x double]* %9, i64 0, i64 0
%27 = getelementptr inbounds [1 x double], [1 x double]* %6, i64 0, i64 0
%28 = call i32 @beta_cdf_(double* %24, double* %25, double* %26, double* %27)
%29 = getelementptr inbounds [1 x double], [1 x double]* %6, i64 0, i64 0
%30 = load double, double* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Inv. Beta: %.4f\0A\00"
@.str.1 = [12 x i8] c"Beta: %.4f\0A\00"
define i32 @main() {
%1 = alloca [1 x double]
%2 = alloca [1 x double]
%3 = alloca [1 x double]
%4 = alloca [1 x double]
%5 = alloca [1 x double]
%6 = alloca [1 x double]
%7 = alloca [1 x double]
%8 = alloca [1 x double]
%9 = bitcast [1 x double]* %1 to i8*
%10 = bitcast [1 x double]* %2 to i8*
%11 = bitcast [1 x double]* %2 to i64*
store i64 4595682026791564109, i64* %11
%12 = bitcast [1 x double]* %3 to i8*
%13 = bitcast [1 x double]* %3 to i64*
store i64 4611686018427387904, i64* %13
%14 = bitcast [1 x double]* %4 to i8*
%15 = bitcast [1 x double]* %4 to i64*
store i64 4613937818241073152, i64* %15
%16 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%17 = getelementptr inbounds [1 x double], [1 x double]* %3, i64 0, i64 0
%18 = getelementptr inbounds [1 x double], [1 x double]* %4, i64 0, i64 0
%19 = getelementptr inbounds [1 x double], [1 x double]* %1, i64 0, i64 0
%20 = call i32 @beta_cdf_inv_(double* %16, double* %17, double* %18, double* %19)
%21 = load double, double* %19
%22 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %21)
%23 = bitcast [1 x double]* %5 to i8*
%24 = bitcast [1 x double]* %6 to i8*
%25 = bitcast [1 x double]* %6 to i64*
store i64 4596373779694328218, i64* %25
%26 = bitcast [1 x double]* %7 to i8*
%27 = bitcast [1 x double]* %7 to i64*
store i64 4611686018427387904, i64* %27
%28 = bitcast [1 x double]* %8 to i8*
%29 = bitcast [1 x double]* %8 to i64*
store i64 4613937818241073152, i64* %29
%30 = getelementptr inbounds [1 x double], [1 x double]* %6, i64 0, i64 0
%31 = getelementptr inbounds [1 x double], [1 x double]* %7, i64 0, i64 0
%32 = getelementptr inbounds [1 x double], [1 x double]* %8, i64 0, i64 0
%33 = getelementptr inbounds [1 x double], [1 x double]* %5, i64 0, i64 0
%34 = call i32 @beta_cdf_(double* %30, double* %31, double* %32, double* %33)
%35 = load double, double* %33
%36 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %35)
ret i32 0
}