// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2ab856
movq %rdi, %r14
leaq 0x18c4b7(%rip), %rax    # 0x437b80
cmpq %rax, (%rdi)
jne 0x2ab856
movq %rcx, %rbx
testq %rcx, %rcx
je 0x2ab884
movq %r8, %r15
movl %edx, %ebp
movq %rsi, %r12
movq %r14, %rdi
callq 0x2abb6e
movl 0xb0(%r14), %ecx
movl 0xb4(%r14), %esi
movl %esi, %edi
imull %ecx, %edi
movq %r12, %rax
xorl %edx, %edx
divq %rdi
imulq %rcx, %rsi
leaq 0x1(%rax), %rcx
imulq %rsi, %rcx
imulq %rax, %rsi
movq %rsi, 0x10(%rbx)
movq 0x10(%r14), %rdx
cmpq %rdx, %rcx
cmovaeq %rdx, %rcx
subq %rsi, %rcx
movq %rcx, 0x18(%rbx)
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x2abbb7
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x2ac2d7
movq %rax, (%rbx)
movl 0x30(%rbx), %eax
testb $0x1, %bpl
jne 0x2ab77a
testb $0x1, %al
je 0x2ab770
movq 0x20(%rbx), %rdi
leaq 0xd561a(%rip), %rsi     # 0x380d80
movl $0x544, %edx            # imm = 0x544
callq 0x936f9
movq 0x10(%r15), %rax
movq %rax, 0x20(%rbx)
jmp 0x2ab7bc
testb $0x1, %al
jne 0x2ab79e
movq %r14, %rdi
callq 0x2abf53
leaq 0xd55f3(%rip), %rsi     # 0x380d80
movq %rax, %rdi
movl $0x53c, %edx            # imm = 0x53C
callq 0x93160
movq %rax, 0x28(%rbx)
movq 0x20(%rbx), %r12
movq 0x10(%r15), %r13
movq %r14, %rdi
callq 0x2abf53
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x17630
movq %r15, %rdi
movq %r14, %rsi
callq 0x2ac2eb
movl (%r15), %ecx
addq %rax, %rcx
movq %rcx, 0x8(%rbx)
movl 0x30(%rbx), %eax
testb $0x4, %bpl
jne 0x2ab7fd
testb $0x4, %al
je 0x2ab7f3
movq 0x28(%rbx), %rdi
leaq 0xd5597(%rip), %rsi     # 0x380d80
movl $0x557, %edx            # imm = 0x557
callq 0x936f9
movq 0x8(%r15), %rax
movq %rax, 0x28(%rbx)
jmp 0x2ab844
testb $0x4, %al
jne 0x2ab826
movq %r14, %rdi
callq 0x2abf85
leaq 0xd5570(%rip), %rsi     # 0x380d80
movq %rax, %rdi
movl $0x54f, %edx            # imm = 0x54F
callq 0x93160
movq %rax, %r12
movq %rax, 0x28(%rbx)
jmp 0x2ab82a
movq 0x28(%rbx), %r12
movq 0x8(%r15), %r15
movq %r14, %rdi
callq 0x2abf85
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x17630
movl %ebp, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18c70b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x397ac(%rip), %rsi     # 0x2e5013
leaq 0xd5d6d(%rip), %rdx     # 0x3815db
leaq 0xd60a3(%rip), %rcx     # 0x381918
leaq 0xd5504(%rip), %r8      # 0x380d80
movl $0x525, %r9d            # imm = 0x525
jmp 0x2ab8b0
movq 0x18c6dd(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x3977e(%rip), %rsi     # 0x2e5013
leaq 0x58ae6(%rip), %rdx     # 0x304382
leaq 0xd6075(%rip), %rcx     # 0x381918
leaq 0xd54d6(%rip), %r8      # 0x380d80
movl $0x526, %r9d            # imm = 0x526
xorl %eax, %eax
callq 0x17a50
callq 0x17390