// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/classification.c
// Function: train_svmtree
void* train_svmtree(Instanceptr* trdata, Instanceptr *cvdata, void* parameters)
{
 /*!Last Changed 09.07.2009*/
 int i, j, k = 0;
 Decisionnodeptr rootnode;
 Svmtree_parameterptr param;
 Decisionnodeptr* forest;
 Instanceptr positives, negatives;
 param = (Svmtree_parameterptr) parameters;
 if (param->multiclasstype == ONE_VS_ONE)
  {
   forest = safemalloc((current_dataset->classno * (current_dataset->classno - 1) / 2) * sizeof(Decisionnodeptr), "train_svmtree", 3);
   for (i = 0; i < current_dataset->classno; i++)
     for (j = i + 1; j < current_dataset->classno; j++)
      {
       rootnode = createnewnode(NULL, 1);
       positives = negatives = NULL;
       divide_instancelist_one_vs_one(trdata, &positives, i, j);
       rootnode->instances = positives;
       create_svmtreechildren(rootnode, param, i);
       positives = NULL;
       accumulate_instances_tree(&positives, rootnode);
       rootnode->instances = NULL;
       merge_instancelist(trdata, positives);
       if (in_list(param->c45param.prunetype, 2, MODELSELECTIONPRUNING, VALIDATIONPRUNING))
        {
         positives = negatives = NULL;
         divide_instancelist_one_vs_one(cvdata, &positives, i, j);
         prune_tree(rootnode, rootnode, positives);
         merge_instancelist(cvdata, positives);
        }
       forest[k] = rootnode;
       k++;
      }
  }
 else
  {
   forest = safemalloc(current_dataset->classno * sizeof(Decisionnodeptr), "train_svmtree", 3);
   for (i = 0; i < current_dataset->classno; i++)
    {
     rootnode = createnewnode(NULL, 1);
     rootnode->instances = *trdata;
     create_svmtreechildren(rootnode, param, i);
     *trdata = NULL;
     accumulate_instances_tree(trdata, rootnode);
     rootnode->instances = NULL;
     if (in_list(param->c45param.prunetype, 2, MODELSELECTIONPRUNING, VALIDATIONPRUNING))
       prune_tree(rootnode, rootnode, *cvdata);
     forest[i] = rootnode;
    }
  }
 return forest;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x115cb
leaq 0xf4408(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %eax
leaq 0xf43fb(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
imull %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0xd1818(%rip), %rsi     # 0xe2c7f
movl $0x3, %edx
callq 0x52d70
movq %rax, -0x40(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
leaq 0xf43ba(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x115c6
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
leaq 0xf439b(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x115b6
xorl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x29480
movq %rax, -0x30(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
leaq -0x48(%rbp), %rsi
callq 0x45900
movq -0x48(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0xd1280
movq $0x0, -0x48(%rbp)
movq -0x30(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x29160
movq -0x30(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x44f40
movq -0x38(%rbp), %rax
movl (%rax), %edi
movl $0x2, %edx
movl $0x1, %ecx
movl %edx, %esi
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x1158f
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
leaq -0x48(%rbp), %rsi
callq 0x45900
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x2a370
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x44f40
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1149b
jmp 0x115b8
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1147c
jmp 0x116b6
leaq 0xf426e(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
leaq 0xd169b(%rip), %rsi     # 0xe2c7f
movl $0x3, %edx
callq 0x52d70
movq %rax, -0x40(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
leaq 0xf423d(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x116b4
xorl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x29480
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0xd1280
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x29160
movq -0x30(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x38(%rbp), %rax
movl (%rax), %edi
movl $0x2, %edx
movl $0x1, %ecx
movl %edx, %esi
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x11696
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
callq 0x2a370
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x115f9
jmp 0x116b6
movq -0x40(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq