// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/lpeg-0.10.2/lpeg.c
// Function: verify
static int verify (lua_State *L, Instruction *op, const Instruction *p,
                   Instruction *e, int postable, int rule) {
  static const char dummy[] = "";
  Stack back[MAXBACKVER];
  int backtop = 0;  /* point to first empty slot in back */
  while (p != e) {
    switch ((Opcode)p->i.code) {
      case IRet: {
        p = back[--backtop].p;
        continue;
      }
      case IChoice: {
        if (backtop >= MAXBACKVER)
          return luaL_error(L, "too many pending calls/choices");
        back[backtop].p = dest(0, p);
        back[backtop++].s = dummy;
        p++;
        continue;
      }
      case ICall: {
        assert((p + 1)->i.code != IRet);  /* no tail call */
        if (backtop >= MAXBACKVER)
          return luaL_error(L, "too many pending calls/choices");
        back[backtop].s = NULL;
        back[backtop++].p = p + 1;
        goto dojmp;
      }
      case IOpenCall: {
        int i;
        if (postable == 0)  /* grammar still not fixed? */
          goto fail;  /* to be verified later */
        for (i = 0; i < backtop; i++) {
          if (back[i].s == NULL && back[i].p == p + 1)
            return luaL_error(L, "%s is left recursive", val2str(L, rule));
        }
        if (backtop >= MAXBACKVER)
          return luaL_error(L, "too many pending calls/choices");
        back[backtop].s = NULL;
        back[backtop++].p = p + 1;
        p = op + getposition(L, postable, p->i.offset);
        continue;
      }
      case IBackCommit:
      case ICommit: {
        assert(backtop > 0 && p->i.offset > 0);
        backtop--;
        goto dojmp;
      }
      case IPartialCommit: {
        assert(backtop > 0);
        if (p->i.offset > 0) goto dojmp;  /* forward jump */
        else {  /* loop will be detected when checking corresponding rule */
          assert(postable != 0);
          backtop--;
          p++;  /* just go on now */
          continue;
        }
      }
      case IBack: {
        if (p->i.aux == 1 && isfixcheck(p + 1)) {  /* char test? */
          p++;  /* skip back instruction */
          p += sizei(p);  /* skip char test */
        }
        else {  /* standard lookbehind code */
          assert((Opcode)(p - 1)->i.code == IChoice);  /* look behind */
          backtop--;
          p += (p - 1)->i.offset;
          assert((Opcode)(p - 1)->i.code == IFail);  /* look behind */
        }
        continue;
      }
      case IAny:
      case IChar:
      case ISet: {
        const Instruction *next = p + sizei(p);
        if ((Opcode)next->i.code == IBack)
          p = next + 1;  /* continue after the back instruction */
        else if (p->i.offset == 0) goto fail;
        else  /* jump */
          p += p->i.offset;
        continue;
      }
      case IJmp:
      dojmp: {
        p += p->i.offset;
        continue;
      }
      case IFailTwice:  /* 'not' predicate */
        goto fail;  /* body could have failed; try to backtrack it */
      case IFail: {
        if (p > op && (p - 1)->i.code == IBackCommit) {  /* 'and' predicate? */
          p++;  /* pretend it succeeded and go ahead */
          continue;
        }
        /* else failed: go through */
      }
      fail: { /* pattern failed: try to backtrack */
        do {
          if (backtop-- == 0)
            return 1;  /* no more backtracking */
        } while (back[backtop].s == NULL);
        p = back[backtop].p;
        continue;
      }
      case ISpan:
      case IOpenCapture: case ICloseCapture:
      case IEmptyCapture: case IEmptyCaptureIdx:
      case IFullCapture: {
        p += sizei(p);
        continue;
      }
      case ICloseRunTime: {
        goto fail;  /* be liberal in this case */
      }
      case IFunc: {
        const char *r = (p+1)->f(dummy, dummy, dummy, (p+2)->buff);
        if (r != NULL) { p += funcinstsize(p); }
        else condfailed(p);
        continue;
      }
      case IEnd:  /* cannot happen (should stop before it) */
      default: assert(0); return 0;
    }
  }
  assert(backtop == 0);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x12e8, %rsp           # imm = 0x12E8
movl %r9d, 0x14(%rsp)
movl %r8d, 0x4(%rsp)
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, 0x18(%rsp)
movq %rdi, 0x8(%rsp)
xorl %ebx, %ebx
leaq 0x17772c(%rip), %r13    # 0x369890
pushq $0x1
popq %r14
cmpq %r12, %rbp
je 0x1f23dd
movzbl (%rbp), %eax
cmpq $0x17, %rax
ja 0x1f24b4
movslq (%r13,%rax,4), %rax
addq %r13, %rax
movslq %ebx, %r15
jmpq *%rax
movq %rbp, %rdi
callq 0x1f1f5f
movl %eax, %eax
jmp 0x1f234a
movq %rbp, %rdi
callq 0x1f1f5f
movl %eax, %eax
cmpb $0x4, (%rbp,%rax,8)
jne 0x1f21d0
leaq (%rbp,%rax,8), %rbp
jmp 0x1f22d4
testl %ebx, %ebx
jle 0x1f2457
cmpw $0x0, 0x2(%rbp)
jle 0x1f2457
decl %ebx
jmp 0x1f2345
movswq 0x2(%rbp), %rax
testq %rax, %rax
jne 0x1f234a
jmp 0x1f23a6
cmpq 0x18(%rsp), %rbp
jbe 0x1f23a6
cmpb $0xd, -0x8(%rbp)
je 0x1f22d4
jmp 0x1f23a6
cmpb $0x1, 0x1(%rbp)
jne 0x1f221c
movzbl 0x8(%rbp), %eax
addq $-0x3, %rax
cmpq $0x15, %rax
jb 0x1f221c
cmpw $0x0, 0xa(%rbp)
je 0x1f23d4
cmpb $0x7, -0x8(%rbp)
jne 0x1f24d3
decl %ebx
movswq -0x6(%rbp), %rax
leaq (%rbp,%rax,8), %rbp
cmpb $0xf, -0x8(%rbp)
je 0x1f2168
jmp 0x1f24f2
testl %ebx, %ebx
jle 0x1f2476
cmpw $0x0, 0x2(%rbp)
jg 0x1f2345
cmpl $0x0, 0x4(%rsp)
je 0x1f2530
decl %ebx
jmp 0x1f22d4
decl %ebx
movslq %ebx, %rax
imulq $0x18, %rax, %rax
movq 0x28(%rsp,%rax), %rbp
jmp 0x1f2168
leaq 0x10(%rbp), %rcx
leaq 0x177763(%rip), %rdi    # 0x3699e4
movq %rdi, %rsi
movq %rdi, %rdx
callq *0x8(%rbp)
testq %rax, %rax
je 0x1f2393
movzbl 0x1(%rbp), %eax
leaq 0x10(%rbp,%rax,8), %rbp
jmp 0x1f2168
cmpl $0xc8, %ebx
jge 0x1f2433
movswq 0x2(%rbp), %rax
leaq (,%rax,8), %rax
addq %rbp, %rax
imulq $0x18, %r15, %rcx
movq %rax, 0x28(%rsp,%rcx)
incl %ebx
leaq 0x177715(%rip), %rax    # 0x3699e4
movq %rax, 0x20(%rsp,%rcx)
addq $0x8, %rbp
jmp 0x1f2168
cmpl $0x0, 0x4(%rsp)
je 0x1f23a6
leaq 0x8(%rbp), %rax
testl %ebx, %ebx
movl $0x0, %ecx
cmovgl %ebx, %ecx
imulq $0x18, %rcx, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x1f2354
cmpq $0x0, 0x20(%rsp,%rdx)
jne 0x1f2314
cmpq %rax, 0x28(%rsp,%rdx)
je 0x1f23fd
addq $0x18, %rdx
jmp 0x1f22fc
cmpb $0x5, 0x8(%rbp)
je 0x1f2495
cmpl $0xc8, %ebx
jge 0x1f2433
imulq $0x18, %r15, %rax
andq $0x0, 0x20(%rsp,%rax)
leaq 0x8(%rbp), %rcx
incl %ebx
movq %rcx, 0x28(%rsp,%rax)
movswq 0x2(%rbp), %rax
leaq (%rbp,%rax,8), %rbp
jmp 0x1f2168
cmpl $0xc8, %ebx
jge 0x1f2433
imulq $0x18, %r15, %rcx
andq $0x0, 0x20(%rsp,%rcx)
incl %ebx
movq %rax, 0x28(%rsp,%rcx)
movswl 0x2(%rbp), %edx
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x1f1eb5
cltq
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,8), %rbp
jmp 0x1f2168
movswq 0x2(%rbp), %rax
leaq (%rbp,%rax,8), %rbp
testq %rax, %rax
jne 0x1f2168
imulq $0x18, %r15, %rax
leaq 0x28(%rsp), %rcx
addq %rcx, %rax
xorl %ecx, %ecx
cmpq %rcx, %r15
je 0x1f23e8
incq %rcx
leaq -0x18(%rax), %rdx
cmpq $0x0, -0x20(%rax)
movq %rdx, %rax
je 0x1f23b4
subl %ecx, %ebx
movq (%rdx), %rbp
jmp 0x1f2168
addq $0x8, %rbp
jmp 0x1f218c
xorl %r14d, %r14d
testl %ebx, %ebx
jne 0x1f2511
movl %r14d, %eax
addq $0x12e8, %rsp           # imm = 0x12E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl 0x14(%rsp), %esi
callq 0x1f1dc6
leaq 0x1778fa(%rip), %rsi    # 0x369d0f
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
addq $0x12e8, %rsp           # imm = 0x12E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1de79c
leaq 0x177849(%rip), %rsi    # 0x369c83
movq 0x8(%rsp), %rdi
xorl %eax, %eax
addq $0x12e8, %rsp           # imm = 0x12E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1de79c
leaq 0x1778c6(%rip), %rdi    # 0x369d24
leaq 0x17767d(%rip), %rsi    # 0x369ae2
leaq 0x17784e(%rip), %rcx    # 0x369cba
movl $0x2bc, %edx            # imm = 0x2BC
callq 0x174b0
leaq 0x1778c6(%rip), %rdi    # 0x369d43
leaq 0x17765e(%rip), %rsi    # 0x369ae2
leaq 0x17782f(%rip), %rcx    # 0x369cba
movl $0x2c1, %edx            # imm = 0x2C1
callq 0x174b0
leaq 0x177806(%rip), %rdi    # 0x369ca2
leaq 0x17763f(%rip), %rsi    # 0x369ae2
leaq 0x177810(%rip), %rcx    # 0x369cba
movl $0x2a4, %edx            # imm = 0x2A4
callq 0x174b0
leaq 0x11c83a(%rip), %rdi    # 0x30ecf5
leaq 0x177620(%rip), %rsi    # 0x369ae2
leaq 0x1777f1(%rip), %rcx    # 0x369cba
movl $0x309, %edx            # imm = 0x309
callq 0x174b0
leaq 0x177883(%rip), %rdi    # 0x369d5d
leaq 0x177601(%rip), %rsi    # 0x369ae2
leaq 0x1777d2(%rip), %rcx    # 0x369cba
movl $0x2d0, %edx            # imm = 0x2D0
callq 0x174b0
leaq 0x177887(%rip), %rdi    # 0x369d80
leaq 0x1775e2(%rip), %rsi    # 0x369ae2
leaq 0x1777b3(%rip), %rcx    # 0x369cba
movl $0x2d3, %edx            # imm = 0x2D3
callq 0x174b0
leaq 0x177889(%rip), %rdi    # 0x369da1
leaq 0x1775c3(%rip), %rsi    # 0x369ae2
leaq 0x177794(%rip), %rcx    # 0x369cba
movl $0x30c, %edx            # imm = 0x30C
callq 0x174b0
leaq 0x177818(%rip), %rdi    # 0x369d4f
leaq 0x1775a4(%rip), %rsi    # 0x369ae2
leaq 0x177775(%rip), %rcx    # 0x369cba
movl $0x2c4, %edx            # imm = 0x2C4
callq 0x174b0