// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/sljit_src/sljitNativeX86_64.c
// Function: sljit_emit_return
int sljit_emit_return(struct sljit_compiler *compiler, int op, int src, long srcw)
{
	int i, tmp, size;
	u_char *inst;

	CHECK_ERROR();
	CHECK(check_sljit_emit_return(compiler, op, src, srcw));

	compiler->flags_saved = 0;
	FAIL_IF(emit_mov_before_return(compiler, op, src, srcw));

#ifdef _WIN64
	/* Restore xmm6 reg: movaps xmm6, [rsp + 0x20] */
	if (compiler->fscratches >= 6 || compiler->fsaveds >= 1) {
		inst = ensure_buf(compiler, 1 + 5);
		FAIL_IF(!inst);
		INC_SIZE(5);
		*inst++ = GROUP_0F;
		*(int*)inst = 0x20247428;
	}
#endif

	SLJIT_ASSERT(compiler->local_size > 0);
	if (compiler->local_size <= 127) {
		inst = ensure_buf(compiler, 1 + 4);
		FAIL_IF(!inst);
		INC_SIZE(4);
		*inst++ = REX_W;
		*inst++ = GROUP_BINARY_83;
		*inst++ = MOD_REG | ADD | 4;
		*inst = compiler->local_size;
	}
	else {
		inst = ensure_buf(compiler, 1 + 7);
		FAIL_IF(!inst);
		INC_SIZE(7);
		*inst++ = REX_W;
		*inst++ = GROUP_BINARY_81;
		*inst++ = MOD_REG | ADD | 4;
		*(int*)inst = compiler->local_size;
	}

	tmp = compiler->scratches;
	for (i = SLJIT_FIRST_SAVED_REG; i <= tmp; i++) {
		size = reg_map[i] >= 8 ? 2 : 1;
		inst = ensure_buf(compiler, 1 + size);
		FAIL_IF(!inst);
		INC_SIZE(size);
		if (reg_map[i] >= 8)
			*inst++ = REX_B;
		POP_REG(reg_lmap[i]);
	}

	tmp = compiler->saveds < SLJIT_NUM_SAVED_REGS ? (SLJIT_S0 + 1 - compiler->saveds) : SLJIT_FIRST_SAVED_REG;
	for (i = tmp; i <= SLJIT_S0; i++) {
		size = reg_map[i] >= 8 ? 2 : 1;
		inst = ensure_buf(compiler, 1 + size);
		FAIL_IF(!inst);
		INC_SIZE(size);
		if (reg_map[i] >= 8)
			*inst++ = REX_B;
		POP_REG(reg_lmap[i]);
	}

	inst = ensure_buf(compiler, 1 + 1);
	FAIL_IF(!inst);
	INC_SIZE(1);
	RET();
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1a7ed
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1abe1
jmp 0x1a7ef
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0x1abf0
movq -0x10(%rbp), %rax
movl $0x0, 0x74(%rax)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0x1b1a0
cmpl $0x0, %eax
je 0x1a833
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1abe1
jmp 0x1a835
jmp 0x1a837
movq -0x10(%rbp), %rax
cmpl $0x0, 0x58(%rax)
jg 0x1a859
leaq 0x15fe0(%rip), %rdi     # 0x30828
movl $0x116, %esi            # imm = 0x116
movb $0x0, %al
callq 0x2070
callq 0x2040
jmp 0x1a85b
movq -0x10(%rbp), %rax
cmpl $0x7f, 0x58(%rax)
jg 0x1a8fe
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x1a330
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1a890
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1abe1
jmp 0x1a892
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x4, (%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x4, %rcx
movq %rcx, 0x60(%rax)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x48, (%rax)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $-0x7d, (%rax)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $-0x3c, (%rax)
movq -0x10(%rbp), %rax
movl 0x58(%rax), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, (%rax)
jmp 0x1a98c
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x1a330
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1a925
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1abe1
jmp 0x1a927
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x7, (%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x7, %rcx
movq %rcx, 0x60(%rax)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x48, (%rax)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $-0x7f, (%rax)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $-0x3c, (%rax)
movq -0x10(%rbp), %rax
movl 0x58(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl 0x48(%rax), %eax
movl %eax, -0x28(%rbp)
movl $0x7, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jg 0x1aa77
movslq -0x24(%rbp), %rcx
leaq 0x15dac(%rip), %rax     # 0x30760
movzbl (%rax,%rcx), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x8, %edx
cmovgel %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x1a330
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1a9f6
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1abe1
jmp 0x1a9f8
movl -0x2c(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movslq -0x2c(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x60(%rax), %rcx
movq %rcx, 0x60(%rax)
movslq -0x24(%rbp), %rcx
leaq 0x15d37(%rip), %rax     # 0x30760
movzbl (%rax,%rcx), %eax
cmpl $0x8, %eax
jl 0x1aa44
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x41, (%rax)
movslq -0x24(%rbp), %rcx
leaq 0x15d31(%rip), %rax     # 0x30780
movzbl (%rax,%rcx), %eax
addl $0x58, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1a99d
movq -0x10(%rbp), %rax
cmpl $0x6, 0x4c(%rax)
jge 0x1aa92
movq -0x10(%rbp), %rcx
movl $0xd, %eax
subl 0x4c(%rcx), %eax
movl %eax, -0x3c(%rbp)
jmp 0x1aa9c
movl $0x7, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1aa9c
movl -0x3c(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0xc, -0x24(%rbp)
jg 0x1ab80
movslq -0x24(%rbp), %rcx
leaq 0x15ca3(%rip), %rax     # 0x30760
movzbl (%rax,%rcx), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x8, %edx
cmovgel %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x1a330
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1aaff
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1abe1
jmp 0x1ab01
movl -0x2c(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movslq -0x2c(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x60(%rax), %rcx
movq %rcx, 0x60(%rax)
movslq -0x24(%rbp), %rcx
leaq 0x15c2e(%rip), %rax     # 0x30760
movzbl (%rax,%rcx), %eax
cmpl $0x8, %eax
jl 0x1ab4d
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x41, (%rax)
movslq -0x24(%rbp), %rcx
leaq 0x15c28(%rip), %rax     # 0x30780
movzbl (%rax,%rcx), %eax
addl $0x58, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1aaa8
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x1a330
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1aba4
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1abe1
jmp 0x1aba6
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x1, (%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x60(%rax)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $-0x3d, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)