// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/lpeg-0.10.2/lpeg.c
// Function: pattbehind
static int pattbehind (lua_State *L) {
  int l1;
  CharsetTag st1;
  Instruction *p1 = getpatt(L, 1, &l1);
  int n = luaL_optint(L, 2, 1);
  luaL_argcheck(L, n <= MAXAUX, 2, "lookbehind delta too large");
  if (!nocalls(p1))
    luaL_error(L, "lookbehind pattern cannot contain non terminals");
  if (isfail(p1) || issucc(p1))
    lua_pushvalue(L, 1);  /* <fail == fail; <true == true */
  else if (n == 1 && tocharset(p1, &st1) == ISCHARSET) {
    Instruction *p = newpatt(L, 1 + l1);
    setinstaux(p, IBack, 0, 1); p++;
    copypatt(p, p1, l1);
  }
  else {  /* Choice L1; Back; p1; BackCommit L2; L1: fail; L2: */
    Instruction *p = newpatt(L, 2 + l1 + 2);
    setinst(p++, IChoice, 2 + l1 + 1);
    setinstaux(p++, IBack, 0, n);
    p += addpatt(L, p, 1);
    setinst(p++, IBackCommit, 2);
    setinst(p, IFail, 0);
  }
  return 1;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rdi
movl $0x1, %esi
leaq 0x4c(%rsp), %rdx
callq 0x35e4f0
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0x33aa70
movl %eax, 0x1c(%rsp)
movb $0x1, %al
cmpl $0xff, 0x1c(%rsp)
movb %al, 0x7(%rsp)
jle 0x361e3a
movq 0x50(%rsp), %rdi
movl $0x2, %esi
leaq 0x23b6e0(%rip), %rdx    # 0x59d50b
callq 0x33a1f0
cmpl $0x0, %eax
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
movq 0x20(%rsp), %rdi
callq 0x365530
cmpl $0x0, %eax
jne 0x361e60
movq 0x50(%rsp), %rdi
leaq 0x23b6cd(%rip), %rsi    # 0x59d526
movb $0x0, %al
callq 0x33a320
movq 0x20(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xf, %eax
je 0x361e7a
movq 0x20(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x6, %eax
jne 0x361e8e
movq 0x50(%rsp), %rdi
movl $0x1, %esi
callq 0x334560
jmp 0x361fc8
cmpl $0x1, 0x1c(%rsp)
jne 0x361f03
movq 0x20(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x35e840
cmpl $0x1, %eax
jne 0x361f03
movq 0x50(%rsp), %rdi
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x35db20
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0x4, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x35dbc0
movq 0x10(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movslq 0x4c(%rsp), %rdx
shlq $0x3, %rdx
callq 0x19610
jmp 0x361fc6
movq 0x50(%rsp), %rdi
movl 0x4c(%rsp), %eax
addl $0x2, %eax
addl $0x2, %eax
movslq %eax, %rsi
callq 0x35db20
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movl 0x4c(%rsp), %edx
addl $0x2, %edx
addl $0x1, %edx
movl $0x7, %esi
xorl %ecx, %ecx
callq 0x35dbc0
movq 0x8(%rsp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movl 0x1c(%rsp), %ecx
movl $0x4, %esi
xorl %edx, %edx
callq 0x35dbc0
movq 0x50(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl $0x1, %edx
callq 0x35f350
movl %eax, %ecx
movq 0x8(%rsp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movl $0xd, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x35dbc0
movq 0x8(%rsp), %rdi
movl $0xf, %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x35dbc0
jmp 0x361fc8
movl $0x1, %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)