// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/omnivariatetree.c
// Function: find_best_hybrid_ldt_split_srm
int find_best_hybrid_ldt_split_srm(Decisionnodeptr node, Multildt_parameterptr param)
{
 /*!Last Changed 06.11.2007 added SRM prepruning*/
 /*!Last Changed 25.08.2007*/
 int hybridspace = get_parameter_i("hybridspace");
 int i, N = data_size(node->instances), h, counts[2][MAXCLASSES], bestmodel;
 matrix qw;
 double qw0, results[3], error, base_generalization_error;
 base_generalization_error = srm_classification(node->falsepositives / (N + 0.0), 1, N, param->a1, param->a2);
 find_uni_and_multi_splits(node, &qw, &qw0, results, param->variance_explained, hybridspace);
 for (i = 0; i < hybridspace; i++)
   if (results[i] != -1)
    {
     switch (i)
      {
       case 0:h = (int) log2(current_dataset->multifeaturecount - 1) + 1;
              find_counts_for_split(node->instances, node->featureno, node->split, counts[0], counts[1], HYBRID_CONDITION);
              break;
       case 1:h = node->lineard + 1;
              find_counts_for_multivariate_split(node->instances, node->w, node->w0, counts[0], counts[1]);
              break;
       case 2:h = node->quadraticd + 1;
              find_counts_for_multivariate_split(node->instances, qw, qw0, counts[0], counts[1]);
              break;
       default:h = 2;
               break;
      }
     error = error_of_split(counts, N);
     results[i] = srm_classification(error, h, N, param->a1, param->a2);
    }
 /*To implement prepruning, compare generalization error of the leaf with the best model*/
 bestmodel = find_min_in_list_double(results, hybridspace);
 if (bestmodel == -1 || results[bestmodel] > base_generalization_error)
  {
   if (hybridspace > 1 && results[1] != -1)
     matrix_free(node->w);
   if (hybridspace > 2 && results[2] != -1)
     matrix_free(qw);  
   node->featureno = LEAF_NODE;
   return 0;
  }
 else
   return set_best_hybrid_split(results, node, qw, qw0, hybridspace);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq 0x6e376(%rip), %rdi     # 0xe57d0
callq 0x78f10
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x449f0
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
cvtsi2sdl 0x88(%rax), %xmm0
cvtsi2sdl -0x24(%rbp), %xmm1
xorps %xmm2, %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movl -0x24(%rbp), %esi
movq -0x18(%rbp), %rax
movsd 0x30(%rax), %xmm1
movq -0x18(%rbp), %rax
movsd 0x38(%rax), %xmm2
movl $0x1, %edi
callq 0x67a20
movsd %xmm0, -0x210(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x200(%rbp), %rcx
movq -0x18(%rbp), %rax
movsd 0x20(%rax), %xmm0
movl -0x1c(%rbp), %r8d
leaq -0x1d8(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq 0x76ad0
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x7769b
movslq -0x20(%rbp), %rax
movsd -0x200(%rbp,%rax,8), %xmm0
movsd 0x6b540(%rip), %xmm1    # 0xe2a48
ucomisd %xmm1, %xmm0
jne 0x77515
jp 0x77515
jmp 0x7768b
movl -0x20(%rbp), %eax
movl %eax, -0x214(%rbp)
testl %eax, %eax
je 0x77545
jmp 0x77524
movl -0x214(%rbp), %eax
subl $0x1, %eax
je 0x775a8
jmp 0x77531
movl -0x214(%rbp), %eax
subl $0x2, %eax
je 0x775f1
jmp 0x7763b
leaq 0x8e2f4(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1c0(%rax), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm0
callq 0x52ad0
cvttsd2si %xmm0, %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
leaq -0x1c0(%rbp), %rdx
leaq -0x1c0(%rbp), %rcx
addq $0xc8, %rcx
movl $0x2, %r8d
callq 0xdd8e0
jmp 0x77642
movq -0x10(%rbp), %rax
movl 0x90(%rax), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movsd 0x48(%rcx), %xmm0
leaq -0x1c0(%rbp), %rcx
leaq -0x1c0(%rbp), %r8
addq $0xc8, %r8
movq 0x38(%rax), %rsi
movq 0x40(%rax), %rdx
callq 0x6f960
jmp 0x77642
movq -0x10(%rbp), %rax
movl 0x94(%rax), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movsd -0x1e0(%rbp), %xmm0
leaq -0x1c0(%rbp), %rcx
leaq -0x1c0(%rbp), %r8
addq $0xc8, %r8
movq -0x1d8(%rbp), %rsi
movq -0x1d0(%rbp), %rdx
callq 0x6f960
jmp 0x77642
movl $0x2, -0x28(%rbp)
leaq -0x1c0(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x2adc0
movsd %xmm0, -0x208(%rbp)
movsd -0x208(%rbp), %xmm0
movl -0x28(%rbp), %edi
movl -0x24(%rbp), %esi
movq -0x18(%rbp), %rax
movsd 0x30(%rax), %xmm1
movq -0x18(%rbp), %rax
movsd 0x38(%rax), %xmm2
callq 0x67a20
movslq -0x20(%rbp), %rax
movsd %xmm0, -0x200(%rbp,%rax,8)
jmp 0x7768d
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x774e7
leaq -0x200(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x50490
movl %eax, -0x1c4(%rbp)
cmpl $-0x1, -0x1c4(%rbp)
je 0x776d3
movslq -0x1c4(%rbp), %rax
movsd -0x200(%rbp,%rax,8), %xmm0
ucomisd -0x210(%rbp), %xmm0
jbe 0x7774b
cmpl $0x1, -0x1c(%rbp)
jle 0x77704
movsd -0x1f8(%rbp), %xmm0
movsd 0x6b35f(%rip), %xmm1    # 0xe2a48
ucomisd %xmm1, %xmm0
jne 0x776f3
jp 0x776f3
jmp 0x77704
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq 0x40(%rax), %rsi
callq 0x59ea0
cmpl $0x2, -0x1c(%rbp)
jle 0x77737
movsd -0x1f0(%rbp), %xmm0
movsd 0x6b32e(%rip), %xmm1    # 0xe2a48
ucomisd %xmm1, %xmm0
jne 0x77724
jp 0x77724
jmp 0x77737
movq -0x1d8(%rbp), %rdi
movq -0x1d0(%rbp), %rsi
callq 0x59ea0
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movl $0x0, -0x4(%rbp)
jmp 0x77778
leaq -0x200(%rbp), %rdi
movq -0x10(%rbp), %rsi
movsd -0x1e0(%rbp), %xmm0
movl -0x1c(%rbp), %r8d
movq -0x1d8(%rbp), %rdx
movq -0x1d0(%rbp), %rcx
callq 0x76df0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw %cs:(%rax,%rax)