// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/lpeg-0.10.2/lpeg.c
// Function: star_l
static int star_l (lua_State *L) {
  int l1;
  int n = luaL_checkint(L, 2);
  Instruction *p1 = getpatt(L, 1, &l1);
  if (n >= 0) {
    CharsetTag st;
    Instruction *op;
    if (tocharset(p1, &st) == ISCHARSET)
      return repeatcharset(L, st.cs, l1, n);
    if (isheadfail(p1))
      op = repeatheadfail(L, l1, n);
    else
      op = repeats(L, p1, l1, n);
    optimizecaptures(op);
    optimizejumps(op);
  }
  else {
    if (isheadfail(p1))
      optionalheadfail(L, l1, -n);
    else
      optionals(L, l1, -n);
  }
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
pushq $0x2
popq %rsi
callq 0x1debd9
movq %rax, %r14
pushq $0x1
popq %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x1f10c5
movq %rax, %r12
testl %r14d, %r14d
js 0x1f0b20
leaq 0x4(%rsp), %rsi
movq %r12, %rdi
callq 0x1f1790
cmpl $0x1, %eax
jne 0x1f0b8a
movslq (%rsp), %rax
movslq %r14d, %rsi
imulq %rax, %rsi
addq $0x5, %rsi
movq %rbx, %rdi
callq 0x1f0978
movq %rax, %r15
pushq $0x1
popq %rbp
subl $0x1, %r14d
jb 0x1f0bf5
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x1f1e11
cltq
leaq (%r15,%rax,8), %r15
jmp 0x1f0b01
movq %r12, %rdi
callq 0x1f259e
movslq (%rsp), %r12
testl %eax, %eax
je 0x1f0c16
movl %r14d, %eax
negl %eax
imull %r12d, %eax
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x1f0978
movq %rax, %r15
movq %r12, %r13
negq %r13
movl %r12d, %ebp
imull %r14d, %ebp
negl %ebp
testl %r14d, %r14d
je 0x1f0d2f
movq %rbx, %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
callq 0x1f1e11
cltq
leaq (%r15,%rax,8), %r15
leaq (%r15,%r13,8), %rdi
movl %ebp, %esi
callq 0x1f25f7
subl %r12d, %ebp
incl %r14d
jmp 0x1f0b5a
movq %r12, %rdi
callq 0x1f259e
movslq (%rsp), %r13
movslq %r14d, %rsi
incq %rsi
imulq %r13, %rsi
testl %eax, %eax
je 0x1f0c81
incq %rsi
movq %rbx, %rdi
callq 0x1f0978
movq %rax, %r15
pushq $0x1
popq %rbp
movq %rax, %r12
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x1f1e11
cltq
leaq (%r12,%rax,8), %r12
subl $0x1, %r14d
jae 0x1f0bbc
movq %r13, %rax
shlq $0x3, %rax
movq %r12, %rdi
subq %rax, %rdi
leal 0x1(%r13), %esi
callq 0x1f25f7
movb $0x8, (%r12)
jmp 0x1f0d10
movl $0x3, (%r15)
xorl %eax, %eax
cmpq $0x20, %rax
je 0x1f0d2f
movb 0x8(%rsp,%rax), %cl
movb %cl, 0x8(%r15,%rax)
incq %rax
jmp 0x1f0bfe
notl %r12d
imull %r14d, %r12d
incl %r12d
movslq %r12d, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1f0978
movq %rax, %r15
movw $0x7, (%rax)
movw %r12w, 0x2(%rax)
pushq $0x1
popq %rbp
movq %rax, %r12
testl %r14d, %r14d
je 0x1f0c6c
leaq 0x8(%r12), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x1f1e11
cltq
leaq (%r12,%rax,8), %r12
addq $0x8, %r12
movl $0x1000c, (%r12)        # imm = 0x1000C
incl %r14d
jmp 0x1f0c41
movl $0x1000b, (%r12)        # imm = 0x1000B
movq %r15, %rdi
callq 0x1f2634
jmp 0x1f0d2f
addl $0x2, %esi
movslq %esi, %rsi
movq %rbx, %rdi
callq 0x1f0978
movq %rax, %r15
leaq (%r12,%r13,8), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1f2130
testl %eax, %eax
jne 0x1f0cbf
leaq 0x17920f(%rip), %rsi    # 0x369ec4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1de79c
pushq $0x1
popq %rbp
movq %r15, %r12
subl $0x1, %r14d
jb 0x1f0ce0
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x1f1e11
cltq
leaq (%r12,%rax,8), %r12
jmp 0x1f0cc5
leaq 0x8(%r12), %rsi
movw $0x7, (%r12)
leal 0x2(%r13), %eax
movw %ax, 0x2(%r12)
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x1f1e11
cltq
leaq (%r12,%rax,8), %r12
addq $0x8, %r12
movb $0xc, (%r12)
negl %r13d
movw %r13w, 0x2(%r12)
movb $0x0, 0x1(%r12)
movq %r15, %rdi
callq 0x1f2762
movq %r15, %rdi
callq 0x1f1f7f
pushq $0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq