// File: /workspace/github_c_makefile_star2_O2/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 0x530be
movq %rax, %r15
leaq 0x49dab(%rip), %rdi     # 0x9a6e5
callq 0x4cff1
testl %eax, %eax
jne 0x5094a
xorl %eax, %eax
callq 0x2a510
leal 0x41(%r14), %ebp
movsbl %bpl, %edi
movq %r12, %rsi
callq 0x28ee8
leaq 0x359757(%rip), %r12    # 0x3aa0b8
movl $0x1, 0x78(%r12)
movsd 0x10(%rsp), %xmm2
movapd %xmm2, %xmm0
movsd 0x28(%rsp), %xmm1
subsd %xmm1, %xmm0
divsd 0x47412(%rip), %xmm0    # 0x97d98
movsd %xmm0, 0x30(%rsp)
xorpd %xmm3, %xmm3
movsd 0x45998(%rip), %xmm4    # 0x96330
movsd 0x45430(%rip), %xmm0    # 0x95dd0
movsd %xmm0, 0x18(%rsp)
movl $0x1f5, %r13d           # imm = 0x1F5
subl $0x1, %r13d
jb 0x50a2a
movsd %xmm4, 0x20(%rsp)
movsd %xmm3, 0x8(%rsp)
movapd %xmm3, %xmm0
mulsd 0x30(%rsp), %xmm0
addsd %xmm1, %xmm0
movq %r15, %rdi
callq 0x5298b
movsd 0x80(%r12), %xmm1
ucomisd 0x88(%r12), %xmm1
jae 0x509f2
movsd 0x20(%rsp), %xmm1
jmp 0x50a0a
movapd %xmm0, %xmm1
minsd 0x20(%rsp), %xmm1
ucomisd 0x18(%rsp), %xmm0
jbe 0x50a0a
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm3
addsd 0x44b02(%rip), %xmm3    # 0x95520
movapd %xmm1, %xmm4
movsd 0x28(%rsp), %xmm1
jmp 0x509ac
movsd 0x80(%r12), %xmm0
ucomisd 0x88(%r12), %xmm0
jb 0x50a5a
movsd %xmm4, 0x80(%r12)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x88(%r12)
movsd 0x10(%r12), %xmm0
ucomisd 0x18(%r12), %xmm0
jb 0x50a78
movsd %xmm1, 0x10(%r12)
movsd %xmm2, 0x18(%r12)
movq %r15, %rdi
movapd %xmm1, %xmm0
callq 0x5298b
movapd %xmm0, %xmm1
testl %ebx, %ebx
je 0x50a99
movapd %xmm1, %xmm0
callq 0x4dd58
movapd %xmm0, %xmm1
leaq 0x3d(%rsp), %r12
movb %bpl, (%r12)
movb $0x0, 0x1(%r12)
movl $0x1f4, %ebp            # imm = 0x1F4
movsd 0x28(%rsp), %xmm2
movsd 0x44a65(%rip), %xmm0    # 0x95520
subl $0x1, %ebp
jb 0x50b5e
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, 0x20(%rsp)
movq %r15, %rdi
movsd %xmm2, 0x10(%rsp)
movapd %xmm2, %xmm0
callq 0x5298b
movapd %xmm0, %xmm3
testl %ebx, %ebx
je 0x50af7
movapd %xmm3, %xmm0
callq 0x4dd58
movapd %xmm0, %xmm3
movsd 0x8(%rsp), %xmm2
mulsd 0x30(%rsp), %xmm2
addsd 0x28(%rsp), %xmm2
movsd %xmm2, 0x18(%rsp)
movsd 0x7c559(%rip), %xmm4    # 0xcd070
movsd 0x7c559(%rip), %xmm5    # 0xcd078
xorl %edi, %edi
movsd 0x10(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd %xmm3, 0x40(%rsp)
movq %r12, %rsi
callq 0x28f8d
movl %r14d, 0x18(%rax)
movsd 0x8(%rsp), %xmm0
addsd 0x449d3(%rip), %xmm0    # 0x95520
movsd 0x40(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
jmp 0x50abb
movq %r15, %rdi
callq 0x52a0f
xorl %eax, %eax
callq 0x2a858
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq