// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: sljit_emit_op0
int sljit_emit_op0(struct sljit_compiler *compiler, int op)
{
	u_char *inst;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
	int size;
#endif

	CHECK_ERROR();
	CHECK(check_sljit_emit_op0(compiler, op));

	switch (GET_OPCODE(op)) {
	case SLJIT_BREAKPOINT:
		inst = ensure_buf(compiler, 1 + 1);
		FAIL_IF(!inst);
		INC_SIZE(1);
		*inst = INT3;
		break;
	case SLJIT_NOP:
		inst = ensure_buf(compiler, 1 + 1);
		FAIL_IF(!inst);
		INC_SIZE(1);
		*inst = NOP;
		break;
	case SLJIT_LUMUL:
	case SLJIT_LSMUL:
	case SLJIT_LUDIV:
	case SLJIT_LSDIV:
		compiler->flags_saved = 0;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
#ifdef _WIN64
		SLJIT_COMPILE_ASSERT(
			reg_map[SLJIT_R0] == 0
			&& reg_map[SLJIT_R1] == 2
			&& reg_map[TMP_REG1] > 7,
			invalid_reg_assignment_for_div_mul);
#else
		SLJIT_COMPILE_ASSERT(
			reg_map[SLJIT_R0] == 0
			&& reg_map[SLJIT_R1] < 7
			&& reg_map[TMP_REG1] == 2,
			invalid_reg_assignment_for_div_mul);
#endif
		compiler->mode32 = op & SLJIT_INT_OP;
#endif

		op = GET_OPCODE(op);
		if (op == SLJIT_LUDIV) {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || defined(_WIN64)
			EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_R1, 0);
			inst = emit_x86_instruction(compiler, 1, SLJIT_R1, 0, SLJIT_R1, 0);
#else
			inst = emit_x86_instruction(compiler, 1, TMP_REG1, 0, TMP_REG1, 0);
#endif
			FAIL_IF(!inst);
			*inst = XOR_r_rm;
		}

		if (op == SLJIT_LSDIV) {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || defined(_WIN64)
			EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_R1, 0);
#endif

#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
			inst = ensure_buf(compiler, 1 + 1);
			FAIL_IF(!inst);
			INC_SIZE(1);
			*inst = CDQ;
#else
			if (compiler->mode32) {
				inst = ensure_buf(compiler, 1 + 1);
				FAIL_IF(!inst);
				INC_SIZE(1);
				*inst = CDQ;
			} else {
				inst = ensure_buf(compiler, 1 + 2);
				FAIL_IF(!inst);
				INC_SIZE(2);
				*inst++ = REX_W;
				*inst = CDQ;
			}
#endif
		}

#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
		inst = ensure_buf(compiler, 1 + 2);
		FAIL_IF(!inst);
		INC_SIZE(2);
		*inst++ = GROUP_F7;
		*inst = MOD_REG | ((op >= SLJIT_LUDIV) ? reg_map[TMP_REG1] : reg_map[SLJIT_R1]);
#else
#ifdef _WIN64
		size = (!compiler->mode32 || op >= SLJIT_LUDIV) ? 3 : 2;
#else
		size = (!compiler->mode32) ? 3 : 2;
#endif
		inst = ensure_buf(compiler, 1 + size);
		FAIL_IF(!inst);
		INC_SIZE(size);
#ifdef _WIN64
		if (!compiler->mode32)
			*inst++ = REX_W | ((op >= SLJIT_LUDIV) ? REX_B : 0);
		else if (op >= SLJIT_LUDIV)
			*inst++ = REX_B;
		*inst++ = GROUP_F7;
		*inst = MOD_REG | ((op >= SLJIT_LUDIV) ? reg_lmap[TMP_REG1] : reg_lmap[SLJIT_R1]);
#else
		if (!compiler->mode32)
			*inst++ = REX_W;
		*inst++ = GROUP_F7;
		*inst = MOD_REG | reg_map[SLJIT_R1];
#endif
#endif
		switch (op) {
		case SLJIT_LUMUL:
			*inst |= MUL;
			break;
		case SLJIT_LSMUL:
			*inst |= IMUL;
			break;
		case SLJIT_LUDIV:
			*inst |= DIV;
			break;
		case SLJIT_LSDIV:
			*inst |= IDIV;
			break;
		}
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) && !defined(_WIN64)
		EMIT_MOV(compiler, SLJIT_R1, 0, TMP_REG1, 0);
#endif
		break;
	}

	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1cc36
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1cf9f
jmp 0x1cc38
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1cfb0
movl -0x14(%rbp), %eax
andl $0xffff80ff, %eax       # imm = 0xFFFF80FF
movl %eax, -0x28(%rbp)
je 0x1cc71
jmp 0x1cc53
movl -0x28(%rbp), %eax
subl $0x1, %eax
je 0x1ccc8
jmp 0x1cc5d
movl -0x28(%rbp), %eax
addl $-0x2, %eax
subl $0x4, %eax
jb 0x1cd1f
jmp 0x1cf98
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x1a330
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1cc98
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1cf9f
jmp 0x1cc9a
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x1, (%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x60(%rax)
movq -0x20(%rbp), %rax
movb $-0x34, (%rax)
jmp 0x1cf98
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x1a330
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1ccef
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1cf9f
jmp 0x1ccf1
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x1, (%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x60(%rax)
movq -0x20(%rbp), %rax
movb $-0x70, (%rax)
jmp 0x1cf98
movq -0x10(%rbp), %rax
movl $0x0, 0x74(%rax)
jmp 0x1cd2c
movl -0x14(%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 $0x4, -0x14(%rbp)
jne 0x1cd8e
movq -0x10(%rbp), %rdi
movl $0x1, %esi
movl $0xe, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl %r8d, %edx
movq %r9, %rcx
callq 0x1b8f0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1cd85
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1cf9f
jmp 0x1cd87
movq -0x20(%rbp), %rax
movb $0x33, (%rax)
cmpl $0x5, -0x14(%rbp)
jne 0x1ce5c
movq -0x10(%rbp), %rax
cmpl $0x0, 0x70(%rax)
je 0x1cdf6
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x1a330
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1cdc9
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1cf9f
jmp 0x1cdcb
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x1, (%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x60(%rax)
movq -0x20(%rbp), %rax
movb $-0x67, (%rax)
jmp 0x1ce5a
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x1a330
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1ce1d
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1cf9f
jmp 0x1ce1f
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x2, (%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x2, %rcx
movq %rcx, 0x60(%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x48, (%rax)
movq -0x20(%rbp), %rax
movb $-0x67, (%rax)
jmp 0x1ce5c
movq -0x10(%rbp), %rax
cmpl $0x0, 0x70(%rax)
setne %dl
xorb $-0x1, %dl
movl $0x2, %eax
movl $0x3, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x1a330
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1cea8
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1cf9f
jmp 0x1ceaa
movl -0x24(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movslq -0x24(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x60(%rax), %rcx
movq %rcx, 0x60(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x70(%rax)
jne 0x1ceec
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x48, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, -0x20(%rbp)
movb $-0x9, (%rax)
movb 0x1385f(%rip), %cl      # 0x30762
orb $-0x40, %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movl -0x14(%rbp), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x3, %eax
ja 0x1cf67
movq -0x30(%rbp), %rax
leaq 0x133d8(%rip), %rcx     # 0x30300
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
orl $0x20, %ecx
movb %cl, (%rax)
jmp 0x1cf67
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
orl $0x28, %ecx
movb %cl, (%rax)
jmp 0x1cf67
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
orl $0x30, %ecx
movb %cl, (%rax)
jmp 0x1cf67
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
orl $0x38, %ecx
movb %cl, (%rax)
jmp 0x1cf69
movq -0x10(%rbp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %r8d
movl $0xe, %ecx
movq %r8, %rdx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x1cf94
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x1cf9f
jmp 0x1cf96
jmp 0x1cf98
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)