// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/sfx-suffixer.c
// Function: gt_getencseqkmers_twobitencoding_slice
void gt_getencseqkmers_twobitencoding_slice(const GtEncseq *encseq,
                                         GtReadmode readmode,
                                         unsigned int kmersize,
                                         unsigned int upperkmersize,
                                         bool onlyfirst,
                                         void(*processkmercode)(void *,
                                                                bool,
                                                                GtUword,
                                                                GtCodetype),
                                         void *processkmercodeinfo,
                                         void(*processkmerspecial)(void *,
                                                                   unsigned int,
                                                                   unsigned int,
                                                                   GtUword),
                                         void *processkmerspecialinfo,
                                         GtUword slice_startpos,
                                         GtUword slice_endpos)
{
  GtUword laststart = slice_startpos,
          lastend = slice_endpos;
  gt_assert(laststart <= lastend);

  if (gt_encseq_has_specialranges(encseq))
  {
    GtSpecialrangeiterator *sri;
    GtRange range;

    if (GT_ISDIRREVERSE(readmode))
    {
      sri = gt_specialrangeiterator_new(encseq,false);
      while (gt_specialrangeiterator_next(sri,&range))
      {
        if (range.end <= lastend) {
          getencseqkmers_rangetwobitencoding(encseq,
                                             readmode,
                                             kmersize,
                                             upperkmersize,
                                             onlyfirst,
                                             processkmercode,
                                             processkmercodeinfo,
                                             processkmerspecial,
                                             processkmerspecialinfo,
                                             range.end,
                                             lastend);
          lastend = range.start;
        }
        if (laststart > range.start) {
          break;
        }
      }
    } else
    {
      sri = gt_specialrangeiterator_new(encseq,true);
      while (gt_specialrangeiterator_next(sri,&range))
      {
        if (range.start >= laststart) {
          getencseqkmers_rangetwobitencoding(encseq,
                                             readmode,
                                             kmersize,
                                             upperkmersize,
                                             onlyfirst,
                                             processkmercode,
                                             processkmercodeinfo,
                                             processkmerspecial,
                                             processkmerspecialinfo,
                                             laststart,
                                             range.start);
          laststart = range.end;
        }
        if (lastend < range.end) {
          break;
        }
      }
    }
    gt_assert(gt_encseq_total_length(encseq) >= laststart);
    gt_specialrangeiterator_delete(sri);
  }

  if (laststart <= slice_endpos && slice_startpos <= lastend) {
    GtUword startpos = GT_ISDIRREVERSE(readmode) ? slice_startpos : laststart;
    GtUword endpos = GT_ISDIRREVERSE(readmode) ? lastend : slice_endpos;

    getencseqkmers_rangetwobitencoding(encseq,
                                       readmode,
                                       kmersize,
                                       upperkmersize,
                                       onlyfirst,
                                       processkmercode,
                                       processkmercodeinfo,
                                       processkmerspecial,
                                       processkmerspecialinfo,
                                       startpos,
                                       endpos);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movl %edx, 0x8(%rsp)
movl %esi, (%rsp)
movq 0x80(%rsp), %r15
movq 0x78(%rsp), %r13
cmpq %r15, %r13
ja 0x1a945a
movl %r8d, %ebx
movq %rdi, %r12
callq 0x740a6
movzbl %bl, %ecx
movl %ecx, 0x4(%rsp)
movq %r15, %r14
testb %al, %al
je 0x1a93ef
movl (%rsp), %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x1a9350
movq %r12, %rdi
xorl %esi, %esi
callq 0x741f0
movq %rax, %rbx
leaq 0x18(%rsp), %rbp
movq %r15, %r14
movq 0x78(%rsp), %r13
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x7428b
testb %al, %al
je 0x1a93d6
movq 0x20(%rsp), %rax
cmpq %r14, %rax
jbe 0x1a9300
movq 0x18(%rsp), %rax
jmp 0x1a9346
subq $0x8, %rsp
movq %r12, %rdi
movl 0x8(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
pushq %r14
pushq %rax
pushq 0x88(%rsp)
pushq 0x88(%rsp)
pushq 0x88(%rsp)
callq 0x1a94c0
addq $0x30, %rsp
movq 0x18(%rsp), %rax
movq %rax, %r14
cmpq %r13, %rax
jae 0x1a92dc
jmp 0x1a93d6
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0x741f0
movq %rax, %rbx
leaq 0x18(%rsp), %rbp
movq 0x78(%rsp), %r13
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x7428b
testb %al, %al
je 0x1a93d3
movq 0x18(%rsp), %rax
cmpq %r13, %rax
jae 0x1a9388
movq 0x20(%rsp), %rax
jmp 0x1a93ce
subq $0x8, %rsp
movq %r12, %rdi
movl 0x8(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
pushq %rax
pushq %r13
pushq 0x88(%rsp)
pushq 0x88(%rsp)
pushq 0x88(%rsp)
callq 0x1a94c0
addq $0x30, %rsp
movq 0x20(%rsp), %rax
movq %rax, %r13
cmpq %r15, %rax
jbe 0x1a9368
movq %r15, %r14
movq %r12, %rdi
callq 0x7055e
cmpq %r13, %rax
jb 0x1a9488
movq %rbx, %rdi
callq 0x74a09
cmpq %r15, %r13
ja 0x1a944b
cmpq 0x78(%rsp), %r14
jb 0x1a944b
movl (%rsp), %esi
movl %esi, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
cmoveq 0x78(%rsp), %r13
cmoveq %r14, %r15
subq $0x8, %rsp
movq %r12, %rdi
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
movl 0xc(%rsp), %r8d
movq 0x18(%rsp), %r9
pushq %r15
pushq %r13
pushq 0x88(%rsp)
pushq 0x88(%rsp)
pushq 0x88(%rsp)
callq 0x1a94c0
addq $0x30, %rsp
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28eb07(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13bba8(%rip), %rsi    # 0x2e5013
leaq 0x1b1223(%rip), %rdx    # 0x35a695
leaq 0x1b1231(%rip), %rcx    # 0x35a6aa
leaq 0x1b11fc(%rip), %r8     # 0x35a67c
movl $0x3c5, %r9d            # imm = 0x3C5
jmp 0x1a94b4
movq 0x28ead9(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13bb7a(%rip), %rsi    # 0x2e5013
leaq 0x1b1231(%rip), %rdx    # 0x35a6d1
leaq 0x1b1203(%rip), %rcx    # 0x35a6aa
leaq 0x1b11ce(%rip), %r8     # 0x35a67c
movl $0x3fb, %r9d            # imm = 0x3FB
xorl %eax, %eax
callq 0x17a50
callq 0x17390