#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 EXIT_SUCCESS;
double correlationTTest(double, int);
int /*<<< orphan*/ printf(char *, double);
double rSignifcanceTest(double, int, int);
int correlationProbability(double r, int N) {
  printf("\nr is: %f\n", r);
  printf("Number of samples is: %d\n", N);
  printf("The t-value is: %f\n", correlationTTest(r, N));
  printf("The number of degrees of freedom is: %d\n", N - 2);
  printf("For the one sided test the result is significant at p <%f\n",
         rSignifcanceTest(r, N, 0));
  printf("For the two sided test the result is significant at p <%f\n",
         rSignifcanceTest(r, N, 2));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<correlationProbability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm0
lea    0xeae(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1040 <correlationTTest@plt>
lea    0xeaf(%rip),%rdi
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
cvtsi2sd %eax,%xmm0
lea    0xead(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1030 <rSignifcanceTest@plt>
lea    0xebb(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1030 <rSignifcanceTest@plt>
lea    0xed8(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<correlationProbability>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movsd  %xmm0,0x8(%rsp)
lea    0xebc(%rip),%rdi
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
call   1040 <correlationTTest@plt>
lea    0xeb5(%rip),%rdi
call   1050 <printf@plt>
lea    -0x2(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xeb3(%rip),%rdi
call   1050 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <rSignifcanceTest@plt>
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <rSignifcanceTest@plt>
lea    0xede(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0Ar is: %f\0A\00"
@.str.1 = [26 x i8] c"Number of samples is: %d\0A\00"
@.str.2 = [20 x i8] c"The t-value is: %f\0A\00"
@.str.3 = [41 x i8] c"The number of degrees of freedom is: %d\0A\00"
@.str.4 = [59 x i8] c"For the one sided test the result is significant at p <%f\0A\00"
@.str.5 = [59 x i8] c"For the two sided test the result is significant at p <%f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @correlationProbability(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %5)
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = load double, double* %3
%11 = load i32, i32* %4
%12 = call double @correlationTTest(double %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 2
%16 = sitofp i32 %15 to double
%17 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), double %16)
%18 = load double, double* %3
%19 = load i32, i32* %4
%20 = call double @rSignifcanceTest(double %18, i32 %19, i32 0)
%21 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), double %20)
%22 = load double, double* %3
%23 = load i32, i32* %4
%24 = call double @rSignifcanceTest(double %22, i32 %23, i32 2)
%25 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0), double %24)
%26 = load i32, i32* @EXIT_SUCCESS
ret i32 %26
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0Ar is: %f\0A\00"
@.str.1 = [26 x i8] c"Number of samples is: %d\0A\00"
@.str.2 = [20 x i8] c"The t-value is: %f\0A\00"
@.str.3 = [41 x i8] c"The number of degrees of freedom is: %d\0A\00"
@.str.4 = [59 x i8] c"For the one sided test the result is significant at p <%f\0A\00"
@.str.5 = [59 x i8] c"For the two sided test the result is significant at p <%f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @correlationProbability(double %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %0)
%4 = sitofp i32 %1 to double
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = tail call double @correlationTTest(double %0, i32 %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = add nsw i32 %1, -2
%9 = sitofp i32 %8 to double
%10 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), double %9)
%11 = tail call double @rSignifcanceTest(double %0, i32 %1, i32 0)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), double %11)
%13 = tail call double @rSignifcanceTest(double %0, i32 %1, i32 2)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0), double %13)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}