// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/decisiontree.c
// Function: next_node
Decisionnodeptr next_node(Decisionnodeptr currentnode, Instanceptr tmp)
{
 /*!Last Changed 28.05.2005 added SVM*/
 /*!Last Changed 26.09.2004*/
 double value, threshold;
 if (currentnode->featureno >= 0)
   if (currentnode->conditiontype != HYBRID_CONDITION)
    {
     switch (current_dataset->features[currentnode->featureno].type)
      {
       case INTEGER:if (tmp->values[currentnode->featureno].intvalue<=currentnode->split)
                      return currentnode->left;
                    else
                      return currentnode->right;
                    break;
       case    REAL:if (tmp->values[currentnode->featureno].floatvalue<=currentnode->split)
                      return currentnode->left;
                    else
                      return currentnode->right;
                    break;
       case  STRING:return &(currentnode->string[tmp->values[currentnode->featureno].stringindex]);
                    break;
      }
    }
   else
    {
     value = real_feature(tmp, currentnode->featureno);
     if (value <= currentnode->split)
       return currentnode -> left;
     else
       return currentnode -> right;
    }
 else
  {
   if (in_list(currentnode->featureno, 2, LINEAR, QUADRATIC))
    {
     value = multiply_with_matrix(tmp, currentnode->w);
     threshold = currentnode->w0;
    }
   else
     if (currentnode->featureno == SVMLIN)
      {
       value = svm_split_value(tmp, currentnode->svmsplit);
       threshold = 0;
      }
     else
       if (currentnode->featureno == DISCRETEMIX)
        {
         if (is_smaller_discrete_order(tmp, currentnode->ksplit))
           return currentnode->left;
         else
           return currentnode->right;
        }
       else
         return NULL;
   if (value <= threshold)
     return currentnode -> left;
   else
     return currentnode -> right;
  }
 return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x30(%rdi), %rsi
testq %rsi, %rsi
js 0x1d438
cmpl $0x2, 0x98(%rbx)
jne 0x1d47c
movq %r14, %rdi
callq 0x2ed6a
movsd 0x28(%rbx), %xmm1
jmp 0x1d469
movl %esi, %edi
movl $0x2, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x1d4ac
movq 0x38(%rbx), %rsi
movq 0x40(%rbx), %rdx
movq %r14, %rdi
callq 0x2efa4
movsd 0x48(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jae 0x1d504
movq 0x8(%rbx), %rax
jmp 0x1d507
leaq 0xb83ed(%rip), %rax     # 0xd5870
movq (%rax), %rax
imulq $0x340, %rsi, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
cmpl $0x2, %eax
je 0x1d4f1
cmpl $0x1, %eax
je 0x1d4dd
testl %eax, %eax
jne 0x1d4d9
movq (%r14), %rax
cvtsi2sdl (%rax,%rsi,8), %xmm0
jmp 0x1d431
movl 0x30(%rbx), %eax
cmpl $-0x5, %eax
je 0x1d512
cmpl $-0x4, %eax
jne 0x1d4d9
leaq 0xa8(%rbx), %rsi
movl $0x11, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
callq 0x1d53e
xorpd %xmm1, %xmm1
jmp 0x1d469
xorl %eax, %eax
jmp 0x1d507
movq (%r14), %rax
movslq (%rax,%rsi,8), %rax
imulq $0x160, %rax, %rax      # imm = 0x160
addq 0x10(%rbx), %rax
jmp 0x1d507
movq (%r14), %rax
movsd 0x28(%rbx), %xmm0
ucomisd (%rax,%rsi,8), %xmm0
jb 0x1d473
movq (%rbx), %rax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
movupd 0x140(%rbx), %xmm0
movupd 0x150(%rbx), %xmm1
movupd %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movq %r14, %rdi
callq 0x1d3ab
testl %eax, %eax
jne 0x1d504
jmp 0x1d473