// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movl %esi, 0x64(%rsp)
movq %rdx, 0x58(%rsp)
movq 0x68(%rsp), %rdi
callq 0x1293d0
testb $0x1, %al
jne 0x3d9cd5
jmp 0x3d9f02
movq 0x68(%rsp), %rdi
callq 0x32150
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rdi
callq 0x12c820
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
shlq $0x4, %rdi
leaq 0x18f32e(%rip), %rsi    # 0x569031
movl $0xa3, %edx
callq 0x2f600
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movb $0x1, %al
cmpl $0x1, 0x64(%rsp)
movb %al, 0x17(%rsp)
je 0x3d9d35
cmpl $0x3, 0x64(%rsp)
sete %al
movb %al, 0x17(%rsp)
movq 0x8(%rsp), %rdi
movb 0x17(%rsp), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x1296c0
movq %rax, 0x50(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1297e0
testb $0x1, %al
jne 0x3d9d8c
jmp 0x3d9e7a
jmp 0x3d9d8e
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x38(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jb 0x3d9de1
movq 0x222218(%rip), %rax    # 0x5fbfc8
movq (%rax), %rdi
leaq 0x1217e3(%rip), %rsi    # 0x4fb59d
leaq 0x18f31e(%rip), %rdx    # 0x5690df
leaq 0x18f343(%rip), %rcx    # 0x56910b
leaq 0x18f262(%rip), %r8     # 0x569031
movl $0xab, %r9d
movb $0x0, %al
callq 0x33960
callq 0x2f830
jmp 0x3d9de3
jmp 0x3d9de5
movq 0x48(%rsp), %rax
cmpq 0x28(%rsp), %rax
jbe 0x3d9e29
movq 0x2221d0(%rip), %rax    # 0x5fbfc8
movq (%rax), %rdi
leaq 0x12179b(%rip), %rsi    # 0x4fb59d
leaq 0x18f319(%rip), %rdx    # 0x569122
leaq 0x18f2fb(%rip), %rcx    # 0x56910b
leaq 0x18f21a(%rip), %r8     # 0x569031
movl $0xac, %r9d
movb $0x0, %al
callq 0x33960
callq 0x2f830
jmp 0x3d9e2b
movq 0x48(%rsp), %rax
subq 0x40(%rsp), %rax
addq 0x30(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rcx
subq $0x1, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x58(%rsp), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x18(%rsp)
jmp 0x3d9d74
jmp 0x3d9e7c
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x38(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
je 0x3d9ecf
movq 0x22212a(%rip), %rax    # 0x5fbfc8
movq (%rax), %rdi
leaq 0x1216f5(%rip), %rsi    # 0x4fb59d
leaq 0x18f28a(%rip), %rdx    # 0x569139
leaq 0x18f255(%rip), %rcx    # 0x56910b
leaq 0x18f174(%rip), %r8     # 0x569031
movl $0xb2, %r9d
movb $0x0, %al
callq 0x33960
callq 0x2f830
jmp 0x3d9ed1
movq 0x50(%rsp), %rdi
callq 0x129cf0
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl $0x10, %edx
leaq 0x2f(%rip), %rcx        # 0x3d9f20
callq 0x32660
movq 0x20(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x3d9f0b
movq $0x0, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)