// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/regex_src/regexJIT.c
// Function: regex_begin_match
struct regex_match* regex_begin_match(struct regex_machine *machine)
{
	long *ptr1;
	long *ptr2;
	long *end;
	long *entry_addrs;

	struct regex_match *match = malloc(sizeof(struct regex_match) + (machine->size * 2 - 1) * sizeof(long));
	if (!match)
		return NULL;

	ptr1 = match->states;
	ptr2 = match->states + machine->size;
	end = ptr2;
	entry_addrs = (long*)machine->entry_addrs;

	match->current = ptr1;
	match->next = ptr2;
	match->head = 0;
	match->machine = machine;

	/* Init machine states. */
	switch (machine->no_states) {
	case 2:
		while (ptr1 < end) {
			*ptr1++ = *entry_addrs;
			*ptr2++ = *entry_addrs++;
			*ptr1++ = -1;
			*ptr2++ = -1;
		}
		break;

	case 3:
		while (ptr1 < end) {
			*ptr1++ = *entry_addrs;
			*ptr2++ = *entry_addrs++;
			*ptr1++ = -1;
			*ptr2++ = -1;
			*ptr1++ = 0;
			*ptr2++ = 0;
		}
		break;

	case 4:
		while (ptr1 < end) {
			*ptr1++ = *entry_addrs;
			*ptr2++ = *entry_addrs++;
			*ptr1++ = -1;
			*ptr2++ = -1;
			*ptr1++ = 0;
			*ptr2++ = 0;
			*ptr1++ = 0;
			*ptr2++ = 0;
		}
		break;

	default:
		SLJIT_ASSERT_STOP();
		break;
	}

	SLJIT_ASSERT(ptr1 == end);

	match->u.continue_match = machine->continue_match;

	regex_reset_match(match);
	return match;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
shlq %rdi
subq $0x1, %rdi
shlq $0x3, %rdi
addq $0x60, %rdi
callq 0x20b0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x7e80
movq $0x0, -0x8(%rbp)
jmp 0x817f
movq -0x38(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
leaq 0x58(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
subq $0x2, %rax
je 0x7f1b
jmp 0x7ef8
movq -0x40(%rbp), %rax
subq $0x3, %rax
je 0x7f97
jmp 0x7f08
movq -0x40(%rbp), %rax
subq $0x4, %rax
je 0x8046
jmp 0x811e
jmp 0x7f1d
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x7f92
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0x18(%rbp)
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0x20(%rbp)
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x18(%rbp)
movq $-0x1, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x20(%rbp)
movq $-0x1, (%rax)
jmp 0x7f1d
jmp 0x8138
jmp 0x7f99
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x8041
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0x18(%rbp)
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0x20(%rbp)
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x18(%rbp)
movq $-0x1, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x20(%rbp)
movq $-0x1, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x18(%rbp)
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x20(%rbp)
movq $0x0, (%rax)
jmp 0x7f99
jmp 0x8138
jmp 0x8048
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x811c
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0x18(%rbp)
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0x20(%rbp)
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x18(%rbp)
movq $-0x1, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x20(%rbp)
movq $-0x1, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x18(%rbp)
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x20(%rbp)
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x18(%rbp)
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x20(%rbp)
movq $0x0, (%rax)
jmp 0x8048
jmp 0x8138
jmp 0x8120
leaq 0x1777c(%rip), %rdi     # 0x1f8a3
movl $0x94f, %esi            # imm = 0x94F
movb $0x0, %al
callq 0x2060
callq 0x2040
jmp 0x813a
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x815c
leaq 0x176c5(%rip), %rdi     # 0x1f810
movl $0x953, %esi            # imm = 0x953
movb $0x0, %al
callq 0x2060
callq 0x2040
jmp 0x815e
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x38(%rbp), %rdi
callq 0x8190
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)