// File: /workspace/github_c_makefile_star2_O2/ArtifexSoftware[P]mujs/./regexp.c
// Function: match
static int match(Reinst *pc, const char *sp, const char *bol, int flags, Resub *out, int depth)
{
	Resub scratch;
	int result;
	int i;
	Rune c;

	/* stack overflow */
	if (depth > REG_MAXREC)
		return -1;

	for (;;) {
		switch (pc->opcode) {
		case I_END:
			return 0;
		case I_JUMP:
			pc = pc->x;
			break;
		case I_SPLIT:
			scratch = *out;
			result = match(pc->x, sp, bol, flags, &scratch, depth+1);
			if (result == -1)
				return -1;
			if (result == 0) {
				*out = scratch;
				return 0;
			}
			pc = pc->y;
			break;

		case I_PLA:
			result = match(pc->x, sp, bol, flags, out, depth+1);
			if (result == -1)
				return -1;
			if (result == 1)
				return 1;
			pc = pc->y;
			break;
		case I_NLA:
			scratch = *out;
			result = match(pc->x, sp, bol, flags, &scratch, depth+1);
			if (result == -1)
				return -1;
			if (result == 0)
				return 1;
			pc = pc->y;
			break;

		case I_ANYNL:
			if (!*sp) return 1;
			sp += chartorune(&c, sp);
			pc = pc + 1;
			break;
		case I_ANY:
			if (!*sp) return 1;
			sp += chartorune(&c, sp);
			if (isnewline(c))
				return 1;
			pc = pc + 1;
			break;
		case I_CHAR:
			if (!*sp) return 1;
			sp += chartorune(&c, sp);
			if (flags & REG_ICASE)
				c = canon(c);
			if (c != pc->c)
				return 1;
			pc = pc + 1;
			break;
		case I_CCLASS:
			if (!*sp) return 1;
			sp += chartorune(&c, sp);
			if (flags & REG_ICASE) {
				if (!incclasscanon(pc->cc, canon(c)))
					return 1;
			} else {
				if (!incclass(pc->cc, c))
					return 1;
			}
			pc = pc + 1;
			break;
		case I_NCCLASS:
			if (!*sp) return 1;
			sp += chartorune(&c, sp);
			if (flags & REG_ICASE) {
				if (incclasscanon(pc->cc, canon(c)))
					return 1;
			} else {
				if (incclass(pc->cc, c))
					return 1;
			}
			pc = pc + 1;
			break;
		case I_REF:
			i = out->sub[pc->n].ep - out->sub[pc->n].sp;
			if (flags & REG_ICASE) {
				if (strncmpcanon(sp, out->sub[pc->n].sp, i))
					return 1;
			} else {
				if (strncmp(sp, out->sub[pc->n].sp, i))
					return 1;
			}
			if (i > 0)
				sp += i;
			pc = pc + 1;
			break;

		case I_BOL:
			if (sp == bol && !(flags & REG_NOTBOL)) {
				pc = pc + 1;
				break;
			}
			if (flags & REG_NEWLINE) {
				if (sp > bol && isnewline(sp[-1])) {
					pc = pc + 1;
					break;
				}
			}
			return 1;
		case I_EOL:
			if (*sp == 0) {
				pc = pc + 1;
				break;
			}
			if (flags & REG_NEWLINE) {
				if (isnewline(*sp)) {
					pc = pc + 1;
					break;
				}
			}
			return 1;
		case I_WORD:
			i = sp > bol && iswordchar(sp[-1]);
			i ^= iswordchar(sp[0]);
			if (!i)
				return 1;
			pc = pc + 1;
			break;
		case I_NWORD:
			i = sp > bol && iswordchar(sp[-1]);
			i ^= iswordchar(sp[0]);
			if (i)
				return 1;
			pc = pc + 1;
			break;

		case I_LPAR:
			out->sub[pc->n].sp = sp;
			pc = pc + 1;
			break;
		case I_RPAR:
			out->sub[pc->n].ep = sp;
			pc = pc + 1;
			break;
		default:
			return 1;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movl %ecx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
cmpl $0x400, %r9d            # imm = 0x400
jle 0x14d3c
pushq $-0x1
jmp 0x1515a
movl %r9d, %r13d
movq %r8, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x8(%r8), %rax
movq %rax, 0x20(%rsp)
incl %r13d
leaq 0xbc1d(%rip), %r14      # 0x20978
movl %r13d, 0x1c(%rsp)
movzbl (%rbx), %eax
cmpq $0x10, %rax
ja 0x15158
movslq (%r14,%rax,4), %rcx
addq %r14, %rcx
jmpq *%rcx
movq 0x10(%rbx), %rbx
jmp 0x14d60
xorl %r14d, %r14d
cmpq 0x10(%rsp), %r12
jbe 0x14d94
movsbl -0x1(%r12), %edi
callq 0x1f124
movl %eax, %r14d
movsbl (%r12), %edi
callq 0x1f124
cmpl %eax, %r14d
je 0x14fda
jmp 0x15158
testb $0x4, 0x8(%rsp)
jne 0x14dbe
cmpq 0x10(%rsp), %r12
je 0x1506a
testb $0x2, 0x8(%rsp)
je 0x15158
cmpq 0x10(%rsp), %r12
jbe 0x15158
movsbl -0x1(%r12), %edi
jmp 0x15039
movq %r15, 0x38(%rsp)
movzbl 0x1(%rbx), %eax
shll $0x4, %eax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax), %r14
movq 0x8(%rcx,%rax), %r15
movq %r15, %rbp
subq %r14, %rbp
testb $0x1, 0x8(%rsp)
jne 0x15073
movslq %ebp, %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x3160
testl %eax, %eax
je 0x1512e
jmp 0x15158
movq 0x10(%rbx), %rdi
movq %r12, %rsi
movq 0x10(%rsp), %rdx
movl 0x8(%rsp), %ecx
movq %r15, %r8
movl %r13d, %r9d
callq 0x14d12
cmpl $-0x1, %eax
je 0x1515b
cmpl $0x1, %eax
jne 0x14efc
jmp 0x15158
cmpb $0x0, (%r12)
je 0x15158
leaq 0xc(%rsp), %rdi
movq %r12, %rsi
callq 0x1241b
movl %eax, %eax
addq %rax, %r12
jmp 0x1506a
movl $0x108, %edx            # imm = 0x108
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x33d0
movq 0x10(%rbx), %rdi
movq %r12, %rsi
movq 0x10(%rsp), %rdx
movl 0x8(%rsp), %ecx
movq %rbp, %r8
movl %r13d, %r9d
callq 0x14d12
cmpl $-0x1, %eax
je 0x1515b
testl %eax, %eax
jne 0x14efc
jmp 0x1516f
movl $0x108, %edx            # imm = 0x108
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x33d0
movq 0x10(%rbx), %rdi
movq %r12, %rsi
movq 0x10(%rsp), %rdx
movl 0x8(%rsp), %ecx
movq %rbp, %r8
movl %r13d, %r9d
callq 0x14d12
cmpl $-0x1, %eax
je 0x1515b
testl %eax, %eax
je 0x15158
movq 0x18(%rbx), %rbx
jmp 0x14d60
cmpb $0x0, (%r12)
je 0x15158
leaq 0xc(%rsp), %rdi
movq %r12, %rsi
callq 0x1241b
movl %eax, %r14d
movq 0x8(%rbx), %r13
movl 0xc(%rsp), %esi
testb $0x1, 0x8(%rsp)
jne 0x150dd
movq %r13, %rdi
callq 0x1f103
jmp 0x150ee
cmpb $0x0, (%r12)
je 0x15158
leaq 0xc(%rsp), %rdi
movq %r12, %rsi
callq 0x1241b
movl %eax, %r14d
movl 0xc(%rsp), %edi
callq 0x1f090
testl %eax, %eax
je 0x14fa7
jmp 0x15158
cmpb $0x0, (%r12)
je 0x15158
leaq 0xc(%rsp), %rdi
movq %r12, %rsi
callq 0x1241b
movl %eax, %r14d
movl 0xc(%rsp), %eax
testb $0x1, 0x8(%rsp)
je 0x14f9e
movl %eax, %edi
callq 0x1f076
movl %eax, 0xc(%rsp)
cmpl 0x4(%rbx), %eax
jne 0x15158
movl %r14d, %eax
addq %rax, %r12
jmp 0x14fda
xorl %r14d, %r14d
cmpq 0x10(%rsp), %r12
jbe 0x14fc7
movsbl -0x1(%r12), %edi
callq 0x1f124
movl %eax, %r14d
movsbl (%r12), %edi
callq 0x1f124
cmpl %eax, %r14d
je 0x15158
addq $0x20, %rbx
leaq 0xb993(%rip), %r14      # 0x20978
jmp 0x14d60
cmpb $0x0, (%r12)
je 0x15158
leaq 0xc(%rsp), %rdi
movq %r12, %rsi
callq 0x1241b
movl %eax, %r14d
movq 0x8(%rbx), %r13
movl 0xc(%rsp), %esi
testb $0x1, 0x8(%rsp)
jne 0x150f4
movq %r13, %rdi
callq 0x1f103
jmp 0x15105
movsbl (%r12), %edi
testl %edi, %edi
je 0x1506a
testb $0x2, 0x8(%rsp)
je 0x15158
callq 0x1f090
testl %eax, %eax
jne 0x1506a
jmp 0x15158
movzbl 0x1(%rbx), %eax
shll $0x4, %eax
movq 0x20(%rsp), %rcx
movq %r12, 0x8(%rcx,%rax)
jmp 0x1506a
movzbl 0x1(%rbx), %eax
shll $0x4, %eax
movq 0x20(%rsp), %rcx
movq %r12, (%rcx,%rax)
addq $0x20, %rbx
jmp 0x14d60
movq %rbp, 0x30(%rsp)
notl %r15d
addl %r14d, %r15d
movq %r12, %r13
incl %r15d
je 0x15124
cmpb $0x0, (%r13)
je 0x15158
cmpb $0x0, (%r14)
je 0x15158
leaq 0x2c(%rsp), %rdi
movq %r13, %rsi
callq 0x1241b
movl %eax, %eax
addq %rax, %r13
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x1241b
movl %eax, %eax
addq %rax, %r14
movl 0x2c(%rsp), %edi
callq 0x1f076
movl %eax, %ebp
movl 0x28(%rsp), %edi
callq 0x1f076
cmpl %eax, %ebp
je 0x15081
jmp 0x15158
movl %esi, %edi
callq 0x1f076
movq %r13, %rdi
movl %eax, %esi
callq 0x1f0b1
testl %eax, %eax
jne 0x15109
jmp 0x15158
movl %esi, %edi
callq 0x1f076
movq %r13, %rdi
movl %eax, %esi
callq 0x1f0b1
testl %eax, %eax
jne 0x15158
movl %r14d, %eax
addq %rax, %r12
addq $0x20, %rbx
movl 0x1c(%rsp), %r13d
leaq 0xb859(%rip), %r14      # 0x20978
jmp 0x14d60
movl 0x1c(%rsp), %r13d
movq 0x30(%rsp), %rbp
movl %ebp, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testl %ebp, %ebp
movl $0x0, %ecx
cmovleq %rcx, %rax
addq %rax, %r12
addq $0x20, %rbx
movq 0x38(%rsp), %r15
leaq 0xb825(%rip), %r14      # 0x20978
jmp 0x14d60
pushq $0x1
popq %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1515b
leaq 0x40(%rsp), %rsi
movl $0x108, %edx            # imm = 0x108
movq %r15, %rdi
callq 0x33d0
xorl %eax, %eax
jmp 0x1515b