// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/decisiontree.c
// Function: soft_output_of_subdecisiontree
double soft_output_of_subdecisiontree(Decisionnodeptr subtree, double input1, double input2)
{
 double weight, output, multiplier;
 Decisionnodeptr tmpnode;
 if (subtree->featureno == LEAF_NODE)
  {
   if (subtree->leaftype == CONSTANTLEAF)
     output = subtree->w0;    
   else
     output = subtree->w.values[0][0] + subtree->w.values[1][0] * input1 + subtree->w.values[2][0] * input2; 
   multiplier = 1.0;
   tmpnode = subtree;
   while (tmpnode->parent)
    {
     weight = sigmoid(tmpnode->parent->w.values[0][0] + tmpnode->parent->w.values[1][0] * input1 + tmpnode->parent->w.values[2][0] * input2);
     if (tmpnode == tmpnode->parent->left)
       multiplier *= weight;
     else
       multiplier *= (1 - weight);
     tmpnode = tmpnode->parent;
    }
   return output * multiplier;   
  }
 else
   return soft_output_of_subdecisiontree(subtree->left, input1, input2) + soft_output_of_subdecisiontree(subtree->right, input1, input2);   
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x30(%rax)
jne 0x2b19a
movq -0x10(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x2b06e
movq -0x10(%rbp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x2b0bc
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movsd (%rax), %xmm1
movsd -0x18(%rbp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movsd (%rax), %xmm0
movsd -0x20(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0xb6f54(%rip), %xmm0    # 0xe2018
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x2b189
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movsd (%rax), %xmm1
movsd -0x18(%rbp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movsd (%rax), %xmm0
movsd -0x20(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x7aab0
movsd %xmm0, -0x28(%rbp)
movq -0x40(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq (%rcx), %rax
jne 0x2b161
movsd -0x28(%rbp), %xmm0
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0x2b178
movsd 0xb6eaf(%rip), %xmm0    # 0xe2018
subsd -0x28(%rbp), %xmm0
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x2b0d1
movsd -0x30(%rbp), %xmm0
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x2b1dd
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
callq 0x2b030
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
callq 0x2b030
movaps %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)