// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %rbx
movq %r8, 0x40(%rsp)
movl %ecx, 0x1c(%rsp)
movq %rdx, %rcx
movq %rsi, 0x38(%rsp)
movq %rdi, %r14
movq 0xb8(%rsp), %r13
movq 0xb0(%rsp), %r15
movq 0xa8(%rsp), %rbp
movq 0xa0(%rsp), %r12
xorl %esi, %esi
movq %rbp, %rdx
callq 0x1fea62
movq %rbx, 0x48(%rsp)
movq %rbx, %rdi
movq %r12, 0x60(%rsp)
movq %r12, %rsi
callq 0x205fd8
leaq 0x20(%r14), %rcx
movq %rcx, 0x50(%rsp)
movq %r14, 0x10(%rsp)
movq $0x0, 0x30(%r14)
cmpq $0x0, 0x8(%rax)
movq %r13, 0x20(%rsp)
movq %rax, 0x30(%rsp)
movq %rbp, 0x28(%rsp)
je 0x1fed7b
testq %rbp, %rbp
movq 0x40(%rsp), %r12
movl 0x1c(%rsp), %r14d
movq %r15, %rdx
movq 0x38(%rsp), %rsi
je 0x1fee05
xorl %ebx, %ebx
movq 0x28(%rsp), %r15
movq %rdx, 0x58(%rsp)
movq 0x10(%rsp), %rbp
xorl %r9d, %r9d
testq %r13, %r13
setne %r9b
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax,%rbx), %rax
movq (%rbp), %rdx
movq %rax, (%rdx,%rbx,2)
movl 0x30(%rbp), %edi
movl %edi, 0x8(%rdx,%rbx,2)
movq 0x58(%rsp), %rdx
leaq (%rax,%rdx), %r8
addq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rdi
movq %r12, %rdx
movl %r14d, %ecx
movq %rsi, %r13
callq 0xf127d
movq %r13, %rsi
movq 0x58(%rsp), %rdx
movq 0x20(%rsp), %r13
movq (%rbp), %rdi
movl %eax, 0xc(%rdi,%rbx,2)
addq $0x8, %rbx
decq %r15
jne 0x1fed0d
jmp 0x1fee05
testq %rbp, %rbp
movq 0x40(%rsp), %r14
movl 0x1c(%rsp), %ecx
movq %r15, %rdx
movq 0x38(%rsp), %r12
je 0x1fee05
xorl %ebx, %ebx
movq 0x28(%rsp), %r15
movq 0x10(%rsp), %r8
xorl %r9d, %r9d
testq %r13, %r13
setne %r9b
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl (%rax,%rbx), %eax
movq (%r8), %rdi
movq %rax, (%rdi,%rbx,4)
movl 0x30(%r8), %r8d
movl %r8d, 0x8(%rdi,%rbx,4)
movq %rdx, %rbp
leaq (%rax,%rdx), %r8
addq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
movl %ecx, %r13d
callq 0xf127d
movl %r13d, %ecx
movq %rbp, %rdx
movq 0x20(%rsp), %r13
movq 0x10(%rsp), %rdi
movq (%rdi), %rdi
movl %eax, 0xc(%rdi,%rbx,4)
addq $0x4, %rbx
decq %r15
jne 0x1fed98
movq 0x28(%rsp), %r13
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq 0x60(%rsp), %r12
movq %r12, %rcx
callq 0x1feeb8
movq 0x30(%rsp), %rbp
cmpq $0x0, 0x8(%rbp)
je 0x1fee69
testq %r13, %r13
movq 0x48(%rsp), %r15
je 0x1feea2
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbx,2), %rax
movq 0x8(%rbp), %rcx
movq %rax, (%rcx,%rbx)
testq %rax, %rax
jne 0x1fee5b
movq %r15, %rdi
movq %r12, %rsi
callq 0x205f1e
incq %r12
addq $0x8, %rbx
decq %r13
jne 0x1fee37
jmp 0x1feea2
testq %r13, %r13
movq 0x48(%rsp), %r15
je 0x1feea2
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl (%rax,%rbx,4), %eax
movq (%rbp), %rcx
movl %eax, (%rcx,%rbx)
testl %eax, %eax
jne 0x1fee96
movq %r15, %rdi
movq %r12, %rsi
callq 0x205f1e
incq %r12
addq $0x4, %rbx
decq %r13
jne 0x1fee75
movq %r15, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20604d