// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/test_src/sljitTest.c
// Function: test41
static void test41(void)
{
	/* Test inline assembly. */
	executable_code code;
	struct sljit_compiler* compiler = sljit_create_compiler();
	int i;
	double buf[3];
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
	u_char inst[16];
#elif (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
	u_char inst[16];
	int reg;
#else
	unsigned int inst;
#endif

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

	for (i = 0; i < SLJIT_NUM_REGS; i++) {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
		if (SLJIT_R(i) >= SLJIT_R3 && SLJIT_R(i) <= SLJIT_R6) {
			SLJIT_ASSERT(sljit_get_reg_index(SLJIT_R(i)) == -1);
			continue;
		}
#endif
		SLJIT_ASSERT(sljit_get_reg_index(SLJIT_R(i)) >= 0 && sljit_get_reg_index(SLJIT_R(i)) < 64);
	}

	FAILED(!compiler, "cannot create compiler\n");
	sljit_emit_enter(compiler, 0, 2, 3, 3, 0, 0, 0);

	/* Returns with the sum of SLJIT_S0 and SLJIT_S1. */
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
	/* lea SLJIT_RETURN_REG, [SLJIT_S0, SLJIT_S1] */
	inst[0] = 0x48;
	inst[1] = 0x8d;
	inst[2] = 0x04 | ((sljit_get_reg_index(SLJIT_RETURN_REG) & 0x7) << 3);
	inst[3] = (sljit_get_reg_index(SLJIT_S0) & 0x7)
		| ((sljit_get_reg_index(SLJIT_S1) & 0x7) << 3);
	sljit_emit_op_custom(compiler, inst, 4);
#elif (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
	/* lea SLJIT_RETURN_REG, [SLJIT_S0, SLJIT_S1] */
	inst[0] = 0x48; /* REX_W */
	inst[1] = 0x8d;
	inst[2] = 0x04;
	reg = sljit_get_reg_index(SLJIT_RETURN_REG);
	inst[2] |= ((reg & 0x7) << 3);
	if (reg > 7)
		inst[0] |= 0x04; /* REX_R */
	reg = sljit_get_reg_index(SLJIT_S0);
	inst[3] = reg & 0x7;
	if (reg > 7)
		inst[0] |= 0x01; /* REX_B */
	reg = sljit_get_reg_index(SLJIT_S1);
	inst[3] |= (reg & 0x7) << 3;
	if (reg > 7)
		inst[0] |= 0x02; /* REX_X */
	sljit_emit_op_custom(compiler, inst, 4);
#elif (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) || (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7)
	/* add rd, rn, rm */
	inst = 0xe0800000 | (sljit_get_reg_index(SLJIT_RETURN_REG) << 12)
		| (sljit_get_reg_index(SLJIT_S0) << 16)
		| sljit_get_reg_index(SLJIT_S1);
	sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#elif (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2)
	/* add rd, rn, rm */
	inst = 0xeb000000 | (sljit_get_reg_index(SLJIT_RETURN_REG) << 8)
		| (sljit_get_reg_index(SLJIT_S0) << 16)
		| sljit_get_reg_index(SLJIT_S1);
	sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#elif (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64)
	/* add rd, rn, rm */
	inst = 0x8b000000 | sljit_get_reg_index(SLJIT_RETURN_REG)
		| (sljit_get_reg_index(SLJIT_S0) << 5)
		| (sljit_get_reg_index(SLJIT_S1) << 16);
	sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#elif (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC)
	/* add rD, rA, rB */
	inst = (31 << 26) | (266 << 1) | (sljit_get_reg_index(SLJIT_RETURN_REG) << 21)
		| (sljit_get_reg_index(SLJIT_S0) << 16)
		| (sljit_get_reg_index(SLJIT_S1) << 11);
	sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#elif (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
	/* addu rd, rs, rt */
	inst = 33 | (sljit_get_reg_index(SLJIT_RETURN_REG) << 11)
		| (sljit_get_reg_index(SLJIT_S0) << 21)
		| (sljit_get_reg_index(SLJIT_S1) << 16);
	sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#elif (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
	/* daddu rd, rs, rt */
	inst = 45 | (sljit_get_reg_index(SLJIT_RETURN_REG) << 11)
		| (sljit_get_reg_index(SLJIT_S0) << 21)
		| (sljit_get_reg_index(SLJIT_S1) << 16);
	sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#elif (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
	/* add rd, rs1, rs2 */
	inst = (0x2 << 30) | (sljit_get_reg_index(SLJIT_RETURN_REG) << 25)
		| (sljit_get_reg_index(SLJIT_S0) << 14)
		| sljit_get_reg_index(SLJIT_S1);
	sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#else
	inst = 0;
	sljit_emit_op_custom(compiler, &inst, 0);
#endif

	sljit_emit_return(compiler, SLJIT_MOV, SLJIT_RETURN_REG, 0);

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

	FAILED(code.func2(32, -11) != 21, "test41 case 1 failed\n");
	FAILED(code.func2(1000, 234) != 1234, "test41 case 2 failed\n");
#if (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
	FAILED(code.func2(SLJIT_W(0x20f0a04090c06070), SLJIT_W(0x020f0a04090c0607)) != SLJIT_W(0x22ffaa4499cc6677), "test41 case 3 failed\n");
#endif

	sljit_free_code(code.code);

	if (sljit_is_fpu_available()) {
		buf[0] = 13.5;
		buf[1] = -2.25;
		buf[2] = 0.0;

		compiler = sljit_create_compiler();
		sljit_emit_enter(compiler, 0, 1, 0, 1, 2, 0, 0);
		sljit_emit_fop1(compiler, SLJIT_DMOV, SLJIT_FR0, 0, SLJIT_MEM1(SLJIT_S0), 0);
		sljit_emit_fop1(compiler, SLJIT_DMOV, SLJIT_FR1, 0, SLJIT_MEM1(SLJIT_S0), sizeof(double));
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
		/* addsd x, xm */
		inst[0] = 0xf2;
		inst[1] = 0x0f;
		inst[2] = 0x58;
		inst[3] = 0xc0 | (sljit_get_float_reg_index(SLJIT_FR0) << 3)
			| sljit_get_float_reg_index(SLJIT_FR1);
		sljit_emit_op_custom(compiler, inst, 4);
#elif (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
		/* addsd x, xm */
		if (sljit_get_float_reg_index(SLJIT_FR0) > 7 || sljit_get_float_reg_index(SLJIT_FR1) > 7) {
			inst[0] = 0;
			if (sljit_get_float_reg_index(SLJIT_FR0) > 7)
				inst[0] |= 0x04; /* REX_R */
			if (sljit_get_float_reg_index(SLJIT_FR1) > 7)
				inst[0] |= 0x01; /* REX_B */
			inst[1] = 0xf2;
			inst[2] = 0x0f;
			inst[3] = 0x58;
			inst[4] = 0xc0 | ((sljit_get_float_reg_index(SLJIT_FR0) & 0x7) << 3)
				| (sljit_get_float_reg_index(SLJIT_FR1) & 0x7);
			sljit_emit_op_custom(compiler, inst, 5);
		}
		else {
			inst[0] = 0xf2;
			inst[1] = 0x0f;
			inst[2] = 0x58;
			inst[3] = 0xc0 | (sljit_get_float_reg_index(SLJIT_FR0) << 3)
				| sljit_get_float_reg_index(SLJIT_FR1);
			sljit_emit_op_custom(compiler, inst, 4);
		}
#elif (defined SLJIT_CONFIG_ARM_32 && SLJIT_CONFIG_ARM_32)
		/* vadd.f64 dd, dn, dm */
		inst = 0xee300b00 | ((sljit_get_float_reg_index(SLJIT_FR0) >> 1) << 12)
			| ((sljit_get_float_reg_index(SLJIT_FR0) >> 1) << 16)
			| (sljit_get_float_reg_index(SLJIT_FR1) >> 1);
		sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#elif (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64)
		/* fadd rd, rn, rm */
		inst = 0x1e602800 | sljit_get_float_reg_index(SLJIT_FR0)
			| (sljit_get_float_reg_index(SLJIT_FR0) << 5)
			| (sljit_get_float_reg_index(SLJIT_FR1) << 16);
		sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#elif (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC)
		/* fadd frD, frA, frB */
		inst = (63 << 26) | (21 << 1) | (sljit_get_float_reg_index(SLJIT_FR0) << 21)
			| (sljit_get_float_reg_index(SLJIT_FR0) << 16)
			| (sljit_get_float_reg_index(SLJIT_FR1) << 11);
		sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#elif (defined SLJIT_CONFIG_MIPS && SLJIT_CONFIG_MIPS)
		/* add.d fd, fs, ft */
		inst = (17 << 26) | (17 << 21) | (sljit_get_float_reg_index(SLJIT_FR0) << 6)
			| (sljit_get_float_reg_index(SLJIT_FR0) << 11)
			| (sljit_get_float_reg_index(SLJIT_FR1) << 16);
		sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#elif (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
		/* faddd rd, rs1, rs2 */
		inst = (0x2 << 30) | (0x34 << 19) | (0x42 << 5)
			| (sljit_get_float_reg_index(SLJIT_FR0) << 25)
			| (sljit_get_float_reg_index(SLJIT_FR0) << 14)
			| sljit_get_float_reg_index(SLJIT_FR1);
		sljit_emit_op_custom(compiler, &inst, sizeof(unsigned int));
#endif
		sljit_emit_fop1(compiler, SLJIT_DMOV, SLJIT_MEM1(SLJIT_S0), 2 * sizeof(double), SLJIT_FR0, 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[2] != 11.25, "test41 case 3 failed\n");

		sljit_free_code(code.code);
	}

	successful_tests++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
callq 0x18ba0
movq %rax, -0x10(%rbp)
cmpl $0x0, 0x2174c(%rip)     # 0x34354
je 0x12c18
leaq 0x1c8f1(%rip), %rdi     # 0x2f502
movb $0x0, %al
callq 0x2070
movl $0x0, -0x14(%rbp)
cmpl $0xc, -0x14(%rbp)
jge 0x12c6e
jmp 0x12c27
movl -0x14(%rbp), %edi
addl $0x1, %edi
callq 0x237d0
cmpl $0x0, %eax
jl 0x12c47
movl -0x14(%rbp), %edi
addl $0x1, %edi
callq 0x237d0
cmpl $0x40, %eax
jl 0x12c5f
leaq 0x1a79d(%rip), %rdi     # 0x2d3eb
movl $0xdf7, %esi            # imm = 0xDF7
movb $0x0, %al
callq 0x2070
callq 0x2040
jmp 0x12c61
jmp 0x12c63
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x12c1f
cmpq $0x0, -0x10(%rbp)
jne 0x12c88
leaq 0x1a757(%rip), %rdi     # 0x2d3d3
movb $0x0, %al
callq 0x2070
jmp 0x130a5
movq -0x10(%rbp), %rdi
xorl %r9d, %r9d
movl $0x2, %edx
movl $0x3, %r8d
movl %r9d, %esi
movl %r8d, %ecx
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x19b20
movb $0x48, -0x40(%rbp)
movb $-0x73, -0x3f(%rbp)
movb $0x4, -0x3e(%rbp)
movl $0x1, %edi
callq 0x237d0
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %ecx
andl $0x7, %ecx
shll $0x3, %ecx
movzbl -0x3e(%rbp), %eax
orl %ecx, %eax
movb %al, -0x3e(%rbp)
cmpl $0x7, -0x44(%rbp)
jle 0x12cef
movzbl -0x40(%rbp), %eax
orl $0x4, %eax
movb %al, -0x40(%rbp)
movl $0xc, %edi
callq 0x237d0
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
andl $0x7, %eax
movb %al, -0x3d(%rbp)
cmpl $0x7, -0x44(%rbp)
jle 0x12d15
movzbl -0x40(%rbp), %eax
orl $0x1, %eax
movb %al, -0x40(%rbp)
movl $0xb, %edi
callq 0x237d0
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %ecx
andl $0x7, %ecx
shll $0x3, %ecx
movzbl -0x3d(%rbp), %eax
orl %ecx, %eax
movb %al, -0x3d(%rbp)
cmpl $0x7, -0x44(%rbp)
jle 0x12d44
movzbl -0x40(%rbp), %eax
orl $0x2, %eax
movb %al, -0x40(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movl $0x4, %edx
callq 0x238a0
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1a7c0
movq -0x10(%rbp), %rdi
callq 0x19070
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x18030
cmpl $0x1, %eax
je 0x12daf
movq -0x10(%rbp), %rdi
callq 0x18030
movl %eax, %esi
leaq 0x1a67e(%rip), %rdi     # 0x2d418
movb $0x0, %al
callq 0x2070
movq -0x10(%rbp), %rdi
callq 0x18d90
jmp 0x130a5
movq -0x10(%rbp), %rdi
callq 0x18d90
movl $0x20, %edi
movq $-0xb, %rsi
callq *-0x8(%rbp)
cmpq $0x15, %rax
je 0x12de0
leaq 0x1c73a(%rip), %rdi     # 0x2f50e
movb $0x0, %al
callq 0x2070
jmp 0x130a5
movl $0x3e8, %edi            # imm = 0x3E8
movl $0xea, %esi
callq *-0x8(%rbp)
cmpq $0x4d2, %rax            # imm = 0x4D2
je 0x12e08
leaq 0x1c728(%rip), %rdi     # 0x2f524
movb $0x0, %al
callq 0x2070
jmp 0x130a5
movabsq $0x20f0a04090c06070, %rdi # imm = 0x20F0A04090C06070
movabsq $0x20f0a04090c0607, %rsi # imm = 0x20F0A04090C0607
callq *-0x8(%rbp)
movabsq $0x22ffaa4499cc6677, %rcx # imm = 0x22FFAA4499CC6677
cmpq %rcx, %rax
je 0x12e41
leaq 0x1c705(%rip), %rdi     # 0x2f53a
movb $0x0, %al
callq 0x2070
jmp 0x130a5
movq -0x8(%rbp), %rdi
callq 0x18e10
callq 0x23a30
testb $0x1, %al
jne 0x12e58
jmp 0x13096
movsd 0x1a310(%rip), %xmm0    # 0x2d170
movsd %xmm0, -0x30(%rbp)
movsd 0x1a2fb(%rip), %xmm0    # 0x2d168
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
callq 0x18ba0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
xorl %ecx, %ecx
movl $0x1, %r8d
movl $0x2, %r9d
movl %ecx, %esi
movl %r8d, %edx
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x19b20
movq -0x10(%rbp), %rdi
movl $0x80, %esi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0x8c, %r8d
movq %r9, %rcx
callq 0x23a40
movq -0x10(%rbp), %rdi
movl $0x80, %esi
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0x8c, %r8d
movl $0x8, %r9d
callq 0x23a40
movl $0x1, %edi
callq 0x23840
cmpl $0x7, %eax
jg 0x12f14
movl $0x2, %edi
callq 0x23840
cmpl $0x7, %eax
jle 0x12f99
movb $0x0, -0x40(%rbp)
movl $0x1, %edi
callq 0x23840
cmpl $0x7, %eax
jle 0x12f31
movzbl -0x40(%rbp), %eax
orl $0x4, %eax
movb %al, -0x40(%rbp)
movl $0x2, %edi
callq 0x23840
cmpl $0x7, %eax
jle 0x12f4a
movzbl -0x40(%rbp), %eax
orl $0x1, %eax
movb %al, -0x40(%rbp)
movb $-0xe, -0x3f(%rbp)
movb $0xf, -0x3e(%rbp)
movb $0x58, -0x3d(%rbp)
movl $0x1, %edi
callq 0x23840
andl $0x7, %eax
shll $0x3, %eax
orl $0xc0, %eax
movl %eax, -0x48(%rbp)
movl $0x2, %edi
callq 0x23840
movl %eax, %ecx
movl -0x48(%rbp), %eax
andl $0x7, %ecx
orl %ecx, %eax
movb %al, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movl $0x5, %edx
callq 0x238a0
jmp 0x12fe0
movb $-0xe, -0x40(%rbp)
movb $0xf, -0x3f(%rbp)
movb $0x58, -0x3e(%rbp)
movl $0x1, %edi
callq 0x23840
shll $0x3, %eax
orl $0xc0, %eax
movl %eax, -0x4c(%rbp)
movl $0x2, %edi
callq 0x23840
movl %eax, %ecx
movl -0x4c(%rbp), %eax
orl %ecx, %eax
movb %al, -0x3d(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movl $0x4, %edx
callq 0x238a0
movq -0x10(%rbp), %rdi
movl $0x80, %esi
movl $0x8c, %edx
movl $0x10, %ecx
movl $0x1, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x23a40
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 0x13053
movq -0x10(%rbp), %rdi
callq 0x18030
movl %eax, %esi
leaq 0x1a3d7(%rip), %rdi     # 0x2d418
movb $0x0, %al
callq 0x2070
movq -0x10(%rbp), %rdi
callq 0x18d90
jmp 0x130a5
movq -0x10(%rbp), %rdi
callq 0x18d90
movq -0x8(%rbp), %rax
leaq -0x30(%rbp), %rdi
callq *%rax
movsd -0x20(%rbp), %xmm0
movsd 0x1a105(%rip), %xmm1    # 0x2d178
ucomisd %xmm1, %xmm0
jne 0x1307d
jp 0x1307d
jmp 0x1308d
leaq 0x1c4b6(%rip), %rdi     # 0x2f53a
movb $0x0, %al
callq 0x2070
jmp 0x130a5
movq -0x8(%rbp), %rdi
callq 0x18e10
movl 0x212c0(%rip), %eax     # 0x3435c
addl $0x1, %eax
movl %eax, 0x212b7(%rip)     # 0x3435c
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)