// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/regex_src/regexJIT.c
// Function: iterate
static int iterate(struct stack *stack, int min, int max)
{
	struct stack it;
	struct stack_item *item;
	int count = -1;
	int len = 0;
	int depth = 0;

	stack_clone(stack, &it);

	/* Calculate size. */
	while (count < 0) {
		item = stack_pop(&it);
		switch (item->type) {
		case type_id:
		case type_rng_end:
		case type_rng_char:
		case type_rng_left:
		case type_rng_right:
		case type_plus_sign:
		case type_qestion_mark:
			len++;
			break;

		case type_asterisk:
			len += 2;
			break;

		case type_close_br:
			depth++;
			break;

		case type_open_br:
			SLJIT_ASSERT(depth > 0);
			depth--;
			if (depth == 0)
				count = it.count;
			break;

		case type_select:
			SLJIT_ASSERT(depth > 0);
			len += 2;
			break;

		default:
			SLJIT_ASSERT(item->type != type_begin && item->type != type_end);
			if (depth == 0)
				count = it.count;
			len++;
			break;
		}
	}

	if (min == 0 && max == 0) {
		/* {0,0} case, not {0,} case: delete subtree. */
		stack_clone(&it, stack);
		/* and put an empty bracket expression instead of it. */
		if (stack_push(stack, type_open_br, 0))
			return REGEX_MEMORY_ERROR;
		if (stack_push(stack, type_close_br, 0))
			return REGEX_MEMORY_ERROR;
		return len;
	}

	count = stack->count - count;

	/* Put an open bracket before the sequence. */
	if (stack_push_copy(stack, 1, count))
		return -1;

#if (defined SLJIT_DEBUG && SLJIT_DEBUG)
	SLJIT_ASSERT(stack_push(&it, type_open_br, 0) == 0);
#else
	stack_push(&it, type_open_br, 0);
#endif

	/* Copy the data. */
	if (max > 0) {
		len = len * (max - 1);
		max -= min;
		/* Insert ? operators. */
		len += max;

		if (min > 0) {
			min--;
			while (min > 0) {
				if (stack_push_copy(stack, count, count))
					return -1;
				min--;
			}
			if (max > 0) {
				if (stack_push_copy(stack, count, count))
					return -1;
				if (stack_push(stack, type_qestion_mark, 0))
					return REGEX_MEMORY_ERROR;
				count++;
				max--;
			}
		}
		else {
			SLJIT_ASSERT(max > 0);
			max--;
			count++;
			if (stack_push(stack, type_qestion_mark, 0))
				return REGEX_MEMORY_ERROR;
		}

		while (max > 0) {
			if (stack_push_copy(stack, count, count))
				return -1;
			max--;
		}
	}
	else {
		SLJIT_ASSERT(min > 0);
		min--;
		/* Insert + operator. */
		len = len * min + 1;
		while (min > 0) {
			if (stack_push_copy(stack, count, count))
				return -1;
			min--;
		}

		if (stack_push(stack, type_plus_sign, 0))
			return REGEX_MEMORY_ERROR;
	}

	/* Close the opened bracket. */
	if (stack_push(stack, type_close_br, 0))
		return REGEX_MEMORY_ERROR;

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9990
cmpl $0x0, -0x3c(%rbp)
jge 0x96af
leaq -0x30(%rbp), %rdi
callq 0x5b40
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %eax
addl $-0x4, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0xd, %eax
ja 0x9667
movq -0x50(%rbp), %rax
leaq 0x1620a(%rip), %rcx     # 0x1f7d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x96aa
movl -0x40(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x40(%rbp)
jmp 0x96aa
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x96aa
jmp 0x9603
cmpl $0x0, -0x44(%rbp)
jg 0x9621
leaq 0x16200(%rip), %rdi     # 0x1f810
movl $0x1ca, %esi            # imm = 0x1CA
movb $0x0, %al
callq 0x2060
callq 0x2040
jmp 0x9623
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x9638
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x96aa
jmp 0x963c
cmpl $0x0, -0x44(%rbp)
jg 0x965a
leaq 0x161c7(%rip), %rdi     # 0x1f810
movl $0x1d1, %esi            # imm = 0x1D1
movb $0x0, %al
callq 0x2060
callq 0x2040
jmp 0x965c
movl -0x40(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x40(%rbp)
jmp 0x96aa
jmp 0x9669
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
je 0x967b
movq -0x38(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x9693
leaq 0x1618e(%rip), %rdi     # 0x1f810
movl $0x1d6, %esi            # imm = 0x1D6
movb $0x0, %al
callq 0x2060
callq 0x2040
jmp 0x9695
cmpl $0x0, -0x44(%rbp)
jne 0x96a1
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x9594
cmpl $0x0, -0x14(%rbp)
jne 0x9715
cmpl $0x0, -0x18(%rbp)
jne 0x9715
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x9990
movq -0x10(%rbp), %rdi
movl $0xc, %esi
xorl %edx, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x96e9
movl $0x1, -0x4(%rbp)
jmp 0x997a
movq -0x10(%rbp), %rdi
movl $0xd, %esi
xorl %edx, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x970a
movl $0x1, -0x4(%rbp)
jmp 0x997a
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x997a
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
subl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl $0x1, %esi
callq 0x99c0
cmpl $0x0, %eax
je 0x9744
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x997a
jmp 0x9746
leaq -0x30(%rbp), %rdi
movl $0xc, %esi
xorl %edx, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x9773
leaq 0x160ae(%rip), %rdi     # 0x1f810
movl $0x1f0, %esi            # imm = 0x1F0
movb $0x0, %al
callq 0x2060
callq 0x2040
jmp 0x9775
cmpl $0x0, -0x18(%rbp)
jle 0x98d0
movl -0x40(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
imull %ecx, %eax
movl %eax, -0x40(%rbp)
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
addl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0x9841
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0x97e6
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x99c0
cmpl $0x0, %eax
je 0x97db
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x997a
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x97b5
cmpl $0x0, -0x18(%rbp)
jle 0x983f
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x99c0
cmpl $0x0, %eax
je 0x980c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x997a
movq -0x10(%rbp), %rdi
movl $0x11, %esi
xorl %edx, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x982d
movl $0x1, -0x4(%rbp)
jmp 0x997a
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x9898
jmp 0x9843
cmpl $0x0, -0x18(%rbp)
jg 0x9861
leaq 0x15fc0(%rip), %rdi     # 0x1f810
movl $0x20d, %esi            # imm = 0x20D
movb $0x0, %al
callq 0x2060
callq 0x2040
jmp 0x9863
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x11, %esi
xorl %edx, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x9896
movl $0x1, -0x4(%rbp)
jmp 0x997a
jmp 0x9898
jmp 0x989a
cmpl $0x0, -0x18(%rbp)
jle 0x98cb
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x99c0
cmpl $0x0, %eax
je 0x98c0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x997a
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x989a
jmp 0x9956
jmp 0x98d2
cmpl $0x0, -0x14(%rbp)
jg 0x98f0
leaq 0x15f31(%rip), %rdi     # 0x1f810
movl $0x21b, %esi            # imm = 0x21B
movb $0x0, %al
callq 0x2060
callq 0x2040
jmp 0x98f2
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x40(%rbp), %eax
imull -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0x9936
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x99c0
cmpl $0x0, %eax
je 0x992b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x997a
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x9908
movq -0x10(%rbp), %rdi
movl $0x10, %esi
xorl %edx, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x9954
movl $0x1, -0x4(%rbp)
jmp 0x997a
jmp 0x9956
movq -0x10(%rbp), %rdi
movl $0xd, %esi
xorl %edx, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x9974
movl $0x1, -0x4(%rbp)
jmp 0x997a
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)