// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/test_src/sljitTest.c
// Function: test31
static void test31(void)
{
	/* Integer mul and set flags. */
	executable_code code;
	struct sljit_compiler* compiler = sljit_create_compiler();
	long buf[12];
#if (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
	long big_word = SLJIT_W(0x7fffffff00000000);
	long big_word2 = SLJIT_W(0x7fffffff00000012);
#else
	long big_word = 0x7fffffff;
	long big_word2 = 0x00000012;
#endif

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

	buf[0] = 3;
	buf[1] = 3;
	buf[2] = 3;
	buf[3] = 3;
	buf[4] = 3;
	buf[5] = 3;
	buf[6] = 3;
	buf[7] = 3;
	buf[8] = 3;
	buf[9] = 3;
	buf[10] = 3;
	buf[11] = 3;

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

	sljit_emit_enter(compiler, 0, 1, 3, 5, 0, 0, 0);
	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_R1, 0, SLJIT_IMM, 0);
	sljit_emit_op2(compiler, SLJIT_MUL | SLJIT_SET_O, SLJIT_UNUSED, 0, SLJIT_R1, 0, SLJIT_IMM, -45);
	cond_set(compiler, SLJIT_MEM1(SLJIT_S0), 0, SLJIT_MUL_NOT_OVERFLOW);
	cond_set(compiler, SLJIT_MEM1(SLJIT_S0), sizeof(long), SLJIT_MUL_OVERFLOW);

	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_S2, 0, SLJIT_IMM, big_word);
	sljit_emit_op2(compiler, SLJIT_MUL | SLJIT_SET_O, SLJIT_R2, 0, SLJIT_S2, 0, SLJIT_IMM, -2);
	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_R1, 0, SLJIT_IMM, 33); /* Should not change flags. */
	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_R1, 0, SLJIT_IMM, 0); /* Should not change flags. */
	cond_set(compiler, SLJIT_MEM1(SLJIT_S0), 2 * sizeof(long), SLJIT_MUL_OVERFLOW);
	cond_set(compiler, SLJIT_MEM1(SLJIT_S0), 3 * sizeof(long), SLJIT_MUL_NOT_OVERFLOW);

	sljit_emit_op1(compiler, SLJIT_IMOV, SLJIT_S3, 0, SLJIT_IMM, 0x3f6b0);
	sljit_emit_op1(compiler, SLJIT_IMOV, SLJIT_S4, 0, SLJIT_IMM, 0x2a783);
	sljit_emit_op2(compiler, SLJIT_IMUL | SLJIT_SET_O, SLJIT_R1, 0, SLJIT_S3, 0, SLJIT_S4, 0);
	cond_set(compiler, SLJIT_MEM1(SLJIT_S0), 4 * sizeof(long), SLJIT_I_MUL_OVERFLOW);
	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_MEM1(SLJIT_S0), 5 * sizeof(long), SLJIT_R1, 0);

	sljit_emit_op1(compiler, SLJIT_IMOV, SLJIT_R1, 0, SLJIT_IMM, big_word2);
	sljit_emit_op1(compiler, SLJIT_IMOV, SLJIT_R2, 0, SLJIT_R1, 0);
	sljit_emit_op2(compiler, SLJIT_IMUL | SLJIT_SET_O, SLJIT_R1, 0, SLJIT_R1, 0, SLJIT_IMM, 23);
	cond_set(compiler, SLJIT_MEM1(SLJIT_S0), 6 * sizeof(long), SLJIT_I_MUL_OVERFLOW);

	sljit_emit_op2(compiler, SLJIT_IMUL | SLJIT_SET_O, SLJIT_UNUSED, 0, SLJIT_R2, 0, SLJIT_IMM, -23);
	cond_set(compiler, SLJIT_MEM1(SLJIT_S0), 7 * sizeof(long), SLJIT_I_MUL_NOT_OVERFLOW);
	sljit_emit_op2(compiler, SLJIT_MUL | SLJIT_SET_O, SLJIT_UNUSED, 0, SLJIT_R2, 0, SLJIT_IMM, -23);
	cond_set(compiler, SLJIT_MEM1(SLJIT_S0), 8 * sizeof(long), SLJIT_MUL_NOT_OVERFLOW);

	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_R1, 0, SLJIT_IMM, 67);
	sljit_emit_op2(compiler, SLJIT_MUL | SLJIT_SET_O, SLJIT_R1, 0, SLJIT_R1, 0, SLJIT_IMM, -23);
	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_MEM1(SLJIT_S0), 9 * sizeof(long), SLJIT_R1, 0);

	sljit_emit_return(compiler, SLJIT_UNUSED, 0, 0);

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

	code.func1((long)&buf);

	FAILED(buf[0] != 1, "test31 case 1 failed\n");
	FAILED(buf[1] != 2, "test31 case 2 failed\n");
/* Qemu issues for 64 bit muls. */
#if !(defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
	FAILED(buf[2] != 1, "test31 case 3 failed\n");
	FAILED(buf[3] != 2, "test31 case 4 failed\n");
#endif
	FAILED(buf[4] != 1, "test31 case 5 failed\n");
	FAILED((buf[5] & 0xffffffff) != 0x85540c10, "test31 case 6 failed\n");
	FAILED(buf[6] != 2, "test31 case 7 failed\n");
	FAILED(buf[7] != 1, "test31 case 8 failed\n");
#if !(defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
	FAILED(buf[8] != 1, "test31 case 9 failed\n");
#endif
	FAILED(buf[9] != -1541, "test31 case 10 failed\n");

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
callq 0x18ba0
movq %rax, -0x10(%rbp)
movabsq $0x7fffffff00000000, %rax # imm = 0x7FFFFFFF00000000
movq %rax, -0x78(%rbp)
movabsq $0x7fffffff00000012, %rax # imm = 0x7FFFFFFF00000012
movq %rax, -0x80(%rbp)
cmpl $0x0, 0x2589d(%rip)     # 0x34354
je 0xeac7
leaq 0x20417(%rip), %rdi     # 0x2eed7
movb $0x0, %al
callq 0x2070
movq $0x3, -0x70(%rbp)
movq $0x3, -0x68(%rbp)
movq $0x3, -0x60(%rbp)
movq $0x3, -0x58(%rbp)
movq $0x3, -0x50(%rbp)
movq $0x3, -0x48(%rbp)
movq $0x3, -0x40(%rbp)
movq $0x3, -0x38(%rbp)
movq $0x3, -0x30(%rbp)
movq $0x3, -0x28(%rbp)
movq $0x3, -0x20(%rbp)
movq $0x3, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xeb41
leaq 0x1e89e(%rip), %rdi     # 0x2d3d3
movb $0x0, %al
callq 0x2070
jmp 0xf02b
movq -0x10(%rbp), %rdi
xorl %r9d, %r9d
movl $0x1, %edx
movl $0x3, %ecx
movl $0x5, %r8d
movl %r9d, %esi
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x19b20
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0x40, %r8d
movq %r9, %rcx
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x1064, %esi           # imm = 0x1064
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0x2, %r8d
movq %r9, %rcx
movl $0x40, (%rsp)
movq $-0x2d, 0x8(%rsp)
callq 0x1f8d0
movq -0x10(%rbp), %rdi
movl $0x8c, %esi
xorl %eax, %eax
movl %eax, %edx
movl $0xd, %ecx
callq 0x180d0
movq -0x10(%rbp), %rdi
movl $0x8c, %esi
movl $0x8, %edx
movl $0xc, %ecx
callq 0x180d0
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %r9
movl $0x20, %esi
movl $0xa, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r8d
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x1064, %esi           # imm = 0x1064
movl $0x3, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0xa, %r8d
movq %r9, %rcx
movl $0x40, (%rsp)
movq $-0x2, 0x8(%rsp)
callq 0x1f8d0
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r8d
movl $0x21, %r9d
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0x40, %r8d
movq %r9, %rcx
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x8c, %esi
movl $0x10, %edx
movl $0xc, %ecx
callq 0x180d0
movq -0x10(%rbp), %rdi
movl $0x8c, %esi
movl $0x18, %edx
movl $0xd, %ecx
callq 0x180d0
movq -0x10(%rbp), %rdi
movl $0x126, %esi            # imm = 0x126
movl $0x9, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r8d
movl $0x3f6b0, %r9d          # imm = 0x3F6B0
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x126, %esi            # imm = 0x126
movl $0x8, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r8d
movl $0x2a783, %r9d          # imm = 0x2A783
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x1164, %esi           # imm = 0x1164
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0x9, %r8d
movq %r9, %rcx
movl $0x8, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x1f8d0
movq -0x10(%rbp), %rdi
movl $0x8c, %esi
movl $0x20, %edx
movl $0x10c, %ecx            # imm = 0x10C
callq 0x180d0
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x8c, %edx
movl $0x28, %ecx
movl $0x2, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %r9
movl $0x126, %esi            # imm = 0x126
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r8d
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x126, %esi            # imm = 0x126
movl $0x3, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0x2, %r8d
movq %r9, %rcx
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x1164, %esi           # imm = 0x1164
movl $0x2, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl %r8d, %edx
movq %r9, %rcx
movl $0x40, (%rsp)
movq $0x17, 0x8(%rsp)
callq 0x1f8d0
movq -0x10(%rbp), %rdi
movl $0x8c, %esi
movl $0x30, %edx
movl $0x10c, %ecx            # imm = 0x10C
callq 0x180d0
movq -0x10(%rbp), %rdi
movl $0x1164, %esi           # imm = 0x1164
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0x3, %r8d
movq %r9, %rcx
movl $0x40, (%rsp)
movq $-0x17, 0x8(%rsp)
callq 0x1f8d0
movq -0x10(%rbp), %rdi
movl $0x8c, %esi
movl $0x38, %edx
movl $0x10d, %ecx            # imm = 0x10D
callq 0x180d0
movq -0x10(%rbp), %rdi
movl $0x1064, %esi           # imm = 0x1064
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0x3, %r8d
movq %r9, %rcx
movl $0x40, (%rsp)
movq $-0x17, 0x8(%rsp)
callq 0x1f8d0
movq -0x10(%rbp), %rdi
movl $0x8c, %esi
movl $0x40, %edx
movl $0xd, %ecx
callq 0x180d0
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x40, %r8d
movl $0x43, %r9d
callq 0x1d3d0
movq -0x10(%rbp), %rdi
movl $0x1064, %esi           # imm = 0x1064
movl $0x2, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl %r8d, %edx
movq %r9, %rcx
movl $0x40, (%rsp)
movq $-0x17, 0x8(%rsp)
callq 0x1f8d0
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x8c, %edx
movl $0x48, %ecx
movl $0x2, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x1d3d0
movq -0x10(%rbp), %rdi
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %ecx
movl %edx, %esi
callq 0x1a7c0
movq -0x10(%rbp), %rdi
callq 0x19070
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x18030
cmpl $0x1, %eax
je 0xef42
movq -0x10(%rbp), %rdi
callq 0x18030
movl %eax, %esi
leaq 0x1e4eb(%rip), %rdi     # 0x2d418
movb $0x0, %al
callq 0x2070
movq -0x10(%rbp), %rdi
callq 0x18d90
jmp 0xf02b
movq -0x10(%rbp), %rdi
callq 0x18d90
movq -0x8(%rbp), %rax
leaq -0x70(%rbp), %rdi
callq *%rax
cmpq $0x1, -0x70(%rbp)
je 0xef6f
leaq 0x1ff80(%rip), %rdi     # 0x2eee3
movb $0x0, %al
callq 0x2070
jmp 0xf02b
cmpq $0x2, -0x68(%rbp)
je 0xef89
leaq 0x1ff7c(%rip), %rdi     # 0x2eef9
movb $0x0, %al
callq 0x2070
jmp 0xf02b
cmpq $0x1, -0x50(%rbp)
je 0xefa3
leaq 0x1ff78(%rip), %rdi     # 0x2ef0f
movb $0x0, %al
callq 0x2070
jmp 0xf02b
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0x48(%rbp), %rax
movl $0x85540c10, %ecx       # imm = 0x85540C10
cmpq %rcx, %rax
je 0xefcb
leaq 0x1ff63(%rip), %rdi     # 0x2ef25
movb $0x0, %al
callq 0x2070
jmp 0xf02b
cmpq $0x2, -0x40(%rbp)
je 0xefe2
leaq 0x1ff62(%rip), %rdi     # 0x2ef3b
movb $0x0, %al
callq 0x2070
jmp 0xf02b
cmpq $0x1, -0x38(%rbp)
je 0xeff9
leaq 0x1ff61(%rip), %rdi     # 0x2ef51
movb $0x0, %al
callq 0x2070
jmp 0xf02b
cmpq $-0x605, -0x28(%rbp)    # imm = 0xF9FB
je 0xf013
leaq 0x1ff5d(%rip), %rdi     # 0x2ef67
movb $0x0, %al
callq 0x2070
jmp 0xf02b
movq -0x8(%rbp), %rdi
callq 0x18e10
movl 0x2533a(%rip), %eax     # 0x3435c
addl $0x1, %eax
movl %eax, 0x25331(%rip)     # 0x3435c
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)