// File: /workspace/github_c_makefile_star2_O2/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, %r13d
movl %esi, %ebx
movq %rdi, %r15
callq 0x776db
testq %rax, %rax
je 0x1b4e97
movq %rax, %r14
movl %ebx, %r12d
andl $-0x2, %r12d
cmpl $0x2, %r12d
jne 0x1b4ea6
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x72260
movq %rax, 0x20(%rsp)
jmp 0x1b4eaf
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x20(%rsp)
movq %r15, %rdi
callq 0x7055e
cmpl $0x7, %ebx
ja 0x1b51dd
movq %rax, %rbp
movl %ebx, %eax
leaq 0x1a7c08(%rip), %rcx    # 0x35cad4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x21, %r13d
jae 0x1b52b6
movq %r15, %rdi
callq 0x7055e
movq %rax, %rbp
movl %r13d, %eax
subq %rax, %rbp
jb 0x1b51dd
movq %r15, %rdi
callq 0x776db
movq %rax, %r14
cmpl $0x4, %r12d
jne 0x1b5023
movq %r15, %rdi
xorl %esi, %esi
movl %r13d, %edx
xorl %ecx, %ecx
callq 0x19f20f
movq %rax, %r12
jmp 0x1b5026
xorl %r12d, %r12d
subq $0x1, %rbp
jb 0x1b5004
movq 0x20(%rsp), %rdi
callq 0x70f55
movzbl %al, %eax
addq %rax, %r12
jmp 0x1b4f25
xorl %r13d, %r13d
xorl %ebx, %ebx
xorl %r12d, %r12d
subq $0x1, %rbp
jb 0x1b5004
testl %ebx, %ebx
jle 0x1b4f5c
addl $-0x2, %ebx
jmp 0x1b4f66
movq (%r14), %r13
addq $0x8, %r14
pushq $0x3e
popq %rbx
movq %r13, %r15
movl %ebx, %ecx
shrq %cl, %r15
movq 0x20(%rsp), %rdi
callq 0x70f55
cmpb $-0x3, %al
ja 0x1b4f8a
movl %r15d, %ecx
andb $0x3, %cl
cmpb %al, %cl
jne 0x1b51f5
andl $0x3, %r15d
movzbl %al, %eax
addq %rax, %r12
addq %r15, %r12
jmp 0x1b4f49
leaq -0x1(%rbp), %rcx
shrq $0x5, %rcx
addq $0x2, %rcx
cmpq $0x20, %rbp
pushq $0x2
popq %rax
cmovaeq %rcx, %rax
xorl %r12d, %r12d
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x1b5004
addq (%r14,%rcx,8), %r12
incq %rcx
jmp 0x1b4fb5
xorl %eax, %eax
pushq $0x3e
popq %rdx
xorl %ecx, %ecx
xorl %r12d, %r12d
subq $0x1, %rbp
jb 0x1b4ff3
testl %ecx, %ecx
jle 0x1b4fdc
addl $-0x2, %ecx
jmp 0x1b4fe5
movq (%r14), %rax
addq $0x8, %r14
movl %edx, %ecx
movq %rax, %rsi
shrq %cl, %rsi
andl $0x3, %esi
addq %rsi, %r12
jmp 0x1b4fcd
movq %r15, %rdi
callq 0x7812d
cmpq %rax, %r12
jne 0x1b52e4
testq %r12, %r12
je 0x1b51dd
leaq 0x1a7b64(%rip), %rdi    # 0x35cb78
movq %r12, %rsi
xorl %eax, %eax
callq 0x17070
jmp 0x1b51dd
xorl %r12d, %r12d
addl $-0x4, %ebx
leaq 0x1a7ac4(%rip), %rax    # 0x35caf4
movslq (%rax,%rbx,4), %rcx
addq %rax, %rcx
movq %r12, 0x38(%rsp)
jmpq *%rcx
xorl %r14d, %r14d
xorl %ebx, %ebx
cmpq %rbp, %r14
ja 0x1b51c2
movq %r12, %rdi
callq 0x19f495
testq %rax, %rax
je 0x1b5223
addq 0x8(%rax), %rbx
incq %r14
jmp 0x1b5043
leaq 0x1a7baf(%rip), %r14    # 0x35cc1c
leaq 0x37c(%rip), %r12       # 0x1b53f0
xorl %ebp, %ebp
cmpl $0x4, %ebp
je 0x1b51d3
movl %ebp, %edi
callq 0xa45c4
movq %r14, %rdi
movl %r13d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x17070
movq %r15, %rdi
movl %ebp, %esi
movl %r13d, %edx
xorl %ecx, %ecx
callq 0x19f20f
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movq %rax, (%rsp)
movq %r15, %rdi
movl %ebp, %esi
movl %r13d, %edx
movl %r13d, %ecx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x1a9b46
movq %rbx, %rdi
callq 0x19f83e
incl %ebp
jmp 0x1b5076
movq %r15, %rdi
movl %r13d, %esi
callq 0x2bfe70
jmp 0x1b51d3
movq %rbp, 0x50(%rsp)
leal (,%r13,2), %ecx
pushq $0x40
popq %rbp
pushq $0x1
popq %rax
shll %cl, %eax
subl %ecx, %ebp
decq %rax
movq %rax, 0x40(%rsp)
movq %r14, %r12
addq $0x8, %r12
movq (%r14), %rax
movq %rax, 0x28(%rsp)
pushq $0x20
popq %rax
subl %r13d, %eax
movq %rax, 0x48(%rsp)
addl %eax, %eax
movl %eax, 0x34(%rsp)
xorl %r14d, %r14d
pushq $0x2
popq %r13
xorl %r15d, %r15d
cmpq 0x50(%rsp), %r15
ja 0x1b51d3
cmpl 0x48(%rsp), %r14d
jbe 0x1b5157
movq (%r12), %rax
movq 0x28(%rsp), %rbx
movl %r13d, %ecx
shldq %cl, %rax, %rbx
addl $0x2, %r13d
jmp 0x1b5164
movq 0x28(%rsp), %rbx
movl %ebp, %ecx
shrq %cl, %rbx
addl $-0x2, %ebp
cmpl $0x1e, %r14d
movq 0x38(%rsp), %rdi
ja 0x1b5174
incl %r14d
jmp 0x1b518c
movq (%r12), %rax
movq %rax, 0x28(%rsp)
addq $0x8, %r12
xorl %r14d, %r14d
movl 0x34(%rsp), %ebp
pushq $0x2
popq %r13
testq %rdi, %rdi
je 0x1b5251
callq 0x19f495
testq %rax, %rax
je 0x1b526b
cmpb $0x0, (%rax)
jne 0x1b51ba
andq 0x40(%rsp), %rbx
movq 0x8(%rax), %rdx
cmpq %rdx, %rbx
jne 0x1b52a3
incq %r15
jmp 0x1b512f
leaq 0x1a79ee(%rip), %rdi    # 0x35cbb7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x17070
movq 0x38(%rsp), %rdi
callq 0x19f83e
movq 0x20(%rsp), %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x722ae
movq 0x282d6c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12fe0d(%rip), %rsi    # 0x2e5013
leaq 0x1a7919(%rip), %rdx    # 0x35cb26
leaq 0x1a7935(%rip), %rcx    # 0x35cb49
leaq 0x1a7943(%rip), %r8     # 0x35cb5e
movl $0x135, %r9d            # imm = 0x135
jmp 0x1b5297
movq 0x282d3e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12fddf(%rip), %rsi    # 0x2e5013
leaq 0x1a7968(%rip), %rdx    # 0x35cba3
leaq 0x1a7946(%rip), %rcx    # 0x35cb88
leaq 0x1a7915(%rip), %r8     # 0x35cb5e
movl $0xdd, %r9d
jmp 0x1b5297
movq 0x282d10(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12fdb1(%rip), %rsi    # 0x2e5013
leaq 0x1a795b(%rip), %rdx    # 0x35cbc4
jmp 0x1b5283
movq 0x282cf6(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12fd97(%rip), %rsi    # 0x2e5013
leaq 0x1a7920(%rip), %rdx    # 0x35cba3
leaq 0x1a78fe(%rip), %rcx    # 0x35cb88
leaq 0x1a78cd(%rip), %r8     # 0x35cb5e
movl $0xe8, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1b5304
pushq $0x2
popq %rdi
callq 0x178f0
movq 0x282cab(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12fd4c(%rip), %rsi    # 0x2e5013
leaq 0x190a1b(%rip), %rdx    # 0x345ce9
leaq 0x1a78b3(%rip), %rcx    # 0x35cb88
leaq 0x1a7882(%rip), %r8     # 0x35cb5e
movl $0xc6, %r9d
jmp 0x1b5297
movq 0x282c7d(%rip), %rcx    # 0x437f68
movq (%rcx), %rdi
leaq 0x1a780f(%rip), %rsi    # 0x35cb04
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x17a50
jmp 0x1b52ae