// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/lpeg-0.10.2/lpeg.c
// Function: separateparts
static Instruction *separateparts (lua_State *L, Instruction *p1, int l1,
                                   int l2, int *size, CharsetTag *st2) {
  int sp = firstpart(p1, l1);
  if (sp == 0)  /* first part is entire p1? */
    return basicUnion(L, p1, l1, l2, size, st2);
  else if ((p1 + sp - 1)->i.code == ICommit || !interfere(p1, sp, st2)) {
    Instruction *p;
    int init = *size;
    int end = init + sp;
    *size = end;
    p = separateparts(L, p1 + sp, l1 - sp, l2, size, st2);
    copypatt(p + init, p1, sp);
    (p + end - 1)->i.offset = *size - (end - 1);
    return p;
  }
  else {  /* must change back to non-optimized choice */
    Instruction *p;
    int init = *size;
    int end = init + sp + 1;  /* needs one extra instruction (choice) */
    int sizefirst = sizei(p1);  /* size of p1's first instruction (the test) */
    *size = end;
    p = separateparts(L, p1 + sp, l1 - sp, l2, size, st2);
    copypatt(p + init, p1, sizefirst);  /* copy the test */
    (p + init)->i.offset++;  /* correct jump (because of new instruction) */
    init += sizefirst;
    setinstaux(p + init, IChoice, sp - sizefirst + 1, 1); init++;
    copypatt(p + init, p1 + sizefirst, sp - sizefirst - 1);
    init += sp - sizefirst - 1;
    setinst(p + init, ICommit, *size - (end - 1));
    return p;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %rbp
movl %ecx, %r12d
movl %edx, %r13d
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movzbl (%rsi), %r15d
movl $0xfdfff8, %eax         # imm = 0xFDFFF8
btq %r15, %rax
movq %r8, 0x10(%rsp)
jb 0x1f18a3
movswl 0x2(%r14), %ebx
testl %ebx, %ebx
je 0x1f18a3
movslq %ebx, %rax
movzbl -0x8(%r14,%rax,8), %ecx
cmpl $0xb, %ecx
je 0x1f1888
cmpl $0x8, %ecx
jne 0x1f1972
movswl -0x6(%r14,%rax,8), %ecx
decq %rax
addl %ecx, %eax
movw $0x1, (%rsp)
cmpl %r13d, %eax
je 0x1f18de
jmp 0x1f1972
cmpl $0x7, %r15d
jne 0x1f1972
movzwl 0x2(%r14), %eax
movw %ax, (%rsp)
movswq %ax, %rax
cmpb $0xb, -0x8(%r14,%rax,8)
jne 0x1f1972
movswl -0x6(%r14,%rax,8), %ecx
decq %rax
addl %ecx, %eax
cmpl %r13d, %eax
jne 0x1f1972
movswl (%rsp), %ebx
testl %ebx, %ebx
je 0x1f1972
movq %r12, 0x38(%rsp)
movslq %ebx, %rax
movq %rax, 0x20(%rsp)
leaq (%r14,%rax,8), %rax
movq %rax, 0x30(%rsp)
cmpb $0xb, -0x8(%rax)
jne 0x1f1b07
movq 0x10(%rsp), %r8
movslq (%r8), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %r12
addq %r12, %rax
movq %rax, (%rsp)
movl %eax, (%r8)
subl %ebx, %r13d
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl %r13d, %edx
movq 0x38(%rsp), %rcx
movq %r8, %rbx
movq %rbp, %r9
callq 0x1f1835
movq %rax, %r15
movq 0x18(%rsp), %rax
leaq (%r15,%rax,8), %rdi
shlq $0x3, %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0x17630
movl (%rbx), %eax
movq (%rsp), %rcx
subl %ecx, %eax
incl %eax
movw %ax, -0x6(%r15,%rcx,8)
jmp 0x1f1af5
leaq 0x44(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f1790
movl (%rbx), %eax
testl %eax, %eax
je 0x1f19eb
cmpl $0x1, %eax
jne 0x1f19cf
movl (%rbp), %eax
cmpl $0x1, %eax
jne 0x1f19d2
leaq 0x28(%rsp), %rsi
pushq $0x5
popq %rcx
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
callq 0x1f254f
movl $0x2, (%rax)
xorl %ecx, %ecx
cmpq $0x20, %rcx
je 0x1f1af0
movb 0x4(%rbp,%rcx), %dl
orb 0x48(%rsp,%rcx), %dl
movb %dl, 0x8(%rax,%rcx)
incq %rcx
jmp 0x1f19b4
movl (%rbp), %eax
testl %eax, %eax
je 0x1f19eb
leaq 0x48(%rsp), %rdi
addq $0x4, %rbp
movq %rbp, %rsi
callq 0x1f26f0
testl %eax, %eax
jne 0x1f19f7
movq %r14, %rdi
callq 0x1f259e
testl %eax, %eax
je 0x1f1a67
leal 0x1(%r13), %ebx
leal (%r12,%r13), %ecx
incl %ecx
leaq 0x28(%rsp), %rsi
movq %r13, %r15
movq 0x8(%rsp), %r13
movq %r13, %rdi
movq 0x10(%rsp), %rdx
callq 0x1f254f
movq %rax, %rbp
movslq %r15d, %r15
leaq (,%r15,8), %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x17630
movq %rbp, %rdi
movl %ebx, %esi
callq 0x1f25f7
leaq 0x8(,%r15,8), %rsi
addq %rbp, %rsi
movw $0x8, -0x8(%rsi)
incl %r12d
movw %r12w, -0x6(%rsi)
pushq $0x2
popq %rdx
movq %r13, %rdi
callq 0x1f1e11
jmp 0x1f1af0
leal 0x2(%r13), %r15d
leal (%r12,%r13), %ecx
addl $0x2, %ecx
leaq 0x28(%rsp), %rsi
movq %r13, %rbp
movq %r12, %r13
movq 0x8(%rsp), %r12
movq %r12, %rdi
movq 0x10(%rsp), %rdx
callq 0x1f254f
movq %rax, %rbx
leaq 0x8(%rax), %rdi
movw $0x7, (%rax)
movw %r15w, 0x2(%rax)
movslq %ebp, %r15
leaq (,%r15,8), %rdx
movq %r14, %rsi
callq 0x17630
leaq (%rbx,%r15,8), %r14
addq $0x8, %r14
leaq (%rbx,%r15,8), %rsi
addq $0x10, %rsi
movw $0xb, -0x8(%rsi)
incl %r13d
movw %r13w, -0x6(%rsi)
pushq $0x2
popq %rdx
movq %r12, %rdi
callq 0x1f1e11
pushq $-0x2
popq %rax
subl %ebp, %eax
cltq
leaq (%r14,%rax,8), %rdi
addq $0x8, %rdi
callq 0x1f2634
movq 0x28(%rsp), %r15
movq %r15, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
cmpl %ebx, %r12d
jge 0x1f1906
movl %r12d, %eax
movl (%r14,%rax,8), %ecx
movl $0x83fef7, %edx         # imm = 0x83FEF7
btq %rcx, %rdx
jb 0x1f1b33
leaq (%r14,%rax,8), %rdi
callq 0x1f1f5f
addl %eax, %r12d
jmp 0x1f1b0a
cmpl $0x0, (%rbp)
je 0x1f1b8c
cmpw $0x0, (%rsp)
je 0x1f1c63
testl %r15d, %r15d
je 0x1f1b8c
cmpl $0x2, %r15d
je 0x1f1b74
cmpl $0x1, %r15d
jne 0x1f1c82
movzbl 0x1(%r14), %ecx
movl %ecx, %eax
shrl $0x3, %eax
movzbl 0x4(%rbp,%rax), %edx
andb $0x7, %cl
pushq $0x1
popq %rax
shll %cl, %eax
andl %edx, %eax
jmp 0x1f1b84
leaq 0x4(%rbp), %rdi
leaq 0x8(%r14), %rsi
callq 0x1f26f0
xorl $0x1, %eax
testl %eax, %eax
je 0x1f1906
movq 0x10(%rsp), %rax
movslq (%rax), %rcx
movq %rcx, 0x20(%rsp)
movq %rax, %r12
leal (%rcx,%rbx), %eax
movl %eax, (%rsp)
leal (%rcx,%rbx), %r15d
incl %r15d
movq %r14, %rdi
callq 0x1f1f5f
movq %rax, 0x18(%rsp)
movq %r12, %r8
movl %r15d, (%r12)
subl %ebx, %r13d
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl %r13d, %edx
movq 0x38(%rsp), %rcx
movq %rbp, %r9
callq 0x1f1835
movq %rax, %r15
movq 0x20(%rsp), %rbp
leaq (%rax,%rbp,8), %r12
movq 0x18(%rsp), %r13
movl %r13d, %eax
movq %rax, 0x8(%rsp)
leaq (,%rax,8), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x17630
incw 0x2(%r12)
leal (%r13,%rbp), %eax
cltq
subl %r13d, %ebx
leaq (%r15,%rax,8), %rdi
addq $0x8, %rdi
movw $0x107, -0x8(%rdi)      # imm = 0x107
leal 0x1(%rbx), %eax
movw %ax, -0x6(%rdi)
movq 0x8(%rsp), %rax
leaq (%r14,%rax,8), %rsi
movslq %ebx, %rax
leaq -0x8(,%rax,8), %rdx
callq 0x17630
movslq (%rsp), %rax
movq 0x10(%rsp), %rcx
movl (%rcx), %ecx
subl %eax, %ecx
movw $0xb, (%r15,%rax,8)
movw %cx, 0x2(%r15,%rax,8)
jmp 0x1f1af5
leaq 0x178205(%rip), %rdi    # 0x369e6f
leaq 0x177e71(%rip), %rsi    # 0x369ae2
leaq 0x178209(%rip), %rcx    # 0x369e81
movl $0x5da, %edx            # imm = 0x5DA
callq 0x174b0
leaq 0x178228(%rip), %rdi    # 0x369eb1
leaq 0x177e52(%rip), %rsi    # 0x369ae2
leaq 0x1781ea(%rip), %rcx    # 0x369e81
movl $0x5de, %edx            # imm = 0x5DE
callq 0x174b0