// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/apmeoveridx.c
// Function: apme_inplacenextLimdfsstate
static void apme_inplacenextLimdfsstate(const Limdfsconstinfo *mt,
                                        DECLAREPTRDFSSTATE(aliascol),
                                        GT_UNUSED GtUword currentdepth,
                                        GtUchar currentchar)
{
  GtUword Eq = 0, Xv, Xh, Ph, Mh, /* as in Myers Paper */
                backmask,           /* only one bit is on */
                idx,                /* a counter */
                score;              /* current score */
  ApmeoveridxLimdfsstate *col = (ApmeoveridxLimdfsstate *) aliascol;
  const ApmeoveridxLimdfsconstinfo *mti =
                                        (const ApmeoveridxLimdfsconstinfo *) mt;

  gt_assert(col->maxleqk != UNDEFMAXLEQK);
  gt_assert(mti->maxintervalwidth > 0 || col->maxleqk != SUCCESSMAXLEQK);
  if (currentchar != (GtUchar) GT_WILDCARD)
  {
    Eq = mti->eqsvector[(GtUword) currentchar];
  }
  Xv = Eq | col->Mv;
  Xh = (((Eq & col->Pv) + col->Pv) ^ col->Pv) | Eq;

  Ph = col->Mv | ~ (Xh | col->Pv);
  Mh = col->Pv & Xh;

  Ph = (Ph << 1) | 1UL;
  col->Pv = (Mh << 1) | ~ (Xv | Ph);
  col->Mv = Ph & Xv;
  backmask = 1UL << col->maxleqk;
  if (Eq & backmask || Mh & backmask)
  {
    col->maxleqk++;
  } else
  {
    if (Ph & backmask)
    {
      GtUword tmpmaxleqk = UNDEFMAXLEQK;
      score = mti->maxdistance+1;
      if (col->maxleqk > 0)
      {
        for (idx = col->maxleqk - 1, backmask >>= 1;
             /* Nothing */;
             backmask >>= 1)
        {
          if (col->Pv & backmask)
          {
            score--;
            if (score <= mti->maxdistance)
            {
              tmpmaxleqk = idx;
              col->lastdistvalue = score;
              break;
            }
          } else
          {
            if (col->Mv & backmask)
            {
              score++;
            }
          }
          if (idx > 0)
          {
            idx--;
          } else
          {
            break;
          }
        }
      }
      col->maxleqk = tmpmaxleqk;
    }
  }
}

// Assembly:
subq $0x78, %rsp
movb %cl, %al
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movb %al, 0x5f(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x4a2e39
movq 0x199198(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x73201(%rip), %rsi     # 0x516013
leaq 0x112cb7(%rip), %rdx    # 0x5b5ad0
leaq 0x112d20(%rip), %rcx    # 0x5b5b40
leaq 0x112c28(%rip), %r8     # 0x5b5a4f
movl $0x16a, %r9d            # imm = 0x16A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4a2e3b
jmp 0x4a2e3d
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
ja 0x4a2e95
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x4a2e95
movq 0x19913c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x731a5(%rip), %rsi     # 0x516013
leaq 0x112ce7(%rip), %rdx    # 0x5b5b5c
leaq 0x112cc4(%rip), %rcx    # 0x5b5b40
leaq 0x112bcc(%rip), %r8     # 0x5b5a4f
movl $0x16b, %r9d            # imm = 0x16B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4a2e97
movzbl 0x5f(%rsp), %eax
cmpl $0xfe, %eax
je 0x4a2eba
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movzbl 0x5f(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x10(%rsp), %rcx
orq 0x8(%rcx), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq 0x10(%rsp), %rcx
andq (%rcx), %rax
movq 0x10(%rsp), %rcx
addq (%rcx), %rax
movq 0x10(%rsp), %rcx
xorq (%rcx), %rax
orq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x40(%rsp), %rcx
movq 0x10(%rsp), %rdx
orq (%rdx), %rcx
xorq $-0x1, %rcx
orq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
andq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rax
shlq %rax
orq $0x1, %rax
movq %rax, 0x38(%rsp)
movq 0x30(%rsp), %rcx
shlq %rcx
movq 0x48(%rsp), %rax
orq 0x38(%rsp), %rax
xorq $-0x1, %rax
orq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x38(%rsp), %rcx
andq 0x48(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %rax
andq 0x28(%rsp), %rax
cmpq $0x0, %rax
jne 0x4a2fa3
movq 0x30(%rsp), %rax
andq 0x28(%rsp), %rax
cmpq $0x0, %rax
je 0x4a2fb9
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
jmp 0x4a30ce
movq 0x38(%rsp), %rax
andq 0x28(%rsp), %rax
cmpq $0x0, %rax
je 0x4a30cc
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
addq $0x1, %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jbe 0x4a30bf
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
shrq %rax
movq %rax, 0x28(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
andq 0x28(%rsp), %rax
cmpq $0x0, %rax
je 0x4a306b
movq 0x18(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq 0x18(%rcx), %rax
ja 0x4a3069
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x4a30bd
jmp 0x4a308f
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
andq 0x28(%rsp), %rax
cmpq $0x0, %rax
je 0x4a308d
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x4a308f
cmpq $0x0, 0x20(%rsp)
jbe 0x4a30a7
movq 0x20(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x4a30a9
jmp 0x4a30bd
jmp 0x4a30ab
movq 0x28(%rsp), %rax
shrq %rax
movq %rax, 0x28(%rsp)
jmp 0x4a301f
jmp 0x4a30bf
movq (%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x4a30ce
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)