// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/univariatetree.c
// Function: make_children
int make_children(Decisionnodeptr node)
{
 /*!Last Changed 02.02.2004*/
 /*!Last Changed 08.04.2003*/
 Instanceptr inst,leftbefore=NULL,rightbefore=NULL,*before;
 Decisionnodeptr left,right;
 Decisioncondition ruleleft, ruleright, rule;
 int i,count;
 double value;
 if (node->featureno == LEAF_NODE || node->instances == NULL)
  {
   make_leaf_node(node);
   return 0;
  }
 switch (current_dataset->features[node->featureno].type)
  {
   case INTEGER:
   case REAL   :left = createnewnode(node, 1);
                right = createnewnode(node, 1);
                node->string = NULL;
                node->left = left;
                node->right = right;
                ruleleft = createcondition(node->featureno,'<',node->split);
                ruleleft.conditiontype = UNIVARIATE_CONDITION;
                addcondition(node->left, ruleleft);
                ruleright = createcondition(node->featureno,'>',node->split);
                ruleright.conditiontype = UNIVARIATE_CONDITION;
                addcondition(node->right, ruleright);
                inst=node->instances;
                while (inst)
                 {
                  if (current_dataset->features[node->featureno].type==INTEGER)
                    value=inst->values[node->featureno].intvalue;
                  else
                    value=inst->values[node->featureno].floatvalue;
                  if (value<=node->split)
                   {
                    if (leftbefore)
                      leftbefore->next=inst;
                    else
                      left->instances=inst;
                    leftbefore=inst;
                   }
                  else
                   {
                    if (rightbefore)
                      rightbefore->next=inst;
                    else
                      right->instances=inst;
                    rightbefore=inst;
                   }
                  inst=inst->next;
                 }
                if (leftbefore)
                  leftbefore->next=NULL;
                if (rightbefore)
                  rightbefore->next=NULL;
                node->instances=NULL;
                break;
   case STRING :count=current_dataset->features[node->featureno].valuecount;
                node->string = createnewnode(node, count);                
                before = (Instanceptr*)safemalloc(count*sizeof(Instanceptr), "make_children", 56);
                node->left = NULL;
                node->right = NULL;
                for (i = 0; i < count; i++)
                 {
                  node->string[i].instances = NULL;
                  rule = createcondition(node->featureno, '=', i);
                  rule.conditiontype = UNIVARIATE_CONDITION;
                  addcondition(&(node->string[i]), rule);
                  before[i] = NULL;
                 }
                inst=node->instances;
                while (inst)
                 {
                  i=inst->values[node->featureno].stringindex;
                  if (before[i]==NULL)
                   {
                    node->string[i].instances=inst;
                    before[i]=inst;
                   }
                  else
                   {
                    before[i]->next=inst;
                    before[i]=inst;
                   }
                  inst=inst->next;
                 }
                node->instances=NULL;
                for (i=0;i<count;i++)
                 {
                  if (before[i])
                    before[i]->next=NULL;
                  else
                    node->string[i].instances=NULL;
                 }
                safe_free(before);
                break;
  }
 return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
je 0xdce14
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0xdce29
movq -0x10(%rbp), %rdi
callq 0x28a30
movl $0x0, -0x4(%rbp)
jmp 0xdd3eb
leaq 0x28a10(%rip), %rax     # 0x105840
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x30(%rcx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
movl %eax, -0x2f4(%rbp)
testl %eax, %eax
je 0xdce77
jmp 0xdce55
movl -0x2f4(%rbp), %eax
subl $0x1, %eax
je 0xdd117
jmp 0xdce66
movl -0x2f4(%rbp), %eax
subl $0x2, %eax
jne 0xdd3e4
jmp 0xdce77
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x29480
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x29480
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
leaq -0x210(%rbp), %rdi
movl $0x3c, %edx
callq 0xdba90
leaq -0xb0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
movl $0x70, %edx
callq 0x42b0
movl $0x0, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movups -0x50(%rbp), %xmm0
movq %rsp, %rax
movups %xmm0, 0x60(%rax)
movups -0x60(%rbp), %xmm0
movups %xmm0, 0x50(%rax)
movups -0x70(%rbp), %xmm0
movups %xmm0, 0x40(%rax)
movups -0xb0(%rbp), %xmm0
movups -0xa0(%rbp), %xmm1
movups -0x90(%rbp), %xmm2
movups -0x80(%rbp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x293f0
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
leaq -0x280(%rbp), %rdi
movl $0x3e, %edx
callq 0xdba90
leaq -0x120(%rbp), %rdi
leaq -0x280(%rbp), %rsi
movl $0x70, %edx
callq 0x42b0
movl $0x0, -0xe0(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movups -0xc0(%rbp), %xmm0
movq %rsp, %rax
movups %xmm0, 0x60(%rax)
movups -0xd0(%rbp), %xmm0
movups %xmm0, 0x50(%rax)
movups -0xe0(%rbp), %xmm0
movups %xmm0, 0x40(%rax)
movups -0x120(%rbp), %xmm0
movups -0x110(%rbp), %xmm1
movups -0x100(%rbp), %xmm2
movups -0xf0(%rbp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x293f0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xdd0e0
leaq 0x28836(%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 $0x0, (%rax)
jne 0xdd048
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x30(%rcx), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x1a0(%rbp)
jmp 0xdd064
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x30(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x1a0(%rbp)
movsd -0x1a0(%rbp), %xmm1
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0xdd0a6
cmpq $0x0, -0x20(%rbp)
je 0xdd090
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0xdd09c
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xdd0cf
cmpq $0x0, -0x28(%rbp)
je 0xdd0bb
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0xdd0c7
movq -0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xdcff8
cmpq $0x0, -0x20(%rbp)
je 0xdd0f3
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
cmpq $0x0, -0x28(%rbp)
je 0xdd106
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
jmp 0xdd3e4
leaq 0x28722(%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
movl 0x18(%rax), %eax
movl %eax, -0x198(%rbp)
movq -0x10(%rbp), %rdi
movl -0x198(%rbp), %esi
callq 0x29480
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movslq -0x198(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x11934(%rip), %rsi     # 0xeeaa2
movl $0x38, %edx
callq 0x52d70
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movl $0x0, -0x194(%rbp)
movl -0x194(%rbp), %eax
cmpl -0x198(%rbp), %eax
jge 0xdd2a6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x194(%rbp), %rcx
imulq $0x160, %rcx, %rcx      # imm = 0x160
addq %rcx, %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
cvtsi2sdl -0x194(%rbp), %xmm0
leaq -0x2f0(%rbp), %rdi
movl $0x3d, %edx
callq 0xdba90
leaq -0x190(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
movl $0x70, %edx
callq 0x42b0
movl $0x0, -0x150(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x194(%rbp), %rax
imulq $0x160, %rax, %rax      # imm = 0x160
addq %rax, %rdi
movups -0x130(%rbp), %xmm0
movq %rsp, %rax
movups %xmm0, 0x60(%rax)
movups -0x140(%rbp), %xmm0
movups %xmm0, 0x50(%rax)
movups -0x150(%rbp), %xmm0
movups %xmm0, 0x40(%rax)
movups -0x190(%rbp), %xmm0
movups -0x180(%rbp), %xmm1
movups -0x170(%rbp), %xmm2
movups -0x160(%rbp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x293f0
movq -0x30(%rbp), %rax
movslq -0x194(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x194(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x194(%rbp)
jmp 0xdd19d
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xdd358
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x30(%rcx), %rcx
movl (%rax,%rcx,8), %eax
movl %eax, -0x194(%rbp)
movq -0x30(%rbp), %rax
movslq -0x194(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0xdd31d
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x194(%rbp), %rdx
imulq $0x160, %rdx, %rdx      # imm = 0x160
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rax
movslq -0x194(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xdd347
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movslq -0x194(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rax
movslq -0x194(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xdd2b2
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movl $0x0, -0x194(%rbp)
movl -0x194(%rbp), %eax
cmpl -0x198(%rbp), %eax
jge 0xdd3db
movq -0x30(%rbp), %rax
movslq -0x194(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0xdd3a7
movq -0x30(%rbp), %rax
movslq -0x194(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $0x0, 0x10(%rax)
jmp 0xdd3c8
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x194(%rbp), %rcx
imulq $0x160, %rcx, %rcx      # imm = 0x160
addq %rcx, %rax
movq $0x0, 0x20(%rax)
jmp 0xdd3ca
movl -0x194(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x194(%rbp)
jmp 0xdd36e
movq -0x30(%rbp), %rdi
callq 0x52e80
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
nopw (%rax,%rax)