// File: /workspace/github_c_makefile_star2_O0/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 %rbx
subq $0x70, %rsp
movq 0xd0(%rsp), %rax
movq 0xc8(%rsp), %rax
movq 0xc0(%rsp), %rax
movq 0xb8(%rsp), %rax
movq 0xb0(%rsp), %rax
movl 0xa8(%rsp), %eax
movq 0xa0(%rsp), %rax
movl 0x98(%rsp), %eax
movl 0x90(%rsp), %eax
movq 0x88(%rsp), %rax
movq 0x80(%rsp), %rax
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movl %r8d, 0x4c(%rsp)
movq %r9, 0x40(%rsp)
movq 0x40(%rsp), %rax
movl 0x90(%rsp), %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, 0x34(%rsp)
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rsi
movl 0x4c(%rsp), %edx
movl 0x98(%rsp), %ecx
movq 0x88(%rsp), %r8
movl 0xa8(%rsp), %r9d
movq 0xb0(%rsp), %r11
movq 0xa0(%rsp), %rbx
xorl %eax, %eax
movl $0x1, %r10d
cmpq $0x0, %rbx
cmovnel %r10d, %eax
cmpl $0x0, %eax
setne %r10b
movq %rsp, %rax
movq %r11, (%rax)
movzbl %r10b, %r10d
andl $0x1, %r10d
movl %r10d, 0x8(%rax)
callq 0x2b19a0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq 0x2b20f0
movq 0xc0(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0xb8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
cmpq 0x80(%rsp), %rax
ja 0x2b1982
cmpq $0x0, 0x58(%rsp)
je 0x2b188d
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x2bbea0
testb $0x1, %al
jne 0x2b186d
jmp 0x2b1886
movq 0x38(%rsp), %rax
movl 0x90(%rsp), %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, 0x34(%rsp)
jmp 0x2b188b
jmp 0x2b196f
jmp 0x2b188d
movq 0xc8(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x88(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq 0x60(%rsp), %r8
movl 0x34(%rsp), %r9d
leaq 0x18(%rsp), %rdi
callq 0x2058b0
movl %eax, 0x34(%rsp)
movq 0xa0(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x2c6bf0
cmpq $0x0, 0x20(%rsp)
jbe 0x2b1940
cmpq $0x1, 0x20(%rsp)
jbe 0x2b1910
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movl 0x98(%rsp), %eax
movl %eax, %ecx
callq 0x2b2160
movq 0xa0(%rsp), %rdi
movl 0x98(%rsp), %esi
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdx
movq 0x10(%rsp), %rax
movq 0x38(%rax), %rcx
movq 0x38(%rsp), %r9
leaq 0x18(%rsp), %r8
callq 0x2c6ce0
movq 0xa0(%rsp), %rdi
movl 0x98(%rsp), %esi
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdx
movq 0x88(%rsp), %rcx
movq 0x38(%rsp), %r9
leaq 0x18(%rsp), %r8
callq 0x2c73d0
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x2b183d
movq 0x10(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0x2b39f0
addq $0x70, %rsp
popq %rbx
retq
nopw (%rax,%rax)