// File: /workspace/github_c_makefile_star2_O2/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 $0x58, %rsp
movq %r8, %r14
movq %rcx, %rbp
movq %rdx, 0x8(%rsp)
movq %rsi, %r13
movq %rdi, 0x10(%rsp)
leaq 0xc1560(%rip), %rbx     # 0xcd870
movq (%rbx), %rax
movslq 0x10(%rax), %rdi
leaq 0x89cdf(%rip), %rdx     # 0x95ffd
pushq $0x8
popq %rsi
pushq $0x2
popq %rcx
callq 0x35067
movq %rax, %r15
cmpl $0x0, 0x10(%rbp)
movq (%rbx), %rax
movl 0x10(%rax), %esi
je 0xc39c
xorl %ebx, %ebx
leaq 0x20(%rsp), %rbp
movslq %esi, %rax
cmpq %rax, %rbx
jge 0xc418
movq 0x8(%rsp), %rax
movq (%rax,%rbx,8), %rdx
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %r8
callq 0x8e7e
leaq 0xc1507(%rip), %rax     # 0xcd870
movq (%rax), %rax
movl 0x10(%rax), %esi
testl %esi, %esi
movl $0x0, %eax
cmovgl %esi, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0xc397
movsd (%r14,%rcx,8), %xmm0
addsd (%r15,%rcx,8), %xmm0
movsd %xmm0, (%r15,%rcx,8)
incq %rcx
jmp 0xc37b
incq %rbx
jmp 0xc33f
pushq $0x1
popq %r12
xorl %ebx, %ebx
xorl %ebp, %ebp
movslq %esi, %rax
cmpq %rax, %rbx
jge 0xc418
movslq %ebp, %rbp
movq %r12, 0x18(%rsp)
cmpl %r12d, %esi
jle 0xc40b
movq 0x8(%rsp), %rax
movq (%rax,%rbp,8), %rdx
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movq %r14, %r8
callq 0x8e7e
movsd (%r14,%rbx,8), %xmm0
addsd (%r15,%rbx,8), %xmm0
movsd %xmm0, (%r15,%rbx,8)
movsd (%r14,%r12,8), %xmm0
addsd (%r15,%r12,8), %xmm0
movsd %xmm0, (%r15,%r12,8)
incq %rbp
incq %r12
leaq 0xc146d(%rip), %rax     # 0xcd870
movq (%rax), %rax
movl 0x10(%rax), %esi
jmp 0xc3b4
incq %rbx
movq 0x18(%rsp), %r12
incq %r12
jmp 0xc3a4
movq %r15, %rdi
callq 0x33c59
leaq 0xc1449(%rip), %rbx     # 0xcd870
movq (%rbx), %rax
movslq 0x10(%rax), %rdx
shlq $0x3, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4310
movq %r15, %rdi
callq 0x34ff7
movq (%rbx), %rax
movl 0x10(%rax), %esi
movq %r14, %rdi
callq 0x339b7
movq 0x10(%rsp), %rcx
movl %eax, 0x8(%rcx)
movq %rcx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)