// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/nodeboundedtree.c
// Function: prune_node_bounded_tree
void prune_node_bounded_tree(Decisionnodeptr root, Nodeboundedtree_parameterptr param, int datasize)
{
 /*!Last Changed 30.09.2007*/
 int finished = NO, count, h, index, best;
 double *generalizationerror, error;
 Decisionnodeptr *nodes, toberemoved;
 while (!finished)
  {
   count = decisiontree_node_count(root) + 1;
   nodes = safemalloc(count * sizeof(Decisionnodeptr), "prune_node_bounded_tree", 7);
   generalizationerror = safemalloc(count * sizeof(double), "prune_node_bounded_tree", 8);
   error = decisiontree_falsepositive_count(root) / (datasize + 0.0);
   h = decisiontree_vc_dimension_wrt_nodetype(current_dataset, count - 1, param->model - 5);
   generalizationerror[0] = srm_classification(error, h, datasize, param->a1, param->a2);
   index = 0;
   prune_node_bounded_tree_nodes(root, root, param, nodes, generalizationerror, &index, datasize);
   best = find_min_in_list_double(generalizationerror, count);
   finished = YES;
   if (best != 0)
    {
     toberemoved = nodes[best];
     finished = NO;
     if (in_list(toberemoved->featureno, 2, LINEAR, QUADRATIC))
       matrix_free(toberemoved->w);
     accumulate_instances_tree(&(toberemoved->instances), toberemoved);
     toberemoved->featureno = LEAF_NODE;
     free_children(toberemoved);
    }
   safe_free(nodes);
   safe_free(generalizationerror);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x72a7c
jmp 0x72bff
movq -0x8(%rbp), %rdi
callq 0x28de0
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movslq -0x1c(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x7488a(%rip), %rsi     # 0xe7324
movl $0x7, %edx
callq 0x52d70
movq %rax, -0x40(%rbp)
movslq -0x1c(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x7486d(%rip), %rsi     # 0xe7324
movl $0x8, %edx
callq 0x52d70
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x28a70
cvtsi2sd %eax, %xmm0
cvtsi2sdl -0x14(%rbp), %xmm1
xorps %xmm2, %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
leaq 0x92d52(%rip), %rax     # 0x105840
movq (%rax), %rdi
movl -0x1c(%rbp), %esi
subl $0x1, %esi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
subl $0x5, %edx
callq 0xe0580
movl %eax, -0x20(%rbp)
movsd -0x38(%rbp), %xmm0
movl -0x20(%rbp), %edi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rax
movsd 0x18(%rax), %xmm1
movq -0x10(%rbp), %rax
movsd 0x20(%rax), %xmm2
callq 0x67a20
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x14(%rbp), %eax
leaq -0x24(%rbp), %r9
movl %eax, (%rsp)
callq 0x72900
movq -0x30(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x50490
movl %eax, -0x28(%rbp)
movl $0x1, -0x18(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x72be8
movq -0x40(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x48(%rbp), %rax
movl 0x30(%rax), %edi
movl $0x2, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x72bc3
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rdi
movq 0x40(%rax), %rsi
callq 0x59ea0
movq -0x48(%rbp), %rdi
addq $0x20, %rdi
movq -0x48(%rbp), %rsi
callq 0x29160
movq -0x48(%rbp), %rax
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movq -0x48(%rbp), %rdi
callq 0x2a250
movq -0x40(%rbp), %rdi
callq 0x52e80
movq -0x30(%rbp), %rdi
callq 0x52e80
jmp 0x72a6a
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)