// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-sain.c
// Function: gt_sain_fast_assignSstarnames
static void gt_sain_fast_assignSstarnames(GtUword totallength,
                                          GtUword countSstartype,
                                          GtUsainindextype *suftab,
                                          GtUword numberofnames,
                                          GtUword nonspecialentries)
{
  GtUsainindextype *suftabptr, *secondhalf = suftab + countSstartype;

  if ((GtUword) numberofnames < countSstartype)
  {
    GtUword currentname = numberofnames + 1;

    for (suftabptr = suftab + nonspecialentries - 1; suftabptr >= suftab;
         suftabptr--)
    {
      GtUsainindextype position;

      if ((position = *suftabptr) >= (GtUsainindextype) totallength)
      {
        position -= totallength;
        gt_assert(currentname > 0);
        currentname--;
      }
      if (currentname <= numberofnames)
      {
        secondhalf[GT_DIV2(position)] = (GtUsainindextype) currentname;
      }
    }
  } else
  {
    for (suftabptr = suftab; suftabptr < suftab + nonspecialentries;
         suftabptr++)
    {
      if (*suftabptr >= (GtUsainindextype) totallength)
      {
        *suftabptr -= totallength;
      }
    }
  }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x2d3049
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x30(%rsp), %rax
jb 0x2d3047
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movq 0x40(%rsp), %rcx
cmpl %ecx, %eax
jb 0x2d300f
movq 0x40(%rsp), %rcx
movl 0x4(%rsp), %eax
subq %rcx, %rax
movl %eax, 0x4(%rsp)
cmpq $0x0, 0x8(%rsp)
ja 0x2d2fff
movq 0x368fd2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24303b(%rip), %rsi    # 0x516013
leaq 0x2b9b00(%rip), %rdx    # 0x58cadf
leaq 0x2b9b09(%rip), %rcx    # 0x58caef
leaq 0x2b907b(%rip), %r8     # 0x58c068
movl $0x38e, %r9d            # imm = 0x38E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d3001
movq 0x8(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq 0x28(%rsp), %rax
ja 0x2d3032
movq 0x8(%rsp), %rax
movl %eax, %edx
movq 0x10(%rsp), %rax
movl 0x4(%rsp), %ecx
shrl %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x2d3034
movq 0x18(%rsp), %rax
addq $-0x4, %rax
movq %rax, 0x18(%rsp)
jmp 0x2d2f8b
jmp 0x2d30a3
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x2d30a1
movq 0x18(%rsp), %rax
movl (%rax), %eax
movq 0x40(%rsp), %rcx
cmpl %ecx, %eax
jb 0x2d308f
movq 0x40(%rsp), %rdx
movq 0x18(%rsp), %rax
movl (%rax), %ecx
subq %rdx, %rcx
movl %ecx, (%rax)
jmp 0x2d3091
movq 0x18(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x18(%rsp)
jmp 0x2d3053
jmp 0x2d30a3
addq $0x48, %rsp
retq
nopl (%rax,%rax)