// File: /workspace/github_c_makefile_star2_O2/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, %r14d
movq %rcx, 0x28(%rsp)
movl %edx, %r12d
movl %esi, 0xc(%rsp)
movq %rdi, %rbx
movq 0xd0(%rsp), %r15
movq 0xc8(%rsp), %r13
movq 0xc0(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x50(%rsp)
callq 0x776db
movq %rax, 0x38(%rsp)
movq %r12, 0x18(%rsp)
leal (%r12,%r12), %ecx
negb %cl
pushq $-0x1
popq %r12
movq %r12, %rax
shrq %cl, %rax
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
callq 0x81dea
movl %eax, %ebp
movq %rbx, %rdi
callq 0x7055e
testb %bpl, %bpl
movq %rax, 0x30(%rsp)
je 0x1a95b0
testb $0x1, %al
je 0x1a99ee
leaq -0x1(%rax), %rsi
shrq %rsi
movq %rsi, %rcx
subq %r13, %rcx
ja 0x1a95b0
addq %rsi, %rcx
incq %rcx
movq %rsi, %rdx
subq %r15, %rdx
xorl %r13d, %r13d
cmpq %r15, %rax
leaq 0x1(%rdx,%rsi), %rdx
cmovneq %rdx, %r13
cmpq %r13, %rcx
movq %r13, %r15
cmovaq %rcx, %r15
cmovbq %rcx, %r13
cmpq %rsi, %r15
ja 0x1a9ae0
pushq $0x3
popq %rax
subl 0xc(%rsp), %eax
movl %eax, 0xc(%rsp)
movq %r15, %rbx
movq %r13, 0x40(%rsp)
subq %r13, %rbx
movq %r15, %rax
movl 0x28(%rsp), %r13d
movl 0x18(%rsp), %r15d
cmpq %r13, %rbx
jae 0x1a967f
cmpq $0x0, 0x48(%rsp)
movq 0x40(%rsp), %r13
je 0x1a98c4
movq %rax, %r14
cmpq %r13, %rax
jbe 0x1a98c4
cmpq %r15, %rbx
jae 0x1a9ab2
movq 0x18(%rsp), %rax
subl %ebx, %eax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x1ac2aa
movl 0xc(%rsp), %ebp
andl $-0x3, %ebp
cmpl $0x1, %ebp
setne %cl
cmpq $0x2, %rbx
setb %dl
orb %cl, %dl
jne 0x1a9634
movq %rax, %rdi
movl %ebx, %esi
callq 0x1ac2f2
movl 0xc(%rsp), %edx
andl $-0x2, %edx
xorl %ecx, %ecx
cmpl $0x2, %edx
movq 0x20(%rsp), %rdx
cmovel %edx, %ecx
xorl %ecx, %eax
movq 0x18(%rsp), %rcx
addl %ecx, %ecx
shlq %cl, %rax
shlq %cl, %r12
notl %r12d
orl %r12d, %eax
andl %edx, %eax
movq 0x30(%rsp), %rcx
subq %r13, %rcx
cmpl $0x1, %ebp
cmoveq %rcx, %r14
movq 0x70(%rsp), %rdi
movl %ebx, %esi
movl %eax, %edx
movq %r14, %rcx
jmp 0x1a98af
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x1a9a1f
cmpl $0x1, 0x18(%rsp)
jbe 0x1a9a50
movl 0xc(%rsp), %eax
orl $0x2, %eax
cmpl $0x3, %eax
jne 0x1a980d
movq 0x60(%rsp), %rbx
cmpq %r13, %rbx
jb 0x1a9a81
movq 0x30(%rsp), %rbp
subq %r15, %rbp
subq %r15, %rbx
leaq -0x1(%rbx), %rax
shrq $0x5, %rax
xorl %r15d, %r15d
movq %rbx, %r13
subq $0x1, %r13
cmovaeq %rax, %r15
movq 0x38(%rsp), %rdi
movq %rbx, %rsi
movq 0x18(%rsp), %r12
movl %r12d, %edx
callq 0x1ac2aa
movq %rax, %rdi
movl %r12d, %esi
movq %rbp, %r12
callq 0x1ac2f2
movq %rax, %rbp
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0x1a972e
movq %r12, %rdx
subq %rbx, %rdx
xorl %ecx, %ecx
cmpl $0x2, 0xc(%rsp)
cmovaeq 0x20(%rsp), %rcx
xorq %rbp, %rcx
pushq $0x1
popq %rsi
movq 0x50(%rsp), %rdi
callq *0x10(%rsp)
movq 0x10(%rsp), %rdx
testb %r14b, %r14b
jne 0x1a985a
movq 0x28(%rsp), %r14
subl 0x18(%rsp), %r14d
addq 0x40(%rsp), %r14
notl %r13d
addl %r13d, %r13d
andl $0x3e, %r13d
xorl %eax, %eax
cmpl $0x3, 0xc(%rsp)
cmoveq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
incq %r12
movq %r12, 0x68(%rsp)
movq 0x38(%rsp), %rax
movq (%rax,%r15,8), %r12
movq %r15, 0x58(%rsp)
movl %r13d, %r15d
movq 0x68(%rsp), %r13
subq %rbx, %r13
decq %rbx
leaq 0x1(%rbx), %rax
cmpq %r14, %rax
jbe 0x1a985a
movq %r12, %rax
movl %r15d, %ecx
shrq %cl, %rax
andl $0x3, %eax
leaq (%rax,%rbp,4), %rbp
andq 0x20(%rsp), %rbp
testq %rdx, %rdx
je 0x1a97c8
movq %rbp, %rcx
xorq 0x28(%rsp), %rcx
movq 0x50(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
callq *0x10(%rsp)
movq 0x10(%rsp), %rdx
cmpl $0x3d, %r15d
ja 0x1a97da
addq $0x2, %r15
decq %rbx
incq %r13
jmp 0x1a9786
movq 0x58(%rsp), %rax
testq %rax, %rax
jne 0x1a97ed
cmpq %rbx, %r14
jne 0x1a9b0e
xorl %r15d, %r15d
movl $0x0, %r13d
testq %rax, %rax
je 0x1a9773
decq %rax
xorl %r13d, %r13d
movq %rax, %r15
jmp 0x1a976a
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rbx
movq %rbx, %rsi
movq 0x18(%rsp), %rdx
callq 0x1ac2aa
movq %rax, %rbp
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0x1a9855
xorl %ecx, %ecx
cmpl $0x2, 0xc(%rsp)
cmoveq 0x20(%rsp), %rcx
xorq %rbp, %rcx
pushq $0x1
popq %rsi
movq 0x50(%rsp), %rdi
movq %rbx, %rdx
callq *0x10(%rsp)
movq 0x10(%rsp), %rdx
testb %r14b, %r14b
je 0x1a98d3
cmpq $0x0, 0x48(%rsp)
movq 0x60(%rsp), %rcx
movq 0x40(%rsp), %rdi
je 0x1a98c4
movl 0xc(%rsp), %r8d
movl %r8d, %eax
andl $-0x2, %eax
xorl %edx, %edx
cmpl $0x2, %eax
movq 0x20(%rsp), %rax
cmovel %eax, %edx
xorl %edx, %ebp
leal 0x3(,%rbp,4), %edx
andl %eax, %edx
movq 0x18(%rsp), %rsi
decl %esi
andl $-0x3, %r8d
movq 0x30(%rsp), %rax
subq %rdi, %rax
cmpl $0x1, %r8d
cmoveq %rax, %rcx
movq 0x70(%rsp), %rdi
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
movq 0x30(%rsp), %rax
leaq -0x1(%rax), %rdi
movq 0x40(%rsp), %rbx
addq %rbx, %r15
shrq $0x5, %rdi
movq %r15, %rcx
shrq $0x5, %rcx
notl %r15d
addl %r15d, %r15d
andl $0x3e, %r15d
movq 0x60(%rsp), %r12
subq %r13, %r12
movq %rcx, %rsi
xorl %ecx, %ecx
cmpl $0x2, 0xc(%rsp)
cmoveq 0x20(%rsp), %rcx
movq %rcx, 0x68(%rsp)
cmpq $0x20, %rax
setae %al
movq 0x38(%rsp), %rcx
movq (%rcx,%rsi,8), %rcx
movq %rcx, 0x28(%rsp)
movq %rsi, 0x58(%rsp)
cmpq %rsi, %rdi
seta %r14b
andb %al, %r14b
incq %rbx
leaq -0x1(%rbx), %rax
cmpq %r12, %rax
jae 0x1a985a
movq 0x28(%rsp), %rax
movl %r15d, %ecx
shrq %cl, %rax
andl $0x3, %eax
leaq (%rax,%rbp,4), %rbp
andq 0x20(%rsp), %rbp
testq %rdx, %rdx
je 0x1a9987
movq %rbp, %rcx
xorq 0x68(%rsp), %rcx
movq %rdi, %r13
movq 0x50(%rsp), %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq *0x10(%rsp)
movq %r13, %rdi
movq 0x10(%rsp), %rdx
testl %r15d, %r15d
je 0x1a9992
addl $-0x2, %r15d
jmp 0x1a993a
cmpq %rbx, %r12
sete %al
orb %r14b, %al
je 0x1a99bd
pushq $0x3e
popq %rax
movl %eax, %r15d
testb %r14b, %r14b
je 0x1a993a
movq 0x58(%rsp), %rsi
incq %rsi
movl %eax, %r15d
movq 0x30(%rsp), %rax
jmp 0x1a9916
movq 0x28e5a4(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13b645(%rip), %rsi    # 0x2e5013
leaq 0x1b1366(%rip), %rdx    # 0x35ad3b
leaq 0x1b160e(%rip), %rcx    # 0x35afea
leaq 0x1b0c99(%rip), %r8     # 0x35a67c
movl $0x33d, %r9d            # imm = 0x33D
jmp 0x1a9b3a
movq 0x28e573(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13b614(%rip), %rsi    # 0x2e5013
leaq 0x1b128c(%rip), %rdx    # 0x35ac92
leaq 0x1b15a2(%rip), %rcx    # 0x35afaf
leaq 0x1b0c68(%rip), %r8     # 0x35a67c
movl $0x364, %r9d            # imm = 0x364
jmp 0x1a9b3a
movq 0x28e542(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13b5e3(%rip), %rsi    # 0x2e5013
leaq 0x1b128e(%rip), %rdx    # 0x35acc5
leaq 0x1b1571(%rip), %rcx    # 0x35afaf
leaq 0x1b0c37(%rip), %r8     # 0x35a67c
movl $0x379, %r9d            # imm = 0x379
jmp 0x1a9b3a
movq 0x28e511(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13b5b2(%rip), %rsi    # 0x2e5013
leaq 0x1b13f4(%rip), %rdx    # 0x35ae5c
leaq 0x1b157b(%rip), %rcx    # 0x35afea
leaq 0x1b0c06(%rip), %r8     # 0x35a67c
movl $0x2de, %r9d            # imm = 0x2DE
jmp 0x1a9b3a
movq 0x28e4e0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13b581(%rip), %rsi    # 0x2e5013
leaq 0x1b125e(%rip), %rdx    # 0x35acf7
leaq 0x1b154a(%rip), %rcx    # 0x35afea
leaq 0x1b0bd5(%rip), %r8     # 0x35a67c
movl $0x2e3, %r9d            # imm = 0x2E3
jmp 0x1a9b3a
movq 0x28e4af(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13b550(%rip), %rsi    # 0x2e5013
leaq 0x1b1206(%rip), %rdx    # 0x35acd0
leaq 0x1b14de(%rip), %rcx    # 0x35afaf
leaq 0x1b0ba4(%rip), %r8     # 0x35a67c
movl $0x398, %r9d            # imm = 0x398
jmp 0x1a9b3a
movq 0x28e481(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13b522(%rip), %rsi    # 0x2e5013
leaq 0x1b11b3(%rip), %rdx    # 0x35acab
leaq 0x1b14b0(%rip), %rcx    # 0x35afaf
leaq 0x1b0b76(%rip), %r8     # 0x35a67c
movl $0x375, %r9d            # imm = 0x375
jmp 0x1a9b3a
movq 0x28e453(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13b4f4(%rip), %rsi    # 0x2e5013
leaq 0x1b11f3(%rip), %rdx    # 0x35ad19
leaq 0x1b14bd(%rip), %rcx    # 0x35afea
leaq 0x1b0b48(%rip), %r8     # 0x35a67c
movl $0x30d, %r9d            # imm = 0x30D
xorl %eax, %eax
callq 0x17a50
callq 0x17390