// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movl %edx, 0x4c(%rsp)
movl %ecx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x38(%rsp)
movq 0x50(%rsp), %rdi
movl 0x4c(%rsp), %esi
callq 0x360390
movl %eax, 0x34(%rsp)
cmpl $0x0, 0x34(%rsp)
jne 0x35e984
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
movl 0x4c(%rsp), %edx
movl 0x48(%rsp), %ecx
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %r9
callq 0x360490
movq %rax, 0x60(%rsp)
jmp 0x35ebcb
movq 0x50(%rsp), %rax
movslq 0x34(%rsp), %rcx
movzbl -0x8(%rax,%rcx,8), %eax
cmpl $0xb, %eax
je 0x35e9b4
movq 0x50(%rsp), %rdi
movl 0x34(%rsp), %esi
movq 0x38(%rsp), %rdx
callq 0x360700
cmpl $0x0, %eax
jne 0x35ea61
movq 0x40(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addl 0x34(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, (%rax)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
movslq 0x34(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movl 0x4c(%rsp), %edx
subl 0x34(%rsp), %edx
movl 0x48(%rsp), %ecx
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %r9
callq 0x35e920
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movslq 0x24(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x50(%rsp), %rsi
movslq 0x34(%rsp), %rdx
shlq $0x3, %rdx
callq 0x19610
movq 0x40(%rsp), %rax
movl (%rax), %eax
movl 0x20(%rsp), %ecx
subl $0x1, %ecx
subl %ecx, %eax
movw %ax, %dx
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
movw %dx, -0x6(%rax,%rcx,8)
movq 0x28(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x35ebcb
movq 0x40(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
addl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
callq 0x35f7b0
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, (%rax)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
movslq 0x34(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movl 0x4c(%rsp), %edx
subl 0x34(%rsp), %edx
movl 0x48(%rsp), %ecx
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %r9
callq 0x35e920
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x50(%rsp), %rsi
movslq 0xc(%rsp), %rdx
shlq $0x3, %rdx
callq 0x19610
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movw 0x2(%rax,%rcx,8), %dx
addw $0x1, %dx
movw %dx, 0x2(%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl 0x14(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movl 0x34(%rsp), %edx
subl 0xc(%rsp), %edx
addl $0x1, %edx
movl $0x7, %esi
movl $0x1, %ecx
callq 0x35dbc0
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x50(%rsp), %rsi
movslq 0xc(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movl 0x34(%rsp), %eax
subl 0xc(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x3, %rdx
callq 0x19610
movl 0x34(%rsp), %eax
subl 0xc(%rsp), %eax
subl $0x1, %eax
addl 0x14(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x40(%rsp), %rax
movl (%rax), %edx
movl 0x10(%rsp), %eax
subl $0x1, %eax
subl %eax, %edx
movl $0xb, %esi
xorl %ecx, %ecx
callq 0x35dbc0
movq 0x18(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)