// File: /workspace/github_c_makefile_star2_O2/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 $0x98, %rsp
movq %rdi, %rbx
leaq 0x38a026(%rip), %rbp    # 0x3aa0b8
pushq $0xa
popq %r14
cmpl $0x0, 0x8(%rbp)
movl %r14d, 0x1c(%rsp)
je 0x200ee
movl 0x20(%rbp), %eax
testl %eax, %eax
pushq $0xa
popq %r15
cmovnel %eax, %r15d
leaq 0x77e0c(%rip), %rdi     # 0x97ec1
callq 0x4cff1
movl 0x4(%rbp), %r9d
addl $-0x50, %r9d
testl %eax, %eax
movl %r15d, 0x1c(%rsp)
cmovnel %r15d, %eax
movl $0x50, (%rsp)
leaq 0x78013(%rip), %rsi     # 0x980ee
pushq $0x6
popq %rcx
pushq $0x50
popq %r8
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x42e0
cmpl $0x0, 0x78(%rbp)
je 0x201a0
leaq 0x77dc2(%rip), %rdi     # 0x97ec1
callq 0x4cff1
movl (%rbp), %ecx
movl 0x4(%rbp), %r9d
addl $-0x50, %r9d
addl $-0x50, %ecx
testl %eax, %eax
cmovnel 0x1c(%rsp), %eax
movl %ecx, (%rsp)
leaq 0x77fcb(%rip), %rsi     # 0x980ee
pushq $-0x6
popq %r15
pushq $0x50
popq %r12
movq %rbx, %rdi
movl %eax, %edx
movl %r15d, %ecx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x42e0
movl (%rbp), %r9d
movl 0x90(%rbp), %eax
testl %eax, %eax
pushq $0xa
popq %r14
cmovnel %eax, %r14d
addl $-0x50, %r9d
movl $0x50, (%rsp)
leaq 0x77fa1(%rip), %r13     # 0x98104
pushq $0x6
popq %rcx
movq %rbx, %rdi
movq %r13, %rsi
movl %r14d, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x42e0
movl (%rbp), %r9d
movl 0x4(%rbp), %eax
addl $-0x50, %r9d
addl $-0x50, %eax
movl %eax, (%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movl %r14d, %edx
movl %r15d, %ecx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x42e0
leaq 0x77c8f(%rip), %rdi     # 0x97e36
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x42c0
cmpl $0x0, 0x8(%rbp)
je 0x201f9
cmpq $0x0, 0x40(%rbp)
je 0x201f9
movq 0x70(%rbp), %rax
movq %rax, 0x10(%rsp)
movupd 0x60(%rbp), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x208eb
movl 0x4(%rbp), %eax
cltd
pushq $0x2
popq %r8
idivl %r8d
movq 0x40(%rbp), %rcx
pushq $0x1e
popq %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x20944
cmpl $0x0, 0x78(%rbp)
je 0x2024b
cmpq $0x0, 0xb0(%rbp)
je 0x2024b
movq 0xe0(%rbp), %rax
movq %rax, 0x10(%rsp)
movupd 0xd0(%rbp), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x208eb
movl (%rbp), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movq 0xb0(%rbp), %rcx
pushq $0xa
popq %rsi
pushq $0x5
popq %r8
movq %rbx, %rdi
movl %eax, %edx
callq 0x20944
cmpl $0x0, 0x8(%rbp)
je 0x203a3
leaq 0x389e5c(%rip), %r15    # 0x3aa0b8
movq 0x58(%r15), %rax
movq %rax, 0x10(%rsp)
movupd 0x48(%r15), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x208eb
cmpl $0x0, 0x38(%r15)
je 0x202ee
xorl %r12d, %r12d
movl 0x1c(%rsp), %eax
testl %eax, %eax
movl $0x0, %r15d
cmovgl %eax, %r15d
pushq $0x46
popq %r13
xorl %esi, %esi
cmpq %rsi, %r15
je 0x203a3
movl %r12d, %eax
cltd
movl 0x1c(%rsp), %edi
idivl %edi
movl %eax, %ecx
leaq 0x1(%rsi), %rbp
addl $0x1f4, %r12d           # imm = 0x1F4
movl %r12d, %eax
cltd
idivl %edi
addl %ecx, %eax
addl $0xa0, %eax
cltd
pushq $0x2
popq %r8
idivl %r8d
leaq 0x389de4(%rip), %rcx    # 0x3aa0b8
movq 0x30(%rcx), %rcx
movq (%rcx,%rsi,8), %rcx
movq %rbx, %rdi
movl %eax, %esi
movl %r13d, %edx
callq 0x20944
movq %rbp, %rsi
jmp 0x20298
cvtsi2sdl 0x1c(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
xorpd %xmm2, %xmm2
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpl 0x1c(%rsp), %r13d
jg 0x203a3
movl %r12d, %eax
cltd
idivl 0x1c(%rsp)
movl %eax, %r15d
leaq 0x389d97(%rip), %rcx    # 0x3aa0b8
movl 0x24(%rcx), %eax
leaq 0x77b2c(%rip), %rsi     # 0x97e57
cmpq $0x3, %rax
ja 0x2033c
leaq 0xaba40(%rip), %rdx     # 0xcbd78
movq (%rdx,%rax,8), %rsi
addl $0x50, %r15d
movsd 0x10(%rcx), %xmm1
movsd 0x18(%rcx), %xmm0
subsd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movb $0x1, %al
movsd %xmm2, 0x28(%rsp)
callq 0x41b0
movq %rbx, %rdi
movl %r15d, %esi
pushq $0x41
popq %rdx
movq %rbp, %rcx
pushq $0x2
popq %r8
callq 0x20944
movsd 0x28(%rsp), %xmm2
addsd 0x7518c(%rip), %xmm2    # 0x95520
incl %r13d
addl $0x1f4, %r12d           # imm = 0x1F4
jmp 0x20304
leaq 0x389d0e(%rip), %rax    # 0x3aa0b8
cmpl $0x0, 0x78(%rax)
je 0x2050f
leaq 0x389cfd(%rip), %r15    # 0x3aa0b8
movq 0xc8(%r15), %rax
movq %rax, 0x10(%rsp)
movupd 0xb8(%r15), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x208eb
cmpl $0x0, 0xa8(%r15)
je 0x20455
xorl %r12d, %r12d
testl %r14d, %r14d
movl $0x0, %r13d
cmovgl %r14d, %r13d
pushq $0x5
popq %r15
xorl %esi, %esi
cmpq %rsi, %r13
je 0x2050f
movl %r12d, %eax
cltd
idivl %r14d
movl %eax, %ecx
leaq 0x1(%rsi), %rbp
addl $0x1f4, %r12d           # imm = 0x1F4
movl %r12d, %eax
cltd
idivl %r14d
addl %ecx, %eax
addl $0xa0, %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
leaq 0x389c83(%rip), %rcx    # 0x3aa0b8
movq 0xa0(%rcx), %rcx
movq (%rcx,%rsi,8), %rcx
movq %rbx, %rdi
pushq $0x46
popq %rsi
movl %eax, %edx
movl %r15d, %r8d
callq 0x20944
movq %rbp, %rsi
jmp 0x203fd
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x20(%rsp)
xorpd %xmm2, %xmm2
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpl %r14d, %r12d
jg 0x2050f
movl %r15d, %eax
cltd
idivl %r14d
movl %eax, %r13d
leaq 0x389c34(%rip), %rcx    # 0x3aa0b8
movl 0x94(%rcx), %eax
leaq 0x779c6(%rip), %rsi     # 0x97e57
cmpq $0x3, %rax
ja 0x204a2
leaq 0xab8da(%rip), %rdx     # 0xcbd78
movq (%rdx,%rax,8), %rsi
addl $0x50, %r13d
movsd 0x80(%rcx), %xmm1
movsd 0x88(%rcx), %xmm0
subsd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movb $0x1, %al
movsd %xmm2, 0x28(%rsp)
callq 0x41b0
movq %rbx, %rdi
pushq $0x4b
popq %rsi
movl %r13d, %edx
movq %rbp, %rcx
pushq $0x1
popq %r8
callq 0x20944
movsd 0x28(%rsp), %xmm2
addsd 0x75020(%rip), %xmm2    # 0x95520
incl %r12d
addl $0x1f4, %r15d           # imm = 0x1F4
jmp 0x2046a
movl 0x1c(%rsp), %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq