// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/sfx-diffcov.c
// Function: dc_sortsuffixesonthislevel
static void dc_sortsuffixesonthislevel(GtDifferencecover *dcov,
                                       GtUword blisbl,
                                       GtUword width)
{
  GtUword idx, rangestart, startpos;

  gt_assert(dcov != NULL);
  if (dcov->itvinfo == NULL)
  {
    dcov->itvinfo = gt_malloc(sizeof (*dcov->itvinfo) *
                              dcov->allocateditvinfo);
  }
  if (dcov->firstwithnewdepth.blisbl == blisbl &&
      dcov->firstwithnewdepth.width == width)
  {
    dcov->currentdepth = dcov->firstwithnewdepth.depth;
  }
  gt_assert(dcov->allocateditvinfo >= width);
  /*
  printf("new interval of width "GT_WU"\n",width);
  */
  for (idx=0; idx<width; idx++)
  {
    startpos = dc_suffixptrget(dcov,blisbl+idx);
    dcov->itvinfo[idx].suffixstart = startpos;
    dcov->itvinfo[idx].key
      = dc_inversesuftab_get(dcov,startpos + dcov->currentdepth);
  }
  qsort(dcov->itvinfo,(size_t) width,sizeof (*dcov->itvinfo),dc_compareitv);
  for (idx=0; idx<width; idx++)
  {
    dc_suffixptrset(dcov,blisbl+idx,dcov->itvinfo[idx].suffixstart);
  }
  rangestart = 0;
  for (idx=1UL; idx<width; idx++)
  {
    if (dcov->itvinfo[idx-1].key != dcov->itvinfo[idx].key)
    {
      if (rangestart + 1 < idx)
      {
        dc_processunsortedrange(dcov,
                                blisbl + rangestart,
                                idx - rangestart,
                                GT_MULT2(dcov->currentdepth));
        if (dcov->samplelcpvalues != NULL)
        {
          dc_setlcpvaluesofrunsortedrange(dcov->samplelcpvalues,
                                          blisbl + rangestart,
                                          idx - rangestart,
                                          GT_MULT2(dcov->currentdepth));
        }
        dc_anchorleftmost(dcov, blisbl + rangestart, idx - rangestart);
      } else
      {
        GtUword currentsuftabentry
          = dc_suffixptrget(dcov,blisbl+rangestart);

        gt_assert(rangestart + 1 == idx);
        dc_inversesuftab_set(dcov,currentsuftabentry,
                             blisbl+rangestart);
      }
      if (dcov->samplelcpvalues != NULL)
      {
        gt_lcptab_update(dcov->samplelcpvalues,
                         0,blisbl + idx,dcov->currentdepth);
      }
      rangestart = idx;
    }
  }
  if (rangestart + 1 < width)
  {
    dc_processunsortedrange(dcov,
                            blisbl + rangestart,
                            width - rangestart,
                            GT_MULT2(dcov->currentdepth));
    if (dcov->samplelcpvalues != NULL)
    {
      dc_setlcpvaluesofrunsortedrange(dcov->samplelcpvalues,
                                      blisbl + rangestart,
                                      width - rangestart,
                                      GT_MULT2(dcov->currentdepth));
    }
    dc_anchorleftmost(dcov, blisbl + rangestart, width - rangestart);
  } else
  {
    GtUword currentsuftabentry
      = dc_suffixptrget(dcov,blisbl+rangestart);
    dc_inversesuftab_set(dcov,currentsuftabentry,blisbl+rangestart);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r14
movq 0x108(%rdi), %rdi
testq %rdi, %rdi
jne 0x19bb7e
movq 0xa0(%r14), %rdi
shlq $0x4, %rdi
leaq 0x1bb226(%rip), %rsi    # 0x356d90
movl $0x3e6, %edx            # imm = 0x3E6
callq 0x93160
movq %rax, %rdi
movq %rax, 0x108(%r14)
cmpq %rbp, 0xc8(%r14)
jne 0x19bb9e
cmpq %r15, 0xd0(%r14)
jne 0x19bb9e
movq 0xf0(%r14), %rax
movq %rax, 0xb8(%r14)
cmpq %r15, 0xa0(%r14)
jb 0x19bddb
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x19bbf3
leaq (%r12,%rbp), %rsi
movq %r14, %rdi
callq 0x19ba4a
movq 0x108(%r14), %rcx
movq %rax, 0x8(%rcx,%rbx)
addq 0xb8(%r14), %rax
movq %r14, %rdi
movq %rax, %rsi
callq 0x19a078
movq 0x108(%r14), %rdi
movq %rax, (%rdi,%rbx)
incq %r12
addq $0x10, %rbx
jmp 0x19bbb0
leaq 0x20f(%rip), %rcx       # 0x19be09
pushq $0x10
popq %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x17ed0
pushq $0x8
popq %rbx
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x19bc36
movq %rbp, %rsi
addq %r13, %rsi
movq 0x108(%r14), %rax
movq (%rax,%rbx), %rdx
movq %r14, %rdi
callq 0x19b0b3
incq %r13
addq $0x10, %rbx
jmp 0x19bc0f
movq %rbp, (%rsp)
pushq $0x1
popq %rbp
xorl %eax, %eax
cmpq %r15, %rbp
jae 0x19bd14
movq 0x108(%r14), %rcx
movq -0x10(%rcx,%r12), %rdx
cmpq (%rcx,%r12), %rdx
je 0x19bd08
leaq 0x1(%rax), %rbx
movq (%rsp), %rcx
leaq (%rax,%rcx), %r13
cmpq %rbp, %rbx
jae 0x19bcbe
movq %rbp, %rbx
subq %rax, %rbx
movq 0xb8(%r14), %rcx
addq %rcx, %rcx
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x19be1b
movq 0x128(%r14), %rdi
testq %rdi, %rdi
je 0x19bcae
movq 0xb8(%r14), %rcx
addq %rcx, %rcx
movq %r13, %rsi
movq %rbx, %rdx
callq 0x19c119
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x19c156
jmp 0x19bce0
movq %r14, %rdi
movq %r13, %rsi
callq 0x19ba4a
cmpq %rbx, %rbp
jne 0x19bda3
movq %r14, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x19b985
movq 0x128(%r14), %rdi
movq %rbp, %rax
testq %rdi, %rdi
je 0x19bd08
movq (%rsp), %rax
leaq (%rax,%rbp), %rdx
movq 0xb8(%r14), %rcx
xorl %esi, %esi
callq 0x19a0c7
movq %rbp, %rax
incq %rbp
addq $0x10, %r12
jmp 0x19bc3f
leaq 0x1(%rax), %rcx
movq (%rsp), %rbx
addq %rax, %rbx
cmpq %r15, %rcx
jae 0x19bd7c
subq %rax, %r15
movq 0xb8(%r14), %rcx
addq %rcx, %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x19be1b
movq 0x128(%r14), %rdi
testq %rdi, %rdi
je 0x19bd60
movq 0xb8(%r14), %rcx
addq %rcx, %rcx
movq %rbx, %rsi
movq %r15, %rdx
callq 0x19c119
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19c156
movq %r14, %rdi
movq %rbx, %rsi
callq 0x19ba4a
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19b985
movq 0x29c1be(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x14925f(%rip), %rsi    # 0x2e5013
leaq 0x1bb991(%rip), %rdx    # 0x35774c
leaq 0x1bb94f(%rip), %rcx    # 0x357711
leaq 0x1bafc7(%rip), %r8     # 0x356d90
movl $0x415, %r9d            # imm = 0x415
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x29c186(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x149227(%rip), %rsi    # 0x2e5013
leaq 0x1bb939(%rip), %rdx    # 0x35772c
leaq 0x1bb917(%rip), %rcx    # 0x357711
leaq 0x1baf8f(%rip), %r8     # 0x356d90
movl $0x3ed, %r9d            # imm = 0x3ED
jmp 0x19bdcf