// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/eps.c
// Function: plot_decision_node
void plot_decision_node(FILE* outfile, Decisionnodeptr rootnode, int maxdepth, int maxwidth)
{
 int i, dx, dy, radius = img.width / (5 * maxwidth), node_width = img.width / maxwidth, node_height = img.height / maxdepth;
 double l;
 Point p1, p2, parent;
 if (rootnode)
  {
   p1.x = (rootnode->x + 0.5) * node_width;
   p1.y = img.height - (rootnode->y + 0.5) * node_height;
   write_circle(outfile, p1.x, p1.y, radius);
   if (rootnode->parent)
    {
     parent.x = (rootnode->parent->x + 0.5) * node_width;
     parent.y = img.height - (rootnode->parent->y + 0.5) * node_height;
     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);
    }
   if (rootnode->featureno >= 0 && current_dataset->features[rootnode->featureno].type == STRING)
     for (i = 0; i < current_dataset->features[rootnode->featureno].valuecount; i++)
       plot_decision_node(outfile, &(rootnode->string[i]), maxdepth, maxwidth);
   else
    {
     plot_decision_node(outfile, rootnode->left, maxdepth, maxwidth);
     plot_decision_node(outfile, rootnode->right, maxdepth, maxwidth);    
    }
  } 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leal (%rbx,%rbx,4), %eax
movl %eax, 0x14(%rsp)
leaq 0x3895d5(%rip), %r13    # 0x3aa0b8
movl 0x4(%r13), %ecx
movl %ecx, %eax
cltd
idivl 0x14(%rsp)
testq %r14, %r14
je 0x20d00
movl %eax, %r12d
movl (%r13), %esi
movl %esi, %eax
cltd
idivl %ebp
movl %eax, %edi
movl %ecx, %eax
cltd
idivl %ebx
cvtsi2sdl 0x134(%r14), %xmm2
movsd 0x75205(%rip), %xmm1    # 0x95d20
addsd %xmm1, %xmm2
cvtsi2sd %eax, %xmm0
cvtsi2sd %esi, %xmm3
movsd %xmm0, 0x8(%rsp)
mulsd %xmm0, %xmm2
cvtsi2sdl 0x138(%r14), %xmm0
addsd %xmm1, %xmm0
cvtsi2sd %edi, %xmm1
movsd %xmm1, 0x30(%rsp)
mulsd %xmm1, %xmm0
subsd %xmm0, %xmm3
movsd %xmm2, 0x18(%rsp)
cvttsd2si %xmm2, %esi
movsd %xmm3, 0x20(%rsp)
cvttsd2si %xmm3, %edx
movq %r15, %rdi
movl %r12d, %ecx
callq 0x208a3
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x20c7b
cvtsi2sdl 0x134(%rax), %xmm2
movsd 0x75194(%rip), %xmm1    # 0x95d20
addsd %xmm1, %xmm2
cvtsi2sdl (%r13), %xmm3
cvtsi2sdl 0x138(%rax), %xmm0
mulsd 0x8(%rsp), %xmm2
movsd %xmm2, 0x28(%rsp)
addsd %xmm1, %xmm0
mulsd 0x30(%rsp), %xmm0
subsd %xmm0, %xmm3
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd %xmm3, 0x8(%rsp)
callq 0x2a7b3
movsd 0x28(%rsp), %xmm7
movapd %xmm7, %xmm2
movsd 0x18(%rsp), %xmm5
subsd %xmm5, %xmm2
andpd 0x755f5(%rip), %xmm2    # 0x961e0
cvtsi2sd %r12d, %xmm1
mulsd %xmm1, %xmm2
divsd %xmm0, %xmm2
cvttpd2dq %xmm2, %xmm2
movq 0x18(%r14), %rax
cvtdq2pd %xmm2, %xmm4
movapd %xmm4, %xmm2
xorpd 0x755c0(%rip), %xmm2    # 0x961d0
movapd %xmm4, %xmm3
cmpq %r14, (%rax)
je 0x20c1d
movapd %xmm2, %xmm3
je 0x20c23
movapd %xmm4, %xmm2
movsd 0x8(%rsp), %xmm8
movapd %xmm8, %xmm4
movsd 0x20(%rsp), %xmm6
subsd %xmm6, %xmm4
andpd 0x7559f(%rip), %xmm4    # 0x961e0
mulsd %xmm1, %xmm4
divsd %xmm0, %xmm4
addsd %xmm3, %xmm5
addsd %xmm2, %xmm7
cvttpd2dq %xmm4, %xmm0
cvtdq2pd %xmm0, %xmm0
addsd %xmm0, %xmm6
subsd %xmm0, %xmm8
cvttsd2si %xmm5, %esi
cvttsd2si %xmm6, %edx
cvttsd2si %xmm7, %ecx
cvttsd2si %xmm8, %r8d
movq %r15, %rdi
callq 0x20866
movslq 0x30(%r14), %rax
testq %rax, %rax
js 0x20c9f
leaq 0xacbe5(%rip), %rcx     # 0xcd870
movq (%rcx), %rcx
imulq $0x340, %rax, %rdx      # imm = 0x340
cmpl $0x1, 0x30f08(%rcx,%rdx)
je 0x20cb7
movq (%r14), %rsi
movq %r15, %rdi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x20abd
movq 0x8(%r14), %r14
jmp 0x20ae3
xorl %r12d, %r12d
xorl %r13d, %r13d
cltq
imulq $0x340, %rax, %rax      # imm = 0x340
movslq 0x30f20(%rcx,%rax), %rax
cmpq %rax, %r13
jge 0x20d00
movq 0x10(%r14), %rsi
addq %r12, %rsi
movq %r15, %rdi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x20abd
incq %r13
leaq 0xacb80(%rip), %rax     # 0xcd870
movq (%rax), %rcx
movl 0x30(%r14), %eax
addq $0x160, %r12            # imm = 0x160
jmp 0x20cbd
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq