// File: /workspace/github_c_makefile_star2_O1/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 0x38cdbb(%rip), %r14    # 0x3af0b8
movl $0xa, %r15d
cmpl $0x0, 0x8(%r14)
movl $0xa, %r13d
je 0x2235f
movl 0x20(%r14), %eax
testl %eax, %eax
movl $0xa, %r13d
cmovnel %eax, %r13d
leaq 0x82bc2(%rip), %rdi     # 0xa4ee9
callq 0x536e7
movl 0x4(%r14), %r9d
addl $-0x50, %r9d
testl %eax, %eax
cmovnel %r13d, %eax
movl $0x50, (%rsp)
leaq 0x82dce(%rip), %rsi     # 0xa5116
movq %rbx, %rdi
movl %eax, %edx
movl $0x6, %ecx
movl $0x50, %r8d
xorl %eax, %eax
callq 0x42e0
cmpl $0x0, 0x78(%r14)
je 0x2241a
leaq 0x82b78(%rip), %rdi     # 0xa4ee9
callq 0x536e7
movl (%r14), %ecx
movl 0x4(%r14), %r9d
addl $-0x50, %r9d
addl $-0x50, %ecx
testl %eax, %eax
cmovnel %r13d, %eax
movl %ecx, (%rsp)
leaq 0x82d82(%rip), %rsi     # 0xa5116
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 0x82d59(%rip), %r12     # 0xa512c
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 0x82a3d(%rip), %rdi     # 0xa4e5e
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
cmpl $0x0, 0x8(%r14)
je 0x22481
cmpq $0x0, 0x40(%r14)
je 0x22481
movq 0x70(%r14), %rax
movq %rax, 0x10(%rsp)
movupd 0x60(%r14), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x22cba
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 0x22d13
movq %r15, 0x30(%rsp)
movq %r13, 0x18(%rsp)
cmpl $0x0, 0x78(%r14)
je 0x224e4
cmpq $0x0, 0xb0(%r14)
je 0x224e4
movq 0xe0(%r14), %rax
movq %rax, 0x10(%rsp)
movupd 0xd0(%r14), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x22cba
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 0x22d13
cmpl $0x0, 0x8(%r14)
je 0x2265f
movq 0x58(%r14), %rax
movq %rax, 0x10(%rsp)
movupd 0x48(%r14), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x22cba
cmpl $0x0, 0x38(%r14)
je 0x22586
movq 0x18(%rsp), %r15
testl %r15d, %r15d
jle 0x2265f
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 0x22d13
movq %rbp, %rdi
cmpq %rbp, %r13
jne 0x22528
jmp 0x2265f
movq 0x18(%rsp), %rcx
testl %ecx, %ecx
js 0x2265f
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x20(%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
cmpq $0x3, %rax
ja 0x225d4
leaq 0x82808(%rip), %rcx     # 0xa4dcc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
leaq 0x828a8(%rip), %rsi     # 0xa4e7a
jmpq *%rax
leaq 0x828a4(%rip), %rsi     # 0xa4e7f
jmp 0x225ed
leaq 0x828a0(%rip), %rsi     # 0xa4e84
jmp 0x225ed
leaq 0x8289c(%rip), %rsi     # 0xa4e89
addl $0x50, %r13d
movsd 0x10(%r14), %xmm1
movsd 0x18(%r14), %xmm0
subsd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movb $0x1, %al
movsd %xmm2, 0x28(%rsp)
callq 0x41b0
movq %rbx, %rdi
movl %r13d, %esi
movl $0x41, %edx
movq %r15, %rcx
movl $0x2, %r8d
callq 0x22d13
movsd 0x28(%rsp), %xmm2
addsd 0x7fed5(%rip), %xmm2    # 0xa2520
addl $0x1f4, %ebp            # imm = 0x1F4
decl %r12d
movq 0x18(%rsp), %rcx
jne 0x225aa
cmpl $0x0, 0x78(%r14)
movq 0x30(%rsp), %r15
je 0x227f4
movq 0xc8(%r14), %rax
movq %rax, 0x10(%rsp)
movupd 0xb8(%r14), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x22cba
cmpl $0x0, 0xa8(%r14)
je 0x2270c
testl %r15d, %r15d
jle 0x227f4
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 0x22d13
movq %rbp, %rsi
cmpq %rbp, %r13
jne 0x226ac
jmp 0x227f4
testl %r15d, %r15d
js 0x227f4
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movsd %xmm0, 0x20(%rsp)
leal 0x1(%r15), %r12d
xorpd %xmm2, %xmm2
xorl %ebp, %ebp
movq %rbx, 0x38(%rsp)
movl %ebp, %eax
xorl %edx, %edx
divl %r15d
movl %eax, %r13d
movl 0x94(%r14), %eax
cmpq $0x3, %rax
ja 0x22760
leaq 0x8268c(%rip), %rcx     # 0xa4ddc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
leaq 0x8271c(%rip), %rsi     # 0xa4e7a
jmpq *%rax
leaq 0x82718(%rip), %rsi     # 0xa4e7f
jmp 0x22779
leaq 0x82714(%rip), %rsi     # 0xa4e84
jmp 0x22779
leaq 0x82710(%rip), %rsi     # 0xa4e89
addl $0x50, %r13d
movsd 0x80(%r14), %xmm1
movsd 0x88(%r14), %xmm0
subsd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq %r14, %rbx
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movb $0x1, %al
movsd %xmm2, 0x28(%rsp)
callq 0x41b0
movq 0x38(%rsp), %rdi
movl $0x4b, %esi
movl %r13d, %edx
movq %r14, %rcx
movq %rbx, %r14
movl $0x1, %r8d
callq 0x22d13
movsd 0x28(%rsp), %xmm2
addsd 0x7fd3b(%rip), %xmm2    # 0xa2520
addl $0x1f4, %ebp            # imm = 0x1F4
decl %r12d
jne 0x22732
movq 0x18(%rsp), %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq