// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-shortreadsort.c
// Function: gt_shortreadsort_sssp_sort
void gt_shortreadsort_sssp_sort(GtShortreadsortworkinfo *srsw,
                                const GtEncseq *encseq,
                                GtUword maxremain,
                                GtReadmode readmode,
                                GtEncseqReader *esr,
                                GtSuffixsortspace *sssp,
                                GtUword subbucketleft,
                                GtUword width,
                                GtUword depth,
                                GtUword maxdepth)
{
  GtUword idx, pos;
  GtSuffixsortspace_exportptr *exportptr;

  gt_shortreadsort_resize(srsw, false, width, maxremain);
  exportptr = gt_suffixsortspace_exportptr(sssp, subbucketleft);
  srsw->tbereservoir.nextfreeGtTwobitencoding = 0;
  if (exportptr->ulongtabsectionptr != NULL)
  {
    for (idx = 0; idx < width; idx++)
    {
      pos = exportptr->ulongtabsectionptr[idx];
      srsw->shortreadsorttable[idx].suffixrepresentation = pos;
      srsw->shortreadsorttable[idx].tbeidx
        = (uint32_t) srsw->tbereservoir.nextfreeGtTwobitencoding;
      srsw->shortreadsorttable[idx].unitsnotspecial
        = gt_encseq_extract2bitencvector(&srsw->tbereservoir,
                                         encseq,
                                         esr,
                                         readmode,
                                         pos+depth,
                                         maxdepth > 0 ? true : false,
                                         pos + maxdepth);
    }
  } else
  {
    for (idx = 0; idx < width; idx++)
    {
      pos = (GtUword) exportptr->uinttabsectionptr[idx];
      srsw->shortreadsorttable[idx].suffixrepresentation = pos;
      srsw->shortreadsorttable[idx].tbeidx
        = (uint32_t) srsw->tbereservoir.nextfreeGtTwobitencoding;
      srsw->shortreadsorttable[idx].unitsnotspecial
        = gt_encseq_extract2bitencvector(&srsw->tbereservoir,
                                         encseq,
                                         esr,
                                         readmode,
                                         pos+depth,
                                         maxdepth > 0 ? true : false,
                                         pos + maxdepth);
    }
  }
  QSORTNAME(gt_inlinedarr_qsort_r) (6UL, false, width, srsw, depth,
                                    subbucketleft);
  if (exportptr->ulongtabsectionptr != NULL)
  {
    for (idx = 0; idx < width; idx++)
    {
      exportptr->ulongtabsectionptr[idx]
        = srsw->shortreadsorttable[idx].suffixrepresentation;
      if (exportptr->ulongtabsectionptr[idx] == 0)
      {
        gt_suffixsortspace_updatelongest(sssp,subbucketleft + idx);
      }
    }
  } else
  {
    for (idx = 0; idx < width; idx++)
    {
      exportptr->uinttabsectionptr[idx]
        = (uint32_t) srsw->shortreadsorttable[idx].suffixrepresentation;
      if (exportptr->uinttabsectionptr[idx] == 0)
      {
        gt_suffixsortspace_updatelongest(sssp,subbucketleft + idx);
      }
    }
  }
  gt_suffixsortspace_export_done(sssp);
}

// Assembly:
subq $0x58, %rsp
movq 0x78(%rsp), %rax
movq 0x70(%rsp), %rax
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rax
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movl %ecx, 0x3c(%rsp)
movq %r8, 0x30(%rsp)
movq %r9, 0x28(%rsp)
movq 0x50(%rsp), %rdi
movq 0x68(%rsp), %rdx
movq 0x40(%rsp), %rcx
xorl %esi, %esi
callq 0x2da840
movq 0x28(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x2e9cf0
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rax
movq $0x0, 0x30(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2dace4
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x68(%rsp), %rax
jae 0x2dacdf
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rcx
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0x50(%rsp), %rax
movq 0x30(%rax), %rax
movl %eax, %ecx
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq 0x50(%rsp), %rdi
addq $0x20, %rdi
movq 0x48(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl 0x3c(%rsp), %ecx
movq 0x18(%rsp), %r8
addq 0x70(%rsp), %r8
movq 0x78(%rsp), %r10
xorl %eax, %eax
movl $0x1, %r9d
cmpq $0x0, %r10
cmoval %r9d, %eax
cmpl $0x0, %eax
setne %al
movq 0x18(%rsp), %r10
addq 0x78(%rsp), %r10
movq %rsp, %r9
movq %r10, (%r9)
movzbl %al, %r9d
andl $0x1, %r9d
callq 0xb3880
movl %eax, %ecx
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2dabf5
jmp 0x2dadd7
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x68(%rsp), %rax
jae 0x2dadd5
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rcx
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0x50(%rsp), %rax
movq 0x30(%rax), %rax
movl %eax, %ecx
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq 0x50(%rsp), %rdi
addq $0x20, %rdi
movq 0x48(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl 0x3c(%rsp), %ecx
movq 0x18(%rsp), %r8
addq 0x70(%rsp), %r8
movq 0x78(%rsp), %r10
xorl %eax, %eax
movl $0x1, %r9d
cmpq $0x0, %r10
cmoval %r9d, %eax
cmpl $0x0, %eax
setne %al
movq 0x18(%rsp), %r10
addq 0x78(%rsp), %r10
movq %rsp, %r9
movq %r10, (%r9)
movzbl %al, %r9d
andl $0x1, %r9d
callq 0xb3880
movl %eax, %ecx
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2daced
jmp 0x2dadd7
movq 0x68(%rsp), %rdx
movq 0x50(%rsp), %rcx
movq 0x70(%rsp), %r8
movq 0x60(%rsp), %r9
movl $0x6, %edi
xorl %esi, %esi
callq 0x2daf10
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2dae7e
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x68(%rsp), %rax
jae 0x2dae7c
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x2dae6a
movq 0x28(%rsp), %rdi
movq 0x60(%rsp), %rsi
addq 0x20(%rsp), %rsi
callq 0x2e9b50
jmp 0x2dae6c
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2dae0c
jmp 0x2daef7
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x68(%rsp), %rax
jae 0x2daef5
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, %edx
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x2daee3
movq 0x28(%rsp), %rdi
movq 0x60(%rsp), %rsi
addq 0x20(%rsp), %rsi
callq 0x2e9b50
jmp 0x2daee5
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2dae87
jmp 0x2daef7
movq 0x28(%rsp), %rdi
callq 0x2e9e50
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)