// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/annotationsketch/canvas.c
// Function: gt_format_ruler_label
void gt_format_ruler_label(char *txt, GtWord pos,
                           const char *unitstr, size_t buflen)
{
  double fpos;
  int logval;
  GtStr *formatstring;
  GtUword upos;
  gt_assert(txt);
  bool negative = false;

  if (pos < 0)
  {
    upos = (GtUword)-pos;
    negative = true;
    formatstring = gt_str_new_cstr("-%.");
  }
  else
  {
    upos = (GtUword)pos;
    formatstring = gt_str_new_cstr("%.");
  }
  logval = (int) floor(log10(upos));
  if (upos >= 1000000000)
  {
    fpos = (double) upos / 1000000000;
    while (upos % 10 == 0)
    {
      upos /= 10;
      logval--;
    }
    /*@ignore@*/
    gt_str_append_uword(formatstring, (GtUword) logval);
    gt_str_append_cstr(formatstring, "fG%s");
    (void) snprintf(txt, buflen, gt_str_get(formatstring), fpos, unitstr);
    /*@end@*/
  }
  else if (upos >= 1000000)
  {
    fpos = (double) upos / 1000000;
    while (upos % 10 == 0)
    {
      upos /= 10;
      logval--;
    }
    /*@ignore@*/
    gt_str_append_uword(formatstring, (GtUword) logval);
    gt_str_append_cstr(formatstring, "fM%s");
    (void) snprintf(txt, buflen, gt_str_get(formatstring), fpos, unitstr);
    /*@end@*/
  }
  else if (upos >= 1000)
  {
    fpos = (double) upos / 1000;
    while (upos % 10 == 0)
    {
      upos /= 10;
      logval--;
    }
    /*@ignore@*/
    gt_str_append_uword(formatstring, (GtUword) logval);
    gt_str_append_cstr(formatstring, "fk%s");
    (void) snprintf(txt, buflen, gt_str_get(formatstring), fpos, unitstr);
    /*@end@*/
  } else {
    /*@ignore@*/
    (void) snprintf(txt, buflen, " %s"GT_WU"%s", negative ? "-" : "", upos,
        unitstr);
    /*@end@*/
  }

  gt_str_delete(formatstring);
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
cmpq $0x0, 0x70(%rsp)
jne 0x3a1f8
movq 0x179e11(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x123e95(%rip), %rsi    # 0x15e066
leaq 0x12dc5e(%rip), %rdx    # 0x167e36
leaq 0x12d3d1(%rip), %rcx    # 0x1675b0
leaq 0x12d3e0(%rip), %r8     # 0x1675c6
movl $0x59, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x3a1fa
movb $0x0, 0x37(%rsp)
cmpq $0x0, 0x68(%rsp)
jge 0x3a22b
xorl %eax, %eax
subq 0x68(%rsp), %rax
movq %rax, 0x38(%rsp)
movb $0x1, 0x37(%rsp)
leaq 0x12d3c5(%rip), %rdi    # 0x1675e4
callq 0x18f70
movq %rax, 0x40(%rsp)
jmp 0x3a246
movq 0x68(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x12d3a9(%rip), %rdi    # 0x1675e5
callq 0x18f70
movq %rax, 0x40(%rsp)
movaps 0x124233(%rip), %xmm1   # 0x15e480
movq 0x38(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x124231(%rip), %xmm1   # 0x15e490
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0xb290
callq 0xba80
cvttsd2si %xmm0, %eax
movl %eax, 0x4c(%rsp)
cmpq $0x3b9aca00, 0x38(%rsp) # imm = 0x3B9ACA00
jb 0x3a361
movaps 0x1241ea(%rip), %xmm1   # 0x15e480
movq 0x38(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x1241e8(%rip), %xmm1   # 0x15e490
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x12d2e9(%rip), %xmm1   # 0x1675a8
divsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x38(%rsp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0x3a2ff
movq 0x38(%rsp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x38(%rsp)
movl 0x4c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x3a2c9
movq 0x40(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x19390
movq 0x40(%rsp), %rdi
leaq 0x12d2ce(%rip), %rsi    # 0x1675e8
callq 0x18fb0
movq 0x70(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rdi
callq 0x19940
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %rdx
movsd 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rcx
movb $0x1, %al
callq 0xb9d0
jmp 0x3a55d
cmpq $0xf4240, 0x38(%rsp)    # imm = 0xF4240
jb 0x3a442
movaps 0x124109(%rip), %xmm1   # 0x15e480
movq 0x38(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x124107(%rip), %xmm1   # 0x15e490
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x12d200(%rip), %xmm1   # 0x1675a0
divsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x38(%rsp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0x3a3e0
movq 0x38(%rsp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x38(%rsp)
movl 0x4c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x3a3aa
movq 0x40(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x19390
movq 0x40(%rsp), %rdi
leaq 0x12d1f2(%rip), %rsi    # 0x1675ed
callq 0x18fb0
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rdi
callq 0x19940
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %rax, %rdx
movsd 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rcx
movb $0x1, %al
callq 0xb9d0
jmp 0x3a55b
cmpq $0x3e8, 0x38(%rsp)      # imm = 0x3E8
jb 0x3a51e
movaps 0x124028(%rip), %xmm1   # 0x15e480
movq 0x38(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x124026(%rip), %xmm1   # 0x15e490
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x12d117(%rip), %xmm1   # 0x167598
divsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x38(%rsp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0x3a4c1
movq 0x38(%rsp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x38(%rsp)
movl 0x4c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x3a48b
movq 0x40(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x19390
movq 0x40(%rsp), %rdi
leaq 0x12d116(%rip), %rsi    # 0x1675f2
callq 0x18fb0
movq 0x70(%rsp), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0x19940
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rdx
movsd 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rcx
movb $0x1, %al
callq 0xb9d0
jmp 0x3a559
movq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rsi
movb 0x37(%rsp), %dl
leaq 0x1319b0(%rip), %rcx    # 0x16bee3
leaq 0x130ba2(%rip), %rax    # 0x16b0dc
testb $0x1, %dl
cmovneq %rax, %rcx
movq 0x38(%rsp), %r8
movq 0x60(%rsp), %r9
leaq 0x12d0a5(%rip), %rdx    # 0x1675f7
movb $0x0, %al
callq 0xb9d0
jmp 0x3a55b
jmp 0x3a55d
movq 0x40(%rsp), %rdi
callq 0x1afc0
addq $0x78, %rsp
retq
nopl (%rax)