// File: /workspace/github_c_makefile_star2_O1/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
movl $0x2, %esi
callq 0x230f7b
movq %rax, %r14
movq %rsp, %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x246779
movq %rax, %r12
testl %r14d, %r14d
js 0x246177
leaq 0x4(%rsp), %rsi
movq %r12, %rdi
callq 0x246ec3
cmpl $0x1, %eax
jne 0x2461df
movslq (%rsp), %rax
movslq %r14d, %rsi
imulq %rax, %rsi
addq $0x5, %rsi
movq %rbx, %rdi
callq 0x245fcd
movq %rax, %r15
testl %r14d, %r14d
je 0x246157
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x2475f9
cltq
leaq (%r15,%rax,8), %r15
decl %r14d
jne 0x24613c
movl $0x3, (%r15)
xorl %eax, %eax
movb 0x8(%rsp,%rax), %cl
movb %cl, 0x8(%r15,%rax)
incq %rax
cmpq $0x20, %rax
jne 0x246160
jmp 0x24637b
movq %r12, %rdi
callq 0x247ec7
movslq (%rsp), %r12
testl %eax, %eax
je 0x246265
movl %r14d, %eax
negl %eax
imull %r12d, %eax
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x245fcd
movq %rax, %r15
movq %r12, %r13
negq %r13
movl %r12d, %ebp
imull %r14d, %ebp
negl %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x2475f9
cltq
leaq (%r15,%rax,8), %r15
leaq (%r15,%r13,8), %rdi
movl %ebp, %esi
callq 0x247f53
subl %r12d, %ebp
incl %r14d
jne 0x2461b1
jmp 0x24637b
movq %r12, %rdi
callq 0x247ec7
movslq (%rsp), %r13
movslq %r14d, %rsi
incq %rsi
imulq %r13, %rsi
testl %eax, %eax
je 0x2462cb
incq %rsi
movq %rbx, %rdi
callq 0x245fcd
movq %rax, %r15
movq %rax, %r12
testl %r14d, %r14d
je 0x246231
movq %r15, %r12
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x2475f9
cltq
leaq (%r12,%rax,8), %r12
decl %r14d
jne 0x246216
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x2475f9
cltq
leaq (%r12,%rax,8), %rbx
movq %r13, %rax
shlq $0x3, %rax
movq %rbx, %rdi
subq %rax, %rdi
leal 0x1(%r13), %esi
callq 0x247f53
movb $0x8, (%rbx)
jmp 0x24635f
notl %r12d
imull %r14d, %r12d
incl %r12d
movslq %r12d, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x245fcd
movq %rax, %r15
movw $0x7, (%rax)
movw %r12w, 0x2(%rax)
movq %rax, %r12
leaq 0x8(%r12), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x2475f9
cltq
leaq (%r12,%rax,8), %r12
addq $0x8, %r12
movl $0x1000c, (%r12)        # imm = 0x1000C
incl %r14d
jne 0x24628d
movl $0x1000b, (%r12)        # imm = 0x1000B
movq %r15, %rdi
callq 0x247f90
jmp 0x24637b
addl $0x2, %esi
movslq %esi, %rsi
movq %rbx, %rdi
callq 0x245fcd
movq %rax, %r15
leaq (%r12,%r13,8), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x247942
testl %eax, %eax
jne 0x246309
leaq 0x18cee5(%rip), %rsi    # 0x3d31e4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x230abd
movq %r15, %r12
testl %r14d, %r14d
je 0x24632f
movq %r15, %r12
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x2475f9
cltq
leaq (%r12,%rax,8), %r12
decl %r14d
jne 0x246314
leaq 0x8(%r12), %rsi
movw $0x7, (%r12)
leal 0x2(%r13), %eax
movw %ax, 0x2(%r12)
movq %rbx, %rdi
movl $0x1, %edx
callq 0x2475f9
cltq
leaq (%r12,%rax,8), %rbx
addq $0x8, %rbx
movb $0xc, (%rbx)
negl %r13d
movw %r13w, 0x2(%rbx)
movb $0x0, 0x1(%rbx)
movq %r15, %rdi
callq 0x2480f7
movq %r15, %rdi
callq 0x247746
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq