// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/sfx-mappedstr.c
// Function: gt_kmercodeiterator_encseq_new
GtKmercodeiterator *gt_kmercodeiterator_encseq_new(
                                            const GtEncseq *encseq,
                                            GtReadmode readmode,
                                            unsigned int kmersize,
                                            GtUword startpos)
{
  GtKmercodeiterator *kmercodeiterator;
  unsigned int numofchars;
  GtUchar charcode;

  gt_assert(!GT_ISDIRREVERSE(readmode) || startpos == 0);
  kmercodeiterator = gt_malloc(sizeof (*kmercodeiterator));
  kmercodeiterator->totallength = gt_encseq_total_length(encseq);
  gt_assert(kmersize <= kmercodeiterator->totallength);
  kmercodeiterator->startpos = startpos;
  gt_assert(startpos < kmercodeiterator->totallength);
  kmercodeiterator->fb = NULL;
  kmercodeiterator->encseq = encseq;
  if (kmercodeiterator->totallength - startpos < (GtUword) kmersize)
  {
    kmercodeiterator->inputexhausted = true;
    kmercodeiterator->esr = NULL;
    kmercodeiterator->spwp = NULL;
  } else
  {
    kmercodeiterator->inputexhausted = false;
    kmercodeiterator->readmode = readmode;
    kmercodeiterator->esr = gt_encseq_create_reader_with_readmode(encseq,
                                                                  readmode,
                                                                  startpos);
    numofchars = gt_alphabet_num_of_chars(gt_encseq_alphabet(encseq));
    kmercodeiterator->spwp = gt_kmerstream_new(numofchars,kmersize);
    kmercodeiterator->hasprocessedfirst = false;
    for (kmercodeiterator->currentposition = startpos;
         kmercodeiterator->currentposition < startpos+(GtUword) kmersize;
         kmercodeiterator->currentposition++)
    {
      charcode = gt_encseq_reader_next_encoded_char(kmercodeiterator->esr);
      kmercodeiterator->spwp->windowwidth++;
      gt_kmerstream_updatespecialpositions(kmercodeiterator->spwp,charcode,
                                           false,0);
      kmercodeiterator->spwp->cyclicwindow[kmercodeiterator->
                                           spwp->windowwidth-1] = charcode;
    }
  }
  return kmercodeiterator;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movl %esi, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
setne %al
testq %rcx, %rcx
sete %cl
orb %al, %cl
je 0x19f325
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r15
leaq 0x1b93ae(%rip), %rsi    # 0x3585f3
pushq $0x58
popq %rdi
movl $0x1ee, %edx            # imm = 0x1EE
callq 0x93160
movq %rax, %rbx
movq %r15, %rdi
callq 0x7055e
movq %rax, (%rbx)
movl %ebp, %r13d
cmpq %r13, %rax
jb 0x19f353
movq %r14, 0x8(%rbx)
subq %r14, %rax
jbe 0x19f381
andq $0x0, 0x50(%rbx)
movq %r15, 0x20(%rbx)
cmpq %r13, %rax
jae 0x19f2a7
movb $0x1, 0x19(%rbx)
andq $0x0, 0x28(%rbx)
andq $0x0, 0x38(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
movb %al, 0x19(%rbx)
movl %r12d, 0x30(%rbx)
movq %r15, %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x72260
movq %rax, 0x28(%rbx)
movq %r15, %rdi
callq 0x754dd
movq %rax, %rdi
callq 0x56c8e
movl %eax, %edi
movl %ebp, %esi
callq 0x19f3b9
movq %rax, 0x38(%rbx)
xorl %eax, %eax
movb %al, 0x18(%rbx)
addq %r14, %r13
movq %r14, 0x10(%rbx)
cmpq %r13, %r14
jae 0x19f295
movq 0x28(%rbx), %rdi
callq 0x70f55
movq 0x38(%rbx), %rdi
incl 0x48(%rdi)
movzbl %al, %ebp
movl %ebp, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x19f0b3
movq 0x38(%rbx), %rax
movl 0x48(%rax), %ecx
decl %ecx
movb %bpl, 0x20(%rax,%rcx)
movq 0x10(%rbx), %r14
incq %r14
jmp 0x19f2e7
movq 0x298c3c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x145cdd(%rip), %rsi    # 0x2e5013
leaq 0x1b9270(%rip), %rdx    # 0x3585ad
leaq 0x1b92f2(%rip), %rcx    # 0x358636
leaq 0x1b92a8(%rip), %r8     # 0x3585f3
movl $0x1ed, %r9d            # imm = 0x1ED
jmp 0x19f3ad
movq 0x298c0e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x145caf(%rip), %rsi    # 0x2e5013
leaq 0x1b92ea(%rip), %rdx    # 0x358655
leaq 0x1b92c4(%rip), %rcx    # 0x358636
leaq 0x1b927a(%rip), %r8     # 0x3585f3
movl $0x1f0, %r9d            # imm = 0x1F0
jmp 0x19f3ad
movq 0x298be0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x145c81(%rip), %rsi    # 0x2e5013
leaq 0x1b9274(%rip), %rdx    # 0x35860d
leaq 0x1b9296(%rip), %rcx    # 0x358636
leaq 0x1b924c(%rip), %r8     # 0x3585f3
movl $0x1f2, %r9d            # imm = 0x1F2
xorl %eax, %eax
callq 0x17a50
callq 0x17390