// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x554a6(%rip), %rdi     # 0xa8c98
callq 0x54920
movl %eax, %ebp
movq 0x20(%rbx), %rdi
callq 0x30309
movl %eax, %r15d
cvtsi2sdl 0x88(%rbx), %xmm0
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd 0x30(%r14), %xmm1
movsd 0x38(%r14), %xmm2
movl $0x1, %edi
movl %eax, %esi
callq 0x4896e
movsd %xmm0, 0x38(%rsp)
movsd 0x20(%r14), %xmm0
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbx, %rdi
movl %ebp, %r8d
callq 0x531f9
movl %ebp, 0x4(%rsp)
testl %ebp, %ebp
jle 0x5396b
movl 0x4(%rsp), %r12d
xorl %r13d, %r13d
leaq 0x40(%rsp), %rdi
movsd 0x20(%rsp,%r13,8), %xmm0
ucomisd 0x5252d(%rip), %xmm0    # 0xa5da8
jne 0x53883
jnp 0x5395f
cmpl $0x2, %r13d
je 0x53902
cmpl $0x1, %r13d
je 0x538e7
movl $0x2, %ebp
testl %r13d, %r13d
jne 0x53935
leaq 0x81fcc(%rip), %rax     # 0xd5870
movq (%rax), %rax
movl 0x1c0(%rax), %eax
decl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x39bdc
cvttsd2si %xmm0, %ebp
incl %ebp
movq 0x20(%rbx), %rdi
movl 0x30(%rbx), %esi
movsd 0x28(%rbx), %xmm0
leaq 0x40(%rsp), %rdx
leaq 0x108(%rsp), %rcx
movl $0x2, %r8d
callq 0xa11fa
jmp 0x53930
movl 0x90(%rbx), %ebp
incl %ebp
movsd 0x48(%rbx), %xmm0
movq 0x20(%rbx), %rdi
movq 0x38(%rbx), %rsi
movq 0x40(%rbx), %rdx
jmp 0x5391e
movl 0x94(%rbx), %ebp
incl %ebp
movq 0x20(%rbx), %rdi
movsd 0x18(%rsp), %xmm0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x108(%rsp), %r8
callq 0x4de0c
leaq 0x40(%rsp), %rdi
movl %r15d, %esi
callq 0x1e071
movsd 0x30(%r14), %xmm1
movsd 0x38(%r14), %xmm2
movl %ebp, %edi
movl %r15d, %esi
callq 0x4896e
leaq 0x40(%rsp), %rdi
movsd %xmm0, 0x20(%rsp,%r13,8)
incq %r13
cmpq %r13, %r12
jne 0x5386c
leaq 0x20(%rsp), %rdi
movl 0x4(%rsp), %ebp
movl %ebp, %esi
callq 0x38250
cmpl $-0x1, %eax
je 0x53990
cltq
movsd 0x20(%rsp,%rax,8), %xmm0
ucomisd 0x38(%rsp), %xmm0
jbe 0x539e5
cmpl $0x2, %ebp
jl 0x539b4
movsd 0x28(%rsp), %xmm0
ucomisd 0x52405(%rip), %xmm0    # 0xa5da8
jne 0x539a7
jnp 0x539b4
movq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x3ed51
cmpl $0x3, %ebp
jl 0x539da
movsd 0x30(%rsp), %xmm0
ucomisd 0x523e1(%rip), %xmm0    # 0xa5da8
jne 0x539cb
jnp 0x539da
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x3ed51
movl $0xffffffff, 0x30(%rbx) # imm = 0xFFFFFFFF
xorl %eax, %eax
jmp 0x53a05
movsd 0x18(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %r8d
callq 0x533cf
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq