// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/lpeg-0.10.2/lpeg.c
// Function: getpatt
static Instruction *getpatt (lua_State *L, int idx, int *size) {
  Instruction *p;
  switch (lua_type(L, idx)) {
    case LUA_TSTRING: {
      size_t i, len;
      const char *s = lua_tolstring(L, idx, &len);
      p = newpatt(L, len);
      for (i = 0; i < len; i++)
        setinstaux(p + i, IChar, 0, (byte)s[i]);
      lua_replace(L, idx);
      break;
    }
    case LUA_TNUMBER: {
      int n = lua_tointeger(L, idx);
      if (n == 0)  /* empty pattern? */
        p = newpatt(L, 0);
      else if (n > 0)
        p = any(L, n, 0, NULL);
      else if (-n <= UCHAR_MAX) {
        p = newpatt(L, 2);
        setinstaux(p, IAny, 2, -n);
        setinst(p + 1, IFail, 0);
      }
      else {
        int offset = 2;  /* space for ITestAny & IChoice */
        p = any(L, -n - UCHAR_MAX, 3, &offset);
        setinstaux(p, IAny, offset + 1, UCHAR_MAX);
        setinstaux(p + 1, IChoice, offset, UCHAR_MAX);
        setinst(p + offset, IFailTwice, 0);
      }
      lua_replace(L, idx);
      break;
    }
    case LUA_TBOOLEAN: {
      if (lua_toboolean(L, idx))  /* true? */
        p = newpatt(L, 0);  /* empty pattern (always succeeds) */
      else {
        p = newpatt(L, 1);
        setinst(p, IFail, 0);
      }
      lua_replace(L, idx);
      break;
    }
    case LUA_TTABLE: {
      p = fix_l(L, idx);
      break;
    }
    case LUA_TFUNCTION: {
      p = newpatt(L, 2);
      setinstcap(p, IOpenCapture, value2fenv(L, idx), Cruntime, 0);
      setinstcap(p + 1, ICloseRunTime, 0, Cclose, 0);
      lua_replace(L, idx);
      break;
    }
    default: {
      p = checkpattern(L, idx);
      break;
    }
  }
  if (size) *size = pattsize(L, idx);
  return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movl %esi, 0xc(%rsp)
callq 0x1db731
decl %eax
cmpl $0x5, %eax
ja 0x1f1124
leaq 0x178788(%rip), %rcx    # 0x369878
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %r14, 0x10(%rsp)
jmpq *%rax
movq %r14, %rdi
movl 0xc(%rsp), %esi
callq 0x1dbb4f
testl %eax, %eax
je 0x1f165f
movq %r14, %rdi
xorl %esi, %esi
callq 0x1f0978
movq %rax, %rbp
jmp 0x1f1673
leaq 0x178968(%rip), %rdx    # 0x369a93
movq %r14, %rdi
movl 0xc(%rsp), %esi
callq 0x1dea4f
movq %rax, %rbp
jmp 0x1f16a0
movq %rbx, %r12
leaq 0x68(%rsp), %r15
movq %r14, %rdi
movl 0xc(%rsp), %esi
movq %r15, %rdx
callq 0x1dbb73
movq %rax, %rbx
movq (%r15), %rsi
movq %r14, %rdi
callq 0x1f0978
movq %rax, %r15
xorl %r14d, %r14d
pushq $0x1
popq %rbp
movq %rax, %r13
cmpq 0x68(%rsp), %r14
jae 0x1f1191
movzbl (%rbx,%r14), %ecx
movq %r15, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x1f09e0
incq %r14
addq $0x8, %r15
jmp 0x1f1170
movq 0x10(%rsp), %r14
movq %r14, %rdi
movl 0xc(%rsp), %esi
callq 0x1db535
movq %r12, %rbx
movq %r13, %rbp
jmp 0x1f16a0
movq %r14, %r12
movq %rbx, %r14
movq %r12, %rdi
movl 0xc(%rsp), %esi
callq 0x1dbb20
movq %rax, %rbx
testl %ebx, %ebx
je 0x1f1681
jle 0x1f16cb
movq 0x10(%rsp), %r12
movq %r12, %rdi
movl %ebx, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1f1ca1
jmp 0x1f168b
movq %rbx, 0x50(%rsp)
movq %r14, %rdi
callq 0x1db3c5
movl %eax, %ebx
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1dc7bd
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x1dbe48
movq %r14, %rdi
callq 0x1dbe22
leal 0x2(%rbx), %eax
movq %rax, 0x30(%rsp)
movq %rbx, 0x48(%rsp)
leal 0x1(%rbx), %eax
movq %rax, 0x18(%rsp)
pushq $0x2
popq %rbp
pushq $-0x2
popq %r15
pushq $-0x1
popq %r13
xorl %r12d, %r12d
movq %r14, %rdi
movl 0xc(%rsp), %esi
callq 0x1dd391
movslq %ebp, %rbx
testl %eax, %eax
je 0x1f133c
movq %r14, %rdi
movl %r15d, %esi
callq 0x1dbaf1
ucomisd 0xf4fc5(%rip), %xmm0    # 0x2e6228
jne 0x1f1285
jp 0x1f1285
movq %r14, %rdi
movl %r13d, %esi
callq 0x1db803
testl %eax, %eax
je 0x1f1285
movq %r14, %rdi
movq 0x30(%rsp), %rsi
callq 0x1db535
jmp 0x1f1239
movq %r14, %rdi
movl %r13d, %esi
callq 0x1f1d66
testl %eax, %eax
jne 0x1f12b3
movq %r14, %rdi
movl %r15d, %esi
callq 0x1f1dc6
movq %r14, %rdi
leaq 0x17888a(%rip), %rsi    # 0x369b33
movq %rax, %rdx
xorl %eax, %eax
callq 0x1de79c
movq %r14, %rdi
movl %r13d, %esi
callq 0x1dbc3d
movq %rax, %r15
shrq $0x3, %r15
movl $0x7ff5, %eax           # imm = 0x7FF5
subl %r15d, %eax
cmpl %eax, %ebp
jl 0x1f12e2
movq %r14, %rdi
leaq 0x17886c(%rip), %rsi    # 0x369b47
xorl %eax, %eax
callq 0x1de79c
movq %r14, %rdi
pushq $0x14
popq %rsi
leaq 0x17886a(%rip), %rdx    # 0x369b59
callq 0x1deabb
movq %r14, %rdi
pushq $-0x2
popq %rsi
callq 0x1db4fe
movq %r14, %rdi
movl %r13d, %esi
callq 0x1db711
movq %r14, %rdi
movl %r13d, %esi
callq 0x1db711
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1dbe48
movq %r14, %rdi
movq 0x18(%rsp), %rsi
callq 0x1dc936
addl %r15d, %ebp
pushq $-0x2
popq %r15
incl %r12d
jmp 0x1f1239
testl %r12d, %r12d
jne 0x1f1354
leaq 0x17882c(%rip), %rdx    # 0x369b74
movq %r14, %rdi
movl 0xc(%rsp), %esi
callq 0x1de6f4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f0978
leaq 0x10(%rax), %rcx
movw $0x8, 0x8(%rax)
decl %ebp
movw %bp, 0xa(%rax)
leal 0x1(%r12), %eax
movl %eax, 0x40(%rsp)
movq 0x48(%rsp), %rax
movl %eax, %ebp
addl $0x3, %ebp
subl $0x1, %r12d
jb 0x1f13b2
movq %r14, %rdi
movq %rcx, %r15
movq %rcx, %rsi
movl %ebp, %edx
callq 0x1f1e11
cltq
leaq (%r15,%rax,8), %r15
addq $0x8, %r15
movq %r15, %rcx
movl $0x5, -0x8(%r15)
addl $0x2, %ebp
jmp 0x1f1382
shlq $0x3, %rbx
movq %rcx, %rbp
subq %rbx, %rbp
leaq -0x8(%rbp), %rbx
pushq $0x1
popq %r12
pushq $0x2
popq %r15
movq %rbp, 0x20(%rsp)
movq %rbx, 0x58(%rsp)
cmpl 0x40(%rsp), %r12d
je 0x1f1576
movq 0x18(%rsp), %rax
leal (%rax,%r12,2), %esi
movq %r14, %rdi
callq 0x1dbc3d
movq %rax, %r13
shrq $0x3, %r13
addl %r15d, %r13d
movq 0x30(%rsp), %rax
movq %r12, 0x60(%rsp)
leal (%rax,%r12,2), %eax
movl %eax, 0x2c(%rsp)
xorl %r12d, %r12d
movl %r15d, 0x44(%rsp)
movl %r15d, %r14d
movq %r13, 0x38(%rsp)
movslq %r14d, %rax
cmpl %r13d, %r14d
jge 0x1f14ee
leaq (,%rax,8), %r15
addq %rbp, %r15
movb (%r15), %al
cmpb $0xc, %al
jne 0x1f1441
movswl 0x2(%r15), %ebx
testl %ebx, %ebx
js 0x1f1454
cmpb $0xa, %al
cmovel %r14d, %r12d
movq %r15, %rdi
callq 0x1f1f5f
addl %eax, %r14d
jmp 0x1f141a
addl %r14d, %ebx
movslq %ebx, %r13
cmpb $0x7, -0x8(%rbp,%r13,8)
jne 0x1f1752
leaq -0x1(%r13), %rax
movq 0x20(%rsp), %rcx
movswl 0x2(%rcx,%rax,8), %ebp
addl %eax, %ebp
leal 0x1(%r14), %esi
movq 0x20(%rsp), %rdi
callq 0x1f1f4a
cmpl %eax, %ebp
movq 0x20(%rsp), %rbp
jne 0x1f1752
cmpl %r12d, %ebx
jg 0x1f14e4
leaq (,%r13,8), %rdx
addq %rbp, %rdx
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rcx
movq 0x18(%rsp), %r8
movl 0x2c(%rsp), %r13d
movl %r13d, %r9d
callq 0x1f2130
testl %eax, %eax
jne 0x1f14e4
movq %rbx, %rdi
movl %r13d, %esi
callq 0x1f1dc6
movq %rbx, %rdi
leaq 0x178773(%rip), %rsi    # 0x369c4d
movq %rax, %rdx
xorl %eax, %eax
callq 0x1de79c
movq 0x38(%rsp), %r13
jmp 0x1f1447
movq 0x58(%rsp), %rbx
cmpb $0x5, (%rbx,%rax,8)
jne 0x1f1771
movslq 0x44(%rsp), %rax
leaq (,%rax,8), %rdx
addq %rbp, %rdx
movslq %r13d, %rax
leaq (%rbx,%rax,8), %rcx
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
movq 0x18(%rsp), %r8
movl 0x2c(%rsp), %r9d
callq 0x1f2130
movq 0x60(%rsp), %r12
incl %r12d
movl %r13d, %r15d
jmp 0x1f13d2
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x1f0978
movq %rax, %r15
movq %r14, %rdi
movl 0xc(%rsp), %ebp
movl %ebp, %esi
callq 0x1f1d2a
movl $0x10c15, (%r15)        # imm = 0x10C15
movl $0x17, 0x8(%r15)
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rbp
jmp 0x1f167a
movq %r14, %rdi
movq 0x30(%rsp), %rsi
callq 0x1db711
movq %r14, %rdi
movq 0x18(%rsp), %rsi
callq 0x1dc524
pushq $-0x1
popq %rsi
movq %r14, %rdi
callq 0x1dbaf1
cvttsd2si %xmm0, %ebx
pushq $-0x2
popq %rsi
movq %r14, %rdi
callq 0x1db3d2
testl %ebx, %ebx
jne 0x1f15bf
leaq 0x1785cd(%rip), %rsi    # 0x369b82
movq %r14, %rdi
xorl %eax, %eax
callq 0x1de79c
movw $0x9, (%rbp)
movw %bx, 0x2(%rbp)
xorl %r14d, %r14d
cmpl %r15d, %r14d
jge 0x1f1632
movl %r14d, %eax
leaq (,%rax,8), %rbx
addq %rbp, %rbx
cmpb $0xa, (%rbx)
jne 0x1f1625
movswl 0x2(%rbx), %edx
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1f1eb5
movl %eax, %ebp
leal 0x1(%r14), %esi
movq 0x20(%rsp), %rdi
callq 0x1f1f4a
cltq
movq 0x20(%rsp), %rcx
cmpb $0x5, (%rcx,%rax,8)
sete %al
xorb $0x9, %al
movb %al, (%rbx)
subl %r14d, %ebp
movw %bp, 0x2(%rbx)
movq 0x20(%rsp), %rbp
movq %rbx, %rdi
callq 0x1f1f5f
addl %eax, %r14d
jmp 0x1f15cc
movq %rbp, %rdi
callq 0x1f1f7f
movq 0x10(%rsp), %r14
movq %r14, %rdi
movl 0xc(%rsp), %esi
callq 0x1db535
movq %r14, %rdi
movq 0x48(%rsp), %rsi
callq 0x1db3d2
movq 0x50(%rsp), %rbx
jmp 0x1f16a0
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x1f0978
movq %rax, %rbp
movl $0xf, (%rax)
movq %r14, %rdi
movl 0xc(%rsp), %esi
callq 0x1db535
jmp 0x1f16a0
movq %r12, %rdi
xorl %esi, %esi
callq 0x1f0978
movq %rax, %rbp
movq %r12, %rdi
movl 0xc(%rsp), %esi
callq 0x1db535
movq %r14, %rbx
movq %r12, %r14
testq %rbx, %rbx
je 0x1f16b9
movq %r14, %rdi
movl 0xc(%rsp), %esi
callq 0x1dbc3d
shrq $0x3, %rax
decl %eax
movl %eax, (%rbx)
movq %rbp, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xffffff01, %ebx       # imm = 0xFFFFFF01
jb 0x1f1700
negl %ebx
pushq $0x2
popq %rsi
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x1f0978
movq %rax, %rbp
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
movl %ebx, %ecx
callq 0x1f09e0
movl $0xf, 0x8(%rbp)
jmp 0x1f168e
leaq 0x74(%rsp), %r15
movl $0x2, (%r15)
movl $0xffffff01, %esi       # imm = 0xFFFFFF01
subl %ebx, %esi
pushq $0x3
popq %rdx
movq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rcx
callq 0x1f1ca1
movq %rax, %rbp
movl (%r15), %eax
movw $0xff00, (%rbp)         # imm = 0xFF00
incl %eax
movw %ax, 0x2(%rbp)
movslq (%r15), %rax
movw $0xff07, 0x8(%rbp)      # imm = 0xFF07
movw %ax, 0xa(%rbp)
movl $0xe, (%rbp,%rax,8)
jmp 0x1f168e
leaq 0x178469(%rip), %rdi    # 0x369bc2
leaq 0x178382(%rip), %rsi    # 0x369ae2
leaq 0x1784a7(%rip), %rcx    # 0x369c0e
movl $0x319, %edx            # imm = 0x319
callq 0x174b0
leaq 0x1784f2(%rip), %rdi    # 0x369c6a
leaq 0x178363(%rip), %rsi    # 0x369ae2
leaq 0x178488(%rip), %rcx    # 0x369c0e
movl $0x322, %edx            # imm = 0x322
callq 0x174b0