// File: /workspace/github_c_makefile_star2_O3/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 $0x78, %rsp
movq %r8, 0x8(%rsp)
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
leaq 0xc8ddf(%rip), %r12     # 0xd5870
movq (%r12), %rax
movslq 0x10(%rax), %rdi
leaq 0x99555(%rip), %rdx     # 0xa5ff5
movl $0x8, %esi
movl $0x2, %ecx
callq 0x3a1fc
movq %rax, %r15
cmpl $0x0, 0x10(%rbp)
movq (%r12), %rax
movl 0x10(%rax), %esi
movq %rbx, 0x20(%rsp)
je 0xcb32
testl %esi, %esi
jle 0xcc07
xorl %ebx, %ebx
leaq 0x40(%rsp), %rbp
leaq 0xc8d96(%rip), %r12     # 0xd5870
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %r14
movq (%r13,%rbx,8), %rdx
movq %rbp, %rdi
movq %rax, %rsi
movq %r14, %r8
callq 0x9253
movq (%r12), %rax
movslq 0x10(%rax), %rsi
testq %rsi, %rsi
jle 0xcb20
xorl %eax, %eax
movsd (%r14,%rax,8), %xmm0
addsd (%r15,%rax,8), %xmm0
movsd %xmm0, (%r15,%rax,8)
incq %rax
cmpq %rax, %rsi
jne 0xcb06
incq %rbx
cmpq %rsi, %rbx
movq 0x10(%rsp), %rax
jl 0xcae4
jmp 0xcc07
testl %esi, %esi
jle 0xcc07
xorl %edx, %edx
movl $0x1, %ecx
leaq 0x40(%rsp), %r14
xorl %r12d, %r12d
movq %r13, 0x28(%rsp)
movq %r15, 0x18(%rsp)
movq 0x8(%rsp), %rbx
movq %rdx, %rdi
incq %rdx
movslq %esi, %rax
cmpq %rax, %rdx
jge 0xcbfb
movq %rdx, 0x30(%rsp)
movslq %r12d, %rax
leaq (,%rax,8), %rbp
addq %r13, %rbp
movq %rcx, 0x38(%rsp)
movq %rcx, %r13
movq (%rbp), %rdx
movq %rdi, %r15
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %rbx, %r8
callq 0x9253
movq %r15, %rdi
movsd (%rbx,%r15,8), %xmm0
movq 0x18(%rsp), %rax
addsd (%rax,%r15,8), %xmm0
movsd %xmm0, (%rax,%r15,8)
movsd (%rbx,%r13,8), %xmm0
addsd (%rax,%r13,8), %xmm0
movsd %xmm0, (%rax,%r13,8)
incq %r13
leaq 0xc8c9e(%rip), %rax     # 0xd5870
movq (%rax), %rax
movl 0x10(%rax), %esi
addq $0x8, %rbp
incl %r12d
cmpl %r13d, %esi
jg 0xcb85
movslq %esi, %rax
movq 0x28(%rsp), %r13
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %rdx
movq 0x18(%rsp), %r15
incq %rcx
cmpq %rax, %rdx
jl 0xcb58
movq %r15, %rdi
callq 0x38695
leaq 0xc8c5a(%rip), %rbx     # 0xd5870
movq (%rbx), %rax
movslq 0x10(%rax), %rdx
shlq $0x3, %rdx
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x4310
movq %r15, %rdi
callq 0x3a180
movq (%rbx), %rax
movl 0x10(%rax), %esi
movq %r14, %rdi
callq 0x38362
movq 0x20(%rsp), %rcx
movl %eax, 0x8(%rcx)
movq %rcx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)