// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-sain.c
// Function: gt_sain_assignSstarnames
static GtUword gt_sain_assignSstarnames(const GtSainseq *sainseq,
                                        GtUword countSstartype,
                                        GtUsainindextype *suftab)
{
  GtUsainindextype *suftabptr, *secondhalf = suftab + countSstartype,
                   previouspos;
  GtUword previouslen, currentname = 1UL;

  previouspos = suftab[0];
  previouslen = (GtUword) secondhalf[GT_DIV2(previouspos)];
  secondhalf[GT_DIV2(previouspos)] = (GtUsainindextype) currentname;
  for (suftabptr = suftab + 1UL; suftabptr < suftab + countSstartype;
       suftabptr++)
  {
    int cmp = 0;
    GtUsainindextype position = *suftabptr;
    GtUword currentlen = 0;

    currentlen = (GtUword) secondhalf[GT_DIV2(position)];
    if (previouslen == currentlen)
    {
      switch (sainseq->seqtype)
      {
        case GT_SAIN_PLAINSEQ:
          cmp = gt_sain_PLAINSEQ_compare_Sstarstrings(sainseq,
                                                      sainseq->seq.plainseq,
                                                      (GtUword) previouspos,
                                                      (GtUword) position,
                                                      currentlen);
          break;
        case GT_SAIN_ENCSEQ:
          cmp = gt_sain_ENCSEQ_compare_Sstarstrings(sainseq,
                                                    sainseq->seq.encseq,
                                                    (GtUword) previouspos,
                                                    (GtUword) position,
                                                    currentlen);
          break;
        case GT_SAIN_INTSEQ:
          cmp = gt_sain_INTSEQ_compare_Sstarstrings(sainseq,
                                                    sainseq->seq.array,
                                                    (GtUword) previouspos,
                                                    (GtUword) position,
                                                    currentlen);
          break;
        case GT_SAIN_BARE_ENCSEQ:
          cmp = gt_sain_BARE_ENCSEQ_compare_Sstarstrings(sainseq,
                                                         sainseq->seq.plainseq,
                                                         (GtUword) previouspos,
                                                         (GtUword) position,
                                                         currentlen);
          break;
      }
      gt_assert(cmp != 1);
    } else
    {
      cmp = -1;
    }
    if (cmp == -1)
    {
      currentname++;
    }
    /* write the names in order of positions. As the positions of
       the Sstar suffixes differ by at least 2, the used address
       is unique */
    previouslen = currentlen;
    secondhalf[GT_DIV2(position)] = (GtUsainindextype) currentname;
    previouspos = position;
  }
  return currentname;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
movq $0x1, 0x18(%rsp)
movq 0x40(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x2c(%rsp)
movq 0x30(%rsp), %rax
movl 0x2c(%rsp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rax
movl %eax, %edx
movq 0x30(%rsp), %rax
movl 0x2c(%rsp), %ecx
shrl %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movq 0x40(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x2d2c75
movl $0x0, 0x14(%rsp)
movq 0x38(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x30(%rsp), %rax
movl 0x10(%rsp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x2d2c1c
movq 0x50(%rsp), %rax
movl 0x50(%rax), %eax
movq %rax, (%rsp)
subq $0x3, %rax
ja 0x2d2bd7
movq (%rsp), %rax
leaq 0x2b94f0(%rip), %rcx    # 0x58c018
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x50(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x38(%rax), %rsi
movl 0x2c(%rsp), %eax
movl %eax, %edx
movl 0x10(%rsp), %eax
movl %eax, %ecx
movq 0x8(%rsp), %r8
callq 0x2d7ff0
movl %eax, 0x14(%rsp)
jmp 0x2d2bd7
movq 0x50(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x38(%rax), %rsi
movl 0x2c(%rsp), %eax
movl %eax, %edx
movl 0x10(%rsp), %eax
movl %eax, %ecx
movq 0x8(%rsp), %r8
callq 0x2d81e0
movl %eax, 0x14(%rsp)
jmp 0x2d2bd7
movq 0x50(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x38(%rax), %rsi
movl 0x2c(%rsp), %eax
movl %eax, %edx
movl 0x10(%rsp), %eax
movl %eax, %ecx
movq 0x8(%rsp), %r8
callq 0x2d8420
movl %eax, 0x14(%rsp)
jmp 0x2d2bd7
movq 0x50(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x38(%rax), %rsi
movl 0x2c(%rsp), %eax
movl %eax, %edx
movl 0x10(%rsp), %eax
movl %eax, %ecx
movq 0x8(%rsp), %r8
callq 0x2d8610
movl %eax, 0x14(%rsp)
jmp 0x2d2bd9
cmpl $0x1, 0x14(%rsp)
jne 0x2d2c18
movq 0x3693b9(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x243422(%rip), %rsi    # 0x516013
leaq 0x2b9d9c(%rip), %rdx    # 0x58c994
leaq 0x2b9d9e(%rip), %rcx    # 0x58c99d
leaq 0x2b9462(%rip), %r8     # 0x58c068
movl $0x498, %r9d            # imm = 0x498
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d2c1a
jmp 0x2d2c24
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
cmpl $-0x1, 0x14(%rsp)
jne 0x2d2c39
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rax
movl %eax, %edx
movq 0x30(%rsp), %rax
movl 0x10(%rsp), %ecx
shrl %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movl 0x10(%rsp), %eax
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x38(%rsp)
jmp 0x2d2aa7
movq 0x18(%rsp), %rax
addq $0x58, %rsp
retq
nop