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

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

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

  Ph = (Ph << 1) | 1UL;
  outcol->Pv = (Mh << 1) | ~ (Xv | Ph);
  outcol->Mv = Ph & Xv;
  backmask = 1UL << incol->maxleqk;
  if (Eq & backmask || Mh & backmask)
  {
    outcol->maxleqk = incol->maxleqk + 1UL;
    outcol->lastdistvalue = incol->lastdistvalue;
  } else
  {
    if (Ph & backmask)
    {
      score = mti->maxdistance+1;
      outcol->maxleqk = UNDEFMAXLEQK;
      if (incol->maxleqk > 0)
      {
        for (idx = incol->maxleqk - 1, backmask >>= 1;
             /* Nothing */;
             backmask >>= 1)
        {
          if (outcol->Pv & backmask)
          {
            score--;
            if (score <= mti->maxdistance)
            {
              outcol->maxleqk = idx;
              outcol->lastdistvalue = score;
              break;
            }
          } else
          {
            if (outcol->Mv & backmask)
            {
              score++;
            }
          }
          if (idx > 0)
          {
            idx--;
          } else
          {
            break;
          }
        }
      }
    } else
    {
      outcol->maxleqk = incol->maxleqk;
      outcol->lastdistvalue = incol->lastdistvalue;
    }
  }
#ifdef SKDEBUG
  verifycolumnvalues(mti,outcol,currentdepth);
#endif
}

// Assembly:
subq $0x88, %rsp
movb %cl, %al
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movb %al, 0x6f(%rsp)
movq %r8, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x80(%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 0x4a2a91
movq 0x199540(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x735a9(%rip), %rsi     # 0x516013
leaq 0x11305d(%rip), %rdx    # 0x5b5ace
leaq 0x113075(%rip), %rcx    # 0x5b5aed
leaq 0x112fd0(%rip), %r8     # 0x5b5a4f
movl $0x118, %r9d            # imm = 0x118
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4a2a93
jmp 0x4a2a95
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
ja 0x4a2aed
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x4a2aed
movq 0x1994e4(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x7354d(%rip), %rsi     # 0x516013
leaq 0x113035(%rip), %rdx    # 0x5b5b02
leaq 0x113019(%rip), %rcx    # 0x5b5aed
leaq 0x112f74(%rip), %r8     # 0x5b5a4f
movl $0x119, %r9d            # imm = 0x119
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4a2aef
jmp 0x4a2af1
movzbl 0x6f(%rsp), %eax
cmpl $0xff, %eax
jne 0x4a2b35
movq 0x19949c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x73505(%rip), %rsi     # 0x516013
leaq 0x8cc7a(%rip), %rdx     # 0x52f78f
leaq 0x112fd1(%rip), %rcx    # 0x5b5aed
leaq 0x112f2c(%rip), %r8     # 0x5b5a4f
movl $0x11a, %r9d            # imm = 0x11A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4a2b37
movzbl 0x6f(%rsp), %eax
cmpl $0xfe, %eax
je 0x4a2b5a
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movzbl 0x6f(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0x10(%rsp), %rcx
orq 0x8(%rcx), %rax
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq 0x10(%rsp), %rcx
andq (%rcx), %rax
movq 0x10(%rsp), %rcx
addq (%rcx), %rax
movq 0x10(%rsp), %rcx
xorq (%rcx), %rax
orq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rsp), %rcx
movq 0x10(%rsp), %rdx
orq (%rdx), %rcx
xorq $-0x1, %rcx
orq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
andq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
shlq %rax
orq $0x1, %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rcx
shlq %rcx
movq 0x50(%rsp), %rax
orq 0x40(%rsp), %rax
xorq $-0x1, %rax
orq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rcx
andq 0x50(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, 0x30(%rsp)
movq 0x58(%rsp), %rax
andq 0x30(%rsp), %rax
cmpq $0x0, %rax
jne 0x4a2c43
movq 0x38(%rsp), %rax
andq 0x30(%rsp), %rax
cmpq $0x0, %rax
je 0x4a2c70
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x4a2da8
movq 0x40(%rsp), %rax
andq 0x30(%rsp), %rax
cmpq $0x0, %rax
je 0x4a2d82
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jbe 0x4a2d80
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
shrq %rax
movq %rax, 0x30(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
andq 0x30(%rsp), %rax
cmpq $0x0, %rax
je 0x4a2d2c
movq 0x20(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq 0x18(%rcx), %rax
ja 0x4a2d2a
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x4a2d7e
jmp 0x4a2d50
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
andq 0x30(%rsp), %rax
cmpq $0x0, %rax
je 0x4a2d4e
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x4a2d50
cmpq $0x0, 0x28(%rsp)
jbe 0x4a2d68
movq 0x28(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x4a2d6a
jmp 0x4a2d7e
jmp 0x4a2d6c
movq 0x30(%rsp), %rax
shrq %rax
movq %rax, 0x30(%rsp)
jmp 0x4a2cdb
jmp 0x4a2d80
jmp 0x4a2da6
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x4a2da8
addq $0x88, %rsp
retq