// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/softtree.c
// Function: find_best_soft_tree_split_K_class
BOOLEAN find_best_soft_tree_split_K_class(Decisionnodeptr rootnode, Decisionnodeptr node, Instanceptr cvdata, Softregtree_parameterptr param)
{
 int i, datasize, performancebefore, performancebest, performancenow;
 double eta, *tmp;
 BOOLEAN result = BOOLEAN_TRUE;
 Decisionnodeptr bestnode;
 tmp = clone_array(node->w0s, current_dataset->classno);
 performancebefore = error_of_soft_tree_K_class(rootnode, cvdata);
 performancebest = performancebefore;
 datasize = data_size(rootnode->instances);
 node->left = createnewnode(node, 1);
 node->left->outputs = safemalloc(current_dataset->classno * sizeof(double), "find_best_soft_tree_split_K_class", 8);
 node->left->leaftype = CONSTANTLEAF;
 node->right = createnewnode(node, 1);
 node->right->outputs = safemalloc(current_dataset->classno * sizeof(double), "find_best_soft_tree_split_K_class", 11);
 node->right->leaftype = CONSTANTLEAF;
 node->featureno = SOFTLIN;
 bestnode = createnewnode(node, 1);
 bestnode->outputs = safemalloc(current_dataset->classno * sizeof(double), "find_best_soft_tree_split_K_class", 15);
 bestnode->left = createnewnode(node, 1);
 bestnode->left->outputs = safemalloc(current_dataset->classno * sizeof(double), "find_best_soft_tree_split_K_class", 17);
 bestnode->right = createnewnode(node, 1);
 bestnode->right->outputs = safemalloc(current_dataset->classno * sizeof(double), "find_best_soft_tree_split_K_class", 19);
 for (i = 0; i <= 10; i++)
  {
   eta = 10.0 / pow(2, i);
   gradient_descent_soft_tree_K_class(rootnode, node, param, eta);
   performancenow = error_of_soft_tree_K_class(rootnode, cvdata);
   if (performancenow < performancebest)
    {
     if (performancebest != performancebefore)
       free_soft_tree_ws_K_class(bestnode);
     performancebest = performancenow;
     copy_soft_tree_ws_K_class(bestnode, node);
    }
   free_soft_tree_ws_K_class(node);
  }
 if (performancebefore <= performancebest)
  {
   result = BOOLEAN_FALSE;
   deallocate_tree_rule(node->left);
   deallocate_tree_rule(node->right);
   safe_free(node->left->outputs);
   safe_free(node->right->outputs);
   safe_free(node->left);
   safe_free(node->right);
   make_leaf_node(node);
   memcpy(node->w0s, tmp, current_dataset->classno * sizeof(double));
  }
 else
  {
   copy_soft_tree_ws_K_class(node, bestnode);
   safe_free(node->w0s);
  }
 if (performancebest != performancebefore)
   free_soft_tree_ws_K_class(bestnode);
 safe_free(tmp);
 deallocate_tree_rule(bestnode->left);
 deallocate_tree_rule(bestnode->right);
 deallocate_tree_rule(bestnode);
 safe_free(bestnode->left->outputs);
 safe_free(bestnode->right->outputs);
 safe_free(bestnode->outputs);
 safe_free(bestnode->left);
 safe_free(bestnode->right);
 safe_free(bestnode);
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x1, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
leaq 0x45a02(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %esi
callq 0x4f9d0
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xbee60
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x449f0
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x29480
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
leaq 0x459ae(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
leaq 0x2dbf2(%rip), %rsi     # 0xeda96
movl $0x8, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl $0x0, 0x60(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x29480
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq 0x45956(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
leaq 0x2db9a(%rip), %rsi     # 0xeda96
movl $0xb, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x0, 0x60(%rax)
movq -0x10(%rbp), %rax
movl $0xfffffffa, 0x30(%rax) # imm = 0xFFFFFFFA
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x29480
movq %rax, -0x58(%rbp)
leaq 0x458f8(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
leaq 0x2db3c(%rip), %rsi     # 0xeda96
movl $0xf, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x29480
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
leaq 0x458b2(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
leaq 0x2daf6(%rip), %rsi     # 0xeda96
movl $0x11, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x29480
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq 0x45868(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
leaq 0x2daac(%rip), %rsi     # 0xeda96
movl $0x13, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x70(%rax)
movl $0x0, -0x24(%rbp)
cmpl $0xa, -0x24(%rbp)
jg 0xc00a3
cvtsi2sdl -0x24(%rbp), %xmm1
movsd 0x22c7f(%rip), %xmm0    # 0xe2ca0
callq 0x4290
movaps %xmm0, %xmm1
movsd 0x24917(%rip), %xmm0    # 0xe4948
divsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movsd -0x40(%rbp), %xmm0
callq 0xbef80
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xbee60
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xc008c
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0xc0079
movq -0x58(%rbp), %rdi
callq 0xbfba0
movl -0x34(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xbfc50
movq -0x10(%rbp), %rdi
callq 0xbfba0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc000a
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jg 0xc0137
movl $0x0, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x29ec0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x29ec0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x70(%rax), %rdi
callq 0x52e80
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x70(%rax), %rdi
callq 0x52e80
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x52e80
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x52e80
movq -0x10(%rbp), %rdi
callq 0x28a30
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x48(%rbp), %rsi
leaq 0x4571b(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdx
shlq $0x3, %rdx
callq 0x42b0
jmp 0xc0151
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0xbfc50
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x52e80
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0xc0162
movq -0x58(%rbp), %rdi
callq 0xbfba0
movq -0x48(%rbp), %rdi
callq 0x52e80
movq -0x58(%rbp), %rax
movq (%rax), %rdi
callq 0x29ec0
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x29ec0
movq -0x58(%rbp), %rdi
callq 0x29ec0
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq 0x70(%rax), %rdi
callq 0x52e80
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x70(%rax), %rdi
callq 0x52e80
movq -0x58(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x52e80
movq -0x58(%rbp), %rax
movq (%rax), %rdi
callq 0x52e80
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x52e80
movq -0x58(%rbp), %rdi
callq 0x52e80
movl -0x4c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)