// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: sljit_emit_op1
int sljit_emit_op1(struct sljit_compiler *compiler, int op,
	int dst, long dstw,
	int src, long srcw)
{
	u_char* inst;
	int update = 0;
	int op_flags = GET_ALL_FLAGS(op);
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
	int dst_is_ereg = 0;
	int src_is_ereg = 0;
#else
#	define src_is_ereg 0
#endif

	CHECK_ERROR();
	CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw));
	ADJUST_LOCAL_OFFSET(dst, dstw);
	ADJUST_LOCAL_OFFSET(src, srcw);

	CHECK_EXTRA_REGS(dst, dstw, dst_is_ereg = 1);
	CHECK_EXTRA_REGS(src, srcw, src_is_ereg = 1);
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
	compiler->mode32 = op_flags & SLJIT_INT_OP;
#endif

	op = GET_OPCODE(op);
	if (op >= SLJIT_MOV && op <= SLJIT_MOVU_P) {
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
		compiler->mode32 = 0;
#endif

		if (op_flags & SLJIT_INT_OP) {
			if (FAST_IS_REG(src) && src == dst) {
				if (!TYPE_CAST_NEEDED(op))
					return SLJIT_SUCCESS;
			}
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
			if (op == SLJIT_MOV_SI && (src & SLJIT_MEM))
				op = SLJIT_MOV_UI;
			if (op == SLJIT_MOVU_SI && (src & SLJIT_MEM))
				op = SLJIT_MOVU_UI;
			if (op == SLJIT_MOV_UI && (src & SLJIT_IMM))
				op = SLJIT_MOV_SI;
			if (op == SLJIT_MOVU_UI && (src & SLJIT_IMM))
				op = SLJIT_MOVU_SI;
#endif
		}

		SLJIT_COMPILE_ASSERT(SLJIT_MOV + 8 == SLJIT_MOVU, movu_offset);
		if (op >= SLJIT_MOVU) {
			update = 1;
			op -= 8;
		}

		if (src & SLJIT_IMM) {
			switch (op) {
			case SLJIT_MOV_UB:
				srcw = (u_char)srcw;
				break;
			case SLJIT_MOV_SB:
				srcw = (s_char)srcw;
				break;
			case SLJIT_MOV_UH:
				srcw = (unsigned short)srcw;
				break;
			case SLJIT_MOV_SH:
				srcw = (short)srcw;
				break;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
			case SLJIT_MOV_UI:
				srcw = (unsigned int)srcw;
				break;
			case SLJIT_MOV_SI:
				srcw = (int)srcw;
				break;
#endif
			}
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
			if (dst_is_ereg)
				return emit_mov(compiler, dst, dstw, src, srcw);
#endif
		}

		if (update && (src & SLJIT_MEM) && !src_is_ereg && (src & REG_MASK) && (srcw != 0 || (src & OFFS_REG_MASK) != 0)) {
			inst = emit_x86_instruction(compiler, 1, src & REG_MASK, 0, src, srcw);
			FAIL_IF(!inst);
			*inst = LEA_r_m;
			src &= SLJIT_MEM | 0xf;
			srcw = 0;
		}

#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
		if (dst_is_ereg && (!(op == SLJIT_MOV || op == SLJIT_MOV_UI || op == SLJIT_MOV_SI || op == SLJIT_MOV_P) || (src & SLJIT_MEM))) {
			SLJIT_ASSERT(dst == SLJIT_MEM1(SLJIT_SP));
			dst = TMP_REG1;
		}
#endif

		switch (op) {
		case SLJIT_MOV:
		case SLJIT_MOV_P:
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
		case SLJIT_MOV_UI:
		case SLJIT_MOV_SI:
#endif
			FAIL_IF(emit_mov(compiler, dst, dstw, src, srcw));
			break;
		case SLJIT_MOV_UB:
			FAIL_IF(emit_mov_byte(compiler, 0, dst, dstw, src, srcw));
			break;
		case SLJIT_MOV_SB:
			FAIL_IF(emit_mov_byte(compiler, 1, dst, dstw, src, srcw));
			break;
		case SLJIT_MOV_UH:
			FAIL_IF(emit_mov_half(compiler, 0, dst, dstw, src, srcw));
			break;
		case SLJIT_MOV_SH:
			FAIL_IF(emit_mov_half(compiler, 1, dst, dstw, src, srcw));
			break;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
		case SLJIT_MOV_UI:
			FAIL_IF(emit_mov_int(compiler, 0, dst, dstw, src, srcw));
			break;
		case SLJIT_MOV_SI:
			FAIL_IF(emit_mov_int(compiler, 1, dst, dstw, src, srcw));
			break;
#endif
		}

#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
		if (dst_is_ereg && dst == TMP_REG1)
			return emit_mov(compiler, SLJIT_MEM1(SLJIT_SP), dstw, TMP_REG1, 0);
#endif

		if (update && (dst & SLJIT_MEM) && (dst & REG_MASK) && (dstw != 0 || (dst & OFFS_REG_MASK) != 0)) {
			inst = emit_x86_instruction(compiler, 1, dst & REG_MASK, 0, dst, dstw);
			FAIL_IF(!inst);
			*inst = LEA_r_m;
		}
		return SLJIT_SUCCESS;
	}

	if (GET_FLAGS(op_flags))
		compiler->flags_saved = 0;

	switch (op) {
	case SLJIT_NOT:
		if (op_flags & SLJIT_SET_E)
			return emit_not_with_flags(compiler, dst, dstw, src, srcw);
		return emit_unary(compiler, NOT_rm, dst, dstw, src, srcw);

	case SLJIT_NEG:
		if (op_flags & SLJIT_KEEP_FLAGS && !compiler->flags_saved)
			FAIL_IF(emit_save_flags(compiler));
		return emit_unary(compiler, NEG_rm, dst, dstw, src, srcw);

	case SLJIT_CLZ:
		if (op_flags & SLJIT_KEEP_FLAGS && !compiler->flags_saved)
			FAIL_IF(emit_save_flags(compiler));
		return emit_clz(compiler, op_flags, dst, dstw, src, srcw);
	}

	return SLJIT_SUCCESS;

#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
#	undef src_is_ereg
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x14(%rbp), %eax
andl $0x7f00, %eax           # imm = 0x7F00
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1d417
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d419
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
callq 0x1d9e0
cmpl $0x8d, -0x18(%rbp)
jne 0x1d449
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
cmpl $0x8d, -0x24(%rbp)
jne 0x1d45e
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movl -0x40(%rbp), %ecx
andl $0x100, %ecx            # imm = 0x100
movq -0x10(%rbp), %rax
movl %ecx, 0x70(%rax)
movl -0x14(%rbp), %eax
andl $0xffff80ff, %eax       # imm = 0xFFFF80FF
movl %eax, -0x14(%rbp)
cmpl $0x20, -0x14(%rbp)
jl 0x1d886
cmpl $0x2f, -0x14(%rbp)
jg 0x1d886
movq -0x10(%rbp), %rax
movl $0x0, 0x70(%rax)
movl -0x40(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x1d543
cmpl $0x3f, -0x24(%rbp)
jg 0x1d4dd
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
jne 0x1d4dd
cmpl $0x21, -0x14(%rbp)
jl 0x1d4c3
cmpl $0x24, -0x14(%rbp)
jle 0x1d4db
cmpl $0x29, -0x14(%rbp)
jl 0x1d4cf
cmpl $0x2c, -0x14(%rbp)
jle 0x1d4db
movl $0x0, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d4dd
cmpl $0x26, -0x14(%rbp)
jne 0x1d4f7
movl -0x24(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x1d4f7
movl $0x25, -0x14(%rbp)
cmpl $0x2e, -0x14(%rbp)
jne 0x1d511
movl -0x24(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x1d511
movl $0x2d, -0x14(%rbp)
cmpl $0x25, -0x14(%rbp)
jne 0x1d529
movl -0x24(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x1d529
movl $0x26, -0x14(%rbp)
cmpl $0x2d, -0x14(%rbp)
jne 0x1d541
movl -0x24(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x1d541
movl $0x2e, -0x14(%rbp)
jmp 0x1d543
jmp 0x1d545
jmp 0x1d547
cmpl $0x28, -0x14(%rbp)
jl 0x1d55d
movl $0x1, -0x3c(%rbp)
movl -0x14(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x14(%rbp)
movl -0x24(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x1d5db
movl -0x14(%rbp), %eax
addl $-0x21, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x5, %eax
ja 0x1d5d9
movq -0x48(%rbp), %rax
leaq 0x12d8c(%rip), %rcx     # 0x30310
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x30(%rbp), %rax
movzbl %al, %eax
movq %rax, -0x30(%rbp)
jmp 0x1d5d9
movq -0x30(%rbp), %rax
movsbq %al, %rax
movq %rax, -0x30(%rbp)
jmp 0x1d5d9
movq -0x30(%rbp), %rax
movzwl %ax, %eax
movq %rax, -0x30(%rbp)
jmp 0x1d5d9
movq -0x30(%rbp), %rax
movswq %ax, %rax
movq %rax, -0x30(%rbp)
jmp 0x1d5d9
movq -0x30(%rbp), %rax
movl %eax, %eax
movq %rax, -0x30(%rbp)
jmp 0x1d5d9
movq -0x30(%rbp), %rax
cltq
movq %rax, -0x30(%rbp)
jmp 0x1d5db
cmpl $0x0, -0x3c(%rbp)
je 0x1d666
movl -0x24(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x1d666
movl -0x24(%rbp), %eax
andl $0x3f, %eax
cmpl $0x0, %eax
je 0x1d666
cmpq $0x0, -0x30(%rbp)
jne 0x1d611
movl -0x24(%rbp), %eax
andl $0x3f00, %eax           # imm = 0x3F00
cmpl $0x0, %eax
je 0x1d666
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %edx
andl $0x3f, %edx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x1b8f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1d64a
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d64c
movq -0x38(%rbp), %rax
movb $-0x73, (%rax)
movl -0x24(%rbp), %eax
andl $0x8f, %eax
movl %eax, -0x24(%rbp)
movq $0x0, -0x30(%rbp)
movl -0x14(%rbp), %eax
addl $-0x20, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x7, %eax
ja 0x1d806
movq -0x50(%rbp), %rax
leaq 0x12ca2(%rip), %rcx     # 0x30328
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x1d691
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
callq 0x1d0a0
cmpl $0x0, %eax
je 0x1d6bb
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d6bd
jmp 0x1d806
jmp 0x1d6c4
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
xorl %esi, %esi
callq 0x1e7b0
cmpl $0x0, %eax
je 0x1d6f1
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d6f3
jmp 0x1d806
jmp 0x1d6fa
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x1, %esi
callq 0x1e7b0
cmpl $0x0, %eax
je 0x1d72a
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d72c
jmp 0x1d806
jmp 0x1d733
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
xorl %esi, %esi
callq 0x1e9a0
cmpl $0x0, %eax
je 0x1d760
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d762
jmp 0x1d806
jmp 0x1d769
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x1, %esi
callq 0x1e9a0
cmpl $0x0, %eax
je 0x1d799
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d79b
jmp 0x1d806
jmp 0x1d79f
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
xorl %esi, %esi
callq 0x1eb90
cmpl $0x0, %eax
je 0x1d7cc
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d7ce
jmp 0x1d806
jmp 0x1d7d2
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x1, %esi
callq 0x1eb90
cmpl $0x0, %eax
je 0x1d802
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d804
jmp 0x1d806
cmpl $0x0, -0x3c(%rbp)
je 0x1d87a
movl -0x18(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x1d87a
movl -0x18(%rbp), %eax
andl $0x3f, %eax
cmpl $0x0, %eax
je 0x1d87a
cmpq $0x0, -0x20(%rbp)
jne 0x1d838
movl -0x18(%rbp), %eax
andl $0x3f00, %eax           # imm = 0x3F00
cmpl $0x0, %eax
je 0x1d87a
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
andl $0x3f, %edx
movl -0x18(%rbp), %r8d
movq -0x20(%rbp), %r9
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x1b8f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1d871
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d873
movq -0x38(%rbp), %rax
movb $-0x73, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x1d9cf
movl -0x40(%rbp), %eax
andl $0x3e00, %eax           # imm = 0x3E00
cmpl $0x0, %eax
je 0x1d89e
movq -0x10(%rbp), %rax
movl $0x0, 0x74(%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x54(%rbp)
subl $0x30, %eax
je 0x1d8c6
jmp 0x1d8ab
movl -0x54(%rbp), %eax
subl $0x31, %eax
je 0x1d917
jmp 0x1d8b5
movl -0x54(%rbp), %eax
subl $0x32, %eax
je 0x1d972
jmp 0x1d9c8
movl -0x40(%rbp), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x1d8f2
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
callq 0x1ee10
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x10, %esi
callq 0x1f0f0
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
movl -0x40(%rbp), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x1d950
movq -0x10(%rbp), %rax
cmpl $0x0, 0x74(%rax)
jne 0x1d950
jmp 0x1d930
movq -0x10(%rbp), %rdi
callq 0x1f390
cmpl $0x0, %eax
je 0x1d94c
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d94e
jmp 0x1d950
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x18, %esi
callq 0x1f0f0
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
movl -0x40(%rbp), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x1d9a8
movq -0x10(%rbp), %rax
cmpl $0x0, 0x74(%rax)
jne 0x1d9a8
jmp 0x1d98b
movq -0x10(%rbp), %rdi
callq 0x1f390
cmpl $0x0, %eax
je 0x1d9a4
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
jmp 0x1d9a6
jmp 0x1d9a8
movq -0x10(%rbp), %rdi
movl -0x40(%rbp), %esi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
callq 0x1f470
movl %eax, -0x4(%rbp)
jmp 0x1d9cf
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)