// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/tests.c
// Function: friedman
double friedman(char **files)
{
 /*!Last Changed 25.04.2010*/
 int i, j, N, k, df1, df2;
 Obsptr *obs;
 double *R, S, F, sumri2, res;
 obs = read_observations_for_multiple_equal_size_file(files, &N, &k);
 assign_ranks_to_equal_size_observations(obs, k, N);
 R = (double *)safecalloc(k, sizeof(double), "friedman", 6);
 for (i = 0; i < k; i++)
   for (j = 0; j < N; j++)
	 	  R[i] += obs[i][j].rij;
	sumri2 = 0.0;
 for (i = 0; i < k; i++)
	 { 
		 R[i] /= N;
   write_array_variables("aout", i + 1, 3, "f", R[i]);
   if (get_parameter_o("displayresulton") == ON)
     printf("%.6f ", R[i]);
			sumri2 += R[i] * R[i];
		}
 if (get_parameter_o("displayresulton") == ON)
   printf("\n");
 safe_free(R);
 safe_free(obs);
 S = ((12.0 * N) / (k * (k + 1))) * (sumri2 - ((k * (k + 1) * (k + 1)) / 4.0));
 if (N * (k - 1) - S != 0)
  {
	  F = ((N - 1) * S) / (N * (k - 1) - S);
   df1 = k - 1;
   df2 = (k - 1) * (N - 1);
	  res = f_distribution(F, df1, df2);
   return 1 - res;
  }
 else
   return 1.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0xd5820
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0xd1530
movslq -0x20(%rbp), %rdi
movl $0x8, %esi
leaq 0x18aaf(%rip), %rdx     # 0xee4df
movl $0x6, %ecx
callq 0x52f40
movq %rax, -0x38(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0xd5aa2
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xd5a95
movq -0x30(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xd5a54
jmp 0xd5a97
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xd5a45
xorps %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0xd5b6b
cvtsi2sdl -0x1c(%rbp), %xmm1
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x14(%rbp), %esi
addl $0x1, %esi
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0xc9c3(%rip), %rdi      # 0xe24b5
movl $0x3, %edx
leaq 0xf71b(%rip), %rcx      # 0xe5219
movb $0x1, %al
callq 0x490c0
leaq 0xd75f(%rip), %rdi      # 0xe326b
callq 0x79440
cmpl $0x1, %eax
jne 0xd5b31
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x172c7(%rip), %rdi     # 0xecdf1
movb $0x1, %al
callq 0x4030
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x50(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xd5ab1
leaq 0xd6f9(%rip), %rdi      # 0xe326b
callq 0x79440
cmpl $0x1, %eax
jne 0xd5b8a
leaq 0x101b8(%rip), %rdi     # 0xe5d3b
movb $0x0, %al
callq 0x4030
movq -0x38(%rbp), %rdi
callq 0x52e80
movq -0x30(%rbp), %rdi
callq 0x52e80
cvtsi2sdl -0x1c(%rbp), %xmm1
movsd 0x11d47(%rip), %xmm0    # 0xe78f0
mulsd %xmm1, %xmm0
movl -0x20(%rbp), %eax
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd -0x50(%rbp), %xmm1
movl -0x20(%rbp), %eax
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm2
movsd 0xce99(%rip), %xmm3     # 0xe2a80
divsd %xmm3, %xmm2
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x1c(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
subsd -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xd5c1a
jp 0xd5c1a
jmp 0xd5c8b
movl -0x1c(%rbp), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm0
mulsd -0x40(%rbp), %xmm0
movl -0x1c(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm1
subsd -0x40(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
imull %ecx, %eax
movl %eax, -0x28(%rbp)
movsd -0x48(%rbp), %xmm0
movl -0x24(%rbp), %edi
movl -0x28(%rbp), %esi
callq 0x2ddf0
movsd %xmm0, -0x58(%rbp)
movsd 0xc399(%rip), %xmm0     # 0xe2018
subsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xd5c98
movsd 0xc385(%rip), %xmm0     # 0xe2018
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)