// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/lpeg-0.10.2/lpeg.c
// Function: checkrule
static void checkrule (lua_State *L, Instruction *op, int from, int to,
                       int postable, int rule) {
  int i;
  int lastopen = 0;  /* more recent OpenCall seen in the code */
  for (i = from; i < to; i += sizei(op + i)) {
    if (op[i].i.code == IPartialCommit && op[i].i.offset < 0) {  /* loop? */
      int start = dest(op, i);
      assert(op[start - 1].i.code == IChoice &&
             dest(op, start - 1) == target(op, i + 1));
      if (start <= lastopen) {  /* loop does contain an open call? */
        if (!verify(L, op, op + start, op + i, postable, rule)) /* check body */
          luaL_error(L, "possible infinite loop in %s", val2str(L, rule));
      }
    }
    else if (op[i].i.code == IOpenCall)
      lastopen = i;
  }
  assert(op[i - 1].i.code == IRet);
  verify(L, op, op + from, op + to - 1, postable, rule);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movl %ecx, 0x20(%rsp)
movl %r8d, 0x1c(%rsp)
movl %r9d, 0x18(%rsp)
movl $0x0, 0x10(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x20(%rsp), %eax
jge 0x35f617
movq 0x28(%rsp), %rax
movslq 0x14(%rsp), %rcx
movzbl (%rax,%rcx,8), %eax
cmpl $0xc, %eax
jne 0x35f5d5
movq 0x28(%rsp), %rax
movslq 0x14(%rsp), %rcx
movswl 0x2(%rax,%rcx,8), %eax
cmpl $0x0, %eax
jge 0x35f5d5
movl 0x14(%rsp), %eax
movq 0x28(%rsp), %rcx
movslq 0x14(%rsp), %rdx
movswl 0x2(%rcx,%rdx,8), %ecx
addl %ecx, %eax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rax
movl 0xc(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx,8), %eax
cmpl $0x7, %eax
jne 0x35f53c
movl 0xc(%rsp), %eax
subl $0x1, %eax
movq 0x28(%rsp), %rcx
movl 0xc(%rsp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movswl 0x2(%rcx,%rdx,8), %ecx
addl %ecx, %eax
movl %eax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movl 0x14(%rsp), %esi
addl $0x1, %esi
callq 0x35f770
movl %eax, %ecx
movl 0x8(%rsp), %eax
cmpl %ecx, %eax
jne 0x35f53c
jmp 0x35f55b
leaq 0x23d797(%rip), %rdi    # 0x59ccda
leaq 0x23d6b0(%rip), %rsi    # 0x59cbfa
movl $0x319, %edx            # imm = 0x319
leaq 0x23d7d0(%rip), %rcx    # 0x59cd26
callq 0x19490
movl 0xc(%rsp), %eax
cmpl 0x10(%rsp), %eax
jg 0x35f5d3
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x28(%rsp), %rdx
movslq 0xc(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq 0x28(%rsp), %rcx
movslq 0x14(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rcx
movl 0x1c(%rsp), %r8d
movl 0x18(%rsp), %r9d
callq 0x35faa0
cmpl $0x0, %eax
jne 0x35f5d1
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x30(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x35f2b0
movq (%rsp), %rdi
movq %rax, %rdx
leaq 0x23d79b(%rip), %rsi    # 0x59cd65
movb $0x0, %al
callq 0x33a320
jmp 0x35f5d3
jmp 0x35f5f2
movq 0x28(%rsp), %rax
movslq 0x14(%rsp), %rcx
movzbl (%rax,%rcx,8), %eax
cmpl $0xa, %eax
jne 0x35f5f0
movl 0x14(%rsp), %eax
movl %eax, 0x10(%rsp)
jmp 0x35f5f2
jmp 0x35f5f4
movq 0x28(%rsp), %rdi
movslq 0x14(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x35f7b0
addl 0x14(%rsp), %eax
movl %eax, 0x14(%rsp)
jmp 0x35f490
movq 0x28(%rsp), %rax
movl 0x14(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx,8), %eax
cmpl $0x5, %eax
jne 0x35f631
jmp 0x35f650
leaq 0x23d74a(%rip), %rdi    # 0x59cd82
leaq 0x23d5bb(%rip), %rsi    # 0x59cbfa
movl $0x322, %edx            # imm = 0x322
leaq 0x23d6db(%rip), %rcx    # 0x59cd26
callq 0x19490
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x28(%rsp), %rdx
movslq 0x24(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq 0x28(%rsp), %rcx
movslq 0x20(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rcx
addq $-0x8, %rcx
movl 0x1c(%rsp), %r8d
movl 0x18(%rsp), %r9d
callq 0x35faa0
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)