// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/metaclassification.c
// Function: test_one_vs_one
Prediction test_one_vs_one(Instanceptr data, void** model, int algorithm, void* parameters, double* posterior)
{
 int i, j, k = 0, *votes, tmp;
 Prediction result, prediction;
 double* tmp_posteriors;
 tmp_posteriors = safemalloc(current_dataset->classno * sizeof(double), "test_one_vs_one", 3);
 votes = safecalloc(current_dataset->classno, sizeof(int), "test_one_vs_one", 4);
 tmp = current_dataset->classno;
 for (i = 0; i < current_dataset->classno; i++)
   for (j = i + 1; j < current_dataset->classno; j++)
    {
     current_dataset->classno = 2;
     prediction = classification_algorithms[algorithm - SELECTMAX].test_algorithm(data, model[k], parameters, tmp_posteriors);
     current_dataset->classno = tmp;
     if (prediction.classno == 0)
       votes[i]++;
     else
       votes[j]++;
     k++;
    }
 safe_free(tmp_posteriors);
 result.classno = find_max_in_list(votes, current_dataset->classno);
 normalize_array(votes, posterior, current_dataset->classno);
 safe_free(votes);
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0xd0(%rbp)
movq %rdi, -0xc8(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
leaq 0xa5936(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
leaq 0x86ebb(%rip), %rsi     # 0xe6dd7
movl $0x3, %edx
callq 0x52d70
movq %rax, -0x88(%rbp)
leaq 0xa590c(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
movl $0x4, %esi
leaq 0x86e90(%rip), %rdx     # 0xe6dd7
movl $0x4, %ecx
callq 0x52f40
movq %rax, -0x40(%rbp)
leaq 0xa58e4(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
leaq 0xa58ca(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x60069
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
leaq 0xa58ab(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x60059
leaq 0xa5898(%rip), %rax     # 0x105840
movq (%rax), %rax
movl $0x2, 0x10(%rax)
movl -0x14(%rbp), %eax
subl $0x3e8, %eax            # imm = 0x3E8
movslq %eax, %rcx
leaq 0xa41cc(%rip), %rax     # 0x104190
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movq (%rcx,%rdx,8), %rdx
movq -0x20(%rbp), %rcx
movq -0x88(%rbp), %r8
leaq -0xc0(%rbp), %rdi
callq *%rax
leaq -0x80(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
movl $0x38, %edx
callq 0x42b0
movl -0x44(%rbp), %ecx
leaq 0xa582e(%rip), %rax     # 0x105840
movq (%rax), %rax
movl %ecx, 0x10(%rax)
cmpl $0x0, -0x78(%rbp)
jne 0x60031
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x60042
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x5ff8b
jmp 0x6005b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5ff6c
movq -0x88(%rbp), %rdi
callq 0x52e80
movq -0x40(%rbp), %rdi
leaq 0xa57c0(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %esi
callq 0x50070
movl %eax, %ecx
movq -0xd0(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq 0xa579a(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %edx
callq 0x50a20
movq -0x40(%rbp), %rdi
callq 0x52e80
movq -0xc8(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopw (%rax,%rax)