// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxRegexp.c
// Function: Reg
static char *
Reg(
Hax_Interp *interp,
int paren,			/* Parenthesized? */
int *flagp)
{
	Interp *iPtr = (Interp *) interp;
	char *ret;
	char *br;
	char *ender;
	int parno = 0;
	int flags;

	*flagp = HASWIDTH;	/* Tentatively. */

	/* Make an OPEN node, if parenthesized. */
	if (paren) {
		if (iPtr->regnpar >= NSUBEXP)
			FAIL((char *) "too many ()");
		parno = iPtr->regnpar;
		iPtr->regnpar++;
		ret = RegNode(interp, OPEN+parno);
	} else
		ret = NULL;

	/* Pick up the branches, linking them together. */
	br = RegBranch(interp, &flags);
	if (br == NULL)
		return(NULL);
	if (ret != NULL)
		RegTail(interp, ret, br);	/* OPEN -> first. */
	else
		ret = br;
	if (!(flags&HASWIDTH))
		*flagp &= ~HASWIDTH;
	*flagp |= flags&SPSTART;
	while (*iPtr->regparse == '|') {
		iPtr->regparse++;
		br = RegBranch(interp, &flags);
		if (br == NULL)
			return(NULL);
		RegTail(interp, ret, br);	/* BRANCH -> BRANCH. */
		if (!(flags&HASWIDTH))
			*flagp &= ~HASWIDTH;
		*flagp |= flags&SPSTART;
	}

	/* Make a closing node, and hook it on the end. */
	ender = RegNode(interp, (paren) ? CLOSE+parno : END);
	RegTail(interp, ret, ender);

	/* Hook the tails of the branches to the closing node. */
	for (br = ret; br != NULL; br = RegNext(interp, br))
		RegOpTail(interp, br, ender);

	/* Check for proper termination. */
	if (paren && *iPtr->regparse++ != ')') {
		FAIL((char *) "unmatched ()");
	} else if (!paren && *iPtr->regparse != '\0') {
		if (*iPtr->regparse == ')') {
			FAIL((char *) "unmatched ()");
		} else
			FAIL((char *) "junk on end");	/* "Can't happen". */
		/* NOTREACHED */
	}

	return(ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
cmpl $0x0, -0x14(%rbp)
je 0x4b36
movq -0x28(%rbp), %rax
cmpl $0xa, 0x2a0(%rax)
jl 0x4afe
jmp 0x4ae1
movq -0x10(%rbp), %rdi
leaq 0x18623(%rip), %rsi     # 0x1d10f
callq 0x4200
movq $0x0, -0x8(%rbp)
jmp 0x4d59
movq -0x28(%rbp), %rax
movl 0x2a0(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
movl 0x2a0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2a0(%rax)
movq -0x10(%rbp), %rdi
movl -0x44(%rbp), %eax
addl $0x14, %eax
movsbl %al, %esi
callq 0x50f0
movq %rax, -0x30(%rbp)
jmp 0x4b3e
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x51b0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x4b63
movq $0x0, -0x8(%rbp)
jmp 0x4d59
cmpq $0x0, -0x30(%rbp)
je 0x4b7d
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x52d0
jmp 0x4b85
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x48(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x4b9b
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $-0x2, %ecx
movl %ecx, (%rax)
movl -0x48(%rbp), %ecx
andl $0x4, %ecx
movq -0x20(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq 0x298(%rax), %rax
movsbl (%rax), %eax
cmpl $0x7c, %eax
jne 0x4c31
movq -0x28(%rbp), %rax
movq 0x298(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x298(%rax)
movq -0x10(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x51b0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x4bf7
movq $0x0, -0x8(%rbp)
jmp 0x4d59
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x52d0
movl -0x48(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x4c1e
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $-0x2, %ecx
movl %ecx, (%rax)
movl -0x48(%rbp), %ecx
andl $0x4, %ecx
movq -0x20(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x4ba9
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x4c4a
movl -0x44(%rbp), %eax
addl $0x1e, %eax
movl %eax, -0x54(%rbp)
jmp 0x4c51
xorl %eax, %eax
movl %eax, -0x54(%rbp)
jmp 0x4c51
movq -0x50(%rbp), %rdi
movl -0x54(%rbp), %eax
movsbl %al, %esi
callq 0x50f0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x52d0
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x4ca8
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x5390
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x4d70
movq %rax, -0x38(%rbp)
jmp 0x4c7d
cmpl $0x0, -0x14(%rbp)
je 0x4ceb
movq -0x28(%rbp), %rcx
movq 0x298(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x298(%rcx)
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x4ceb
jmp 0x4cd1
movq -0x10(%rbp), %rdi
leaq 0x1843f(%rip), %rsi     # 0x1d11b
callq 0x4200
movq $0x0, -0x8(%rbp)
jmp 0x4d59
cmpl $0x0, -0x14(%rbp)
jne 0x4d4f
movq -0x28(%rbp), %rax
movq 0x298(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x4d4f
movq -0x28(%rbp), %rax
movq 0x298(%rax), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
jne 0x4d33
jmp 0x4d19
movq -0x10(%rbp), %rdi
leaq 0x183f7(%rip), %rsi     # 0x1d11b
callq 0x4200
movq $0x0, -0x8(%rbp)
jmp 0x4d59
jmp 0x4d35
movq -0x10(%rbp), %rdi
leaq 0x183e8(%rip), %rsi     # 0x1d128
callq 0x4200
movq $0x0, -0x8(%rbp)
jmp 0x4d59
jmp 0x4d51
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)