// File: /workspace/github_c_makefile_star2_O1/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 0x1ccbe
cmpl $0x2, 0x98(%rbx)
jne 0x1cd02
movq %r14, %rdi
callq 0x2e4b6
movsd 0x28(%rbx), %xmm1
jmp 0x1ccef
movl %esi, %edi
movl $0x2, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
xorl %eax, %eax
callq 0x39a80
testl %eax, %eax
je 0x1cd32
movq 0x38(%rbx), %rsi
movq 0x40(%rbx), %rdx
movq %r14, %rdi
callq 0x2e700
movsd 0x48(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jae 0x1cd8a
movq 0x8(%rbx), %rax
jmp 0x1cd8d
leaq 0xb5b67(%rip), %rax     # 0xd2870
movq (%rax), %rax
imulq $0x340, %rsi, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
cmpl $0x2, %eax
je 0x1cd77
cmpl $0x1, %eax
je 0x1cd63
testl %eax, %eax
jne 0x1cd5f
movq (%r14), %rax
cvtsi2sdl (%rax,%rsi,8), %xmm0
jmp 0x1ccb7
movl 0x30(%rbx), %eax
cmpl $-0x5, %eax
je 0x1cd98
cmpl $-0x4, %eax
jne 0x1cd5f
leaq 0xa8(%rbx), %rsi
movl $0x11, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
callq 0x1cdc4
xorpd %xmm1, %xmm1
jmp 0x1ccef
xorl %eax, %eax
jmp 0x1cd8d
movq (%r14), %rax
movslq (%rax,%rsi,8), %rax
imulq $0x160, %rax, %rax      # imm = 0x160
addq 0x10(%rbx), %rax
jmp 0x1cd8d
movq (%r14), %rax
movsd 0x28(%rbx), %xmm0
ucomisd (%rax,%rsi,8), %xmm0
jb 0x1ccf9
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 0x1cc31
testl %eax, %eax
jne 0x1cd8a
jmp 0x1ccf9