// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/classification.c
// Function: train_nodeboundedtree
void* train_nodeboundedtree(Instanceptr* trdata, Instanceptr *cvdata, void* parameters)
{
 /*!Last Changed 30.09.2007 added postpruning via SRM*/
 /*!Last Changed 31.05.2006*/
 Decisionnodeptr rootnode, besttree = NULL;
 int i, j, k, performance, maxperformance = -1, size = data_size(*trdata);
 double bin;
 Instanceptr data = *trdata;
 Nodeboundedtree_parameterptr p;
 p = (Nodeboundedtree_parameterptr) parameters;
 bin = 4.0 / p->partitioncount;
 if (in_list(p->prunetype, 3, MODELSELECTIONPRUNING, PREPRUNING, VALIDATIONPRUNING))
  {
   k = 0;
   for (i = 0; i < p->partitioncount; i++)
     for (j = 0; j < p->partitioncount; j++)
      {
       rootnode = createnewnode(NULL, 1);
       rootnode->instances = data;
       p->a1 = (i + 1) * bin;
       p->a2 = (j + 1) * bin; 
       create_node_bounded_tree(rootnode, p);
       switch (p->prunetype)
        {
         case     VALIDATIONPRUNING:prune_node_bounded_tree(rootnode, p, size);
                                    break;
         case MODELSELECTIONPRUNING:set_float_parameter("srma1", p->a1);
                                    set_float_parameter("srma2", p->a2);
                                    prune_tree_according_to_model_selection_method(rootnode, MODEL_SELECTION_SRM);
                                    break;
        }
       performance = test_tree(rootnode, *cvdata);
       write_array_variables("aout", k + 1, 3, "d", performance);
       data = NULL;
       accumulate_instances_tree(&data, rootnode);
       if (performance > maxperformance)
        {
         if (maxperformance != -1)
           deallocate_tree(besttree);
         maxperformance = performance;
         besttree = rootnode;       
        }
       else
         deallocate_tree(rootnode);
       k++;
      }
   *trdata = data;
  }
 else
  {
   besttree = createnewnode(NULL, 1);
   besttree->instances = *trdata;  
   create_node_bounded_tree(besttree, p);
  } 
 return besttree;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x449f0
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cvtsi2sdl 0x4(%rax), %xmm1
movsd 0xd248a(%rip), %xmm0    # 0xe2a80
divsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x58(%rbp), %rax
movl 0x14(%rax), %edi
movl $0x3, %esi
movl $0x2, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x107d3
movl $0x0, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x107c6
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x107b6
xorl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x29480
movq %rax, -0x20(%rbp)
movq -0x50(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movl -0x2c(%rbp), %eax
incl %eax
cvtsi2sd %eax, %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movq -0x58(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movl -0x30(%rbp), %eax
incl %eax
cvtsi2sd %eax, %xmm0
movsd -0x48(%rbp), %xmm1
mulsd %xmm1, %xmm0
movq -0x58(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movq -0x20(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x72fc0
movq -0x58(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x5c(%rbp)
subl $0x1, %eax
je 0x106d9
jmp 0x106cf
movl -0x5c(%rbp), %eax
subl $0x2, %eax
je 0x106eb
jmp 0x10723
movq -0x20(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl -0x40(%rbp), %edx
callq 0x72a50
jmp 0x10723
movq -0x58(%rbp), %rax
movsd 0x18(%rax), %xmm0
leaq 0xd20b6(%rip), %rdi     # 0xe27b1
callq 0x79130
movq -0x58(%rbp), %rax
movsd 0x20(%rax), %xmm0
leaq 0xd20a7(%rip), %rdi     # 0xe27b7
callq 0x79130
movq -0x20(%rbp), %rdi
movl $0x3, %esi
callq 0x765a0
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x29e30
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %esi
addl $0x1, %esi
movl -0x38(%rbp), %r8d
leaq 0xd1d6e(%rip), %rdi     # 0xe24b5
movl $0x3, %edx
leaq 0xdcb13(%rip), %rcx     # 0xed266
movb $0x0, %al
callq 0x490c0
movq $0x0, -0x50(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x29160
movl -0x38(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jle 0x10796
cmpl $-0x1, -0x3c(%rbp)
je 0x10786
movq -0x28(%rbp), %rdi
callq 0x2a030
movl -0x38(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x1079f
movq -0x20(%rbp), %rdi
callq 0x2a030
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1064d
jmp 0x107b8
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x10636
movq -0x50(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
jmp 0x10801
xorl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x29480
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x72fc0
movq -0x28(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)