// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/ktree.c
// Function: make_children_discrete
int make_children_discrete(Decisionnodeptr node)
{
 Instanceptr inst, leftbefore = NULL, rightbefore = NULL;
 Decisionnodeptr left, right;
 Decisioncondition ruleleft, ruleright;
 if (node->featureno == LEAF_NODE || node->instances == NULL)
  {
   make_leaf_node(node);
   return 0;
  }
 left = createnewnode(node, 1);
 right = createnewnode(node, 1);
 node->string = NULL;
 node->left = left;
 node->right = right;
 ruleleft = create_kordering_condition(node->ksplit, '<');
 ruleleft.conditiontype = UNIVARIATE_CONDITION;
 addcondition(node->left, ruleleft);
 ruleright = create_kordering_condition(node->ksplit, '>');
 ruleright.conditiontype = UNIVARIATE_CONDITION;
 addcondition(node->right, ruleright);
 inst = node->instances;
 while (inst)
  {
   if (is_smaller_discrete_order(inst, node->ksplit))
    {
     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;
 return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, %r12
cmpl $-0x1, 0x30(%rdi)
je 0x2f098
cmpq $0x0, 0x20(%r12)
je 0x2f098
leaq 0x20(%r12), %rax
movq %rax, 0x78(%rsp)
pushq $0x1
popq %rbx
movq %r12, %rdi
movl %ebx, %esi
callq 0x1ac98
movq %rax, %r14
movq %r12, %rdi
movl %ebx, %esi
callq 0x1ac98
andq $0x0, 0x10(%r12)
movq %rax, %r15
movq %r14, (%r12)
movq %rax, 0x8(%r12)
leaq 0x140(%r12), %rbx
movups 0x140(%r12), %xmm0
movups 0x150(%r12), %xmm1
leaq 0x160(%rsp), %rbp
movaps %xmm1, 0x10(%rbp)
movaps %xmm0, (%rbp)
pushq $-0x5
popq %rax
leaq 0xd0(%rsp), %r13
movl %eax, -0x50(%r13)
movaps (%rbp), %xmm0
movaps 0x10(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r13, %rdi
callq 0x2e56c
movb $0x3c, -0x4c(%r13)
pushq $0xe
popq %rdx
leaq 0x80(%rsp), %r13
movq %rdx, %rcx
movq %rbp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
andl $0x0, 0x40(%rbp)
movq (%r12), %rax
movq %rdx, %rcx
movq %rsp, %rdi
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
callq 0x1ac58
movups 0x140(%r12), %xmm0
movups 0x150(%r12), %xmm1
movaps %xmm1, 0x10(%r13)
movaps %xmm0, (%r13)
leaq 0x140(%rsp), %rbp
pushq $-0x5
popq %rax
movl %eax, -0x50(%rbp)
movaps (%r13), %xmm0
movaps 0x10(%r13), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbp, %rdi
callq 0x2e56c
movb $0x3e, -0x4c(%rbp)
leaq 0x80(%rsp), %rax
leaq 0xf0(%rsp), %rsi
pushq $0xe
popq %r8
movq %r8, %rcx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
andl $0x0, 0x40(%rax)
movq 0x8(%r12), %rdx
movq %r8, %rcx
movq %rsp, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rdx, %rdi
callq 0x1ac58
xorl %ebp, %ebp
xorl %r13d, %r13d
movq 0x78(%rsp), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x2f0a4
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x1af28
testl %eax, %eax
je 0x2f077
movq %rbp, %rax
movq %r14, %rcx
movq %r12, %rbp
jmp 0x2f080
movq %r13, %rax
movq %r15, %rcx
movq %r12, %r13
addq $0x20, %rcx
leaq 0x10(%rax), %rdx
testq %rax, %rax
cmoveq %rcx, %rdx
movq %r12, (%rdx)
addq $0x10, %r12
jmp 0x2f047
movq %r12, %rdi
callq 0x1a6ac
xorl %eax, %eax
jmp 0x2f0c4
testq %rbp, %rbp
je 0x2f0ae
andq $0x0, 0x10(%rbp)
testq %r13, %r13
pushq $0x1
popq %rax
je 0x2f0bb
andq $0x0, 0x10(%r13)
movq 0x78(%rsp), %rcx
andq $0x0, (%rcx)
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq