// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/twobits2kmers.c
// Function: gt_encseq_faststream
void gt_encseq_faststream(const GtEncseq *encseq,
                          Bitstreamreadmode bsrsmode,
                          unsigned int multiarg)
{
  const GtTwobitencoding *twobitencoding;

  twobitencoding = gt_encseq_twobitencoding_export(encseq);
  if (twobitencoding != NULL)
  {
    GtUword idx, totallength, pos;
    uint64_t pairbitsum = 0, pairbitsumBF;
    GtUchar cc, ccesr;
    GtEncseqReader *esr = NULL;
    Singlecharacterbitstreamstate scbs;

    scbs_init(&scbs,twobitencoding,0);
    if (bsrsmode == BSRS_reader_single ||
        bsrsmode == BSRS_stream_reader_single)
    {
      esr = gt_encseq_create_reader_with_readmode(encseq,
                                                  GT_READMODE_FORWARD,
                                                  0);
    }
    totallength = gt_encseq_total_length(encseq);
    switch (bsrsmode)
    {
      case BSRS_stream_words:
        for (idx = 0; idx < gt_unitsoftwobitencoding(totallength); idx++)
        {
          pairbitsum += twobitencoding[idx];
        }
        break;
      case BSRS_stream_single:
        for (pos = 0; pos < totallength; pos++)
        {
          cc = scbs_next(&scbs);
          pairbitsum += (uint64_t) cc;
        }
        pairbitsumBF = gt_encseq_pairbitsum(encseq);
        if (pairbitsum != pairbitsumBF)
        {
          fprintf(stderr,"pairbitsum=" Formatuint64_t "!=" Formatuint64_t
                         "=pairbitsumBF\n",
                         PRINTuint64_tcast(pairbitsum),
                         PRINTuint64_tcast(pairbitsumBF));
          exit(GT_EXIT_PROGRAMMING_ERROR);
        }
        break;
      case BSRS_reader_single:
        for (pos = 0; pos < totallength; pos++)
        {
          ccesr = gt_encseq_reader_next_encoded_char(esr);
          pairbitsum += (uint64_t) ccesr;
        }
        break;
      case BSRS_stream_reader_single:
        for (pos = 0; pos < totallength; pos++)
        {
          cc = scbs_next(&scbs);
          pairbitsum += (uint64_t) cc;
          ccesr = gt_encseq_reader_next_encoded_char(esr);
          pairbitsum += (uint64_t) ccesr;
          gt_assert(cc == ccesr || GT_ISSPECIAL(ccesr));
        }
        break;
      case BSRS_reader_multi:
      case BSRS_stream_reader_multi:
      case BSRS_stream_reader_multi3:
      case BSRS_hashfirstcodes:
        gt_encseq_faststream_kmers(encseq,bsrsmode,multiarg);
        break;
    }
    if (pairbitsum > 0)
    {
      printf("pairbitsum=" Formatuint64_t "\n",PRINTuint64_tcast(pairbitsum));
    }
    gt_encseq_reader_delete(esr);
  }
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movl %esi, 0x6c(%rsp)
movl %edx, 0x68(%rsp)
movq 0x70(%rsp), %rdi
callq 0xb5250
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
je 0x2f39d8
movq $0x0, 0x40(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x60(%rsp), %rsi
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x2f39e0
cmpl $0x2, 0x6c(%rsp)
je 0x2f376d
cmpl $0x3, 0x6c(%rsp)
jne 0x2f3782
movq 0x70(%rsp), %rdi
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xac380
movq %rax, 0x28(%rsp)
movq 0x70(%rsp), %rdi
callq 0xa9d00
movq %rax, 0x50(%rsp)
movl 0x6c(%rsp), %eax
movq %rax, 0x8(%rsp)
subq $0x7, %rax
ja 0x2f39b3
movq 0x8(%rsp), %rax
leaq 0x29bfb8(%rip), %rcx    # 0x58f768
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rdi
callq 0x2f3aa0
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jae 0x2f3809
movq 0x60(%rsp), %rax
movq 0x58(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x2f37c2
jmp 0x2f39b3
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
jae 0x2f3850
leaq 0x10(%rsp), %rdi
callq 0x2f3b00
movb %al, 0x37(%rsp)
movzbl 0x37(%rsp), %eax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x2f3817
movq 0x70(%rsp), %rdi
callq 0xb63d0
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
cmpq 0x38(%rsp), %rax
je 0x2f3897
movq 0x34872e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
leaq 0x29bf12(%rip), %rsi    # 0x58f798
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
jmp 0x2f39b3
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
jae 0x2f38de
movq 0x28(%rsp), %rdi
callq 0xaae30
movb %al, 0x36(%rsp)
movzbl 0x36(%rsp), %eax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x2f38a5
jmp 0x2f39b3
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
jae 0x2f399f
leaq 0x10(%rsp), %rdi
callq 0x2f3b00
movb %al, 0x37(%rsp)
movzbl 0x37(%rsp), %eax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x28(%rsp), %rdi
callq 0xaae30
movb %al, 0x36(%rsp)
movzbl 0x36(%rsp), %eax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movzbl 0x37(%rsp), %eax
movzbl 0x36(%rsp), %ecx
cmpl %ecx, %eax
je 0x2f3988
movzbl 0x36(%rsp), %eax
cmpl $0xfe, %eax
jge 0x2f3988
movq 0x348649(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2226b2(%rip), %rsi    # 0x516013
leaq 0x29be52(%rip), %rdx    # 0x58f7ba
leaq 0x29be6e(%rip), %rcx    # 0x58f7dd
leaq 0x29be7c(%rip), %r8     # 0x58f7f2
movl $0x135, %r9d            # imm = 0x135
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2f398a
jmp 0x2f398c
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x2f38ec
jmp 0x2f39b3
movq 0x70(%rsp), %rdi
movl 0x6c(%rsp), %esi
movl 0x68(%rsp), %edx
callq 0x2f3b70
cmpq $0x0, 0x40(%rsp)
jbe 0x2f39ce
movq 0x40(%rsp), %rsi
leaq 0x29be45(%rip), %rdi    # 0x58f80c
movb $0x0, %al
callq 0x19070
movq 0x28(%rsp), %rdi
callq 0xac3f0
addq $0x78, %rsp
retq
nopl (%rax)