// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-lwcheck.c
// Function: gt_suftab_sk_suffixorder
static void gt_suftab_sk_suffixorder(GtUword totallength,
                                     unsigned int numofchars,
                                     const void *suftab,
                                     size_t unitsize,
                                     const GtRangewithchar *rangestore,
                                     unsigned int numofranges)
{
  unsigned int rangeidx;
  GtUword numofcomparisons = 0;
  double ratio;

  for (rangeidx = 0; rangeidx < numofranges; rangeidx++)
  {
    GtUword idx, start = 0;

    for (idx = rangestore[rangeidx].start; idx <= rangestore[rangeidx].end;
         idx++)
    {
      GtUword position = GEN_ESASUFFIXPTRGET(suftab, idx);

      if (position + 1 <= totallength)
      {
        GtUword found = gt_check_for_range_occurrence(suftab,
                                                      unitsize,
                                                      position + 1,
                                                      start,
                                                      totallength);
        if (found == ULONG_MAX)
        {
          fprintf(stderr, "Cannot find position+1="GT_WU" in range ["GT_WU", "
                  GT_WU"]\n", position+1, start, totallength);
          exit(GT_EXIT_PROGRAMMING_ERROR);
        }
        numofcomparisons += found - start + 1;
        start = found + 1;
      }
    }
  }
  ratio = (double) numofcomparisons/totallength;
  if (gt_double_compare(ratio, (double) numofchars) > 0)
  {
    fprintf(stderr, "gt_double_compare(%.2f, %u) = %d > 0 not exected\n",
                    ratio, numofchars,
                    gt_double_compare(ratio, (double) numofchars));
    exit(GT_EXIT_PROGRAMMING_ERROR);
  }
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movl %esi, 0x7c(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movl %r9d, 0x5c(%rsp)
movq $0x0, 0x50(%rsp)
movl $0x0, 0x58(%rsp)
movl 0x58(%rsp), %eax
cmpl 0x5c(%rsp), %eax
jae 0x2ca1ed
movq $0x0, 0x38(%rsp)
movq 0x60(%rsp), %rax
movl 0x58(%rsp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq 0x60(%rsp), %rcx
movl 0x58(%rsp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
ja 0x2ca1db
cmpq $0x4, 0x68(%rsp)
jne 0x2ca102
movq 0x70(%rsp), %rax
movq 0x40(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, 0x20(%rsp)
jmp 0x2ca115
movq 0x70(%rsp), %rax
movq 0x40(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x1, %rax
cmpq 0x80(%rsp), %rax
ja 0x2ca1c6
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq $0x1, %rdx
movq 0x38(%rsp), %rcx
movq 0x80(%rsp), %r8
callq 0x2ca2c0
movq %rax, 0x28(%rsp)
cmpq $-0x1, 0x28(%rsp)
jne 0x2ca1a0
movq 0x371e31(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x30(%rsp), %rdx
addq $0x1, %rdx
movq 0x38(%rsp), %rcx
movq 0x80(%rsp), %r8
leaq 0x2c0ef4(%rip), %rsi    # 0x58b083
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movq 0x28(%rsp), %rax
subq 0x38(%rsp), %rax
addq $0x1, %rax
addq 0x50(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x2ca1c8
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x2ca0c7
jmp 0x2ca1dd
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x2ca098
movq 0x50(%rsp), %xmm0
movaps 0x24e736(%rip), %xmm3   # 0x518930
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x24e73a(%rip), %xmm2   # 0x518940
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x80(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x48(%rsp), %xmm0
movl 0x7c(%rsp), %eax
cvtsi2sd %rax, %xmm1
callq 0xec290
cmpl $0x0, %eax
jle 0x2ca2af
movq 0x371d45(%rip), %rax    # 0x63bfa0
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movsd 0x48(%rsp), %xmm0
movaps %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movl 0x7c(%rsp), %eax
movl %eax, %ecx
movl %ecx, 0x1c(%rsp)
cvtsi2sd %rax, %xmm1
callq 0xec290
movq 0x8(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
movl 0x1c(%rsp), %edx
movl %eax, %ecx
leaq 0x2c0e15(%rip), %rsi    # 0x58b0b3
movb $0x1, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
addq $0x88, %rsp
retq
nopw (%rax,%rax)