// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movl %esi, 0x8c(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
cmpq $0x0, 0x90(%rsp)
je 0x4aaec7
movq 0x90(%rsp), %rax
leaq 0x190d4e(%rip), %rcx    # 0x63bc10
cmpq %rcx, (%rax)
je 0x4aaeff
movq 0x1910d2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x6b13b(%rip), %rsi     # 0x516013
leaq 0x10b913(%rip), %rdx    # 0x5b67f2
leaq 0x10bb3b(%rip), %rcx    # 0x5b6a21
leaq 0x10b01b(%rip), %r8     # 0x5b5f08
movl $0x581, %r9d            # imm = 0x581
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4aaf01
movq 0x90(%rsp), %rdi
callq 0x4ac370
movq %rax, 0x68(%rsp)
movl 0x8c(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x90(%rsp), %rdi
callq 0x4ad0a0
movq %rax, %rdi
callq 0x4a64a0
movl %eax, %ecx
movl 0x20(%rsp), %eax
cmpl %ecx, %eax
jb 0x4aaf75
movq 0x19105c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x6b0c5(%rip), %rsi     # 0x516013
leaq 0x10bae2(%rip), %rdx    # 0x5b6a37
leaq 0x10bac5(%rip), %rcx    # 0x5b6a21
leaq 0x10afa5(%rip), %r8     # 0x5b5f08
movl $0x583, %r9d            # imm = 0x583
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4aaf77
movq 0x68(%rsp), %rax
movq 0xa8(%rax), %rax
movl 0x8c(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1c(%rsp)
subl $0x1, %eax
je 0x4aafaa
jmp 0x4aaf98
movl 0x1c(%rsp), %eax
subl $0x2, %eax
je 0x4ab16f
jmp 0x4ab213
movq 0x68(%rsp), %rax
movl 0xb4(%rax), %eax
movl %eax, 0x3c(%rsp)
movq 0x68(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x4ac3d0
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0x4ac400
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x78(%rsp), %rdx
callq 0x4ad0f0
movq 0x68(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x4ac4f0
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq 0x68(%rsp), %rsi
xorl %edx, %edx
callq 0x4ac510
movq %rax, 0x58(%rsp)
movq 0x50(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x60(%rsp)
movq 0x48(%rsp), %rax
movq 0x68(%rsp), %rcx
movl 0xb0(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movl 0x68(%rax), %eax
movl %eax, 0x34(%rsp)
cmpl $0x0, 0x38(%rsp)
je 0x4ab0e1
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x58(%rsp), %rsi
movl 0x34(%rsp), %edx
callq 0x473e40
movl %eax, 0x30(%rsp)
movq 0x68(%rsp), %rdi
addq $0x48, %rdi
movq 0x68(%rsp), %rax
movzwl 0xc4(%rax), %esi
movl 0x30(%rsp), %edx
movq 0x78(%rsp), %rcx
callq 0x4ad150
movq 0x68(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x30(%rsp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addq 0x60(%rsp), %rax
movq %rax, 0x60(%rsp)
movl 0x34(%rsp), %eax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
movl 0x38(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x4ab05d
jmp 0x4ab0e3
jmp 0x4ab0e5
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x80(%rsp), %rdx
movl 0x3c(%rsp), %ecx
movq 0x78(%rsp), %r8
movq 0x58(%rsp), %r9
movq 0x60(%rsp), %rax
movq %rax, (%rsp)
callq 0x4ad240
movq 0x68(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x4ac790
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq 0x70(%rax), %rdi
movq 0x28(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x70(%rsp), %rcx
addq $0x20, %rcx
callq 0x4b2020
movq %rax, %rsi
movq 0x78(%rsp), %rax
movq 0x68(%rsp), %rcx
movzbl 0xc6(%rcx), %ecx
movq (%rax,%rcx,8), %rdx
subq %rsi, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x4ab213
movq 0x68(%rsp), %rax
movq 0xa0(%rax), %rdi
callq 0x22aeb0
movw %ax, 0x24(%rsp)
movw $0x0, 0x26(%rsp)
movzwl 0x26(%rsp), %eax
movzwl 0x24(%rsp), %ecx
cmpl %ecx, %eax
jge 0x4ab211
movq 0x68(%rsp), %rax
movq 0x70(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rax
movq 0xa0(%rax), %rdi
movw 0x26(%rsp), %ax
movzbl %al, %esi
callq 0x4ad300
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movq 0x70(%rsp), %r8
addq $0x20, %r8
xorl %ecx, %ecx
movl %ecx, %esi
movzbl %al, %ecx
callq 0x4b1ba0
movq %rax, %rdx
movq 0x78(%rsp), %rax
movzwl 0x26(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movw 0x26(%rsp), %ax
addw $0x1, %ax
movw %ax, 0x26(%rsp)
jmp 0x4ab18c
jmp 0x4ab213
addq $0x98, %rsp
retq
nopl (%rax,%rax)