// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/lpeg-0.10.2/lpeg.c
// Function: pushcapture
static int pushcapture (CapState *cs) {
  luaL_checkstack(cs->L, 4, "too many captures");
  switch (captype(cs->cap)) {
    case Cposition: {
      lua_pushinteger(cs->L, cs->cap->s - cs->s + 1);
      cs->cap++;
      return 1;
    }
    case Cconst: {
      pushluaval(cs);
      cs->cap++;
      return 1;
    }
    case Carg: {
      int arg = (cs->cap++)->idx;
      if (arg + FIXEDARGS > cs->ptop)
        return luaL_error(cs->L, "reference to absent argument #%d", arg);
      lua_pushvalue(cs->L, arg + FIXEDARGS);
      return 1;
    }
    case Csimple: {
      int k = pushallvalues(cs, 1);
      if (k > 1)
        lua_insert(cs->L, -k);  /* whole match is first result */
      return k;
    }
    case Cruntime: {
      int n = 0;
      while (!isclosecap(cs->cap++)) {
        luaL_checkstack(cs->L, 4, "too many captures");
        lua_pushvalue(cs->L, (cs->cap - 1)->idx);
        n++;
      }
      return n;
    }
    case Cstring: {
      luaL_Buffer b;
      luaL_buffinit(cs->L, &b);
      stringcap(&b, cs);
      luaL_pushresult(&b);
      return 1;
    }
    case Csubst: {
      luaL_Buffer b;
      luaL_buffinit(cs->L, &b);
      substcap(&b, cs);
      luaL_pushresult(&b);
      return 1;
    }
    case Cgroup: {
      if (cs->cap->idx == 0)  /* anonymous group? */
        return pushallvalues(cs, 0);  /* add all nested values */
      else {  /* named group: add no values */
        cs->cap = nextcap(cs->cap);  /* skip capture */
        return 0;
      }
    }
    case Cbackref: return backrefcap(cs);
    case Ctable: return tablecap(cs);
    case Cfunction: return functioncap(cs);
    case Cquery: return querycap(cs);
    case Cfold: return foldcap(cs);
    default: assert(0); return 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2028, %rsp           # imm = 0x2028
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
leaq 0x1750f5(%rip), %rdx    # 0x3690c6
pushq $0x4
popq %rsi
callq 0x1deabb
movq (%rbx), %r13
movzbl 0xa(%r13), %eax
leal -0x1(%rax), %ecx
cmpl $0xc, %ecx
ja 0x1f44b3
leaq 0x1759bc(%rip), %rdx    # 0x3699b0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x10(%rbx), %rdi
movq (%r13), %rsi
subq 0x20(%rbx), %rsi
incq %rsi
callq 0x1dbe48
jmp 0x1f4269
xorl %ebp, %ebp
leaq 0x1750a7(%rip), %r14    # 0x3690c6
pushq $0x4
popq %r15
addq $0x10, %r13
movq %r13, (%rbx)
testb %al, %al
je 0x1f434f
movq 0x10(%rbx), %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x1deabb
movq (%rbx), %rax
movq 0x10(%rbx), %rdi
movswl -0x8(%rax), %esi
callq 0x1db711
incl %ebp
movq (%rbx), %r13
movb 0xa(%r13), %al
jmp 0x1f4023
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1f3f2a
movl %eax, %ebp
cmpl $0x2, %eax
jl 0x1f434f
movq 0x10(%rbx), %rdi
movl %ebp, %esi
negl %esi
callq 0x1db4fe
jmp 0x1f434f
cmpw $0x0, 0x8(%r13)
je 0x1f441c
movq %r13, %rdi
callq 0x1f46a4
movq %rax, (%rbx)
jmp 0x1f424e
movq 0x10(%rbx), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x1defee
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f461c
jmp 0x1f4344
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %esi
addl $0x3, %esi
movswl 0x8(%r13), %edx
callq 0x1dc73a
movq 0x10(%rbx), %r15
pushq $-0x1
popq %rbp
pushq $-0x2
popq %r12
movq %r13, %r14
cmpq 0x8(%rbx), %r14
jne 0x1f4136
movq %r15, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x1dbb73
testq %rax, %rax
jne 0x1f4122
movq %r15, %rdi
movl %ebp, %esi
callq 0x1db731
movq %r15, %rdi
movl %eax, %esi
callq 0x1db74a
movq %r15, %rdi
leaq 0x176126(%rip), %rsi    # 0x36a23e
movq %rax, %rdx
xorl %eax, %eax
callq 0x1dc33c
movq %r15, %rdi
leaq 0x176119(%rip), %rsi    # 0x36a245
movq %rax, %rdx
xorl %eax, %eax
callq 0x1de79c
leaq -0x10(%r14), %rdi
cmpb $0x0, -0x6(%r14)
je 0x1f414d
cmpb $0x0, -0x5(%r14)
movq %rdi, %r14
jne 0x1f4155
jmp 0x1f40e3
callq 0x1f3eff
movq %rax, %r14
cmpb $0xd, 0xa(%r14)
jne 0x1f40e3
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %esi
addl $0x3, %esi
movswl 0x8(%r14), %edx
callq 0x1dc73a
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x1db8c6
testl %eax, %eax
jne 0x1f4191
movq %r15, %rdi
movl %r12d, %esi
callq 0x1db3d2
jmp 0x1f40e3
pushq $-0x3
popq %rsi
movq %r15, %rdi
callq 0x1db3d2
movq %r14, (%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1f3f2a
addq $0x10, %r13
movq %r13, (%rbx)
jmp 0x1f4351
leaq 0x10(%r13), %rax
movq %rax, (%rbx)
movswl 0x8(%r13), %edx
leal 0x3(%rdx), %esi
movq 0x10(%rbx), %rdi
cmpl 0x18(%rbx), %esi
jle 0x1f4412
leaq 0x175fdf(%rip), %rsi    # 0x36a1b7
xorl %eax, %eax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1de79c
movswl 0x8(%r13), %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1f3f2a
cmpl $0x2, %eax
jl 0x1f4211
movq 0x10(%rbx), %rdi
negl %eax
movl %eax, %esi
callq 0x1db3d2
cmpl %ebp, 0x28(%rbx)
je 0x1f4220
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1f46db
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %esi
incl %esi
callq 0x1dc524
movq 0x10(%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x1db731
testl %eax, %eax
jne 0x1f434c
movq 0x10(%rbx), %rdi
pushq $-0x2
popq %rsi
callq 0x1db3d2
xorl %ebp, %ebp
jmp 0x1f434f
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %esi
addl $0x3, %esi
movswl 0x8(%r13), %edx
callq 0x1dc73a
addq $0x10, (%rbx)
jmp 0x1f434c
movq 0x10(%rbx), %r14
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1dc7bd
movq (%rbx), %rax
leaq 0x10(%rax), %rcx
movq %rcx, (%rbx)
pushq $0x1
popq %rbp
cmpb $0x0, 0xb(%rax)
jne 0x1f434f
jmp 0x1f439e
movq 0x10(%rbx), %rdi
callq 0x1db3c5
movl %eax, %r14d
movq (%rbx), %rax
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %esi
addl $0x3, %esi
movswl 0x8(%rax), %edx
callq 0x1dc73a
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1f3f2a
movq 0x10(%rbx), %rdi
pushq $-0x1
popq %rdx
movl %eax, %esi
callq 0x1dce3a
movq 0x10(%rbx), %rdi
callq 0x1db3c5
movl %eax, %ebp
subl %r14d, %ebp
jmp 0x1f434f
movq 0x10(%rbx), %r14
movswl 0x8(%r13), %r15d
leaq 0x10(%r13), %rax
movq %rax, (%rbx)
cmpb $0x0, 0xb(%r13)
je 0x1f4437
leaq 0x175f56(%rip), %rsi    # 0x36a263
movq %r14, %rdi
xorl %eax, %eax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1de79c
movq 0x10(%rbx), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x1defee
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f44d2
movq %r14, %rdi
callq 0x1df075
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x1f3fb2
movl %eax, %r13d
notl %r13d
movl %eax, 0xc(%rsp)
movl %eax, %r12d
testl %r12d, %r12d
jle 0x1f4394
leal (%r15,%r12), %edx
movq %r14, %rdi
movl %r13d, %esi
callq 0x1dcc5f
decl %r12d
incl %r13d
jmp 0x1f4378
movl 0xc(%rsp), %eax
addl %r15d, %eax
movl %eax, %r15d
pushq $-0x2
popq %r12
movq (%rbx), %rax
movzbl 0xa(%rax), %ecx
cmpl $0xd, %ecx
jne 0x1f43fe
movswl 0x8(%rax), %edx
testl %edx, %edx
je 0x1f4363
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %esi
addl $0x3, %esi
callq 0x1dc73a
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1f3f2a
testl %eax, %eax
jne 0x1f43e0
movq %r14, %rdi
movl %r12d, %esi
callq 0x1db3d2
jmp 0x1f43a2
cmpl $0x2, %eax
jl 0x1f43f1
negl %eax
movq %r14, %rdi
movl %eax, %esi
callq 0x1db3d2
movq %r14, %rdi
pushq $-0x3
popq %rsi
callq 0x1dc936
jmp 0x1f43a2
testl %ecx, %ecx
jne 0x1f4363
addq $0x10, %rax
movq %rax, (%rbx)
jmp 0x1f434f
callq 0x1db711
jmp 0x1f434c
movq %rbx, %rdi
xorl %esi, %esi
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f3f2a
cmpb $0x0, 0x1a(%r13)
je 0x1f4306
movq %rbx, %rdi
callq 0x1f3fb2
testl %eax, %eax
je 0x1f4306
cmpl $0x2, %eax
jl 0x1f4463
negl %eax
movq %r14, %rdi
movl %eax, %esi
callq 0x1db3d2
pushq $-0x2
popq %r12
pushq $0x1
popq %rbp
movq (%rbx), %rax
cmpb $0x0, 0xa(%rax)
je 0x1f4406
cmpl %r15d, 0x28(%rbx)
je 0x1f4484
movq %rbx, %rdi
movl %r15d, %esi
callq 0x1f46db
movl 0x18(%rbx), %esi
incl %esi
movq %r14, %rdi
callq 0x1db711
movq %r14, %rdi
movl %r12d, %esi
callq 0x1db4fe
movq %rbx, %rdi
callq 0x1f3fb2
leal 0x1(%rax), %esi
movq %r14, %rdi
movl %ebp, %edx
callq 0x1dce3a
jmp 0x1f446a
leaq 0x11a83b(%rip), %rdi    # 0x30ecf5
leaq 0x175621(%rip), %rsi    # 0x369ae2
leaq 0x175d10(%rip), %rcx    # 0x36a1d8
movl $0x8b3, %edx            # imm = 0x8B3
callq 0x174b0