// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/plot.c
// Function: polyplot
void polyplot(double start, double end, char* polynomial, int color, int sig) 
{
 /*!Last Changed 20.09.2006*/
 /*!Last Changed 08.10.2004 added img.xaxis.lim and img.yaxis.lim*/
 int i;
 double minvaluey = +LONG_MAX, maxvaluey = -LONG_MAX, valuey, valuex;
 Point p1, p2;
 char st2[3]; 
 Polynomptr p = read_polynom(polynomial);
 Objectptr obj;
 if (!get_parameter_o("hold"))
   clear_image();
 add_legend((char)('A' + color), polynomial);
 img.yaxis.available = 1;
 for (i = 0; i <= PARTITIONS; i++)
  {
   valuex = start + i * ((end - start) / PARTITIONS);
   valuey = polynom_value(p, valuex);
   if (img.yaxis.lim.min >= img.yaxis.lim.max)
    {
     if (valuey < minvaluey)
       minvaluey = valuey;
     if (valuey > maxvaluey)
       maxvaluey = valuey;
    }
  }
 if (img.yaxis.lim.min >= img.yaxis.lim.max)
  {
   img.yaxis.lim.min = minvaluey;
   img.yaxis.lim.max = maxvaluey;
  }
 if (img.xaxis.lim.min >= img.xaxis.lim.max)
  {
   img.xaxis.lim.min = start;
   img.xaxis.lim.max = end;
  }
 p1.x = start;
 p1.y = (polynom_value(p, p1.x));
 if (sig)
   p1.y = sigmoid(p1.y);
 sprintf(st2, "%c", 'A' + color);
 for (i = 1; i <= PARTITIONS; i++)
  {
   p2.x = (start + i * ((end - start) / PARTITIONS));
   p2.y = (polynom_value(p, p1.x));
   if (sig)
     p2.y = sigmoid(p2.y);
   obj = add_object(OBJECT_LINE, p1, p2, dummyp, st2);
   obj->fnt.fontcolor = color;
   p1.x = p2.x;
   p1.y = p2.y;
  }
 free_polynom(p);
 export_image();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r12
movsd %xmm1, 0x18(%rsp)
movsd %xmm0, 0x8(%rsp)
callq 0x5b29e
movq %rax, %r15
leaq 0x52101(%rip), %rdi     # 0xaa7b5
callq 0x54bec
testl %eax, %eax
jne 0x586c4
xorl %eax, %eax
callq 0x2e342
leal 0x41(%r14), %ebp
movsbl %bpl, %edi
movq %r12, %rsi
callq 0x2cbc4
leaq 0x3599dd(%rip), %r12    # 0x3b20b8
movsd 0x18(%rsp), %xmm0
movsd 0x8(%rsp), %xmm4
subsd %xmm4, %xmm0
divsd 0x4f725(%rip), %xmm0    # 0xa7e18
movsd %xmm0, 0x28(%rsp)
movl $0x1, 0x78(%r12)
movsd 0x4d6be(%rip), %xmm5    # 0xa5dc8
movsd 0x4dc1e(%rip), %xmm6    # 0xa6330
xorl %r13d, %r13d
movsd %xmm6, 0x20(%rsp)
movsd %xmm5, 0x10(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
mulsd 0x28(%rsp), %xmm0
addsd %xmm4, %xmm0
movq %r15, %rdi
callq 0x5aba9
movsd 0x80(%r12), %xmm1
movsd 0x88(%r12), %xmm2
ucomisd %xmm2, %xmm1
jae 0x58769
incl %r13d
cmpl $0x1f5, %r13d           # imm = 0x1F5
movsd 0x8(%rsp), %xmm4
jne 0x58721
jmp 0x587b5
movapd %xmm0, %xmm3
minsd 0x20(%rsp), %xmm3
maxsd 0x10(%rsp), %xmm0
leal 0x1(%r13), %eax
movapd %xmm3, %xmm6
movapd %xmm0, %xmm5
cmpl $0x1f4, %r13d           # imm = 0x1F4
movl %eax, %r13d
movsd 0x8(%rsp), %xmm4
jne 0x58715
ucomisd %xmm2, %xmm1
jb 0x587b5
movsd %xmm3, 0x80(%r12)
movsd %xmm0, 0x88(%r12)
movsd 0x10(%r12), %xmm0
ucomisd 0x18(%r12), %xmm0
jb 0x587d9
movsd %xmm4, 0x10(%r12)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%r12)
movq %r15, %rdi
movapd %xmm4, %xmm0
callq 0x5aba9
testl %ebx, %ebx
je 0x587ee
callq 0x55a80
leaq 0x35(%rsp), %r12
movb %bpl, (%r12)
movb $0x0, 0x1(%r12)
movsd 0x4cd1b(%rip), %xmm1    # 0xa5520
movl $0x1f4, %ebp            # imm = 0x1F4
movsd 0x8(%rsp), %xmm2
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x20(%rsp)
movq %r15, %rdi
movsd %xmm2, 0x18(%rsp)
movapd %xmm2, %xmm0
callq 0x5aba9
movapd %xmm0, %xmm3
testl %ebx, %ebx
je 0x58843
movapd %xmm3, %xmm0
callq 0x55a80
movapd %xmm0, %xmm3
movsd 0x10(%rsp), %xmm2
mulsd 0x28(%rsp), %xmm2
addsd 0x8(%rsp), %xmm2
movsd %xmm2, 0x40(%rsp)
movsd 0x7c80d(%rip), %xmm4    # 0xd5070
movsd 0x7c80d(%rip), %xmm5    # 0xd5078
xorl %edi, %edi
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd %xmm3, 0x38(%rsp)
movq %r12, %rsi
callq 0x2cc6c
movl %r14d, 0x18(%rax)
movsd 0x10(%rsp), %xmm1
addsd 0x4cc87(%rip), %xmm1    # 0xa5520
movsd 0x40(%rsp), %xmm2
movsd 0x38(%rsp), %xmm0
decl %ebp
jne 0x58810
movq %r15, %rdi
callq 0x5ac26
xorl %eax, %eax
callq 0x2e6d0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq