// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/test_src/sljitTest.c
// Function: test12
static void test12(void)
{
	/* Test rewriteable jumps. */
	executable_code code;
	struct sljit_compiler* compiler = sljit_create_compiler();
	struct sljit_label *label1;
	struct sljit_label *label2;
	struct sljit_label *label3;
	struct sljit_jump *jump1;
	struct sljit_jump *jump2;
	struct sljit_jump *jump3;
	void* value;
	unsigned long jump1_addr;
	unsigned long label1_addr;
	unsigned long label2_addr;
	long buf[1];

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

	FAILED(!compiler, "cannot create compiler\n");
	buf[0] = 0;

	sljit_emit_enter(compiler, 0, 2, 3, 2, 0, 0, 0);
	sljit_emit_op2(compiler, SLJIT_SUB | SLJIT_SET_S, SLJIT_UNUSED, 0, SLJIT_S1, 0, SLJIT_IMM, 10);
	jump1 = sljit_emit_jump(compiler, SLJIT_REWRITABLE_JUMP | SLJIT_SIG_GREATER);
	/* Default handler. */
	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_MEM1(SLJIT_S0), 0, SLJIT_IMM, 5);
	jump2 = sljit_emit_jump(compiler, SLJIT_JUMP);
	value = sljit_alloc_memory(compiler, 15);
	SLJIT_ASSERT(!((long)value & (sizeof(long) - 1)));
	memset(value, 255, 15);
	/* Handler 1. */
	label1 = sljit_emit_label(compiler);
	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_MEM1(SLJIT_S0), 0, SLJIT_IMM, 6);
	jump3 = sljit_emit_jump(compiler, SLJIT_JUMP);
	/* Handler 2. */
	label2 = sljit_emit_label(compiler);
	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_MEM1(SLJIT_S0), 0, SLJIT_IMM, 7);
	/* Exit. */
	label3 = sljit_emit_label(compiler);
	sljit_set_label(jump2, label3);
	sljit_set_label(jump3, label3);
	/* By default, set to handler 1. */
	sljit_set_label(jump1, label1);
	sljit_emit_return(compiler, SLJIT_UNUSED, 0, 0);

	value = sljit_alloc_memory(compiler, 8);
	SLJIT_ASSERT(!((long)value & (sizeof(long) - 1)));
	memset(value, 255, 8);

	code.code = sljit_generate_code(compiler);
	CHECK(compiler);
	jump1_addr = sljit_get_jump_addr(jump1);
	label1_addr = sljit_get_label_addr(label1);
	label2_addr = sljit_get_label_addr(label2);
	sljit_free_compiler(compiler);

	code.func2((long)&buf, 4);
	FAILED(buf[0] != 5, "test12 case 1 failed\n");

	code.func2((long)&buf, 11);
	FAILED(buf[0] != 6, "test12 case 2 failed\n");

	sljit_set_jump_addr(jump1_addr, label2_addr);
	code.func2((long)&buf, 12);
	FAILED(buf[0] != 7, "test12 case 3 failed\n");

	sljit_set_jump_addr(jump1_addr, label1_addr);
	code.func2((long)&buf, 13);
	FAILED(buf[0] != 6, "test12 case 4 failed\n");

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
callq 0x18ba0
movq %rax, -0x10(%rbp)
cmpl $0x0, 0x2dcc9(%rip)     # 0x34354
je 0x669b
leaq 0x2752f(%rip), %rdi     # 0x2dbc3
movb $0x0, %al
callq 0x2070
cmpq $0x0, -0x10(%rbp)
jne 0x66b5
leaq 0x26d2a(%rip), %rdi     # 0x2d3d3
movb $0x0, %al
callq 0x2070
jmp 0x69ee
movq $0x0, -0x68(%rbp)
movq -0x10(%rbp), %rdi
xorl %r9d, %r9d
movl $0x2, %r8d
movl $0x3, %ecx
movl %r9d, %esi
movl %r8d, %edx
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x19b20
movq -0x10(%rbp), %rdi
movl $0x862, %esi            # imm = 0x862
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0xb, %r8d
movq %r9, %rcx
movl $0x40, (%rsp)
movq $0xa, 0x8(%rsp)
callq 0x1f8d0
movq -0x10(%rbp), %rdi
movl $0x1008, %esi           # imm = 0x1008
callq 0x283d0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x8c, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r8d
movl $0x5, %r9d
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x16, %esi
callq 0x283d0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl $0xf, %esi
callq 0x18ed0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x6796
leaq 0x26c66(%rip), %rdi     # 0x2d3eb
movl $0x384, %esi            # imm = 0x384
movb $0x0, %al
callq 0x2070
callq 0x2040
jmp 0x6798
movq -0x48(%rbp), %rdi
movl $0xff, %esi
movl $0xf, %edx
callq 0x2080
movq -0x10(%rbp), %rdi
callq 0x28220
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x8c, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r8d
movl $0x6, %r9d
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x16, %esi
callq 0x283d0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x28220
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x8c, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r8d
movl $0x7, %r9d
callq 0x1d3d0
movq -0x10(%rbp), %rdi
callq 0x28220
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x18e30
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x18e30
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x18e30
movq -0x10(%rbp), %rdi
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %ecx
movl %edx, %esi
callq 0x1a7c0
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x18ed0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x689a
leaq 0x26b62(%rip), %rdi     # 0x2d3eb
movl $0x396, %esi            # imm = 0x396
movb $0x0, %al
callq 0x2070
callq 0x2040
jmp 0x689c
movq -0x48(%rbp), %rdi
movl $0xff, %esi
movl $0x8, %edx
callq 0x2080
movq -0x10(%rbp), %rdi
callq 0x19070
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x18030
cmpl $0x1, %eax
je 0x68f1
movq -0x10(%rbp), %rdi
callq 0x18030
movl %eax, %esi
leaq 0x26b3c(%rip), %rdi     # 0x2d418
movb $0x0, %al
callq 0x2070
movq -0x10(%rbp), %rdi
callq 0x18d90
jmp 0x69ee
movq -0x30(%rbp), %rdi
callq 0x18060
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x18080
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rdi
callq 0x18080
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x18d90
movq -0x8(%rbp), %rax
leaq -0x68(%rbp), %rdi
movl $0x4, %esi
callq *%rax
cmpq $0x5, -0x68(%rbp)
je 0x694a
leaq 0x27291(%rip), %rdi     # 0x2dbcf
movb $0x0, %al
callq 0x2070
jmp 0x69ee
movq -0x8(%rbp), %rax
leaq -0x68(%rbp), %rdi
movl $0xb, %esi
callq *%rax
cmpq $0x6, -0x68(%rbp)
je 0x6970
leaq 0x2727e(%rip), %rdi     # 0x2dbe5
movb $0x0, %al
callq 0x2070
jmp 0x69ee
movq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x2ac40
movq -0x8(%rbp), %rax
leaq -0x68(%rbp), %rdi
movl $0xc, %esi
callq *%rax
cmpq $0x7, -0x68(%rbp)
je 0x69a3
leaq 0x27261(%rip), %rdi     # 0x2dbfb
movb $0x0, %al
callq 0x2070
jmp 0x69ee
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2ac40
movq -0x8(%rbp), %rax
leaq -0x68(%rbp), %rdi
movl $0xd, %esi
callq *%rax
cmpq $0x6, -0x68(%rbp)
je 0x69d6
leaq 0x27244(%rip), %rdi     # 0x2dc11
movb $0x0, %al
callq 0x2070
jmp 0x69ee
movq -0x8(%rbp), %rdi
callq 0x18e10
movl 0x2d977(%rip), %eax     # 0x3435c
addl $0x1, %eax
movl %eax, 0x2d96e(%rip)     # 0x3435c
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)