// File: /workspace/github_c_makefile_star2_O3/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 0x1d76e
callq 0x3a180
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x1d77c
callq 0x3a180
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x1d78a
callq 0x2ff55
movl 0x30(%rbx), %edi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rdi
je 0x1d85d
testl %edi, %edi
js 0x1d812
cmpl $0x2, 0x98(%rbx)
je 0x1d812
leaq 0xb80c1(%rip), %r14     # 0xd5870
movq (%r14), %rax
imulq $0x340, %rdi, %rcx      # imm = 0x340
cmpl $0x1, 0x30f08(%rax,%rcx)
jne 0x1d812
addq $0x30f08, %rax          # imm = 0x30F08
cmpl $0x0, 0x18(%rax,%rcx)
jle 0x1d807
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%rbx), %rdi
addq %r15, %rdi
callq 0x1d74c
incq %r12
movq (%r14), %rax
movslq 0x30(%rbx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movslq 0x30f20(%rax,%rcx), %rax
addq $0x160, %r15            # imm = 0x160
cmpq %rax, %r12
jl 0x1d7d6
movq 0x10(%rbx), %rdi
callq 0x3a180
jmp 0x1d847
movl $0x3, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
movl $0xfffffffa, %r8d       # imm = 0xFFFFFFFA
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x1d894
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x3ed51
movq %rbx, %rdi
callq 0x1d8e3
movq %rbx, %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1d64e
cmpl $0x1, 0x60(%rbx)
jne 0x1d870
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x3ed51
movq %rbx, %rdi
callq 0x1d64e
movq 0x50(%rbx), %rdi
addq $0x88, %rsp
testq %rdi, %rdi
je 0x1d8ba
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3a180
movl 0x30(%rbx), %eax
cmpl $-0x5, %eax
je 0x1d8c2
cmpl $-0x4, %eax
jne 0x1d83f
leaq 0xa8(%rbx), %rsi
movl $0x11, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x90540
jmp 0x1d83f
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movups 0x140(%rbx), %xmm0
movups 0x150(%rbx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x1d703
jmp 0x1d83f