// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/specialrank.c
// Function: gt_fillspecialranklist
Specialrank *gt_fillspecialranklist(const GtEncseq *encseq,
                                 GtReadmode readmode,
                                 const GtUword *inversesuftab)
{
  if (gt_encseq_has_specialranges(encseq))
  {
    GtSpecialrangeiterator *sri;
    GtRange range;
    GtUword realspecialranges, specialrank;
    GT_UNUSED GtUword totallength;
    Specialrank *specialranklist, *rbptr;

    totallength = gt_encseq_total_length(encseq);
    realspecialranges = gt_encseq_realspecialranges(encseq);
    specialranklist = gt_malloc(sizeof (Specialrank) * realspecialranges);
    sri = gt_specialrangeiterator_new(encseq,
                                  GT_ISDIRREVERSE(readmode)
                                  ? false : true);
    rbptr = specialranklist;
    specialrank = 0;
    while (gt_specialrangeiterator_next(sri,&range))
    {
      gt_assert(rbptr < specialranklist + realspecialranges);
      gt_assert(range.end<=totallength);
      specialrank += range.end - range.start;
      rbptr->specialrank = specialrank - 1;
      rbptr->key = inversesuftab[range.end];
      rbptr++;
    }
    gt_assert(rbptr == specialranklist + realspecialranges);
    gt_specialrangeiterator_delete(sri);
    qsort(specialranklist,(size_t) realspecialranges,
          sizeof (Specialrank),compareSpecialrank);
    return specialranklist;
  }
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x10(%rsp)
movl %esi, %r15d
movq %rdi, %rbp
callq 0xc5cfe
testb %al, %al
je 0x24490c
movq %rbp, %rdi
callq 0x31140
movq %rax, %r12
movq %rbp, %rdi
callq 0xc7e90
movq %rax, %rbx
movq %rax, (%rsp)
shlq $0x4, %rbx
leaq 0x105a71(%rip), %rsi    # 0x34a2f4
movq %rbx, %rdi
movl $0xa3, %edx
callq 0x2e5f0
movq %rax, %r14
andl $-0x3, %r15d
xorl %esi, %esi
cmpl $0x1, %r15d
setne %sil
movq %rbp, %rdi
callq 0xc5e48
movq %rax, %rbp
movq %rbx, 0x8(%rsp)
leaq (%r14,%rbx), %r15
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %rbp, %rdi
leaq 0x18(%rsp), %rsi
callq 0xc5ee3
testb %al, %al
je 0x244911
leaq (%r14,%r13), %rax
cmpq %r15, %rax
jae 0x24494c
movq 0x20(%rsp), %rax
cmpq %r12, %rax
ja 0x24497a
movq %rax, %rcx
subq 0x18(%rsp), %rcx
leaq (%rcx,%rbx), %rdx
decq %rdx
addq %rcx, %rbx
movq %rdx, (%r14,%r13)
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rax
movq %rax, 0x8(%r14,%r13)
addq $0x10, %r13
jmp 0x2448ba
xorl %r14d, %r14d
jmp 0x24493a
cmpq %r13, 0x8(%rsp)
jne 0x2449b2
movq %rbp, %rdi
callq 0xc6661
leaq 0xb5(%rip), %rcx        # 0x2449e0
pushq $0x10
popq %rdx
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x31640
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1c665d(%rip), %rax    # 0x40afb0
movq (%rax), %rdi
leaq 0x99e93(%rip), %rsi     # 0x2de7f0
leaq 0x105a3e(%rip), %rdx    # 0x34a3a2
leaq 0x105a63(%rip), %rcx    # 0x34a3ce
leaq 0x105982(%rip), %r8     # 0x34a2f4
movl $0xab, %r9d
jmp 0x2449a6
movq 0x1c662f(%rip), %rax    # 0x40afb0
movq (%rax), %rdi
leaq 0x99e65(%rip), %rsi     # 0x2de7f0
leaq 0x105a53(%rip), %rdx    # 0x34a3e5
leaq 0x105a35(%rip), %rcx    # 0x34a3ce
leaq 0x105954(%rip), %r8     # 0x34a2f4
movl $0xac, %r9d
xorl %eax, %eax
callq 0x32960
callq 0x2e820
movq 0x1c65f7(%rip), %rax    # 0x40afb0
movq (%rax), %rdi
leaq 0x99e2d(%rip), %rsi     # 0x2de7f0
leaq 0x105a32(%rip), %rdx    # 0x34a3fc
leaq 0x1059fd(%rip), %rcx    # 0x34a3ce
leaq 0x10591c(%rip), %r8     # 0x34a2f4
movl $0xb2, %r9d
jmp 0x2449a6