// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/plot.c
// Function: plotay
void plotay(char* names)
{
 /*!Last Changed 15.09.2006*/
 /*!Last Changed 08.10.2004 added img.xaxis.lim and img.yaxis.lim*/
 FILE* myfile;
 double obs, maxobs = -LONG_MAX, minobs = 0;
 int count2;
 char st[MAXLENGTH], *legendname;
 Point p1, p2;
 if (!get_parameter_o("hold"))
   clear_image();
 legendname = file_only_name(names);
 add_legend((char) (img.xaxis.namesavailable + '0'), legendname);
 safe_free(legendname);
 img.yaxis.available = 1;
 myfile = fopen(names, "r");
 if (!myfile)
   return;
 count2 = 0;
 while (fscanf(myfile,"%s %lf\n", st, &obs) != EOF)
  {
   count2++;
   if (!img.xaxis.namesavailable)
    {
     img.xaxis.names = alloc(img.xaxis.names, count2 * (sizeof(char*)), count2);
     img.xaxis.names[count2 - 1] = strcopy(img.xaxis.names[count2 - 1], st);
     p2.x = count2 - 1;
    }
   else
     p2.x = listindex(st, img.xaxis.names, img.xaxis.lim.division);
   p1.x = img.xaxis.namesavailable;
   p1.y = MARGIN;
   p2.y = (double) obs;
   add_object(OBJECT_RECTANGLE, p1, p2, dummyp, "");   
   if (!img.xaxis.namesavailable)
    {
     if (obs > maxobs)
       maxobs = obs;
    }
   else
     if (obs > img.yaxis.lim.max)
       img.yaxis.lim.max = obs;
  }
 fclose(myfile);
 if (!img.xaxis.namesavailable)
  {
   img.xaxis.lim.division = count2;
   img.xaxis.limitsset = 1;
   img.xaxis.lim.precision = 0;
   img.yaxis.lim.min = minobs;
   img.yaxis.lim.max = maxobs;
  }
 img.xaxis.namesavailable++;
 export_image();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a138, %rsp          # imm = 0x7A138
movq %rdi, %rbx
leaq 0x487ad(%rip), %rdi     # 0x9a6e5
callq 0x4cff1
testl %eax, %eax
jne 0x51f48
xorl %eax, %eax
callq 0x2a510
movq %rbx, %rdi
callq 0x34033
movq %rax, %r14
leaq 0x35815e(%rip), %rbp    # 0x3aa0b8
movb 0x38(%rbp), %al
addb $0x30, %al
movsbl %al, %edi
movq %r14, %rsi
callq 0x28ee8
movq %r14, %rdi
callq 0x34ff7
movl $0x1, 0x78(%rbp)
leaq 0x498ff(%rip), %rsi     # 0x9b87f
movq %rbx, %rdi
callq 0x40f0
testq %rax, %rax
je 0x520d1
movq %rax, %rbx
movsd 0x43e34(%rip), %xmm0    # 0x95dd0
movsd %xmm0, (%rsp)
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
xorl %r14d, %r14d
leaq 0x8(,%r14,8), %r13
movq %rbx, %rdi
leaq 0x48cb1(%rip), %rsi     # 0x9ac71
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x4070
cmpl $-0x1, %eax
je 0x5208f
cmpl $0x0, 0x38(%rbp)
movq 0x30(%rbp), %rsi
je 0x51ff1
movl 0x20(%rbp), %edx
movq %r15, %rdi
callq 0x35f17
cvtsi2sd %eax, %xmm2
jmp 0x5201d
leal 0x1(%r14), %edx
movq %rsi, %rdi
movq %r13, %rsi
callq 0x34f30
movq %rax, 0x30(%rbp)
movq (%rax,%r14,8), %rdi
movq %r15, %rsi
callq 0x3604c
movq 0x30(%rbp), %rcx
movq %rax, (%rcx,%r14,8)
cvtsi2sd %r14d, %xmm2
cvtsi2sdl 0x38(%rbp), %xmm0
movsd 0x8(%rsp), %xmm3
movsd 0x7b040(%rip), %xmm4    # 0xcd070
movsd 0x7b040(%rip), %xmm5    # 0xcd078
pushq $0x2
popq %rdi
movsd 0x45d45(%rip), %xmm1    # 0x97d88
leaq 0x4f8d4(%rip), %rsi     # 0xa191e
callq 0x28f8d
cmpl $0x0, 0x38(%rbp)
movsd 0x8(%rsp), %xmm0
je 0x5206f
ucomisd 0x88(%rbp), %xmm0
jbe 0x52076
movsd %xmm0, 0x88(%rbp)
jmp 0x52076
ucomisd (%rsp), %xmm0
ja 0x52082
addq $0x8, %r13
incq %r14
jmp 0x51fb6
incq %r14
movsd %xmm0, (%rsp)
jmp 0x51fae
movq %rbx, %rdi
callq 0x42a0
movl 0x38(%rbp), %eax
testl %eax, %eax
jne 0x520c5
movl %r14d, 0x20(%rbp)
movabsq $0x100000000, %rcx      # imm = 0x100000000
movq %rcx, 0x24(%rbp)
andq $0x0, 0x80(%rbp)
movsd (%rsp), %xmm0
movsd %xmm0, 0x88(%rbp)
incl %eax
movl %eax, 0x38(%rbp)
xorl %eax, %eax
callq 0x2a858
addq $0x7a138, %rsp          # imm = 0x7A138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq