// File: /workspace/github_c_makefile_star2_O2/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), %rax
testq %rax, %rax
js 0x1afbd
cmpl $0x2, 0x98(%rbx)
jne 0x1affb
movq %r14, %rdi
movl %eax, %esi
callq 0x2aea2
movsd 0x28(%rbx), %xmm1
jmp 0x1afe8
pushq $0x2
popq %rsi
pushq $-0x2
popq %rdx
pushq $-0x3
popq %rcx
movl %eax, %edi
xorl %eax, %eax
callq 0x35812
testl %eax, %eax
je 0x1b02b
movq 0x38(%rbx), %rsi
movq 0x40(%rbx), %rdx
movq %r14, %rdi
callq 0x2b0c0
movsd 0x48(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jae 0x1b081
movq 0x8(%rbx), %rax
jmp 0x1b084
leaq 0xb286e(%rip), %rcx     # 0xcd870
movq (%rcx), %rcx
imulq $0x340, %rax, %rdx      # imm = 0x340
movl 0x30f08(%rcx,%rdx), %ecx
cmpl $0x2, %ecx
je 0x1b06e
cmpl $0x1, %ecx
je 0x1b05a
testl %ecx, %ecx
jne 0x1b056
movq (%r14), %rcx
cvtsi2sdl (%rcx,%rax,8), %xmm0
jmp 0x1afb6
movl 0x30(%rbx), %eax
cmpl $-0x5, %eax
je 0x1b08f
cmpl $-0x4, %eax
jne 0x1b056
leaq 0xa8(%rbx), %rsi
pushq $0x11
popq %rcx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
callq 0x1b0bb
xorpd %xmm1, %xmm1
jmp 0x1afe8
xorl %eax, %eax
jmp 0x1b084
movq (%r14), %rcx
movslq (%rcx,%rax,8), %rax
imulq $0x160, %rax, %rax      # imm = 0x160
addq 0x10(%rbx), %rax
jmp 0x1b084
movq (%r14), %rcx
movsd 0x28(%rbx), %xmm0
ucomisd (%rcx,%rax,8), %xmm0
jb 0x1aff2
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 0x1af28
testl %eax, %eax
jne 0x1b081
jmp 0x1aff2