// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %r8, %r14
movq %rcx, 0x10(%rsp)
movl %edx, %r15d
movl %esi, %r13d
movq %rdi, %rbp
callq 0xec1d8
movl %r15d, %ebx
cmpq %rbx, %rax
jae 0x1f83ce
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, 0x20(%rsp)
movq %r14, 0x8(%rsp)
movq %rbp, %rdi
callq 0xf02da
movq %rax, %rdi
callq 0xd3713
movl %eax, %edi
movl %r15d, %esi
callq 0x1f7ef8
movq %rax, %r12
movl %r15d, %r14d
movq %rax, %r15
movq %rbp, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0xed76d
movq %rax, %r13
movl %r14d, 0x1c(%rsp)
testl %r14d, %r14d
je 0x1f8445
movq %rbx, %r14
movq %r13, %rdi
callq 0xec7be
incl 0x48(%r15)
movzbl %al, %ebp
movq %r15, %rdi
movl %ebp, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1f7c95
movl 0x48(%r15), %eax
decl %eax
movb %bpl, 0x20(%r15,%rax)
decq %r14
jne 0x1f8418
addq $0x70, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x1f802e
movq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq *0x10(%rsp)
movq %rbx, %rbp
movq 0x20(%rsp), %rax
cmpq %rbx, %rax
jbe 0x1f84ca
movq %rax, %rbp
negq %rbp
leaq 0x1(%rbx), %r14
movq %r13, %rdi
callq 0xec7be
movzbl %al, %esi
movq %r15, %rdi
callq 0x1f806f
movq %r12, %rdi
movq %r15, %rsi
callq 0x1f802e
movl 0x44(%r15), %eax
movq %r14, %rsi
subq %rax, %rsi
movq 0x8(%rsp), %rdi
movq %r12, %rdx
callq *0x10(%rsp)
leaq (%r14,%rbp), %rax
incq %rax
incq %r14
cmpq $0x1, %rax
jne 0x1f847c
movq 0x20(%rsp), %rbp
movq 0x8(%rsp), %r14
movq %r13, %rdi
callq 0xed7bf
cmpl $0x0, 0x1c(%rsp)
movq 0x10(%rsp), %r13
je 0x1f8514
incq %rbp
movq %r15, %rdi
movl $0xfe, %esi
callq 0x1f806f
movq %r12, %rdi
movq %r15, %rsi
callq 0x1f802e
movl 0x44(%r15), %eax
movq %rbp, %rsi
subq %rax, %rsi
movq %r14, %rdi
movq %r12, %rdx
callq *%r13
incq %rbp
decq %rbx
jne 0x1f84e1
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f7c40
nop