// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/sfx-mappedstr.c
// Function: getencseqkmers
void getencseqkmers(const GtEncseq *encseq,
                    GtReadmode readmode,
                    unsigned int kmersize,
                    void(*processkmercode)(void *,
                                           GtUword,
                                           const GtKmercode *),
                    void *processkmercodeinfo)
{
  GtUword currentposition = 0, totallength;
  GtKmerstream *spwp;
  GtUchar charcode;
  GtEncseqReader *esr;
  unsigned int numofchars, overshoot;

  totallength = gt_encseq_total_length(encseq);
  if (totallength < (GtUword) kmersize)
  {
    return;
  }
  numofchars = gt_alphabet_num_of_chars(gt_encseq_alphabet(encseq));
  spwp = gt_kmerstream_new(numofchars,kmersize);
  esr = gt_encseq_create_reader_with_readmode(encseq,readmode,0);
  for (currentposition = 0; currentposition < (GtUword) kmersize;
       currentposition++)
  {
    charcode = gt_encseq_reader_next_encoded_char(esr);
    spwp->windowwidth++;
    gt_kmerstream_updatespecialpositions(spwp,charcode,false,0);
    spwp->cyclicwindow[spwp->windowwidth-1] = charcode;
  }
  gt_kmerstream_newcode(&spwp->currentkmercode,spwp);
  processkmercode(processkmercodeinfo,0,&spwp->currentkmercode);
  for (currentposition = (GtUword) kmersize; currentposition<totallength;
       currentposition++)
  {
    charcode = gt_encseq_reader_next_encoded_char(esr);
    gt_kmerstream_shiftrightwithchar(spwp,charcode);
    gt_kmerstream_newcode(&spwp->currentkmercode,spwp);
    processkmercode(processkmercodeinfo,currentposition + 1 - spwp->kmersize,
                    &spwp->currentkmercode);
  }
  gt_encseq_reader_delete(esr);
  for (overshoot=0; overshoot<kmersize; overshoot++)
  {
    gt_kmerstream_shiftrightwithchar(spwp,(GtUchar) GT_WILDCARD);
    gt_kmerstream_newcode(&spwp->currentkmercode,spwp);
    processkmercode(processkmercodeinfo,
                    overshoot + currentposition + 1 - spwp->kmersize,
                    &spwp->currentkmercode);
  }
  gt_kmerstream_delete(spwp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movq %rcx, (%rsp)
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %r13
callq 0x7055e
movl %r12d, %ebx
movq %rax, 0x8(%rsp)
cmpq %rbx, %rax
jae 0x19f997
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x754dd
movq %rax, %rdi
callq 0x56c8e
movl %eax, %edi
movl %r12d, %esi
callq 0x19f3b9
movq %rax, %r12
movq %r13, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x72260
movq %rax, %rbp
movq %rbx, %r14
subq $0x1, %r14
jb 0x19f9fa
movq %rbp, %rdi
callq 0x70f55
incl 0x48(%r12)
movzbl %al, %r13d
movq %r12, %rdi
movl %r13d, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x19f0b3
movl 0x48(%r12), %eax
decl %eax
movb %r13b, 0x20(%r12,%rax)
jmp 0x19f9c6
movq %r12, %r13
addq $0x70, %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x19f557
movq %r15, 0x10(%rsp)
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq *(%rsp)
movq 0x8(%rsp), %r15
negq %r15
leaq 0x1(%rbx), %r14
leaq (%r15,%r14), %rax
cmpq $0x1, %rax
je 0x19fa6b
movq %rbp, %rdi
callq 0x70f55
movzbl %al, %esi
movq %r12, %rdi
callq 0x19f5c8
movq %r13, %rdi
movq %r12, %rsi
callq 0x19f557
movl 0x44(%r12), %eax
movq %r14, %rsi
subq %rax, %rsi
movq 0x10(%rsp), %rdi
movq %r13, %rdx
callq *(%rsp)
incq %r14
jmp 0x19fa28
movq %rbp, %rdi
callq 0x722ae
movq 0x8(%rsp), %r15
incq %r15
movq 0x10(%rsp), %r14
subq $0x1, %rbx
jb 0x19fab7
movq %r12, %rdi
movl $0xfe, %esi
callq 0x19f5c8
movq %r13, %rdi
movq %r12, %rsi
callq 0x19f557
movl 0x44(%r12), %eax
movq %r15, %rsi
subq %rax, %rsi
movq %r14, %rdi
movq %r13, %rdx
callq *(%rsp)
incq %r15
jmp 0x19fa80
movq %r12, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19f05e
nopl (%rax)