// File: /workspace/github_c_makefile_star2_O1/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, 0x10(%rsp)
movsd %xmm0, 0x28(%rsp)
callq 0x59d2a
movq %rax, %r15
leaq 0x505aa(%rip), %rdi     # 0xa7715
callq 0x536e7
testl %eax, %eax
jne 0x5717b
xorl %eax, %eax
callq 0x2da74
leal 0x41(%r14), %ebp
movsbl %bpl, %edi
movq %r12, %rsi
callq 0x2c324
leaq 0x357f26(%rip), %r12    # 0x3af0b8
movl $0x1, 0x78(%r12)
movsd 0x10(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
subsd %xmm1, %xmm0
divsd 0x4dbdd(%rip), %xmm0    # 0xa4d90
movsd %xmm0, 0x30(%rsp)
movsd 0x4bc07(%rip), %xmm0    # 0xa2dc8
movsd %xmm0, 0x18(%rsp)
movsd 0x4c161(%rip), %xmm0    # 0xa3330
movsd %xmm0, 0x8(%rsp)
xorpd %xmm0, %xmm0
movl $0x1f5, %r13d           # imm = 0x1F5
movsd %xmm0, 0x20(%rsp)
mulsd 0x30(%rsp), %xmm0
addsd %xmm1, %xmm0
movq %r15, %rdi
callq 0x59606
movsd 0x80(%r12), %xmm1
ucomisd 0x88(%r12), %xmm1
jb 0x5722b
movapd %xmm0, %xmm1
minsd 0x8(%rsp), %xmm1
ucomisd 0x18(%rsp), %xmm0
jbe 0x57225
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm2
movsd 0x20(%rsp), %xmm0
addsd 0x4b2e1(%rip), %xmm0    # 0xa2520
decl %r13d
movsd 0x28(%rsp), %xmm1
jne 0x571df
movsd 0x80(%r12), %xmm0
ucomisd 0x88(%r12), %xmm0
jb 0x57280
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x80(%r12)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x88(%r12)
movsd 0x10(%r12), %xmm0
ucomisd 0x18(%r12), %xmm0
jb 0x5729e
movsd %xmm1, 0x10(%r12)
movsd %xmm2, 0x18(%r12)
movq %r15, %rdi
movapd %xmm1, %xmm0
callq 0x59606
movapd %xmm0, %xmm1
testl %ebx, %ebx
je 0x572bf
movapd %xmm1, %xmm0
callq 0x54568
movapd %xmm0, %xmm1
leaq 0x3d(%rsp), %r12
movb %bpl, (%r12)
movb $0x0, 0x1(%r12)
movl $0x1f4, %ebp            # imm = 0x1F4
movsd 0x4b245(%rip), %xmm2    # 0xa2520
movsd 0x28(%rsp), %xmm0
movsd %xmm2, 0x20(%rsp)
movsd %xmm1, 0x10(%rsp)
movq %r15, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0x59606
movaps %xmm0, %xmm3
testl %ebx, %ebx
je 0x5730d
movaps %xmm3, %xmm0
callq 0x54568
movaps %xmm0, %xmm3
movsd 0x20(%rsp), %xmm2
mulsd 0x30(%rsp), %xmm2
addsd 0x28(%rsp), %xmm2
movsd %xmm2, 0x18(%rsp)
movsd 0x7ad43(%rip), %xmm4    # 0xd2070
movsd 0x7ad43(%rip), %xmm5    # 0xd2078
xorl %edi, %edi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd %xmm3, 0x40(%rsp)
movq %r12, %rsi
callq 0x2c3cc
movl %r14d, 0x18(%rax)
movsd 0x20(%rsp), %xmm2
addsd 0x4b1bd(%rip), %xmm2    # 0xa2520
movsd 0x18(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
decl %ebp
jne 0x572e1
movq %r15, %rdi
callq 0x59683
xorl %eax, %eax
callq 0x2de4a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq