// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/tests.c
// Function: permutation_test_paired
int permutation_test_paired(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, *difference, mean, current;
 int* iterator;
 observations = read_observations_for_two_file(files, counts);
 if (!observations)
  {
   *real_confidence = 0.5;
   return 0;
  }
 if (counts[0] != counts[1])
  {
   printf(m1315);
   free_2d((void**)observations, 2);
   return 0;
  }
 difference = (double *)safemalloc(counts[0] * sizeof(double), "permutation_test_paired", 15);
 for (i = 0; i < counts[0]; i++)
   difference[i] = observations[0][i] - observations[1][i];
 free_2d((void**)observations, 2);
 mean = sum_of_list_double(difference, counts[0]) / counts[0];
 iterator = first_iterator(counts[0]);
 count = 0;
 total = 0;
 do{
   current = 0;
   for (i = 0; i < counts[0]; i++)
     if (iterator[i])
       current += fabs(difference[i]);
     else
       current += -fabs(difference[i]);
   total++;
   if (mean > current / counts[0])
     count++;
 }while (next_iterator(iterator, counts[0], 1));
 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 $0x70, %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 0xd8c2d
movq -0x28(%rbp), %rax
movsd 0x9d9b(%rip), %xmm0     # 0xe29b8
movsd %xmm0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0xd8ea8
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
je 0xd8c5d
leaq 0x15773(%rip), %rdi     # 0xee3af
movb $0x0, %al
callq 0x4030
movq -0x48(%rbp), %rdi
movl $0x2, %esi
callq 0x52e20
movl $0x0, -0x4(%rbp)
jmp 0xd8ea8
movslq -0x34(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x158ee(%rip), %rsi     # 0xee55a
movl $0xf, %edx
callq 0x52d70
movq %rax, -0x50(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xd8cc2
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xd8c81
movq -0x48(%rbp), %rdi
movl $0x2, %esi
callq 0x52e20
movq -0x50(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x50b50
cvtsi2sdl -0x34(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x34(%rbp), %edi
callq 0x51b20
movq %rax, -0x68(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xd8d93
movq -0x68(%rbp), %rax
movslq -0x2c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xd8d4d
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0xa123(%rip), %xmm1     # 0xe2e60
pand %xmm1, %xmm0
addsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0xd8d86
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0xa0ff(%rip), %xmm1     # 0xe2e60
pand %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
addsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0xd8d88
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xd8d13
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movsd -0x58(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
cvtsi2sdl -0x34(%rbp), %xmm2
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xd8dbe
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xd8dc0
movq -0x68(%rbp), %rdi
movl -0x34(%rbp), %esi
movl $0x1, %edx
callq 0x52330
cmpl $0x0, %eax
jne 0xd8d04
leaq 0x10463(%rip), %rdi     # 0xe9244
callq 0x78f10
cmpl $0x2, %eax
jne 0xd8e68
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 0x9200(%rip), %xmm0     # 0xe2018
addsd -0x20(%rbp), %xmm0
movsd 0x9e7b(%rip), %xmm2     # 0xe2ca0
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xd8e5f
movq -0x28(%rbp), %rax
movsd (%rax), %xmm0
movsd 0x91d9(%rip), %xmm1     # 0xe2018
subsd -0x20(%rbp), %xmm1
movsd 0x9e54(%rip), %xmm2     # 0xe2ca0
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xd8e5f
movl $0x0, -0x4(%rbp)
jmp 0xd8ea8
movl $0x1, -0x4(%rbp)
jmp 0xd8ea8
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 0xd8ea1
movl $0x0, -0x4(%rbp)
jmp 0xd8ea8
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)