// File: /workspace/github_c_makefile_star2_O3/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 0x83696(%rip), %xmm4    # 0xa7dd8
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 0x838d9(%rip), %rsi     # 0xa809e
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 0x814ee(%rip), %xmm0    # 0xa5cf8
movsd %xmm0, 0x8(%rsp)
leal 0x2(%r15), %eax
movl %eax, 0x38(%rsp)
leal -0x2(%r13), %r14d
movsd 0x80cfc(%rip), %xmm0    # 0xa5520
movl $0x3, %ebx
leaq 0x8382a(%rip), %r15     # 0xa805a
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 0x80c88(%rip), %xmm0    # 0xa5520
decl %ebx
jne 0x24835
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 0x8345e(%rip), %xmm0    # 0xa7d20
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 0x80c33(%rip), %xmm0    # 0xa5520
movl $0x5, %ebx
leaq 0x83761(%rip), %r15     # 0xa805a
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 0x80bca(%rip), %xmm0    # 0xa5520
decl %ebx
jne 0x248f9
cvttsd2si 0x30(%rsp), %eax
movl %eax, 0x4c(%rsp)
movsd 0xb026c(%rip), %xmm0    # 0xd4bd8
movsd 0xb026c(%rip), %xmm1    # 0xd4be0
movsd 0xb026c(%rip), %xmm2    # 0xd4be8
leaq 0x83592(%rip), %rsi     # 0xa7f15
movq %r12, 0x30(%rsp)
movq %r12, %rdi
movb $0x3, %al
callq 0x42e0
movl 0x48(%rsp), %r15d
testl %r15d, %r15d
js 0x24b6d
movsd 0x81440(%rip), %xmm0    # 0xa5de8
divsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
notl %r15d
leaq 0x38d5e7(%rip), %r13    # 0x3b1fa8
leaq 0x38d610(%rip), %rbx    # 0x3b1fd8
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 0x830ec(%rip), %xmm1    # 0xa7af0
movq (%r13), %rax
subsd (%rax), %xmm1
movq (%rbx), %rax
movsd (%rax), %xmm0
ucomisd 0x812ed(%rip), %xmm0    # 0xa5d08
jb 0x24a23
sqrtsd %xmm0, %xmm0
jmp 0x24a34
movsd %xmm1, 0x10(%rsp)
callq 0x4300
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x90(%rsp), %rdi
movapd %xmm1, %xmm0
callq 0x8b2bb
movapd %xmm0, %xmm1
movsd 0x70(%rsp), %xmm0
ucomisd 0x812ad(%rip), %xmm0    # 0xa5d08
movsd 0x78(%rsp), %xmm0
jae 0x24a7a
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 0x24b51
movapd %xmm1, %xmm0
andpd 0x81743(%rip), %xmm0    # 0xa61e0
movsd 0x8133b(%rip), %xmm2    # 0xa5de0
ucomisd %xmm0, %xmm2
jb 0x24b51
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 0x83300(%rip), %xmm1    # 0xa7de0
movsd 0x812f8(%rip), %xmm2    # 0xa5de0
callq 0x2e6b3
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 0x832cb(%rip), %xmm1    # 0xa7de0
movsd 0x812c3(%rip), %xmm2    # 0xa5de0
callq 0x2e6b3
leal -0x1(%r14), %edx
movq 0x30(%rsp), %rdi
leaq 0x83528(%rip), %rsi     # 0xa805a
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 0x809c1(%rip), %xmm0    # 0xa5520
incl %r14d
cmpl %r12d, %r15d
jne 0x249e6
jmp 0x24b72
movq 0x60(%rsp), %rbp
movapd %xmm1, 0x10(%rsp)
movsd 0xb0040(%rip), %xmm0    # 0xd4bc0
movsd 0xb0040(%rip), %xmm1    # 0xd4bc8
movsd 0xb0040(%rip), %xmm2    # 0xd4bd0
leaq 0x8337e(%rip), %rsi     # 0xa7f15
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 0x834da(%rip), %rsi     # 0xa809e
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 0x24d32
movsd 0x831f6(%rip), %xmm0    # 0xa7de8
divsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
notl %ebx
leaq 0x38d39e(%rip), %r13    # 0x3b1fa8
leaq 0x38d3c7(%rip), %r12    # 0x3b1fd8
xorl %r14d, %r14d
xorpd %xmm2, %xmm2
movl %ebx, 0x2c(%rsp)
movl 0x4c(%rsp), %r15d
movsd %xmm2, 0x40(%rsp)
mulsd 0x8(%rsp), %xmm2
addsd 0x82ebb(%rip), %xmm2    # 0xa7af0
movq (%r13), %rax
subsd (%rax), %xmm2
movq (%r12), %rax
movsd (%rax), %xmm0
ucomisd 0x810bb(%rip), %xmm0    # 0xa5d08
movapd %xmm1, 0x10(%rsp)
jb 0x24c5b
sqrtsd %xmm0, %xmm0
jmp 0x24c6c
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 0x55a80
movapd %xmm0, %xmm1
subl $0x1, %r14d
jb 0x24d19
movsd %xmm1, 0x50(%rsp)
xorpd %xmm1, %xmm1
movaps 0x10(%rsp), %xmm0
movl %r15d, %edi
movq 0x68(%rsp), %rsi
movsd 0x80863(%rip), %xmm2    # 0xa5520
callq 0x2e6b3
movq %r12, %rbx
movq %rbp, %r12
movl %eax, %ebp
xorpd %xmm1, %xmm1
movsd 0x50(%rsp), %xmm0
movl %r15d, %edi
movq 0x68(%rsp), %rsi
movsd 0x8083c(%rip), %xmm2    # 0xa5520
callq 0x2e6b3
leal -0x1(%r12), %edx
movq 0x30(%rsp), %rdi
leaq 0x83360(%rip), %rsi     # 0xa805a
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 0x807f9(%rip), %xmm2    # 0xa5520
incl %ebp
cmpl %r14d, %ebx
jne 0x24c21
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq