// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-contfinder.c
// Function: gt_contfinder_get_code
static inline GtContfinderKmercodeWithOverflow gt_contfinder_get_code(
    const GtTwobitencoding *twobitencoding, gt_contfinder_seqnum_t seqnum,
    const size_t depth, const gt_contfinder_seqnum_t firstrevcompl, size_t len,
    const size_t *seppos)
{
  GtContfinderKmercodeWithOverflow k;
  size_t remaining, seqstart;

  if (seqnum < firstrevcompl)
  {
    if (len != 0)
    {
      seqstart = seqnum * len;
    }
    else
    {
      gt_assert(seppos != NULL);
      seqstart = (seqnum > 0) ? seppos[seqnum - 1] + 1 : 0;
      len = seppos[seqnum] - seqstart + 1;
    }
    if (depth < len - 1)
    {
      k.code = gt_contfinder_code_at_position(twobitencoding, seqstart + depth);
      k.overflow = 0;
      remaining = len - 1 - depth;
      if (remaining < GT_CONTFINDER_KMERSIZE)
      {
        k.overflow = GT_CONTFINDER_KMERSIZE -
          (gt_contfinder_overflow_t)remaining;
        k.code &= (GT_CONTFINDER_KMERCODE_MAX - ((1 << (k.overflow << 1)) - 1));
      }
    }
    else
    {
      k.code = 0;
      k.overflow = GT_CONTFINDER_KMERSIZE;
    }
    return k;
  }
  else
  {
    size_t pos;
    if (len != 0)
    {
      pos = ((firstrevcompl << 1) - seqnum) * len - 1 - depth;
    }
    else
    {
      seqnum = (firstrevcompl << 1) - seqnum - 1;
      gt_assert(seppos != NULL);
      pos = seppos[seqnum] - depth;
      seqstart = (seqnum > 0) ? seppos[seqnum - 1] + 1 : 0;
      len = seppos[seqnum] - seqstart + 1;
    }
    if (depth < len - 1)
    {
      remaining = len - 1 - depth;
      pos -= (remaining > GT_CONTFINDER_KMERSIZE) ? GT_CONTFINDER_KMERSIZE :
        remaining;
      k.overflow = 0;
      k.code = GT_CONTFINDER_REVCOMPL(
          gt_contfinder_code_at_position(twobitencoding, pos));
      if (remaining < GT_CONTFINDER_KMERSIZE)
      {
        k.overflow = GT_CONTFINDER_KMERSIZE - remaining;
        k.code <<= (k.overflow << 1);
      }
    }
    else
    {
      k.code = 0;
      k.overflow = GT_CONTFINDER_KMERSIZE;
    }
    return k;
  }
}

// Assembly:
pushq %rbx
movq %r8, %rbx
cmpl %ecx, %esi
jae 0x1754fa
testq %rbx, %rbx
je 0x175515
movl %esi, %eax
imulq %rbx, %rax
decq %rbx
jmp 0x175559
addl %ecx, %ecx
testq %rbx, %rbx
je 0x17552e
subl %esi, %ecx
imulq %rbx, %rcx
movq %rdx, %rsi
notq %rsi
addq %rcx, %rsi
decq %rbx
jmp 0x175588
testq %r9, %r9
je 0x1755e8
testl %esi, %esi
je 0x17554e
leal -0x1(%rsi), %eax
movq (%r9,%rax,8), %rax
incq %rax
jmp 0x175550
testq %r9, %r9
je 0x175616
notl %esi
addl %esi, %ecx
movl %ecx, %eax
movq (%r9,%rax,8), %rsi
je 0x175580
decl %ecx
movq (%r9,%rcx,8), %rbx
notq %rbx
jmp 0x175582
xorl %eax, %eax
movl %esi, %ecx
movq (%r9,%rcx,8), %rbx
subq %rax, %rbx
subq %rdx, %rbx
jbe 0x1755d3
addq %rdx, %rax
movq %rax, %rsi
callq 0x175c26
cmpq $0x3, %rbx
ja 0x1755d9
movb $0x4, %dl
subb %bl, %dl
leal (%rdx,%rdx), %ecx
pushq $-0x1
popq %rsi
shll %cl, %esi
andb %sil, %al
jmp 0x1755db
xorl %ebx, %ebx
addq %rsi, %rbx
subq %rdx, %rsi
subq %rdx, %rbx
jbe 0x1755d3
cmpq $0x4, %rbx
pushq $0x4
popq %rax
cmovbq %rbx, %rax
subq %rax, %rsi
callq 0x175c26
movl %eax, %ecx
shrb $0x6, %cl
movl %eax, %edx
shlb $0x6, %dl
orb %cl, %dl
movl %eax, %ecx
shrb $0x2, %cl
andb $0xc, %cl
shlb $0x2, %al
andb $0x30, %al
orb %cl, %al
orb %dl, %al
notb %al
cmpq $0x3, %rbx
ja 0x1755d9
movb $0x4, %dl
subb %bl, %dl
leal (%rdx,%rdx), %ecx
movzbl %al, %eax
shll %cl, %eax
jmp 0x1755db
movb $0x4, %dl
xorl %eax, %eax
jmp 0x1755db
xorl %edx, %edx
movzbl %dl, %ecx
shll $0x8, %ecx
movzbl %al, %eax
orl %ecx, %eax
popq %rbx
retq
movq 0x2c2979(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16fa1a(%rip), %rsi    # 0x2e5013
leaq 0x1dd8f6(%rip), %rdx    # 0x352ef6
leaq 0x1d7dde(%rip), %rcx    # 0x34d3e5
leaq 0x1d7cc7(%rip), %r8     # 0x34d2d5
movl $0xc4, %r9d
jmp 0x175642
movq 0x2c294b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16f9ec(%rip), %rsi    # 0x2e5013
leaq 0x1dd8c8(%rip), %rdx    # 0x352ef6
leaq 0x1d7db0(%rip), %rcx    # 0x34d3e5
leaq 0x1d7c99(%rip), %r8     # 0x34d2d5
movl $0xe5, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390