// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: regpiece
static int regpiece(regex_t *preg, int *flagp)
{
	int ret;
	char op;
	int next;
	int flags;
	int min;
	int max;

	ret = regatom(preg, &flags);
	if (ret == 0)
		return 0;

	op = *preg->regparse;
	if (!ISMULT(op)) {
		*flagp = flags;
		return(ret);
	}

	if (!(flags&HASWIDTH) && op != '?') {
		preg->err = REG_ERR_OPERAND_COULD_BE_EMPTY;
		return 0;
	}


	if (op == '{') {
		char *end;

		min = strtoul(preg->regparse + 1, &end, 10);
		if (end == preg->regparse + 1) {
			preg->err = REG_ERR_BAD_COUNT;
			return 0;
		}
		if (*end == '}') {
			max = min;
		}
		else if (*end == '\0') {
			preg->err = REG_ERR_UNMATCHED_BRACES;
			return 0;
		}
		else {
			preg->regparse = end;
			max = strtoul(preg->regparse + 1, &end, 10);
			if (*end != '}') {
				preg->err = REG_ERR_UNMATCHED_BRACES;
				return 0;
			}
		}
		if (end == preg->regparse + 1) {
			max = MAX_REP_COUNT;
		}
		else if (max < min || max >= 100) {
			preg->err = REG_ERR_BAD_COUNT;
			return 0;
		}
		if (min >= 100) {
			preg->err = REG_ERR_BAD_COUNT;
			return 0;
		}

		preg->regparse = strchr(preg->regparse, '}');
	}
	else {
		min = (op == '+');
		max = (op == '?' ? 1 : MAX_REP_COUNT);
	}

	if (preg->regparse[1] == '?') {
		preg->regparse++;
		next = reginsert(preg, flags & SIMPLE ? REPMIN : REPXMIN, 5, ret);
	}
	else {
		next = reginsert(preg, flags & SIMPLE ? REP: REPX, 5, ret);
	}
	preg->program[ret + 2] = max;
	preg->program[ret + 3] = min;
	preg->program[ret + 4] = 0;

	*flagp = (min) ? (WORST|HASWIDTH) : (WORST|SPSTART);

	if (!(flags & SIMPLE)) {
		int back = regnode(preg, BACK);
		regtail(preg, back, ret);
		regtail(preg, next, back);
	}

	preg->regparse++;
	if (ISMULT(*preg->regparse)) {
		preg->err = REG_ERR_NESTED_COUNT;
		return 0;
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x33980
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x33602
movl $0x0, -0x4(%rbp)
jmp 0x33973
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movb (%rax), %al
movb %al, -0x1d(%rbp)
movsbl -0x1d(%rbp), %eax
cmpl $0x2a, %eax
je 0x33647
movsbl -0x1d(%rbp), %eax
cmpl $0x2b, %eax
je 0x33647
movsbl -0x1d(%rbp), %eax
cmpl $0x3f, %eax
je 0x33647
movsbl -0x1d(%rbp), %eax
cmpl $0x7b, %eax
je 0x33647
movl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x33973
movl -0x28(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x33672
movsbl -0x1d(%rbp), %eax
cmpl $0x3f, %eax
je 0x33672
movq -0x10(%rbp), %rax
movl $0xc, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x33973
movsbl -0x1d(%rbp), %eax
cmpl $0x7b, %eax
jne 0x337d0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x1, %rdi
leaq -0x38(%rbp), %rsi
movl $0xa, %edx
callq 0x6470
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x336c8
movq -0x10(%rbp), %rax
movl $0xa, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x33973
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7d, %eax
jne 0x336dc
movl -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x3374f
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x336ff
movq -0x10(%rbp), %rax
movl $0x9, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x33973
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
addq $0x1, %rdi
leaq -0x38(%rbp), %rsi
movl $0xa, %edx
callq 0x6470
movl %eax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7d, %eax
je 0x3374b
movq -0x10(%rbp), %rax
movl $0x9, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x33973
jmp 0x3374d
jmp 0x3374f
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x3376d
movl $0xf4240, -0x30(%rbp)   # imm = 0xF4240
jmp 0x33794
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jl 0x3377b
cmpl $0x64, -0x30(%rbp)
jl 0x33792
movq -0x10(%rbp), %rax
movl $0xa, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x33973
jmp 0x33794
cmpl $0x64, -0x2c(%rbp)
jl 0x337b1
movq -0x10(%rbp), %rax
movl $0xa, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x33973
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movl $0x7d, %esi
callq 0x61d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x337f9
movsbl -0x1d(%rbp), %eax
cmpl $0x2b, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
movsbl -0x1d(%rbp), %edx
movl $0xf4240, %eax          # imm = 0xF4240
movl $0x1, %ecx
cmpl $0x3f, %edx
cmovel %ecx, %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x3f, %eax
jne 0x33846
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %ecx
andl $0x2, %ecx
movl $0xd, %esi
movl $0xb, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
movl -0x1c(%rbp), %ecx
movl $0x5, %edx
callq 0x34400
movl %eax, -0x24(%rbp)
jmp 0x33870
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %ecx
andl $0x2, %ecx
movl $0xc, %esi
movl $0xa, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
movl -0x1c(%rbp), %ecx
movl $0x5, %edx
callq 0x34400
movl %eax, -0x24(%rbp)
movl -0x30(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x2c(%rbp), %edx
movl $0x4, %ecx
movl $0x1, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x33909
movq -0x10(%rbp), %rdi
movl $0x7, %esi
callq 0x33330
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x334a0
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x334a0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
je 0x33959
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0x33959
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x3f, %eax
je 0x33959
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x7b, %eax
jne 0x3396d
movq -0x10(%rbp), %rax
movl $0xd, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x33973
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)