// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movq %r9, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
movl %edx, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x90(%rsp), %rbx
movq 0x88(%rsp), %r15
cmpq %rbx, %r15
ja 0x1f6e19
movl %r8d, %ebp
movq %rdi, %r13
callq 0xeacd6
movq %rbx, %r14
movq %r15, %r12
testb %al, %al
je 0x1f6db3
movl 0xc(%rsp), %eax
andl $-0x3, %eax
cmpl $0x1, %eax
movl %ebp, 0x34(%rsp)
movq %r13, %rdi
jne 0x1f6d08
xorl %esi, %esi
callq 0xeae2c
movq %rax, %r15
leaq 0x20(%rsp), %r12
movzbl %bpl, %ebp
movq %rbx, %r14
movq %r15, %rdi
movq %r12, %rsi
callq 0xeae9a
testb %al, %al
je 0x1f6cfb
movq 0x28(%rsp), %rax
cmpq %r14, %rax
jbe 0x1f6cad
movq 0x20(%rsp), %rax
jmp 0x1f6cf1
subq $0x8, %rsp
movq %r13, %rdi
movl 0x14(%rsp), %esi
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl %ebp, %r8d
movq 0x20(%rsp), %r9
pushq %r14
pushq %rax
pushq 0x98(%rsp)
pushq 0x98(%rsp)
pushq 0x98(%rsp)
callq 0x1f6e23
addq $0x30, %rsp
movq 0x20(%rsp), %rax
movq %rax, %r14
cmpq 0x88(%rsp), %rax
jae 0x1f6c8d
movq 0x88(%rsp), %r12
jmp 0x1f6d92
movl $0x1, %esi
callq 0xeae2c
movq %rax, %r15
leaq 0x20(%rsp), %r14
movzbl %bpl, %ebp
movq 0x88(%rsp), %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0xeae9a
testb %al, %al
je 0x1f6d8f
movq 0x20(%rsp), %rax
cmpq %r12, %rax
jae 0x1f6d46
movq 0x28(%rsp), %rax
jmp 0x1f6d8a
subq $0x8, %rsp
movq %r13, %rdi
movl 0x14(%rsp), %esi
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl %ebp, %r8d
movq 0x20(%rsp), %r9
pushq %rax
pushq %r12
pushq 0x98(%rsp)
pushq 0x98(%rsp)
pushq 0x98(%rsp)
callq 0x1f6e23
addq $0x30, %rsp
movq 0x28(%rsp), %rax
movq %rax, %r12
cmpq %rbx, %rax
jbe 0x1f6d26
movq %rbx, %r14
movq %r13, %rdi
callq 0xe7b9c
cmpq %r12, %rax
movl 0x34(%rsp), %ebp
jb 0x1f6e1e
movq %r15, %rdi
callq 0xeb455
movq 0x88(%rsp), %r15
cmpq %rbx, %r12
ja 0x1f6e0a
cmpq %r15, %r14
jb 0x1f6e0a
movl 0xc(%rsp), %esi
movl %esi, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
cmoveq %r15, %r12
cmoveq %r14, %rbx
subq $0x8, %rsp
movzbl %bpl, %r8d
movq %r13, %rdi
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
movq 0x20(%rsp), %r9
pushq %rbx
pushq %r12
pushq 0x98(%rsp)
pushq 0x98(%rsp)
pushq 0x98(%rsp)
callq 0x1f6e23
addq $0x30, %rsp
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x7c113
callq 0x7c0da