// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r15
callq 0xed62d
testq %rax, %rax
je 0x2010fa
movq %rax, %r14
movl %ebx, %r12d
andl $-0x2, %r12d
cmpl $0x2, %r12d
jne 0x201109
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe91b2
movq %rax, 0x20(%rsp)
jmp 0x201112
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x20(%rsp)
movq %r15, %rdi
callq 0xe7b9c
cmpl $0x7, %ebx
ja 0x201442
movq %rax, %r13
movl %ebx, %eax
leaq 0x1bb551(%rip), %rcx    # 0x3bc680
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x21, %ebp
jae 0x201483
movq %r15, %rdi
callq 0xe7b9c
movl %ebp, %ecx
subq %rcx, %rax
jb 0x201442
movq %rax, 0x38(%rsp)
movq %r15, %rdi
callq 0xed62d
movq %rax, %r13
cmpl $0x4, %r12d
jne 0x201294
movq %r15, %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x1ee606
movq %rax, %r12
jmp 0x201297
testq %r13, %r13
je 0x201442
xorl %r12d, %r12d
movq 0x20(%rsp), %rdi
callq 0xe8186
movzbl %al, %eax
addq %rax, %r12
decq %r13
jne 0x201190
jmp 0x201275
testq %r13, %r13
je 0x201442
xorl %r12d, %r12d
xorl %ebx, %ebx
xorl %r15d, %r15d
testl %ebx, %ebx
jle 0x2011c4
addl $-0x2, %ebx
jmp 0x2011d0
movq (%r14), %r15
addq $0x8, %r14
movl $0x3e, %ebx
movq %r15, %rbp
movl %ebx, %ecx
shrq %cl, %rbp
movq 0x20(%rsp), %rdi
callq 0xe8186
cmpb $-0x3, %al
ja 0x2011f3
movl %ebp, %ecx
andb $0x3, %cl
cmpb %al, %cl
jne 0x20145a
andl $0x3, %ebp
movzbl %al, %eax
addq %rax, %r12
addq %rbp, %r12
decq %r13
jne 0x2011bb
jmp 0x201275
leaq -0x1(%r13), %rcx
shrq $0x5, %rcx
addq $0x2, %rcx
cmpq $0x20, %r13
movl $0x2, %eax
cmovaeq %rcx, %rax
xorl %ecx, %ecx
xorl %r12d, %r12d
addq (%r14,%rcx,8), %r12
incq %rcx
cmpq %rcx, %rax
jne 0x201224
jmp 0x201275
xorl %ecx, %ecx
xorl %r12d, %r12d
testq %r13, %r13
je 0x201264
xorl %eax, %eax
testl %ecx, %ecx
jle 0x201247
addl $-0x2, %ecx
jmp 0x201253
movq (%r14), %rax
addq $0x8, %r14
movl $0x3e, %ecx
movq %rax, %rdx
shrq %cl, %rdx
andl $0x3, %edx
addq %rdx, %r12
decq %r13
jne 0x20123e
movq %r15, %rdi
callq 0xedeaa
cmpq %rax, %r12
jne 0x201488
testq %r12, %r12
je 0x201442
leaq 0x1bb49f(%rip), %rdi    # 0x3bc724
movq %r12, %rsi
xorl %eax, %eax
callq 0x17070
jmp 0x201442
xorl %r12d, %r12d
addl $-0x4, %ebx
leaq 0x1bb3ff(%rip), %rax    # 0x3bc6a0
movslq (%rax,%rbx,4), %rcx
addq %rax, %rcx
movq %r12, 0x40(%rsp)
jmpq *%rcx
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x38(%rsp), %r15
movq %r12, %rdi
callq 0x1ee7e3
testq %rax, %rax
je 0x20145f
addq 0x8(%rax), %rbx
incq %r14
cmpq %r15, %r14
jbe 0x2012b9
leaq 0x1bb486(%rip), %rdi    # 0x3bc763
movq %rbx, %rsi
xorl %eax, %eax
callq 0x17070
jmp 0x201438
leaq 0x1bb4d5(%rip), %r14    # 0x3bc7c8
leaq 0x199(%rip), %r12       # 0x201493
xorl %r13d, %r13d
movl %r13d, %edi
callq 0x1130f8
movq %r14, %rdi
movl %ebp, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x17070
movq %r15, %rdi
movl %r13d, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x1ee606
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movq %rax, (%rsp)
movq %r15, %rdi
movl %r13d, %esi
movl %ebp, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x1f73f9
movq %rbx, %rdi
callq 0x1eeaa9
incl %r13d
cmpl $0x4, %r13d
jne 0x2012fd
jmp 0x201438
movq %r15, %rdi
movl %ebp, %esi
callq 0x31f268
jmp 0x201438
leal (,%rbp,2), %ecx
movl $0x1, %eax
shll %cl, %eax
movl $0x40, %r15d
subl %ecx, %r15d
decq %rax
movq %rax, 0x48(%rsp)
movq %r13, %r12
addq $0x8, %r12
movq (%r13), %rax
movq %rax, 0x28(%rsp)
movl $0x20, %eax
subl %ebp, %eax
movq %rax, 0x50(%rsp)
addl %eax, %eax
movl %eax, 0x34(%rsp)
movl $0x2, %ebp
xorl %r13d, %r13d
xorl %r14d, %r14d
cmpl 0x50(%rsp), %r14d
jbe 0x2013d3
movq (%r12), %rax
movq 0x28(%rsp), %rbx
movl %ebp, %ecx
shldq %cl, %rax, %rbx
addl $0x2, %ebp
jmp 0x2013e2
movq 0x28(%rsp), %rbx
movl %r15d, %ecx
shrq %cl, %rbx
addl $-0x2, %r15d
cmpl $0x1e, %r14d
movq 0x40(%rsp), %rdi
ja 0x2013f2
incl %r14d
jmp 0x20140c
movq (%r12), %rax
movq %rax, 0x28(%rsp)
addq $0x8, %r12
xorl %r14d, %r14d
movl $0x2, %ebp
movl 0x34(%rsp), %r15d
testq %rdi, %rdi
je 0x201464
callq 0x1ee7e3
testq %rax, %rax
je 0x201469
cmpb $0x0, (%rax)
jne 0x20142e
andq 0x48(%rsp), %rbx
movq 0x8(%rax), %rdx
cmpq %rdx, %rbx
jne 0x20146e
incq %r13
cmpq 0x38(%rsp), %r13
jbe 0x2013b8
movq 0x40(%rsp), %rdi
callq 0x1eeaa9
movq 0x20(%rsp), %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9204
callq 0x7f662
callq 0x7f629
callq 0x7f5f0
callq 0x7f5b7
movq %r13, %rdi
movq %rbx, %rsi
callq 0x7f46e
movl $0x2, %edi
callq 0x17940
callq 0x7f57e
movq %r12, %rdi
movq %rax, %rsi
callq 0x7f69b