// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/eps.c
// Function: plot_regression_node
void plot_regression_node(FILE* outfile, Regressionnodeptr rootnode, int maxdepth, int maxwidth, int algorithm, double outputmean, double outputvariance)
{
 int dx, dy, radius = (epsaxis + MARGIN) / (WIDTHFACTOR * maxwidth), node_width = (epsaxis + MARGIN) / maxwidth, node_height = img.height / maxdepth;
 double l;
 Point p1, p2, parent;
 if (rootnode)
  {
   p1.x = MARGIN / 2 + (rootnode->x + 0.5) * node_width;
   p1.y = img.height - (rootnode->y + 0.5) * node_height + MARGIN / 2;
   write_circle(outfile, p1.x, p1.y, radius);
   if (rootnode->parent)
    {
     parent.x = MARGIN / 2 + (rootnode->parent->x + 0.5) * node_width;
     parent.y = img.height - (rootnode->parent->y + 0.5) * node_height + MARGIN / 2;
     l = point_to_point_distance(p1, parent);
     dx = fabs(parent.x - p1.x) * radius / l;
     dy = fabs(parent.y - p1.y) * radius / l;
     if (rootnode == rootnode->parent->left)
      {  
       p1.x = p1.x + dx;
       p2.x = parent.x - dx;
      }
     else
      {
       p1.x = p1.x - dx;
       p2.x = parent.x + dx;      
      }
     p1.y = p1.y + dy;
     p2.y = parent.y - dy;
     write_line(outfile, p1.x, p1.y, p2.x, p2.y);
    }
   plot_regression_node(outfile, rootnode->left, maxdepth, maxwidth, algorithm, outputmean, outputvariance);
   plot_regression_node(outfile, rootnode->right, maxdepth, maxwidth, algorithm, outputmean, outputvariance);
  }  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movsd %xmm1, 0x48(%rsp)
movsd %xmm0, 0x40(%rsp)
movl %r8d, 0x14(%rsp)
movl %edx, %ebp
movq %rcx, 0x18(%rsp)
addl %ecx, %ecx
movl $0x244, %eax            # imm = 0x244
xorl %edx, %edx
idivl %ecx
testq %rsi, %rsi
je 0x257dc
movq %rsi, %r15
movq %rdi, %r12
movl %eax, %r13d
movl $0x244, %eax            # imm = 0x244
xorl %edx, %edx
idivl 0x18(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x20(%rsp)
leaq 0x38cae8(%rip), %rax    # 0x3b20b8
movl (%rax), %ecx
movl %ecx, %eax
cltd
idivl %ebp
xorps %xmm3, %xmm3
cvtsi2sdl 0x90(%r15), %xmm3
movsd 0x8072d(%rip), %xmm1    # 0xa5d18
addsd %xmm1, %xmm3
mulsd 0x28(%rsp), %xmm3
movsd 0x827f3(%rip), %xmm2    # 0xa7df0
addsd %xmm2, %xmm3
xorps %xmm4, %xmm4
cvtsi2sd %ecx, %xmm4
xorps %xmm0, %xmm0
cvtsi2sdl 0x94(%r15), %xmm0
addsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd %xmm1, 0x8(%rsp)
mulsd %xmm1, %xmm0
subsd %xmm0, %xmm4
movsd %xmm3, 0x30(%rsp)
cvttsd2si %xmm3, %ebx
addsd %xmm2, %xmm4
movsd %xmm4, 0x38(%rsp)
cvttsd2si %xmm4, %r14d
leal (%r13,%rbx), %edx
movq %r12, %rdi
leaq 0x829e6(%rip), %rsi     # 0xa803b
movl %r14d, %ecx
xorl %eax, %eax
callq 0x42e0
movq %r12, %rdi
leaq 0x829e0(%rip), %rsi     # 0xa8049
movl %r13d, %edx
movl %ebx, %ecx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x42e0
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x257ac
xorps %xmm3, %xmm3
cvtsi2sdl 0x90(%rax), %xmm3
movsd 0x80680(%rip), %xmm1    # 0xa5d18
addsd %xmm1, %xmm3
mulsd 0x28(%rsp), %xmm3
movsd 0x82746(%rip), %xmm4    # 0xa7df0
addsd %xmm4, %xmm3
movapd %xmm3, %xmm2
movsd %xmm3, 0x50(%rsp)
leaq 0x38c9f9(%rip), %rcx    # 0x3b20b8
xorps %xmm3, %xmm3
cvtsi2sdl (%rcx), %xmm3
xorps %xmm0, %xmm0
cvtsi2sdl 0x94(%rax), %xmm0
addsd %xmm1, %xmm0
mulsd 0x8(%rsp), %xmm0
subsd %xmm0, %xmm3
addsd %xmm4, %xmm3
movsd 0x30(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movsd %xmm3, 0x8(%rsp)
callq 0x2e628
movsd 0x50(%rsp), %xmm6
movapd %xmm6, %xmm1
movsd 0x30(%rsp), %xmm4
subsd %xmm4, %xmm1
andpd 0x80aca(%rip), %xmm1    # 0xa61e0
mulsd 0x20(%rsp), %xmm1
divsd %xmm0, %xmm1
cvttpd2dq %xmm1, %xmm1
movq 0x18(%r15), %rax
cvtdq2pd %xmm1, %xmm1
movapd %xmm1, %xmm3
xorpd 0x80a98(%rip), %xmm3    # 0xa61d0
movapd %xmm3, %xmm2
cmpq %r15, (%rax)
je 0x25745
movapd %xmm1, %xmm2
je 0x2574b
movapd %xmm3, %xmm1
movsd 0x8(%rsp), %xmm7
movapd %xmm7, %xmm3
movsd 0x38(%rsp), %xmm5
subsd %xmm5, %xmm3
andpd 0x80a79(%rip), %xmm3    # 0xa61e0
mulsd 0x20(%rsp), %xmm3
divsd %xmm0, %xmm3
addsd %xmm2, %xmm6
addsd %xmm1, %xmm4
cvttpd2dq %xmm3, %xmm0
cvtdq2pd %xmm0, %xmm0
addsd %xmm0, %xmm5
subsd %xmm0, %xmm7
cvttsd2si %xmm4, %edx
cvttsd2si %xmm5, %ecx
cvttsd2si %xmm6, %r8d
cvttsd2si %xmm7, %r9d
movq %r12, %rdi
leaq 0x828b5(%rip), %rsi     # 0xa805a
xorl %eax, %eax
callq 0x42e0
movq (%r15), %rsi
movq %r12, %rdi
movl %ebp, %edx
movq 0x18(%rsp), %rcx
movl 0x14(%rsp), %r8d
movsd 0x40(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
callq 0x25560
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x255c9
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq