// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxRegexp.c
// Function: RegMatch
static int			/* 0 failure, 1 success */
RegMatch(
Hax_Interp *interp,
char *prog)
{
	Interp *iPtr = (Interp *) interp;
	char *scan;	/* Current node. */
	char *next;		/* Next node. */

	scan = prog;
#ifdef DEBUG
	if (scan != NULL && regnarrate)
		printf("%s(\n", Regprop(scan));
#endif
	while (scan != NULL) {
#ifdef DEBUG
		if (regnarrate)
			printf("%s...\n", Regprop(scan));
#endif
		next = RegNext(interp, scan);

		switch (OP(scan)) {
		case BOL:
			if (iPtr->reginput != iPtr->regbol)
				return(0);
			break;
		case EOL:
			if (*iPtr->reginput != '\0')
				return(0);
			break;
		case ANY:
			if (*iPtr->reginput == '\0')
				return(0);
			iPtr->reginput++;
			break;
		case EXACTLY: {
				int len;
				char *opnd;

				opnd = OPERAND(scan);
				/* Inline the first character, for speed. */
				if (*opnd != *iPtr->reginput)
					return(0);
				len = strlen(opnd);
				if (len > 1 && strncmp(opnd, iPtr->reginput, len) != 0)
					return(0);
				iPtr->reginput += len;
			}
			break;
		case ANYOF:
 			if (*iPtr->reginput == '\0' || strchr(OPERAND(scan), *iPtr->reginput) == NULL)
				return(0);
			iPtr->reginput++;
			break;
		case ANYBUT:
 			if (*iPtr->reginput == '\0' || strchr(OPERAND(scan), *iPtr->reginput) != NULL)
				return(0);
			iPtr->reginput++;
			break;
		case NOTHING:
			break;
		case BACK:
			break;
		case OPEN+1:
		case OPEN+2:
		case OPEN+3:
		case OPEN+4:
		case OPEN+5:
		case OPEN+6:
		case OPEN+7:
		case OPEN+8:
		case OPEN+9: {
				int no;
				char *save;

				no = OP(scan) - OPEN;
				save = iPtr->reginput;

				if (RegMatch(interp, next)) {
					/*
					 * Don't set startp if some later
					 * invocation of the same parentheses
					 * already has.
					 */
					if (iPtr->regstartp[no] == NULL)
						iPtr->regstartp[no] = save;
					return(1);
				} else
					return(0);
			}
			/* NOTREACHED */
		case CLOSE+1:
		case CLOSE+2:
		case CLOSE+3:
		case CLOSE+4:
		case CLOSE+5:
		case CLOSE+6:
		case CLOSE+7:
		case CLOSE+8:
		case CLOSE+9: {
				int no;
				char *save;

				no = OP(scan) - CLOSE;
				save = iPtr->reginput;

				if (RegMatch(interp, next)) {
					/*
					 * Don't set endp if some later
					 * invocation of the same parentheses
					 * already has.
					 */
					if (iPtr->regendp[no] == NULL)
						iPtr->regendp[no] = save;
					return(1);
				} else
					return(0);
			}
			/* NOTREACHED */
		case BRANCH: {
				char *save;

				if (OP(next) != BRANCH)		/* No choice. */
					next = OPERAND(scan);	/* Avoid recursion. */
				else {
					do {
						save = iPtr->reginput;
						if (RegMatch(interp, OPERAND(scan)))
							return(1);
						iPtr->reginput = save;
						scan = RegNext(interp, scan);
					} while (scan != NULL && OP(scan) == BRANCH);
					return(0);
					/* NOTREACHED */
				}
			}
			/* NOTREACHED */
			break;
		case STAR:
		case PLUS: {
				char nextch;
				int no;
				char *save;
				int min;

				/*
				 * Lookahead to avoid useless match attempts
				 * when we know what character comes next.
				 */
				nextch = '\0';
				if (OP(next) == EXACTLY)
					nextch = *OPERAND(next);
				min = (OP(scan) == STAR) ? 0 : 1;
				save = iPtr->reginput;
				no = RegRepeat(interp, OPERAND(scan));
				while (no >= min) {
					/* If it could work, try it. */
					if (nextch == '\0' || *iPtr->reginput == nextch)
						if (RegMatch(interp, next))
							return(1);
					/* Couldn't or didn't -- back up. */
					no--;
					iPtr->reginput = save + no;
				}
				return(0);
			}
			/* NOTREACHED */
		case END:
			return(1);	/* Success! */
		default:
			RegError(interp, (char *) "memory corruption");
			return(0);
		}

		scan = next;
	}

	/*
	 * We get here only if there's trouble -- normally "case END" is
	 * the terminating point.
	 */
	RegError(interp, (char *) "corrupted pointers");
	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x6316
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4d70
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
movl %eax, %ecx
movq %rcx, -0x88(%rbp)
subl $0x27, %eax
ja 0x62f0
movq -0x88(%rbp), %rax
leaq 0x1714a(%rip), %rcx     # 0x1d000
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x2c0(%rcx), %rax
je 0x5ee3
movl $0x0, -0x4(%rbp)
jmp 0x632d
jmp 0x6309
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x5f07
movl $0x0, -0x4(%rbp)
jmp 0x632d
jmp 0x6309
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x5f2b
movl $0x0, -0x4(%rbp)
jmp 0x632d
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x2b8(%rax)
jmp 0x6309
movq -0x28(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
movq -0x20(%rbp), %rcx
movq 0x2b8(%rcx), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x5f77
movl $0x0, -0x4(%rbp)
jmp 0x632d
movq -0x40(%rbp), %rdi
callq 0x41b0
movl %eax, -0x34(%rbp)
cmpl $0x1, -0x34(%rbp)
jle 0x5fb2
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rsi
movslq -0x34(%rbp), %rdx
callq 0x40a0
cmpl $0x0, %eax
je 0x5fb2
movl $0x0, -0x4(%rbp)
jmp 0x632d
movl -0x34(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rcx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, 0x2b8(%rax)
jmp 0x6309
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x6006
movq -0x28(%rbp), %rdi
addq $0x3, %rdi
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movsbl (%rax), %esi
callq 0x4230
cmpq $0x0, %rax
jne 0x6012
movl $0x0, -0x4(%rbp)
jmp 0x632d
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x2b8(%rax)
jmp 0x6309
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x6061
movq -0x28(%rbp), %rdi
addq $0x3, %rdi
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movsbl (%rax), %esi
callq 0x4230
cmpq $0x0, %rax
je 0x606d
movl $0x0, -0x4(%rbp)
jmp 0x632d
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x2b8(%rax)
jmp 0x6309
jmp 0x6309
jmp 0x6309
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
subl $0x14, %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x5e50
cmpl $0x0, %eax
je 0x60f9
movq -0x20(%rbp), %rax
movq 0x2c8(%rax), %rax
movslq -0x44(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x60ed
movq -0x50(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x2c8(%rax), %rax
movslq -0x44(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x1, -0x4(%rbp)
jmp 0x632d
movl $0x0, -0x4(%rbp)
jmp 0x632d
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
subl $0x1e, %eax
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x5e50
cmpl $0x0, %eax
je 0x616c
movq -0x20(%rbp), %rax
movq 0x2d0(%rax), %rax
movslq -0x54(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x6160
movq -0x60(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x2d0(%rax), %rax
movslq -0x54(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x1, -0x4(%rbp)
jmp 0x632d
movl $0x0, -0x4(%rbp)
jmp 0x632d
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6, %eax
je 0x6195
movq -0x28(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x30(%rbp)
jmp 0x6220
jmp 0x6197
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x3, %rsi
callq 0x5e50
cmpl $0x0, %eax
je 0x61c8
movl $0x1, -0x4(%rbp)
jmp 0x632d
movq -0x68(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x2b8(%rax)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4d70
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0x89(%rbp)
je 0x620a
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6, %eax
sete %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x6197
movl $0x0, -0x4(%rbp)
jmp 0x632d
jmp 0x6309
movb $0x0, -0x69(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x8, %eax
jne 0x623f
movq -0x30(%rbp), %rax
movb 0x3(%rax), %al
movb %al, -0x69(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0xa, %edx
cmovel %ecx, %eax
movl %eax, -0x7c(%rbp)
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x3, %rsi
callq 0x6340
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jl 0x62de
movsbl -0x69(%rbp), %eax
cmpl $0x0, %eax
je 0x62a0
movq -0x20(%rbp), %rax
movq 0x2b8(%rax), %rax
movsbl (%rax), %eax
movsbl -0x69(%rbp), %ecx
cmpl %ecx, %eax
jne 0x62bd
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x5e50
cmpl $0x0, %eax
je 0x62bb
movl $0x1, -0x4(%rbp)
jmp 0x632d
jmp 0x62bd
movl -0x70(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x70(%rbp)
movq -0x78(%rbp), %rcx
movslq -0x70(%rbp), %rax
addq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x2b8(%rax)
jmp 0x6279
movl $0x0, -0x4(%rbp)
jmp 0x632d
movl $0x1, -0x4(%rbp)
jmp 0x632d
movq -0x10(%rbp), %rdi
leaq 0x16ec6(%rip), %rsi     # 0x1d1c1
callq 0x4200
movl $0x0, -0x4(%rbp)
jmp 0x632d
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x5e73
movq -0x10(%rbp), %rdi
leaq 0x16eb2(%rip), %rsi     # 0x1d1d3
callq 0x4200
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)