// File: /workspace/github_c_makefile_star2_O1/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 0xf1c71
testq %rax, %rax
je 0x20a952
movq %rax, %r14
movl %ebx, %r12d
andl $-0x2, %r12d
cmpl $0x2, %r12d
jne 0x20a961
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xed76d
movq %rax, 0x28(%rsp)
jmp 0x20a96a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x28(%rsp)
movq %r15, %rdi
callq 0xec1d8
cmpl $0x7, %ebx
ja 0x20acad
movq %rax, %r13
movl %ebx, %eax
leaq 0x1bb369(%rip), %rcx    # 0x3c5cf0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x21, %ebp
jae 0x20ad07
movq %r15, %rdi
callq 0xec1d8
movl %ebp, %ecx
subq %rcx, %rax
jb 0x20acad
movq %rax, %r14
movq %r15, %rdi
callq 0xf1c71
movq %rax, %r13
cmpl $0x4, %r12d
jne 0x20aade
movq %r15, %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x1f7dc2
movq %rax, 0x20(%rsp)
jmp 0x20aae7
testq %r13, %r13
je 0x20acad
xorl %r12d, %r12d
movq 0x28(%rsp), %rdi
callq 0xec7be
movzbl %al, %eax
addq %rax, %r12
decq %r13
jne 0x20a9e8
jmp 0x20acb0
xorl %ebx, %ebx
testq %r13, %r13
je 0x20acad
xorl %r12d, %r12d
xorl %r15d, %r15d
testl %ebx, %ebx
jle 0x20aa1c
addl $-0x2, %ebx
jmp 0x20aa28
movq (%r14), %r15
addq $0x8, %r14
movl $0x3e, %ebx
movq %r15, %rbp
movl %ebx, %ecx
shrq %cl, %rbp
movq 0x28(%rsp), %rdi
callq 0xec7be
cmpb $-0x3, %al
ja 0x20aa4b
movl %ebp, %ecx
andb $0x3, %cl
cmpb %al, %cl
jne 0x20acde
andl $0x3, %ebp
movzbl %al, %eax
addq %rax, %r12
addq %rbp, %r12
decq %r13
jne 0x20aa13
jmp 0x20acb0
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 0x20aa7f
jmp 0x20acb0
xorl %ecx, %ecx
xorl %r12d, %r12d
testq %r13, %r13
je 0x20aac2
xorl %eax, %eax
testl %ecx, %ecx
jle 0x20aaa5
addl $-0x2, %ecx
jmp 0x20aab1
movq (%r14), %rax
addq $0x8, %r14
movl $0x3e, %ecx
movq %rax, %rdx
shrq %cl, %rdx
andl $0x3, %edx
addq %rdx, %r12
decq %r13
jne 0x20aa9c
movq %r15, %rdi
callq 0xf24e6
cmpq %rax, %r12
je 0x20acb0
movq %r12, %rdi
movq %rax, %rsi
callq 0x814a5
movq $0x0, 0x20(%rsp)
movq %r14, %r12
addl $-0x4, %ebx
cmpl $0x3, %ebx
ja 0x20aca3
leaq 0x1bb213(%rip), %rax    # 0x3c5d10
movslq (%rax,%rbx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x1f7f9f
testq %rax, %rax
je 0x20ace3
addq 0x8(%rax), %rbx
incq %r14
cmpq %r12, %r14
jbe 0x20ab10
leaq 0x1bb29f(%rip), %rdi    # 0x3c5dd3
movq %rbx, %rsi
xorl %eax, %eax
callq 0x17070
jmp 0x20aca3
leaq 0x1bb2ee(%rip), %r14    # 0x3c5e38
leaq 0x1bb(%rip), %r12       # 0x20ad0c
xorl %r13d, %r13d
movl %r13d, %edi
callq 0x118794
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 0x1f7dc2
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 0x200bb0
movq %rbx, %rdi
callq 0x1f827b
incl %r13d
cmpl $0x4, %r13d
jne 0x20ab54
jmp 0x20aca3
movq %r15, %rdi
movl %ebp, %esi
callq 0x329500
jmp 0x20aca3
leal (,%rbp,2), %ecx
movl $0x1, %eax
shll %cl, %eax
movl $0x40, %r15d
subl %ecx, %r15d
decq %rax
movq %rax, 0x48(%rsp)
movq %r13, %rax
addq $0x8, %rax
movq %rax, 0x30(%rsp)
movq (%r13), %rax
movq %rax, 0x38(%rsp)
movl $0x20, %eax
subl %ebp, %eax
movq %rax, 0x50(%rsp)
addl %eax, %eax
movl %eax, 0x44(%rsp)
movl $0x2, %ebp
xorl %r13d, %r13d
xorl %r14d, %r14d
cmpl 0x50(%rsp), %r14d
jbe 0x20ac33
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x38(%rsp), %rbx
movl %ebp, %ecx
shldq %cl, %rax, %rbx
addl $0x2, %ebp
jmp 0x20ac42
movq 0x38(%rsp), %rbx
movl %r15d, %ecx
shrq %cl, %rbx
addl $-0x2, %r15d
cmpl $0x1e, %r14d
movq 0x20(%rsp), %rdi
ja 0x20ac52
incl %r14d
jmp 0x20ac75
movq 0x30(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x38(%rsp)
addq $0x8, %rax
movq %rax, 0x30(%rsp)
xorl %r14d, %r14d
movl $0x2, %ebp
movl 0x44(%rsp), %r15d
testq %rdi, %rdi
je 0x20ace8
callq 0x1f7f9f
testq %rax, %rax
je 0x20aced
cmpb $0x0, (%rax)
jne 0x20ac97
andq 0x48(%rsp), %rbx
movq 0x8(%rax), %rdx
cmpq %rdx, %rbx
jne 0x20acf2
incq %r13
cmpq %r12, %r13
jbe 0x20ac14
movq 0x20(%rsp), %rdi
callq 0x1f827b
xorl %r12d, %r12d
testq %r12, %r12
je 0x20acc6
leaq 0x1bb0d8(%rip), %rdi    # 0x3c5d94
movq %r12, %rsi
xorl %eax, %eax
callq 0x17070
movq 0x28(%rsp), %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xed7bf
callq 0x8146c
callq 0x81433
callq 0x813fa
callq 0x813c1
movq %r13, %rdi
movq %rbx, %rsi
callq 0x81278
movl $0x2, %edi
callq 0x17940
callq 0x81388