// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
jne 0x76332
jmp 0x76598
movl -0x14(%rbp), %eax
subl $0x3, %eax
jne 0x763d6
jmp 0x76340
movq -0x8(%rbp), %rdi
callq 0x28a70
cvtsi2sd %eax, %xmm0
movq -0x8(%rbp), %rax
cvtsi2sdl 0x84(%rax), %xmm1
xorps %xmm2, %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq 0x8f4d0(%rip), %rax     # 0x105840
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0xe04e0
movl %eax, -0x38(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movl 0x84(%rax), %eax
movl %eax, -0x54(%rbp)
leaq 0x6c40e(%rip), %rdi     # 0xe27b1
callq 0x79040
movsd %xmm0, -0x50(%rbp)
leaq 0x6c403(%rip), %rdi     # 0xe27b7
callq 0x79040
movl -0x58(%rbp), %edi
movl -0x54(%rbp), %esi
movsd -0x50(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x48(%rbp), %xmm0
callq 0x67a20
movsd %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
subl $0x3, %eax
jne 0x7648f
jmp 0x763f9
movq -0x8(%rbp), %rdi
callq 0x28a70
cvtsi2sd %eax, %xmm0
movq -0x8(%rbp), %rax
cvtsi2sdl 0x84(%rax), %xmm1
xorps %xmm2, %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq 0x8f417(%rip), %rax     # 0x105840
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0xe04e0
movl %eax, -0x38(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movl 0x84(%rax), %eax
movl %eax, -0x6c(%rbp)
leaq 0x6c355(%rip), %rdi     # 0xe27b1
callq 0x79040
movsd %xmm0, -0x68(%rbp)
leaq 0x6c34a(%rip), %rdi     # 0xe27b7
callq 0x79040
movl -0x70(%rbp), %edi
movl -0x6c(%rbp), %esi
movsd -0x68(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x60(%rbp), %xmm0
callq 0x67a20
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x764be
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rsi
callq 0x29160
movq -0x10(%rbp), %rdi
callq 0x2a250
jmp 0x76598
movl -0x3c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jl 0x7656f
movq -0x10(%rbp), %rax
cmpl $0x2, 0x98(%rax)
je 0x7656f
leaq 0x8f352(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movq -0x10(%rbp), %rcx
movslq 0x30(%rcx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
cmpl $0x1, (%rax)
jne 0x7656f
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
leaq 0x8f321(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
addq $0x30f08, %rcx          # imm = 0x30F08
movq -0x10(%rbp), %rdx
movslq 0x30(%rdx), %rdx
imulq $0x340, %rdx, %rdx      # imm = 0x340
addq %rdx, %rcx
cmpl 0x18(%rcx), %eax
jge 0x7656d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movslq -0x34(%rbp), %rax
imulq $0x160, %rax, %rax      # imm = 0x160
addq %rax, %rsi
movl -0x14(%rbp), %edx
callq 0x76310
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x76515
jmp 0x76596
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movl -0x14(%rbp), %edx
callq 0x76310
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movl -0x14(%rbp), %edx
callq 0x76310
jmp 0x76598
addq $0x70, %rsp
popq %rbp
retq
nop