// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rcx, %r14
movl %edx, 0x1c(%rsp)
movq %rsi, %r13
movq %rdi, %r15
movq 0x10(%rdi), %rcx
movl 0xb0(%rdi), %esi
movl 0xb4(%rdi), %r8d
movl %r8d, %edi
imull %esi, %edi
movq %rcx, %rax
xorl %edx, %edx
divq %rdi
testq %r14, %r14
je 0x2aca56
testq %rbx, %rbx
je 0x2aca56
movq %rax, %r12
movzwl 0xc4(%r15), %eax
movq %rax, 0x50(%rsp)
movq %rsi, %rax
imulq %r13, %rax
imulq %r8, %rax
cmpq %rcx, %rax
movq %r12, 0x68(%rsp)
jae 0x2ac3a0
imulq %rsi, %r8
movq %r8, %rcx
imulq %r13, %rcx
cmpq %r13, %r12
jbe 0x2ac3ca
leaq 0x1(%r13), %rax
imulq %rax, %r8
jmp 0x2ac3ce
leaq 0xd572e(%rip), %rdi     # 0x381ad5
movq %r13, %rsi
xorl %eax, %eax
callq 0x92a82
movl 0xb0(%r15), %eax
movl 0xb4(%r15), %ecx
imulq %rax, %rcx
imulq %r12, %rcx
movq %r12, %r13
movq 0x10(%r15), %r8
movq %r8, 0x80(%rsp)
decq %r8
leaq 0xd572b(%rip), %rsi     # 0x381b0b
movq %r14, 0x20(%rsp)
movq %r14, %rdi
movq %r13, %rdx
movq %rcx, 0x78(%rsp)
xorl %eax, %eax
callq 0x17a50
movl %eax, 0xc(%rsp)
movl 0x68(%r15), %eax
movq %rax, 0x88(%rsp)
movl 0xb4(%r15), %r12d
movq %r15, %rdi
movq %r13, 0x70(%rsp)
movq %r13, %rsi
movq %rbx, 0x48(%rsp)
movq %rbx, %rdx
callq 0x2abbb7
movq %rax, 0x28(%rsp)
movq %r15, 0x10(%rsp)
movl 0xb4(%r15), %edi
leaq 0xd4942(%rip), %rsi     # 0x380d80
movl $0xa09, %edx            # imm = 0xA09
callq 0x93160
movq %rax, %rbp
xorl %r13d, %r13d
cmpq %r13, 0x50(%rsp)
je 0x2ac4da
testb $0x4, 0x1c(%rsp)
jne 0x2ac471
movq 0x10(%rsp), %r15
movl 0xc(%rsp), %r14d
movq 0x20(%rsp), %rbx
jmp 0x2ac4a2
movq 0x10(%rsp), %r15
movq 0xd0(%r15), %rax
movl (%rax,%r13,4), %ecx
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0xd56dd(%rip), %rsi     # 0x381b6d
movl %r13d, %edx
xorl %eax, %eax
callq 0x17a50
movl 0xc(%rsp), %r14d
addl %eax, %r14d
movzbl %r13b, %esi
movq 0x28(%rsp), %rdi
movq %r15, %rdx
callq 0x2abdb4
movq %rbx, %rdi
leaq 0xd56cc(%rip), %rsi     # 0x381b89
movl %r13d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x17a50
addl %eax, %r14d
movl %r14d, 0xc(%rsp)
incq %r13
jmp 0x2ac44e
testb $0x4, 0x1c(%rsp)
movq 0x20(%rsp), %r14
je 0x2ac502
movq 0x10(%rsp), %rax
movl 0xc0(%rax), %edx
leaq 0xd56a8(%rip), %rsi     # 0x381ba0
movq %r14, %rdi
xorl %eax, %eax
callq 0x17a50
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x2abf38
leaq 0xd56a8(%rip), %rsi     # 0x381bc6
movq %r14, %rdi
movq %rax, 0x60(%rsp)
movq %rax, %rdx
xorl %eax, %eax
callq 0x17a50
cmpl $0x0, 0xb8(%r15)
je 0x2ac55b
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x2ac2eb
leaq 0xd5693(%rip), %rsi     # 0x381be1
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x17a50
testb $0x4, 0x1c(%rsp)
je 0x2ac57f
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rdx
leaq 0xd5686(%rip), %rsi     # 0x381bfb
movq %r14, %rdi
xorl %eax, %eax
callq 0x17a50
movq 0x28(%rsp), %rax
movl (%rax), %r14d
movl 0x4(%rax), %eax
movq 0x10(%rsp), %rdi
movl 0xe0(%rdi), %ecx
addq %rax, %rcx
movl 0xc0(%rdi), %eax
movl 0xb8(%rdi), %esi
addq %rax, %rsi
addq %rcx, %rsi
movl 0x68(%rdi), %edx
movl 0xb0(%rdi), %eax
leaq 0xbddcf(%rip), %rbx     # 0x36a389
movl $0x0, 0x34(%rsp)
movq %rdx, 0x90(%rsp)
subl $0x1, %eax
jb 0x2ac6f3
movl %eax, 0x44(%rsp)
movq 0x28(%rsp), %r13
movq 0x10(%r13), %rdi
movq %rsi, 0x58(%rsp)
callq 0x28c984
movzwl 0x34(%rsp), %ecx
movl %ecx, 0x38(%rsp)
movl %eax, %ecx
movq %rcx, 0x98(%rsp)
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
imulq $0x18, %rcx, %rcx
movq %rcx, 0xa0(%rsp)
movl 0x8(%rax,%rcx), %r15d
movq 0x8(%r13), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x28c984
movl %eax, %r9d
movq %r14, %r13
xorl %r14d, %r14d
movq 0x20(%rsp), %rdi
leaq 0xd55ef(%rip), %rsi     # 0x381c2a
movl 0x38(%rsp), %edx
movq 0x98(%rsp), %rcx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x17a50
movl %eax, %r15d
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r13, 0x38(%rsp)
movq %r13, %rcx
movq %rbp, %r8
movl %r12d, %r9d
callq 0x2ac054
xorl %r13d, %r13d
cmpq %r14, %r12
je 0x2ac69b
movzbl (%rbp,%r14), %edx
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x17a50
addl %eax, %r13d
incq %r14
jmp 0x2ac679
addl 0xc(%rsp), %r15d
addl %r13d, %r15d
leaq 0xb3e45(%rip), %rdi     # 0x3604ef
movq 0x20(%rsp), %rsi
callq 0x17870
incl 0x34(%rsp)
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movq 0xa0(%rsp), %rcx
movl 0x8(%rax,%rcx), %eax
movq 0x38(%rsp), %r14
addq %rax, %r14
movq 0x58(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rdx, %rsi
movl %r15d, 0xc(%rsp)
movl 0x44(%rsp), %eax
jmp 0x2ac5ca
leaq 0xd4686(%rip), %rsi     # 0x380d80
movq %rbp, %rdi
movl $0xa35, %edx            # imm = 0xA35
callq 0x936f9
testb $0x1, 0x1c(%rsp)
jne 0x2ac718
movq 0x48(%rsp), %r14
jmp 0x2ac9fb
xorl %r15d, %r15d
leaq 0xd5543(%rip), %rbx     # 0x381c65
movq 0x20(%rsp), %r14
movl 0xc(%rsp), %ebp
movq 0x28(%rsp), %r12
movq 0x10(%r12), %rsi
cmpq %r15, 0x50(%rsp)
je 0x2ac791
movq 0x10(%rsp), %rcx
movq 0xd0(%rcx), %rax
movq 0xd8(%rcx), %rcx
movl 0x4(%r12), %edx
addl (%rcx,%r15,4), %edx
movl (%rax,%r15,4), %ecx
movq %r14, %rdi
callq 0x28b2c3
testl %eax, %eax
je 0x2ac778
movq 0x10(%rsp), %rax
movq 0xd0(%rax), %rax
addl (%rax,%r15,4), %ebp
testb $0x2, 0x1c(%rsp)
je 0x2ac78c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x17870
addl %eax, %ebp
incq %r15
jmp 0x2ac730
movq 0x10(%rsp), %rax
movl 0xc0(%rax), %ecx
movl 0xe0(%rax), %eax
movl 0x4(%r12), %edx
addq %rax, %rdx
movq %r14, %rdi
callq 0x28b2c3
testb $0x2, 0x1c(%rsp)
je 0x2ac7ca
leaq 0xd54a5(%rip), %rdi     # 0x381c65
movq %r14, %rsi
callq 0x17870
addl %eax, %ebp
movq 0x10(%rsp), %rax
movl 0xb8(%rax), %ecx
testq %rcx, %rcx
je 0x2ac81b
movq 0x10(%r12), %rsi
movq 0x10(%rsp), %rdx
movl 0xc0(%rdx), %eax
movl 0xe0(%rdx), %edx
addq %rdx, %rax
movl 0x4(%r12), %edx
addq %rax, %rdx
movq %r14, %rdi
callq 0x28b2c3
testb $0x2, 0x1c(%rsp)
je 0x2ac81b
leaq 0xd5454(%rip), %rdi     # 0x381c65
movq %r14, %rsi
callq 0x17870
addl %eax, %ebp
movl %ebp, 0xc(%rsp)
movl 0x4(%r12), %eax
movq 0x10(%rsp), %rdx
movl 0xe0(%rdx), %ecx
addq %rax, %rcx
movl 0xc0(%rdx), %eax
movl 0xb8(%rdx), %ebx
addq %rax, %rbx
addq %rcx, %rbx
movl 0x68(%rdx), %r15d
movl 0xb0(%rdx), %ebp
movq 0x28(%rsp), %r12
movq 0x10(%r12), %r13
subl $0x1, %ebp
jb 0x2ac8a2
movq %r13, %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x28c984
movq 0x10(%r12), %rsi
movq %r14, %rdi
movq %rbx, %rdx
movq 0x88(%rsp), %rcx
callq 0x28b2c3
testb $0x2, 0x1c(%rsp)
je 0x2ac89d
leaq 0xd53d4(%rip), %rdi     # 0x381c65
movq %r14, %rsi
callq 0x17870
addl %eax, 0xc(%rsp)
addq %r15, %rbx
jmp 0x2ac853
movq %r12, %rdi
movq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x2ac2d7
movq 0x90(%rbx), %rcx
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x28b2c3
leaq 0xd5399(%rip), %rdi     # 0x381c67
movq %r14, %rsi
callq 0x17870
movl (%r12), %ecx
movl 0x4(%r12), %eax
movq %rcx, %r12
movl 0xe0(%rbx), %ecx
addq %rax, %rcx
movl 0xc0(%rbx), %eax
movl 0xb8(%rbx), %r15d
addq %rax, %r15
addq %rcx, %r15
movl 0x68(%rbx), %edx
movl 0xb0(%rbx), %ebp
subl $0x1, %ebp
jb 0x2ac983
movq %r12, %r13
movq 0x28(%rsp), %r12
movq 0x10(%r12), %rdi
movq %r15, %rsi
movq %rdx, %rbx
callq 0x28c984
movq 0x10(%rsp), %rcx
movq 0x50(%rcx), %rcx
movl %eax, %eax
imulq $0x18, %rax, %r14
movl 0x8(%rcx,%r14), %ecx
movq 0x8(%r12), %rsi
movq %r13, %r12
movq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r12, %rdx
callq 0x28b2c3
testb $0x2, 0x1c(%rsp)
je 0x2ac96a
leaq 0xd5307(%rip), %rdi     # 0x381c65
movq %r13, %rsi
callq 0x17870
addl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax,%r14), %eax
addq %rax, %r12
movq %rbx, %rdx
addq %rbx, %r15
jmp 0x2ac907
movq 0x70(%rsp), %rsi
cmpq 0x68(%rsp), %rsi
movq 0x48(%rsp), %r14
je 0x2ac9ea
incq %rsi
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2abbb7
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2abf38
movq %rax, %r15
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rsi
movq %r15, %rcx
subq 0x60(%rsp), %rcx
movq %r12, %rdx
movq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x28b2c3
leaq 0xd52a6(%rip), %rsi     # 0x381c83
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x17a50
leaq 0xb3afe(%rip), %rdi     # 0x3604ef
movq 0x20(%rsp), %rsi
callq 0x17870
movl 0xc(%rsp), %ebp
testb $0x8, 0x1c(%rsp)
je 0x2aca42
leaq 0xd529b(%rip), %rdi     # 0x381ca8
movq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x17870
movq 0x10(%rsp), %rax
movq 0x70(%rax), %rdi
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %rdx
subq %rdx, %rcx
addq $0x20, %r14
movq %rbx, %rsi
movq %r14, %r8
callq 0x2aea60
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18b50b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x385ac(%rip), %rsi     # 0x2e5013
leaq 0xd5046(%rip), %rdx     # 0x381ab4
leaq 0xd5054(%rip), %rcx     # 0x381ac9
leaq 0xd4304(%rip), %r8      # 0x380d80
movl $0x9ed, %r9d            # imm = 0x9ED
xorl %eax, %eax
callq 0x17a50
callq 0x17390
nop