// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/statistics.c
// Function: find_best_classifier
int find_best_classifier(char**files, int filecount, TEST_TYPE testtype)
{
 /*Last Changed 21.10.2004*/
 int i, *indexes, found, best, which, res;
 char **two_file;
 double* means, confidence = 1 - (get_parameter_f("confidencelevel") / (filecount - 1)), conf;
 means = safemalloc(filecount * sizeof(double), "find_best_classifier", 4);
 indexes = safemalloc(filecount * sizeof(int), "find_best_classifier", 5);
 two_file = safemalloc(2 * sizeof(char *), "find_best_classifier", 6);
 for (i = 0; i < filecount; i++)
  {
   indexes[i] = i;
   means[i] = file_mean(&(files[i]), 1);
  }
 sort_two_arrays(means, indexes, filecount);
 found = 0;
 best = indexes[0];
 for (i = 1; i < filecount; i++)
   if (best > indexes[i])
    {
     two_file[0] = strcopy(two_file[0], files[indexes[i]]);
     two_file[1] = strcopy(two_file[1], files[indexes[0]]);
     res = compare_two_files_using_test(testtype, two_file, &which, confidence, &conf);
     if (!res)
      {
       found = 1;
       break;
      }
    }
 safe_free(means);
 safe_free(indexes);
 safe_free(two_file);
 if (!found)
   return best + 1;
 else
   return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
leaq 0x1f904(%rip), %rdi     # 0xe269d
callq 0x79040
movaps %xmm0, %xmm1
movl -0x14(%rbp), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
movsd 0x1f261(%rip), %xmm0    # 0xe2018
subsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movslq -0x14(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x2affc(%rip), %rsi     # 0xeddcb
movl $0x4, %edx
callq 0x52d70
movq %rax, -0x48(%rbp)
movslq -0x14(%rbp), %rdi
shlq $0x2, %rdi
leaq 0x2afdf(%rip), %rsi     # 0xeddcb
movl $0x5, %edx
callq 0x52d70
movq %rax, -0x28(%rbp)
movl $0x10, %edi
leaq 0x2afc5(%rip), %rsi     # 0xeddcb
movl $0x6, %edx
callq 0x52d70
movq %rax, -0x40(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xc2e62
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rdi
movslq -0x1c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movl $0x1, %esi
callq 0xc2f70
movq -0x48(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xc2e1b
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x539d0
movl $0x0, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xc2f33
movl -0x30(%rbp), %eax
movq -0x28(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0xc2f23
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x54ba0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x54ba0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x18(%rbp), %edi
movq -0x40(%rbp), %rsi
movsd -0x50(%rbp), %xmm0
leaq -0x34(%rbp), %rdx
leaq -0x58(%rbp), %rcx
callq 0xc2810
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0xc2f21
movl $0x1, -0x2c(%rbp)
jmp 0xc2f33
jmp 0xc2f23
jmp 0xc2f25
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xc2e89
movq -0x48(%rbp), %rdi
callq 0x52e80
movq -0x28(%rbp), %rdi
callq 0x52e80
movq -0x40(%rbp), %rdi
callq 0x52e80
cmpl $0x0, -0x2c(%rbp)
jne 0xc2f5f
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc2f66
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop