// File: /workspace/github_c_makefile_star2_O1/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 0x15a23
movq %rdi, %rbx
movl 0x48(%rdi), %eax
testl %eax, %eax
js 0x15a32
movq %rcx, %r14
movl %edx, %r15d
movl %esi, %ebp
testl %esi, %esi
je 0x15594
movl %ebp, %ecx
andl $-0x8, %ecx
cmpl $0x20, %ecx
jne 0x15a4e
movl 0x4c(%rbx), %edx
cmpl $-0x1, %edx
je 0x15583
testl %r15d, %r15d
setg %cl
cmpl %r15d, %eax
setge %sil
testb %sil, %cl
jne 0x1557e
movl $0xc, %ecx
subl %edx, %ecx
cmpl %r15d, %ecx
setge %dl
cmpl $0xd, %r15d
setge %sil
orb %dl, %sil
jne 0x15649
testq %r14, %r14
je 0x155a6
leaq 0xdce5(%rip), %rdi      # 0x2326f
movl $0x3c4, %esi            # imm = 0x3C4
jmp 0x15a68
testl %r15d, %r15d
jne 0x15a5c
testq %r14, %r14
jne 0x15a5c
movq 0x78(%rbx), %rcx
testq %rcx, %rcx
je 0x1583c
testl %ebp, %ebp
je 0x15614
movslq %ebp, %rax
leaq 0x125ef(%rip), %rdx     # 0x27bb0
movq -0x100(%rdx,%rax,8), %rdx
leaq 0xdd94(%rip), %rsi      # 0x23364
movq %rcx, %rdi
xorl %eax, %eax
callq 0x20b0
testb $0x40, %r15b
jne 0x1562f
testb %r15b, %r15b
js 0x1567a
testl %r15d, %r15d
je 0x15730
movq 0x78(%rbx), %rdi
cmpl %r15d, 0x48(%rbx)
jge 0x15761
movl $0xc, %edx
subl %r15d, %edx
leaq 0xdec3(%rip), %rsi      # 0x234d2
jmp 0x1576c
leaq 0xdd3f(%rip), %rdi      # 0x2335a
movl $0x9, %esi
movl $0x1, %edx
callq 0x2120
jmp 0x1583c
movq 0x78(%rbx), %rdi
leaq 0xdd37(%rip), %rsi      # 0x23371
movq %r14, %rdx
xorl %eax, %eax
callq 0x20b0
jmp 0x1582e
cmpl $0x40, %r15d
je 0x155a6
cmpl $0x8d, %r15d
jne 0x156b7
testq %r14, %r14
js 0x15583
movslq 0x80(%rbx), %rax
cmpq %r14, %rax
jg 0x155a6
jmp 0x15583
movl %r15d, %r12d
movq 0x78(%rbx), %rsi
andl $0x3f, %r12d
je 0x1574f
movl $0x5b, %edi
callq 0x20a0
movq 0x78(%rbx), %rdi
cmpl 0x48(%rbx), %r12d
jle 0x15778
movl $0xc, %edx
subl %r12d, %edx
leaq 0xde20(%rip), %rsi      # 0x234d2
jmp 0x15785
testb %r15b, %r15b
jns 0x15583
movl %r15d, %edx
andl $0x3f, %edx
cmpl %eax, %edx
jle 0x156db
cmpl $0xc, %edx
ja 0x15583
cmpl %ecx, %edx
jle 0x15583
testl $0x3f00, %r15d          # imm = 0x3F00
je 0x1571e
testl %edx, %edx
je 0x15583
movl %r15d, %edx
shrl $0x8, %edx
andl $0x3f, %edx
setne %sil
cmpl %eax, %edx
setle %al
testb %al, %sil
jne 0x15714
cmpl $0xc, %edx
ja 0x15583
cmpl %ecx, %edx
jle 0x15583
cmpq $0x4, %r14
jae 0x15583
cmpl $0x4000, %r15d          # imm = 0x4000
jb 0x155a6
jmp 0x15583
movq 0x78(%rbx), %rcx
leaq 0xdc53(%rip), %rdi      # 0x2338e
movl $0x6, %esi
movl $0x1, %edx
callq 0x2120
jmp 0x1582e
leaq 0xdc31(%rip), %rax      # 0x23387
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x1563a
leal -0x1(%r15), %edx
leaq 0xdd61(%rip), %rsi      # 0x234cd
xorl %eax, %eax
callq 0x20b0
jmp 0x1582e
decl %r12d
leaq 0xdd4b(%rip), %rsi      # 0x234cd
movl %r12d, %edx
xorl %eax, %eax
callq 0x20b0
testl $0x3f00, %r15d          # imm = 0x3F00
je 0x157d3
movq 0x78(%rbx), %rcx
leaq 0xdbd6(%rip), %rdi      # 0x23376
movl $0x3, %esi
movl $0x1, %edx
callq 0x2120
movl %r15d, %edx
shrl $0x8, %edx
andl $0x3f, %edx
movq 0x78(%rbx), %rdi
cmpl 0x48(%rbx), %edx
jle 0x157ef
movl $0xc, %eax
subl %edx, %eax
leaq 0xdd03(%rip), %rsi      # 0x234d2
movl %eax, %edx
jmp 0x157f8
testq %r14, %r14
je 0x15820
movq 0x78(%rbx), %rdi
leaq 0xdb9d(%rip), %rsi      # 0x23380
movq %r14, %rdx
xorl %eax, %eax
callq 0x20b0
jmp 0x15820
decl %edx
leaq 0xdcd5(%rip), %rsi      # 0x234cd
xorl %eax, %eax
callq 0x20b0
testq %r14, %r14
je 0x15820
movq 0x78(%rbx), %rdi
movl $0x1, %edx
movl %r14d, %ecx
shll %cl, %edx
leaq 0xdb61(%rip), %rsi      # 0x2337a
xorl %eax, %eax
callq 0x20b0
movq 0x78(%rbx), %rsi
movl $0x5d, %edi
callq 0x20a0
movq 0x78(%rbx), %rsi
movl $0xa, %edi
callq 0x20a0
movl $0x0, 0x74(%rbx)
testl %ebp, %ebp
je 0x15880
cmpl $0x1, %r15d
jne 0x15857
cmpl $0x20, %ebp
je 0x15880
cmpl $0x27, %ebp
je 0x15880
movl $0x1, 0x84(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
movl $0x1, %edx
xorl %ecx, %ecx
movl %r15d, %r8d
movq %r14, %r9
callq 0x16cab
testl %eax, %eax
jne 0x15a21
movl 0x58(%rbx), %eax
testl %eax, %eax
jle 0x15a40
cmpl $0x7f, %eax
jg 0x158c0
movl $0x5, %esi
movq %rbx, %rdi
callq 0x152be
testq %rax, %rax
je 0x15a21
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 0x158ee
movl $0x8, %esi
movq %rbx, %rdi
callq 0x152be
testq %rax, %rax
je 0x15a21
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 0x1596a
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 0x152be
testq %rax, %rax
je 0x15a21
movb %r13b, (%rax)
movl %r13d, %ecx
addq %rcx, 0x60(%rbx)
testb $0x1, %bpl
jne 0x1594a
incq %rax
jmp 0x15952
movb $0x41, 0x1(%rax)
addq $0x2, %rax
leaq 0xd7c7(%rip), %rcx      # 0x23120
movb (%r14,%rcx), %cl
addb $0x58, %cl
movb %cl, (%rax)
incq %r14
cmpq %r14, %r15
jne 0x15907
movl 0x4c(%rbx), %eax
movl $0xd, %edx
subl %eax, %edx
cmpl $0x6, %eax
movl $0x7, %ecx
cmovll %edx, %ecx
cmpl $0xc, %ecx
jg 0x15a00
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 0x152be
testq %rax, %rax
je 0x15a21
movb %r12b, (%rax)
movl %r12d, %ecx
addq %rcx, 0x60(%rbx)
testb $0x1, %r13b
jne 0x159de
incq %rax
jmp 0x159e6
movb $0x41, 0x1(%rax)
addq $0x2, %rax
leaq 0xd733(%rip), %rcx      # 0x23120
movb (%r14,%rcx), %cl
addb $0x58, %cl
movb %cl, (%rax)
incq %r14
incl %ebp
cmpl $0xc, %ebp
jl 0x1599d
movl $0x2, %esi
movq %rbx, %rdi
callq 0x152be
testq %rax, %rax
je 0x15a21
movb $0x1, (%rax)
incq 0x60(%rbx)
movb $-0x3d, 0x1(%rax)
xorl %eax, %eax
jmp 0x15a23
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd836(%rip), %rdi      # 0x2326f
movl $0x3c1, %esi            # imm = 0x3C1
jmp 0x15a68
leaq 0xd7f2(%rip), %rdi      # 0x23239
movl $0x116, %esi            # imm = 0x116
jmp 0x15a68
leaq 0xd81a(%rip), %rdi      # 0x2326f
movl $0x3c3, %esi            # imm = 0x3C3
jmp 0x15a68
leaq 0xd80c(%rip), %rdi      # 0x2326f
movl $0x3c7, %esi            # imm = 0x3C7
xorl %eax, %eax
callq 0x2080
callq 0x2040