// File: /workspace/github_c_makefile_star2_O3/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 0x1599d
movq %rdi, %rbx
movl 0x48(%rdi), %eax
testl %eax, %eax
js 0x159ac
movq %rcx, %r14
movl %edx, %r15d
movl %esi, %r12d
testl %esi, %esi
je 0x1555d
movl %r12d, %ecx
andl $-0x8, %ecx
cmpl $0x20, %ecx
jne 0x159c8
movl 0x4c(%rbx), %edx
cmpl $-0x1, %edx
je 0x15759
testl %r15d, %r15d
setg %cl
cmpl %r15d, %eax
setge %sil
testb %sil, %cl
jne 0x154ef
movl $0xc, %ecx
subl %edx, %ecx
cmpl %r15d, %ecx
setge %dl
cmpl $0xd, %r15d
setge %sil
orb %dl, %sil
jne 0x155b4
testq %r14, %r14
jne 0x15759
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x157b7
leal -0x20(%r12), %eax
leaq 0x1269f(%rip), %rcx     # 0x27bb0
movq (%rcx,%rax,8), %rdx
leaq 0xdf18(%rip), %rsi      # 0x23434
xorl %eax, %eax
callq 0x20c0
testb $0x40, %r15b
jne 0x1559a
testb %r15b, %r15b
js 0x155e5
testl %r15d, %r15d
je 0x15686
movq 0x78(%rbx), %rdi
cmpl %r15d, 0x48(%rbx)
jge 0x156b7
movl $0xc, %edx
subl %r15d, %edx
leaq 0xe04a(%rip), %rsi      # 0x235a2
jmp 0x156c2
testl %r15d, %r15d
jne 0x159d6
testq %r14, %r14
jne 0x159d6
movq 0x78(%rbx), %rcx
testq %rcx, %rcx
je 0x1558e
leaq 0xdeab(%rip), %rdi      # 0x2342a
movl $0x9, %esi
movl $0x1, %edx
callq 0x2130
movl $0x0, 0x74(%rbx)
jmp 0x157fa
movq 0x78(%rbx), %rdi
leaq 0xde9c(%rip), %rsi      # 0x23441
movq %r14, %rdx
xorl %eax, %eax
callq 0x20c0
jmp 0x157a9
cmpl $0x40, %r15d
je 0x154f8
cmpl $0x8d, %r15d
jne 0x1561f
testq %r14, %r14
js 0x15759
movslq 0x80(%rbx), %rax
cmpq %r14, %rax
jg 0x154f8
jmp 0x15759
movl %r15d, %ebp
movq 0x78(%rbx), %rsi
andl $0x3f, %ebp
je 0x156a5
movl $0x5b, %edi
callq 0x20a0
movq 0x78(%rbx), %rdi
cmpl 0x48(%rbx), %ebp
jle 0x156ce
movl $0xc, %edx
subl %ebp, %edx
leaq 0xdf88(%rip), %rsi      # 0x235a2
jmp 0x156d9
testb %r15b, %r15b
jns 0x15759
movl %r15d, %edx
andl $0x3f, %edx
je 0x15743
cmpl %eax, %edx
jbe 0x15649
cmpl $0xc, %edx
ja 0x15759
cmpl %ecx, %edx
jle 0x15759
testl $0x3f00, %r15d          # imm = 0x3F00
je 0x1574c
movl %r15d, %edx
shrl $0x8, %edx
andl $0x3f, %edx
leal -0x1(%rdx), %esi
cmpl %eax, %esi
jb 0x15677
cmpl $0xc, %edx
ja 0x15759
cmpl %ecx, %edx
jle 0x15759
cmpq $0x4, %r14
jb 0x1574c
jmp 0x15759
movq 0x78(%rbx), %rcx
leaq 0xddcd(%rip), %rdi      # 0x2345e
movl $0x6, %esi
movl $0x1, %edx
callq 0x2130
jmp 0x157a9
leaq 0xddab(%rip), %rax      # 0x23457
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x155a5
leal -0x1(%r15), %edx
leaq 0xdedb(%rip), %rsi      # 0x2359d
xorl %eax, %eax
callq 0x20c0
jmp 0x157a9
decl %ebp
leaq 0xdec6(%rip), %rsi      # 0x2359d
movl %ebp, %edx
xorl %eax, %eax
callq 0x20c0
testl $0x3f00, %r15d          # imm = 0x3F00
je 0x15727
movq 0x78(%rbx), %rcx
leaq 0xdd52(%rip), %rdi      # 0x23446
movl $0x3, %esi
movl $0x1, %edx
callq 0x2130
movl %r15d, %edx
shrl $0x8, %edx
andl $0x3f, %edx
movq 0x78(%rbx), %rdi
cmpl 0x48(%rbx), %edx
jle 0x1576a
movl $0xc, %eax
subl %edx, %eax
leaq 0xde7f(%rip), %rsi      # 0x235a2
movl %eax, %edx
jmp 0x15773
testq %r14, %r14
je 0x1579b
movq 0x78(%rbx), %rdi
leaq 0xdd19(%rip), %rsi      # 0x23450
movq %r14, %rdx
xorl %eax, %eax
callq 0x20c0
jmp 0x1579b
testl $0x3f00, %r15d          # imm = 0x3F00
jne 0x15759
cmpl $0x4000, %r15d          # imm = 0x4000
jb 0x154f8
leaq 0xdbdf(%rip), %rdi      # 0x2333f
movl $0x3c4, %esi            # imm = 0x3C4
jmp 0x159e2
decl %edx
leaq 0xde2a(%rip), %rsi      # 0x2359d
xorl %eax, %eax
callq 0x20c0
testq %r14, %r14
je 0x1579b
movq 0x78(%rbx), %rdi
movl $0x1, %edx
movl %r14d, %ecx
shll %cl, %edx
leaq 0xdcb6(%rip), %rsi      # 0x2344a
xorl %eax, %eax
callq 0x20c0
movq 0x78(%rbx), %rsi
movl $0x5d, %edi
callq 0x20a0
movq 0x78(%rbx), %rsi
movl $0xa, %edi
callq 0x20a0
movl $0x0, 0x74(%rbx)
cmpl $0x1, %r15d
jne 0x157d0
cmpl $0x20, %r12d
je 0x157fa
cmpl $0x27, %r12d
je 0x157fa
movl $0x1, 0x84(%rbx)
movq %rbx, %rdi
movl %r12d, %esi
movl $0x1, %edx
xorl %ecx, %ecx
movl %r15d, %r8d
movq %r14, %r9
callq 0x16c8b
testl %eax, %eax
jne 0x1599b
movl 0x58(%rbx), %eax
testl %eax, %eax
jle 0x159ba
cmpl $0x7f, %eax
ja 0x1583a
movl $0x5, %esi
movq %rbx, %rdi
callq 0x15218
testq %rax, %rax
je 0x1599b
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 0x15868
movl $0x8, %esi
movq %rbx, %rdi
callq 0x15218
testq %rax, %rax
je 0x1599b
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)
movl 0x48(%rbx), %r15d
cmpl $0x7, %r15d
jl 0x158e4
incq %r15
movl $0x7, %r14d
movl $0x10ef0, %r12d         # imm = 0x10EF0
movl $0x10ef0, %ebp          # imm = 0x10EF0
movl %r14d, %ecx
shrq %cl, %rbp
btq %r14, %r12
movl $0x0, %r13d
adcl $0x1, %r13d
leal 0x1(%r13), %esi
movq %rbx, %rdi
callq 0x15218
testq %rax, %rax
je 0x1599b
movb %r13b, (%rax)
movl %r13d, %ecx
addq %rcx, 0x60(%rbx)
testb $0x1, %bpl
jne 0x158c4
incq %rax
jmp 0x158cc
movb $0x41, 0x1(%rax)
addq $0x2, %rax
leaq 0xd91d(%rip), %rcx      # 0x231f0
movb (%r14,%rcx), %cl
addb $0x58, %cl
movb %cl, (%rax)
incq %r14
cmpq %r14, %r15
jne 0x15881
movl 0x4c(%rbx), %eax
movl $0xd, %edx
subl %eax, %edx
cmpl $0x6, %eax
movl $0x7, %ecx
cmovll %edx, %ecx
cmpl $0xc, %ecx
jg 0x1597a
movl %ecx, %r14d
cmpl $0x7, %eax
movl $0x6, %ebp
cmovgel %eax, %ebp
subl %eax, %ebp
addl $0x6, %ebp
movl $0x10ef0, %r15d         # imm = 0x10EF0
movl $0x10ef0, %r13d         # imm = 0x10EF0
movl %r14d, %ecx
shrq %cl, %r13
btq %r14, %r15
movl $0x0, %r12d
adcl $0x1, %r12d
leal 0x1(%r12), %esi
movq %rbx, %rdi
callq 0x15218
testq %rax, %rax
je 0x1599b
movb %r12b, (%rax)
movl %r12d, %ecx
addq %rcx, 0x60(%rbx)
testb $0x1, %r13b
jne 0x15958
incq %rax
jmp 0x15960
movb $0x41, 0x1(%rax)
addq $0x2, %rax
leaq 0xd889(%rip), %rcx      # 0x231f0
movb (%r14,%rcx), %cl
addb $0x58, %cl
movb %cl, (%rax)
incq %r14
incl %ebp
cmpl $0xc, %ebp
jl 0x15917
movl $0x2, %esi
movq %rbx, %rdi
callq 0x15218
testq %rax, %rax
je 0x1599b
movb $0x1, (%rax)
incq 0x60(%rbx)
movb $-0x3d, 0x1(%rax)
xorl %eax, %eax
jmp 0x1599d
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd98c(%rip), %rdi      # 0x2333f
movl $0x3c1, %esi            # imm = 0x3C1
jmp 0x159e2
leaq 0xd948(%rip), %rdi      # 0x23309
movl $0x116, %esi            # imm = 0x116
jmp 0x159e2
leaq 0xd970(%rip), %rdi      # 0x2333f
movl $0x3c3, %esi            # imm = 0x3C3
jmp 0x159e2
leaq 0xd962(%rip), %rdi      # 0x2333f
movl $0x3c7, %esi            # imm = 0x3C7
xorl %eax, %eax
callq 0x2080
callq 0x2040