// File: /workspace/github_c_makefile_star2_O3/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 0x83068(%rip), %xmm2    # 0xa7dd8
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 0x832b9(%rip), %rsi     # 0xa809e
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 0x80ed5(%rip), %xmm0    # 0xa5cf8
movsd %xmm0, 0x38(%rsp)
movq %r13, 0x40(%rsp)
leal 0x2(%r13), %eax
movl %eax, 0x10(%rsp)
movq %r12, %r14
addl $-0x2, %r12d
movsd 0x806db(%rip), %xmm0    # 0xa5520
movl $0x3, %ebx
leaq 0x83209(%rip), %r13     # 0xa805a
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 0x80674(%rip), %xmm0    # 0xa5520
decl %ebx
jne 0x24e51
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 0x82e45(%rip), %xmm0    # 0xa7d20
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 0x8061e(%rip), %xmm0    # 0xa5520
movl $0x5, %ebx
leaq 0x8314c(%rip), %r13     # 0xa805a
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 0x805b7(%rip), %xmm0    # 0xa5520
decl %ebx
jne 0x24f0e
movq %r12, 0x50(%rsp)
movq 0x68(%rsp), %rax
cmpl $0x0, 0x6c(%rax)
je 0x252a2
cmpl $0x0, 0x48(%rsp)
movq 0x20(%rsp), %rbp
js 0x2554e
movsd 0x80e4f(%rip), %xmm0    # 0xa5de8
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 0x82b10(%rip), %xmm1    # 0xa7af0
leaq 0x38cfc1(%rip), %rax    # 0x3b1fa8
movq (%rax), %rax
subsd (%rax), %xmm1
leaq 0x38cfe3(%rip), %rax    # 0x3b1fd8
movq (%rax), %rax
movsd (%rax), %xmm0
ucomisd 0x80d04(%rip), %xmm0    # 0xa5d08
jb 0x2500c
sqrtsd %xmm0, %xmm0
jmp 0x2501d
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 0x80cb7(%rip), %xmm0    # 0xa5d08
movsd 0x10(%rsp), %xmm0
jae 0x2506e
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 0x25119
movapd %xmm2, %xmm0
andpd 0x8114a(%rip), %xmm0    # 0xa61e0
movsd 0x80d42(%rip), %xmm1    # 0xa5de0
ucomisd %xmm0, %xmm1
jb 0x25119
movsd 0x30(%rsp), %xmm0
movq 0x40(%rsp), %rbx
movl %ebx, %edi
movq 0x60(%rsp), %r12
movl %r12d, %esi
movsd 0x82d1f(%rip), %xmm1    # 0xa7de0
movsd 0x80d17(%rip), %xmm2    # 0xa5de0
callq 0x2e6b3
movq %rbp, %r15
movl %eax, %ebp
movapd (%rsp), %xmm0
movl %ebx, %edi
movl %r12d, %esi
movsd 0x82cfb(%rip), %xmm1    # 0xa7de0
movsd 0x80cf3(%rip), %xmm2    # 0xa5de0
callq 0x2e6b3
leal -0x1(%r15), %edx
movq 0x50(%rsp), %rdi
leaq 0x82f58(%rip), %rsi     # 0xa805a
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 0x25279
movsd 0xafaa9(%rip), %xmm0    # 0xd4bd8
movsd 0xafaa9(%rip), %xmm1    # 0xd4be0
movsd 0xafaa9(%rip), %xmm2    # 0xd4be8
movq 0x50(%rsp), %rdi
leaq 0x82dca(%rip), %rsi     # 0xa7f15
movb $0x3, %al
callq 0x42e0
movq 0x68(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
callq 0x8b2bb
movapd %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
ucomisd 0x80b94(%rip), %xmm0    # 0xa5d08
movsd 0x10(%rsp), %xmm0
jae 0x25193
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 0x2523a
movapd %xmm2, %xmm0
andpd 0x81028(%rip), %xmm0    # 0xa61e0
movsd 0x80c20(%rip), %xmm1    # 0xa5de0
ucomisd %xmm0, %xmm1
jb 0x2523a
movsd 0x90(%rsp), %xmm0
movq 0x40(%rsp), %rbx
movl %ebx, %edi
movq 0x60(%rsp), %r12
movl %r12d, %esi
movsd 0x82bfa(%rip), %xmm1    # 0xa7de0
movsd 0x80bf2(%rip), %xmm2    # 0xa5de0
callq 0x2e6b3
movq %rbp, %r14
movl %eax, %ebp
movapd 0x20(%rsp), %xmm0
movl %ebx, %edi
movl %r12d, %esi
movsd 0x82bd5(%rip), %xmm1    # 0xa7de0
movsd 0x80bcd(%rip), %xmm2    # 0xa5de0
callq 0x2e6b3
leal -0x1(%r14), %edx
movq 0x50(%rsp), %rdi
leaq 0x82e32(%rip), %rsi     # 0xa805a
movl %ebp, %ecx
movq %r14, %rbp
movl %ebp, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x42e0
movsd 0xaf97e(%rip), %xmm0    # 0xd4bc0
movsd 0xaf97e(%rip), %xmm1    # 0xd4bc8
movsd 0xaf97e(%rip), %xmm2    # 0xd4bd0
movq 0x50(%rsp), %rdi
leaq 0x82cb7(%rip), %rsi     # 0xa7f15
movb $0x3, %al
callq 0x42e0
movapd 0x20(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movapd (%rsp), %xmm2
movsd 0x38(%rsp), %xmm0
addsd 0x80299(%rip), %xmm0    # 0xa5520
incl %ebp
movl %r13d, %r14d
movsd %xmm2, 0x30(%rsp)
cmpl %r13d, 0x48(%rsp)
jne 0x24fc5
jmp 0x2554e
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 0x252cf
sqrtsd %xmm0, %xmm0
jmp 0x252de
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 0x82ae1(%rip), %xmm1    # 0xa7de0
movsd 0x80ad9(%rip), %xmm2    # 0xa5de0
movapd %xmm3, %xmm0
callq 0x2e6b3
leaq 0x82d43(%rip), %rsi     # 0xa805a
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 0x2554e
movsd 0xaf894(%rip), %xmm0    # 0xd4bd8
movsd 0xaf894(%rip), %xmm1    # 0xd4be0
movsd 0xaf894(%rip), %xmm2    # 0xd4be8
leaq 0x82bba(%rip), %rsi     # 0xa7f15
movq 0x50(%rsp), %rdi
movb $0x3, %al
callq 0x42e0
testl %ebx, %ebx
js 0x25512
movsd 0x80a71(%rip), %xmm0    # 0xa5de8
divsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
notl %ebx
leaq 0x38cc19(%rip), %r14    # 0x3b1fa8
leaq 0x38cc42(%rip), %r15    # 0x3b1fd8
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 0x82721(%rip), %xmm1    # 0xa7af0
movq (%r14), %rax
subsd (%rax), %xmm1
movq (%r15), %rax
movsd (%rax), %xmm0
ucomisd 0x80923(%rip), %xmm0    # 0xa5d08
jb 0x253ed
sqrtsd %xmm0, %xmm0
jmp 0x253fc
movsd %xmm1, (%rsp)
callq 0x4300
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x68(%rsp), %rdi
movapd %xmm1, %xmm0
callq 0x8b2bb
movapd %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
ucomisd 0x808e8(%rip), %xmm0    # 0xa5d08
movsd 0x48(%rsp), %xmm0
jae 0x2543d
movsd 0x18(%rsp), %xmm0
movapd %xmm2, (%rsp)
callq 0x4300
movapd (%rsp), %xmm2
mulsd %xmm0, %xmm2
addsd 0x78(%rsp), %xmm2
subl $0x1, %ebp
jb 0x254f0
movapd %xmm2, %xmm0
andpd 0x80d84(%rip), %xmm0    # 0xa61e0
movsd 0x8097c(%rip), %xmm1    # 0xa5de0
ucomisd %xmm0, %xmm1
jb 0x254f0
movsd 0x10(%rsp), %xmm0
movl %r12d, %edi
movl %r13d, %esi
movsd 0x8295e(%rip), %xmm1    # 0xa7de0
movapd %xmm2, (%rsp)
movsd 0x80951(%rip), %xmm2    # 0xa5de0
callq 0x2e6b3
movl %ebp, 0x10(%rsp)
movl %ebx, %ebp
movq %r14, %rbx
movl %eax, %r14d
movapd (%rsp), %xmm0
movl %r12d, %edi
movl %r13d, %esi
movsd 0x8292d(%rip), %xmm1    # 0xa7de0
movsd 0x80925(%rip), %xmm2    # 0xa5de0
callq 0x2e6b3
movq 0x20(%rsp), %r8
leal -0x1(%r8), %edx
movq 0x50(%rsp), %rdi
leaq 0x82b85(%rip), %rsi     # 0xa805a
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 0x80022(%rip), %xmm1    # 0xa5520
movq 0x20(%rsp), %rax
incl %eax
movq %rax, 0x20(%rsp)
cmpl %ebp, %ebx
jne 0x253b5
movsd 0xaf6a6(%rip), %xmm0    # 0xd4bc0
movsd 0xaf6a6(%rip), %xmm1    # 0xd4bc8
movsd 0xaf6a6(%rip), %xmm2    # 0xd4bd0
leaq 0x829e4(%rip), %rsi     # 0xa7f15
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