// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/eps.c
// Function: plot_regression_leaf_model
void plot_regression_leaf_model(FILE* outfile, Regressionnodeptr rootnode, Point p, int radius, int algorithm, double outputmean, double outputvariance)
{
 double output, prevoutput, output2, prevoutput2, 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;
 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));   
  }
 if (rootnode->leaftype == CONSTANTLEAF)
  {
   output = rootnode->regressionvalue * sqrt(outputvariance) + outputmean;
   posy1 = return_pos(output, bottom, top, minoutput, maxoutput);
   write_line(outfile, left, posy1, right, posy1);
   if (algorithm == SOFTREGTREE)
    {
     setcolor(outfile, RED);
     for (i = 0; i <= width; i++)
      {
       prevoutput2 = output2;
       input = ((-2 + i * (4.0 / width)) - mean.values[0].floatvalue) / sqrt(variance.values[0].floatvalue);
       output2 = soft_output_of_subregressiontree(rootnode, input) * sqrt(outputvariance) + outputmean;
       if (i != 0 && output2 <= maxoutput && output2 >= minoutput)
        {
         posy1 = return_pos(prevoutput2, bottom, top, minoutput, maxoutput);
         posy2 = return_pos(output2, bottom, top, minoutput, maxoutput);
         write_line(outfile, left + i - 1, posy1, left + i, posy2);      
        }
      }
     setcolor(outfile, BLACK);     
    }
  }
 else
  {
   for (i = 0; i <= width; i++)
    {
     prevoutput = output;
     prevoutput2 = output2;
     input = ((-2 + i * (4.0 / width)) - mean.values[0].floatvalue) / sqrt(variance.values[0].floatvalue);
     output = (rootnode->w.values[0][0] + rootnode->w.values[1][0] * 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);      
      }
     if (algorithm == SOFTREGTREE)
      {
       setcolor(outfile, RED);
       output2 = soft_output_of_subregressiontree(rootnode, input) * sqrt(outputvariance) + outputmean;
       if (i != 0 && output2 <= maxoutput && output2 >= minoutput)
        {
         posy1 = return_pos(prevoutput2, bottom, top, minoutput, maxoutput);
         posy2 = return_pos(output2, bottom, top, minoutput, maxoutput);
         write_line(outfile, left + i - 1, posy1, left + i, posy2);      
        }
       setcolor(outfile, BLACK);       
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movsd %xmm3, 0x18(%rsp)
movsd %xmm2, 0x78(%rsp)
xorps %xmm2, %xmm2
cvtsi2sd %edx, %xmm2
mulsd 0x8070b(%rip), %xmm2    # 0xa4d50
cvttsd2si %xmm2, %r8d
movl %r8d, %eax
shrl $0x1f, %eax
movl %r8d, 0x48(%rsp)
addl %r8d, %eax
sarl %eax
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
movapd %xmm0, %xmm4
subsd %xmm3, %xmm4
movapd %xmm4, (%rsp)
cvttsd2si %xmm4, %ebx
movl %ecx, 0x74(%rsp)
addsd %xmm0, %xmm3
cvttsd2si %xmm3, %r14d
addl %edx, %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movq %rsi, 0x68(%rsp)
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %r12d
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm0
movq %rdi, %r15
movapd %xmm0, 0x80(%rsp)
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %r13d
leaq 0x8098c(%rip), %rsi     # 0xa5046
movl %ebx, %edx
movl %r12d, %ecx
movl %r14d, %r8d
movl %r13d, %r9d
xorl %eax, %eax
callq 0x42e0
cvttpd2dq (%rsp), %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq %r14, 0x30(%rsp)
movl %r14d, %eax
movq %rbx, 0x20(%rsp)
subl %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x7e600(%rip), %xmm0    # 0xa2cf8
movsd %xmm0, 0x38(%rsp)
movq %r13, 0x40(%rsp)
leal 0x2(%r13), %eax
movl %eax, 0x10(%rsp)
movq %r12, %r14
addl $-0x2, %r12d
movsd 0x7de06(%rip), %xmm0    # 0xa2520
movl $0x3, %ebx
leaq 0x808dc(%rip), %r13     # 0xa5002
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
mulsd 0x38(%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
cvttsd2si %xmm0, %ebp
movq %r15, %rdi
movq %r13, %rsi
movl %ebp, %edx
movq 0x40(%rsp), %rcx
movl %ebp, %r8d
movl 0x10(%rsp), %r9d
xorl %eax, %eax
callq 0x42e0
movq %r15, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %r14d, %ecx
movl %ebp, %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x42e0
movsd (%rsp), %xmm0
addsd 0x7dd9f(%rip), %xmm0    # 0xa2520
decl %ebx
jne 0x24726
movq 0x40(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x50(%rsp)
movq %r14, 0x60(%rsp)
movl %r14d, %eax
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x804c0(%rip), %xmm0    # 0xa4c70
movsd %xmm0, 0x38(%rsp)
movq %r15, %r12
movq 0x20(%rsp), %r15
leal 0x2(%r15), %eax
movl %eax, 0x10(%rsp)
movq 0x30(%rsp), %r15
leal -0x2(%r15), %r14d
movsd 0x7dd49(%rip), %xmm0    # 0xa2520
movl $0x5, %ebx
leaq 0x8081f(%rip), %r13     # 0xa5002
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
mulsd 0x38(%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
cvttsd2si %xmm0, %ebp
movq %r12, %rdi
movq %r13, %rsi
movq 0x20(%rsp), %rdx
movl %ebp, %ecx
movl 0x10(%rsp), %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0x42e0
movq %r12, %rdi
movq %r13, %rsi
movl %r14d, %edx
movl %ebp, %ecx
movl %r15d, %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0x42e0
movsd (%rsp), %xmm0
addsd 0x7dce2(%rip), %xmm0    # 0xa2520
decl %ebx
jne 0x247e3
movq %r12, 0x50(%rsp)
movq 0x68(%rsp), %rax
cmpl $0x0, 0x6c(%rax)
je 0x24b77
cmpl $0x0, 0x48(%rsp)
movq 0x20(%rsp), %rbp
js 0x24e23
movsd 0x7e57a(%rip), %xmm0    # 0xa2de8
divsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
notl 0x48(%rsp)
xorps %xmm0, %xmm0
sqrtsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %r14d, %r14d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x38(%rsp)
movapd %xmm0, %xmm1
mulsd 0x80(%rsp), %xmm1
addsd 0x80183(%rip), %xmm1    # 0xa4a38
leaq 0x38a6ec(%rip), %rax    # 0x3aefa8
movq (%rax), %rax
subsd (%rax), %xmm1
leaq 0x38a70e(%rip), %rax    # 0x3aefd8
movq (%rax), %rax
movsd (%rax), %xmm0
ucomisd 0x7e42f(%rip), %xmm0    # 0xa2d08
jb 0x248e1
sqrtsd %xmm0, %xmm0
jmp 0x248f2
movsd %xmm1, 0x20(%rsp)
callq 0x4300
movsd 0x20(%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movsd (%rax), %xmm2
movsd %xmm1, 0x20(%rsp)
mulsd %xmm1, %xmm2
addsd (%rcx), %xmm2
movsd 0x18(%rsp), %xmm0
ucomisd 0x7e3e2(%rip), %xmm0    # 0xa2d08
movsd 0x10(%rsp), %xmm0
jae 0x24943
movsd 0x18(%rsp), %xmm0
movapd %xmm2, (%rsp)
callq 0x4300
movapd (%rsp), %xmm2
mulsd %xmm0, %xmm2
addsd 0x78(%rsp), %xmm2
movl %r14d, %r13d
subl $0x1, %r13d
movapd %xmm2, (%rsp)
jb 0x249ee
movapd %xmm2, %xmm0
andpd 0x7e875(%rip), %xmm0    # 0xa31e0
movsd 0x7e46d(%rip), %xmm1    # 0xa2de0
ucomisd %xmm0, %xmm1
jb 0x249ee
movsd 0x30(%rsp), %xmm0
movq 0x40(%rsp), %rbx
movl %ebx, %edi
movq 0x60(%rsp), %r12
movl %r12d, %esi
movsd 0x803c2(%rip), %xmm1    # 0xa4d58
movsd 0x7e442(%rip), %xmm2    # 0xa2de0
callq 0x2de2d
movq %rbp, %r15
movl %eax, %ebp
movapd (%rsp), %xmm0
movl %ebx, %edi
movl %r12d, %esi
movsd 0x8039e(%rip), %xmm1    # 0xa4d58
movsd 0x7e41e(%rip), %xmm2    # 0xa2de0
callq 0x2de2d
leal -0x1(%r15), %edx
movq 0x50(%rsp), %rdi
leaq 0x8062b(%rip), %rsi     # 0xa5002
movl %ebp, %ecx
movq %r15, %rbp
movl %ebp, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x42e0
movapd (%rsp), %xmm2
cmpl $0x7de, 0x74(%rsp)      # imm = 0x7DE
jne 0x24b4e
movsd 0xad1d4(%rip), %xmm0    # 0xd1bd8
movsd 0xad1d4(%rip), %xmm1    # 0xd1be0
movsd 0xad1d4(%rip), %xmm2    # 0xd1be8
movq 0x50(%rsp), %rdi
leaq 0x8049d(%rip), %rsi     # 0xa4ebd
movb $0x3, %al
callq 0x42e0
movq 0x68(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
callq 0x88ab5
movapd %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
ucomisd 0x7e2bf(%rip), %xmm0    # 0xa2d08
movsd 0x10(%rsp), %xmm0
jae 0x24a68
movsd 0x18(%rsp), %xmm0
movapd %xmm2, 0x20(%rsp)
callq 0x4300
movapd 0x20(%rsp), %xmm2
mulsd %xmm0, %xmm2
addsd 0x78(%rsp), %xmm2
testl %r14d, %r14d
movapd %xmm2, 0x20(%rsp)
je 0x24b0f
movapd %xmm2, %xmm0
andpd 0x7e753(%rip), %xmm0    # 0xa31e0
movsd 0x7e34b(%rip), %xmm1    # 0xa2de0
ucomisd %xmm0, %xmm1
jb 0x24b0f
movsd 0x90(%rsp), %xmm0
movq 0x40(%rsp), %rbx
movl %ebx, %edi
movq 0x60(%rsp), %r12
movl %r12d, %esi
movsd 0x8029d(%rip), %xmm1    # 0xa4d58
movsd 0x7e31d(%rip), %xmm2    # 0xa2de0
callq 0x2de2d
movq %rbp, %r14
movl %eax, %ebp
movapd 0x20(%rsp), %xmm0
movl %ebx, %edi
movl %r12d, %esi
movsd 0x80278(%rip), %xmm1    # 0xa4d58
movsd 0x7e2f8(%rip), %xmm2    # 0xa2de0
callq 0x2de2d
leal -0x1(%r14), %edx
movq 0x50(%rsp), %rdi
leaq 0x80505(%rip), %rsi     # 0xa5002
movl %ebp, %ecx
movq %r14, %rbp
movl %ebp, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x42e0
movsd 0xad0a9(%rip), %xmm0    # 0xd1bc0
movsd 0xad0a9(%rip), %xmm1    # 0xd1bc8
movsd 0xad0a9(%rip), %xmm2    # 0xd1bd0
movq 0x50(%rsp), %rdi
leaq 0x8038a(%rip), %rsi     # 0xa4ebd
movb $0x3, %al
callq 0x42e0
movapd 0x20(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movapd (%rsp), %xmm2
movsd 0x38(%rsp), %xmm0
addsd 0x7d9c4(%rip), %xmm0    # 0xa2520
incl %ebp
movl %r13d, %r14d
movsd %xmm2, 0x30(%rsp)
cmpl %r13d, 0x48(%rsp)
jne 0x2489a
jmp 0x24e23
movq 0x68(%rsp), %rax
movsd 0x70(%rax), %xmm3
xorpd %xmm0, %xmm0
movsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movapd %xmm1, %xmm0
movl 0x48(%rsp), %ebx
movq 0x20(%rsp), %r14
jb 0x24ba4
sqrtsd %xmm0, %xmm0
jmp 0x24bb3
movsd %xmm3, (%rsp)
callq 0x4300
movsd (%rsp), %xmm3
movq 0x60(%rsp), %rsi
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %r12
mulsd %xmm0, %xmm3
addsd 0x78(%rsp), %xmm3
movsd 0x80184(%rip), %xmm1    # 0xa4d58
movsd 0x7e204(%rip), %xmm2    # 0xa2de0
movapd %xmm3, %xmm0
callq 0x2de2d
leaq 0x80416(%rip), %rsi     # 0xa5002
movq 0x50(%rsp), %rdi
movl %r14d, %edx
movl %eax, %ecx
movl %r12d, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x42e0
cmpl $0x7de, 0x74(%rsp)      # imm = 0x7DE
jne 0x24e23
movsd 0xacfbf(%rip), %xmm0    # 0xd1bd8
movsd 0xacfbf(%rip), %xmm1    # 0xd1be0
movsd 0xacfbf(%rip), %xmm2    # 0xd1be8
leaq 0x8028d(%rip), %rsi     # 0xa4ebd
movq 0x50(%rsp), %rdi
movb $0x3, %al
callq 0x42e0
testl %ebx, %ebx
js 0x24de7
movsd 0x7e19c(%rip), %xmm0    # 0xa2de8
divsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
notl %ebx
leaq 0x38a344(%rip), %r14    # 0x3aefa8
leaq 0x38a36d(%rip), %r15    # 0x3aefd8
xorps %xmm0, %xmm0
sqrtsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
xorl %ebp, %ebp
xorpd %xmm1, %xmm1
movq 0x40(%rsp), %r12
movq 0x60(%rsp), %r13
movsd %xmm2, 0x10(%rsp)
movsd %xmm1, 0x38(%rsp)
mulsd 0x30(%rsp), %xmm1
addsd 0x7fd94(%rip), %xmm1    # 0xa4a38
movq (%r14), %rax
subsd (%rax), %xmm1
movq (%r15), %rax
movsd (%rax), %xmm0
ucomisd 0x7e04e(%rip), %xmm0    # 0xa2d08
jb 0x24cc2
sqrtsd %xmm0, %xmm0
jmp 0x24cd1
movsd %xmm1, (%rsp)
callq 0x4300
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x68(%rsp), %rdi
movapd %xmm1, %xmm0
callq 0x88ab5
movapd %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
ucomisd 0x7e013(%rip), %xmm0    # 0xa2d08
movsd 0x48(%rsp), %xmm0
jae 0x24d12
movsd 0x18(%rsp), %xmm0
movapd %xmm2, (%rsp)
callq 0x4300
movapd (%rsp), %xmm2
mulsd %xmm0, %xmm2
addsd 0x78(%rsp), %xmm2
subl $0x1, %ebp
jb 0x24dc5
movapd %xmm2, %xmm0
andpd 0x7e4af(%rip), %xmm0    # 0xa31e0
movsd 0x7e0a7(%rip), %xmm1    # 0xa2de0
ucomisd %xmm0, %xmm1
jb 0x24dc5
movsd 0x10(%rsp), %xmm0
movl %r12d, %edi
movl %r13d, %esi
movsd 0x80001(%rip), %xmm1    # 0xa4d58
movapd %xmm2, (%rsp)
movsd 0x7e07c(%rip), %xmm2    # 0xa2de0
callq 0x2de2d
movl %ebp, 0x10(%rsp)
movl %ebx, %ebp
movq %r14, %rbx
movl %eax, %r14d
movapd (%rsp), %xmm0
movl %r12d, %edi
movl %r13d, %esi
movsd 0x7ffd0(%rip), %xmm1    # 0xa4d58
movsd 0x7e050(%rip), %xmm2    # 0xa2de0
callq 0x2de2d
movq 0x20(%rsp), %r8
leal -0x1(%r8), %edx
movq 0x50(%rsp), %rdi
leaq 0x80258(%rip), %rsi     # 0xa5002
movl %r14d, %ecx
movq %rbx, %r14
movl %ebp, %ebx
movl 0x10(%rsp), %ebp
movl %eax, %r9d
xorl %eax, %eax
callq 0x42e0
movapd (%rsp), %xmm2
movsd 0x38(%rsp), %xmm1
addsd 0x7d74d(%rip), %xmm1    # 0xa2520
movq 0x20(%rsp), %rax
incl %eax
movq %rax, 0x20(%rsp)
cmpl %ebp, %ebx
jne 0x24c8a
movsd 0xacdd1(%rip), %xmm0    # 0xd1bc0
movsd 0xacdd1(%rip), %xmm1    # 0xd1bc8
movsd 0xacdd1(%rip), %xmm2    # 0xd1bd0
leaq 0x800b7(%rip), %rsi     # 0xa4ebd
movq 0x50(%rsp), %rdi
movb $0x3, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x42e0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq