// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0xc8(%rbp)
movq %rdi, -0xc0(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0xf4141(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
movl $0x8, %esi
leaq 0xd157b(%rip), %rdx     # 0xe2c8d
movl $0x2, %ecx
callq 0x52f40
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x117f9
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
leaq 0xf40f9(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x117f4
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
leaq 0xf40da(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x117e4
movq -0x8(%rbp), %rsi
movq -0x48(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq -0x80(%rbp), %rdi
callq 0xc580
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x38(%rbp), %rax
movslq -0x24(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x38(%rbp), %rax
movslq -0x28(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1175c
jmp 0x117e6
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1173d
jmp 0x1188b
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
leaq 0xf4036(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x11889
movq -0x8(%rbp), %rsi
movq -0x48(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq -0xb8(%rbp), %rdi
callq 0xc580
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
leaq 0xf3ff9(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x11879
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x38(%rbp), %rax
movslq -0x28(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1183d
jmp 0x1187b
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x11800
jmp 0x1188b
movq -0x38(%rbp), %rdi
leaq 0xf3faa(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %esi
callq 0x50ba0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq 0xf3f90(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdx
shlq $0x3, %rdx
callq 0x42b0
movq -0x38(%rbp), %rdi
callq 0x52e80
movq -0x20(%rbp), %rdi
leaq 0xf3f6c(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %esi
callq 0x505f0
movq -0xc8(%rbp), %rcx
movl %eax, %edx
movq -0xc0(%rbp), %rax
movl %edx, 0x8(%rcx)
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax,%rax)