// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/regex_src/regexJIT.c
// Function: regex_get_result
int regex_get_result(struct regex_match *match, int *end, int *id)
{
	int flags = match->machine->flags;
	long no_states;

	*end = match->best_end;
	*id = match->best_id;
	if (!(flags & (REGEX_MATCH_END | REGEX_FAKE_MATCH_END)))
		return match->best_begin;

	if (flags & REGEX_FAKE_MATCH_END) {
		SLJIT_ASSERT(!(flags & (REGEX_MATCH_BEGIN | REGEX_MATCH_END)));
		if (match->best_begin != -1)
			return match->best_begin;

		no_states = match->machine->no_states;
		if (match->current[no_states + 1] == -1)
			return -1;
		if (flags & REGEX_ID_CHECK)
			*id = match->current[no_states + 3];
		if (!(flags & REGEX_FAKE_MATCH_BEGIN))
			*end = match->index - 1;
		else
			*end = match->index - 2;
		return match->current[no_states + 2];
	}
	else {
		/* Check the status of the last code. */
		if (!(flags & REGEX_MATCH_BEGIN)) {
			/* No shortcut in this case. */
			if (!(flags & REGEX_ID_CHECK)) {
				if (match->current[1] == -1)
					return -1;
				*end = match->index - 1;
				return match->current[2];
			}

			if (match->current[1] == -1)
				return -1;
			*end = match->index - 1;
			*id = match->current[3];
			return match->current[2];
		}

		/* Shortcut is possible in this case. */
		if (!(flags & REGEX_ID_CHECK)) {
			if (match->current[1] == -1 || match->head == -1)
				return -1;
			*end = match->index - 1;
			return 0;
		}

		if (match->current[1] == -1 || match->head == -1)
			return -1;
		*end = match->index - 1;
		*id = match->current[2];
		return 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x24(%rbp), %eax
andl $0x402, %eax            # imm = 0x402
cmpl $0x0, %eax
jne 0x82fe
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, -0x4(%rbp)
jmp 0x8541
movl -0x24(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x83f4
jmp 0x8311
movl -0x24(%rbp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x8334
leaq 0x174ed(%rip), %rdi     # 0x1f810
movl $0x987, %esi            # imm = 0x987
movb $0x0, %al
callq 0x2060
callq 0x2040
jmp 0x8336
movq -0x10(%rbp), %rax
cmpq $-0x1, 0x20(%rax)
je 0x8351
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, -0x4(%rbp)
jmp 0x8541
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq $-0x1, 0x8(%rax,%rcx,8)
jne 0x8380
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8541
movl -0x24(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x83a5
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x24(%rbp), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x83c8
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x83dc
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x2, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rax
movl %eax, -0x4(%rbp)
jmp 0x8541
movl -0x24(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x84a5
movl -0x24(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x8451
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq $-0x1, 0x8(%rax)
jne 0x842a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8541
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl %eax, -0x4(%rbp)
jmp 0x8541
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq $-0x1, 0x8(%rax)
jne 0x846b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8541
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl %eax, -0x4(%rbp)
jmp 0x8541
movl -0x24(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x84f1
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq $-0x1, 0x8(%rax)
je 0x84cb
movq -0x10(%rbp), %rax
cmpq $-0x1, 0x10(%rax)
jne 0x84d4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8541
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x8541
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq $-0x1, 0x8(%rax)
je 0x850a
movq -0x10(%rbp), %rax
cmpq $-0x1, 0x10(%rax)
jne 0x8513
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8541
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)