// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/eis-blockcomp.c
// Function: blockCompSeqRangeRank
static void
blockCompSeqRangeRank(struct encIdxSeq *eSeqIdx, AlphabetRangeID range,
                      GtUword pos, GtUword *rankCounts,
                      union EISHint *hint)
{
  struct blockCompositionSeq *seqIdx;
  gt_assert(eSeqIdx && eSeqIdx->classInfo == &blockCompositionSeqClass);
  seqIdx = encIdxSeq2blockCompositionSeq(eSeqIdx);
  gt_assert(range < MRAEncGetNumRanges(EISGetAlphabet(eSeqIdx)));
  switch (seqIdx->modes[range])
  {
  case BLOCK_COMPOSITION_INCLUDE:
    {
      BitOffset varDataMemOffset, cwIdxMemOffset;
      struct superBlock *sBlock;
      GtUword blockNum, bucketNum;
      unsigned blockSize = seqIdx->blockSize;
      bucketNum = bucketNumFromPos(seqIdx, pos);
#ifdef USE_SBLOCK_CACHE
      sBlock = cacheFetchSuperBlock(seqIdx, bucketNum,
                                    &hint->bcHint.sBlockCache);
#else
      sBlock = fetchSuperBlock(seqIdx, bucketNum, NULL);
#endif
      {
        sBlockGetPartialSymSums(sBlock, seqIdx, rankCounts);
        blockNum = blockNumFromPos(seqIdx, pos);
        walkCompIndicesPrefix(
          seqIdx, sBlock, blockNum % seqIdx->bucketBlocks, cwIdxMemOffset,
          addSymCountsFromComposition(&seqIdx->compositionTable,
                                      seqIdx->blockMapAlphabetSize, compIndex,
                                      rankCounts);,
          varDataMemOffset);
        adjustRanksForBlock(seqIdx, sBlock, pos, blockSize, rankCounts,
                            cwIdxMemOffset, varDataMemOffset);
        {
          GtUword base = bucketBasePos(seqIdx, bucketNum);
          rankCounts[seqIdx->blockEncFallback]
            -= gt_SRLAllSymbolsCountInSeqRegion(
              seqIdx->rangeEncs, base, pos, &hint->bcHint.rangeHint);
        }
      }
#ifndef USE_SBLOCK_CACHE
      deleteSuperBlock(sBlock);
#endif
    }
    break;
  case REGIONS_LIST:
    {
      AlphabetRangeSize sym,
        rangeEncNumSyms = gt_MRAEncGetSize(seqIdx->rangeMapAlphabet);
      for (sym = 0; sym < rangeEncNumSyms; ++sym)
        rankCounts[sym] = gt_SRLSymbolCountInSeqRegion(
          seqIdx->rangeEncs, 0, pos,
          MRAEncRevMapSymbol(seqIdx->rangeMapAlphabet, sym),
          &hint->bcHint.rangeHint);
    }
    break;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
testq %rdi, %rdi
je 0x2aae75
movq %rdi, %r14
leaq 0x18ceff(%rip), %rax    # 0x437b80
cmpq %rax, (%rdi)
jne 0x2aae75
movq %rcx, %r13
movl %esi, %ebx
movq %r14, %rdi
callq 0x2abb6e
movq 0x8(%r14), %rax
cmpl %ebx, 0x4(%rax)
jbe 0x2aaea3
movq 0xa8(%r14), %rax
movl %ebx, %ecx
movl (%rax,%rcx,4), %eax
cmpl $0x2, %eax
je 0x2aae22
cmpl $0x1, %eax
jne 0x2aae13
movl 0xb4(%r14), %eax
movl 0xb0(%r14), %ecx
movl %eax, 0x24(%rsp)
imull %eax, %ecx
movq 0x18(%rsp), %rbx
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
movq %r14, %rdi
movq %rax, 0x38(%rsp)
movq %rax, %rsi
movq 0x10(%rsp), %rdx
callq 0x2abbb7
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r13, 0x30(%rsp)
movq %r13, %rdx
callq 0x2ac140
movl 0xb4(%r14), %ecx
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
movl (%r15), %ebx
movq %r15, 0x28(%rsp)
movl 0x4(%r15), %ecx
movl 0xe0(%r14), %edx
movl 0xc0(%r14), %esi
addq %rdx, %rsi
movl 0xb8(%r14), %r13d
addq %rsi, %r13
addq %rcx, %r13
movl 0x68(%r14), %r12d
movl 0xb0(%r14), %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, %r15
leaq 0x48(%r14), %rax
movq %rax, 0x40(%rsp)
subl $0x1, %r15d
jb 0x2aadaf
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x28c984
movl %eax, %ebp
movzwl 0xc4(%r14), %esi
movq 0x40(%rsp), %rdi
movl %eax, %edx
movq 0x30(%rsp), %rcx
callq 0x2ac16a
movq 0x50(%r14), %rax
movl %ebp, %ecx
imulq $0x18, %rcx, %rcx
movl 0x8(%rax,%rcx), %eax
addq %rax, %rbx
addq %r12, %r13
jmp 0x2aad64
movq %rbx, (%rsp)
movq %r14, %rdi
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %r15
movq %r15, %rdx
movl 0x24(%rsp), %ecx
movq 0x30(%rsp), %rbx
movq %rbx, %r8
movq %r13, %r9
callq 0x2ac1f9
movl 0xb0(%r14), %eax
movq 0x38(%rsp), %rcx
imulq %rax, %rcx
movl 0xb4(%r14), %esi
imulq %rcx, %rsi
movq 0x70(%r14), %rdi
movq 0x10(%rsp), %rcx
addq $0x20, %rcx
movq %r15, %rdx
callq 0x2ae7ee
movzbl 0xc6(%r14), %ecx
subq %rax, (%rbx,%rcx,8)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa0(%r14), %rdi
callq 0x14906a
addq $0x20, 0x10(%rsp)
movzwl %ax, %r15d
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x2aae13
movq 0x70(%r14), %rbx
movq 0xa0(%r14), %rdi
movzbl %r12b, %esi
callq 0x2ac265
movzbl %al, %ecx
movq %rbx, %rdi
xorl %esi, %esi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %r8
callq 0x2ae5ea
movq %rax, (%r13,%r12,8)
incq %r12
jmp 0x2aae3b
movq 0x18d0ec(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x3a18d(%rip), %rsi     # 0x2e5013
leaq 0xd674e(%rip), %rdx     # 0x3815db
leaq 0xd6976(%rip), %rcx     # 0x38180a
leaq 0xd5ee5(%rip), %r8      # 0x380d80
movl $0x581, %r9d            # imm = 0x581
jmp 0x2aaecf
movq 0x18d0be(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x3a15f(%rip), %rsi     # 0x2e5013
leaq 0xd6965(%rip), %rdx     # 0x381820
leaq 0xd6948(%rip), %rcx     # 0x38180a
leaq 0xd5eb7(%rip), %r8      # 0x380d80
movl $0x583, %r9d            # imm = 0x583
xorl %eax, %eax
callq 0x17a50
callq 0x17390