// File: /workspace/github_c_makefile_star2_O0/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 %r14
pushq %rbx
subq $0xd8, %rsp
movb %r8b, %al
movq 0x110(%rsp), %r8
movq 0x108(%rsp), %r8
movq 0x100(%rsp), %r8
movq 0xf8(%rsp), %r8
movq 0xf0(%rsp), %r8
movq %rdi, 0xd0(%rsp)
movl %esi, 0xcc(%rsp)
movl %edx, 0xc8(%rsp)
movl %ecx, 0xc4(%rsp)
andb $0x1, %al
movb %al, 0xc3(%rsp)
movq %r9, 0xb8(%rsp)
movq 0xd0(%rsp), %rdi
callq 0xb5250
movq %rax, 0x98(%rsp)
movl $0x20, %eax
subl 0xc8(%rsp), %eax
shll %eax
movl %eax, %eax
movl %eax, %ecx
movq $-0x1, %rax
shrq %cl, %rax
movq %rax, 0x90(%rsp)
movq 0xd0(%rsp), %rdi
callq 0xc2ec0
andb $0x1, %al
movb %al, 0x8f(%rsp)
movq 0xd0(%rsp), %rdi
callq 0xa9d00
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0xa0(%rsp)
testb $0x1, 0x8f(%rsp)
je 0x2de436
jmp 0x2de3d3
movq 0x80(%rsp), %rax
andq $0x1, %rax
cmpq $0x1, %rax
je 0x2de41d
movq 0x35dbb4(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x237c1d(%rip), %rsi    # 0x516013
leaq 0x2af44d(%rip), %rdx    # 0x58d84a
leaq 0x2af776(%rip), %rcx    # 0x58db7a
leaq 0x2aee29(%rip), %r8     # 0x58d234
movl $0x364, %r9d            # imm = 0x364
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2de41f
movq 0x80(%rsp), %rax
subq $0x1, %rax
shrq %rax
movq %rax, 0xa0(%rsp)
testb $0x1, 0x8f(%rsp)
je 0x2de5bd
movq 0x108(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jb 0x2de5bd
movl $0x3, %eax
subl 0xcc(%rsp), %eax
movl %eax, 0xcc(%rsp)
movq 0xa0(%rsp), %rax
subq $0x1, %rax
movq 0x108(%rsp), %rcx
subq 0xa0(%rsp), %rcx
subq $0x2, %rcx
subq %rcx, %rax
movq %rax, 0x108(%rsp)
movq 0x110(%rsp), %rax
cmpq 0x80(%rsp), %rax
jne 0x2de4b8
movq $0x0, 0x110(%rsp)
jmp 0x2de4e3
movq 0xa0(%rsp), %rax
subq $0x1, %rax
movq 0x110(%rsp), %rcx
subq 0xa0(%rsp), %rcx
subq $0x2, %rcx
subq %rcx, %rax
movq %rax, 0x110(%rsp)
movq 0x108(%rsp), %rax
cmpq 0x110(%rsp), %rax
jbe 0x2de51f
movq 0x108(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x108(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x2de521
movq 0x108(%rsp), %rax
cmpq 0x110(%rsp), %rax
jbe 0x2de56b
movq 0x35da66(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x237acf(%rip), %rsi    # 0x516013
leaq 0x2af318(%rip), %rdx    # 0x58d863
leaq 0x2af628(%rip), %rcx    # 0x58db7a
leaq 0x2aecdb(%rip), %r8     # 0x58d234
movl $0x374, %r9d            # imm = 0x374
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2de56d
jmp 0x2de56f
movq 0x110(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jbe 0x2de5b9
movq 0x35da18(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x237a81(%rip), %rsi    # 0x516013
leaq 0x2af2dd(%rip), %rdx    # 0x58d876
leaq 0x2af5da(%rip), %rcx    # 0x58db7a
leaq 0x2aec8d(%rip), %r8     # 0x58d234
movl $0x375, %r9d            # imm = 0x375
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2de5bb
jmp 0x2de5bd
movq 0x110(%rsp), %rax
subq 0x108(%rsp), %rax
movl 0xc4(%rsp), %ecx
cmpq %rcx, %rax
jb 0x2de792
jmp 0x2de5df
cmpq $0x0, 0x110(%rsp)
ja 0x2de622
movq 0x35d9af(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x237a18(%rip), %rsi    # 0x516013
leaq 0x2af28e(%rip), %rdx    # 0x58d890
leaq 0x2af571(%rip), %rcx    # 0x58db7a
leaq 0x2aec24(%rip), %r8     # 0x58d234
movl $0x379, %r9d            # imm = 0x379
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2de624
movq 0x98(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x90(%rsp), %rdx
movl 0xcc(%rsp), %ecx
movl 0xc8(%rsp), %r8d
movl 0xc4(%rsp), %r9d
movq 0xb8(%rsp), %r14
movq 0xf0(%rsp), %rbx
movb 0xc3(%rsp), %r11b
movq 0x108(%rsp), %r10
movq 0x110(%rsp), %rax
andb $0x1, %r11b
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movzbl %r11b, %r11d
movl %r11d, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x2e2bd0
movq %rax, 0xb0(%rsp)
cmpq $0x0, 0xf8(%rsp)
je 0x2de78d
cmpl $0x2, 0xcc(%rsp)
je 0x2de6cb
cmpl $0x3, 0xcc(%rsp)
jne 0x2de6e8
movq 0xb0(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x2e3400
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
shlq $0x2, %rax
orq $0x3, %rax
andq 0x90(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0x60(%rsp)
movl 0xc8(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x6c(%rsp)
movq 0xa8(%rsp), %rax
movl %eax, 0x70(%rsp)
cmpl $0x1, 0xcc(%rsp)
je 0x2de750
cmpl $0x3, 0xcc(%rsp)
jne 0x2de767
movq 0x80(%rsp), %rax
subq 0x108(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x2de774
movq 0x110(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rax
movl 0x70(%rsp), %edx
movl 0x6c(%rsp), %esi
movq 0x60(%rsp), %rdi
movq 0x50(%rsp), %rcx
callq *%rax
jmp 0x2de9a7
cmpq $0x0, 0xf8(%rsp)
je 0x2de9a5
movq 0x108(%rsp), %rax
cmpq 0x110(%rsp), %rax
jae 0x2de9a5
jmp 0x2de7b9
movl 0xc8(%rsp), %eax
movq 0x110(%rsp), %rcx
subq 0x108(%rsp), %rcx
cmpq %rcx, %rax
ja 0x2de80d
movq 0x35d7c4(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x23782d(%rip), %rsi    # 0x516013
leaq 0x2af0ae(%rip), %rdx    # 0x58d89b
leaq 0x2af386(%rip), %rcx    # 0x58db7a
leaq 0x2aea39(%rip), %r8     # 0x58d234
movl $0x398, %r9d            # imm = 0x398
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2de80f
movl 0xc8(%rsp), %eax
movq 0x110(%rsp), %rcx
subq 0x108(%rsp), %rcx
subq %rcx, %rax
movl %eax, 0x74(%rsp)
movq 0x98(%rsp), %rdi
movq 0x108(%rsp), %rsi
movq 0x110(%rsp), %rax
subq 0x108(%rsp), %rax
movl %eax, %edx
callq 0x2e3420
movq %rax, 0xb0(%rsp)
cmpl $0x1, 0xcc(%rsp)
je 0x2de870
cmpl $0x3, 0xcc(%rsp)
jne 0x2de8ac
movq 0x110(%rsp), %rax
subq 0x108(%rsp), %rax
cmpl $0x1, %eax
jbe 0x2de8ac
movq 0xb0(%rsp), %rdi
movq 0x110(%rsp), %rax
subq 0x108(%rsp), %rax
movl %eax, %esi
callq 0x2e3500
movq %rax, 0xb0(%rsp)
cmpl $0x2, 0xcc(%rsp)
je 0x2de8c0
cmpl $0x3, 0xcc(%rsp)
jne 0x2de8dd
movq 0xb0(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x2e3400
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movl 0x74(%rsp), %ecx
shll %ecx
movl %ecx, %ecx
shlq %cl, %rax
movl 0x74(%rsp), %ecx
shll %ecx
movl %ecx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
subq $0x1, %rcx
orq %rcx, %rax
andq 0x90(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x110(%rsp), %rax
subq 0x108(%rsp), %rax
movl %eax, 0x48(%rsp)
movq 0xa8(%rsp), %rax
movl %eax, 0x4c(%rsp)
cmpl $0x1, 0xcc(%rsp)
je 0x2de968
cmpl $0x3, 0xcc(%rsp)
jne 0x2de97f
movq 0x80(%rsp), %rax
subq 0x108(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x2de98c
movq 0x110(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rax
movl 0x4c(%rsp), %edx
movl 0x48(%rsp), %esi
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rcx
callq *%rax
jmp 0x2de9a7
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
nopw %cs:(%rax,%rax)