// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: reg
static int reg(regex_t *preg, int paren, int *flagp )
{
	int ret;
	int br;
	int ender;
	int parno = 0;
	int flags;

	*flagp = HASWIDTH;


	if (paren) {
		if (preg->regparse[0] == '?' && preg->regparse[1] == ':') {

			preg->regparse += 2;
			parno = -1;
		}
		else {
			parno = ++preg->re_nsub;
		}
		ret = regnode(preg, OPEN+parno);
	} else
		ret = 0;


	br = regbranch(preg, &flags);
	if (br == 0)
		return 0;
	if (ret != 0)
		regtail(preg, ret, br);
	else
		ret = br;
	if (!(flags&HASWIDTH))
		*flagp &= ~HASWIDTH;
	*flagp |= flags&SPSTART;
	while (*preg->regparse == '|') {
		preg->regparse++;
		br = regbranch(preg, &flags);
		if (br == 0)
			return 0;
		regtail(preg, ret, br);
		if (!(flags&HASWIDTH))
			*flagp &= ~HASWIDTH;
		*flagp |= flags&SPSTART;
	}


	ender = regnode(preg, (paren) ? CLOSE+parno : END);
	regtail(preg, ret, ender);


	for (br = ret; br != 0; br = regnext(preg, br))
		regoptail(preg, br, ender);


	if (paren && *preg->regparse++ != ')') {
		preg->err = REG_ERR_UNMATCHED_PAREN;
		return 0;
	} else if (!paren && *preg->regparse != '\0') {
		if (*preg->regparse == ')') {
			preg->err = REG_ERR_UNMATCHED_PAREN;
			return 0;
		} else {
			preg->err = REG_ERR_JUNK_ON_END;
			return 0;
		}
	}

	return(ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
cmpl $0x0, -0x14(%rbp)
je 0x160d9
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x3f, %eax
jne 0x160b4
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x3a, %eax
jne 0x160b4
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x2, %rcx
movq %rcx, 0x28(%rax)
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
jmp 0x160c2
movq -0x10(%rbp), %rcx
movl (%rcx), %eax
addl $0x1, %eax
movl %eax, (%rcx)
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl -0x30(%rbp), %esi
addl $0x3e9, %esi            # imm = 0x3E9
callq 0x33330
movl %eax, -0x24(%rbp)
jmp 0x160e0
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x333a0
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x16102
movl $0x0, -0x4(%rbp)
jmp 0x162b1
cmpl $0x0, -0x24(%rbp)
je 0x16119
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x334a0
jmp 0x1611f
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x34(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x16135
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $-0x2, %ecx
movl %ecx, (%rax)
movl -0x34(%rbp), %ecx
andl $0x4, %ecx
movq -0x20(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x7c, %eax
jne 0x161ba
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x333a0
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x16185
movl $0x0, -0x4(%rbp)
jmp 0x162b1
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x334a0
movl -0x34(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x161aa
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $-0x2, %ecx
movl %ecx, (%rax)
movl -0x34(%rbp), %ecx
andl $0x4, %ecx
movq -0x20(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x16143
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x161d5
movl -0x30(%rbp), %eax
addl $0x7d1, %eax            # imm = 0x7D1
movl %eax, -0x44(%rbp)
jmp 0x161dc
xorl %eax, %eax
movl %eax, -0x44(%rbp)
jmp 0x161dc
movq -0x40(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x33330
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x2c(%rbp), %edx
callq 0x334a0
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x16226
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x2c(%rbp), %edx
callq 0x33520
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x162c0
movl %eax, -0x28(%rbp)
jmp 0x16200
cmpl $0x0, -0x14(%rbp)
je 0x1625b
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x28(%rcx)
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x1625b
movq -0x10(%rbp), %rax
movl $0x8, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x162b1
cmpl $0x0, -0x14(%rbp)
jne 0x162a9
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x162a9
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
jne 0x16295
movq -0x10(%rbp), %rax
movl $0x8, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x162b1
movq -0x10(%rbp), %rax
movl $0xb, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x162b1
jmp 0x162ab
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)