// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/fmi-fwduni.c
// Function: gt_skfmmstats
GtUword gt_skfmmstats (const void *genericindex,
                          GT_UNUSED GtUword offset,
                          GT_UNUSED GtUword left,
                          GT_UNUSED GtUword right,
                          GtUword *witnessposition,
                          const GtUchar *qstart,
                          const GtUchar *qend)
{
  GtUchar cc;
  const GtUchar *qptr;
  GtUword prevlbound;
  GtUword matchlength;
  GtUwordBound bwtbound;
  const Fmindex *fmindex = (Fmindex *) genericindex;

  gt_assert(qstart < qend);
  qptr = qstart;
  cc = *qptr;
  if (GT_ISSPECIAL(cc))
  {
    return 0;
  }
  bwtbound.lbound = fmindex->tfreq[cc];
  bwtbound.ubound = fmindex->tfreq[cc+1];
  if (bwtbound.lbound >= bwtbound.ubound)
  {
    return 0;
  }
  prevlbound = bwtbound.lbound;
  for (qptr++; qptr < qend; qptr++)
  {
    cc = *qptr;
    if (GT_ISSPECIAL (cc))
    {
      break;
    }
    bwtbound.lbound = fmindex->tfreq[cc] +
                      fmoccurrence (fmindex, cc, bwtbound.lbound);
    bwtbound.ubound = fmindex->tfreq[cc] +
                      fmoccurrence (fmindex, cc, bwtbound.ubound);
    if (bwtbound.lbound >= bwtbound.ubound)
    {
      break;
    }
    prevlbound = bwtbound.lbound;
  }
  matchlength = (GtUword) (qptr - qstart);
  if (witnessposition != NULL)
  {
    GtUword startpos = gt_fmfindtextpos (fmindex,prevlbound);
    gt_assert((fmindex->bwtlength-1) >= (startpos + matchlength));
    *witnessposition = (fmindex->bwtlength-1) - (startpos + matchlength);
  }
  return matchlength;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x8(%rsp)
cmpq 0x70(%rsp), %r9
jae 0x1ada01
movq %r9, %r15
movzbl (%r9), %eax
cmpq $0xfd, %rax
ja 0x1ad9ec
movq 0x8(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq (%rcx,%rax,8), %rbp
movq 0x8(%rcx,%rax,8), %r12
cmpq %r12, %rbp
jae 0x1ad9ec
movq %r8, 0x10(%rsp)
incq %r15
movq $-0x1, %rax
movq $-0x2, %rcx
movq %rbp, %rdx
movq %rax, %r8
movq %rcx, %r13
cmpq 0x70(%rsp), %r15
jae 0x1ad9ab
movzbl (%r15), %ebx
cmpq $0xfd, %rbx
ja 0x1ad9ab
movq %r13, 0x30(%rsp)
movq 0x8(%rsp), %r13
movq 0x18(%r13), %rax
leal (,%rbx,8), %r14d
movq (%rax,%r14), %rax
movq %rax, 0x18(%rsp)
movq %r13, %rdi
movl %ebx, %esi
movq %r8, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
callq 0x1ad640
movq %rax, %rbp
addq 0x18(%rsp), %rbp
movq 0x18(%r13), %rax
movq (%rax,%r14), %r14
movq %r13, %rdi
movq 0x30(%rsp), %r13
movl %ebx, %esi
movq %r12, %rdx
callq 0x1ad640
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %r8
movq %rax, %r12
addq %r14, %r12
leaq -0x1(%r8), %rax
leaq -0x1(%r13), %rcx
incq %r15
cmpq %r12, %rbp
jb 0x1ad911
movq %r8, %r15
negq %r15
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x1ad9ef
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rdx, %rsi
movq %r8, %r12
callq 0x1ada0c
movq 0x10(%r14), %rcx
leaq -0x1(%rcx), %rdx
movq %rax, %rsi
subq %r12, %rsi
cmpq %rsi, %rdx
jb 0x1ada06
subq %rax, %rcx
addq %r13, %rcx
movq %rcx, (%rbx)
jmp 0x1ad9ef
xorl %r15d, %r15d
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x64583
callq 0x645ba
nop