// File: /workspace/github_c_makefile_star2_O1/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 $0x1e8, %rsp            # imm = 0x1E8
movq %rdi, %rbp
cmpl $-0x1, 0x30(%rdi)
je 0x329d9
cmpq $0x0, 0x20(%rbp)
je 0x329d9
movq %rbp, %rdi
movl $0x1, %esi
callq 0x1c996
movq %rax, %rbx
movq %rbp, %rdi
movl $0x1, %esi
callq 0x1c996
movq $0x0, 0x10(%rbp)
movq %rbx, %r15
movq %rbx, (%rbp)
movq %rax, 0x78(%rsp)
movq %rax, 0x8(%rbp)
movups 0x140(%rbp), %xmm0
movups 0x150(%rbp), %xmm1
leaq 0x170(%rsp), %r12
movaps %xmm1, 0x10(%r12)
movaps %xmm0, (%r12)
movl $0xfffffffb, %ebx       # imm = 0xFFFFFFFB
leaq 0xe0(%rsp), %r13
movl %ebx, -0x50(%r13)
movaps (%r12), %xmm0
movaps 0x10(%r12), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r13, %rdi
callq 0x31e4c
movb $0x3c, -0x4c(%r13)
leaq 0x90(%rsp), %r13
movl $0xe, %ecx
movq %r12, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
xorl %r14d, %r14d
movl %r14d, 0x40(%r12)
movq (%rbp), %rax
movl $0xe, %ecx
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
callq 0x1c954
movups 0x140(%rbp), %xmm0
movups 0x150(%rbp), %xmm1
movaps %xmm1, 0x10(%r13)
movaps %xmm0, (%r13)
leaq 0x150(%rsp), %r12
movl %ebx, -0x50(%r12)
movaps (%r13), %xmm0
movaps 0x10(%r13), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x31e4c
movb $0x3e, -0x4c(%r12)
leaq 0x90(%rsp), %rax
leaq 0x100(%rsp), %rsi
movl $0xe, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl %r14d, 0x40(%rax)
movq 0x8(%rbp), %rdx
movl $0xe, %ecx
movq %rsp, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rdx, %rdi
callq 0x1c954
movq 0x20(%rbp), %r12
testq %r12, %r12
movq %rbp, 0x80(%rsp)
je 0x329e5
leaq 0x140(%rbp), %rbx
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %r15, 0x88(%rsp)
movq 0x78(%rsp), %r15
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0x1cc31
testl %eax, %eax
movq 0x88(%rsp), %rax
cmoveq %r15, %rax
movq %r12, %r14
cmoveq %rbp, %r14
cmoveq %r13, %rbp
cmoveq %r12, %r13
addq $0x20, %rax
leaq 0x10(%rbp), %rcx
testq %rbp, %rbp
cmoveq %rax, %rcx
movq %r12, (%rcx)
movq 0x10(%r12), %r12
movq %r14, %rbp
testq %r12, %r12
jne 0x32983
jmp 0x329e8
movq %rbp, %rdi
callq 0x1c39c
xorl %eax, %eax
jmp 0x32a17
xorl %r13d, %r13d
testq %r14, %r14
je 0x329f5
movq $0x0, 0x10(%r14)
testq %r13, %r13
movq 0x80(%rsp), %rax
je 0x32a0a
movq $0x0, 0x10(%r13)
movq $0x0, 0x20(%rax)
movl $0x1, %eax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq