// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/regex_src/regexJIT.c
// Function: parse_char_range
static int parse_char_range(const regex_char_t *regex_string, int length, struct compiler_common *compiler_common)
{
	struct stack* stack = &compiler_common->stack;
	const regex_char_t *base_from = regex_string;
	regex_char_t left_char, right_char, tmp_char;

	length--;
	regex_string++;

	if (length == 0)
		return -2;

	if (*regex_string != '^') {
		if (stack_push(stack, type_rng_start, 0))
			return -1;
	}
	else {
		length--;
		regex_string++;

		if (length == 0)
			return -2;

		if (stack_push(stack, type_rng_start, 1))
			return -1;
	}
	/* For both the type_rng_start & type_rng_end. */
	compiler_common->dfa_size += 2;

	/* Range must be at least 1 character. */
	if (*regex_string == ']') {
		length--;
		regex_string++;
		if (stack_push(stack, type_rng_char, ']'))
			return -1;
		compiler_common->dfa_size++;
	}

	while (1) {
		if (length == 0)
			return -2;

		if (*regex_string == ']')
			break;

		if (*regex_string != '\\')
			left_char = *regex_string;
		else {
			regex_string++;
			length--;
			if (length == 0)
				return -2;
			left_char = *regex_string;
		}
		regex_string++;
		length--;

		/* Is a range here? */
		if (length >= 3 && *regex_string == '-' && *(regex_string + 1) != ']') {
			regex_string++;
			length--;

			if (*regex_string != '\\')
				right_char = *regex_string;
			else {
				regex_string++;
				length--;
				if (length == 0)
					return -2;
				right_char = *regex_string;
			}
			regex_string++;
			length--;

			if (left_char > right_char) {
				/* Swap if necessary. */
				tmp_char = left_char;
				left_char = right_char;
				right_char = tmp_char;
			}

			if (stack_push(stack, type_rng_left, left_char))
				return -1;
			if (stack_push(stack, type_rng_right, right_char))
				return -1;
			compiler_common->dfa_size += 2;
		}
		else {
			if (stack_push(stack, type_rng_char, left_char))
				return -1;
			compiler_common->dfa_size++;
		}
	}

	if (stack_push(stack, type_rng_end, 0))
		return -1;
	return regex_string - base_from;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x8f8a
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x925c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5e, %eax
je 0x8fb9
movq -0x28(%rbp), %rdi
movl $0x5, %esi
xorl %edx, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x8fb7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x925c
jmp 0x9006
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x8fe0
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x925c
movq -0x28(%rbp), %rdi
movl $0x5, %esi
movl $0x1, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x9004
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x925c
jmp 0x9006
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rcx
addq $0x2, %rcx
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x906b
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rdi
movl $0x7, %esi
movl $0x5d, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x905b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x925c
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x38(%rax)
jmp 0x906d
cmpl $0x0, -0x14(%rbp)
jne 0x907f
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x925c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x9090
jmp 0x9230
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
je 0x90a7
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x31(%rbp)
jmp 0x90d7
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x90ce
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x925c
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x31(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x3, -0x14(%rbp)
jl 0x91fb
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x91fb
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x5d, %eax
je 0x91fb
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
je 0x9143
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x32(%rbp)
jmp 0x9173
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x916a
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x925c
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x32(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movsbl -0x31(%rbp), %eax
movsbl -0x32(%rbp), %ecx
cmpl %ecx, %eax
jle 0x91a6
movb -0x31(%rbp), %al
movb %al, -0x33(%rbp)
movb -0x32(%rbp), %al
movb %al, -0x31(%rbp)
movb -0x33(%rbp), %al
movb %al, -0x32(%rbp)
movq -0x28(%rbp), %rdi
movsbl -0x31(%rbp), %edx
movl $0x8, %esi
callq 0x8980
cmpl $0x0, %eax
je 0x91c9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x925c
movq -0x28(%rbp), %rdi
movsbl -0x32(%rbp), %edx
movl $0x9, %esi
callq 0x8980
cmpl $0x0, %eax
je 0x91e9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x925c
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rcx
addq $0x2, %rcx
movq %rcx, 0x38(%rax)
jmp 0x922b
movq -0x28(%rbp), %rdi
movsbl -0x31(%rbp), %edx
movl $0x7, %esi
callq 0x8980
cmpl $0x0, %eax
je 0x921b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x925c
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x38(%rax)
jmp 0x906d
movq -0x28(%rbp), %rdi
movl $0x6, %esi
xorl %edx, %edx
callq 0x8980
cmpl $0x0, %eax
je 0x924e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x925c
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)