// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/sfx-suffixer.c
// Function: getencseqkmers_rangetwobitencoding
static
void getencseqkmers_rangetwobitencoding(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 startpos,
                                        GtUword endpos)
{
  GtCodetype lastcode, newcode, realtotallength;
  const GtTwobitencoding *twobitencoding
          = gt_encseq_twobitencoding_export(encseq);
  const GtCodetype maskright = GT_MASKRIGHT(kmersize);
  bool mirrored = gt_encseq_is_mirrored(encseq);
  const GtUword totallength = gt_encseq_total_length(encseq);
  realtotallength = totallength;
  if (mirrored) {
    gt_assert((totallength & 1) == 1UL);
    realtotallength = ((totallength - 1) / 2);
  }

  if (mirrored && startpos >= realtotallength) {
    gt_readmode_invert(readmode);
    startpos = GT_REVERSEPOS(realtotallength, startpos - realtotallength - 2);
    if (endpos == totallength)
      endpos = 0;
    else
      endpos = GT_REVERSEPOS(realtotallength, endpos - realtotallength - 2);
    if (startpos > endpos) {
      GtUword tmp = startpos;
      startpos = endpos;
      endpos = tmp;
    }
    gt_assert(startpos <= endpos);
    gt_assert(endpos <= realtotallength);
  }
  if (endpos - startpos >= (GtUword) upperkmersize)
  {
    gt_assert(endpos > 0);
    lastcode = getencseqkmers_nospecialtwobitencoding(twobitencoding,
                                                      totallength,
                                                      maskright,
                                                      readmode,
                                                      kmersize,
                                                      upperkmersize,
                                                      processkmercode,
                                                      processkmercodeinfo,
                                                      onlyfirst,
                                                      startpos,
                                                      endpos);
    if (processkmerspecial != NULL)
    {
      if (GT_ISDIRCOMPLEMENT(readmode))
      {
        lastcode = gt_kmercode_complement(lastcode,maskright);
      }
      newcode = ((lastcode << 2) | 3UL) & maskright;
      processkmerspecial(processkmerspecialinfo,
                         kmersize-1,
                         (unsigned int) newcode,
                         GT_ISDIRREVERSE(readmode) ? (totallength - startpos)
                                                   : endpos);
    }
  } else
  {
    if (processkmerspecial != NULL && startpos < endpos)
    {
      unsigned int fillpos;

      gt_assert((GtUword) kmersize > endpos - startpos);
      fillpos = (unsigned int) (kmersize - (endpos - startpos));
      lastcode = gt_kmercode_at_position(twobitencoding,startpos,
                                         (unsigned int) (endpos - startpos));
      if (GT_ISDIRREVERSE(readmode) && (unsigned int) (endpos - startpos) > 1U)
      {
        lastcode = gt_kmercode_reverse(lastcode,
                                       (unsigned int) (endpos-startpos));
      }
      if (GT_ISDIRCOMPLEMENT(readmode))
      {
        lastcode = gt_kmercode_complement(lastcode,maskright);
      }
      newcode
        = ((lastcode << GT_MULT2(fillpos)) | ((1UL << GT_MULT2(fillpos)) - 1))
           & maskright;
      processkmerspecial(processkmerspecialinfo,
                         (unsigned int) (endpos - startpos),
                         (unsigned int) newcode,
                         GT_ISDIRREVERSE(readmode) ? (totallength - startpos)
                                                   : endpos);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, 0x10(%rsp)
movl %r8d, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movl %edx, %r13d
movl %esi, 0xc(%rsp)
movq %rdi, %rbx
movq 0xd0(%rsp), %r14
movq 0xc8(%rsp), %r15
movq 0xc0(%rsp), %r12
movq 0xb8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x50(%rsp)
callq 0xed62d
movq %rax, 0x18(%rsp)
leal (,%r13,2), %ecx
negb %cl
movq $-0x1, %rax
shrq %cl, %rax
movq %rax, 0x28(%rsp)
movq %rbx, %rdi
callq 0xf6567
movl %eax, %ebp
movq %rbx, %rdi
callq 0xe7b9c
testb %bpl, %bpl
movq %rax, 0x40(%rsp)
je 0x1f6f1d
testb $0x1, %al
je 0x1f73d6
leaq -0x1(%rax), %rsi
shrq %rsi
movq %rsi, %rcx
subq %r15, %rcx
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %r8
ja 0x1f6f27
addq %rsi, %rcx
incq %rcx
movq %rsi, %rdx
subq %r14, %rdx
xorl %r15d, %r15d
cmpq %r14, %rax
leaq 0x1(%rdx,%rsi), %rdx
cmovneq %rdx, %r15
cmpq %r15, %rcx
movq %r15, %r14
cmovaq %rcx, %r14
cmovbq %rcx, %r15
cmpq %rsi, %r14
ja 0x1f73f4
movl $0x3, %eax
subl 0xc(%rsp), %eax
movl %eax, 0xc(%rsp)
jmp 0x1f6f27
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %r8
movq %r14, %rbx
movq %r15, 0x20(%rsp)
subq %r15, %rbx
movl %r8d, %r15d
cmpq %r15, %rbx
jae 0x1f6f9a
cmpq $0x0, 0x48(%rsp)
je 0x1f73c2
cmpq 0x20(%rsp), %r14
jbe 0x1f73c2
movl %r13d, %eax
cmpq %rax, %rbx
jae 0x1f73ef
movq 0x20(%rsp), %rdi
movl %edi, %ecx
andl $0x1f, %ecx
shrq $0x5, %rdi
movl $0x20, %eax
subl %ebx, %eax
movl %eax, %esi
subl %ecx, %esi
jae 0x1f71a7
addl %ebx, %ecx
addl %ecx, %ecx
addb $-0x40, %cl
movq 0x18(%rsp), %rsi
movq (%rsi,%rdi,8), %rdx
movq 0x8(%rsi,%rdi,8), %rsi
shldq %cl, %rsi, %rdx
jmp 0x1f71b7
testq %r14, %r14
je 0x1f73db
cmpl $0x1, %r13d
jbe 0x1f73e0
movl %r13d, %ebp
movl 0xc(%rsp), %eax
orl $0x2, %eax
cmpl $0x3, %eax
movq %r14, 0x60(%rsp)
movq %r12, 0x68(%rsp)
movq %r13, 0x58(%rsp)
jne 0x1f7026
cmpq %r15, %r14
jb 0x1f73ea
movq %r14, %rbx
subq %rbp, %rbx
leaq -0x1(%rbx), %r12
shrq $0x5, %r12
xorl %r14d, %r14d
movq %rbx, %r15
subq $0x1, %r15
cmovaeq %r12, %r14
movl %ebx, %ecx
andl $0x1f, %ecx
movq %rbx, %rsi
shrq $0x5, %rsi
movl $0x20, %eax
subl %r13d, %eax
movl %eax, %edx
subl %ecx, %edx
jae 0x1f7065
addl %r13d, %ecx
addl %ecx, %ecx
addb $-0x40, %cl
movq 0x18(%rsp), %rdx
movq (%rdx,%rsi,8), %rdi
movq 0x8(%rdx,%rsi,8), %rdx
shldq %cl, %rdx, %rdi
jmp 0x1f7075
movq 0x20(%rsp), %rsi
movl %esi, %ecx
andl $0x1f, %ecx
shrq $0x5, %rsi
movl $0x20, %eax
subl %r13d, %eax
movl %eax, %edx
subl %ecx, %edx
jae 0x1f7236
addl %r13d, %ecx
addl %ecx, %ecx
addb $-0x40, %cl
movq 0x18(%rsp), %rdx
movq (%rdx,%rsi,8), %r13
movq 0x8(%rdx,%rsi,8), %rdx
shldq %cl, %rdx, %r13
jmp 0x1f7246
movq 0x18(%rsp), %rcx
movq (%rcx,%rsi,8), %rdi
addl %edx, %edx
movl %edx, %ecx
shrq %cl, %rdi
addl %eax, %eax
movl %eax, %ecx
shlq %cl, %rdi
shrq %cl, %rdi
movl %r13d, %esi
callq 0x1f968f
movq %rax, %r13
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0x1f70c2
movq 0x40(%rsp), %rdx
subq %rbp, %rdx
subq %rbx, %rdx
xorl %ecx, %ecx
cmpl $0x2, 0xc(%rsp)
cmovaeq 0x28(%rsp), %rcx
xorq %r13, %rcx
movq 0x50(%rsp), %rdi
movl $0x1, %esi
callq *0x10(%rsp)
movq 0x10(%rsp), %rdx
cmpb $0x0, 0x38(%rsp)
jne 0x1f7359
movq 0x30(%rsp), %rsi
subl 0x58(%rsp), %esi
movq 0x20(%rsp), %rax
leaq (%rax,%rsi), %rcx
movq %rcx, 0x30(%rsp)
cmpq %rcx, %rbx
jbe 0x1f7359
notl %r15d
addl %r15d, %r15d
andl $0x3e, %r15d
xorl %edi, %edi
cmpl $0x3, 0xc(%rsp)
movq 0x18(%rsp), %rcx
movq (%rcx,%r12,8), %rbp
cmoveq 0x28(%rsp), %rdi
movq %rdi, 0x38(%rsp)
addq %rsi, %rax
incq %rax
movq %rax, 0x70(%rsp)
movq 0x40(%rsp), %r12
subq 0x60(%rsp), %r12
incq %r12
movq %rbp, %rax
movl %r15d, %ecx
shrq %cl, %rax
andl $0x3, %eax
leaq (%rax,%r13,4), %r13
andq 0x28(%rsp), %r13
testq %rdx, %rdx
je 0x1f715f
movq %r13, %rcx
xorq 0x38(%rsp), %rcx
movq 0x50(%rsp), %rdi
xorl %esi, %esi
movq %r12, %rdx
callq *0x10(%rsp)
movq 0x10(%rsp), %rdx
cmpl $0x3d, %r15d
ja 0x1f716b
addl $0x2, %r15d
jmp 0x1f7195
cmpq %rbx, 0x70(%rsp)
je 0x1f717b
testq %r14, %r14
je 0x1f73d1
xorl %r15d, %r15d
testq %r14, %r14
je 0x1f7192
movq 0x18(%rsp), %rax
movq -0x8(%rax,%r14,8), %rbp
decq %r14
jmp 0x1f7195
xorl %r14d, %r14d
decq %rbx
incq %r12
cmpq 0x30(%rsp), %rbx
ja 0x1f712a
jmp 0x1f7359
movq 0x18(%rsp), %rcx
movq (%rcx,%rdi,8), %rdx
addl %esi, %esi
movl %esi, %ecx
shrq %cl, %rdx
addl %eax, %eax
movl %eax, %ecx
shlq %cl, %rdx
shrq %cl, %rdx
subl %ebx, %r13d
movl 0xc(%rsp), %ebp
andl $-0x3, %ebp
cmpl $0x1, %ebp
setne %al
cmpq $0x2, %rbx
setb %cl
orb %al, %cl
jne 0x1f71e9
movq %rdx, %rdi
movl %ebx, %esi
callq 0x1f968f
movq %rax, %rdx
movl 0xc(%rsp), %ecx
andl $-0x2, %ecx
xorl %eax, %eax
cmpl $0x2, %ecx
movq 0x28(%rsp), %rsi
cmovel %esi, %eax
xorl %eax, %edx
addl %r13d, %r13d
movl %r13d, %ecx
shlq %cl, %rdx
movq $-0x1, %rax
shlq %cl, %rax
notl %eax
orl %eax, %edx
andl %esi, %edx
movq 0x40(%rsp), %rax
subq 0x20(%rsp), %rax
cmpl $0x1, %ebp
cmoveq %rax, %r14
movq %r12, %rdi
movl %ebx, %esi
movq %r14, %rcx
jmp 0x1f73ad
movq 0x18(%rsp), %rcx
movq (%rcx,%rsi,8), %r13
addl %edx, %edx
movl %edx, %ecx
shrq %cl, %r13
addl %eax, %eax
movl %eax, %ecx
shlq %cl, %r13
shrq %cl, %r13
testq %rdi, %rdi
je 0x1f727d
xorl %ecx, %ecx
cmpl $0x2, 0xc(%rsp)
cmoveq 0x28(%rsp), %rcx
xorq %r13, %rcx
movq 0x50(%rsp), %rdi
movl $0x1, %esi
movq 0x20(%rsp), %rdx
callq *0x10(%rsp)
movq 0x10(%rsp), %rdi
cmpb $0x0, 0x38(%rsp)
jne 0x1f7359
subq %r15, %r14
movq 0x20(%rsp), %rax
cmpq %rax, %r14
jbe 0x1f7359
movq 0x40(%rsp), %rcx
decq %rcx
addq %rax, %rbp
shrq $0x5, %rcx
movq %rcx, 0x38(%rsp)
movq %rbp, %r12
shrq $0x5, %r12
notl %ebp
addl %ebp, %ebp
andl $0x3e, %ebp
movq 0x18(%rsp), %rcx
movq (%rcx,%r12,8), %r15
xorl %ecx, %ecx
cmpl $0x2, 0xc(%rsp)
cmoveq 0x28(%rsp), %rcx
movq %rcx, 0x30(%rsp)
leaq 0x1(%rax), %rbx
movq %r15, %rax
movl %ebp, %ecx
shrq %cl, %rax
andl $0x3, %eax
leaq (%rax,%r13,4), %r13
andq 0x28(%rsp), %r13
testq %rdi, %rdi
je 0x1f730e
movq %r13, %rcx
xorq 0x30(%rsp), %rcx
movq 0x50(%rsp), %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq *0x10(%rsp)
movq 0x10(%rsp), %rdi
testl %ebp, %ebp
je 0x1f7317
addl $-0x2, %ebp
jmp 0x1f734d
cmpq $0x20, 0x40(%rsp)
setae %cl
cmpq %r12, 0x38(%rsp)
seta %al
andb %cl, %al
cmpq %rbx, %r14
je 0x1f7337
testb %al, %al
je 0x1f73e5
movl $0x3e, %ebp
testb %al, %al
je 0x1f734d
movq 0x18(%rsp), %rax
movq 0x8(%rax,%r12,8), %r15
incq %r12
leaq 0x1(%rbx), %rax
cmpq %r14, %rbx
movq %rax, %rbx
jb 0x1f72da
cmpq $0x0, 0x48(%rsp)
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %rdi
je 0x1f73c2
movl 0xc(%rsp), %r8d
movl %r8d, %eax
andl $-0x2, %eax
xorl %edx, %edx
cmpl $0x2, %eax
movq 0x28(%rsp), %rax
cmovel %eax, %edx
xorl %edx, %r13d
leal 0x3(,%r13,4), %edx
andl %eax, %edx
movq 0x58(%rsp), %rsi
decl %esi
andl $-0x3, %r8d
movq 0x40(%rsp), %rax
subq 0x20(%rsp), %rax
cmpl $0x1, %r8d
cmoveq %rax, %rcx
movq 0x48(%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x7c1be
callq 0x7c2db
callq 0x7c269
callq 0x7c185
callq 0x7c230
callq 0x7c1f7
callq 0x7c2a2
callq 0x7c14c