// File: /workspace/github_c_makefile_star2_O3/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, %rbx
cmpl $-0x1, 0x30(%rdi)
je 0x333ef
cmpq $0x0, 0x20(%rbx)
je 0x333ef
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1d107
movq %rax, %r14
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1d107
movq %rax, %r15
movq $0x0, 0x10(%rbx)
movq %r14, (%rbx)
movq %rax, 0x8(%rbx)
movups 0x140(%rbx), %xmm0
movups 0x150(%rbx), %xmm1
leaq 0x160(%rsp), %r12
movaps %xmm1, 0x10(%r12)
movaps %xmm0, (%r12)
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
leaq 0xd0(%rsp), %r13
movl %eax, -0x50(%r13)
movaps (%r12), %xmm0
movaps 0x10(%r12), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r13, %rdi
callq 0x32780
movb $0x3c, -0x4c(%r13)
leaq 0x80(%rsp), %r13
movl $0xe, %ecx
movq %r12, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
xorl %ebp, %ebp
movl %ebp, 0x40(%r12)
movq (%rbx), %rax
movl $0xe, %ecx
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
callq 0x1d0c5
movups 0x140(%rbx), %xmm0
movups 0x150(%rbx), %xmm1
movaps %xmm1, 0x10(%r13)
movaps %xmm0, (%r13)
leaq 0x140(%rsp), %r12
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
movl %eax, -0x50(%r12)
movaps (%r13), %xmm0
movaps 0x10(%r13), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x32780
movb $0x3e, -0x4c(%r12)
leaq 0x80(%rsp), %rax
leaq 0xf0(%rsp), %rsi
movl $0xe, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl %ebp, 0x40(%rax)
movq 0x8(%rbx), %rdx
movl $0xe, %ecx
movq %rsp, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rdx, %rdi
callq 0x1d0c5
movq 0x20(%rbx), %r12
testq %r12, %r12
je 0x333e0
movq %rbx, 0x78(%rsp)
leaq 0x140(%rbx), %rbp
xorl %r13d, %r13d
xorl %eax, %eax
movq %rax, %rbx
movups (%rbp), %xmm0
movups 0x10(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x1d3ab
testl %eax, %eax
movq %r14, %rcx
cmoveq %r15, %rcx
movq %r12, %rax
cmoveq %rbx, %rax
cmoveq %r13, %rbx
cmoveq %r12, %r13
addq $0x20, %rcx
leaq 0x10(%rbx), %rdx
testq %rbx, %rbx
cmoveq %rcx, %rdx
movq %r12, (%rdx)
movq 0x10(%r12), %r12
testq %r12, %r12
jne 0x33371
testq %rax, %rax
je 0x333ce
movq $0x0, 0x10(%rax)
testq %r13, %r13
movq 0x78(%rsp), %rbx
je 0x333e0
movq $0x0, 0x10(%r13)
movq $0x0, 0x20(%rbx)
movl $0x1, %eax
jmp 0x333f9
movq %rbx, %rdi
callq 0x1cab0
xorl %eax, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq