// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/eis-blockcomp.c
// Function: blockCompSeqExpose
static void
blockCompSeqExpose(struct encIdxSeq *eSeqIdx, GtUword pos, int flags,
                   struct extBitsRetrieval *retval, union EISHint *hint)
{
  struct blockCompositionSeq *seqIdx;
  gt_assert(eSeqIdx && eSeqIdx->classInfo == &blockCompositionSeqClass);
  gt_assert(retval);
  seqIdx = encIdxSeq2blockCompositionSeq(eSeqIdx);
  {
    struct superBlock *sBlock;
    GtUword bucketNum, end;
    bucketNum = bucketNumFromPos(seqIdx, pos);
    retval->start = bucketBasePos(seqIdx, bucketNum);
    end = bucketBasePos(seqIdx, bucketNum + 1);
    if (end >= seqIdx->baseClass.seqLen)
      end = seqIdx->baseClass.seqLen;
    retval->len = end - retval->start;
#ifdef USE_SBLOCK_CACHE
    sBlock = cacheFetchSuperBlock(seqIdx, bucketNum,
                                  &hint->bcHint.sBlockCache);
#else
    sBlock = fetchSuperBlock(seqIdx, bucketNum, NULL);
#endif
    retval->cwOffset = sBlockCWExtBitsOffset(sBlock, seqIdx);
    if (flags & EBRF_PERSISTENT_CWBITS)
    {
      if (!(retval->flags & EBRF_PERSISTENT_CWBITS))
      {
          retval->varPart = gt_malloc(superBlockCWMaxReadSize(seqIdx));
      }
      memcpy(retval->cwPart, sBlock->cwData,
             superBlockCWMaxReadSize(seqIdx));
    }
    else
    {
      if (retval->flags & EBRF_PERSISTENT_CWBITS)
        gt_free(retval->cwPart);
      retval->cwPart = sBlock->cwData;
    }
    if (EBRF_RETRIEVE_VARBITS)
    {
      retval->varOffset = sBlockGetcbOffset(sBlock, seqIdx)
        + sBlock->varDataMemBase;
      if (flags & EBRF_PERSISTENT_VARBITS)
      {
        if (!(retval->flags & EBRF_PERSISTENT_VARBITS))
        {
          retval->varPart = gt_malloc(superBlockVarMaxReadSize(seqIdx));
        }
        memcpy(retval->varPart, sBlock->varData,
               superBlockVarMaxReadSize(seqIdx));
      }
      else
      {
        if (retval->flags & EBRF_PERSISTENT_VARBITS)
          gt_free(retval->varPart);
        retval->varPart = sBlock->varData;
      }
    }
    else
    {
      if (retval->flags & EBRF_PERSISTENT_VARBITS)
        gt_free(retval->varPart);
      retval->varPart = NULL;
      retval->varOffset = 0;
    }
#ifndef USE_SBLOCK_CACHE
    deleteSuperBlock(sBlock);
#endif
    retval->flags = flags;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x316c76
movq %rdi, %r14
leaq 0x1ad196(%rip), %rax    # 0x4c3bc0
cmpq %rax, (%rdi)
jne 0x316c76
movq %rcx, %rbx
testq %rcx, %rcx
je 0x316c7b
movl %edx, %ebp
movl 0xb0(%r14), %ecx
movl 0xb4(%r14), %edi
movl %edi, %r9d
imull %ecx, %r9d
movq %rsi, %rax
xorl %edx, %edx
divq %r9
imulq %rcx, %rdi
leaq 0x1(%rax), %rcx
imulq %rdi, %rcx
imulq %rax, %rdi
movq %rdi, 0x10(%rbx)
movq 0x10(%r14), %rdx
cmpq %rdx, %rcx
cmovaeq %rdx, %rcx
subq %rdi, %rcx
movq %rcx, 0x18(%rbx)
movq %r14, %rdi
movq %rax, %rsi
movq %r8, %rdx
callq 0x316e82
movq %rax, %r15
movl 0xe0(%r14), %ecx
movl 0xc0(%r14), %eax
leaq (%rax,%rcx), %rdi
movl 0x68(%r14), %edx
movl 0xb8(%r14), %esi
addq %rsi, %rdi
imull 0xb0(%r14), %edx
addq %rdx, %rdi
movl 0x4(%r15), %r8d
addq %rdi, %r8
movq %r8, (%rbx)
movl 0x30(%rbx), %edi
testb $0x1, %bpl
jne 0x316afb
testb $0x1, %dil
je 0x316aee
movq 0x20(%rbx), %rdi
leaq 0xd35dc(%rip), %rsi     # 0x3ea0c0
movl $0x544, %edx            # imm = 0x544
callq 0x109670
movq 0x10(%r15), %rax
movq %rax, 0x20(%rbx)
jmp 0x316b8c
testb $0x1, %dil
jne 0x316b3c
addl %ecx, %eax
addl %esi, %eax
addl %edx, %eax
movq 0x90(%r14), %rcx
addq %rcx, %rax
addq $0x7, %rax
movq %rax, %rdi
shrq $0x3, %rdi
andl $0x7, %eax
cmpq $0x1, %rax
sbbq $-0x1, %rdi
leaq 0xd3592(%rip), %rsi     # 0x3ea0c0
movl $0x53c, %edx            # imm = 0x53C
callq 0x1092b2
movq %rax, 0x28(%rbx)
movq 0x20(%rbx), %rdi
movq 0x10(%r15), %rsi
movl 0xc0(%r14), %eax
addl 0xe0(%r14), %eax
addl 0xb8(%r14), %eax
movl 0xb0(%r14), %ecx
imull 0x68(%r14), %ecx
addl %eax, %ecx
movq 0x90(%r14), %rax
addq %rcx, %rax
addq $0x7, %rax
movq %rax, %rdx
shrq $0x3, %rdx
andl $0x7, %eax
cmpq $0x1, %rax
sbbq $-0x1, %rdx
callq 0x17660
movl 0xe0(%r14), %eax
movl 0xb8(%r14), %edx
movl 0xc0(%r14), %ecx
addq %rax, %rcx
movl 0x4(%r15), %esi
addq %rcx, %rsi
movq 0x10(%r15), %rdi
callq 0x2fcc2c
movl (%r15), %ecx
addq %rax, %rcx
movq %rcx, 0x8(%rbx)
movl 0x30(%rbx), %eax
testb $0x4, %bpl
jne 0x316bea
testb $0x4, %al
je 0x316be0
movq 0x28(%rbx), %rdi
leaq 0xd34ea(%rip), %rsi     # 0x3ea0c0
movl $0x557, %edx            # imm = 0x557
callq 0x109670
movq 0x8(%r15), %rax
movq %rax, 0x28(%rbx)
jmp 0x316c68
testb $0x4, %al
jne 0x316c2f
movl 0xb0(%r14), %eax
imull 0x6c(%r14), %eax
movq 0x88(%r14), %rcx
addq %rcx, %rax
addq $0x7, %rax
movq %rax, %rdi
shrq $0x3, %rdi
andl $0x7, %eax
cmpq $0x1, %rax
sbbq $-0x1, %rdi
leaq 0xd349f(%rip), %rsi     # 0x3ea0c0
movl $0x54f, %edx            # imm = 0x54F
callq 0x1092b2
movq %rax, 0x28(%rbx)
movq 0x28(%rbx), %rdi
movq 0x8(%r15), %rsi
movl 0xb0(%r14), %eax
imull 0x6c(%r14), %eax
movq 0x88(%r14), %rcx
addq %rcx, %rax
addq $0x7, %rax
movq %rax, %rdx
shrq $0x3, %rdx
andl $0x7, %eax
cmpq $0x1, %rax
sbbq $-0x1, %rdx
callq 0x17660
movl %ebp, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x91d47
callq 0x91d0e