// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/eps.c
// Function: plot_regression_node_model
void plot_regression_node_model(FILE* outfile, Regressionnodeptr rootnode, Point p, int radius, double outputmean, double outputvariance)
{
 double output, prevoutput, input, posy1, posy2; 
 double minoutput = -1.5, maxoutput = 1.5;
 int i, width = (2 * WIDTHFACTOR - 0.5) * radius, height = width, left = p.x - width / 2, right = p.x + width / 2, top = p.y - 2 * radius, bottom = p.y - 2 * radius - height, bottom2 = p.y - 2 * radius - height / 2;
 write_rectangle(outfile, left, top, right, bottom, FILL_NONE, BLACK);
 for (i = 1; i < 4; i++)
  {
   write_line(outfile, left + i * ((right - left) / 4.0), bottom, left + i * ((right - left) / 4.0), bottom + 2);   
   write_line(outfile, left + i * ((right - left) / 4.0), top, left + i * ((right - left) / 4.0), top - 2);   
  }
 for (i = 1; i < 6; i++)
  {
   write_line(outfile, left, bottom + i * ((top - bottom) / 6.0), left + 2, bottom + i * ((top - bottom) / 6.0));   
   write_line(outfile, right - 2, bottom + i * ((top - bottom) / 6.0), right, bottom + i * ((top - bottom) / 6.0));   
  }
 setcolor(outfile, RED);
 for (i = 0; i <= width; i++)
  {
   prevoutput = output;
   input = ((-2 + i * (4.0 / width)) - mean.values[0].floatvalue) / sqrt(variance.values[0].floatvalue);
   output = soft_output_of_subregressiontree(rootnode, input) * sqrt(outputvariance) + outputmean;
   if (i != 0 && output <= maxoutput && output >= minoutput)
    {
     posy1 = return_pos(prevoutput, bottom, top, minoutput, maxoutput);
     posy2 = return_pos(output, bottom, top, minoutput, maxoutput);
     write_line(outfile, left + i - 1, posy1, left + i, posy2);      
    }
  }
 setcolor(outfile, BLACK);
 write_rectangle(outfile, left + width, top, right + width / 2, bottom2, FILL_NONE, BLACK);
 for (i = 0; i <= width / 2; i++)
  {
   prevoutput = output;
   input = ((-2 + i * (8.0 / width)) - mean.values[0].floatvalue) / sqrt(variance.values[0].floatvalue);
   output = sigmoid(rootnode->w.values[0][0] + rootnode->w.values[1][0] * input);
   if (i != 0)
    {
     posy1 = return_pos(prevoutput, bottom2, top, 0.0, 1.0);
     posy2 = return_pos(output, bottom2, top, 0.0, 1.0);
     write_line(outfile, left + width + i - 1, posy1, left + width + i, posy2);      
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movsd %xmm3, 0x50(%rsp)
movsd %xmm2, 0x98(%rsp)
movl %edx, %ecx
cvtsi2sd %edx, %xmm3
mulsd 0x76389(%rip), %xmm3    # 0x97d58
cvttsd2si %xmm3, %eax
pushq $0x2
popq %r8
movl %eax, 0x64(%rsp)
cltd
idivl %r8d
movl %eax, 0x74(%rsp)
cvtsi2sd %eax, %xmm4
movq %rsi, 0x78(%rsp)
movapd %xmm4, %xmm2
addsd %xmm0, %xmm2
subsd %xmm4, %xmm0
movapd %xmm0, 0x10(%rsp)
cvttsd2si %xmm0, %r13d
cvttsd2si %xmm2, %r14d
addl %ecx, %ecx
cvtsi2sd %ecx, %xmm2
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %ebx
cvttpd2dq %xmm3, %xmm2
cvtdq2pd %xmm2, %xmm3
movapd %xmm1, %xmm2
movapd %xmm3, 0xa0(%rsp)
subsd %xmm3, %xmm2
cvttsd2si %xmm2, %r15d
subsd %xmm4, %xmm1
movsd %xmm1, 0x80(%rsp)
leaq 0x765d6(%rip), %rsi     # 0x9801e
movq %rdi, 0x28(%rsp)
movl %r13d, %edx
movl %ebx, %ecx
movl %r14d, %r8d
movl %r15d, %r9d
xorl %eax, %eax
callq 0x42e0
cvttpd2dq 0x10(%rsp), %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq %r14, 0x68(%rsp)
movl %r14d, %eax
movq %r13, %rbp
subl %r13d, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x74288(%rip), %xmm0    # 0x95d10
movsd %xmm0, 0x8(%rsp)
movq %r15, 0x48(%rsp)
leal 0x2(%r15), %r14d
movq %rbx, 0x58(%rsp)
addl $-0x2, %ebx
movsd 0x73a79(%rip), %xmm0    # 0x95520
pushq $0x3
popq %r13
movq 0x28(%rsp), %r12
subl $0x1, %r13d
jb 0x21b0f
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
cvttsd2si %xmm0, %r15d
movq %r12, %rdi
movl %r15d, %esi
movq 0x48(%rsp), %rdx
movl %r15d, %ecx
movl %r14d, %r8d
callq 0x20866
movq %r12, %rdi
movl %r15d, %esi
movq 0x58(%rsp), %rdx
movl %r15d, %ecx
movl %ebx, %r8d
callq 0x20866
movsd 0x10(%rsp), %xmm0
addsd 0x73a13(%rip), %xmm0    # 0x95520
jmp 0x21ab0
movq 0x48(%rsp), %rcx
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x58(%rsp), %rax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
divsd 0x76167(%rip), %xmm0    # 0x97c98
movsd %xmm0, 0x8(%rsp)
leal 0x2(%rbp), %r14d
movq 0x68(%rsp), %rax
leal -0x2(%rax), %ebx
movsd 0x739d5(%rip), %xmm0    # 0x95520
pushq $0x5
popq %r13
movq 0x28(%rsp), %r12
subl $0x1, %r13d
jb 0x21baf
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
cvttsd2si %xmm0, %r15d
movq %r12, %rdi
movl %ebp, %esi
movl %r15d, %edx
movl %r14d, %ecx
movl %r15d, %r8d
callq 0x20866
movq %r12, %rdi
movl %ebx, %esi
movl %r15d, %edx
movq 0x68(%rsp), %rcx
movl %r15d, %r8d
callq 0x20866
movsd 0x10(%rsp), %xmm0
addsd 0x73973(%rip), %xmm0    # 0x95520
jmp 0x21b54
pushq $0x1
popq %rsi
movq 0x28(%rsp), %rdi
callq 0x2004b
movsd 0x7422c(%rip), %xmm0    # 0x95df0
divsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
xorl %r15d, %r15d
leaq 0x3883c8(%rip), %r13    # 0x3a9fa8
sqrtsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movl %ebp, %r14d
xorpd %xmm1, %xmm1
movl 0x64(%rsp), %ebx
cmpl %ebx, %r15d
jg 0x21d74
movapd %xmm1, %xmm2
mulsd 0x90(%rsp), %xmm2
addsd 0x75e58(%rip), %xmm2    # 0x97a70
movq (%r13), %rax
subsd (%rax), %xmm2
leaq 0x3883b1(%rip), %rax    # 0x3a9fd8
movq (%rax), %rax
movsd (%rax), %xmm0
ucomisd 0x740e2(%rip), %xmm0    # 0x95d18
movsd %xmm1, 0x8(%rsp)
jb 0x21c44
sqrtsd %xmm0, %xmm0
jmp 0x21c55
movsd %xmm2, 0x30(%rsp)
callq 0x4300
movsd 0x30(%rsp), %xmm2
divsd %xmm0, %xmm2
movq 0x78(%rsp), %rdi
movapd %xmm2, %xmm0
callq 0x7db6d
movapd %xmm0, %xmm2
movsd 0x50(%rsp), %xmm0
ucomisd 0x7409f(%rip), %xmm0    # 0x95d18
movsd 0x88(%rsp), %xmm0
jae 0x21c9b
movsd 0x50(%rsp), %xmm0
movapd %xmm2, 0x30(%rsp)
callq 0x4300
movapd 0x30(%rsp), %xmm2
mulsd %xmm0, %xmm2
addsd 0x98(%rsp), %xmm2
testl %r15d, %r15d
je 0x21d55
movapd %xmm2, %xmm0
andpd 0x74523(%rip), %xmm0    # 0x961e0
movsd 0x74123(%rip), %xmm1    # 0x95de8
ucomisd %xmm0, %xmm1
jb 0x21d55
movsd 0x10(%rsp), %xmm0
movq %rbp, %r12
movq 0x48(%rsp), %rbp
movl %ebp, %edi
movq 0x58(%rsp), %r13
movl %r13d, %esi
movsd 0x76071(%rip), %xmm1    # 0x97d60
movapd %xmm2, 0x30(%rsp)
movsd 0x740eb(%rip), %xmm2    # 0x95de8
callq 0x2a83b
movl %eax, 0x10(%rsp)
movapd 0x30(%rsp), %xmm0
movl %ebp, %edi
movq %r12, %rbp
movq 0x28(%rsp), %r12
movl %r13d, %esi
leaq 0x388288(%rip), %r13    # 0x3a9fa8
movsd 0x76038(%rip), %xmm1    # 0x97d60
movsd 0x740b8(%rip), %xmm2    # 0x95de8
callq 0x2a83b
leal -0x1(%r14), %esi
movq %r12, %rdi
movl 0x10(%rsp), %edx
movl 0x64(%rsp), %ebx
movl %r14d, %ecx
movl %eax, %r8d
callq 0x20866
movapd 0x30(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
addsd 0x737bd(%rip), %xmm1    # 0x95520
incl %r15d
incl %r14d
movsd %xmm2, 0x10(%rsp)
jmp 0x21bfa
cvttsd2si 0x80(%rsp), %r15d
xorl %r14d, %r14d
movq 0x28(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x2004b
addl %ebx, %ebp
movl 0x74(%rsp), %ebx
movq 0x68(%rsp), %r8
addl %ebx, %r8d
leaq 0x76279(%rip), %rsi     # 0x9801e
movq %r12, %rdi
movq %rbp, %r12
movl %ebp, %edx
movq 0x58(%rsp), %rcx
movl %r15d, 0x48(%rsp)
movl %r15d, %r9d
xorl %eax, %eax
callq 0x42e0
movsd 0x75f9f(%rip), %xmm0    # 0x97d68
testl %ebx, %ebx
pushq $-0x1
popq %rbp
cmovnsl %ebx, %ebp
divsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
notl %ebp
xorpd %xmm1, %xmm1
movl 0x48(%rsp), %r15d
cmpl %r14d, %ebp
je 0x21ef1
movsd %xmm1, 0x30(%rsp)
mulsd 0x50(%rsp), %xmm1
addsd 0x75c68(%rip), %xmm1    # 0x97a70
movq (%r13), %rax
subsd (%rax), %xmm1
leaq 0x3881c1(%rip), %rax    # 0x3a9fd8
movq (%rax), %rax
movsd (%rax), %xmm0
ucomisd 0x73ef2(%rip), %xmm0    # 0x95d18
jb 0x21e2e
sqrtsd %xmm0, %xmm0
jmp 0x21e3f
movsd %xmm1, 0x8(%rsp)
callq 0x4300
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x78(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
mulsd (%rax), %xmm1
addsd (%rcx), %xmm1
movapd %xmm1, %xmm0
callq 0x4dd58
subl $0x1, %r14d
jb 0x21ed5
movsd %xmm0, 0x8(%rsp)
xorpd %xmm1, %xmm1
movsd 0x10(%rsp), %xmm0
movl %r15d, %edi
movq 0x58(%rsp), %r13
movl %r13d, %esi
movsd 0x73693(%rip), %xmm2    # 0x95520
callq 0x2a83b
movl %eax, %ebx
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
movl %r15d, %edi
movl %r13d, %esi
leaq 0x3880fd(%rip), %r13    # 0x3a9fa8
movsd 0x7366d(%rip), %xmm2    # 0x95520
callq 0x2a83b
movq %r12, %rcx
leal -0x1(%r12), %esi
movq 0x28(%rsp), %rdi
movl %ebx, %edx
movl %eax, %r8d
callq 0x20866
movsd 0x8(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
addsd 0x7363d(%rip), %xmm1    # 0x95520
incl %r12d
movsd %xmm0, 0x10(%rsp)
jmp 0x21deb
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq