// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movsd %xmm1, 0x30(%rsp)
movsd %xmm0, 0x28(%rsp)
movl %r8d, %ebx
movl %ecx, %r14d
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
leal (%r14,%r14), %ecx
movl $0x244, %eax            # imm = 0x244
xorl %edx, %edx
idivl %ecx
movl %eax, %r13d
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x10(%rsp)
testq %r15, %r15
je 0x22825
leaq 0x387a64(%rip), %rax    # 0x3aa0b8
movl (%rax), %ecx
movl %ecx, %eax
cltd
idivl %ebp
movl %eax, %esi
movl $0x244, %eax            # imm = 0x244
xorl %edx, %edx
idivl %r14d
cvtsi2sdl 0x90(%r15), %xmm3
movsd 0x736a8(%rip), %xmm1    # 0x95d20
addsd %xmm1, %xmm3
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x8(%rsp)
mulsd %xmm0, %xmm3
movsd 0x756de(%rip), %xmm2    # 0x97d70
addsd %xmm2, %xmm3
cvtsi2sd %ecx, %xmm4
cvtsi2sdl 0x94(%r15), %xmm0
cvtsi2sd %esi, %xmm5
addsd %xmm1, %xmm0
movsd %xmm5, 0x40(%rsp)
mulsd %xmm5, %xmm0
subsd %xmm0, %xmm4
addsd %xmm2, %xmm4
movsd %xmm3, 0x18(%rsp)
cvttsd2si %xmm3, %esi
movsd %xmm4, 0x20(%rsp)
cvttsd2si %xmm4, %edx
movq %r12, %rdi
movl %r13d, %ecx
callq 0x208a3
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x227fd
cvtsi2sdl 0x90(%rax), %xmm3
movsd 0x73627(%rip), %xmm1    # 0x95d20
addsd %xmm1, %xmm3
mulsd 0x8(%rsp), %xmm3
movsd 0x75665(%rip), %xmm4    # 0x97d70
addsd %xmm4, %xmm3
movapd %xmm3, %xmm2
movsd %xmm3, 0x38(%rsp)
leaq 0x387998(%rip), %rcx    # 0x3aa0b8
cvtsi2sdl (%rcx), %xmm3
cvtsi2sdl 0x94(%rax), %xmm0
addsd %xmm1, %xmm0
mulsd 0x40(%rsp), %xmm0
subsd %xmm0, %xmm3
addsd %xmm4, %xmm3
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd %xmm3, 0x8(%rsp)
callq 0x2a7b3
movsd 0x38(%rsp), %xmm6
movapd %xmm6, %xmm1
movsd 0x18(%rsp), %xmm4
subsd %xmm4, %xmm1
andpd 0x73a6f(%rip), %xmm1    # 0x961e0
mulsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
cvttpd2dq %xmm1, %xmm1
movq 0x18(%r15), %rax
cvtdq2pd %xmm1, %xmm1
movapd %xmm1, %xmm3
xorpd 0x73a3d(%rip), %xmm3    # 0x961d0
movapd %xmm3, %xmm2
cmpq %r15, (%rax)
je 0x227a0
movapd %xmm1, %xmm2
je 0x227a6
movapd %xmm3, %xmm1
movsd 0x8(%rsp), %xmm7
movapd %xmm7, %xmm3
movsd 0x20(%rsp), %xmm5
subsd %xmm5, %xmm3
andpd 0x73a1e(%rip), %xmm3    # 0x961e0
mulsd 0x10(%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, %esi
cvttsd2si %xmm5, %edx
cvttsd2si %xmm6, %ecx
cvttsd2si %xmm7, %r8d
movq %r12, %rdi
callq 0x20866
movq (%r15), %rsi
movq %r12, %rdi
movl %ebp, %edx
movl %r14d, %ecx
movl %ebx, %r8d
movsd 0x28(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
callq 0x22602
movq 0x8(%r15), %r15
jmp 0x22644
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq