// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
cmpl $0x400, -0x34(%rbp)     # imm = 0x400
jle 0x1d1a7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1d8fb
jmp 0x1d1a9
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movq %rax, -0x158(%rbp)
subq $0x10, %rax
ja 0x1d8ed
movq -0x158(%rbp), %rax
leaq 0x167c1(%rip), %rcx     # 0x33990
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x4(%rbp)
jmp 0x1d8fb
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x30(%rbp), %rsi
leaq -0x140(%rbp), %rdi
movl $0x108, %edx            # imm = 0x108
callq 0x33a0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl -0x34(%rbp), %r9d
addl $0x1, %r9d
leaq -0x140(%rbp), %r8
callq 0x1d170
movl %eax, -0x144(%rbp)
cmpl $-0x1, -0x144(%rbp)
jne 0x1d24c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1d8fb
cmpl $0x0, -0x144(%rbp)
jne 0x1d276
movq -0x30(%rbp), %rdi
leaq -0x140(%rbp), %rsi
movl $0x108, %edx            # imm = 0x108
callq 0x33a0
movl $0x0, -0x4(%rbp)
jmp 0x1d8fb
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
addl $0x1, %r9d
callq 0x1d170
movl %eax, -0x144(%rbp)
cmpl $-0x1, -0x144(%rbp)
jne 0x1d2c6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1d8fb
cmpl $0x1, -0x144(%rbp)
jne 0x1d2db
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x30(%rbp), %rsi
leaq -0x140(%rbp), %rdi
movl $0x108, %edx            # imm = 0x108
callq 0x33a0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl -0x34(%rbp), %r9d
addl $0x1, %r9d
leaq -0x140(%rbp), %r8
callq 0x1d170
movl %eax, -0x144(%rbp)
cmpl $-0x1, -0x144(%rbp)
jne 0x1d343
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1d8fb
cmpl $0x0, -0x144(%rbp)
jne 0x1d358
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x1d37e
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x18(%rbp), %rsi
leaq -0x14c(%rbp), %rdi
callq 0x19d20
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x1d3c4
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x18(%rbp), %rsi
leaq -0x14c(%rbp), %rdi
callq 0x19d20
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x14c(%rbp), %edi
callq 0x327e0
cmpl $0x0, %eax
je 0x1d400
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x1d426
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x18(%rbp), %rsi
leaq -0x14c(%rbp), %rdi
callq 0x19d20
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1d462
movl -0x14c(%rbp), %edi
callq 0x327a0
movl %eax, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x1d47d
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x1d4a3
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x18(%rbp), %rsi
leaq -0x14c(%rbp), %rdi
callq 0x19d20
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1d509
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x160(%rbp)
movl -0x14c(%rbp), %edi
callq 0x327a0
movq -0x160(%rbp), %rdi
movl %eax, %esi
callq 0x32830
cmpl $0x0, %eax
jne 0x1d507
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
jmp 0x1d52f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x14c(%rbp), %esi
callq 0x328c0
cmpl $0x0, %eax
jne 0x1d52d
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
jmp 0x1d52f
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x1d555
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x18(%rbp), %rsi
leaq -0x14c(%rbp), %rdi
callq 0x19d20
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1d5bb
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x168(%rbp)
movl -0x14c(%rbp), %edi
callq 0x327a0
movq -0x168(%rbp), %rdi
movl %eax, %esi
callq 0x32830
cmpl $0x0, %eax
je 0x1d5b9
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
jmp 0x1d5e1
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x14c(%rbp), %esi
callq 0x328c0
cmpl $0x0, %eax
je 0x1d5df
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
jmp 0x1d5e1
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
addq $0x8, %rcx
movq -0x10(%rbp), %rdx
movzbl 0x1(%rdx), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x148(%rbp)
movl -0x24(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1d677
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movl -0x148(%rbp), %edx
callq 0x32920
cmpl $0x0, %eax
je 0x1d675
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
jmp 0x1d6b4
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movslq -0x148(%rbp), %rdx
callq 0x3140
cmpl $0x0, %eax
je 0x1d6b2
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
jmp 0x1d6b4
cmpl $0x0, -0x148(%rbp)
jle 0x1d6d1
movl -0x148(%rbp), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x1d708
movl -0x24(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x1d708
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movl -0x24(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1d742
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jbe 0x1d740
movq -0x18(%rbp), %rax
movsbl -0x1(%rax), %edi
callq 0x327e0
cmpl $0x0, %eax
je 0x1d740
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
jmp 0x1d742
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1d76b
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movl -0x24(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1d79a
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x327e0
cmpl $0x0, %eax
je 0x1d798
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
jmp 0x1d79a
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0x169(%rbp)
jbe 0x1d7d1
movq -0x18(%rbp), %rax
movsbl -0x1(%rax), %edi
callq 0x329f0
cmpl $0x0, %eax
setne %al
movb %al, -0x169(%rbp)
movb -0x169(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x148(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x329f0
xorl -0x148(%rbp), %eax
movl %eax, -0x148(%rbp)
cmpl $0x0, -0x148(%rbp)
jne 0x1d80f
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0x16a(%rbp)
jbe 0x1d84b
movq -0x18(%rbp), %rax
movsbl -0x1(%rax), %edi
callq 0x329f0
cmpl $0x0, %eax
setne %al
movb %al, -0x16a(%rbp)
movb -0x16a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x148(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x329f0
xorl -0x148(%rbp), %eax
movl %eax, -0x148(%rbp)
cmpl $0x0, -0x148(%rbp)
je 0x1d886
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq -0x10(%rbp), %rdx
movzbl 0x1(%rdx), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq -0x10(%rbp), %rdx
movzbl 0x1(%rdx), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x10(%rbp)
jmp 0x1d8f6
movl $0x1, -0x4(%rbp)
jmp 0x1d8fb
jmp 0x1d1a9
movl -0x4(%rbp), %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw (%rax,%rax)