// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/multivariatetree.c
// Function: make_multivariate_children
int make_multivariate_children(Decisionnodeptr node)
{
 /*!Last Changed 04.10.2004 added rules*/
 /*!Last Changed 26.09.2004 added parent*/
 /*!Last Changed 21.09.2004*/
 Instanceptr inst, leftbefore=NULL, rightbefore=NULL;
 Decisionnodeptr left, right;
 double value, threshold;
 Decisioncondition ruleleft, ruleright;
 if (node->featureno == LEAF_NODE || node->instances == NULL)
  {
   if (in_list(node->featureno, 2, LINEAR, QUADRATIC))
     matrix_free(node->w);
   make_leaf_node(node);
   return 0;
  }
 left = createnewnode(node, 1);
 right = createnewnode(node, 1);
 node->string = NULL;
 node->left = left;
 node->right = right;
 inst = node->instances;
 if (node->conditiontype != HYBRID_CONDITION)
   node->featureno = LINEAR;
 if (in_list(node->featureno, 2, LINEAR, QUADRATIC))
  {
   ruleleft = createmultivariatecondition(node->w, node->w0, '<', node->featureno);
   ruleright = createmultivariatecondition(node->w, node->w0, '>', node->featureno);
  }
 else
  {
   ruleleft = createcondition(node->featureno, '<', node->split);
   ruleright = createcondition(node->featureno, '>', node->split);
  }
 addcondition(node->left, ruleleft);
 addcondition(node->right, ruleright);
 while (inst)
  {
   if (in_list(node->featureno, 2, LINEAR, QUADRATIC))
    {
     value = multiply_with_matrix(inst, node->w);
     threshold = node->w0;
    }
   else
    {
     value = real_feature(inst, node->featureno);
     threshold = node->split;
    }
   if (value <= threshold)
    {
     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
movq %rsp, %rbp
subq $0x360, %rsp            # imm = 0x360
movq %rdi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
je 0x6f5a4
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x6f5ec
movq -0x10(%rbp), %rax
movl 0x30(%rax), %edi
movl $0x2, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x6f5d7
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq 0x40(%rax), %rsi
callq 0x59ea0
movq -0x10(%rbp), %rdi
callq 0x28a30
movl $0x0, -0x4(%rbp)
jmp 0x6f953
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x29480
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x29480
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, 0x98(%rax)
je 0x6f657
movq -0x10(%rbp), %rax
movl $0xfffffffe, 0x30(%rax) # imm = 0xFFFFFFFE
movq -0x10(%rbp), %rax
movl 0x30(%rax), %edi
movl $0x2, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x6f70b
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movsd 0x48(%rcx), %xmm0
movq -0x10(%rbp), %rcx
movl 0x30(%rcx), %r8d
movq 0x38(%rax), %rsi
movq 0x40(%rax), %rdx
leaq -0x198(%rbp), %rdi
movl $0x3c, %ecx
callq 0x6e040
leaq -0xb8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
movl $0x70, %edx
callq 0x42b0
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movsd 0x48(%rcx), %xmm0
movq -0x10(%rbp), %rcx
movl 0x30(%rcx), %r8d
movq 0x38(%rax), %rsi
movq 0x40(%rax), %rdx
leaq -0x208(%rbp), %rdi
movl $0x3e, %ecx
callq 0x6e040
leaq -0x128(%rbp), %rdi
leaq -0x208(%rbp), %rsi
movl $0x70, %edx
callq 0x42b0
jmp 0x6f77d
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
leaq -0x278(%rbp), %rdi
movl $0x3c, %edx
callq 0xdba90
leaq -0xb8(%rbp), %rdi
leaq -0x278(%rbp), %rsi
movl $0x70, %edx
callq 0x42b0
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
leaq -0x2e8(%rbp), %rdi
movl $0x3e, %edx
callq 0xdba90
leaq -0x128(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
movl $0x70, %edx
callq 0x42b0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movups -0x58(%rbp), %xmm0
movq %rsp, %rax
movups %xmm0, 0x60(%rax)
movups -0x68(%rbp), %xmm0
movups %xmm0, 0x50(%rax)
movups -0x78(%rbp), %xmm0
movups %xmm0, 0x40(%rax)
movups -0xb8(%rbp), %xmm0
movups -0xa8(%rbp), %xmm1
movups -0x98(%rbp), %xmm2
movups -0x88(%rbp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x293f0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movups -0xc8(%rbp), %xmm0
movq %rsp, %rax
movups %xmm0, 0x60(%rax)
movups -0xd8(%rbp), %xmm0
movups %xmm0, 0x50(%rax)
movups -0xe8(%rbp), %xmm0
movups %xmm0, 0x40(%rax)
movups -0x128(%rbp), %xmm0
movups -0x118(%rbp), %xmm1
movups -0x108(%rbp), %xmm2
movups -0xf8(%rbp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x293f0
cmpq $0x0, -0x18(%rbp)
je 0x6f91a
movq -0x10(%rbp), %rax
movl 0x30(%rax), %edi
movl $0x2, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0x6f882
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
movq 0x40(%rax), %rdx
callq 0x42fb0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
jmp 0x6f8a5
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
callq 0x42c40
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x40(%rbp), %xmm1
movsd -0x48(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x6f8e0
cmpq $0x0, -0x20(%rbp)
je 0x6f8ca
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x6f8d6
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x6f909
cmpq $0x0, -0x28(%rbp)
je 0x6f8f5
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x6f901
movq -0x18(%rbp), %rcx
movq -0x38(%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 0x6f82b
cmpq $0x0, -0x20(%rbp)
je 0x6f92d
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
cmpq $0x0, -0x28(%rbp)
je 0x6f940
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x360, %rsp            # imm = 0x360
popq %rbp
retq
nop