// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %eax
testl %eax, %eax
jne 0x13c81
movq %rdi, %rbx
movl 0x48(%rdi), %eax
testl %eax, %eax
js 0x13c90
movq %rcx, %r14
movl %edx, %r15d
movl %esi, %r12d
testl %esi, %esi
je 0x1388c
movl %r12d, %ecx
andl $-0x8, %ecx
cmpl $0x20, %ecx
jne 0x13cac
movl 0x4c(%rbx), %edx
cmpl $-0x1, %edx
je 0x13a71
testl %r15d, %r15d
setg %cl
cmpl %r15d, %eax
setge %sil
pushq $0xc
popq %rbp
testb %sil, %cl
jne 0x13821
movl %ebp, %ecx
subl %edx, %ecx
cmpl %r15d, %ecx
setge %dl
cmpl $0xd, %r15d
setge %sil
orb %dl, %sil
jne 0x138dc
testq %r14, %r14
jne 0x13a71
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x13ac9
leal -0x20(%r12), %eax
leaq 0x1636d(%rip), %rcx     # 0x29bb0
movq (%rcx,%rax,8), %rdx
leaq 0xdba6(%rip), %rsi      # 0x213f4
xorl %eax, %eax
callq 0x20c0
testb $0x40, %r15b
jne 0x138c2
testb %r15b, %r15b
js 0x1390d
testl %r15d, %r15d
je 0x139ab
movq 0x78(%rbx), %rdi
cmpl %r15d, 0x48(%rbx)
jge 0x139d8
subl %r15d, %ebp
leaq 0xdcdd(%rip), %rsi      # 0x21562
movl %ebp, %edx
jmp 0x139e3
testl %r15d, %r15d
jne 0x13cba
testq %r14, %r14
jne 0x13cba
movq 0x78(%rbx), %rcx
testq %rcx, %rcx
je 0x138b9
leaq 0xdb3c(%rip), %rdi      # 0x213ea
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
callq 0x2130
andl $0x0, 0x74(%rbx)
jmp 0x13b07
movq 0x78(%rbx), %rdi
leaq 0xdb34(%rip), %rsi      # 0x21401
movq %r14, %rdx
xorl %eax, %eax
callq 0x20c0
jmp 0x13abd
cmpl $0x40, %r15d
je 0x1382a
cmpl $0x8d, %r15d
jne 0x13945
testq %r14, %r14
js 0x13a71
movslq 0x80(%rbx), %rax
cmpq %r14, %rax
jg 0x1382a
jmp 0x13a71
movl %r15d, %r13d
movq 0x78(%rbx), %rsi
andl $0x3f, %r13d
je 0x139c6
pushq $0x5b
popq %rdi
callq 0x20a0
movq 0x78(%rbx), %rdi
cmpl 0x48(%rbx), %r13d
jle 0x139ef
movl %ebp, %edx
subl %r13d, %edx
leaq 0xdc22(%rip), %rsi      # 0x21562
jmp 0x139fc
testb %r15b, %r15b
jns 0x13a71
movl %r15d, %edx
andl $0x3f, %edx
je 0x13a5c
cmpl %eax, %edx
jbe 0x1396f
cmpl $0xc, %edx
ja 0x13a71
cmpl %ecx, %edx
jle 0x13a71
testw $0x3f00, %r15w          # imm = 0x3F00
je 0x13a64
movl %r15d, %edx
shrl $0x8, %edx
andl $0x3f, %edx
leal -0x1(%rdx), %esi
cmpl %eax, %esi
jb 0x1399c
cmpl $0xc, %edx
ja 0x13a71
cmpl %ecx, %edx
jle 0x13a71
cmpq $0x4, %r14
jb 0x13a64
jmp 0x13a71
movq 0x78(%rbx), %rcx
leaq 0xda68(%rip), %rdi      # 0x2141e
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
callq 0x2130
jmp 0x13abd
leaq 0xda4a(%rip), %rax      # 0x21417
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x138cd
leal -0x1(%r15), %edx
leaq 0xdb7a(%rip), %rsi      # 0x2155d
xorl %eax, %eax
callq 0x20c0
jmp 0x13abd
decl %r13d
leaq 0xdb64(%rip), %rsi      # 0x2155d
movl %r13d, %edx
xorl %eax, %eax
callq 0x20c0
testw $0x3f00, %r15w          # imm = 0x3F00
je 0x13a40
movq 0x78(%rbx), %rcx
leaq 0xd9f0(%rip), %rdi      # 0x21406
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
callq 0x2130
movl %r15d, %edx
shrl $0x8, %edx
andl $0x3f, %edx
movq 0x78(%rbx), %rdi
cmpl 0x48(%rbx), %edx
jle 0x13a82
subl %edx, %ebp
leaq 0xdb26(%rip), %rsi      # 0x21562
movl %ebp, %edx
jmp 0x13a8b
testq %r14, %r14
je 0x13ab1
movq 0x78(%rbx), %rdi
leaq 0xd9c0(%rip), %rsi      # 0x21410
movq %r14, %rdx
xorl %eax, %eax
callq 0x20c0
jmp 0x13ab1
testw $0x3f00, %r15w          # imm = 0x3F00
jne 0x13a71
cmpl $0x4000, %r15d          # imm = 0x4000
jb 0x1382a
leaq 0xd887(%rip), %rdi      # 0x212ff
movl $0x3c4, %esi            # imm = 0x3C4
jmp 0x13cc6
decl %edx
leaq 0xdad2(%rip), %rsi      # 0x2155d
xorl %eax, %eax
callq 0x20c0
testq %r14, %r14
je 0x13ab1
movq 0x78(%rbx), %rdi
pushq $0x1
popq %rdx
movl %r14d, %ecx
shll %cl, %edx
leaq 0xd960(%rip), %rsi      # 0x2140a
xorl %eax, %eax
callq 0x20c0
movq 0x78(%rbx), %rsi
pushq $0x5d
popq %rdi
callq 0x20a0
movq 0x78(%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x20a0
andl $0x0, 0x74(%rbx)
cmpl $0x1, %r15d
jne 0x13adf
cmpl $0x20, %r12d
je 0x13b07
cmpl $0x27, %r12d
je 0x13b07
movl $0x1, 0x84(%rbx)
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %r12d, %esi
xorl %ecx, %ecx
movl %r15d, %r8d
movq %r14, %r9
callq 0x14ea5
testl %eax, %eax
jne 0x13c7f
movl 0x58(%rbx), %eax
testl %eax, %eax
jle 0x13c9e
cmpl $0x7f, %eax
ja 0x13b45
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x1354f
testq %rax, %rax
je 0x13c7f
movb $0x4, (%rax)
addq $0x4, 0x60(%rbx)
movw $0x8348, 0x1(%rax)      # imm = 0x8348
movb $-0x3c, 0x3(%rax)
movb 0x58(%rbx), %cl
movb %cl, 0x4(%rax)
jmp 0x13b71
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x1354f
testq %rax, %rax
je 0x13c7f
movb $0x7, (%rax)
addq $0x7, 0x60(%rbx)
movw $0x8148, 0x1(%rax)      # imm = 0x8148
movb $-0x3c, 0x3(%rax)
movl 0x58(%rbx), %ecx
movl %ecx, 0x4(%rax)
movslq 0x48(%rbx), %r12
pushq $0x7
popq %r14
movl $0x10ef0, %r13d         # imm = 0x10EF0
cmpq %r12, %r14
jg 0x13be4
movl $0x10ef0, %ebp          # imm = 0x10EF0
movl %r14d, %ecx
shrq %cl, %rbp
btq %r14, %r13
movl $0x0, %r15d
adcl $0x1, %r15d
leal 0x1(%r15), %esi
movq %rbx, %rdi
callq 0x1354f
testq %rax, %rax
je 0x13c7f
movb %r15b, (%rax)
movl %r15d, %ecx
addq %rcx, 0x60(%rbx)
testb $0x1, %bpl
jne 0x13bc7
incq %rax
jmp 0x13bcf
movb $0x41, 0x1(%rax)
addq $0x2, %rax
leaq 0xd5da(%rip), %rcx      # 0x211b0
movb (%r14,%rcx), %cl
addb $0x58, %cl
movb %cl, (%rax)
incq %r14
jmp 0x13b7f
movl 0x4c(%rbx), %eax
pushq $0xd
popq %rcx
subl %eax, %ecx
cmpl $0x6, %eax
pushq $0x7
popq %r14
cmovll %ecx, %r14d
movl $0x10ef0, %r12d         # imm = 0x10EF0
cmpl $0xc, %r14d
jg 0x13c60
movl $0x10ef0, %r13d         # imm = 0x10EF0
movl %r14d, %ecx
shrq %cl, %r13
btq %r14, %r12
movl $0x0, %r15d
adcl $0x1, %r15d
leal 0x1(%r15), %esi
movq %rbx, %rdi
callq 0x1354f
testq %rax, %rax
je 0x13c7f
movb %r15b, (%rax)
movl %r15d, %ecx
addq %rcx, 0x60(%rbx)
testb $0x1, %r13b
jne 0x13c43
incq %rax
jmp 0x13c4b
movb $0x41, 0x1(%rax)
addq $0x2, %rax
leaq 0xd55e(%rip), %rcx      # 0x211b0
movb (%r14,%rcx), %cl
addb $0x58, %cl
movb %cl, (%rax)
incq %r14
jmp 0x13bfd
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1354f
testq %rax, %rax
je 0x13c7f
movb $0x1, (%rax)
incq 0x60(%rbx)
movb $-0x3d, 0x1(%rax)
xorl %eax, %eax
jmp 0x13c81
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd668(%rip), %rdi      # 0x212ff
movl $0x3c1, %esi            # imm = 0x3C1
jmp 0x13cc6
leaq 0xd624(%rip), %rdi      # 0x212c9
movl $0x116, %esi            # imm = 0x116
jmp 0x13cc6
leaq 0xd64c(%rip), %rdi      # 0x212ff
movl $0x3c3, %esi            # imm = 0x3C3
jmp 0x13cc6
leaq 0xd63e(%rip), %rdi      # 0x212ff
movl $0x3c7, %esi            # imm = 0x3C7
xorl %eax, %eax
callq 0x2080
callq 0x2040