// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxRegexp.c
// Function: RegExec
int
RegExec(
Hax_Interp *interp,
regexp *prog,
char *string)
{
	Interp *iPtr = (Interp *) interp;
	char *s;

	/* Be paranoid... */
	if (prog == NULL || string == NULL) {
		RegError(interp, (char *) "NULL parameter");
		return(0);
	}

	/* Check validity of program. */
	if (UCHARAT(prog->program) != MAGIC) {
		RegError(interp, (char *) "corrupted program");
		return(0);
	}

	/* If there is a "must appear" string, look for it. */
	if (prog->regmust != NULL) {
		s = string;
		while ((s = strchr(s, prog->regmust[0])) != NULL) {
			if (strncmp(s, prog->regmust, prog->regmlen) == 0)
				break;	/* Found it. */
			s++;
		}
		if (s == NULL)	/* Not present. */
			return(0);
	}

	/* Mark beginning of line for ^ . */
	iPtr->regbol = string;

	/* Simplest case:  anchored match need be tried only once. */
	if (prog->reganch)
		return(RegTry(interp, prog, string));

	/* Messy cases:  unanchored match. */
	s = string;
	if (prog->regstart != '\0')
		/* We know what char it must start with. */
		while ((s = strchr(s, prog->regstart)) != NULL) {
			if (RegTry(interp, prog, s))
				return(1);
			s++;
		}
	else
		/* We don't -- general case. */
		do {
			if (RegTry(interp, prog, s))
				return(1);
		} while (*s++ != '\0');

	/* Failure. */
	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4e3a
cmpq $0x0, -0x20(%rbp)
jne 0x4e56
movq -0x10(%rbp), %rdi
leaq 0x182a9(%rip), %rsi     # 0x1d0ee
callq 0x4200
movl $0x0, -0x4(%rbp)
jmp 0x4fe3
movq -0x18(%rbp), %rax
movzbl 0xb4(%rax), %eax
cmpl $0x9c, %eax
je 0x4e84
movq -0x10(%rbp), %rdi
leaq 0x1828a(%rip), %rsi     # 0x1d0fd
callq 0x4200
movl $0x0, -0x4(%rbp)
jmp 0x4fe3
movq -0x18(%rbp), %rax
cmpq $0x0, 0xa8(%rax)
je 0x4f04
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0xa8(%rax), %rax
movsbl (%rax), %esi
callq 0x4230
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x4eef
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0xa8(%rax), %rsi
movq -0x18(%rbp), %rax
movslq 0xb0(%rax), %rdx
callq 0x40a0
cmpl $0x0, %eax
jne 0x4ee1
jmp 0x4eef
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x4e9a
cmpq $0x0, -0x30(%rbp)
jne 0x4f02
movl $0x0, -0x4(%rbp)
jmp 0x4fe3
jmp 0x4f04
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x2c0(%rax)
movq -0x18(%rbp), %rax
cmpb $0x0, 0xa1(%rax)
je 0x4f39
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4ff0
movl %eax, -0x4(%rbp)
jmp 0x4fe3
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movsbl 0xa0(%rax), %eax
cmpl $0x0, %eax
je 0x4fa0
jmp 0x4f53
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movsbl 0xa0(%rax), %esi
callq 0x4230
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x4f9e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x4ff0
cmpl $0x0, %eax
je 0x4f90
movl $0x1, -0x4(%rbp)
jmp 0x4fe3
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x4f53
jmp 0x4fdc
jmp 0x4fa2
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x4ff0
cmpl $0x0, %eax
je 0x4fc1
movl $0x1, -0x4(%rbp)
jmp 0x4fe3
jmp 0x4fc3
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x4fa2
jmp 0x4fdc
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)