// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/decisionforest.c
// Function: create_kforestchildren
int create_kforestchildren(Decisionnodeptr node, Kforest_parameterptr p)
{
 int iteration, j, t, fno, permsize;
 double bestgain = ISELL;
 int** perm;
 int* array;
 int* iter;
 int* rangelist;
 int** featurecounts;
 Korderingsplit ksplit;
 node->conditiontype = UNIVARIATE_CONDITION;
 node->featureno = DISCRETEMIX;
 if (!(setup_node_properties(node)))
  {
   make_leaf_node(node);
   return 1;
  }
 iteration = 0;
 ksplit.featurecount = p->k;
 ksplit.sortorder = safemalloc(p->k * sizeof(int*), "create_kforestchildren", 20);
 for (j = 0; j < p->k; j++)
   ksplit.sortorder[j] = safemalloc(sizeof(int), "create_kforestchildren", 22);
 ksplit.featurelist = safemalloc(p->k * sizeof(int), "create_kforestchildren", 23);
 ksplit.discretesplit = safemalloc(p->k * sizeof(int), "create_kforestchildren", 24);
 perm = safemalloc(p->k * sizeof(int*), "create_kforestchildren", 25);
 rangelist = safemalloc(p->k * sizeof(int), "create_kforestchildren", 26);
 iter = safemalloc(p->k * sizeof(int), "create_kforestchildren", 27);
 while (iteration < p->featuresize)
  {
   array = random_array(current_dataset->featurecount);
   j = 0;
   t = 0;
   while (j < p->k)
    {
     fno = array[t];
     if (current_dataset->features[fno].type != CLASSDEF)
      {
       iter[j] = fno;
       j++;
      }
     t++;
    }
   safe_free(array);
   featurecounts = count_feature_combinations(node->instances, iter, p->k, &permsize);
   for (j = 0; j < p->k; j++)
    {
     rangelist[j] = current_dataset->features[iter[j]].valuecount;
     perm[j] = random_array(rangelist[j]);
    }
   update_best_discrete_split(&ksplit, perm, rangelist, iter, featurecounts, node->counts, &bestgain);
   iteration++;
   for (j = 0; j < p->k; j++)
     safe_free(perm[j]);
   free_2d((void**) featurecounts, permsize);
  }
 safe_free(perm);
 safe_free(iter);
 safe_free(rangelist);
 if (bestgain == ISELL)
  {
   for (j = 0; j < p->k; j++)
     safe_free(ksplit.sortorder[j]);
   safe_free(ksplit.sortorder);
   safe_free(ksplit.discretesplit);
   safe_free(ksplit.featurelist);
   node->featureno = LEAF_NODE;
   return 1;
  }
 else
   node->ksplit = ksplit;
 if (!(make_children_discrete(node)))
   return 1;
 create_kforestchildren(node->left, p);
 create_kforestchildren(node->right, p);
 return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movsd 0xba58d(%rip), %xmm0    # 0xe2998
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x98(%rax)
movq -0x10(%rbp), %rax
movl $0xfffffffb, 0x30(%rax) # imm = 0xFFFFFFFB
movq -0x10(%rbp), %rdi
callq 0x29290
cmpl $0x0, %eax
jne 0x2844c
movq -0x10(%rbp), %rdi
callq 0x28a30
movl $0x1, -0x4(%rbp)
jmp 0x28808
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movslq 0x8(%rax), %rdi
shlq $0x3, %rdi
leaq 0xbc06e(%rip), %rsi     # 0xe44de
movl $0x14, %edx
callq 0x52d70
movq %rax, -0x68(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x284c1
movl $0x4, %edi
leaq 0xbc041(%rip), %rsi     # 0xe44de
movl $0x16, %edx
callq 0x52d70
movq %rax, %rdx
movq -0x68(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x28485
movq -0x18(%rbp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
leaq 0xbc00a(%rip), %rsi     # 0xe44de
movl $0x17, %edx
callq 0x52d70
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
leaq 0xbbfe9(%rip), %rsi     # 0xe44de
movl $0x18, %edx
callq 0x52d70
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rax
movslq 0x8(%rax), %rdi
shlq $0x3, %rdi
leaq 0xbbfc8(%rip), %rsi     # 0xe44de
movl $0x19, %edx
callq 0x52d70
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
leaq 0xbbfa7(%rip), %rsi     # 0xe44de
movl $0x1a, %edx
callq 0x52d70
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
leaq 0xbbf86(%rip), %rsi     # 0xe44de
movl $0x1b, %edx
callq 0x52d70
movq %rax, -0x50(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x2870b
leaq 0xdd2c3(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x1bc(%rax), %edi
callq 0x54600
movq %rax, -0x48(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x20(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x285fc
movq -0x48(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
leaq 0xdd282(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x28(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
cmpl $0x3, (%rax)
je 0x285f1
movl -0x28(%rbp), %edx
movq -0x50(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2859d
movq -0x48(%rbp), %rdi
callq 0x52e80
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x50(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
leaq -0x2c(%rbp), %rcx
callq 0xdd400
movq %rax, -0x60(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x28696
leaq 0xdd201(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movq -0x50(%rbp), %rcx
movslq -0x20(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl 0x18(%rax), %edx
movq -0x58(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x54600
movq %rax, %rdx
movq -0x40(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x2862c
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %r9
leaq -0x80(%rbp), %rdi
leaq -0x38(%rbp), %rax
movq %rax, (%rsp)
callq 0x48140
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x286fa
movq -0x40(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x52e80
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x286d2
movq -0x60(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x52e20
jmp 0x28566
movq -0x40(%rbp), %rdi
callq 0x52e80
movq -0x50(%rbp), %rdi
callq 0x52e80
movq -0x58(%rbp), %rdi
callq 0x52e80
movsd -0x38(%rbp), %xmm0
movsd 0xba265(%rip), %xmm1    # 0xe2998
ucomisd %xmm1, %xmm0
jne 0x28799
jp 0x28799
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2876a
movq -0x68(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x52e80
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x28742
movq -0x68(%rbp), %rdi
callq 0x52e80
movq -0x70(%rbp), %rdi
callq 0x52e80
movq -0x78(%rbp), %rdi
callq 0x52e80
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movl $0x1, -0x4(%rbp)
jmp 0x28808
movq -0x10(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, 0x140(%rax)
movq -0x78(%rbp), %rcx
movq %rcx, 0x148(%rax)
movq -0x70(%rbp), %rcx
movq %rcx, 0x150(%rax)
movq -0x68(%rbp), %rcx
movq %rcx, 0x158(%rax)
movq -0x10(%rbp), %rdi
callq 0x48a40
cmpl $0x0, %eax
jne 0x287e0
movl $0x1, -0x4(%rbp)
jmp 0x28808
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x283f0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x283f0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)