// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
cmpl $0x1, 0x1c(%rsp)
je 0x2ca8a4
cmpl $0x3, 0x1c(%rsp)
jne 0x2ca8e4
cmpq $0x0, 0x10(%rsp)
je 0x2ca8e4
movq 0x3716ed(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24b756(%rip), %rsi    # 0x516013
leaq 0x2c0821(%rip), %rdx    # 0x58b0e5
leaq 0x2c08a3(%rip), %rcx    # 0x58b16e
leaq 0x2c0859(%rip), %r8     # 0x58b12b
movl $0x1ed, %r9d            # imm = 0x1ED
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ca8e6
movl $0x58, %edi
leaq 0x2c0839(%rip), %rsi    # 0x58b12b
movl $0x1ee, %edx            # imm = 0x1EE
callq 0xe80f0
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0xa9d00
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movl 0x18(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpq (%rcx), %rax
jbe 0x2ca95c
movq 0x371675(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24b6de(%rip), %rsi    # 0x516013
leaq 0x2c0851(%rip), %rdx    # 0x58b18d
leaq 0x2c082b(%rip), %rcx    # 0x58b16e
leaq 0x2c07e1(%rip), %r8     # 0x58b12b
movl $0x1f0, %r9d            # imm = 0x1F0
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ca95e
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq (%rcx), %rax
jb 0x2ca9b3
movq 0x37161e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x24b687(%rip), %rsi    # 0x516013
leaq 0x2c07b2(%rip), %rdx    # 0x58b145
leaq 0x2c07d4(%rip), %rcx    # 0x58b16e
leaq 0x2c078a(%rip), %r8     # 0x58b12b
movl $0x1f2, %r9d            # imm = 0x1F2
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ca9b5
movq 0x8(%rsp), %rax
movq $0x0, 0x50(%rax)
movq 0x20(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
movq (%rax), %rax
subq 0x10(%rsp), %rax
movl 0x18(%rsp), %ecx
cmpq %rcx, %rax
jae 0x2caa0e
movq 0x8(%rsp), %rax
movb $0x1, 0x19(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x28(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x38(%rax)
jmp 0x2cab17
movq 0x8(%rsp), %rax
movb $0x0, 0x19(%rax)
movl 0x1c(%rsp), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x30(%rax)
movq 0x20(%rsp), %rdi
movl 0x1c(%rsp), %esi
movq 0x10(%rsp), %rdx
callq 0xac380
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x20(%rsp), %rdi
callq 0xb0f00
movq %rax, %rdi
callq 0x7e8c0
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %edi
movl 0x18(%rsp), %esi
callq 0x2cab30
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x8(%rsp), %rax
movb $0x0, 0x18(%rax)
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movl 0x18(%rsp), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x2cab15
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0xaae30
movb %al, 0x3(%rsp)
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x48(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x48(%rax)
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
xorl %ecx, %ecx
movzbl 0x3(%rsp), %esi
movl %ecx, %edx
callq 0x2ca640
movb 0x3(%rsp), %dl
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x38(%rcx), %rcx
movl 0x48(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movb %dl, 0x20(%rax,%rcx)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
jmp 0x2caa88
jmp 0x2cab17
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)