// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/firstcodes.c
// Function: gt_firstcodes_sortremaining
static int gt_firstcodes_sortremaining(GtShortreadsortworkinfo *srsw,
                                       const GtEncseq *encseq,
                                       GtReadmode readmode,
                                       const GtSpmsuftab *spmsuftab,
                                       const GtSeqnumrelpos *snrp,
                                       const GtFirstcodestab *fct,
                                       GtUword minindex,
                                       GtUword maxindex,
                                       GtUword sumofwidth,
                                       GtUword spaceforbucketprocessing,
                                       GtUword depth,
                                       GtFirstcodesintervalprocess itvprocess,
                                       GtFirstcodesintervalprocess_end
                                              itvprocess_end,
                                       void *itvprocessdata,
                                       bool withsuftabcheck,
                                       GtError *err)
{
  GtUword current,
                next = GT_UNDEF_UWORD,
                idx,
                width,
                GT_UNUSED sumwidth = 0,
                previoussuffix = 0;
  GtShortreadsortresult srsresult;
  bool previousdefined = false, haserr = false;

  current = gt_firstcodes_get_leftborder(fct,minindex);
  for (idx = minindex; idx <= maxindex; idx++)
  {
    if (idx < maxindex)
    {
      next = gt_firstcodes_get_leftborder(fct,idx+1);
      gt_assert(current < next);
      width = next - current;
    } else
    {
      gt_assert(sumofwidth > current);
      width = sumofwidth - current;
    }
    sumwidth += width;
    gt_assert(sumwidth <= spmsuftab->numofentries);
    if (width >= 2UL)
    {
      gt_shortreadsort_firstcodes_sort(&srsresult,
                                       srsw,
                                       snrp,
                                       encseq,
                                       spmsuftab,
                                       current,
                                       width,
                                       depth,
                                       0);
      if (withsuftabcheck)
      {
        gt_firstcodes_checksuftab_bucket(encseq,
                                         readmode,
                                         NULL,
                                         NULL,
                                         previoussuffix,
                                         previousdefined,
                                         srsresult.suftab_bucket,
                                         snrp,
                                         srsresult.lcptab_bucket,
                                         width);
        previousdefined = true;
        previoussuffix
          = gt_seqnumrelpos_decode_pos(snrp,srsresult.suftab_bucket[width-1]);
      }
      if (itvprocess != NULL)
      {
        if (itvprocess(itvprocessdata,
                       srsresult.suftab_bucket,
                       snrp,srsresult.lcptab_bucket,width,
                       spaceforbucketprocessing,err) != 0)
        {
          haserr = true;
          break;
        }
      }
    } else
    {
      gt_assert(width == 1UL);
    }
    gt_assert(next != GT_UNDEF_UWORD);
    current = next;
  }
  if (itvprocess_end != NULL)
  {
    itvprocess_end(itvprocessdata);
  }
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
movq 0xf8(%rsp), %rax
movb 0xf0(%rsp), %al
movq 0xe8(%rsp), %r10
movq 0xe0(%rsp), %r10
movq 0xd8(%rsp), %r10
movq 0xd0(%rsp), %r10
movq 0xc8(%rsp), %r10
movq 0xc0(%rsp), %r10
movq 0xb8(%rsp), %r10
movq 0xb0(%rsp), %r10
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movl %edx, 0x8c(%rsp)
movq %rcx, 0x80(%rsp)
movq %r8, 0x78(%rsp)
movq %r9, 0x70(%rsp)
andb $0x1, %al
movb %al, 0x6f(%rsp)
movq $-0x1, 0x58(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x0, 0x27(%rsp)
movb $0x0, 0x26(%rsp)
movq 0x70(%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x4c0d80
movq %rax, 0x60(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpq 0xb8(%rsp), %rax
ja 0x24aaf1
movq 0x50(%rsp), %rax
cmpq 0xb8(%rsp), %rax
jae 0x24a860
movq 0x70(%rsp), %rdi
movq 0x50(%rsp), %rsi
addq $0x1, %rsi
callq 0x4c0d80
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rax
cmpq 0x58(%rsp), %rax
jb 0x24a84d
movq 0x3f1784(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2cb7ed(%rip), %rsi    # 0x516013
leaq 0x32e3b9(%rip), %rdx    # 0x578be6
leaq 0x32e3c1(%rip), %rcx    # 0x578bf5
leaq 0x32d9c1(%rip), %r8     # 0x5781fc
movl $0x14a, %r9d            # imm = 0x14A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x24a84f
movq 0x58(%rsp), %rax
subq 0x60(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x24a8bd
jmp 0x24a862
movq 0xc0(%rsp), %rax
cmpq 0x60(%rsp), %rax
ja 0x24a8a9
movq 0x3f1728(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2cb791(%rip), %rsi    # 0x516013
leaq 0x32e388(%rip), %rdx    # 0x578c11
leaq 0x32e365(%rip), %rcx    # 0x578bf5
leaq 0x32d965(%rip), %r8     # 0x5781fc
movl $0x14e, %r9d            # imm = 0x14E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x24a8ab
movq 0xc0(%rsp), %rax
subq 0x60(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq 0x80(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x24a917
movq 0x3f16ba(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2cb723(%rip), %rsi    # 0x516013
leaq 0x32e32f(%rip), %rdx    # 0x578c26
leaq 0x32e2f7(%rip), %rcx    # 0x578bf5
leaq 0x32d8f7(%rip), %r8     # 0x5781fc
movl $0x152, %r9d            # imm = 0x152
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x24a919
cmpq $0x2, 0x48(%rsp)
jb 0x24aa4a
movq 0x98(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0x80(%rsp), %r8
movq 0x60(%rsp), %r9
movq 0x48(%rsp), %r10
movq 0xd0(%rsp), %rax
leaq 0x28(%rsp), %rdi
xorl %r11d, %r11d
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
callq 0x2dce80
testb $0x1, 0x6f(%rsp)
je 0x24a9f2
movq 0x90(%rsp), %rdi
movl 0x8c(%rsp), %esi
movq 0x38(%rsp), %r8
movb 0x27(%rsp), %r9b
movq 0x28(%rsp), %rbx
movq 0x78(%rsp), %r11
movq 0x30(%rsp), %r10
movq 0x48(%rsp), %rax
xorl %ecx, %ecx
andb $0x1, %r9b
movq %rcx, %rdx
movzbl %r9b, %r9d
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x24af70
movb $0x1, 0x27(%rsp)
movq 0x78(%rsp), %rdi
movq 0x28(%rsp), %rax
movq 0x48(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x2b11d0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0xd8(%rsp)
je 0x24aa48
movq 0xd8(%rsp), %rax
movq 0xe8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0xc8(%rsp), %r9
movq 0xf8(%rsp), %r10
movq %r10, (%rsp)
callq *%rax
cmpl $0x0, %eax
je 0x24aa46
movb $0x1, 0x26(%rsp)
jmp 0x24aaf1
jmp 0x24aa48
jmp 0x24aa90
jmp 0x24aa4c
cmpq $0x1, 0x48(%rsp)
je 0x24aa8c
movq 0x3f1545(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2cb5ae(%rip), %rsi    # 0x516013
leaq 0x32e1de(%rip), %rdx    # 0x578c4a
leaq 0x32e182(%rip), %rcx    # 0x578bf5
leaq 0x32d782(%rip), %r8     # 0x5781fc
movl $0x17b, %r9d            # imm = 0x17B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x24aa8e
jmp 0x24aa90
jmp 0x24aa92
cmpq $-0x1, 0x58(%rsp)
jne 0x24aad2
movq 0x3f14ff(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2cb568(%rip), %rsi    # 0x516013
leaq 0x3349f8(%rip), %rdx    # 0x57f4aa
leaq 0x32e13c(%rip), %rcx    # 0x578bf5
leaq 0x32d73c(%rip), %r8     # 0x5781fc
movl $0x17d, %r9d            # imm = 0x17D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x24aad4
movq 0x58(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x24a7cf
cmpq $0x0, 0xe0(%rsp)
je 0x24ab0e
movq 0xe0(%rsp), %rax
movq 0xe8(%rsp), %rdi
callq *%rax
movb 0x26(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0xa0, %rsp
popq %rbx
retq
nopl (%rax,%rax)