// File: /workspace/github_c_makefile_star2_O3/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 $0x158, %rsp            # imm = 0x158
movq %r8, 0x28(%rsp)
movq %rdx, 0x18(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %r9d, 0x14(%rsp)
cmpl $0x400, %r9d            # imm = 0x400
jg 0x1c2b6
movq 0x28(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x30(%rsp)
incl 0x14(%rsp)
leaq 0xfc86(%rip), %r13      # 0x2b99c
movq %rsi, %r12
movq %rdi, %r14
movl %ecx, %ebp
movl %ecx, 0x10(%rsp)
movzbl (%r14), %ebx
cmpq $0x10, %rbx
ja 0x1c2b1
movslq (%r13,%rbx,4), %rax
addq %r13, %rax
jmpq *%rax
movq 0x10(%r14), %r14
jmp 0x1bd22
xorl %eax, %eax
cmpq 0x18(%rsp), %r12
jbe 0x1bd73
movsbl -0x1(%r12), %eax
cmpl $0x5f, %eax
sete %cl
movl %eax, %edx
andl $-0x21, %edx
addl $-0x41, %edx
cmpl $0x1a, %edx
setb %dl
addl $-0x30, %eax
cmpl $0xa, %eax
setb %al
orb %cl, %al
orb %dl, %al
movzbl %al, %eax
movsbl (%r12), %ecx
cmpl $0x5f, %ecx
sete %dl
movl %ecx, %esi
andl $-0x21, %esi
addl $-0x41, %esi
cmpl $0x1a, %esi
setb %sil
addl $-0x30, %ecx
cmpl $0xa, %ecx
setb %cl
orb %dl, %cl
orb %sil, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x1c2a8
jmp 0x1c2b1
testb $0x4, %bpl
jne 0x1bdbc
cmpq 0x18(%rsp), %r12
je 0x1c2a8
movl $0x1, %ebx
testb $0x2, %bpl
je 0x1c2b6
cmpq 0x18(%rsp), %r12
jbe 0x1c2b6
movq %r12, %rcx
movzbl -0x1(%r12), %eax
cmpl $0xd, %eax
je 0x1bded
cmpl $0xa, %eax
jne 0x1c2b6
addq $0x20, %r14
movq %rcx, %r12
leaq 0xfba1(%rip), %r13      # 0x2b99c
jmp 0x1bd22
movq %r14, 0x48(%rsp)
movzbl 0x1(%r14), %eax
shll $0x4, %eax
movq 0x30(%rsp), %rcx
movq (%rcx,%rax), %rbx
movq 0x8(%rcx,%rax), %r14
movq %r14, %r15
subq %rbx, %r15
testb $0x1, %bpl
jne 0x1c16a
movslq %r15d, %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3160
testl %eax, %eax
je 0x1c28c
jmp 0x1c2b1
movq 0x10(%r14), %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
movl %ebp, %ecx
movq 0x28(%rsp), %r8
movl 0x14(%rsp), %r9d
callq 0x1bccb
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x1c2b6
cmpl $0x1, %ebx
jne 0x1bf29
jmp 0x1c2b1
cmpb $0x0, (%r12)
je 0x1c2b1
leaq 0xc(%rsp), %rdi
movq %r12, %rsi
callq 0x18239
movl %eax, %eax
addq %rax, %r12
jmp 0x1c2a8
movl $0x108, %edx            # imm = 0x108
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
callq 0x33d0
movq 0x10(%r14), %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
movl %ebp, %ecx
movq %rbx, %r8
movl 0x14(%rsp), %r9d
callq 0x1bccb
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x1c2b6
testl %ebx, %ebx
jne 0x1bf29
jmp 0x1c2ca
movl $0x108, %edx            # imm = 0x108
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
callq 0x33d0
movq 0x10(%r14), %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
movl %ebp, %ecx
movq %rbx, %r8
movl 0x14(%rsp), %r9d
callq 0x1bccb
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x1c2b6
testl %ebx, %ebx
je 0x1c2b1
movq 0x18(%r14), %r14
jmp 0x1bd22
movl $0x1, %ebx
cmpb $0x0, (%r12)
je 0x1c2b6
leaq 0xc(%rsp), %rdi
movq %r12, 0x20(%rsp)
movq %r12, %rsi
callq 0x18239
movl %eax, %r12d
movq %r14, %r13
movl %ebp, %eax
movq 0x8(%r14), %rbp
movl 0xc(%rsp), %r14d
testb $0x1, %al
jne 0x1c20b
movq (%rbp), %rax
addq $0x8, %rbp
cmpq %rax, %rbp
jae 0x1c2b6
cmpl %r14d, (%rbp)
jg 0x1bf71
cmpl %r14d, 0x4(%rbp)
jl 0x1bf71
jmp 0x1c25c
movl $0x1, %ebx
cmpb $0x0, (%r12)
je 0x1c2b6
leaq 0xc(%rsp), %rdi
movq %r12, %rsi
callq 0x18239
movl 0xc(%rsp), %ecx
leal -0x2028(%rcx), %edx
cmpl $0x2, %edx
jb 0x1c2b6
cmpl $0xa, %ecx
je 0x1c2b6
cmpl $0xd, %ecx
je 0x1c2b6
movl %eax, %eax
addq %rax, %r12
jmp 0x1c12d
movl $0x1, %ebx
cmpb $0x0, (%r12)
je 0x1c2b6
movq %r14, %r13
leaq 0xc(%rsp), %rdi
movq %r12, %rsi
callq 0x18239
movl %ebp, %ecx
movl %eax, %ebp
movl 0xc(%rsp), %r14d
testb $0x1, %cl
je 0x1c02a
movl %r14d, %edi
callq 0x1c418
cmpl $0x80, %eax
movl %eax, %ecx
cmovll %r14d, %ecx
cmpl $0x7f, %r14d
cmovlel %eax, %ecx
movl %ecx, 0xc(%rsp)
movl %ecx, %r14d
cmpl 0x4(%r13), %r14d
jne 0x1c2b6
movl %ebp, %eax
jmp 0x1c264
xorl %eax, %eax
cmpq 0x18(%rsp), %r12
jbe 0x1c06e
movsbl -0x1(%r12), %eax
cmpl $0x5f, %eax
sete %cl
movl %eax, %edx
andl $-0x21, %edx
addl $-0x41, %edx
cmpl $0x1a, %edx
setb %dl
addl $-0x30, %eax
cmpl $0xa, %eax
setb %al
orb %cl, %al
orb %dl, %al
movzbl %al, %eax
movsbl (%r12), %ecx
cmpl $0x5f, %ecx
sete %dl
movl %ecx, %esi
andl $-0x21, %esi
addl $-0x41, %esi
cmpl $0x1a, %esi
setb %sil
addl $-0x30, %ecx
cmpl $0xa, %ecx
setb %cl
orb %dl, %cl
orb %sil, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x1c2a8
jmp 0x1c2b1
movl $0x1, %ebx
cmpb $0x0, (%r12)
je 0x1c2b6
leaq 0xc(%rsp), %rdi
movq %r12, 0x20(%rsp)
movq %r12, %rsi
callq 0x18239
movl %eax, %r12d
movq %r14, %r13
movl %ebp, %eax
movq 0x8(%r14), %rbp
movl 0xc(%rsp), %r14d
testb $0x1, %al
jne 0x1c236
movq (%rbp), %rax
addq $0x8, %rbp
cmpq %rax, %rbp
jae 0x1c25c
cmpl %r14d, (%rbp)
jg 0x1c0e5
cmpl %r14d, 0x4(%rbp)
jl 0x1c0e5
jmp 0x1c2b6
movzbl (%r12), %eax
testl %eax, %eax
je 0x1c2a8
movl $0x1, %ebx
testb $0x2, %bpl
je 0x1c2b6
cmpl $0xd, %eax
je 0x1c12d
cmpl $0xa, %eax
jne 0x1c2b6
addq $0x20, %r14
leaq 0xf864(%rip), %r13      # 0x2b99c
jmp 0x1bd22
movzbl 0x1(%r14), %eax
shll $0x4, %eax
movq 0x30(%rsp), %rcx
movq %r12, 0x8(%rcx,%rax)
jmp 0x1c2a8
movzbl 0x1(%r14), %eax
shll $0x4, %eax
movq 0x30(%rsp), %rcx
movq %r12, (%rcx,%rax)
jmp 0x1c2a8
movq %r15, 0x40(%rsp)
notl %r14d
addl %ebx, %r14d
movq %r12, 0x20(%rsp)
incl %r14d
je 0x1c27e
cmpb $0x0, (%r12)
je 0x1c2b1
cmpb $0x0, (%rbx)
je 0x1c2b1
leaq 0x3c(%rsp), %rdi
movq %r12, %rsi
callq 0x18239
movl %eax, %eax
addq %rax, %r12
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0x18239
movl %eax, %eax
addq %rax, %rbx
movl 0x3c(%rsp), %ebp
movl %ebp, %edi
callq 0x1c418
movl $0x80, %r13d
cmpl %r13d, %eax
movl %eax, %r15d
cmovll %ebp, %r15d
cmpl $0x7f, %ebp
cmovlel %eax, %r15d
movl 0x38(%rsp), %ebp
movl %ebp, %edi
callq 0x1c418
cmpl %r13d, %eax
movl %eax, %ecx
cmovll %ebp, %ecx
cmpl $0x7f, %ebp
cmovlel %eax, %ecx
cmpl %ecx, %r15d
leaq 0xf79c(%rip), %r13      # 0x2b99c
je 0x1c17a
jmp 0x1c2b1
movl %r14d, %edi
callq 0x1c418
cmpl $0x80, %eax
movl %eax, %esi
cmovll %r14d, %esi
cmpl $0x7f, %r14d
cmovlel %eax, %esi
movq %rbp, %rdi
callq 0x2a694
testl %eax, %eax
jne 0x1c25c
jmp 0x1c2b6
movl %r14d, %edi
callq 0x1c418
cmpl $0x80, %eax
movl %eax, %esi
cmovll %r14d, %esi
cmpl $0x7f, %r14d
cmovlel %eax, %esi
movq %rbp, %rdi
callq 0x2a694
testl %eax, %eax
jne 0x1c2b6
movl %r12d, %eax
movq 0x20(%rsp), %r12
addq %rax, %r12
movq %r13, %r14
addq $0x20, %r14
leaq 0xf727(%rip), %r13      # 0x2b99c
movl 0x10(%rsp), %ebp
jmp 0x1bd22
movl 0x10(%rsp), %ebp
movq 0x20(%rsp), %r12
movq 0x40(%rsp), %r15
movl %r15d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testl %r15d, %r15d
movl $0x0, %ecx
cmovleq %rcx, %rax
addq %rax, %r12
movq 0x48(%rsp), %r14
addq $0x20, %r14
jmp 0x1bd22
movl $0x1, %ebx
movl %ebx, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x50(%rsp), %rsi
movl $0x108, %edx            # imm = 0x108
movq 0x28(%rsp), %rdi
callq 0x33d0
xorl %ebx, %ebx
jmp 0x1c2b6