// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movl %esi, 0x4c(%rsp)
movl %edx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq %r8, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x50(%rsp), %rdi
callq 0xa9d00
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movl 0x48(%rsp), %ecx
cmpq %rcx, %rax
jae 0x2cb566
jmp 0x2cb743
movq 0x50(%rsp), %rdi
callq 0xb0f00
movq %rax, %rdi
callq 0x7e8c0
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %edi
movl 0x48(%rsp), %esi
callq 0x2cab30
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rdi
movl 0x4c(%rsp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xac380
movq %rax, 0x10(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
movl 0x48(%rsp), %ecx
cmpq %rcx, %rax
jae 0x2cb615
movq 0x10(%rsp), %rdi
callq 0xaae30
movb %al, 0x1f(%rsp)
movq 0x20(%rsp), %rax
movl 0x48(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x48(%rax)
movq 0x20(%rsp), %rdi
xorl %ecx, %ecx
movzbl 0x1f(%rsp), %esi
movl %ecx, %edx
callq 0x2ca640
movb 0x1f(%rsp), %dl
movq 0x20(%rsp), %rax
movq 0x20(%rsp), %rcx
movl 0x48(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movb %dl, 0x20(%rax,%rcx)
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x2cb5ae
movq 0x20(%rsp), %rdi
addq $0x70, %rdi
movq 0x20(%rsp), %rsi
callq 0x2cada0
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
addq $0x70, %rdx
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
movl 0x48(%rsp), %eax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x2cb6bf
movq 0x10(%rsp), %rdi
callq 0xaae30
movb %al, 0x1f(%rsp)
movq 0x20(%rsp), %rdi
movzbl 0x1f(%rsp), %esi
callq 0x2cae80
movq 0x20(%rsp), %rdi
addq $0x70, %rdi
movq 0x20(%rsp), %rsi
callq 0x2cada0
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq $0x1, %rsi
movq 0x20(%rsp), %rcx
movl 0x44(%rcx), %ecx
subq %rcx, %rsi
movq 0x20(%rsp), %rdx
addq $0x70, %rdx
callq *%rax
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x2cb64a
movq 0x10(%rsp), %rdi
callq 0xac3f0
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl 0x48(%rsp), %eax
jae 0x2cb739
movq 0x20(%rsp), %rdi
movl $0xfe, %esi
callq 0x2cae80
movq 0x20(%rsp), %rdi
addq $0x70, %rdi
movq 0x20(%rsp), %rsi
callq 0x2cada0
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %rdi
movl 0x8(%rsp), %ecx
movl %ecx, %esi
addq 0x30(%rsp), %rsi
addq $0x1, %rsi
movq 0x20(%rsp), %rcx
movl 0x44(%rcx), %ecx
subq %rcx, %rsi
movq 0x20(%rsp), %rdx
addq $0x70, %rdx
callq *%rax
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x2cb6d1
movq 0x20(%rsp), %rdi
callq 0x2ca5b0
addq $0x58, %rsp
retq
nopl (%rax,%rax)