// File: /workspace/github_c_makefile_star2_O3/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 0x30ca1a
movq %rdi, %r14
leaq 0x1ac3ed(%rip), %rax    # 0x4b8bb0
cmpq %rax, (%rdi)
jne 0x30ca1a
movq %rcx, %rbx
testq %rcx, %rcx
je 0x30ca1f
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 0x30cc26
movq %rax, %r15
movl 0x4(%rax), %edi
movl 0xc0(%r14), %eax
movl 0xe0(%r14), %ecx
movl 0x68(%r14), %edx
imull 0xb0(%r14), %edx
movl 0xb8(%r14), %esi
leaq (%rax,%rcx), %r8
addq %rsi, %r8
addq %rdx, %r8
addq %rdi, %r8
movq %r8, (%rbx)
movl 0x30(%rbx), %edi
testb $0x1, %bpl
jne 0x30c893
testb $0x1, %dil
je 0x30c886
movq 0x20(%rbx), %rdi
leaq 0xd4154(%rip), %rsi     # 0x3e09d0
movl $0x544, %edx            # imm = 0x544
callq 0x1045eb
movq 0x10(%r15), %rdi
movq %rdi, 0x20(%rbx)
jmp 0x30c92c
testb $0x1, %dil
jne 0x30c8f5
addl %eax, %ecx
addl %esi, %ecx
addl %edx, %ecx
movq 0x90(%r14), %rax
addq %rcx, %rax
addq $0x7, %rax
movq %rax, %rdi
shrq $0x3, %rdi
andl $0x7, %eax
cmpq $0x1, %rax
sbbq $-0x1, %rdi
leaq 0xd410a(%rip), %rsi     # 0x3e09d0
movl $0x53c, %edx            # imm = 0x53C
callq 0x104226
movq %rax, 0x28(%rbx)
movl 0xe0(%r14), %ecx
movl 0xc0(%r14), %eax
movl 0xb0(%r14), %edx
movl 0xb8(%r14), %esi
imull 0x68(%r14), %edx
addl %ecx, %eax
addl %esi, %eax
addl %edx, %eax
movq 0x20(%rbx), %rdi
movq 0x10(%r15), %rsi
movq 0x90(%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
movq 0x10(%r15), %rdi
movl 0x4(%r15), %eax
movl 0xb8(%r14), %edx
movl 0xc0(%r14), %ecx
movl 0xe0(%r14), %esi
addq %rcx, %rsi
addq %rax, %rsi
callq 0x2f37dc
movl (%r15), %ecx
addq %rax, %rcx
movq %rcx, 0x8(%rbx)
movl 0x30(%rbx), %eax
testb $0x4, %bpl
jne 0x30c989
testb $0x4, %al
je 0x30c97c
movq 0x28(%rbx), %rdi
leaq 0xd405e(%rip), %rsi     # 0x3e09d0
movl $0x557, %edx            # imm = 0x557
callq 0x1045eb
movq 0x8(%r15), %rax
movq %rax, 0x28(%rbx)
jmp 0x30ca0c
testb $0x4, %al
jne 0x30c9d3
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 0xd4010(%rip), %rsi     # 0x3e09d0
movl $0x54f, %edx            # imm = 0x54F
callq 0x104226
movq %rax, %rdi
movq %rax, 0x28(%rbx)
jmp 0x30c9d7
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 0x8ff88
callq 0x8ff4f