// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-blockcomp.c
// Function: blockCompSeqPosPairRank
static GtUwordPair
blockCompSeqPosPairRank(struct encIdxSeq *eSeqIdx, Symbol eSym,
                        GtUword posA, GtUword posB,
                        union EISHint *hint)
{
  struct blockCompositionSeq *seqIdx;
  GtUwordPair rankCounts;
  GtUword bucketNum;
  gt_assert(eSeqIdx && eSeqIdx->classInfo == &blockCompositionSeqClass);
  gt_assert(posA <= posB);
  seqIdx = encIdxSeq2blockCompositionSeq(eSeqIdx);
  gt_assert(gt_MRAEncSymbolIsInSelectedRanges(seqIdx->baseClass.alphabet,
                                        eSym, BLOCK_COMPOSITION_INCLUDE,
                                        seqIdx->modes) >= 0);
  /* Only when both positions are in same bucket, special treatment
   * makes sense. */
  {
    GtUword bucketNumA, bucketNumB;
    bucketNumA = bucketNumFromPos(seqIdx, posA);
    bucketNumB = bucketNumFromPos(seqIdx, posB);
    if (bucketNumA != bucketNumB)
    {
      rankCounts.a = blockCompSeqRank(eSeqIdx, eSym, posA, hint);
      rankCounts.b = blockCompSeqRank(eSeqIdx, eSym, posB, hint);
      return rankCounts;
    }
    bucketNum = bucketNumA;
  }
  if (gt_MRAEncSymbolIsInSelectedRanges(seqIdx->baseClass.alphabet, eSym,
                                     BLOCK_COMPOSITION_INCLUDE, seqIdx->modes))
  {
    BitOffset varDataMemOffset, cwIdxMemOffset;
    struct superBlock *sBlock;
    GtUword blockNumA = blockNumFromPos(seqIdx, posA),
      blockNumB = blockNumFromPos(seqIdx, posB);
    Symbol bSym = MRAEncMapSymbol(seqIdx->blockMapAlphabet, eSym);
    unsigned blockSize = seqIdx->blockSize, bitsPerCompositionIdx
      = seqIdx->compositionTable.compositionIdxBits,
      inBucketBlockNumA = blockNumA % seqIdx->bucketBlocks,
      inBucketBlockNumB = blockNumB % seqIdx->bucketBlocks;
#ifdef USE_SBLOCK_CACHE
    sBlock = cacheFetchSuperBlock(seqIdx, bucketNum,
                                  &hint->bcHint.sBlockCache);
#else
    sBlock = fetchSuperBlock(seqIdx, bucketNum, NULL);
#endif
    rankCounts.a = sBlockGetPartialSymSum(sBlock, bSym, seqIdx);
    walkCompIndicesPrefix(
      seqIdx, sBlock, inBucketBlockNumA, cwIdxMemOffset,
      rankCounts.a += symCountFromComposition(
        &seqIdx->compositionTable, seqIdx->blockMapAlphabetSize, compIndex,
        bSym),
      varDataMemOffset);
    rankCounts.b = rankCounts.a;
    rankCounts.a =
      adjustPosRankForBlock(seqIdx, sBlock, posA, bSym, blockSize,
                            rankCounts.a, cwIdxMemOffset, varDataMemOffset,
                            bitsPerCompositionIdx);
    walkCompIndices(
      seqIdx, sBlock, inBucketBlockNumB - inBucketBlockNumA, cwIdxMemOffset,
      rankCounts.b += symCountFromComposition(
        &seqIdx->compositionTable, seqIdx->blockMapAlphabetSize, compIndex,
        bSym),
      varDataMemOffset);
    rankCounts.b =
      adjustPosRankForBlock(seqIdx, sBlock, posB, bSym, blockSize,
                            rankCounts.b, cwIdxMemOffset, varDataMemOffset,
                            bitsPerCompositionIdx);
    if (bSym == seqIdx->blockEncFallback)
    {
      GtUword base = bucketBasePos(seqIdx, bucketNum);
      rankCounts.a -= gt_SRLAllSymbolsCountInSeqRegion(
        seqIdx->rangeEncs, base, posA, &hint->bcHint.rangeHint);
      rankCounts.b -= gt_SRLAllSymbolsCountInSeqRegion(
        seqIdx->rangeEncs, base, posB, &hint->bcHint.rangeHint);
    }
#ifndef USE_SBLOCK_CACHE
    deleteSuperBlock(sBlock);
#endif
  }
  else
  {
    rankCounts.a = gt_SRLSymbolCountInSeqRegion(seqIdx->rangeEncs, 0, posA,
                                                eSym, &hint->bcHint.rangeHint);
    rankCounts.b = gt_SRLSymbolCountInSeqRegion(seqIdx->rangeEncs, 0, posA,
                                                eSym, &hint->bcHint.rangeHint);
  }
  return rankCounts;
}

// Assembly:
subq $0xd8, %rsp
movb %sil, %al
movq %rdi, 0xc0(%rsp)
movb %al, 0xbf(%rsp)
movq %rdx, 0xb0(%rsp)
movq %rcx, 0xa8(%rsp)
movq %r8, 0xa0(%rsp)
cmpq $0x0, 0xc0(%rsp)
je 0x4aa7e0
movq 0xc0(%rsp), %rax
leaq 0x191435(%rip), %rcx    # 0x63bc10
cmpq %rcx, (%rax)
je 0x4aa818
movq 0x1917b9(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x6b822(%rip), %rsi     # 0x516013
leaq 0x10bffa(%rip), %rdx    # 0x5b67f2
leaq 0x10c20a(%rip), %rcx    # 0x5b6a09
leaq 0x10b702(%rip), %r8     # 0x5b5f08
movl $0x4ce, %r9d            # imm = 0x4CE
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4aa81a
jmp 0x4aa81c
movq 0xb0(%rsp), %rax
cmpq 0xa8(%rsp), %rax
jbe 0x4aa866
movq 0x19176b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x6b7d4(%rip), %rsi     # 0x516013
leaq 0xcbecb(%rip), %rdx     # 0x576711
leaq 0x10c1bc(%rip), %rcx    # 0x5b6a09
leaq 0x10b6b4(%rip), %r8     # 0x5b5f08
movl $0x4cf, %r9d            # imm = 0x4CF
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4aa868
movq 0xc0(%rsp), %rdi
callq 0x4ac370
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq 0x8(%rax), %rdi
movb 0xbf(%rsp), %al
movq 0x98(%rsp), %rcx
movq 0xa8(%rcx), %rcx
movl $0x1, %edx
movzbl %al, %esi
callq 0x22b530
cmpl $0x0, %eax
jge 0x4aa8e9
movq 0x1916e8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x6b751(%rip), %rsi     # 0x516013
leaq 0x10bf75(%rip), %rdx    # 0x5b683e
leaq 0x10c139(%rip), %rcx    # 0x5b6a09
leaq 0x10b631(%rip), %r8     # 0x5b5f08
movl $0x4d3, %r9d            # imm = 0x4D3
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4aa8eb
movq 0x98(%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x4ac3d0
movq %rax, 0x88(%rsp)
movq 0x98(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x4ac3d0
movq %rax, 0x80(%rsp)
movq 0x88(%rsp), %rax
cmpq 0x80(%rsp), %rax
je 0x4aa99a
movq 0xc0(%rsp), %rdi
movb 0xbf(%rsp), %al
movq 0xb0(%rsp), %rdx
movq 0xa0(%rsp), %rcx
movzbl %al, %esi
callq 0x4aa400
movq %rax, 0xc8(%rsp)
movq 0xc0(%rsp), %rdi
movb 0xbf(%rsp), %al
movq 0xa8(%rsp), %rdx
movq 0xa0(%rsp), %rcx
movzbl %al, %esi
callq 0x4aa400
movq %rax, 0xd0(%rsp)
jmp 0x4aae5b
movq 0x88(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x98(%rsp), %rax
movq 0x8(%rax), %rdi
movb 0xbf(%rsp), %al
movq 0x98(%rsp), %rcx
movq 0xa8(%rcx), %rcx
movl $0x1, %edx
movzbl %al, %esi
callq 0x22b530
cmpl $0x0, %eax
je 0x4aade3
movq 0x98(%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x4ac4f0
movq %rax, 0x60(%rsp)
movq 0x98(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x4ac4f0
movq %rax, 0x58(%rsp)
movq 0x98(%rsp), %rax
movq 0x98(%rax), %rdi
movzbl 0xbf(%rsp), %esi
callq 0x4a65b0
movb %al, 0x57(%rsp)
movq 0x98(%rsp), %rax
movl 0xb4(%rax), %eax
movl %eax, 0x50(%rsp)
movq 0x98(%rsp), %rax
movl 0x68(%rax), %eax
movl %eax, 0x4c(%rsp)
movq 0x60(%rsp), %rax
movq 0x98(%rsp), %rcx
movl 0xb0(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, 0x48(%rsp)
movq 0x58(%rsp), %rax
movq 0x98(%rsp), %rcx
movl 0xb0(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, 0x44(%rsp)
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0xa0(%rsp), %rdx
callq 0x4ac400
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
movb 0x57(%rsp), %al
movq 0x98(%rsp), %rdx
movzbl %al, %esi
callq 0x4ac490
movq %rax, 0xc8(%rsp)
movq 0x68(%rsp), %rdi
movq 0x98(%rsp), %rsi
xorl %edx, %edx
callq 0x4ac510
movq %rax, 0x70(%rsp)
movq 0x68(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x78(%rsp)
movl 0x48(%rsp), %eax
movl %eax, 0x40(%rsp)
movq 0x98(%rsp), %rax
movl 0x68(%rax), %eax
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x40(%rsp)
je 0x4aabb5
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x70(%rsp), %rsi
movl 0x3c(%rsp), %edx
callq 0x473e40
movl %eax, 0x38(%rsp)
movq 0x98(%rsp), %rdi
addq $0x48, %rdi
movq 0x98(%rsp), %rax
movzwl 0xc4(%rax), %esi
movl 0x38(%rsp), %edx
movzbl 0x57(%rsp), %ecx
callq 0x4ac570
movl %eax, %eax
addq 0xc8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x98(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x38(%rsp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addq 0x78(%rsp), %rax
movq %rax, 0x78(%rsp)
movl 0x3c(%rsp), %eax
addq 0x70(%rsp), %rax
movq %rax, 0x70(%rsp)
movl 0x40(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0x4aab12
jmp 0x4aabb7
jmp 0x4aabb9
movq 0xc8(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0x98(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0xb0(%rsp), %rdx
movb 0x57(%rsp), %cl
movl 0x50(%rsp), %r8d
movq 0xc8(%rsp), %r9
movq 0x70(%rsp), %r11
movq 0x78(%rsp), %r10
movl 0x4c(%rsp), %eax
movzbl %cl, %ecx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0x4ac660
movq %rax, 0xc8(%rsp)
movl 0x44(%rsp), %eax
subl 0x48(%rsp), %eax
movl %eax, 0x34(%rsp)
movq 0x98(%rsp), %rax
movl 0x68(%rax), %eax
movl %eax, 0x30(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x4aacd8
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x70(%rsp), %rsi
movl 0x30(%rsp), %edx
callq 0x473e40
movl %eax, 0x2c(%rsp)
movq 0x98(%rsp), %rdi
addq $0x48, %rdi
movq 0x98(%rsp), %rax
movzwl 0xc4(%rax), %esi
movl 0x2c(%rsp), %edx
movzbl 0x57(%rsp), %ecx
callq 0x4ac570
movl %eax, %eax
addq 0xd0(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0x98(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x2c(%rsp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addq 0x78(%rsp), %rax
movq %rax, 0x78(%rsp)
movl 0x30(%rsp), %eax
addq 0x70(%rsp), %rax
movq %rax, 0x70(%rsp)
movl 0x34(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x4aac35
jmp 0x4aacda
movq 0x98(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movb 0x57(%rsp), %cl
movl 0x50(%rsp), %r8d
movq 0xd0(%rsp), %r9
movq 0x70(%rsp), %r11
movq 0x78(%rsp), %r10
movl 0x4c(%rsp), %eax
movzbl %cl, %ecx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0x4ac660
movq %rax, 0xd0(%rsp)
movzbl 0x57(%rsp), %eax
movq 0x98(%rsp), %rcx
movzbl 0xc6(%rcx), %ecx
cmpl %ecx, %eax
jne 0x4aade1
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x4ac790
movq %rax, 0x20(%rsp)
movq 0x98(%rsp), %rax
movq 0x70(%rax), %rdi
movq 0x20(%rsp), %rsi
movq 0xb0(%rsp), %rdx
movq 0xa0(%rsp), %rcx
addq $0x20, %rcx
callq 0x4b2020
movq %rax, %rcx
movq 0xc8(%rsp), %rax
subq %rcx, %rax
movq %rax, 0xc8(%rsp)
movq 0x98(%rsp), %rax
movq 0x70(%rax), %rdi
movq 0x20(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq 0xa0(%rsp), %rcx
addq $0x20, %rcx
callq 0x4b2020
movq %rax, %rcx
movq 0xd0(%rsp), %rax
subq %rcx, %rax
movq %rax, 0xd0(%rsp)
jmp 0x4aae59
movq 0x98(%rsp), %rax
movq 0x70(%rax), %rdi
movq 0xb0(%rsp), %rdx
movb 0xbf(%rsp), %al
movq 0xa0(%rsp), %r8
addq $0x20, %r8
xorl %ecx, %ecx
movl %ecx, %esi
movzbl %al, %ecx
callq 0x4b1ba0
movq %rax, 0xc8(%rsp)
movq 0x98(%rsp), %rax
movq 0x70(%rax), %rdi
movq 0xb0(%rsp), %rdx
movb 0xbf(%rsp), %al
movq 0xa0(%rsp), %r8
addq $0x20, %r8
xorl %ecx, %ecx
movl %ecx, %esi
movzbl %al, %ecx
callq 0x4b1ba0
movq %rax, 0xd0(%rsp)
jmp 0x4aae5b
movq 0xc8(%rsp), %rax
movq 0xd0(%rsp), %rdx
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)