// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/omnivariatetree.c
// Function: prune_tree_global
void prune_tree_global(Decisionnodeptr root, Decisionnodeptr currentnode, int modelselectionmethod)
{
 double performancebefore, performance, error;
 int i, h, tmp;
 if (currentnode->featureno == LEAF_NODE)
   return;
 switch (modelselectionmethod)
  {
   case MODEL_SELECTION_SRM:error = decisiontree_falsepositive_count(root) / (root->covered + 0.0);
                            h = decisiontree_vc_dimension_recursive(current_dataset, root);
                            performancebefore = srm_classification(error, h, root->covered, get_parameter_f("srma1"), get_parameter_f("srma2"));
                            break;
  }
 tmp = currentnode->featureno;
 currentnode->featureno = LEAF_NODE;
 switch (modelselectionmethod)
  {
   case MODEL_SELECTION_SRM:error = decisiontree_falsepositive_count(root) / (root->covered + 0.0);
                            h = decisiontree_vc_dimension_recursive(current_dataset, root);
                            performance = srm_classification(error, h, root->covered, get_parameter_f("srma1"),  get_parameter_f("srma2"));
                            break;
  }
 if (performance < performancebefore)
  {
   accumulate_instances_tree(&(currentnode->instances), currentnode);
   free_children(currentnode);
  }
 else
  {
   currentnode->featureno = tmp;
   if (currentnode->featureno >= 0 && (currentnode->conditiontype != HYBRID_CONDITION) && current_dataset->features[currentnode->featureno].type == STRING)
     for (i = 0; i < current_dataset->features[currentnode->featureno].valuecount; i++)
       prune_tree_global(root, &(currentnode->string[i]), modelselectionmethod);
   else
    {
     prune_tree_global(root, currentnode->left, modelselectionmethod);
     prune_tree_global(root, currentnode->right, modelselectionmethod);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x30(%rbx), %r12d
cmpl $-0x1, %r12d
je 0x4b391
cmpl $0x3, %ebp
jne 0x4b2e1
movq %r14, %rdi
callq 0x1a6bc
cvtsi2sd %eax, %xmm1
cvtsi2sdl 0x84(%r14), %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
leaq 0x82667(%rip), %rax     # 0xcd870
movq (%rax), %rdi
movq %r14, %rsi
callq 0x93b46
movl %eax, %r13d
movl 0x84(%r14), %r15d
leaq 0x4a817(%rip), %rdi     # 0x95a3c
callq 0x4cdcf
movsd %xmm0, (%rsp)
leaq 0x4a80c(%rip), %rdi     # 0x95a42
callq 0x4cdcf
movapd %xmm0, %xmm2
movsd 0x8(%rsp), %xmm0
movl %r13d, %edi
movl %r15d, %esi
movsd (%rsp), %xmm1
callq 0x41c3e
movsd %xmm0, 0x8(%rsp)
movl 0x30(%rbx), %r12d
orl $-0x1, 0x30(%rbx)
movq %r14, %rdi
callq 0x1a6bc
cvtsi2sd %eax, %xmm1
cvtsi2sdl 0x84(%r14), %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
leaq 0x825e8(%rip), %rax     # 0xcd870
movq (%rax), %rdi
movq %r14, %rsi
callq 0x93b46
movl %eax, %r15d
movl 0x84(%r14), %r13d
leaq 0x4a798(%rip), %rdi     # 0x95a3c
callq 0x4cdcf
movsd %xmm0, 0x10(%rsp)
leaq 0x4a78c(%rip), %rdi     # 0x95a42
callq 0x4cdcf
movapd %xmm0, %xmm2
movsd (%rsp), %xmm0
movl %r15d, %edi
movl %r13d, %esi
movsd 0x10(%rsp), %xmm1
callq 0x41c3e
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x4b327
movl %r12d, 0x30(%rbx)
testl %r12d, %r12d
js 0x4b311
cmpl $0x2, 0x98(%rbx)
je 0x4b311
leaq 0x82576(%rip), %rax     # 0xcd870
movq (%rax), %rax
movl %r12d, %ecx
imulq $0x340, %rcx, %rcx      # imm = 0x340
cmpl $0x1, 0x30f08(%rax,%rcx)
je 0x4b349
movq (%rbx), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x4b1b6
movq 0x8(%rbx), %rbx
jmp 0x4b1cc
leaq 0x20(%rbx), %rdi
movq %rbx, %rsi
callq 0x1aad3
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1b42e
xorl %r15d, %r15d
xorl %r13d, %r13d
movslq %r12d, %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movslq 0x30f20(%rax,%rcx), %rax
cmpq %rax, %r13
jge 0x4b391
movq 0x10(%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x4b1b6
incq %r13
leaq 0x824ef(%rip), %rax     # 0xcd870
movq (%rax), %rax
movl 0x30(%rbx), %r12d
addq $0x160, %r15            # imm = 0x160
jmp 0x4b34f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq