// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, %rbx
movq %r8, 0x28(%rsp)
movq %rcx, %r14
movl %edx, 0x44(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdi, 0x80(%rsp)
movq 0xd8(%rsp), %r13
movq 0xd0(%rsp), %r12
movq %r9, %rdi
movq %r12, %rsi
callq 0x2b74eb
movq %rax, %rsi
pushq $-0x1
popq %rax
xorl %edx, %edx
movq $0x0, 0x30(%rsp)
xorl %ebp, %ebp
movq %rbx, 0x78(%rsp)
movq %r14, 0x70(%rsp)
cmpq %r13, %r12
ja 0x15a689
movq %rsi, %r15
movq %r12, 0x38(%rsp)
jae 0x15a450
leaq 0x1(%r12), %rsi
movq %rbx, %rdi
movq %rdx, %r12
callq 0x2b74eb
movq %r12, %rdx
movq %rax, %rsi
movq %rax, %r12
cmpq %rax, %r15
jb 0x15a467
jmp 0x15a7af
movq %rax, %rsi
movq 0xe0(%rsp), %rax
movq %rax, %r12
cmpq %rax, %r15
jae 0x15a77e
subq %r15, %r12
addq %r12, %rdx
cmpq 0x8(%r14), %rdx
movq 0x58(%rsp), %rcx
ja 0x15a74d
cmpq $0x2, %r12
jb 0x15a5a4
movq %rsi, 0x48(%rsp)
movq %rdx, 0x50(%rsp)
andq $0x0, 0x10(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r12, (%rsp)
leaq 0x60(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %r14, %r8
movq %r15, %r9
movq %rcx, %r15
callq 0x1a8af1
cmpb $0x0, 0x110(%rsp)
je 0x15a5e6
movq 0x60(%rsp), %r14
movq 0x68(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %r15, %rdi
callq 0x7055e
movq %rax, %r15
cmpq 0x30(%rsp), %rax
setbe %al
testb %al, %bpl
jne 0x15a80b
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x15a5b8
movq (%r14,%r13,8), %rsi
movq 0x28(%rsp), %rdi
callq 0x191c81
movq %rax, %rbx
cmpq %r15, %r13
setb %al
andb %al, %bpl
cmpb $0x1, %bpl
jne 0x15a594
cmpq %r15, %rbx
jae 0x15a6ba
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movq %rbx, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rdi
movl 0x44(%rsp), %esi
leaq 0x90(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x77ebd
testl %eax, %eax
jg 0x15a6eb
testq %r13, %r13
je 0x15a594
movq 0x88(%rsp), %rax
movzwl (%rax,%r13,2), %eax
cmpq %rax, 0x90(%rsp)
jne 0x15a71c
incq %r13
movb $0x1, %bpl
movq %rbx, 0x30(%rsp)
jmp 0x15a506
cmpq $0x1, %r12
movq 0x38(%rsp), %r12
je 0x15a648
jmp 0x15a7dd
movq 0x60(%rsp), %rax
movq -0x8(%rax,%r12,8), %rsi
movq 0x28(%rsp), %rdi
callq 0x191c81
movq %rax, 0x30(%rsp)
movb $0x1, %bpl
movq 0x78(%rsp), %rbx
movq 0x70(%rsp), %r14
movq 0xd8(%rsp), %r13
movq 0xf8(%rsp), %r10
testq %r10, %r10
je 0x15a639
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rcx
movq 0x118(%rsp), %rax
movq %rax, (%rsp)
movq 0x108(%rsp), %rdi
movq 0x28(%rsp), %rdx
movq %r12, %r8
movq 0xe8(%rsp), %r9
callq *%r10
testl %eax, %eax
movq 0x38(%rsp), %r12
movq 0x50(%rsp), %rdx
movq 0x48(%rsp), %rsi
je 0x15a648
jmp 0x15a689
movq 0x38(%rsp), %r12
movq 0x50(%rsp), %rdx
movq 0x48(%rsp), %rsi
incq %r12
movq %rsi, %rax
cmpq $-0x1, %rsi
jne 0x15a41a
movq 0x2dd909(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18a9aa(%rip), %rsi    # 0x2e5013
leaq 0x1f26cd(%rip), %rdx    # 0x34cd3d
leaq 0x1ec128(%rip), %rcx    # 0x34679f
leaq 0x1eb736(%rip), %r8     # 0x345db4
movl $0x17d, %r9d            # imm = 0x17D
jmp 0x15a837
movq 0x100(%rsp), %rax
testq %rax, %rax
je 0x15a6a0
movq 0x108(%rsp), %rdi
callq *%rax
xorl %eax, %eax
cmpq %r12, %r13
adcl $-0x1, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2dd8a7(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18a948(%rip), %rsi    # 0x2e5013
leaq 0x1ec181(%rip), %rdx    # 0x346853
leaq 0x1ec159(%rip), %rcx    # 0x346832
leaq 0x1eb6d4(%rip), %r8     # 0x345db4
movl $0x116, %r9d            # imm = 0x116
jmp 0x15a837
movq 0x2dd876(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18a917(%rip), %rsi    # 0x2e5013
leaq 0x1ec166(%rip), %rdx    # 0x346869
leaq 0x1ec128(%rip), %rcx    # 0x346832
leaq 0x1eb6a3(%rip), %r8     # 0x345db4
movl $0x121, %r9d            # imm = 0x121
jmp 0x15a837
movq 0x2dd845(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18a8e6(%rip), %rsi    # 0x2e5013
leaq 0x1ec13e(%rip), %rdx    # 0x346872
leaq 0x1ec0f7(%rip), %rcx    # 0x346832
leaq 0x1eb672(%rip), %r8     # 0x345db4
movl $0x122, %r9d            # imm = 0x122
jmp 0x15a837
movq 0x2dd814(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18a8b5(%rip), %rsi    # 0x2e5013
leaq 0x1ec06b(%rip), %rdx    # 0x3467d0
leaq 0x1ec033(%rip), %rcx    # 0x34679f
leaq 0x1eb641(%rip), %r8     # 0x345db4
movl $0x152, %r9d            # imm = 0x152
jmp 0x15a837
movq 0x2dd7e3(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18a884(%rip), %rsi    # 0x2e5013
leaq 0x1ec025(%rip), %rdx    # 0x3467bb
leaq 0x1ec002(%rip), %rcx    # 0x34679f
leaq 0x1eb610(%rip), %r8     # 0x345db4
movl $0x14e, %r9d            # imm = 0x14E
jmp 0x15a837
movq 0x2dd7b2(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18a853(%rip), %rsi    # 0x2e5013
leaq 0x1ebfc9(%rip), %rdx    # 0x346790
leaq 0x1ebfd1(%rip), %rcx    # 0x34679f
leaq 0x1eb5df(%rip), %r8     # 0x345db4
movl $0x14a, %r9d            # imm = 0x14A
jmp 0x15a837
movq 0x2dd784(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18a825(%rip), %rsi    # 0x2e5013
leaq 0x1ebfff(%rip), %rdx    # 0x3467f4
leaq 0x1ebfa3(%rip), %rcx    # 0x34679f
leaq 0x1eb5b1(%rip), %r8     # 0x345db4
movl $0x17b, %r9d            # imm = 0x17B
jmp 0x15a837
movq 0x2dd756(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18a7f7(%rip), %rsi    # 0x2e5013
leaq 0x1ebfde(%rip), %rdx    # 0x346801
leaq 0x1ec008(%rip), %rcx    # 0x346832
leaq 0x1eb583(%rip), %r8     # 0x345db4
movl $0x110, %r9d            # imm = 0x110
xorl %eax, %eax
callq 0x17a50
callq 0x17390