// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/eps.c
// Function: save_axes
int save_axes(FILE* myfile)
{
 /*!Last Changed 20.09.2006*/
 char st[100];
 int i, xdivision, ydivision, posx, posx2, posy, posy2;
 if (img.xaxis.available)
  {
   if (img.xaxis.lim.division == 0)
     xdivision = 10;
   else
     xdivision = img.xaxis.lim.division;
   if (get_parameter_o("showticks"))
     write_axis(myfile, xdivision, TICKWIDTH, MARGIN, img.width - MARGIN, MARGIN, X_AXIS);
   else
     write_axis(myfile, 0, TICKWIDTH, MARGIN, img.width - MARGIN, MARGIN, X_AXIS);   
  }
 else
   xdivision = 10;
 if (img.yaxis.available)
  {
   if (get_parameter_o("showticks"))
     write_axis(myfile, xdivision, -TICKWIDTH, MARGIN, img.width - MARGIN, img.height - MARGIN, X_AXIS);
   else
     write_axis(myfile, 0, -TICKWIDTH, MARGIN, img.width - MARGIN, img.height - MARGIN, X_AXIS);  
   if (img.yaxis.lim.division == 0)
     ydivision = 10;
   else
     ydivision = img.yaxis.lim.division;
   write_axis(myfile, ydivision, TICKWIDTH, MARGIN, img.height - MARGIN, MARGIN, Y_AXIS);  
   write_axis(myfile, ydivision, -TICKWIDTH, MARGIN, img.height - MARGIN, img.width - MARGIN, Y_AXIS);
  }
 else
   ydivision = 10; 
 fprintf(myfile, "stroke\n");
 if (img.xaxis.available && img.xaxis.label)
  {
   setfont(myfile, img.xaxis.labelfnt);
   write_string(myfile, img.width / 2, 30, img.xaxis.label, ALIGN_CENTER);
  }
 if (img.yaxis.available && img.yaxis.label)
  {
   setfont(myfile, img.yaxis.labelfnt);
   write_string(myfile, 10, img.height / 2, img.yaxis.label, ALIGN_ROTATE_CENTER);
  }
 if (img.xaxis.available)
  {
   setfont(myfile, img.xaxis.axisfnt);
   if (img.xaxis.namesavailable)
     for (i = 0; i < xdivision; i++)
      {
       posx = MARGIN + (i * epsaxis) / xdivision;
       posx2 = MARGIN + ((i + 1) * epsaxis) / xdivision;
       write_string(myfile, (posx + posx2) / 2, MARGIN - 10, img.xaxis.names[i], ALIGN_CENTER);
      }
   else
     for (i = 0; i <= xdivision; i++)
      {
       posx = MARGIN + (i * epsaxis) / xdivision;
       if (img.xaxis.lim.precision == 0)
         sprintf(st, "%.0f", img.xaxis.lim.min + ((img.xaxis.lim.max - img.xaxis.lim.min) / xdivision) * i);
       else
         switch (img.xaxis.lim.precision)
          {
           case 1:sprintf(st, "%.1f", img.xaxis.lim.min + ((img.xaxis.lim.max - img.xaxis.lim.min) / xdivision) * i);
                  break;
           case 2:sprintf(st, "%.2f", img.xaxis.lim.min + ((img.xaxis.lim.max - img.xaxis.lim.min) / xdivision) * i);
                  break;
           case 3:sprintf(st, "%.3f", img.xaxis.lim.min + ((img.xaxis.lim.max - img.xaxis.lim.min) / xdivision) * i);
                  break;
           default:sprintf(st, "%.1f", img.xaxis.lim.min + ((img.xaxis.lim.max - img.xaxis.lim.min) / xdivision) * i);
                   break;
          }     
       write_string(myfile, posx, MARGIN - 15, st, ALIGN_CENTER);
      }
  }
 if (img.yaxis.available)
  {
   setfont(myfile, img.yaxis.axisfnt);
   if (img.yaxis.namesavailable)
     for (i = 0; i < ydivision; i++)
      {
       posy = MARGIN + (i * epsaxis) / ydivision;
       posy2 = MARGIN + ((i + 1) * epsaxis) / ydivision;
       write_string(myfile, MARGIN - 10, (posy + posy2) / 2, img.yaxis.names[i], ALIGN_ROTATE_CENTER);
      }
   else
     for (i = 0; i <= ydivision; i++)
      {
       posy = MARGIN + (i * epsaxis) / ydivision;
       if (img.yaxis.lim.precision == 0)
         sprintf(st, "%.0f", img.yaxis.lim.min + ((img.yaxis.lim.max - img.yaxis.lim.min) / ydivision) * i);
       else
         switch (img.yaxis.lim.precision)
          {
           case 1:sprintf(st, "%.1f", img.yaxis.lim.min + ((img.yaxis.lim.max - img.yaxis.lim.min) / ydivision) * i);
                  break;
           case 2:sprintf(st, "%.2f", img.yaxis.lim.min + ((img.yaxis.lim.max - img.yaxis.lim.min) / ydivision) * i);
                  break;
           case 3:sprintf(st, "%.3f", img.yaxis.lim.min + ((img.yaxis.lim.max - img.yaxis.lim.min) / ydivision) * i);
                  break;
           default:sprintf(st, "%.1f", img.yaxis.lim.min + ((img.yaxis.lim.max - img.yaxis.lim.min) / ydivision) * i);
                   break;
          }     
       write_string(myfile, MARGIN - 5, posy, st, ALIGN_RIGHT);
      }
  }
 return xdivision; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
leaq 0x38f595(%rip), %r14    # 0x3b20b8
movl $0xa, %r15d
cmpl $0x0, 0x8(%r14)
movl $0xa, %r13d
je 0x22b85
movl 0x20(%r14), %eax
testl %eax, %eax
movl $0xa, %r13d
cmovnel %eax, %r13d
leaq 0x853f4(%rip), %rdi     # 0xa7f41
callq 0x54bec
movl 0x4(%r14), %r9d
addl $-0x50, %r9d
testl %eax, %eax
cmovnel %r13d, %eax
movl $0x50, (%rsp)
leaq 0x85600(%rip), %rsi     # 0xa816e
movq %rbx, %rdi
movl %eax, %edx
movl $0x6, %ecx
movl $0x50, %r8d
xorl %eax, %eax
callq 0x42e0
cmpl $0x0, 0x78(%r14)
je 0x22c40
leaq 0x853aa(%rip), %rdi     # 0xa7f41
callq 0x54bec
movl (%r14), %ecx
movl 0x4(%r14), %r9d
addl $-0x50, %r9d
addl $-0x50, %ecx
testl %eax, %eax
cmovnel %r13d, %eax
movl %ecx, (%rsp)
leaq 0x855b4(%rip), %rsi     # 0xa816e
movq %rbx, %rdi
movl %eax, %edx
movl $0xfffffffa, %ecx       # imm = 0xFFFFFFFA
movl $0x50, %r8d
xorl %eax, %eax
callq 0x42e0
movl (%r14), %r9d
movl 0x90(%r14), %eax
testl %eax, %eax
movl $0xa, %r15d
cmovnel %eax, %r15d
addl $-0x50, %r9d
movl $0x50, (%rsp)
leaq 0x8558b(%rip), %r12     # 0xa8184
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl $0x6, %ecx
movl $0x50, %r8d
xorl %eax, %eax
callq 0x42e0
movl (%r14), %r9d
movl 0x4(%r14), %eax
addl $-0x50, %r9d
addl $-0x50, %eax
movl %eax, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl $0xfffffffa, %ecx       # imm = 0xFFFFFFFA
movl $0x50, %r8d
xorl %eax, %eax
callq 0x42e0
leaq 0x8526f(%rip), %rdi     # 0xa7eb6
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
cmpl $0x0, 0x8(%r14)
je 0x22ca7
cmpq $0x0, 0x40(%r14)
je 0x22ca7
movq 0x70(%r14), %rax
movq %rax, 0x10(%rsp)
movupd 0x60(%r14), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x234a7
movl 0x4(%r14), %eax
movl %eax, %esi
shrl $0x1f, %esi
addl %eax, %esi
sarl %esi
movq 0x40(%r14), %rcx
movq %rbx, %rdi
movl $0x1e, %edx
movl $0x2, %r8d
callq 0x23500
movq %r15, 0x38(%rsp)
movq %r13, 0x20(%rsp)
cmpl $0x0, 0x78(%r14)
je 0x22d0a
cmpq $0x0, 0xb0(%r14)
je 0x22d0a
movq 0xe0(%r14), %rax
movq %rax, 0x10(%rsp)
movupd 0xd0(%r14), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x234a7
movl (%r14), %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movq 0xb0(%r14), %rcx
movq %rbx, %rdi
movl $0xa, %esi
movl $0x5, %r8d
callq 0x23500
cmpl $0x0, 0x8(%r14)
je 0x22e67
movq 0x58(%r14), %rax
movq %rax, 0x10(%rsp)
movupd 0x48(%r14), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x234a7
cmpl $0x0, 0x38(%r14)
je 0x22dac
movq 0x20(%rsp), %r15
testl %r15d, %r15d
jle 0x22e67
movl %r15d, %r13d
xorl %r12d, %r12d
xorl %edi, %edi
movl %r12d, %eax
xorl %edx, %edx
divl %r15d
movl %eax, %ecx
leaq 0x1(%rdi), %rbp
addl $0x1f4, %r12d           # imm = 0x1F4
movl %r12d, %eax
xorl %edx, %edx
divl %r15d
leal (%rcx,%rax), %edx
addl $0xa0, %edx
addl %eax, %ecx
shrl $0x1f, %edx
leal (%rdx,%rcx), %esi
addl $0xa0, %esi
movq 0x30(%r14), %rax
movq (%rax,%rdi,8), %rcx
sarl %esi
movq %rbx, %rdi
movl $0x46, %edx
movl $0x2, %r8d
callq 0x23500
movq %rbp, %rdi
cmpq %rbp, %r13
jne 0x22d4e
jmp 0x22e67
movq 0x20(%rsp), %rcx
testl %ecx, %ecx
js 0x22e67
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x28(%rsp)
leal 0x1(%rcx), %r12d
xorpd %xmm2, %xmm2
xorl %ebp, %ebp
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %r13d
movl 0x24(%r14), %eax
leaq 0x850f3(%rip), %rsi     # 0xa7ed7
cmpq $0x3, %rax
ja 0x22df5
leaq 0xb0e37(%rip), %rcx     # 0xd3c28
movq (%rcx,%rax,8), %rsi
addl $0x50, %r13d
movsd 0x10(%r14), %xmm1
movsd 0x18(%r14), %xmm0
subsd %xmm1, %xmm0
divsd 0x28(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movb $0x1, %al
movsd %xmm2, 0x30(%rsp)
callq 0x41b0
movq %rbx, %rdi
movl %r13d, %esi
movl $0x41, %edx
movq %r15, %rcx
movl $0x2, %r8d
callq 0x23500
movsd 0x30(%rsp), %xmm2
addsd 0x826cd(%rip), %xmm2    # 0xa5520
addl $0x1f4, %ebp            # imm = 0x1F4
decl %r12d
movq 0x20(%rsp), %rcx
jne 0x22dd0
cmpl $0x0, 0x78(%r14)
movq 0x38(%rsp), %r15
je 0x22fe4
movq 0xc8(%r14), %rax
movq %rax, 0x10(%rsp)
movupd 0xb8(%r14), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x234a7
cmpl $0x0, 0xa8(%r14)
je 0x22f14
testl %r15d, %r15d
jle 0x22fe4
movl %r15d, %r13d
xorl %r12d, %r12d
xorl %esi, %esi
movl %r12d, %eax
xorl %edx, %edx
divl %r15d
movl %eax, %ecx
leaq 0x1(%rsi), %rbp
addl $0x1f4, %r12d           # imm = 0x1F4
movl %r12d, %eax
xorl %edx, %edx
divl %r15d
leal (%rcx,%rax), %edx
addl $0xa0, %edx
addl %eax, %ecx
shrl $0x1f, %edx
addl %ecx, %edx
addl $0xa0, %edx
movq 0xa0(%r14), %rax
movq (%rax,%rsi,8), %rcx
sarl %edx
movq %rbx, %rdi
movl $0x46, %esi
movl $0x5, %r8d
callq 0x23500
movq %rbp, %rsi
cmpq %rbp, %r13
jne 0x22eb4
jmp 0x22fe4
testl %r15d, %r15d
js 0x22fe4
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movsd %xmm0, 0x28(%rsp)
leal 0x1(%r15), %r12d
xorpd %xmm2, %xmm2
xorl %ebp, %ebp
movq %r15, %rcx
movq %rbx, %r15
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %r13d
movl 0x94(%r14), %eax
leaq 0x84f85(%rip), %rsi     # 0xa7ed7
cmpq $0x3, %rax
ja 0x22f63
leaq 0xb0cc9(%rip), %rcx     # 0xd3c28
movq (%rcx,%rax,8), %rsi
addl $0x50, %r13d
movsd 0x80(%r14), %xmm1
movsd 0x88(%r14), %xmm0
subsd %xmm1, %xmm0
divsd 0x28(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq %r14, %rbx
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movb $0x1, %al
movsd %xmm2, 0x30(%rsp)
callq 0x41b0
movq %r15, %rdi
movl $0x4b, %esi
movl %r13d, %edx
movq %r14, %rcx
movq %rbx, %r14
movq %r15, %rbx
movl $0x1, %r8d
callq 0x23500
movsd 0x30(%rsp), %xmm2
addsd 0x82550(%rip), %xmm2    # 0xa5520
addl $0x1f4, %ebp            # imm = 0x1F4
decl %r12d
movq 0x38(%rsp), %r15
jne 0x22f35
movq 0x20(%rsp), %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq