// File: /workspace/github_c_makefile_star2_O1/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 0x1cff3
callq 0x39194
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x1d001
callq 0x39194
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x1d00f
callq 0x2f616
movl 0x30(%rbx), %edi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rdi
je 0x1d0ed
testl %edi, %edi
js 0x1d0a2
cmpl $0x2, 0x98(%rbx)
je 0x1d0a2
leaq 0xb583c(%rip), %r14     # 0xd2870
movq (%r14), %rax
imulq $0x340, %rdi, %rcx      # imm = 0x340
cmpl $0x1, 0x30f08(%rax,%rcx)
jne 0x1d0a2
movq (%r14), %rax
movslq 0x30(%rbx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
cmpl $0x0, 0x30f20(%rax,%rcx)
jle 0x1d097
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%rbx), %rdi
addq %r15, %rdi
callq 0x1cfd1
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 0x1d066
movq 0x10(%rbx), %rdi
callq 0x39194
jmp 0x1d0d7
movl $0x3, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
movl $0xfffffffa, %r8d       # imm = 0xFFFFFFFA
xorl %eax, %eax
callq 0x39a80
testl %eax, %eax
je 0x1d124
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x3dbad
movq %rbx, %rdi
callq 0x1d173
movq %rbx, %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1ced4
cmpl $0x1, 0x60(%rbx)
jne 0x1d100
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x3dbad
movq %rbx, %rdi
callq 0x1ced4
movq 0x50(%rbx), %rdi
addq $0x88, %rsp
testq %rdi, %rdi
je 0x1d14a
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x39194
movl 0x30(%rbx), %eax
cmpl $-0x5, %eax
je 0x1d152
cmpl $-0x4, %eax
jne 0x1d0cf
leaq 0xa8(%rbx), %rsi
movl $0x11, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x8dd6c
jmp 0x1d0cf
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 0x1cf7e
jmp 0x1d0cf