// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/eis-voiditf.c
// Function: gt_pck_getShuStringLength
GtUword gt_pck_getShuStringLength(const FMindex *bwtSubject,
                                       const GtUchar *suffix,
                                       GtUword suffixLength)
{
  GtUwordPair occPair;
  Symbol curChar;
  const GtUchar *qptr, *qend;
  const MRAEnc *alphabet;
  GtUword start, end;

  gt_assert(bwtSubject && suffix);
  alphabet = BWTSeqGetAlphabet((const BWTSeq *) bwtSubject);

  qptr = suffix;
  qend = suffix + suffixLength;

  curChar = MRAEncMapSymbol(alphabet, *qptr);

  qptr++;
  start = ((const BWTSeq *) bwtSubject)->count[curChar];
  end = ((const BWTSeq *) bwtSubject)->count[curChar + 1];
  for (/* Nothing */; start < end && qptr < qend; qptr++)
  {
    curChar = MRAEncMapSymbol(alphabet, *qptr);
    occPair = BWTSeqTransformedPosPairOcc((const BWTSeq *) bwtSubject,
                                          curChar,
                                          start,
                                          end);
    start = ((const BWTSeq *) bwtSubject)->count[curChar] + occPair.a;
    end = ((const BWTSeq *) bwtSubject)->count[curChar] + occPair.b;
  }
  if (qptr == qend && start < end)
    return suffixLength + 1;
  else
    return qptr - suffix;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x14c084
movq %rsi, %r14
testq %rsi, %rsi
je 0x14c084
movq %rdi, %r15
movq 0x8(%rdi), %rdi
movq %rdx, (%rsp)
leaq (%r14,%rdx), %rax
movq %rax, 0x10(%rsp)
movzbl (%r14), %esi
movq %rdi, 0x8(%rsp)
callq 0x14c0b2
movq 0x38(%r15), %rcx
movzbl %al, %eax
movq (%rcx,%rax,8), %rbp
movq 0x8(%rcx,%rax,8), %r13
pushq $0x1
popq %r12
cmpq %r13, %rbp
jae 0x14c029
leaq (%r14,%r12), %rax
cmpq 0x10(%rsp), %rax
jae 0x14c029
movzbl (%rax), %esi
movq 0x8(%rsp), %rdi
callq 0x14c0b2
movb 0x24(%r15), %cl
movzbl %al, %ebx
cmpb %al, %cl
ja 0x14bfd7
jae 0x14bfd3
movq 0x10(%r15), %rdx
decq %rdx
cmpq %rbx, %rdx
jne 0x14bfd7
cmpb %al, %cl
jne 0x14c004
movq (%r15), %rdi
movq 0x18(%r15), %r8
movl %ebx, %esi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x14c404
movq %rax, %rbp
movq %rdx, %r13
movq 0x38(%r15), %rax
movq (%rax,%rbx,8), %rax
addq %rax, %rbp
addq %rax, %r13
incq %r12
jmp 0x14bf99
movq 0x10(%r15), %rax
decq %rax
cmpq %rbx, %rax
jne 0x14c04e
movq 0x30(%r15), %rax
xorl %ecx, %ecx
cmpq %rbp, %rax
setb %cl
xorl %edx, %edx
cmpq %r13, %rax
setb %dl
movq %rcx, %rbp
jmp 0x14bfee
movq (%rsp), %rcx
leaq 0x1(%rcx), %rax
cmpq %r13, %rbp
cmovaeq %r12, %rax
cmpq %r12, %rcx
cmovneq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2ebf13(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x198fb4(%rip), %rsi    # 0x2e5013
leaq 0x1f75f0(%rip), %rdx    # 0x343656
leaq 0x1f75cd(%rip), %rcx    # 0x34363a
leaq 0x1f65f3(%rip), %r8     # 0x342667
pushq $0x5d
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2ebedd(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x198f7e(%rip), %rsi    # 0x2e5013
leaq 0x1f8215(%rip), %rdx    # 0x3442b1
leaq 0x1f8223(%rip), %rcx    # 0x3442c6
leaq 0x1f8070(%rip), %r8     # 0x34411a
movl $0x204, %r9d            # imm = 0x204
jmp 0x14c078