// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
movl %ecx, -0x28(%rbp)
movsd %xmm2, -0x30(%rbp)
movsd %xmm3, -0x38(%rbp)
movsd 0xaff73(%rip), %xmm0    # 0xe4968
movsd %xmm0, -0x78(%rbp)
movsd 0xae076(%rip), %xmm0    # 0xe2a78
movsd %xmm0, -0x80(%rbp)
cvtsi2sdl -0x24(%rbp), %xmm1
movsd 0xaff4c(%rip), %xmm0    # 0xe4960
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %eax
movl %eax, -0x8c(%rbp)
movsd -0x10(%rbp), %xmm0
movl -0x88(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cvtsi2sd %eax, %xmm1
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x90(%rbp)
movsd -0x10(%rbp), %xmm0
movl -0x88(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cvtsi2sd %eax, %xmm1
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x94(%rbp)
movsd -0x8(%rbp), %xmm0
movl -0x24(%rbp), %eax
shll %eax
cvtsi2sd %eax, %xmm1
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x98(%rbp)
movsd -0x8(%rbp), %xmm0
movl -0x24(%rbp), %eax
shll %eax
cvtsi2sd %eax, %xmm1
subsd %xmm1, %xmm0
cvtsi2sdl -0x8c(%rbp), %xmm1
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x9c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x90(%rbp), %esi
movl -0x98(%rbp), %edx
movl -0x94(%rbp), %ecx
movl -0x9c(%rbp), %r8d
xorl %r9d, %r9d
movl $0x0, (%rsp)
callq 0x32d30
movl $0x1, -0x84(%rbp)
cmpl $0x4, -0x84(%rbp)
jge 0x34c27
movq -0x18(%rbp), %rdi
cvtsi2sdl -0x90(%rbp), %xmm1
cvtsi2sdl -0x84(%rbp), %xmm0
movl -0x94(%rbp), %eax
subl -0x90(%rbp), %eax
cvtsi2sd %eax, %xmm2
movsd 0xadf55(%rip), %xmm3    # 0xe2a80
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %esi
movl -0x9c(%rbp), %edx
cvtsi2sdl -0x90(%rbp), %xmm1
cvtsi2sdl -0x84(%rbp), %xmm0
movl -0x94(%rbp), %eax
subl -0x90(%rbp), %eax
cvtsi2sd %eax, %xmm2
movsd 0xadf17(%rip), %xmm3    # 0xe2a80
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl -0x9c(%rbp), %r8d
addl $0x2, %r8d
callq 0x32a70
movq -0x18(%rbp), %rdi
cvtsi2sdl -0x90(%rbp), %xmm1
cvtsi2sdl -0x84(%rbp), %xmm0
movl -0x94(%rbp), %eax
subl -0x90(%rbp), %eax
cvtsi2sd %eax, %xmm2
movsd 0xadecb(%rip), %xmm3    # 0xe2a80
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %esi
movl -0x98(%rbp), %edx
cvtsi2sdl -0x90(%rbp), %xmm1
cvtsi2sdl -0x84(%rbp), %xmm0
movl -0x94(%rbp), %eax
subl -0x90(%rbp), %eax
cvtsi2sd %eax, %xmm2
movsd 0xade8d(%rip), %xmm3    # 0xe2a80
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl -0x98(%rbp), %r8d
subl $0x2, %r8d
callq 0x32a70
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x34af2
movl $0x1, -0x84(%rbp)
cmpl $0x6, -0x84(%rbp)
jge 0x34d64
movq -0x18(%rbp), %rdi
movl -0x90(%rbp), %esi
cvtsi2sdl -0x9c(%rbp), %xmm1
cvtsi2sdl -0x84(%rbp), %xmm0
movl -0x98(%rbp), %eax
subl -0x9c(%rbp), %eax
cvtsi2sd %eax, %xmm2
movsd 0xafbf8(%rip), %xmm3    # 0xe4868
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
movl -0x90(%rbp), %ecx
addl $0x2, %ecx
cvtsi2sdl -0x9c(%rbp), %xmm1
cvtsi2sdl -0x84(%rbp), %xmm0
movl -0x98(%rbp), %eax
subl -0x9c(%rbp), %eax
cvtsi2sd %eax, %xmm2
movsd 0xafbb7(%rip), %xmm3    # 0xe4868
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %r8d
callq 0x32a70
movq -0x18(%rbp), %rdi
movl -0x94(%rbp), %esi
subl $0x2, %esi
cvtsi2sdl -0x9c(%rbp), %xmm1
cvtsi2sdl -0x84(%rbp), %xmm0
movl -0x98(%rbp), %eax
subl -0x9c(%rbp), %eax
cvtsi2sd %eax, %xmm2
movsd 0xafb6c(%rip), %xmm3    # 0xe4868
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
movl -0x94(%rbp), %ecx
cvtsi2sdl -0x9c(%rbp), %xmm1
cvtsi2sdl -0x84(%rbp), %xmm0
movl -0x98(%rbp), %eax
subl -0x9c(%rbp), %eax
cvtsi2sd %eax, %xmm2
movsd 0xafb2e(%rip), %xmm3    # 0xe4868
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %r8d
callq 0x32a70
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x34c31
movq -0x20(%rbp), %rax
cmpl $0x0, 0x6c(%rax)
jne 0x34fb2
movq -0x20(%rbp), %rax
movsd 0x70(%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x42a0
movaps %xmm0, %xmm2
movsd -0xa8(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movl -0x9c(%rbp), %edi
movl -0x98(%rbp), %esi
movsd -0x78(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
callq 0x42230
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x18(%rbp), %rdi
movl -0x90(%rbp), %esi
cvttsd2si -0x68(%rbp), %edx
movl -0x94(%rbp), %ecx
cvttsd2si -0x68(%rbp), %r8d
callq 0x32a70
cmpl $0x7de, -0x28(%rbp)     # imm = 0x7DE
jne 0x34fad
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x31ae0
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x88(%rbp), %eax
jg 0x34fa2
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
cvtsi2sdl -0x84(%rbp), %xmm0
cvtsi2sdl -0x88(%rbp), %xmm2
movsd 0xadc34(%rip), %xmm1    # 0xe2a80
divsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0xafa5c(%rip), %xmm1    # 0xe48b8
addsd %xmm1, %xmm0
leaq 0x3ad111(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
subsd (%rax), %xmm0
movsd %xmm0, -0xb8(%rbp)
leaq 0x3ad12b(%rip), %rax    # 0x3e1fa8
movq (%rax), %rax
movsd (%rax), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0xb8(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x20(%rbp), %rdi
movsd -0x60(%rbp), %xmm0
callq 0xbe9f0
movsd %xmm0, -0xb0(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x42a0
movaps %xmm0, %xmm2
movsd -0xb0(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
cmpl $0x0, -0x84(%rbp)
je 0x34f8c
movsd -0x50(%rbp), %xmm1
movsd -0x80(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x34f8c
movsd -0x50(%rbp), %xmm0
ucomisd -0x78(%rbp), %xmm0
jb 0x34f8c
movsd -0x58(%rbp), %xmm0
movl -0x9c(%rbp), %edi
movl -0x98(%rbp), %esi
movsd -0x78(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
callq 0x42230
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x50(%rbp), %xmm0
movl -0x9c(%rbp), %edi
movl -0x98(%rbp), %esi
movsd -0x78(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
callq 0x42230
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x18(%rbp), %rdi
movl -0x90(%rbp), %esi
addl -0x84(%rbp), %esi
subl $0x1, %esi
cvttsd2si -0x68(%rbp), %edx
movl -0x90(%rbp), %ecx
addl -0x84(%rbp), %ecx
cvttsd2si -0x70(%rbp), %r8d
callq 0x32a70
jmp 0x34f8e
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x34e18
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x31ae0
jmp 0x35285
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x88(%rbp), %eax
jg 0x35283
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
cvtsi2sdl -0x84(%rbp), %xmm0
cvtsi2sdl -0x88(%rbp), %xmm2
movsd 0xada86(%rip), %xmm1    # 0xe2a80
divsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0xaf8ae(%rip), %xmm1    # 0xe48b8
addsd %xmm1, %xmm0
leaq 0x3acf63(%rip), %rax    # 0x3e1f78
movq (%rax), %rax
subsd (%rax), %xmm0
movsd %xmm0, -0xc8(%rbp)
leaq 0x3acf7d(%rip), %rax    # 0x3e1fa8
movq (%rax), %rax
movsd (%rax), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0xc8(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movsd (%rax), %xmm1
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rax
movsd (%rax), %xmm0
movsd -0x60(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x42a0
movaps %xmm0, %xmm2
movsd -0xc0(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
cmpl $0x0, -0x84(%rbp)
je 0x35158
movsd -0x40(%rbp), %xmm1
movsd -0x80(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x35158
movsd -0x40(%rbp), %xmm0
ucomisd -0x78(%rbp), %xmm0
jb 0x35158
movsd -0x48(%rbp), %xmm0
movl -0x9c(%rbp), %edi
movl -0x98(%rbp), %esi
movsd -0x78(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
callq 0x42230
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x40(%rbp), %xmm0
movl -0x9c(%rbp), %edi
movl -0x98(%rbp), %esi
movsd -0x78(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
callq 0x42230
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x18(%rbp), %rdi
movl -0x90(%rbp), %esi
addl -0x84(%rbp), %esi
subl $0x1, %esi
cvttsd2si -0x68(%rbp), %edx
movl -0x90(%rbp), %ecx
addl -0x84(%rbp), %ecx
cvttsd2si -0x70(%rbp), %r8d
callq 0x32a70
cmpl $0x7de, -0x28(%rbp)     # imm = 0x7DE
jne 0x3526d
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x31ae0
movq -0x20(%rbp), %rdi
movsd -0x60(%rbp), %xmm0
callq 0xbe9f0
movsd %xmm0, -0xd0(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x42a0
movaps %xmm0, %xmm2
movsd -0xd0(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
cmpl $0x0, -0x84(%rbp)
je 0x35262
movsd -0x50(%rbp), %xmm1
movsd -0x80(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x35262
movsd -0x50(%rbp), %xmm0
ucomisd -0x78(%rbp), %xmm0
jb 0x35262
movsd -0x58(%rbp), %xmm0
movl -0x9c(%rbp), %edi
movl -0x98(%rbp), %esi
movsd -0x78(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
callq 0x42230
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x50(%rbp), %xmm0
movl -0x9c(%rbp), %edi
movl -0x98(%rbp), %esi
movsd -0x78(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
callq 0x42230
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x18(%rbp), %rdi
movl -0x90(%rbp), %esi
addl -0x84(%rbp), %esi
subl $0x1, %esi
cvttsd2si -0x68(%rbp), %edx
movl -0x90(%rbp), %ecx
addl -0x84(%rbp), %ecx
cvttsd2si -0x70(%rbp), %r8d
callq 0x32a70
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x31ae0
jmp 0x3526f
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x34fbc
jmp 0x35285
addq $0xe0, %rsp
popq %rbp
retq
nop