// File: /workspace/github_c_makefile_star2_O2/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 $0xa8, %rsp
movsd %xmm3, 0x18(%rsp)
movsd %xmm2, 0x78(%rsp)
movl %edx, %r8d
cvtsi2sd %edx, %xmm2
mulsd 0x75e29(%rip), %xmm2    # 0x97d58
cvttsd2si %xmm2, %eax
pushq $0x2
popq %r9
movl %eax, 0x5c(%rsp)
cltd
idivl %r9d
cvtsi2sd %eax, %xmm3
movapd %xmm0, %xmm4
subsd %xmm3, %xmm4
movapd %xmm4, (%rsp)
cvttsd2si %xmm4, %r14d
movl %ecx, 0x24(%rsp)
addsd %xmm0, %xmm3
cvttsd2si %xmm3, %r12d
addl %r8d, %r8d
cvtsi2sd %r8d, %xmm0
movq %rsi, 0x70(%rsp)
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %ebx
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm0
movq %rdi, %r13
movapd %xmm0, 0x80(%rsp)
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %r15d
leaq 0x76083(%rip), %rsi     # 0x9801e
movl %r14d, %edx
movl %ebx, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
xorl %eax, %eax
callq 0x42e0
cvttpd2dq (%rsp), %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq %r12, 0x30(%rsp)
movl %r12d, %eax
subl %r14d, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x73d3e(%rip), %xmm0    # 0x95d10
movsd %xmm0, 0x28(%rsp)
movq %r15, 0x48(%rsp)
addl $0x2, %r15d
movq %rbx, 0x50(%rsp)
leal -0x2(%rbx), %r12d
movsd 0x7352e(%rip), %xmm0    # 0x95520
pushq $0x3
popq %rbx
subl $0x1, %ebx
jb 0x2204b
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
mulsd 0x28(%rsp), %xmm0
addsd 0x60(%rsp), %xmm0
cvttsd2si %xmm0, %ebp
movq %r13, %rdi
movl %ebp, %esi
movq 0x48(%rsp), %rdx
movl %ebp, %ecx
movl %r15d, %r8d
callq 0x20866
movq %r13, %rdi
movl %ebp, %esi
movq 0x50(%rsp), %rdx
movl %ebp, %ecx
movl %r12d, %r8d
callq 0x20866
movsd (%rsp), %xmm0
addsd 0x734d7(%rip), %xmm0    # 0x95520
jmp 0x21ff5
movq 0x48(%rsp), %rcx
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x60(%rsp)
movq 0x50(%rsp), %rax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
divsd 0x75c2b(%rip), %xmm0    # 0x97c98
movsd %xmm0, 0x28(%rsp)
leal 0x2(%r14), %r15d
movq 0x30(%rsp), %rax
leal -0x2(%rax), %r12d
movsd 0x73498(%rip), %xmm0    # 0x95520
pushq $0x5
popq %rbx
subl $0x1, %ebx
jb 0x220e1
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
mulsd 0x28(%rsp), %xmm0
addsd 0x60(%rsp), %xmm0
cvttsd2si %xmm0, %ebp
movq %r13, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl %ebp, %r8d
callq 0x20866
movq %r13, %rdi
movl %r12d, %esi
movl %ebp, %edx
movq 0x30(%rsp), %rcx
movl %ebp, %r8d
callq 0x20866
movsd (%rsp), %xmm0
addsd 0x73441(%rip), %xmm0    # 0x95520
jmp 0x2208b
movq 0x70(%rsp), %rbx
cmpl $0x0, 0x6c(%rbx)
je 0x223b0
movsd 0x73cf8(%rip), %xmm0    # 0x95df0
divsd 0x80(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
xorl %ebp, %ebp
movsd 0x18(%rsp), %xmm1
sqrtsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
xorpd %xmm0, %xmm0
cmpl 0x5c(%rsp), %ebp
jg 0x225d5
movsd %xmm0, 0x60(%rsp)
movapd %xmm0, %xmm2
mulsd 0xa0(%rsp), %xmm2
addsd 0x7592b(%rip), %xmm2    # 0x97a70
leaq 0x387e5c(%rip), %rax    # 0x3a9fa8
movq (%rax), %rax
subsd (%rax), %xmm2
leaq 0x387e7e(%rip), %rax    # 0x3a9fd8
movq (%rax), %rax
movsd (%rax), %xmm0
ucomisd 0x73baf(%rip), %xmm0    # 0x95d18
jb 0x22171
sqrtsd %xmm0, %xmm0
jmp 0x22188
movsd %xmm2, 0x30(%rsp)
callq 0x4300
movsd 0x30(%rsp), %xmm2
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm2
movq 0x38(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movsd (%rax), %xmm3
movsd %xmm2, 0x30(%rsp)
mulsd %xmm2, %xmm3
addsd (%rcx), %xmm3
ucomisd 0x73b67(%rip), %xmm1    # 0x95d18
movsd 0x28(%rsp), %xmm0
jae 0x221d2
movapd %xmm1, %xmm0
movapd %xmm3, (%rsp)
callq 0x4300
movapd (%rsp), %xmm3
movsd 0x18(%rsp), %xmm1
mulsd %xmm0, %xmm3
addsd 0x78(%rsp), %xmm3
testl %ebp, %ebp
movapd %xmm3, (%rsp)
je 0x22277
movapd %xmm3, %xmm0
andpd 0x73feb(%rip), %xmm0    # 0x961e0
movsd 0x73beb(%rip), %xmm2    # 0x95de8
ucomisd %xmm0, %xmm2
jb 0x22277
movsd 0x80(%rsp), %xmm0
movq 0x48(%rsp), %r12
movl %r12d, %edi
movq 0x50(%rsp), %r15
movl %r15d, %esi
movsd 0x75b3c(%rip), %xmm1    # 0x97d60
movsd 0x73bbc(%rip), %xmm2    # 0x95de8
callq 0x2a83b
movl %eax, %ebx
movapd (%rsp), %xmm0
movl %r12d, %edi
movl %r15d, %esi
movsd 0x75b1a(%rip), %xmm1    # 0x97d60
movsd 0x73b9a(%rip), %xmm2    # 0x95de8
callq 0x2a83b
leal -0x1(%r14), %esi
movq %r13, %rdi
movl %ebx, %edx
movq 0x70(%rsp), %rbx
movl %r14d, %ecx
movl %eax, %r8d
callq 0x20866
movapd (%rsp), %xmm3
movsd 0x18(%rsp), %xmm1
cmpl $0x7de, 0x24(%rsp)      # imm = 0x7DE
jne 0x2238f
movq %r13, %rdi
pushq $0x1
popq %rsi
callq 0x2004b
movq %rbx, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x7db6d
movapd %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
ucomisd 0x73a68(%rip), %xmm0    # 0x95d18
movsd 0x28(%rsp), %xmm0
jae 0x222cf
movsd 0x18(%rsp), %xmm0
movapd %xmm2, 0x30(%rsp)
callq 0x4300
movapd 0x30(%rsp), %xmm2
mulsd %xmm0, %xmm2
addsd 0x78(%rsp), %xmm2
testl %ebp, %ebp
movapd %xmm2, 0x30(%rsp)
je 0x2236b
movapd %xmm2, %xmm0
andpd 0x73eed(%rip), %xmm0    # 0x961e0
movsd 0x73aed(%rip), %xmm1    # 0x95de8
ucomisd %xmm0, %xmm1
jb 0x2236b
movsd 0x98(%rsp), %xmm0
movq 0x48(%rsp), %r12
movl %r12d, %edi
movq 0x50(%rsp), %r15
movl %r15d, %esi
movsd 0x75a3e(%rip), %xmm1    # 0x97d60
movsd 0x73abe(%rip), %xmm2    # 0x95de8
callq 0x2a83b
movl %eax, %ebx
movapd 0x30(%rsp), %xmm0
movl %r12d, %edi
movl %r15d, %esi
movsd 0x75a1b(%rip), %xmm1    # 0x97d60
movsd 0x73a9b(%rip), %xmm2    # 0x95de8
callq 0x2a83b
leal -0x1(%r14), %esi
movq %r13, %rdi
movl %ebx, %edx
movq 0x70(%rsp), %rbx
movl %r14d, %ecx
movl %eax, %r8d
callq 0x20866
movq %r13, %rdi
xorl %esi, %esi
callq 0x2004b
movapd 0x30(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
movsd 0x18(%rsp), %xmm1
movapd (%rsp), %xmm3
movsd 0x60(%rsp), %xmm0
addsd 0x73183(%rip), %xmm0    # 0x95520
incl %ebp
incl %r14d
movsd %xmm3, 0x80(%rsp)
jmp 0x22120
movsd 0x70(%rbx), %xmm3
xorpd %xmm1, %xmm1
movsd 0x18(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x223cb
sqrtsd %xmm0, %xmm0
jmp 0x223da
movsd %xmm3, (%rsp)
callq 0x4300
movsd (%rsp), %xmm3
mulsd %xmm0, %xmm3
addsd 0x78(%rsp), %xmm3
movsd 0x75974(%rip), %xmm1    # 0x97d60
movsd 0x739f4(%rip), %xmm2    # 0x95de8
movapd %xmm3, %xmm0
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x2a83b
movq %r13, %rdi
movl %r14d, %esi
movl %eax, %edx
movq 0x30(%rsp), %rcx
movl %eax, %r8d
callq 0x20866
cmpl $0x7de, 0x24(%rsp)      # imm = 0x7DE
jne 0x225d5
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0x2004b
movsd 0x739b3(%rip), %xmm0    # 0x95df0
divsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
xorl %ebp, %ebp
leaq 0x387b53(%rip), %r15    # 0x3a9fa8
leaq 0x387b7c(%rip), %r12    # 0x3a9fd8
sqrtsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
xorpd %xmm0, %xmm0
cmpl 0x5c(%rsp), %ebp
jg 0x225e7
movsd %xmm0, 0x30(%rsp)
movapd %xmm0, %xmm1
mulsd 0x28(%rsp), %xmm1
addsd 0x755df(%rip), %xmm1    # 0x97a70
movq (%r15), %rax
subsd (%rax), %xmm1
movq (%r12), %rax
movsd (%rax), %xmm0
ucomisd 0x73870(%rip), %xmm0    # 0x95d18
jb 0x224b0
sqrtsd %xmm0, %xmm0
jmp 0x224bf
movsd %xmm1, (%rsp)
callq 0x4300
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movq %rbx, %rdi
movapd %xmm1, %xmm0
callq 0x7db6d
movapd %xmm0, %xmm2
movsd 0x18(%rsp), %xmm1
ucomisd 0x73837(%rip), %xmm1    # 0x95d18
movsd 0x80(%rsp), %xmm0
jae 0x224ff
movapd %xmm1, %xmm0
movapd %xmm2, (%rsp)
callq 0x4300
movapd (%rsp), %xmm2
mulsd %xmm0, %xmm2
addsd 0x78(%rsp), %xmm2
testl %ebp, %ebp
je 0x225b7
movapd %xmm2, %xmm0
andpd 0x73cc3(%rip), %xmm0    # 0x961e0
movsd 0x738c3(%rip), %xmm1    # 0x95de8
ucomisd %xmm0, %xmm1
jb 0x225b7
movsd 0x60(%rsp), %xmm0
movl %ebp, 0x60(%rsp)
movq %r12, %rbp
movq 0x48(%rsp), %r12
movl %r12d, %edi
movq %r15, %rbx
movq 0x50(%rsp), %r15
movl %r15d, %esi
movsd 0x75809(%rip), %xmm1    # 0x97d60
movapd %xmm2, (%rsp)
movsd 0x73884(%rip), %xmm2    # 0x95de8
callq 0x2a83b
movl %eax, 0x24(%rsp)
movapd (%rsp), %xmm0
movl %r12d, %edi
movq %rbp, %r12
movl 0x60(%rsp), %ebp
movl %r15d, %esi
movq %rbx, %r15
movsd 0x757d6(%rip), %xmm1    # 0x97d60
movsd 0x73856(%rip), %xmm2    # 0x95de8
callq 0x2a83b
leal -0x1(%r14), %esi
movq %r13, %rdi
movl 0x24(%rsp), %edx
movq 0x70(%rsp), %rbx
movl %r14d, %ecx
movl %eax, %r8d
callq 0x20866
movapd (%rsp), %xmm2
movsd 0x30(%rsp), %xmm0
addsd 0x72f5b(%rip), %xmm0    # 0x95520
incl %ebp
incl %r14d
movsd %xmm2, 0x60(%rsp)
jmp 0x2246f
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
xorl %esi, %esi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2004b