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

  for (readidx = 0; (position = suftab[readidx]) < 0; readidx++)
  {
    position = ~position;
    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;
        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);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, %eax
jge 0x2d27f6
movl 0xc(%rsp), %eax
xorl $-0x1, %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %edx
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x18(%rsp), %rax
addq $0x1, %rax
cmpq 0x20(%rsp), %rax
jb 0x2d27df
movq 0x3697f2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24385b(%rip), %rsi    # 0x516013
leaq 0x2ba0aa(%rip), %rdx    # 0x58c869
leaq 0x2ba0c5(%rip), %rcx    # 0x58c88b
leaq 0x2b989b(%rip), %r8     # 0x58c068
movl $0x32a, %r9d            # imm = 0x32A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d27e1
jmp 0x2d27e3
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x2d2765
movq 0x18(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x2d2937
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x2d2820
movq 0x18(%rsp), %rax
cmpq 0x20(%rsp), %rax
jb 0x2d2864
movq 0x36976d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2437d6(%rip), %rsi    # 0x516013
leaq 0x2ba05f(%rip), %rdx    # 0x58c8a3
leaq 0x2ba040(%rip), %rcx    # 0x58c88b
leaq 0x2b9816(%rip), %r8     # 0x58c068
movl $0x330, %r9d            # imm = 0x330
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d2866
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, %eax
jge 0x2d290f
movl 0xc(%rsp), %eax
xorl $-0x1, %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jb 0x2d28cf
movq 0x369702(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24376b(%rip), %rsi    # 0x516013
leaq 0x2ba010(%rip), %rdx    # 0x58c8bf
leaq 0x2b9fd5(%rip), %rcx    # 0x58c88b
leaq 0x2b97ab(%rip), %r8     # 0x58c068
movl $0x334, %r9d            # imm = 0x334
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d28d1
movl 0xc(%rsp), %edx
movq 0x28(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rsp)
movl %edx, (%rax,%rcx,4)
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x10(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x2d290d
jmp 0x2d2935
jmp 0x2d2920
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x2d2922
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x2d281e
jmp 0x2d2941
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x2d2943
movq 0x10(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x2d2987
movq 0x36964a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2436b3(%rip), %rsi    # 0x516013
leaq 0x2b9f6b(%rip), %rdx    # 0x58c8d2
leaq 0x2b9f1d(%rip), %rcx    # 0x58c88b
leaq 0x2b96f3(%rip), %r8     # 0x58c068
movl $0x344, %r9d            # imm = 0x344
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2d2989
addq $0x38, %rsp
retq
nop