// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-sain.c
// Function: gt_sain_fast_moveSstar2front
static GtUword gt_sain_fast_moveSstar2front(
                                      GtUword totallength,
                                      GtUword countSstartype,
                                      GtSsainindextype *suftab,
                                      GT_UNUSED GtUword nonspecialentries)
{
  GtUword readidx, namecount = 0, writeidx = 0;
  GtSsainindextype position;

  for (readidx = 0; (position = suftab[readidx]) < 0; readidx++)
  {
    position = ~position;
    if (position >= (GtSsainindextype) totallength)
    {
      namecount++;
    }
    suftab[readidx] = position;
    gt_assert ((readidx + 1) < nonspecialentries);
  }
  if (readidx < countSstartype)
  {
    for (writeidx = readidx, readidx++; /* Nothing */; readidx++)
    {
      gt_assert (readidx < nonspecialentries);
      if ((position = suftab[readidx]) < 0)
      {
        position = ~position;
        if (position >= (GtSsainindextype) totallength)
        {
          namecount++;
        }
        gt_assert(writeidx < readidx);
        suftab[writeidx++] = position;
        suftab[readidx] = 0;
        if (writeidx == countSstartype)
        {
          break;
        }
      } else
      {
        suftab[readidx] = 0;
      }
    }
  } else
  {
    writeidx = readidx;
  }
  gt_assert(writeidx == countSstartype);
  return namecount;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, %eax
jge 0x2d2d63
movl 0xc(%rsp), %eax
xorl $-0x1, %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl %ecx, %eax
jl 0x2d2cf3
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
movl 0xc(%rsp), %edx
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x20(%rsp), %rax
addq $0x1, %rax
cmpq 0x28(%rsp), %rax
jb 0x2d2d4c
movq 0x369285(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2432ee(%rip), %rsi    # 0x516013
leaq 0x2b9b3d(%rip), %rdx    # 0x58c869
leaq 0x2b9d8f(%rip), %rcx    # 0x58cac2
leaq 0x2b932e(%rip), %r8     # 0x58c068
movl $0x358, %r9d            # imm = 0x358
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d2d4e
jmp 0x2d2d50
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2d2cb3
movq 0x20(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x2d2ec1
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2d2d8d
movq 0x20(%rsp), %rax
cmpq 0x28(%rsp), %rax
jb 0x2d2dd1
movq 0x369200(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x243269(%rip), %rsi    # 0x516013
leaq 0x2b9af2(%rip), %rdx    # 0x58c8a3
leaq 0x2b9d0a(%rip), %rcx    # 0x58cac2
leaq 0x2b92a9(%rip), %r8     # 0x58c068
movl $0x35e, %r9d            # imm = 0x35E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d2dd3
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, %eax
jge 0x2d2e99
movl 0xc(%rsp), %eax
xorl $-0x1, %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl %ecx, %eax
jl 0x2d2e13
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x2d2e15
movq 0x10(%rsp), %rax
cmpq 0x20(%rsp), %rax
jb 0x2d2e59
movq 0x369178(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2431e1(%rip), %rsi    # 0x516013
leaq 0x2b9a86(%rip), %rdx    # 0x58c8bf
leaq 0x2b9c82(%rip), %rcx    # 0x58cac2
leaq 0x2b9221(%rip), %r8     # 0x58c068
movl $0x366, %r9d            # imm = 0x366
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d2e5b
movl 0xc(%rsp), %edx
movq 0x30(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rsp)
movl %edx, (%rax,%rcx,4)
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x10(%rsp), %rax
cmpq 0x38(%rsp), %rax
jne 0x2d2e97
jmp 0x2d2ebf
jmp 0x2d2eaa
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x2d2eac
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2d2d8b
jmp 0x2d2ecb
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x2d2ecd
movq 0x10(%rsp), %rax
cmpq 0x38(%rsp), %rax
je 0x2d2f11
movq 0x3690c0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x243129(%rip), %rsi    # 0x516013
leaq 0x2b99e1(%rip), %rdx    # 0x58c8d2
leaq 0x2b9bca(%rip), %rcx    # 0x58cac2
leaq 0x2b9169(%rip), %r8     # 0x58c068
movl $0x376, %r9d            # imm = 0x376
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d2f13
movq 0x18(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)