// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/decisiontree.c
// Function: deallocate_tree
void deallocate_tree(Decisionnodeptr node)
{
 /*!Last Changed 24.05.2006 added free_children*/
 /*!Last Changed 20.06.2005*/
 /*!Last Changed 28.05.2005 added SVM*/
 /*!Last Changed 23.09.2004 added hybrid condition and multivariate*/
 /*!Last Changed 08.04.2003*/
 /*Added freeing rules array at each node*/
 int i;
 if (node->counts)
   safe_free(node->counts);
 if (node->outputs)
   safe_free(node->outputs);
 if (node->instances)
   deallocate(node->instances);
 if (node->featureno == LEAF_NODE)
  {
   if (node->leaftype == LINEARLEAF)
     matrix_free(node->w);
   deallocate_tree_rule(node);
   if (node->w0s)
     safe_free(node->w0s);
  }
 else
  {
   if (node->featureno >= 0 && (node->conditiontype != HYBRID_CONDITION) && current_dataset->features[node->featureno].type==STRING)
    {
     for (i = 0; i < current_dataset->features[node->featureno].valuecount; i++)
       deallocate_tree(&(node->string[i]));
     safe_free(node->string);
    }
   else
    {
     if (in_list(node->featureno, 3, LINEAR, QUADRATIC, SOFTLIN))
       matrix_free(node->w);
     else
       if (node->featureno == SVMLIN)
         free_svm_split(node->svmsplit);
       else
         if (node->featureno == DISCRETEMIX)
           deallocate_korderingsplit(node->ksplit);
     free_children(node);
    }
   deallocate_tree_rule(node);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq 0xa0(%rdi), %rdi
testq %rdi, %rdi
je 0x1b2cc
callq 0x34ff7
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x1b2da
callq 0x34ff7
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x1b2e8
callq 0x2c010
movl 0x30(%rbx), %edi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rdi
je 0x1b3a3
testl %edi, %edi
js 0x1b360
cmpl $0x2, 0x98(%rbx)
je 0x1b360
leaq 0xb2563(%rip), %r14     # 0xcd870
movq (%r14), %rax
imulq $0x340, %rdi, %rcx      # imm = 0x340
cmpl $0x1, 0x30f08(%rax,%rcx)
jne 0x1b360
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq %edi, %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movslq 0x30f20(%rax,%rcx), %rax
movq 0x10(%rbx), %rdi
cmpq %rax, %r12
jge 0x1b406
addq %r15, %rdi
callq 0x1b2aa
incq %r12
movq (%r14), %rax
movl 0x30(%rbx), %edi
addq $0x160, %r15            # imm = 0x160
jmp 0x1b327
pushq $0x3
popq %rsi
pushq $-0x2
popq %rdx
pushq $-0x3
popq %rcx
pushq $-0x6
popq %r8
xorl %eax, %eax
callq 0x35812
testl %eax, %eax
je 0x1b3da
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x3929f
movq %rbx, %rdi
callq 0x1b42e
movq %rbx, %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1b1b9
cmpl $0x1, 0x60(%rbx)
jne 0x1b3b6
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x3929f
movq %rbx, %rdi
callq 0x1b1b9
movq 0x50(%rbx), %rdi
addq $0x88, %rsp
testq %rdi, %rdi
je 0x1b3fe
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x34ff7
movl 0x30(%rbx), %eax
cmpl $-0x5, %eax
je 0x1b40d
cmpl $-0x4, %eax
jne 0x1b385
leaq 0xa8(%rbx), %rsi
pushq $0x11
popq %rcx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x828bc
jmp 0x1b385
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x34ff7
jmp 0x1b38d
movups 0x140(%rbx), %xmm0
movups 0x150(%rbx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x1b264
jmp 0x1b385