// File: /workspace/github_c_makefile_star2_O1/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)
movl $0x0, %r14d
movl $0x0, %r15d
testl %esi, %esi
je 0x12fb6
movq 0x28(%rbx), %rax
cmpb $0x3f, (%rax)
jne 0x12f67
cmpb $0x3a, 0x1(%rax)
jne 0x12f67
addq $0x2, %rax
movq %rax, 0x28(%rbx)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x12f70
movl (%rbx), %r14d
incl %r14d
movl %r14d, (%rbx)
leal 0x3e9(%r14), %r15d
movq %rbx, %rdi
movl $0x2, %esi
callq 0x265ee
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
addl $-0x2, %r15d
addl $0x7d1, %r14d           # imm = 0x7D1
leaq -0x2c(%rbp), %rsi
movq %rbx, %rdi
callq 0x255d8
testl %eax, %eax
je 0x131d3
testl %r15d, %r15d
je 0x13013
movq 0x20(%rbx), %rcx
movl %r15d, %edi
movl %edi, %esi
movslq %edi, %rdx
movl 0x4(%rcx,%rdx,4), %r8d
testl %r8d, %r8d
je 0x12ff2
cmpl $0x7, (%rcx,%rdx,4)
jne 0x12ff6
movl %esi, %edi
subl %r8d, %edi
jmp 0x12ffc
xorl %edi, %edi
jmp 0x12ffc
addl %esi, %r8d
movl %r8d, %edi
testl %edi, %edi
jne 0x12fd6
movl %esi, %edi
subl %eax, %edi
subl %esi, %eax
cmpl $0x7, (%rcx,%rdx,4)
cmovel %edi, %eax
movl %eax, 0x4(%rcx,%rdx,4)
jmp 0x13016
movl %eax, %r15d
movl %r13d, -0x30(%rbp)
movl -0x2c(%rbp), %eax
testb $0x1, %al
jne 0x13026
andb $-0x2, (%r12)
andl $0x4, %eax
orl %eax, (%r12)
movq 0x28(%rbx), %rax
cmpb $0x7c, (%rax)
jne 0x130b2
leaq -0x2c(%rbp), %r13
incq %rax
movq %rax, 0x28(%rbx)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x255d8
testl %eax, %eax
je 0x131d3
movq 0x20(%rbx), %rcx
movl %r15d, %edi
movl %edi, %esi
movslq %edi, %rdx
movl 0x4(%rcx,%rdx,4), %r8d
testl %r8d, %r8d
je 0x13077
cmpl $0x7, (%rcx,%rdx,4)
jne 0x1307b
movl %esi, %edi
subl %r8d, %edi
jmp 0x13081
xorl %edi, %edi
jmp 0x13081
addl %esi, %r8d
movl %r8d, %edi
testl %edi, %edi
jne 0x1305b
movl %esi, %edi
subl %eax, %edi
subl %esi, %eax
cmpl $0x7, (%rcx,%rdx,4)
cmovel %edi, %eax
movl %eax, 0x4(%rcx,%rdx,4)
movl -0x2c(%rbp), %eax
testb $0x1, %al
jne 0x130a2
andb $-0x2, (%r12)
andl $0x4, %eax
orl %eax, (%r12)
movq 0x28(%rbx), %rax
cmpb $0x7c, (%rax)
je 0x1303a
movq %rbx, %rdi
movl $0x2, %esi
callq 0x265ee
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
movl %r15d, %edi
movl -0x30(%rbp), %r11d
movl %edi, %edx
movslq %edi, %rsi
movl 0x4(%rax,%rsi,4), %r8d
testl %r8d, %r8d
je 0x13108
cmpl $0x7, (%rax,%rsi,4)
jne 0x1310c
movl %edx, %edi
subl %r8d, %edi
jmp 0x13112
xorl %edi, %edi
jmp 0x13112
addl %edx, %r8d
movl %r8d, %edi
testl %edi, %edi
jne 0x130ec
addl $-0x2, %ecx
movl %ecx, %edi
subl %edx, %edi
subl %ecx, %edx
cmpl $0x7, (%rax,%rsi,4)
cmovnel %edi, %edx
movl %edx, 0x4(%rax,%rsi,4)
movl %r15d, %edx
movslq %edx, %rsi
cmpl $0x6, (%rax,%rsi,4)
jne 0x1317f
leal 0x2(%rdx), %r9d
movl %r9d, %edi
movslq %r9d, %r8
movl 0x4(%rax,%r8,4), %r10d
testl %r10d, %r10d
je 0x13159
cmpl $0x7, (%rax,%r8,4)
jne 0x1315e
movl %edi, %r9d
subl %r10d, %r9d
jmp 0x13164
xorl %r9d, %r9d
jmp 0x13164
addl %edi, %r10d
movl %r10d, %r9d
testl %r9d, %r9d
jne 0x1313a
movl %ecx, %r9d
subl %edi, %r9d
subl %ecx, %edi
cmpl $0x7, (%rax,%r8,4)
cmovnel %r9d, %edi
movl %edi, 0x4(%rax,%r8,4)
movl 0x4(%rax,%rsi,4), %edi
testl %edi, %edi
je 0x13191
cmpl $0x7, (%rax,%rsi,4)
jne 0x13195
subl %edi, %edx
jmp 0x13199
xorl %edx, %edx
jmp 0x13199
addl %edx, %edi
movl %edi, %edx
testl %edx, %edx
jne 0x1312d
movq 0x28(%rbx), %rcx
testl %r11d, %r11d
je 0x131ba
leaq 0x1(%rcx), %rax
movq %rax, 0x28(%rbx)
movl $0x8, %eax
cmpb $0x29, (%rcx)
jne 0x131d0
jmp 0x131d6
movzbl (%rcx), %ecx
testl %ecx, %ecx
je 0x131d6
movl $0x8, %eax
cmpl $0x29, %ecx
je 0x131d0
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