// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/tests.c
// Function: kruskalwallis
double kruskalwallis(char **files)
{
 /*!Last Changed 13.01.2009 added find_observations_for_multiple_file, qsort, assign_ranks_to_observations*/
 /*!Last Changed 02.02.2004 added safemalloc*/
 /*!Last Changed 30.01.2002*/
 int treatments, df;
 int *counts = NULL, i, k = 0, n;
 Obs *obs;
 double *T, S, sumd, res;
 obs = read_observations_for_multiple_file(files, &counts, &k, &treatments);
 T = (double *)safecalloc(treatments, sizeof(double), "kruskalwallis", 27);
 qsort(obs, k, sizeof(Obs), sort_function_observation_ascending);
 assign_ranks_to_observations(obs, k);
 for (i = 0; i < k; i++)
   T[obs[i].observation_no] += obs[i].rij;
 sumd = 0;
 for (i = 0; i < treatments; i++)
   sumd += T[i] * T[i] / counts[i];
	safe_free(counts);
 safe_free(T);
 n = counts[0];
 S = sumd * ((12 + 0.0) / (treatments * n * (treatments * n + 1))) - 3 * (treatments * n + 1);
 safe_free(obs);
 df = treatments - 1;
 res = chi_square(df, S);
 return 1 - res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x20(%rbp), %rdx
leaq -0xc(%rbp), %rcx
callq 0xd1b40
movq %rax, -0x30(%rbp)
movslq -0xc(%rbp), %rdi
movl $0x8, %esi
leaq 0x18e13(%rip), %rdx     # 0xee4a7
movl $0x1b, %ecx
callq 0x52f40
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x20(%rbp), %rsi
movl $0x20, %edx
leaq -0x82156(%rip), %rcx    # 0x53560
callq 0x41f0
movq -0x30(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0xd13f0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0xd5715
movq -0x30(%rbp), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xd56ce
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xd576c
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
divsd %xmm1, %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xd5724
movq -0x18(%rbp), %rdi
callq 0x52e80
movq -0x38(%rbp), %rdi
callq 0x52e80
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movsd -0x48(%rbp), %xmm0
movl -0xc(%rbp), %eax
imull -0x24(%rbp), %eax
movl -0xc(%rbp), %ecx
imull -0x24(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm1
movsd 0x12144(%rip), %xmm2    # 0xe78f0
divsd %xmm1, %xmm2
movl -0xc(%rbp), %eax
imull -0x24(%rbp), %eax
addl $0x1, %eax
imull $0x3, %eax, %eax
cvtsi2sd %eax, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x30(%rbp), %rdi
callq 0x52e80
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edi
movsd -0x40(%rbp), %xmm0
callq 0x2d5e0
movsd %xmm0, -0x50(%rbp)
movsd 0xc807(%rip), %xmm0     # 0xe2018
subsd -0x50(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)