// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movl %esi, %r13d
movq %rdi, %rbx
movl $0x1, (%rdx)
testl %esi, %esi
je 0x12c62
movq 0x28(%rbx), %rax
cmpb $0x3f, (%rax)
jne 0x12bb5
cmpb $0x3a, 0x1(%rax)
jne 0x12bb5
addq $0x2, %rax
movq %rax, 0x28(%rbx)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x12bbe
movl (%rbx), %r14d
incl %r14d
movl %r14d, (%rbx)
leal 0x3e9(%r14), %r15d
movq %rbx, %rdi
movl $0x2, %esi
callq 0x25d00
movq 0x20(%rbx), %rax
movslq 0x30(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x30(%rbx)
movl %r15d, (%rax,%rcx,4)
movslq 0x30(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x30(%rbx)
movl $0x0, (%rax,%rcx,4)
movl 0x30(%rbx), %r15d
leaq -0x2c(%rbp), %rsi
movq %rbx, %rdi
callq 0x24dd4
testl %eax, %eax
je 0x12e3c
addl $-0x2, %r15d
addl $0x7d1, %r14d           # imm = 0x7D1
testl %r15d, %r15d
movl %r13d, -0x30(%rbp)
je 0x12c82
movq 0x20(%rbx), %rcx
movl %r15d, %r8d
movl %r8d, %esi
movslq %r8d, %rdx
movl (%rcx,%rdx,4), %edi
movl 0x4(%rcx,%rdx,4), %r9d
testl %r9d, %r9d
je 0x12c4d
movl %r9d, %r8d
negl %r8d
cmpl $0x7, %edi
cmovnel %r9d, %r8d
addl %esi, %r8d
jne 0x12c28
movl %esi, %r8d
subl %eax, %r8d
subl %esi, %eax
cmpl $0x7, %edi
cmovel %r8d, %eax
movl %eax, 0x4(%rcx,%rdx,4)
jmp 0x12c85
leaq -0x2c(%rbp), %rsi
movq %rbx, %rdi
callq 0x24dd4
xorl %r14d, %r14d
testl %eax, %eax
je 0x12e3c
movl %eax, %r15d
movl %r13d, -0x30(%rbp)
jmp 0x12c85
movl %eax, %r15d
movl -0x2c(%rbp), %eax
movl (%r12), %ecx
movl %ecx, %edx
andl $-0x2, %edx
testb $0x1, %al
cmovnel %ecx, %edx
andl $0x4, %eax
orl %edx, %eax
movl %eax, (%r12)
movq 0x28(%rbx), %rax
cmpb $0x7c, (%rax)
jne 0x12d2c
leaq -0x2c(%rbp), %r13
incq %rax
movq %rax, 0x28(%rbx)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x24dd4
testl %eax, %eax
je 0x12e3c
movq 0x20(%rbx), %rcx
movl %r15d, %r8d
movl %r8d, %esi
movslq %r8d, %rdx
movl (%rcx,%rdx,4), %edi
movl 0x4(%rcx,%rdx,4), %r9d
testl %r9d, %r9d
je 0x12cf6
movl %r9d, %r8d
negl %r8d
cmpl $0x7, %edi
cmovnel %r9d, %r8d
addl %esi, %r8d
jne 0x12cd1
movl %esi, %r8d
subl %eax, %r8d
subl %esi, %eax
cmpl $0x7, %edi
cmovel %r8d, %eax
movl %eax, 0x4(%rcx,%rdx,4)
movl -0x2c(%rbp), %eax
movl (%r12), %ecx
movl %ecx, %edx
andl $-0x2, %edx
testb $0x1, %al
cmovnel %ecx, %edx
andl $0x4, %eax
orl %edx, %eax
movl %eax, (%r12)
movq 0x28(%rbx), %rax
cmpb $0x7c, (%rax)
je 0x12cb0
movq %rbx, %rdi
movl $0x2, %esi
callq 0x25d00
movq 0x20(%rbx), %rax
movslq 0x30(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x30(%rbx)
movl %r14d, (%rax,%rcx,4)
movslq 0x30(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x30(%rbx)
movl $0x0, (%rax,%rcx,4)
movl 0x30(%rbx), %ecx
addl $-0x2, %ecx
movl %r15d, %r8d
movl %r8d, %edx
movslq %r8d, %rsi
movl (%rax,%rsi,4), %edi
movl 0x4(%rax,%rsi,4), %r9d
testl %r9d, %r9d
je 0x12d8a
movl %r9d, %r8d
negl %r8d
cmpl $0x7, %edi
cmovnel %r9d, %r8d
addl %edx, %r8d
jne 0x12d65
movl %ecx, %r8d
subl %edx, %r8d
subl %ecx, %edx
cmpl $0x7, %edi
cmovnel %r8d, %edx
movl %edx, 0x4(%rax,%rsi,4)
movl %r15d, %r8d
movl -0x30(%rbp), %r11d
movslq %r8d, %rdx
cmpl $0x6, (%rax,%rdx,4)
jne 0x12dec
addl $0x2, %r8d
movl %r8d, %esi
movslq %r8d, %rdi
movl (%rax,%rdi,4), %r9d
movl 0x4(%rax,%rdi,4), %r10d
testl %r10d, %r10d
je 0x12dd8
movl %r10d, %r8d
negl %r8d
cmpl $0x7, %r9d
cmovnel %r10d, %r8d
addl %esi, %r8d
jne 0x12db1
movl %ecx, %r8d
subl %esi, %r8d
subl %ecx, %esi
cmpl $0x7, %r9d
cmovnel %r8d, %esi
movl %esi, 0x4(%rax,%rdi,4)
movl 0x4(%rax,%rdx,4), %esi
testl %esi, %esi
je 0x12e06
movl %esi, %edi
negl %edi
cmpl $0x7, (%rax,%rdx,4)
cmovnel %esi, %edi
addl %edi, %edx
movl %edx, %r8d
jne 0x12da4
movq 0x28(%rbx), %rcx
testl %r11d, %r11d
je 0x12e23
leaq 0x1(%rcx), %rax
movq %rax, 0x28(%rbx)
movl $0x8, %eax
cmpb $0x29, (%rcx)
jne 0x12e39
jmp 0x12e3f
movzbl (%rcx), %ecx
testl %ecx, %ecx
je 0x12e3f
movl $0x8, %eax
cmpl $0x29, %ecx
je 0x12e39
movl $0xb, %eax
movl %eax, 0x8(%rbx)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq