// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/tests.c
// Function: permutation_test
int permutation_test(char **files, int *which, double confidence, double *real_confidence)
{
 /*One Tailed Test for H0: mu1 <= mu2 H1: mu1 > mu2*/
 /*Two Tailed Test for H0: mu1 = mu2 H1: mu1 != mu2*/
 /*confidence = 0.95 for alpha = 0.05, confidence = 0.99 for alpha = 0.01 etc.*/
 int i, counts[2], count, total;
 double **observations, sum[2], current[2];
 int* combination;
 observations = read_observations_for_two_file(files, counts);
 if (!observations)
  {
   *real_confidence = 0.5;
   return 0;
  }
 sum[0] = sum_of_list_double(observations[0], counts[0]);
 sum[1] = sum_of_list_double(observations[1], counts[1]);
 combination = first_combination(counts[0]);
 count = 0;
 total = 0;
 do{
   current[0] = 0;
   for (i = 0; i < counts[0]; i++)
     if (combination[i] < counts[0])
       current[0] += observations[0][combination[i]];
     else
       current[0] += observations[1][combination[i] - counts[0]];
   current[1] = sum[0] + sum[1] - current[0];
   total++;
   if (sum[0] / counts[0] - sum[1] / counts[1] > current[0] / counts[0] - current[1] / counts[1])
     count++;
 }while (next_combination(combination, counts[0], counts[0] + counts[1] - 1));
 free_2d((void**)observations, 2);
 if (get_parameter_i("tailed") == 2)
  {
   (*real_confidence) = count / (total + 0.0);
   if ((*real_confidence) < ((1 + confidence) / 2) && (*real_confidence) > ((1 - confidence) / 2))
     return 0;
   else
     return 1;
  }
 else
  {
   (*real_confidence) = count / (total + 0.0);
   if ((*real_confidence) < confidence)
     return 0;
   else
     return 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movsd %xmm0, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0xd2020
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xd8f10
movq -0x28(%rbp), %rax
movsd 0x9ab8(%rip), %xmm0     # 0xe29b8
movsd %xmm0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0xd913b
movq -0x48(%rbp), %rax
movq (%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x50b50
movsd %xmm0, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x30(%rbp), %esi
callq 0x50b50
movsd %xmm0, -0x58(%rbp)
movl -0x34(%rbp), %edi
callq 0x51a10
movq %rax, -0x78(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x70(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xd8fd3
movq -0x78(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x34(%rbp), %eax
jge 0xd8f9e
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq -0x78(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
jmp 0xd8fc6
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x78(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
subl -0x34(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
jmp 0xd8fc8
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xd8f62
movsd -0x60(%rbp), %xmm0
addsd -0x58(%rbp), %xmm0
subsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movsd -0x60(%rbp), %xmm0
cvtsi2sdl -0x34(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd -0x58(%rbp), %xmm1
cvtsi2sdl -0x30(%rbp), %xmm2
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd -0x70(%rbp), %xmm1
cvtsi2sdl -0x34(%rbp), %xmm2
divsd %xmm2, %xmm1
movsd -0x68(%rbp), %xmm2
cvtsi2sdl -0x30(%rbp), %xmm3
divsd %xmm3, %xmm2
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xd903f
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xd9041
movq -0x78(%rbp), %rdi
movl -0x34(%rbp), %esi
movl -0x34(%rbp), %edx
addl -0x30(%rbp), %edx
subl $0x1, %edx
callq 0x52190
cmpl $0x0, %eax
jne 0xd8f53
movq -0x48(%rbp), %rdi
movl $0x2, %esi
callq 0x52e20
leaq 0x101d0(%rip), %rdi     # 0xe9244
callq 0x78f10
cmpl $0x2, %eax
jne 0xd90fb
cvtsi2sdl -0x38(%rbp), %xmm0
cvtsi2sdl -0x3c(%rbp), %xmm1
xorps %xmm2, %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rax
movsd (%rax), %xmm1
movsd 0x8f6d(%rip), %xmm0     # 0xe2018
addsd -0x20(%rbp), %xmm0
movsd 0x9be8(%rip), %xmm2     # 0xe2ca0
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xd90f2
movq -0x28(%rbp), %rax
movsd (%rax), %xmm0
movsd 0x8f46(%rip), %xmm1     # 0xe2018
subsd -0x20(%rbp), %xmm1
movsd 0x9bc1(%rip), %xmm2     # 0xe2ca0
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xd90f2
movl $0x0, -0x4(%rbp)
jmp 0xd913b
movl $0x1, -0x4(%rbp)
jmp 0xd913b
cvtsi2sdl -0x38(%rbp), %xmm0
cvtsi2sdl -0x3c(%rbp), %xmm1
xorps %xmm2, %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rax
movsd (%rax), %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xd9134
movl $0x0, -0x4(%rbp)
jmp 0xd913b
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)