// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x2a05d
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rdi
callq 0x52e80
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x2a075
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x52e80
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x2a08d
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x44510
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
jne 0x2a0d8
movq -0x8(%rbp), %rax
cmpl $0x1, 0x60(%rax)
jne 0x2a0b2
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq 0x40(%rax), %rsi
callq 0x59ea0
movq -0x8(%rbp), %rdi
callq 0x29ec0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x2a0d3
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x52e80
jmp 0x2a23b
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jl 0x2a188
movq -0x8(%rbp), %rax
cmpl $0x2, 0x98(%rax)
je 0x2a188
leaq 0xdb742(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movq -0x8(%rbp), %rcx
movslq 0x30(%rcx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
cmpl $0x1, (%rax)
jne 0x2a188
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
leaq 0xdb711(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
addq $0x30f08, %rcx          # imm = 0x30F08
movq -0x8(%rbp), %rdx
movslq 0x30(%rdx), %rdx
imulq $0x340, %rdx, %rdx      # imm = 0x340
addq %rdx, %rcx
cmpl 0x18(%rcx), %eax
jge 0x2a176
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0xc(%rbp), %rax
imulq $0x160, %rax, %rax      # imm = 0x160
addq %rax, %rdi
callq 0x2a030
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2a125
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x52e80
jmp 0x2a232
movq -0x8(%rbp), %rax
movl 0x30(%rax), %edi
movl $0x3, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
movl $0xfffffffa, %r8d       # imm = 0xFFFFFFFA
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x2a1c3
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq 0x40(%rax), %rsi
callq 0x59ea0
jmp 0x2a229
movq -0x8(%rbp), %rax
cmpl $-0x4, 0x30(%rax)
jne 0x2a1ea
movq -0x8(%rbp), %rsi
addq $0xa8, %rsi
movq %rsp, %rdi
movl $0x11, %ecx
rep  movsq (%rsi), %es:(%rdi)
callq 0xc5dd0
jmp 0x2a227
movq -0x8(%rbp), %rax
cmpl $-0x5, 0x30(%rax)
jne 0x2a225
movq -0x8(%rbp), %rax
addq $0x140, %rax            # imm = 0x140
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x29fc0
jmp 0x2a227
jmp 0x2a229
movq -0x8(%rbp), %rdi
callq 0x2a250
movq -0x8(%rbp), %rdi
callq 0x29ec0
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)