// File: /workspace/github_c_makefile_star2_O1/ccxvii[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
movq %r8, 0x18(%rsp)
movq %rdx, 0x8(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %r9d, 0x4(%rsp)
cmpl $0x400, %r9d            # imm = 0x400
jg 0x1c73b
movl %ecx, %r15d
movq %rsi, %r12
movq %rdi, %r14
movq 0x18(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x20(%rsp)
incl 0x4(%rsp)
leaq 0xf797(%rip), %r13      # 0x2b95c
movzbl (%r14), %eax
movl $0x1, %ebx
cmpq $0x10, %rax
ja 0x1c73b
movslq (%r13,%rax,4), %rcx
addq %r13, %rcx
jmpq *%rcx
movq 0x10(%r14), %r14
jmp 0x1c1c5
xorl %eax, %eax
cmpq 0x8(%rsp), %r12
jbe 0x1c21b
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 0x1c51c
jmp 0x1c73b
testb $0x4, %r15b
jne 0x1c69d
cmpq 0x8(%rsp), %r12
je 0x1c51c
jmp 0x1c69d
movq %r14, 0x38(%rsp)
movzbl 0x1(%r14), %eax
shll $0x4, %eax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax), %rbx
movq 0x8(%rcx,%rax), %r14
movq %r14, %rbp
subq %rbx, %rbp
testb $0x1, %r15b
jne 0x1c448
movslq %ebp, %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3160
testl %eax, %eax
je 0x1c502
jmp 0x1c736
movq 0x10(%r14), %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
movl %r15d, %ecx
movq 0x18(%rsp), %r8
movl 0x4(%rsp), %r9d
callq 0x1c171
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x1c73b
cmpl $0x1, %ebx
jne 0x1c395
jmp 0x1c73b
cmpb $0x0, (%r12)
je 0x1c73b
movq %rsp, %rdi
movq %r12, %rsi
callq 0x18750
movl %eax, %eax
addq %rax, %r12
jmp 0x1c51c
movl $0x108, %edx            # imm = 0x108
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0x33d0
movq 0x10(%r14), %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
movl %r15d, %ecx
movq %rbx, %r8
movl 0x4(%rsp), %r9d
callq 0x1c171
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x1c73b
testl %ebx, %ebx
jne 0x1c395
jmp 0x1c753
movl $0x108, %edx            # imm = 0x108
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
callq 0x33d0
movq 0x10(%r14), %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
movl %r15d, %ecx
movq %rbp, %r8
movl 0x4(%rsp), %r9d
callq 0x1c171
cmpl $-0x1, %eax
je 0x1c76b
testl %eax, %eax
je 0x1c73b
movq 0x18(%r14), %r14
jmp 0x1c1c5
xorl %eax, %eax
cmpq 0x8(%rsp), %r12
jbe 0x1c3d1
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 0x1c51c
jmp 0x1c73b
movzbl (%r12), %eax
testl %eax, %eax
jne 0x1c67c
jmp 0x1c51c
movzbl 0x1(%r14), %eax
shll $0x4, %eax
movq 0x20(%rsp), %rcx
movq %r12, 0x8(%rcx,%rax)
jmp 0x1c51c
movzbl 0x1(%r14), %eax
shll $0x4, %eax
movq 0x20(%rsp), %rcx
movq %r12, (%rcx,%rax)
jmp 0x1c51c
movq %rbp, 0x30(%rsp)
notl %r14d
addl %ebx, %r14d
movq %r12, 0x10(%rsp)
incl %r14d
je 0x1c4f8
cmpb $0x0, (%r12)
je 0x1c4e4
cmpb $0x0, (%rbx)
je 0x1c4e4
leaq 0x2c(%rsp), %rdi
movq %r12, %rsi
callq 0x18750
movl %eax, %eax
addq %rax, %r12
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x18750
movl %eax, %eax
addq %rax, %rbx
movl 0x2c(%rsp), %ebp
movl %ebp, %edi
callq 0x1c8bb
movl $0x80, %ecx
cmpl %ecx, %eax
movl %r15d, %r13d
movl %eax, %r15d
cmovll %ebp, %r15d
cmpl $0x7f, %ebp
cmovlel %eax, %r15d
movl 0x28(%rsp), %ebp
movl %ebp, %edi
callq 0x1c8bb
movl $0x80, %ecx
cmpl %ecx, %eax
movl %eax, %ecx
cmovll %ebp, %ecx
cmpl $0x7f, %ebp
cmovlel %eax, %ecx
cmpl %ecx, %r15d
movl %r13d, %r15d
leaq 0xf47e(%rip), %r13      # 0x2b95c
je 0x1c458
testl %r14d, %r14d
movq 0x10(%rsp), %r12
movq 0x30(%rsp), %rbp
je 0x1c502
jmp 0x1c736
movq 0x10(%rsp), %r12
movq 0x30(%rsp), %rbp
movl %ebp, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testl %ebp, %ebp
movl $0x0, %ecx
cmovleq %rcx, %rax
addq %rax, %r12
movq 0x38(%rsp), %r14
addq $0x20, %r14
jmp 0x1c1c5
cmpb $0x0, (%r12)
je 0x1c73b
movq %rsp, %rdi
movq %r12, %rsi
callq 0x18750
movl (%rsp), %ecx
leal -0x2028(%rcx), %edx
cmpl $0x2, %edx
jb 0x1c73b
cmpl $0xa, %ecx
je 0x1c73b
cmpl $0xd, %ecx
je 0x1c73b
movl %eax, %eax
jmp 0x1c5bd
cmpb $0x0, (%r12)
je 0x1c73b
movq %rsp, %rdi
movq %r12, %r13
movq %r12, %rsi
callq 0x18750
movl %eax, %ebp
testb $0x1, %r15b
je 0x1c5ab
movq %r14, %r12
movl (%rsp), %r14d
movl %r14d, %edi
callq 0x1c8bb
cmpl $0x80, %eax
movl %eax, %ecx
cmovll %r14d, %ecx
cmpl $0x7f, %r14d
movq %r12, %r14
cmovlel %eax, %ecx
movl %ecx, (%rsp)
movl (%rsp), %eax
cmpl 0x4(%r14), %eax
jne 0x1c73b
movl %ebp, %eax
movq %r13, %r12
addq %rax, %r12
jmp 0x1c72d
cmpb $0x0, (%r12)
je 0x1c73b
movq %rsp, %rdi
movq %r12, 0x10(%rsp)
movq %r12, %rsi
callq 0x18750
movl %eax, %r12d
movq %r14, %r13
movq 0x8(%r14), %rbp
movl (%rsp), %r14d
testb $0x1, %r15b
jne 0x1c6d1
movq (%rbp), %rax
addq $0x8, %rbp
cmpq %rax, %rbp
jae 0x1c73b
cmpl %r14d, (%rbp)
jg 0x1c619
cmpl %r14d, 0x4(%rbp)
jge 0x1c71f
addq $0x8, %rbp
cmpq %rax, %rbp
jb 0x1c609
jmp 0x1c736
cmpb $0x0, (%r12)
je 0x1c73b
movq %rsp, %rdi
movq %r12, 0x10(%rsp)
movq %r12, %rsi
callq 0x18750
movl %eax, %r12d
movq %r14, %r13
movq 0x8(%r14), %rbp
movl (%rsp), %r14d
testb $0x1, %r15b
jne 0x1c6f9
movq (%rbp), %rax
addq $0x8, %rbp
cmpq %rax, %rbp
jae 0x1c71f
cmpl %r14d, (%rbp)
jg 0x1c65e
cmpl %r14d, 0x4(%rbp)
jl 0x1c65e
jmp 0x1c736
testb $0x2, %r15b
je 0x1c73b
cmpl $0xd, %eax
je 0x1c72d
cmpl $0xa, %eax
je 0x1c72d
jmp 0x1c73b
testb $0x2, %r15b
je 0x1c73b
cmpq 0x8(%rsp), %r12
jbe 0x1c73b
movq %r12, %rcx
movzbl -0x1(%r12), %eax
cmpl $0xd, %eax
je 0x1c6c5
cmpl $0xa, %eax
jne 0x1c73b
addq $0x20, %r14
movq %rcx, %r12
jmp 0x1c1be
movl %r14d, %edi
callq 0x1c8bb
cmpl $0x80, %eax
movl %eax, %esi
cmovll %r14d, %esi
cmpl $0x7f, %r14d
cmovlel %eax, %esi
movq %rbp, %rdi
callq 0x2aace
testl %eax, %eax
jne 0x1c71f
jmp 0x1c73b
movl %r14d, %edi
callq 0x1c8bb
cmpl $0x80, %eax
movl %eax, %esi
cmovll %r14d, %esi
cmpl $0x7f, %r14d
cmovlel %eax, %esi
movq %rbp, %rdi
callq 0x2aace
testl %eax, %eax
jne 0x1c73b
movl %r12d, %eax
movq 0x10(%rsp), %r12
addq %rax, %r12
movq %r13, %r14
addq $0x20, %r14
jmp 0x1c1be
movl $0x1, %ebx
movl %ebx, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %ebx
jmp 0x1c73b
leaq 0x40(%rsp), %rsi
movl $0x108, %edx            # imm = 0x108
movq 0x18(%rsp), %rdi
callq 0x33d0
xorl %ebx, %ebx
jmp 0x1c73b
movl %eax, %ebx
jmp 0x1c73b