// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-bwtseq-extinfo.c
// Function: searchLocateCountMark
static inline BitOffset
searchLocateCountMark(const BWTSeq *bwtSeq, GtUword pos,
                      struct extBitsRetrieval *extBits)
{
  unsigned i, numMarks, bitsPerCount;
  BitOffset markOffset;
  EISRetrieveExtraBits(bwtSeq->seqIdx, pos, EBRF_RETRIEVE_CWBITS
                       | EBRF_RETRIEVE_VARBITS, extBits, bwtSeq->hint);
  markOffset = extBits->varOffset;
  bitsPerCount = requiredUlongBits(extBits->len);
  numMarks = gt_bsGetUlong(extBits->varPart, markOffset, bitsPerCount);
  if (numMarks)
  {
    unsigned bitsPerBWTPos = requiredUlongBits(extBits->len - 1),
      bitsPerOrigPos = requiredUlongBits(
        ((bwtSeq->featureToggles & BWTReversiblySorted) ?
         (BWTSeqLength(bwtSeq) - 1) / bwtSeq->locateSampleInterval :
         BWTSeqLength(bwtSeq) - 1));
    GtUword cmpPos = pos - extBits->start;
    markOffset += bitsPerCount;
    for (i = 0; i < numMarks; ++i)
    {
      GtUword markedPos = gt_bsGetUlong(extBits->varPart, markOffset,
                                     bitsPerBWTPos);
      if (markedPos < cmpPos)
        markOffset += bitsPerBWTPos + bitsPerOrigPos;
      else if (markedPos > cmpPos)
        break;
      else if (markedPos == cmpPos)
        return markOffset + bitsPerBWTPos;
    }
  }
  return 0;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rcx
movq 0x48(%rsp), %rax
movq 0x18(%rax), %r8
movl $0x2, %edx
callq 0x222f70
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x46ec80
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x20(%rsp), %rsi
movl 0x2c(%rsp), %edx
callq 0x476ec0
movl %eax, 0x30(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x22320e
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rdi
subq $0x1, %rdi
callq 0x46ec80
movl %eax, 0x1c(%rsp)
movq 0x48(%rsp), %rax
movl 0x40(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x223135
movq 0x48(%rsp), %rdi
callq 0x223960
subq $0x1, %rax
movq 0x48(%rsp), %rcx
movl 0x20(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, (%rsp)
jmp 0x223147
movq 0x48(%rsp), %rdi
callq 0x223960
subq $0x1, %rax
movq %rax, (%rsp)
movq (%rsp), %rdi
callq 0x46ec80
movl %eax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %rcx
subq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movl 0x2c(%rsp), %eax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x30(%rsp), %eax
jae 0x22320c
movq 0x38(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %edx
callq 0x476ec0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
jae 0x2231c9
movl 0x1c(%rsp), %eax
addl 0x18(%rsp), %eax
movl %eax, %eax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x2231fa
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
jbe 0x2231d7
jmp 0x22320c
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
jne 0x2231f6
movq 0x20(%rsp), %rax
movl 0x1c(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x50(%rsp)
jmp 0x223217
jmp 0x2231f8
jmp 0x2231fa
jmp 0x2231fc
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x22317d
jmp 0x22320e
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)