// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/eis-blockcomp.c
// Function: printBucket
static int
printBucket(const struct blockCompositionSeq *seqIdx, GtUword bucketNum,
            int flags, FILE *fp, union EISHint *hint)
{
  GtUword lastBucket = bucketNumFromPos(seqIdx,
                                             EISLength(&seqIdx->baseClass)),
                start, end;
  AlphabetRangeSize i, blockMapAlphabetSize = seqIdx->blockMapAlphabetSize;
  int outCount = 0;
  gt_assert(seqIdx && fp && hint);
  if (bucketBasePos(seqIdx, bucketNum) >= EISLength(&seqIdx->baseClass))
  {
    gt_log_log("warning: querying bucket "GT_WU""
            " beyond end of sequence!\n", bucketNum);
    bucketNum = lastBucket;
  }
  start = bucketBasePos(seqIdx, bucketNum);
  end = ((bucketNum < lastBucket)?
         bucketBasePos(seqIdx, bucketNum + 1):
         EISLength(&seqIdx->baseClass));
  outCount +=
    fprintf(fp, "# Inspecting bucket: "GT_WU"\n"
            "# bucket position start="GT_WU", end="GT_WU"\n"
            "# partial symbol sums up to start:\n",
            bucketNum, start, end - 1);
  {
    struct superBlock *sBlock;
    BitOffset varDataMemOffset, cwIdxMemOffset, varIdxOffset;
    Symbol *block;
    unsigned blockSize = seqIdx->blockSize,
      idxBits = seqIdx->compositionTable.compositionIdxBits;
#ifdef USE_SBLOCK_CACHE
    sBlock = cacheFetchSuperBlock(seqIdx, bucketNum,
                                  &hint->bcHint.sBlockCache);
#else
    sBlock = fetchSuperBlock(seqIdx, bucketNum, NULL);
#endif
    block = gt_malloc(sizeof (block[0]) * seqIdx->blockSize);
    for (i = 0; i < blockMapAlphabetSize; ++i)
    {
      if (flags & BUCKET_PRINT_BITSIZES)
      {
        outCount += fprintf(fp, "# partial sum[%u] bits: %u\n", i,
                            seqIdx->partialSymSumBits[i]);
      }
      outCount +=
        fprintf(fp, "# partial sum[%u]="GT_WU"\n", i,
                sBlockGetPartialSymSum(sBlock, i, seqIdx));
    }
    if (flags & BUCKET_PRINT_BITSIZES)
    {
      fprintf(fp, "# bit size of sBlockVarIdxOffset: %u\n",
              seqIdx->bitsPerVarDiskOffset);
    }
    fprintf(fp, "# sBlockVarIdxOffset="GT_LLU"\n",
            (varIdxOffset = sBlockGetVarIdxOffset(sBlock, seqIdx)));
    if (seqIdx->callBackDataOffsetBits)
      fprintf(fp, "# sBlockGetcbOffset="GT_LLU"\n",
              sBlockGetcbOffset(sBlock, seqIdx));
    i = 0;
    if (flags & BUCKET_PRINT_BITSIZES)
    {
      fprintf(fp, "# bits of constant width extension data: "GT_LLU"\n",
              (GtUint64)seqIdx->cwExtBitsPerBucket);
    }
    walkCompIndicesPrefix(
      seqIdx, sBlock, seqIdx->bucketBlocks, cwIdxMemOffset,
      outCount +=
      fprintf(
         fp, "# block %u: comp idx: "GT_WU", permIdxBits=%u, perm idx: " GT_WU
         "=>", i, (GtUword)compIndex,
         (unsigned)seqIdx->compositionTable.permutations[compIndex].permIdxBits,
         (GtUword)gt_bsGetPermCompIndex(
                   sBlock->varData, varDataMemOffset,
                   seqIdx->compositionTable.permutations[compIndex].permIdxBits)
         );
      unpackBlock(seqIdx, sBlock, cwIdxMemOffset, varDataMemOffset, block,
                  blockSize);
      outCount += printBlock(block, blockSize, fp);
      fputs("\n", fp);
      i++; , varDataMemOffset);
    gt_free(block);
    if (flags & BUCKET_PRINT_BITSTRING)
    {
      for (i = 0; i < blockMapAlphabetSize; ++i)
      {
        if (gt_bsPrint(fp, sBlock->cwData, seqIdx->partialSymSumBitsSums[i]
                    + sBlock->cwIdxMemBase, seqIdx->partialSymSumBits[i]))
          outCount += seqIdx->partialSymSumBits[i];
        if (flags & BUCKET_PRINT_BITSTRING_SEPARATOR)
          outCount += fputs("&", fp);
      }
      gt_bsPrint(fp, sBlock->cwData,
              cwPreVarIdxBits(seqIdx) + sBlock->cwIdxMemBase,
              seqIdx->bitsPerVarDiskOffset);
      if (flags & BUCKET_PRINT_BITSTRING_SEPARATOR)
        outCount += fputs("&", fp);
      if (seqIdx->callBackDataOffsetBits)
      {
        gt_bsPrint(fp, sBlock->cwData, sBlockGetcbOffsetOffset(sBlock, seqIdx),
                seqIdx->callBackDataOffsetBits);
        if (flags & BUCKET_PRINT_BITSTRING_SEPARATOR)
          outCount += fputs("&", fp);
      }
      walkCompIndicesPrefix(
        seqIdx, sBlock, seqIdx->bucketBlocks, cwIdxMemOffset,
        gt_bsPrint(fp, sBlock->cwData, cwIdxMemOffset, idxBits);
        if (flags & BUCKET_PRINT_BITSTRING_SEPARATOR)
          outCount += fputs("&", fp);, varDataMemOffset);
      gt_bsPrint(fp, sBlock->cwData, sBlockCWExtBitsOffset(sBlock, seqIdx),
              seqIdx->cwExtBitsPerBucket);
      fputs("\n# variable width string: \n", fp);
      walkCompIndicesPrefix(
        seqIdx, sBlock, seqIdx->bucketBlocks, cwIdxMemOffset,
        idxBits =
        seqIdx->compositionTable.permutations[compIndex].permIdxBits;
        gt_bsPrint(fp, sBlock->varData, varDataMemOffset, idxBits);
        if (flags & BUCKET_PRINT_BITSTRING_SEPARATOR)
          outCount += fputs("&", fp);, varDataMemOffset);
      if (bucketNum != lastBucket)
      {
        struct superBlock *nextSBlock;
        BitOffset nextVarIdxOffset;
#ifdef USE_SBLOCK_CACHE
        nextSBlock = cacheFetchSuperBlock(seqIdx, bucketNum + 1,
                                          &hint->bcHint.sBlockCache);
#else
        nextSBlock = fetchSuperBlock(seqIdx, bucketNum + 1, NULL);
#endif
        nextVarIdxOffset = sBlockGetVarIdxOffset(nextSBlock, seqIdx);
        gt_bsPrint(fp, sBlock->varData, varDataMemOffset,
                nextVarIdxOffset - varIdxOffset);
        fprintf(fp, "\n# varIdxOffset for next block: "GT_LLU"",
                (GtUint64)nextVarIdxOffset);
#ifndef USE_SBLOCK_CACHE
        deleteSuperBlock(sBlock);
#endif
      }
      fputs("\n", fp);
    }
    if (flags & BUCKET_PRINT_RANGES_OVERLAY)
    {
      fputs("# overlapping symbol ranges:\n", fp);
      gt_SRLPrintRangesInfo(seqIdx->rangeEncs, fp, start, end - start,
                         &hint->bcHint.rangeHint);
    }
  }
  return outCount;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r8, %r14
movl %edx, 0xc(%rsp)
movq %rsi, %r12
movq %rdi, %r15
movq 0x10(%rdi), %r9
movl 0xb0(%rdi), %esi
movl 0xb4(%rdi), %edi
movl %edi, %r8d
imull %esi, %r8d
movq %r9, %rax
xorl %edx, %edx
divq %r8
movq %rcx, 0x10(%rsp)
testq %rcx, %rcx
je 0x317c0c
testq %r14, %r14
je 0x317c0c
movq %rax, %rbx
movzwl 0xc4(%r15), %eax
movq %rax, 0x28(%rsp)
imulq %r12, %rsi
imulq %rdi, %rsi
cmpq %r9, %rsi
jb 0x3174eb
leaq 0xd3908(%rip), %rdi     # 0x3eade6
movq %r12, %rsi
xorl %eax, %eax
callq 0x108e02
movq %rbx, %r12
movl 0xb0(%r15), %eax
movl 0xb4(%r15), %edx
imulq %rax, %rdx
movq %rdx, %rcx
imulq %r12, %rcx
cmpq %rbx, %r12
movq %rbx, 0x68(%rsp)
jae 0x317519
leaq 0x1(%r12), %rax
imulq %rax, %rdx
jmp 0x31751d
movq 0x10(%r15), %rdx
movq %rdx, 0x80(%rsp)
leaq -0x1(%rdx), %r8
leaq 0xd38ec(%rip), %rsi     # 0x3eae1c
movq 0x10(%rsp), %rdi
movq %r12, %rdx
movq %rcx, 0x78(%rsp)
xorl %eax, %eax
callq 0x17ab0
movl %eax, %ebp
movl 0x68(%r15), %eax
movq %rax, 0x88(%rsp)
movl 0xb4(%r15), %ebx
movq %r15, %rdi
movq %r12, 0x70(%rsp)
movq %r12, %rsi
movq %r14, 0x50(%rsp)
movq %r14, %rdx
callq 0x316e82
movq %rax, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movl 0xb4(%r15), %edi
leaq 0xd2b37(%rip), %rsi     # 0x3ea0c0
movl $0xa09, %edx            # imm = 0xA09
callq 0x1092b2
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x28(%rsp)
movl %ebp, 0x8(%rsp)
je 0x31764d
leaq 0xd38eb(%rip), %r15     # 0x3eae9a
xorl %r13d, %r13d
movq 0x10(%rsp), %r14
testb $0x4, 0xc(%rsp)
jne 0x3175ca
movq 0x20(%rsp), %rbp
movl 0x8(%rsp), %r12d
jmp 0x3175f6
movq 0x20(%rsp), %rbp
movq 0xd0(%rbp), %rax
movl (%rax,%r13,4), %ecx
movq %r14, %rdi
leaq 0xd389a(%rip), %rsi     # 0x3eae7e
movl %r13d, %edx
xorl %eax, %eax
callq 0x17ab0
movl 0x8(%rsp), %r12d
addl %eax, %r12d
movq 0x18(%rsp), %rsi
movq 0x10(%rsi), %rdi
movq 0xd0(%rbp), %rax
movq 0xd8(%rbp), %rcx
movzbl %r13b, %edx
shll $0x2, %edx
movl 0x4(%rsi), %esi
addl (%rcx,%rdx), %esi
movl (%rax,%rdx), %edx
callq 0x2fcc2c
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x17ab0
addl %eax, %r12d
movl %r12d, 0x8(%rsp)
incq %r13
cmpq %r13, 0x28(%rsp)
jne 0x3175b7
jmp 0x317652
movq 0x10(%rsp), %r14
testb $0x4, 0xc(%rsp)
movq 0x20(%rsp), %rbp
je 0x317675
movl 0xc0(%rbp), %edx
leaq 0xd3846(%rip), %rsi     # 0x3eaeb1
movq %r14, %rdi
xorl %eax, %eax
callq 0x17ab0
movl 0xc0(%rbp), %edx
movl 0xe0(%rbp), %eax
movq 0x18(%rsp), %r15
movl 0x4(%r15), %esi
addq %rax, %rsi
movq 0x10(%r15), %rdi
callq 0x2fcc2c
leaq 0xd383a(%rip), %rsi     # 0x3eaed7
movq %r14, %rdi
movq %rax, 0x60(%rsp)
movq %rax, %rdx
xorl %eax, %eax
callq 0x17ab0
movl 0xb8(%rbp), %edx
testl %edx, %edx
je 0x3176ec
movl 0xc0(%rbp), %eax
movl 0xe0(%rbp), %ecx
addq %rcx, %rax
movl 0x4(%r15), %esi
addq %rax, %rsi
movq 0x10(%r15), %rdi
callq 0x2fcc2c
leaq 0xd3813(%rip), %rsi     # 0x3eaef2
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x17ab0
testb $0x4, 0xc(%rsp)
je 0x31770b
movq 0x90(%rbp), %rdx
leaq 0xd380b(%rip), %rsi     # 0x3eaf0c
movq %r14, %rdi
xorl %eax, %eax
callq 0x17ab0
movl 0xb0(%rbp), %edi
testl %edi, %edi
je 0x317889
movq %rbx, 0x90(%rsp)
movl 0x68(%rbp), %edx
movl (%r15), %ebx
movl 0x4(%r15), %eax
movl 0xe0(%rbp), %ecx
addq %rcx, %rax
movl 0xb8(%rbp), %esi
movl 0xc0(%rbp), %ecx
addq %rcx, %rsi
addq %rax, %rsi
leaq 0xbbf5c(%rip), %r13     # 0x3d36a9
xorl %r12d, %r12d
movq %rdx, 0x98(%rsp)
movq %rsi, 0x30(%rsp)
movl %edi, 0x4c(%rsp)
movq 0x10(%r15), %rdi
callq 0x2fba84
movl %r12d, 0x48(%rsp)
movzwl %r12w, %ecx
movl %ecx, 0x38(%rsp)
movq %r15, %rdx
movq %r14, %r15
movl %eax, %r14d
movq 0x50(%rbp), %rax
leaq (%r14,%r14,2), %rcx
movq %rcx, 0xa0(%rsp)
movl 0x8(%rax,%rcx,8), %r12d
movq 0x8(%rdx), %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x2fba84
movl %eax, %r9d
movq %r15, %rdi
leaq 0xd378a(%rip), %rsi     # 0x3eaf3b
movl 0x38(%rsp), %edx
movq %r14, %rcx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x17ab0
movl %eax, 0x44(%rsp)
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbx, 0x38(%rsp)
movq %rbx, %rcx
movq 0x58(%rsp), %rbp
movq %rbp, %r8
movq 0x90(%rsp), %rbx
movl %ebx, %r9d
callq 0x317303
movl $0x0, %r14d
testq %rbx, %rbx
je 0x317822
xorl %r12d, %r12d
xorl %r14d, %r14d
movzbl (%rbp,%r12), %edx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x17ab0
addl %eax, %r14d
incq %r12
cmpq %r12, %rbx
jne 0x317804
movl 0x8(%rsp), %eax
addl 0x44(%rsp), %eax
addl %r14d, %eax
movl %eax, 0x8(%rsp)
leaq 0xb1ee7(%rip), %rdi     # 0x3c971f
movq %r15, %rsi
callq 0x178c0
movl 0x48(%rsp), %r12d
incl %r12d
movq 0x20(%rsp), %rbp
movq 0x50(%rbp), %rax
movq 0xa0(%rsp), %rcx
movl 0x8(%rax,%rcx,8), %eax
movq 0x38(%rsp), %rbx
addq %rax, %rbx
movq 0x98(%rsp), %rdx
movq 0x30(%rsp), %rsi
addq %rdx, %rsi
movl 0x4c(%rsp), %edi
decl %edi
movq %r15, %r14
movq 0x18(%rsp), %r15
jne 0x317758
leaq 0xd2830(%rip), %rsi     # 0x3ea0c0
movq 0x58(%rsp), %rdi
movl $0xa35, %edx            # imm = 0xA35
callq 0x109670
testb $0x1, 0xc(%rsp)
jne 0x3178b5
movq 0x50(%rsp), %r15
movq 0x20(%rsp), %r13
jmp 0x317bbb
cmpq $0x0, 0x28(%rsp)
movq 0x20(%rsp), %r13
movl 0x8(%rsp), %ebp
je 0x317927
xorl %r14d, %r14d
leaq 0xd36a6(%rip), %rbx     # 0x3eaf76
movq 0x10(%r15), %rsi
movq 0xd0(%r13), %rax
movq 0xd8(%r13), %rcx
movl 0x4(%r15), %edx
addl (%rcx,%r14,4), %edx
movl (%rax,%r14,4), %ecx
movq 0x10(%rsp), %rdi
callq 0x2fa743
testl %eax, %eax
je 0x317907
movq 0xd0(%r13), %rax
addl (%rax,%r14,4), %ebp
testb $0x2, 0xc(%rsp)
je 0x31791d
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x178c0
addl %eax, %ebp
incq %r14
cmpq %r14, 0x28(%rsp)
jne 0x3178d0
movq 0x10(%r15), %rsi
movl 0xc0(%r13), %ecx
movl 0xe0(%r13), %eax
movl 0x4(%r15), %edx
addq %rax, %rdx
movq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x2fa743
testb $0x2, 0xc(%rsp)
je 0x317965
leaq 0xd361b(%rip), %rdi     # 0x3eaf76
movq %r14, %rsi
callq 0x178c0
addl %eax, %ebp
movl 0xb8(%r13), %ecx
testq %rcx, %rcx
je 0x3179ad
movq 0x10(%r15), %rsi
movl 0xc0(%r13), %eax
movl 0xe0(%r13), %edx
addq %rdx, %rax
movl 0x4(%r15), %edx
addq %rax, %rdx
movq %r14, %rdi
callq 0x2fa743
testb $0x2, 0xc(%rsp)
je 0x3179ad
leaq 0xd35d3(%rip), %rdi     # 0x3eaf76
movq %r14, %rsi
callq 0x178c0
addl %eax, %ebp
movl %ebp, 0x8(%rsp)
movl 0xb0(%r13), %ebp
testl %ebp, %ebp
je 0x317a2f
movl 0x68(%r13), %ebx
movl 0xe0(%r13), %eax
movl 0x4(%r15), %ecx
addq %rax, %rcx
movl 0xb8(%r13), %r15d
movl 0xc0(%r13), %eax
addq %rax, %r15
addq %rcx, %r15
movq 0x18(%rsp), %r12
movq 0x10(%r12), %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x2fba84
movq 0x10(%r12), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq 0x88(%rsp), %rcx
callq 0x2fa743
testb $0x2, 0xc(%rsp)
je 0x317a28
leaq 0xd355a(%rip), %rdi     # 0x3eaf76
movq %r14, %rsi
callq 0x178c0
addl %eax, 0x8(%rsp)
addq %rbx, %r15
decl %ebp
jne 0x3179e7
movq 0x18(%rsp), %r12
movq 0x10(%r12), %rsi
movl 0xe0(%r13), %eax
movl 0xc0(%r13), %ecx
addq %rax, %rcx
movl 0xb8(%r13), %eax
addq %rcx, %rax
movl 0x68(%r13), %ecx
imull 0xb0(%r13), %ecx
movl 0x4(%r12), %edx
addq %rax, %rdx
addq %rcx, %rdx
movq 0x90(%r13), %rcx
movq %r14, %rdi
callq 0x2fa743
leaq 0xd34f7(%rip), %rdi     # 0x3eaf78
movq %r14, %rsi
callq 0x178c0
movl (%r12), %ebx
movl 0xb0(%r13), %ebp
testl %ebp, %ebp
je 0x317b33
movl 0x68(%r13), %edx
movl 0xe0(%r13), %eax
movl 0x4(%r12), %ecx
addq %rax, %rcx
movl 0xb8(%r13), %r12d
movl 0xc0(%r13), %eax
addq %rax, %r12
addq %rcx, %r12
movq %rdx, 0x30(%rsp)
movq 0x18(%rsp), %r15
movq 0x10(%r15), %rdi
movq %r12, %rsi
callq 0x2fba84
movq 0x50(%r13), %rcx
movl %eax, %eax
leaq (%rax,%rax,2), %r14
movl 0x8(%rcx,%r14,8), %ecx
movq 0x8(%r15), %rsi
movq 0x10(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rdx
callq 0x2fa743
testb $0x2, 0xc(%rsp)
je 0x317b16
leaq 0xd346c(%rip), %rdi     # 0x3eaf76
movq %r13, %rsi
callq 0x178c0
addl %eax, 0x8(%rsp)
movq 0x20(%rsp), %r13
movq 0x50(%r13), %rax
movl 0x8(%rax,%r14,8), %eax
addq %rax, %rbx
movq 0x30(%rsp), %rdx
addq %rdx, %r12
decl %ebp
jne 0x317acd
movq 0x70(%rsp), %rsi
cmpq 0x68(%rsp), %rsi
movq 0x50(%rsp), %r15
je 0x317ba7
incq %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x316e82
movl 0xc0(%r13), %edx
movl 0xe0(%r13), %ecx
movl 0x4(%rax), %esi
addq %rcx, %rsi
movq 0x10(%rax), %rdi
callq 0x2fcc2c
movq %rax, %r14
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rsi
movq %r14, %rcx
subq 0x60(%rsp), %rcx
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rdx
callq 0x2fa743
leaq 0xd33fa(%rip), %rsi     # 0x3eaf94
movq %r12, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x17ab0
leaq 0xb1b71(%rip), %rdi     # 0x3c971f
movq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x178c0
movl 0x8(%rsp), %ebx
testb $0x8, 0xc(%rsp)
je 0x317bf8
leaq 0xd33ec(%rip), %rdi     # 0x3eafb9
movq %r14, %rsi
callq 0x178c0
movq 0x70(%r13), %rdi
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %rdx
subq %rdx, %rcx
addq $0x20, %r15
movq %r14, %rsi
movq %r15, %r8
callq 0x319b7f
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x91fba
nopl (%rax)