// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movl %esi, 0x64(%rsp)
movq %rdx, 0x58(%rsp)
movl %ecx, 0x54(%rsp)
movq %r8, 0x48(%rsp)
movq %r9, 0x40(%rsp)
movl 0x64(%rsp), %eax
cmpl 0x54(%rsp), %eax
jae 0x27b855
cmpq $0x0, 0x48(%rsp)
je 0x27b72a
movl 0x64(%rsp), %eax
imulq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x27b7c0
jmp 0x27b72c
cmpq $0x0, 0x40(%rsp)
jne 0x27b76c
movq 0x3c0865(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x29a8ce(%rip), %rsi    # 0x516013
leaq 0x30a134(%rip), %rdx    # 0x585880
leaq 0x3043ff(%rip), %rcx    # 0x57fb52
leaq 0x3042e8(%rip), %r8     # 0x57fa42
movl $0xc4, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x27b76e
cmpl $0x0, 0x64(%rsp)
jbe 0x27b792
movq 0x40(%rsp), %rax
movl 0x64(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x27b79b
xorl %eax, %eax
movq %rax, 0x20(%rsp)
jmp 0x27b79b
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movl 0x64(%rsp), %ecx
movq (%rax,%rcx,8), %rax
subq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rax
movq 0x48(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x27b846
movq 0x68(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq 0x58(%rsp), %rsi
callq 0x27c430
movb %al, 0x76(%rsp)
movb $0x0, 0x77(%rsp)
movq 0x48(%rsp), %rax
subq $0x1, %rax
subq 0x58(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x4, 0x38(%rsp)
jae 0x27b844
movq 0x38(%rsp), %rax
movzbl %al, %eax
movl %eax, %ecx
movl $0x4, %eax
subq %rcx, %rax
movb %al, 0x77(%rsp)
movzbl 0x77(%rsp), %ecx
shll %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl $0xff, %ecx
subl %eax, %ecx
movzbl 0x76(%rsp), %eax
andl %ecx, %eax
movb %al, 0x76(%rsp)
jmp 0x27b850
movb $0x0, 0x76(%rsp)
movb $0x4, 0x77(%rsp)
jmp 0x27ba60
cmpq $0x0, 0x48(%rsp)
je 0x27b882
movl 0x54(%rsp), %eax
shll %eax
subl 0x64(%rsp), %eax
movl %eax, %eax
imulq 0x48(%rsp), %rax
subq $0x1, %rax
subq 0x58(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x27b93e
movl 0x54(%rsp), %eax
shll %eax
subl 0x64(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x64(%rsp)
cmpq $0x0, 0x40(%rsp)
jne 0x27b8d3
movq 0x3c06fe(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x29a767(%rip), %rsi    # 0x516013
leaq 0x309fcd(%rip), %rdx    # 0x585880
leaq 0x304298(%rip), %rcx    # 0x57fb52
leaq 0x304181(%rip), %r8     # 0x57fa42
movl $0xe5, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x27b8d5
movq 0x40(%rsp), %rax
movl 0x64(%rsp), %ecx
movq (%rax,%rcx,8), %rax
subq 0x58(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpl $0x0, 0x64(%rsp)
jbe 0x27b910
movq 0x40(%rsp), %rax
movl 0x64(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x27b919
xorl %eax, %eax
movq %rax, 0x18(%rsp)
jmp 0x27b919
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movl 0x64(%rsp), %ecx
movq (%rax,%rcx,8), %rax
subq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rax
movq 0x48(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x27ba54
movq 0x48(%rsp), %rax
subq $0x1, %rax
subq 0x58(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x4, 0x38(%rsp)
jbe 0x27b97c
movl $0x4, %eax
movq %rax, 0x10(%rsp)
jmp 0x27b986
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rcx
movq 0x28(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x28(%rsp)
movb $0x0, 0x77(%rsp)
movq 0x68(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x27c430
movzbl %al, %eax
andl $0xc0, %eax
sarl $0x6, %eax
movl %eax, 0x4(%rsp)
movq 0x68(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x27c430
movb %al, %cl
movl 0x4(%rsp), %eax
movzbl %cl, %ecx
andl $0x3, %ecx
shll $0x6, %ecx
orl %ecx, %eax
movl %eax, 0xc(%rsp)
movq 0x68(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x27c430
movzbl %al, %eax
andl $0x30, %eax
sarl $0x2, %eax
movl %eax, 0x8(%rsp)
movq 0x68(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x27c430
movl 0x8(%rsp), %ecx
movb %al, %dl
movl 0xc(%rsp), %eax
movzbl %dl, %edx
andl $0xc, %edx
shll $0x2, %edx
orl %edx, %ecx
orl %ecx, %eax
xorl $0xff, %eax
movb %al, 0x76(%rsp)
cmpq $0x4, 0x38(%rsp)
jae 0x27ba52
movl $0x4, %eax
subq 0x38(%rsp), %rax
movb %al, 0x77(%rsp)
movzbl 0x77(%rsp), %ecx
shll %ecx
movzbl 0x76(%rsp), %eax
shll %cl, %eax
movb %al, 0x76(%rsp)
jmp 0x27ba5e
movb $0x0, 0x76(%rsp)
movb $0x4, 0x77(%rsp)
jmp 0x27ba60
movw 0x76(%rsp), %ax
addq $0x78, %rsp
retq
nopw (%rax,%rax)