// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-bwtseq.c
// Function: gt_packedindexuniqueforward
GtUword gt_packedindexuniqueforward(const BWTSeq *bwtSeq,
                                          const GtUchar *qstart,
                                          const GtUchar *qend)
{
  GtUchar cc;
  const GtUchar *qptr;
  struct matchBound bwtbound;
  GtUwordPair seqpospair;
  Symbol curSym;
  const MRAEnc *alphabet;

  gt_assert(bwtSeq && qstart);
  alphabet = BWTSeqGetAlphabet(bwtSeq);
  qptr = qstart;
  cc = *qptr++;
#undef SKDEBUG
#ifdef SKDEBUG
  printf("# start cc=%u\n",cc);
#endif
  if (GT_ISSPECIAL(cc))
  {
    return 0;
  }
  curSym = MRAEncMapSymbol(alphabet, cc);
  bwtbound.start = bwtSeq->count[curSym];
  bwtbound.end = bwtSeq->count[curSym+1];
#ifdef SKDEBUG
  printf("# bounds="GT_WU","GT_WU" = "GT_WU""
          "occurrences\n",
         bwtbound.start,
         bwtbound.end,
         bwtbound.end - bwtbound.start);
#endif
  while (qptr < qend && bwtbound.start + 1 < bwtbound.end)
  {
    cc = *qptr;
#ifdef SKDEBUG
    printf("# cc=%u\n",cc);
#endif
    if (GT_ISSPECIAL (cc))
    {
      return 0;
    }
    curSym = MRAEncMapSymbol(alphabet, cc);
    seqpospair = BWTSeqTransformedPosPairOcc(bwtSeq, curSym,
                                             bwtbound.start,bwtbound.end);
    bwtbound.start = bwtSeq->count[curSym] + seqpospair.a;
    bwtbound.end = bwtSeq->count[curSym] + seqpospair.b;
#ifdef SKDEBUG
    printf("# bounds="GT_WU","GT_WU" = "GT_WU""
            "occurrences\n",
           bwtbound.start,
           bwtbound.end,
           bwtbound.end - bwtbound.start);
#endif
    qptr++;
  }
  if (bwtbound.start + 1 == bwtbound.end)
  {
    return (GtUword) (qptr - qstart);
  }
  return 0;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x226243
cmpq $0x0, 0x60(%rsp)
jne 0x22627b
movq 0x415d56(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2efdbf(%rip), %rsi    # 0x516013
leaq 0x34f27b(%rip), %rdx    # 0x5754d6
leaq 0x34f285(%rip), %rcx    # 0x5754e7
leaq 0x34f256(%rip), %r8     # 0x5754bf
movl $0xec, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22627d
movq 0x68(%rsp), %rdi
callq 0x226440
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x48(%rsp)
movb (%rax), %al
movb %al, 0x57(%rsp)
movzbl 0x57(%rsp), %eax
cmpl $0xfe, %eax
jl 0x2262c7
movq $0x0, 0x70(%rsp)
jmp 0x22642b
movq 0x18(%rsp), %rdi
movzbl 0x57(%rsp), %esi
callq 0x226450
movb %al, 0x27(%rsp)
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rax
movzbl 0x27(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rax
movzbl 0x27(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rcx
xorl %eax, %eax
cmpq 0x58(%rsp), %rcx
movb %al, 0x7(%rsp)
jae 0x226335
movq 0x38(%rsp), %rax
addq $0x1, %rax
cmpq 0x40(%rsp), %rax
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x226342
jmp 0x2263fe
movq 0x48(%rsp), %rax
movb (%rax), %al
movb %al, 0x57(%rsp)
movzbl 0x57(%rsp), %eax
cmpl $0xfe, %eax
jl 0x226367
movq $0x0, 0x70(%rsp)
jmp 0x22642b
movq 0x18(%rsp), %rdi
movzbl 0x57(%rsp), %esi
callq 0x226450
movb %al, 0x27(%rsp)
movq 0x68(%rsp), %rdi
movb 0x27(%rsp), %al
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
movzbl %al, %esi
callq 0x226490
movq %rax, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rax
movzbl 0x27(%rsp), %ecx
movq (%rax,%rcx,8), %rax
addq 0x28(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rax
movzbl 0x27(%rsp), %ecx
movq (%rax,%rcx,8), %rax
addq 0x30(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x22630e
movq 0x38(%rsp), %rax
addq $0x1, %rax
cmpq 0x40(%rsp), %rax
jne 0x226422
movq 0x48(%rsp), %rax
movq 0x60(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x70(%rsp)
jmp 0x22642b
movq $0x0, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)