// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jl 0x29bed
movq -0x10(%rbp), %rax
cmpl $0x2, 0x98(%rax)
je 0x29b9e
leaq 0xdbd97(%rip), %rax     # 0x105840
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x30(%rcx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0x29ae6
jmp 0x29acb
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0x29b6e
jmp 0x29ad9
movl -0x2c(%rbp), %eax
subl $0x2, %eax
je 0x29b2a
jmp 0x29b9c
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x30(%rcx), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm1
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x29b19
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x30(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x29b5d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movq -0x10(%rbp), %rdx
movslq 0x30(%rdx), %rdx
movslq (%rcx,%rdx,8), %rcx
imulq $0x160, %rcx, %rcx      # imm = 0x160
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
jmp 0x29be8
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
callq 0x42c40
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm1
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x29bd7
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
jmp 0x29d12
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 0x29c3c
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
movq 0x40(%rax), %rdx
callq 0x42fb0
movsd %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x29ce7
movq -0x10(%rbp), %rax
cmpl $-0x4, 0x30(%rax)
jne 0x29c7c
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rsi
addq $0xa8, %rsi
movq %rsp, %rdi
movl $0x11, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq -0x38(%rbp), %rdi
callq 0x29d30
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x29ce5
movq -0x10(%rbp), %rax
cmpl $-0x5, 0x30(%rax)
jne 0x29cdb
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x140, %rax            # imm = 0x140
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x29990
cmpl $0x0, %eax
je 0x29ccd
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
movq $0x0, -0x8(%rbp)
jmp 0x29d1a
jmp 0x29ce7
movsd -0x20(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x29d04
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x29d1a
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)