// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/plot.c
// Function: functionplot
void functionplot(char* functiondefinition, int color)
{
 /*!Last Changed 20.09.2006*/
 /*!Last Changed 21.01.2005*/
 int i, functioncount;
 double minvaluey = +LONG_MAX, maxvaluey = -LONG_MAX, valuey, valuex, start, end;
 char st2[3], *legendname; 
 Point p1, p2;
 Functionptr fx = read_function_definition(functiondefinition, &functioncount);
 Objectptr obj;
 if (!get_parameter_o("hold"))
   clear_image();
 legendname = file_only_name(functiondefinition);
 add_legend((char)('A' + color), legendname);
 safe_free(legendname);
 img.yaxis.available = 1;
 find_function_bounds(fx, functioncount, &start, &end);
 for (i = 0; i <= PARTITIONS; i++)
  {
   valuex = start + i * ((end - start) / PARTITIONS);
   valuey = function_value(fx, functioncount, 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 = (double) start;
 p1.y = (double) (function_value(fx, functioncount, p1.x));
 sprintf(st2, "%c", 'A' + color);
 for (i = 1; i <= PARTITIONS; i++)
  {
   p2.x = (double) (start + i * ((end - start) / PARTITIONS));
   p2.y = (double) (function_value(fx, functioncount, p1.x));
   obj = add_object(OBJECT_LINE, p1, p2, dummyp, st2);
   obj->fnt.fontcolor = color;
   p1.x = p2.x;
   p1.y = p2.y;
  }
 for (i = 0;i < functioncount; i++)
   free_function(fx[i]);
 safe_free(fx);
 export_image();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movsd 0x65096(%rip), %xmm0    # 0xe2fb0
movsd %xmm0, -0x20(%rbp)
movsd 0x64b39(%rip), %xmm0    # 0xe2a60
movsd %xmm0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x81360
movq %rax, -0x80(%rbp)
leaq 0x693c4(%rip), %rdi     # 0xe7308
callq 0x79440
cmpl $0x0, %eax
jne 0x7df55
movb $0x0, %al
callq 0x41a40
movq -0x8(%rbp), %rdi
callq 0x510a0
movq %rax, -0x58(%rbp)
movl -0xc(%rbp), %eax
addl $0x41, %eax
movq -0x58(%rbp), %rsi
movsbl %al, %edi
callq 0x3efa0
movq -0x58(%rbp), %rdi
callq 0x52e80
leaq 0x364104(%rip), %rax    # 0x3e2088
movl $0x1, 0x78(%rax)
movq -0x80(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %rcx
callq 0x80f40
movl $0x0, -0x10(%rbp)
cmpl $0x1f4, -0x10(%rbp)     # imm = 0x1F4
jg 0x7e058
movsd -0x40(%rbp), %xmm1
cvtsi2sdl -0x10(%rbp), %xmm0
movsd -0x48(%rbp), %xmm2
subsd -0x40(%rbp), %xmm2
movsd 0x669b1(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x80(%rbp), %rdi
movl -0x14(%rbp), %esi
movsd -0x38(%rbp), %xmm0
callq 0x81130
movsd %xmm0, -0x30(%rbp)
leaq 0x36408b(%rip), %rax    # 0x3e2088
movsd 0x80(%rax), %xmm0
leaq 0x36407c(%rip), %rax    # 0x3e2088
ucomisd 0x88(%rax), %xmm0
jb 0x7e048
movsd -0x30(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x7e030
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x30(%rbp), %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0x7e046
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x7e048
jmp 0x7e04a
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x7dfa6
leaq 0x364029(%rip), %rax    # 0x3e2088
movsd 0x80(%rax), %xmm0
leaq 0x36401a(%rip), %rax    # 0x3e2088
ucomisd 0x88(%rax), %xmm0
jb 0x7e0a0
movsd -0x20(%rbp), %xmm0
leaq 0x364004(%rip), %rax    # 0x3e2088
movsd %xmm0, 0x80(%rax)
movsd -0x28(%rbp), %xmm0
leaq 0x363ff0(%rip), %rax    # 0x3e2088
movsd %xmm0, 0x88(%rax)
leaq 0x363fe1(%rip), %rax    # 0x3e2088
movsd 0x10(%rax), %xmm0
leaq 0x363fd5(%rip), %rax    # 0x3e2088
ucomisd 0x18(%rax), %xmm0
jb 0x7e0dc
movsd -0x40(%rbp), %xmm0
leaq 0x363fc2(%rip), %rax    # 0x3e2088
movsd %xmm0, 0x10(%rax)
movsd -0x48(%rbp), %xmm0
leaq 0x363fb1(%rip), %rax    # 0x3e2088
movsd %xmm0, 0x18(%rax)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x80(%rbp), %rdi
movl -0x14(%rbp), %esi
movsd -0x68(%rbp), %xmm0
callq 0x81130
movsd %xmm0, -0x60(%rbp)
leaq -0x4b(%rbp), %rdi
movl -0xc(%rbp), %edx
addl $0x41, %edx
leaq 0x6880b(%rip), %rsi     # 0xe6918
movb $0x0, %al
callq 0x4170
movl $0x1, -0x10(%rbp)
cmpl $0x1f4, -0x10(%rbp)     # imm = 0x1F4
jg 0x7e1d0
movsd -0x40(%rbp), %xmm1
cvtsi2sdl -0x10(%rbp), %xmm0
movsd -0x48(%rbp), %xmm2
subsd -0x40(%rbp), %xmm2
movsd 0x6683c(%rip), %xmm3    # 0xe4980
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x80(%rbp), %rdi
movl -0x14(%rbp), %esi
movsd -0x68(%rbp), %xmm0
callq 0x81130
movsd %xmm0, -0x70(%rbp)
leaq -0x4b(%rbp), %rsi
movsd -0x68(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
movsd -0x78(%rbp), %xmm2
movsd -0x70(%rbp), %xmm3
movsd 0x86eb5(%rip), %xmm4    # 0x105040
movsd 0x86eb5(%rip), %xmm5    # 0x105048
xorl %edi, %edi
callq 0x3f100
movq %rax, -0x88(%rbp)
movl -0xc(%rbp), %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x18(%rax)
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x7e11b
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x7e220
movq -0x80(%rbp), %rax
movslq -0x10(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x814b0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x7e1d7
movq -0x80(%rbp), %rdi
callq 0x52e80
movb $0x0, %al
callq 0x42280
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)