// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/sfx-bentsedg.c
// Function: gt_sortallbuckets
void gt_sortallbuckets(GtSuffixsortspace *suffixsortspace,
                       GtUword numberofsuffixes,
                       GtBucketspec2 *bucketspec2,
                       const GtEncseq *encseq,
                       GtReadmode readmode,
                       GtCodetype mincode,
                       GtCodetype maxcode,
                       const GtBcktab *bcktab,
                       unsigned int numofchars,
                       unsigned int prefixlength,
                       GtOutlcpinfo *outlcpinfo,
                       unsigned int sortmaxdepth,
                       const Sfxstrategy *sfxstrategy,
                       GtProcessunsortedsuffixrange processunsortedsuffixrange,
                       void *processunsortedsuffixrangeinfo,
                       GtUint64 *bucketiterstep,
                       GtLogger *logger)
{
  GtCodetype code;
  unsigned int rightchar = (unsigned int) (mincode % numofchars);
  GtBucketspecification bucketspec;
  GtBentsedgresources *bsr = bentsedgresources_new(suffixsortspace,
                                                   encseq,
                                                   readmode,
                                                   prefixlength,
                                                   bcktab,
                                                   sortmaxdepth,
                                                   sfxstrategy,
                                                   outlcpinfo != NULL ? true
                                                                      : false);
  gt_bentsedgresources_addlcpinfo(bsr,outlcpinfo,bcktab);
  bsr->processunsortedsuffixrangeinfo = processunsortedsuffixrangeinfo;
  bsr->processunsortedsuffixrange = processunsortedsuffixrange;
  for (code = mincode; code <= maxcode; code++)
  {
    if (bucketspec2 != NULL)
    {
      if (gt_copysort_checkhardwork(bucketspec2,code))
      {
        rightchar = (unsigned int) (code % numofchars);
      } else
      {
        continue;
      }
    }
    (*bucketiterstep)++;
    rightchar = gt_bcktab_calcboundsparts(&bucketspec,
                                          bcktab,
                                          code,
                                          maxcode,
                                          numberofsuffixes,
                                          rightchar);
    gt_Outlcpinfo_prebucket(outlcpinfo,code,bucketspec.left);
    if (bucketspec.nonspecialsinbucket > 0)
    {
      if (bucketspec.nonspecialsinbucket > 1UL)
      {
        gt_sort_bentleysedgewick(bsr,bucketspec.left,
                                 bucketspec.nonspecialsinbucket,
                                 (GtUword) prefixlength);
      }
      gt_Outlcpinfo_nonspecialsbucket(outlcpinfo,
                                      prefixlength,
                                      bsr->sssp,
                                      bsr->tableoflcpvalues,
                                      &bucketspec,
                                      code);
    }
    gt_Outlcpinfo_postbucket(outlcpinfo,
                             prefixlength,
                             bsr->sssp,
                             bcktab,
                             &bucketspec,
                             code);
  }
  bentsedgresources_delete(bsr, logger);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %rdx, %r15
movq %rsi, 0x8(%rsp)
movq 0x80(%rsp), %r13
movl 0x78(%rsp), %r10d
movq 0x68(%rsp), %r14
movl 0x88(%rsp), %r9d
xorl %eax, %eax
testq %r13, %r13
setne %al
movq %rcx, %rsi
movl %r8d, %edx
movl %r10d, %ecx
movq %r14, %r8
pushq %rax
pushq 0x98(%rsp)
callq 0x1e309e
addq $0x10, %rsp
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x1e33e9
movups 0x98(%rsp), %xmm0
movups %xmm0, 0x50(%r12)
cmpq 0x60(%rsp), %rbx
ja 0x1e307f
movl 0x70(%rsp), %ecx
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rbp
leaq 0x10(%rsp), %r14
testq %r15, %r15
je 0x1e2fce
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1e7e06
testb %al, %al
je 0x1e3071
movq %rbx, %rax
xorl %edx, %edx
movl 0x70(%rsp), %ecx
divq %rcx
movq %rdx, %rbp
movq 0xa8(%rsp), %rax
incq (%rax)
movq %r14, %rdi
movq 0x68(%rsp), %rsi
movq %rbx, %rdx
movq 0x60(%rsp), %rcx
movq 0x8(%rsp), %r8
movl %ebp, %r9d
callq 0x18be28
movl %eax, %ebp
movq 0x10(%rsp), %rdx
movq 0x80(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1eca2b
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
je 0x1e3055
cmpq $0x1, %rdx
je 0x1e3031
movq 0x10(%rsp), %rsi
movq %r12, %rdi
movl 0x78(%rsp), %ecx
callq 0x1e3417
movq 0x38(%r12), %rcx
movq 0x48(%r12), %rdx
movq 0x80(%rsp), %r13
movq %r13, %rdi
movl 0x78(%rsp), %esi
movq %r14, %r8
movq %rbx, %r9
callq 0x1eca9b
movq 0x48(%r12), %rdx
movq %r13, %rdi
movl 0x78(%rsp), %esi
movq 0x68(%rsp), %rcx
movq %r14, %r8
movq %rbx, %r9
callq 0x1ecd0a
incq %rbx
cmpq 0x60(%rsp), %rbx
jbe 0x1e2fa7
movq %r12, %rdi
movq 0xb0(%rsp), %rsi
callq 0x1e4acf
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq