// File: /workspace/github_c_makefile_star2_O1/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, 0x70(%rsp)
movsd %xmm2, 0x98(%rsp)
cvtsi2sd %edx, %xmm4
mulsd 0x80d39(%rip), %xmm4    # 0xa4d50
cvttsd2si %xmm4, %ecx
movl %ecx, %eax
shrl $0x1f, %eax
movl %ecx, 0x48(%rsp)
addl %ecx, %eax
sarl %eax
movl %eax, 0x2c(%rsp)
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
movq %rsi, 0x90(%rsp)
movapd %xmm3, %xmm2
addsd %xmm0, %xmm2
subsd %xmm3, %xmm0
movapd %xmm0, 0x10(%rsp)
cvttsd2si %xmm0, %ebx
cvttsd2si %xmm2, %r14d
addl %edx, %edx
xorps %xmm2, %xmm2
cvtsi2sd %edx, %xmm2
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %r13d
cvttpd2dq %xmm4, %xmm0
movq %rdi, %r12
cvtdq2pd %xmm0, %xmm2
movapd %xmm1, %xmm0
movapd %xmm2, 0xa0(%rsp)
subsd %xmm2, %xmm0
cvttsd2si %xmm0, %r15d
subsd %xmm3, %xmm1
movsd %xmm1, 0x30(%rsp)
leaq 0x80fac(%rip), %rsi     # 0xa5046
movl %ebx, %edx
movl %r13d, %ecx
movl %r14d, %r8d
movl %r15d, %r9d
xorl %eax, %eax
callq 0x42e0
movq %r15, %rcx
cvttpd2dq 0x10(%rsp), %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq %r14, 0x88(%rsp)
movl %r14d, %eax
movq %rbx, 0x60(%rsp)
subl %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x7ec19(%rip), %xmm0    # 0xa2cf8
movsd %xmm0, 0x8(%rsp)
leal 0x2(%r15), %eax
movl %eax, 0x38(%rsp)
leal -0x2(%r13), %r14d
movsd 0x7e427(%rip), %xmm0    # 0xa2520
movl $0x3, %ebx
leaq 0x80efd(%rip), %r15     # 0xa5002
movq %rcx, 0x40(%rsp)
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
cvttsd2si %xmm0, %ebp
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq 0x40(%rsp), %rcx
movl %ebp, %r8d
movl 0x38(%rsp), %r9d
xorl %eax, %eax
callq 0x42e0
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r13d, %ecx
movl %ebp, %r8d
movl %r14d, %r9d
xorl %eax, %eax
callq 0x42e0
movsd 0x10(%rsp), %xmm0
movq 0x40(%rsp), %rcx
addsd 0x7e3b3(%rip), %xmm0    # 0xa2520
decl %ebx
jne 0x2410a
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x50(%rsp)
movq %r13, 0x68(%rsp)
movl %r13d, %eax
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x80ad9(%rip), %xmm0    # 0xa4c70
movsd %xmm0, 0x8(%rsp)
movq 0x60(%rsp), %r13
leal 0x2(%r13), %eax
movl %eax, 0x38(%rsp)
movq 0x88(%rsp), %r14
leal -0x2(%r14), %eax
movl %eax, 0x78(%rsp)
movsd 0x7e35e(%rip), %xmm0    # 0xa2520
movl $0x5, %ebx
leaq 0x80e34(%rip), %r15     # 0xa5002
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
cvttsd2si %xmm0, %ebp
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl %ebp, %ecx
movl 0x38(%rsp), %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0x42e0
movq %r12, %rdi
movq %r15, %rsi
movl 0x78(%rsp), %edx
movl %ebp, %ecx
movl %r14d, %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0x42e0
movsd 0x10(%rsp), %xmm0
addsd 0x7e2f5(%rip), %xmm0    # 0xa2520
decl %ebx
jne 0x241ce
cvttsd2si 0x30(%rsp), %eax
movl %eax, 0x4c(%rsp)
movsd 0xad997(%rip), %xmm0    # 0xd1bd8
movsd 0xad997(%rip), %xmm1    # 0xd1be0
movsd 0xad997(%rip), %xmm2    # 0xd1be8
leaq 0x80c65(%rip), %rsi     # 0xa4ebd
movq %r12, 0x30(%rsp)
movq %r12, %rdi
movb $0x3, %al
callq 0x42e0
movl 0x48(%rsp), %r15d
testl %r15d, %r15d
js 0x24442
movsd 0x7eb6b(%rip), %xmm0    # 0xa2de8
divsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
notl %r15d
leaq 0x38ad12(%rip), %r13    # 0x3aefa8
leaq 0x38ad3b(%rip), %rbx    # 0x3aefd8
xorps %xmm0, %xmm0
sqrtsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0x60(%rsp), %rbp
movl %ebp, %r14d
xorl %r12d, %r12d
xorpd %xmm0, %xmm0
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x50(%rsp)
movapd %xmm0, %xmm1
mulsd 0x38(%rsp), %xmm1
addsd 0x8075f(%rip), %xmm1    # 0xa4a38
movq (%r13), %rax
subsd (%rax), %xmm1
movq (%rbx), %rax
movsd (%rax), %xmm0
ucomisd 0x7ea18(%rip), %xmm0    # 0xa2d08
jb 0x242f8
sqrtsd %xmm0, %xmm0
jmp 0x24309
movsd %xmm1, 0x10(%rsp)
callq 0x4300
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x90(%rsp), %rdi
movapd %xmm1, %xmm0
callq 0x88ab5
movapd %xmm0, %xmm1
movsd 0x70(%rsp), %xmm0
ucomisd 0x7e9d8(%rip), %xmm0    # 0xa2d08
movsd 0x78(%rsp), %xmm0
jae 0x2434f
movsd 0x70(%rsp), %xmm0
movapd %xmm1, 0x10(%rsp)
callq 0x4300
movapd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd 0x98(%rsp), %xmm1
subl $0x1, %r12d
jb 0x24426
movapd %xmm1, %xmm0
andpd 0x7ee6e(%rip), %xmm0    # 0xa31e0
movsd 0x7ea66(%rip), %xmm2    # 0xa2de0
ucomisd %xmm0, %xmm2
jb 0x24426
movsd 0x8(%rsp), %xmm0
movl %r12d, 0x8(%rsp)
movl %r15d, %r12d
movq %r13, %r15
movq 0x40(%rsp), %r13
movl %r13d, %edi
movq %rbx, %rbp
movq 0x68(%rsp), %rbx
movl %ebx, %esi
movapd %xmm1, 0x10(%rsp)
movsd 0x809a3(%rip), %xmm1    # 0xa4d58
movsd 0x7ea23(%rip), %xmm2    # 0xa2de0
callq 0x2de2d
movl %eax, 0x84(%rsp)
movapd 0x10(%rsp), %xmm0
movl %r13d, %edi
movq %r15, %r13
movl %r12d, %r15d
movl 0x8(%rsp), %r12d
movl %ebx, %esi
movq %rbp, %rbx
movsd 0x8096e(%rip), %xmm1    # 0xa4d58
movsd 0x7e9ee(%rip), %xmm2    # 0xa2de0
callq 0x2de2d
leal -0x1(%r14), %edx
movq 0x30(%rsp), %rdi
leaq 0x80bfb(%rip), %rsi     # 0xa5002
movl 0x84(%rsp), %ecx
movq 0x60(%rsp), %rbp
movl %r14d, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x42e0
movapd 0x10(%rsp), %xmm1
movsd 0x50(%rsp), %xmm0
addsd 0x7e0ec(%rip), %xmm0    # 0xa2520
incl %r14d
cmpl %r12d, %r15d
jne 0x242bb
jmp 0x24447
movq 0x60(%rsp), %rbp
movapd %xmm1, 0x10(%rsp)
movsd 0xad76b(%rip), %xmm0    # 0xd1bc0
movsd 0xad76b(%rip), %xmm1    # 0xd1bc8
movsd 0xad76b(%rip), %xmm2    # 0xd1bd0
leaq 0x80a51(%rip), %rsi     # 0xa4ebd
movq 0x30(%rsp), %r14
movq %r14, %rdi
movb $0x3, %al
callq 0x42e0
movl 0x48(%rsp), %r15d
addl %r15d, %ebp
movq 0x88(%rsp), %r8
movl 0x2c(%rsp), %ebx
addl %ebx, %r8d
leaq 0x80bad(%rip), %rsi     # 0xa5046
movq %r14, %rdi
movl %ebp, %edx
movq 0x68(%rsp), %rcx
movl 0x4c(%rsp), %r9d
xorl %eax, %eax
callq 0x42e0
movapd 0x10(%rsp), %xmm1
cmpl $-0x1, %r15d
jl 0x24607
movsd 0x80899(%rip), %xmm0    # 0xa4d60
divsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
notl %ebx
leaq 0x38aac9(%rip), %r13    # 0x3aefa8
leaq 0x38aaf2(%rip), %r12    # 0x3aefd8
xorl %r14d, %r14d
xorpd %xmm2, %xmm2
movl %ebx, 0x2c(%rsp)
movl 0x4c(%rsp), %r15d
movsd %xmm2, 0x40(%rsp)
mulsd 0x8(%rsp), %xmm2
addsd 0x8052e(%rip), %xmm2    # 0xa4a38
movq (%r13), %rax
subsd (%rax), %xmm2
movq (%r12), %rax
movsd (%rax), %xmm0
ucomisd 0x7e7e6(%rip), %xmm0    # 0xa2d08
movapd %xmm1, 0x10(%rsp)
jb 0x24530
sqrtsd %xmm0, %xmm0
jmp 0x24541
movsd %xmm2, 0x50(%rsp)
callq 0x4300
movsd 0x50(%rsp), %xmm2
divsd %xmm0, %xmm2
movq 0x90(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
mulsd (%rax), %xmm2
addsd (%rcx), %xmm2
movapd %xmm2, %xmm0
callq 0x54568
movapd %xmm0, %xmm1
subl $0x1, %r14d
jb 0x245ee
movsd %xmm1, 0x50(%rsp)
xorpd %xmm1, %xmm1
movaps 0x10(%rsp), %xmm0
movl %r15d, %edi
movq 0x68(%rsp), %rsi
movsd 0x7df8e(%rip), %xmm2    # 0xa2520
callq 0x2de2d
movq %r12, %rbx
movq %rbp, %r12
movl %eax, %ebp
xorpd %xmm1, %xmm1
movsd 0x50(%rsp), %xmm0
movl %r15d, %edi
movq 0x68(%rsp), %rsi
movsd 0x7df67(%rip), %xmm2    # 0xa2520
callq 0x2de2d
leal -0x1(%r12), %edx
movq 0x30(%rsp), %rdi
leaq 0x80a33(%rip), %rsi     # 0xa5002
movl %ebp, %ecx
movq %r12, %rbp
movq %rbx, %r12
movl 0x2c(%rsp), %ebx
movl %ebp, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x42e0
movsd 0x50(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
addsd 0x7df24(%rip), %xmm2    # 0xa2520
incl %ebp
cmpl %r14d, %ebx
jne 0x244f6
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq