// File: /workspace/github_c_makefile_star2_O3/mmcco[P]sljit/regex_src/regexJIT.c
// Function: compile_range_check
static long compile_range_check(struct compiler_common *compiler_common, long ind)
{
	struct sljit_compiler *compiler = compiler_common->compiler;
	struct stack_item *dfa_transitions = compiler_common->dfa_transitions;
	struct sljit_jump **range_jump_list = compiler_common->range_jump_list;
	int invert = dfa_transitions[ind].value;
	struct sljit_label *label;
	long no_states;
	long offset;
	int init_range = 1, prev_value = 0;

	ind++;

	while (dfa_transitions[ind].type != type_rng_end) {
		if (dfa_transitions[ind].type == type_rng_char) {
			EMIT_CMP(*range_jump_list, SLJIT_EQUAL, R_CURR_CHAR, 0, SLJIT_IMM, dfa_transitions[ind].value);
			range_jump_list++;
		}
		else {
			SLJIT_ASSERT(dfa_transitions[ind].type == type_rng_left);
			if (init_range) {
				EMIT_OP1(SLJIT_MOV, R_TEMP, 0, R_CURR_CHAR, 0);
				init_range = 0;
			}
			if (dfa_transitions[ind].value != prev_value) {
				/* Best compatibility to all archs. */
				prev_value -= dfa_transitions[ind].value;
				if (prev_value < 0) {
					EMIT_OP2(SLJIT_SUB, R_TEMP, 0, R_TEMP, 0, SLJIT_IMM, -prev_value);
				}
				else {
					EMIT_OP2(SLJIT_ADD, R_TEMP, 0, R_TEMP, 0, SLJIT_IMM, prev_value);
				}
				prev_value = dfa_transitions[ind].value;
			}
			EMIT_CMP(*range_jump_list, SLJIT_LESS_EQUAL, R_TEMP, 0, SLJIT_IMM, dfa_transitions[ind + 1].value - dfa_transitions[ind].value);
			range_jump_list++;
			ind++;
		}
		ind++;
	}

	*range_jump_list = NULL;

	if (!invert) {
		no_states = compiler_common->no_states;
		offset = TERM_OFFSET_OF(compiler_common->search_states[ind].type, 1);
		EMIT_OP1(SLJIT_MOV, R_TEMP, 0, SLJIT_MEM1(R_CURR_STATE), offset);
		EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_CURR_STATE), offset, SLJIT_IMM, -1);
		CHECK(sljit_emit_ijump(compiler, SLJIT_JUMP, SLJIT_MEM2(R_CURR_STATE, R_TEMP), 0));

		EMIT_LABEL(label);
		range_set_label(compiler_common->range_jump_list, label);
		/* Clears the jump list. */
		*compiler_common->range_jump_list = NULL;
	}
	return ind;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq 0x58(%rdi), %rsi
movq 0x68(%rdi), %rdx
movq %rdi, 0x18(%rsp)
movq 0x78(%rdi), %r13
movl 0x4(%rsi,%r15,8), %eax
movl %eax, 0x24(%rsp)
xorl %ebp, %ebp
movl $0x1, %r14d
movq %rdx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x1(%r15), %rbx
movl 0x8(%rsi,%r15,8), %eax
cmpl $0x7, %eax
je 0x5a7a
cmpl $0x8, %eax
jne 0x5b56
testl %r14d, %r14d
je 0x5a5c
movq %rdx, %rdi
movl $0x20, %esi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
xorl %r9d, %r9d
callq 0x9c63
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movl $0x0, %r12d
testl %eax, %eax
jne 0x5c00
movq %rbp, %rcx
movl %ebp, %eax
subl 0xc(%rsi,%r15,8), %eax
je 0x5afb
js 0x5ab8
movl %eax, %eax
movq %rdx, %rdi
movl $0x60, %esi
jmp 0x5ac2
movslq 0xc(%rsi,%r15,8), %r9
movq %rdx, %rdi
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
movl $0x40, %r8d
callq 0x117ca
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rax, (%r13)
movl $0x0, %r12d
testq %rax, %rax
jne 0x5b4a
jmp 0x5c00
negl %eax
movq %rdx, %rdi
movl $0x62, %esi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x3, %r8d
xorl %r9d, %r9d
pushq %rax
pushq $0x40
callq 0xb023
movq 0x18(%rsp), %rdx
addq $0x10, %rsp
movl $0x0, %r12d
testl %eax, %eax
movq 0x10(%rsp), %rsi
jne 0x5c00
movl 0xc(%rsi,%r15,8), %ecx
movslq 0x14(%rsi,%r15,8), %r9
movq %rcx, %rbp
movslq %ecx, %rax
subq %rax, %r9
xorl %r14d, %r14d
movq %rdx, %rdi
movl $0x5, %esi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x40, %r8d
callq 0x117ca
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rax, (%r13)
movl $0x0, %r12d
testq %rax, %rax
je 0x5c00
addq $0x2, %r15
movq %r15, %rbx
addq $0x8, %r13
movq %rbx, %r15
jmp 0x5a0b
cmpl $0x6, %eax
jne 0x5c60
movq $0x0, (%r13)
cmpl $0x0, 0x24(%rsp)
je 0x5b76
movq %rbx, %r12
jmp 0x5c00
movq 0x18(%rsp), %rcx
movq 0x60(%rcx), %rax
movslq 0x8(%rax,%r15,8), %rax
imulq 0x48(%rcx), %rax
leaq 0x8(,%rax,8), %r15
xorl %r12d, %r12d
movq %rdx, %rdi
movl $0x20, %esi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x8c, %r8d
movq %r15, %r9
callq 0x9c63
movq 0x8(%rsp), %r14
testl %eax, %eax
jne 0x5c00
movq %r14, %rdi
movl $0x20, %esi
movl $0x8c, %edx
movq %r15, %rcx
movl $0x40, %r8d
movq $-0x1, %r9
callq 0x9c63
testl %eax, %eax
je 0x5be5
xorl %r12d, %r12d
jmp 0x5c00
xorl %r12d, %r12d
movq %r14, %rdi
movl $0x16, %esi
movl $0x38c, %edx            # imm = 0x38C
xorl %ecx, %ecx
callq 0x10312
testl %eax, %eax
je 0x5c12
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0xfff6
testq %rax, %rax
je 0x5be0
movq %rax, %r14
movq 0x18(%rsp), %rax
movq 0x78(%rax), %r15
movq (%r15), %rdi
testq %rdi, %rdi
je 0x5c54
addq $0x8, %r15
movq %r14, %rsi
callq 0x78d1
movq (%r15), %rdi
addq $0x8, %r15
testq %rdi, %rdi
jne 0x5c37
movq 0x18(%rsp), %rax
movq 0x78(%rax), %r15
movq $0x0, (%r15)
jmp 0x5b6e
leaq 0xda91(%rip), %rdi      # 0x136f8
movl $0x6d8, %esi            # imm = 0x6D8
xorl %eax, %eax
callq 0x2080
callq 0x2050