// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/test_src/sljitTest.c
// Function: test21
static void test21(void)
{
	/* Test fake enter. The parts of the jit code can be separated in the memory. */
	executable_code code1;
	executable_code code2;
	struct sljit_compiler* compiler = sljit_create_compiler();
	struct sljit_jump* jump;
	unsigned long addr;
	long buf[4];

	if (verbose)
		printf("Run test21\n");

	FAILED(!compiler, "cannot create compiler\n");
	buf[0] = 9;
	buf[1] = -6;
	buf[2] = 0;
	buf[3] = 0;

	sljit_emit_enter(compiler, 0, 1, 3, 2, 0, 0, 2 * sizeof(long));

	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), 0, SLJIT_IMM, 10);
	sljit_emit_op2(compiler, SLJIT_ADD, SLJIT_MEM1(SLJIT_SP), sizeof(long), SLJIT_MEM1(SLJIT_S0), 0, SLJIT_MEM1(SLJIT_SP), 0);
	jump = sljit_emit_jump(compiler, SLJIT_JUMP | SLJIT_REWRITABLE_JUMP);
	sljit_set_target(jump, 0);

	code1.code = sljit_generate_code(compiler);
	CHECK(compiler);
	addr = sljit_get_jump_addr(jump);
	sljit_free_compiler(compiler);

	compiler = sljit_create_compiler();
	FAILED(!compiler, "cannot create compiler\n");

	/* Other part of the jit code. */
	sljit_set_context(compiler, 0, 1, 3, 2, 0, 0, 2 * sizeof(long));

	sljit_emit_op2(compiler, SLJIT_SUB, SLJIT_MEM1(SLJIT_S0), sizeof(long) * 2, SLJIT_MEM1(SLJIT_S0), sizeof(long), SLJIT_MEM1(SLJIT_SP), 0);
	sljit_emit_op2(compiler, SLJIT_MUL, SLJIT_MEM1(SLJIT_S0), sizeof(long) * 3, SLJIT_MEM1(SLJIT_SP), 0, SLJIT_MEM1(SLJIT_SP), 0);
	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_MEM1(SLJIT_SP), sizeof(long));

	sljit_emit_return(compiler, SLJIT_MOV, SLJIT_RETURN_REG, 0);

	code2.code = sljit_generate_code(compiler);
	CHECK(compiler);
	sljit_free_compiler(compiler);

	sljit_set_jump_addr(addr, SLJIT_FUNC_OFFSET(code2.code));

	FAILED(code1.func1((long)&buf) != 19, "test21 case 1 failed\n");
	FAILED(buf[2] != -16, "test21 case 2 failed\n");
	FAILED(buf[3] != 100, "test21 case 3 failed\n");

	sljit_free_code(code1.code);
	sljit_free_code(code2.code);
	successful_tests++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
callq 0x18ba0
movq %rax, -0x18(%rbp)
cmpl $0x0, 0x2ae5c(%rip)     # 0x34354
je 0x9508
leaq 0x24cf9(%rip), %rdi     # 0x2e1fa
movb $0x0, %al
callq 0x2070
cmpq $0x0, -0x18(%rbp)
jne 0x9522
leaq 0x23ebd(%rip), %rdi     # 0x2d3d3
movb $0x0, %al
callq 0x2070
jmp 0x97f6
movq $0x9, -0x50(%rbp)
movq $-0x6, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rdi
xorl %r9d, %r9d
movl $0x1, %edx
movl $0x3, %ecx
movl $0x2, %r8d
movl %r9d, %esi
movl $0x0, (%rsp)
movl $0x10, 0x8(%rsp)
callq 0x19b20
movq -0x18(%rbp), %rdi
movl $0x20, %esi
movl $0x8d, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r8d
movl $0xa, %r9d
callq 0x1d3d0
movq -0x18(%rbp), %rdi
movl $0x60, %esi
movl $0x8d, %edx
movl $0x8, %ecx
movl $0x8c, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x8d, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x1f8d0
movq -0x18(%rbp), %rdi
movl $0x1016, %esi           # imm = 0x1016
callq 0x283d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x18e80
movq -0x18(%rbp), %rdi
callq 0x19070
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x18030
cmpl $0x1, %eax
je 0x9627
movq -0x18(%rbp), %rdi
callq 0x18030
movl %eax, %esi
leaq 0x23e06(%rip), %rdi     # 0x2d418
movb $0x0, %al
callq 0x2070
movq -0x18(%rbp), %rdi
callq 0x18d90
jmp 0x97f6
movq -0x20(%rbp), %rdi
callq 0x18060
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x18d90
callq 0x18ba0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x9660
leaq 0x23d7f(%rip), %rdi     # 0x2d3d3
movb $0x0, %al
callq 0x2070
jmp 0x97f6
movq -0x18(%rbp), %rdi
xorl %r9d, %r9d
movl $0x1, %edx
movl $0x3, %ecx
movl $0x2, %r8d
movl %r9d, %esi
movl $0x0, (%rsp)
movl $0x10, 0x8(%rsp)
callq 0x1a430
movq -0x18(%rbp), %rdi
movl $0x62, %esi
movl $0x8c, %r8d
movl $0x10, %ecx
movl $0x8, %r9d
xorl %eax, %eax
movl %r8d, %edx
movl $0x8d, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x1f8d0
movq -0x18(%rbp), %rdi
movl $0x64, %esi
movl $0x8c, %edx
movl $0x18, %ecx
movl $0x8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x8d, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x1f8d0
movq -0x18(%rbp), %rdi
movl $0x20, %esi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x8d, %r8d
movl $0x8, %r9d
callq 0x1d3d0
movq -0x18(%rbp), %rdi
movl $0x20, %esi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1a7c0
movq -0x18(%rbp), %rdi
callq 0x19070
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rdi
callq 0x18030
cmpl $0x1, %eax
je 0x9771
movq -0x18(%rbp), %rdi
callq 0x18030
movl %eax, %esi
leaq 0x23cbc(%rip), %rdi     # 0x2d418
movb $0x0, %al
callq 0x2070
movq -0x18(%rbp), %rdi
callq 0x18d90
jmp 0x97f6
movq -0x18(%rbp), %rdi
callq 0x18d90
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2ac40
movq -0x8(%rbp), %rax
leaq -0x50(%rbp), %rdi
callq *%rax
cmpq $0x13, %rax
je 0x97a7
leaq 0x24a68(%rip), %rdi     # 0x2e206
movb $0x0, %al
callq 0x2070
jmp 0x97f6
cmpq $-0x10, -0x40(%rbp)
je 0x97be
leaq 0x24a67(%rip), %rdi     # 0x2e21c
movb $0x0, %al
callq 0x2070
jmp 0x97f6
cmpq $0x64, -0x38(%rbp)
je 0x97d5
leaq 0x24a66(%rip), %rdi     # 0x2e232
movb $0x0, %al
callq 0x2070
jmp 0x97f6
movq -0x8(%rbp), %rdi
callq 0x18e10
movq -0x10(%rbp), %rdi
callq 0x18e10
movl 0x2ab6f(%rip), %eax     # 0x3435c
addl $0x1, %eax
movl %eax, 0x2ab66(%rip)     # 0x3435c
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)