// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/classification.c
// Function: test_svmtree
Prediction test_svmtree(Instanceptr data, void* model, void* parameters, double* posterior)
{
 /*!Last Changed 09.07.2009*/
 int i, j, k = 0;
 double* votes;
 Svmtree_parameterptr param;
 Decisionnodeptr* forest;
 Prediction predicted;
 param = (Svmtree_parameterptr) parameters;
 votes = safecalloc(current_dataset->classno, sizeof(double), "test_svmtree", 2);
 forest = (Decisionnodeptr*) model;
 if (param->multiclasstype == ONE_VS_ONE)
  {
   for (i = 0; i < current_dataset->classno; i++)
     for (j = i + 1; j < current_dataset->classno; j++)
      {
       test_c45(data, forest[k], parameters, posterior);
       votes[i] += posterior[i];
       votes[j] += posterior[j];
       k++;
      }
  }
 else
  {
   for (i = 0; i < current_dataset->classno; i++)
    {
     test_c45(data, forest[i], parameters, posterior);
     for (j = 0; j < current_dataset->classno; j++)
       votes[j] += posterior[j];
    }
  }
 normalize_array_of_doubles(votes, current_dataset->classno);
 memcpy(posterior, votes, current_dataset->classno * sizeof(double));
 safe_free(votes);
 predicted.classno = findMaxOutput(posterior, current_dataset->classno);
 return predicted;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, (%rsp)
movq %rcx, %rbp
movq %rdx, 0x8(%rsp)
movq %rsi, %r12
movq %rdi, 0x10(%rsp)
leaq 0xc5e62(%rip), %r14     # 0xd2870
movq (%r14), %rax
movslq 0x10(%rax), %rdi
leaq 0x965d9(%rip), %rdx     # 0xa2ff5
movl $0x8, %esi
movl $0x2, %ecx
callq 0x39210
movq %rax, %r15
cmpl $0x0, 0x10(%rbp)
movq (%r14), %rax
movl 0x10(%rax), %eax
je 0xcaa1
testl %eax, %eax
movq (%rsp), %r8
jle 0xcb66
xorl %ebx, %ebx
leaq 0x30(%rsp), %rbp
movq 0x8(%rsp), %rax
movq (%rax,%rbx,8), %rdx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x9241
movq (%rsp), %r8
movq (%r14), %rax
movslq 0x10(%rax), %rax
testq %rax, %rax
jle 0xca8d
xorl %ecx, %ecx
movsd (%r8,%rcx,8), %xmm0
addsd (%r15,%rcx,8), %xmm0
movsd %xmm0, (%r15,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0xca73
incq %rbx
movq (%r14), %rax
movslq 0x10(%rax), %rax
cmpq %rax, %rbx
jl 0xca4d
jmp 0xcb66
testl %eax, %eax
movq (%rsp), %r8
jle 0xcb66
xorl %ecx, %ecx
movl $0x1, %r13d
leaq 0x30(%rsp), %rdi
xorl %ebx, %ebx
movq %r12, 0x28(%rsp)
leaq 0x1(%rcx), %rdx
movq (%r14), %rax
movslq 0x10(%rax), %rax
movq %rdx, 0x20(%rsp)
cmpq %rax, %rdx
movq %r13, 0x18(%rsp)
jge 0xcb3f
movq %rcx, %r12
movslq %ebx, %rax
movq 0x8(%rsp), %rdx
leaq (%rdx,%rax,8), %rbp
movq (%rbp), %rdx
movq 0x28(%rsp), %rsi
movq %rdi, %r14
callq 0x9241
movq (%rsp), %r8
movq %r14, %rdi
movsd (%r8,%r12,8), %xmm0
addsd (%r15,%r12,8), %xmm0
movsd %xmm0, (%r15,%r12,8)
movsd (%r8,%r13,8), %xmm0
addsd (%r15,%r13,8), %xmm0
movsd %xmm0, (%r15,%r13,8)
incq %r13
leaq 0xc5d40(%rip), %rax     # 0xd2870
movq (%rax), %rax
addq $0x8, %rbp
incl %ebx
cmpl %r13d, 0x10(%rax)
jg 0xcaea
leaq 0xc5d2a(%rip), %rdx     # 0xd2870
movq (%rdx), %rax
movslq 0x10(%rax), %rax
movq 0x18(%rsp), %r13
incq %r13
movq 0x20(%rsp), %rcx
cmpq %rax, %rcx
movq %rdx, %r14
jl 0xcac1
movq (%r14), %rax
movl 0x10(%rax), %esi
movq %r15, %rdi
movq %r8, %rbx
callq 0x37aff
movq (%r14), %rax
movslq 0x10(%rax), %rdx
shlq $0x3, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4310
movq %r15, %rdi
callq 0x39194
movq (%r14), %rax
movl 0x10(%rax), %esi
movq %rbx, %rdi
callq 0x37852
movq 0x10(%rsp), %rcx
movl %eax, 0x8(%rcx)
movq %rcx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)