// File: /workspace/github_c_makefile_star2_O3/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:
testq %rsi, %rsi
je 0x2394c
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)
movl %edx, 0x4(%rsp)
leaq 0x38e9f7(%rip), %rax    # 0x3b20b8
movl (%rax), %ecx
movl 0x4(%rax), %esi
movl %esi, %eax
cltd
idivl 0x14(%rsp)
movl %eax, %r12d
movl %ecx, %eax
cltd
movq %rbx, %r8
idivl %ebp
movl %eax, %edi
movl %esi, %eax
cltd
idivl %r8d
xorps %xmm2, %xmm2
cvtsi2sdl 0x134(%r14), %xmm2
xorps %xmm3, %xmm3
cvtsi2sd %eax, %xmm3
movsd 0x8261d(%rip), %xmm1    # 0xa5d18
addsd %xmm1, %xmm2
movsd %xmm3, 0x8(%rsp)
mulsd %xmm3, %xmm2
xorps %xmm3, %xmm3
cvtsi2sd %ecx, %xmm3
xorps %xmm0, %xmm0
cvtsi2sdl 0x138(%r14), %xmm0
xorps %xmm4, %xmm4
cvtsi2sd %edi, %xmm4
addsd %xmm1, %xmm0
movsd %xmm4, 0x30(%rsp)
mulsd %xmm4, %xmm0
movsd %xmm2, 0x18(%rsp)
cvttsd2si %xmm2, %r13d
subsd %xmm0, %xmm3
movsd %xmm3, 0x20(%rsp)
cvttsd2si %xmm3, %ebp
leal (%r12,%r13), %edx
movq %r15, %rdi
leaq 0x848e3(%rip), %rsi     # 0xa803b
movl %ebp, %ecx
xorl %eax, %eax
callq 0x42e0
movq %r15, %rdi
leaq 0x848de(%rip), %rsi     # 0xa8049
movl %r12d, %edx
movl %r13d, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x42e0
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x238a2
xorps %xmm2, %xmm2
cvtsi2sdl 0x134(%rax), %xmm2
movsd 0x8257d(%rip), %xmm1    # 0xa5d18
addsd %xmm1, %xmm2
leaq 0x38e912(%rip), %rcx    # 0x3b20b8
xorps %xmm3, %xmm3
cvtsi2sdl (%rcx), %xmm3
xorps %xmm0, %xmm0
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 0x2e628
movsd 0x28(%rsp), %xmm7
movapd %xmm7, %xmm2
movsd 0x18(%rsp), %xmm5
subsd %xmm5, %xmm2
andpd 0x829db(%rip), %xmm2    # 0xa61e0
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
mulsd %xmm1, %xmm2
divsd %xmm0, %xmm2
cvttpd2dq %xmm2, %xmm2
movq 0x18(%r14), %rax
cvtdq2pd %xmm2, %xmm4
movapd %xmm4, %xmm2
xorpd 0x829a3(%rip), %xmm2    # 0xa61d0
movapd %xmm4, %xmm3
cmpq %r14, (%rax)
je 0x2383a
movapd %xmm2, %xmm3
je 0x23840
movapd %xmm4, %xmm2
movsd 0x8(%rsp), %xmm8
movapd %xmm8, %xmm4
movsd 0x20(%rsp), %xmm6
subsd %xmm6, %xmm4
andpd 0x82982(%rip), %xmm4    # 0xa61e0
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, %edx
cvttsd2si %xmm6, %ecx
cvttsd2si %xmm7, %r8d
cvttsd2si %xmm8, %r9d
movq %r15, %rdi
leaq 0x847bf(%rip), %rsi     # 0xa805a
xorl %eax, %eax
callq 0x42e0
movslq 0x30(%r14), %rcx
testq %rcx, %rcx
js 0x238c6
leaq 0xb1fbe(%rip), %rax     # 0xd5870
movq (%rax), %rax
imulq $0x340, %rcx, %rcx      # imm = 0x340
cmpl $0x1, 0x30f08(%rax,%rcx)
je 0x238e8
movq (%r14), %rsi
movq %r15, %rdi
movl 0x4(%rsp), %ebp
movl %ebp, %edx
movl %ebx, %ecx
callq 0x2368e
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x236ba
jmp 0x2393e
addq $0x30f08, %rax          # imm = 0x30F08
cmpl $0x0, 0x18(%rax,%rcx)
movl 0x4(%rsp), %ebp
jle 0x2393e
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x10(%r14), %rsi
addq %r12, %rsi
movq %r15, %rdi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x2368e
incq %r13
leaq 0xb1f54(%rip), %rax     # 0xd5870
movq (%rax), %rax
movslq 0x30(%r14), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movslq 0x30f20(%rax,%rcx), %rax
addq $0x160, %r12            # imm = 0x160
cmpq %rax, %r13
jl 0x238ff
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq