// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rsi, 0x8(%rsp)
movl 0x70(%rsp), %esi
movq 0x80(%rsp), %r13
movl 0x78(%rsp), %r11d
movq 0x68(%rsp), %r15
movq %r9, %rax
xorl %edx, %edx
divq %rsi
movq %rdx, %rbp
xorl %eax, %eax
testq %r13, %r13
setne %al
movl 0x88(%rsp), %r9d
movq 0x90(%rsp), %r10
movq %rcx, %rsi
movl %r8d, %edx
movl %r11d, %ecx
movq %r15, %r8
pushq %rax
pushq %r10
callq 0x1920b1
popq %rcx
popq %rdx
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x1923e3
movups 0x98(%rsp), %xmm0
movups %xmm0, 0x50(%r12)
leaq 0x10(%rsp), %r15
cmpq 0x60(%rsp), %rbx
ja 0x192092
testq %r14, %r14
je 0x191ff7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x19772f
testb %al, %al
je 0x19208a
movq %rbx, %rax
xorl %edx, %edx
movl 0x70(%rsp), %ecx
divq %rcx
movq %rdx, %rbp
movq 0xa8(%rsp), %rax
incq (%rax)
movq %r15, %rdi
movq 0x68(%rsp), %rsi
movq %rbx, %rdx
movq 0x60(%rsp), %rcx
movq 0x8(%rsp), %r8
movl %ebp, %r9d
callq 0x1353c2
movl %eax, %ebp
movq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x19d00f
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
je 0x19206e
cmpq $0x1, %rdx
je 0x192052
movq 0x10(%rsp), %rsi
movq %r12, %rdi
movl 0x78(%rsp), %ecx
callq 0x192411
movq 0x38(%r12), %rcx
movq 0x48(%r12), %rdx
movq %r13, %rdi
movl 0x78(%rsp), %esi
movq %r15, %r8
movq %rbx, %r9
callq 0x19d07d
movq 0x48(%r12), %rdx
movq %r13, %rdi
movl 0x78(%rsp), %esi
movq 0x68(%rsp), %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x19d3fb
incq %rbx
jmp 0x191fc5
movq %r12, %rdi
movq 0xb0(%rsp), %rsi
callq 0x193944
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq