// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-sain.c
// Function: gt_sain_insertsortedSstarsuffixes
static void gt_sain_insertsortedSstarsuffixes(const GtSainseq *sainseq,
                                              GtUsainindextype *suftab,
                                              GtUword readidx,
                                              GtUword nonspecialentries)
{
  GtUword cc, fillidx = nonspecialentries;

  for (cc = sainseq->numofchars - 1; /* Nothing */; cc--)
  {
    if (sainseq->sstarfirstcharcount[cc] > 0)
    {
      GtUword putidx = fillidx - 1;

      gt_assert(readidx <= putidx);
      if (readidx < putidx)
      {
        GtUsainindextype offset;

        for (offset = 0; offset < sainseq->sstarfirstcharcount[cc]; offset++)
        {
          suftab[putidx - offset] = suftab[readidx - offset];
          suftab[readidx - offset] = 0;
#ifdef SAINSHOWSTATE
          printf("insertsorted: suftab["GT_WU"]="GT_WU"\n",putidx-offset,
                                                   suftab[putidx-offset]);
          printf("insertsorted: suftab["GT_WU"]=undef\n",readidx-offset);
#endif
        }
      }
    }
    gt_assert(fillidx >= (GtUword) sainseq->bucketsize[cc]);
    fillidx -= sainseq->bucketsize[cc];
    gt_assert(sainseq->bucketsize[cc] >=
              sainseq->sstarfirstcharcount[cc]);
    if (sainseq->bucketsize[cc] > sainseq->sstarfirstcharcount[cc])
    {
      gt_sain_setundefined(false,suftab,fillidx,
                           fillidx + sainseq->bucketsize[cc] -
                           sainseq->sstarfirstcharcount[cc] - 1);
    }
    readidx -= (GtUword) sainseq->sstarfirstcharcount[cc];
    if (cc == 0)
    {
      break;
    }
  }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
subq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x20(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jbe 0x2d3a3c
movq 0x18(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x10(%rsp), %rax
jbe 0x2d39be
movq 0x368613(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24267c(%rip), %rsi    # 0x516013
leaq 0x2b9398(%rip), %rdx    # 0x58cd36
leaq 0x2b93a3(%rip), %rcx    # 0x58cd48
leaq 0x2b86bc(%rip), %r8     # 0x58c068
movl $0x4cf, %r9d            # imm = 0x4CF
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d39c0
movq 0x30(%rsp), %rax
cmpq 0x10(%rsp), %rax
jae 0x2d3a3a
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x40(%rsp), %rcx
movq 0x28(%rcx), %rcx
movq 0x20(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jae 0x2d3a38
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
movl 0xc(%rsp), %edx
subq %rdx, %rcx
movl (%rax,%rcx,4), %edx
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
movl 0xc(%rsp), %esi
subq %rsi, %rcx
movl %edx, (%rax,%rcx,4)
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
movl 0xc(%rsp), %edx
subq %rdx, %rcx
movl $0x0, (%rax,%rcx,4)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x2d39d4
jmp 0x2d3a3a
jmp 0x2d3a3c
jmp 0x2d3a3e
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq 0x20(%rsp), %rdx
movl (%rcx,%rdx,4), %ecx
cmpq %rcx, %rax
jae 0x2d3a91
movq 0x368540(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2425a9(%rip), %rsi    # 0x516013
leaq 0x2b92f9(%rip), %rdx    # 0x58cd6a
leaq 0x2b92d0(%rip), %rcx    # 0x58cd48
leaq 0x2b85e9(%rip), %r8     # 0x58c068
movl $0x4e0, %r9d            # imm = 0x4E0
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d3a93
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, %ecx
movq 0x18(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x40(%rsp), %rcx
movq 0x28(%rcx), %rcx
movq 0x20(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jae 0x2d3b0f
movq 0x3684c2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24252b(%rip), %rsi    # 0x516013
leaq 0x2b92a8(%rip), %rdx    # 0x58cd97
leaq 0x2b9252(%rip), %rcx    # 0x58cd48
leaq 0x2b856b(%rip), %r8     # 0x58c068
movl $0x4e3, %r9d            # imm = 0x4E3
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d3b11
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x40(%rsp), %rcx
movq 0x28(%rcx), %rcx
movq 0x20(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jbe 0x2d3b77
movq 0x38(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rsp), %rdi
movl (%rax,%rdi,4), %eax
addq %rax, %rcx
movq 0x40(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x20(%rsp), %rdi
movl (%rax,%rdi,4), %eax
subq %rax, %rcx
subq $0x1, %rcx
xorl %edi, %edi
callq 0x2d30b0
movq 0x40(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x20(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, %ecx
movq 0x30(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x2d3ba1
jmp 0x2d3bb6
jmp 0x2d3ba3
movq 0x20(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2d3954
addq $0x48, %rsp
retq
nopl (%rax,%rax)