// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: emit_shift
static int emit_shift(struct sljit_compiler *compiler,
	u_char mode,
	int dst, long dstw,
	int src1, long src1w,
	int src2, long src2w)
{
	u_char* inst;

	if ((src2 & SLJIT_IMM) || (src2 == SLJIT_PREF_SHIFT_REG)) {
		if (dst == src1 && dstw == src1w) {
			inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, src2, src2w, dst, dstw);
			FAIL_IF(!inst);
			*inst |= mode;
			return SLJIT_SUCCESS;
		}
		if (dst == SLJIT_UNUSED) {
			EMIT_MOV(compiler, TMP_REG1, 0, src1, src1w);
			inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, src2, src2w, TMP_REG1, 0);
			FAIL_IF(!inst);
			*inst |= mode;
			return SLJIT_SUCCESS;
		}
		if (dst == SLJIT_PREF_SHIFT_REG && src2 == SLJIT_PREF_SHIFT_REG) {
			EMIT_MOV(compiler, TMP_REG1, 0, src1, src1w);
			inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_PREF_SHIFT_REG, 0, TMP_REG1, 0);
			FAIL_IF(!inst);
			*inst |= mode;
			EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REG1, 0);
			return SLJIT_SUCCESS;
		}
		if (FAST_IS_REG(dst)) {
			EMIT_MOV(compiler, dst, 0, src1, src1w);
			inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, src2, src2w, dst, 0);
			FAIL_IF(!inst);
			*inst |= mode;
			return SLJIT_SUCCESS;
		}

		EMIT_MOV(compiler, TMP_REG1, 0, src1, src1w);
		inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, src2, src2w, TMP_REG1, 0);
		FAIL_IF(!inst);
		*inst |= mode;
		EMIT_MOV(compiler, dst, dstw, TMP_REG1, 0);
		return SLJIT_SUCCESS;
	}

	if (dst == SLJIT_PREF_SHIFT_REG) {
		EMIT_MOV(compiler, TMP_REG1, 0, src1, src1w);
		EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, src2, src2w);
		inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_PREF_SHIFT_REG, 0, TMP_REG1, 0);
		FAIL_IF(!inst);
		*inst |= mode;
		EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REG1, 0);
	}
	else if (FAST_IS_REG(dst) && dst != src2 && !ADDRESSING_DEPENDS_ON(src2, dst)) {
		if (src1 != dst)
			EMIT_MOV(compiler, dst, 0, src1, src1w);
		EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_PREF_SHIFT_REG, 0);
		EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, src2, src2w);
		inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_PREF_SHIFT_REG, 0, dst, 0);
		FAIL_IF(!inst);
		*inst |= mode;
		EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REG1, 0);
	}
	else {
		/* This case is really difficult, since ecx itself may used for
		   addressing, and we must ensure to work even in that case. */
		EMIT_MOV(compiler, TMP_REG1, 0, src1, src1w);
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
		EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_PREF_SHIFT_REG, 0);
#else
		/* [esp+0] contains the flags. */
		EMIT_MOV(compiler, SLJIT_MEM1(SLJIT_SP), sizeof(long), SLJIT_PREF_SHIFT_REG, 0);
#endif
		EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, src2, src2w);
		inst = emit_x86_instruction(compiler, 1 | EX86_SHIFT_INS, SLJIT_PREF_SHIFT_REG, 0, TMP_REG1, 0);
		FAIL_IF(!inst);
		*inst |= mode;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
		EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, TMP_REG2, 0);
#else
		EMIT_MOV(compiler, SLJIT_PREF_SHIFT_REG, 0, SLJIT_MEM1(SLJIT_SP), sizeof(long));
#endif
		EMIT_MOV(compiler, dst, dstw, TMP_REG1, 0);
	}

	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movq 0x18(%rbp), %rsi
movl 0x10(%rbp), %esi
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movl 0x10(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x2c4dd
cmpl $0x3, 0x10(%rbp)
jne 0x2c7de
movl -0x18(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x2c542
movq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0x2c542
movq -0x10(%rbp), %rdi
movl 0x10(%rbp), %edx
movq 0x18(%rbp), %rcx
movl -0x18(%rbp), %r8d
movq -0x20(%rbp), %r9
movl $0x21, %esi
callq 0x1b8f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2c525
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c527
movzbl -0x11(%rbp), %edx
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl %edx, %ecx
movb %cl, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2cb64
cmpl $0x0, -0x18(%rbp)
jne 0x2c5d2
jmp 0x2c54e
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
movl $0xe, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c57a
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c57c
movq -0x10(%rbp), %rdi
movl 0x10(%rbp), %edx
movq 0x18(%rbp), %rcx
movl $0x21, %esi
movl $0xe, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x1b8f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2c5b5
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c5b7
movzbl -0x11(%rbp), %edx
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl %edx, %ecx
movb %cl, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2cb64
cmpl $0x3, -0x18(%rbp)
jne 0x2c69d
cmpl $0x3, 0x10(%rbp)
jne 0x2c69d
jmp 0x2c5e8
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
movl $0xe, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c614
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c616
movq -0x10(%rbp), %rdi
movl $0x21, %esi
movl $0x3, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0xe, %r8d
movq %r9, %rcx
callq 0x1b8f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2c650
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c652
movzbl -0x11(%rbp), %edx
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl %edx, %ecx
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %r8d
movl $0xe, %ecx
movq %r8, %rdx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c68f
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c691
movl $0x0, -0x4(%rbp)
jmp 0x2cb64
cmpl $0x3f, -0x18(%rbp)
jg 0x2c729
jmp 0x2c6a9
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c6d3
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c6d5
movq -0x10(%rbp), %rdi
movl 0x10(%rbp), %edx
movq 0x18(%rbp), %rcx
movl -0x18(%rbp), %r8d
movl $0x21, %esi
xorl %eax, %eax
movl %eax, %r9d
callq 0x1b8f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2c70c
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c70e
movzbl -0x11(%rbp), %edx
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl %edx, %ecx
movb %cl, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c72b
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
movl $0xe, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c757
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c759
movq -0x10(%rbp), %rdi
movl 0x10(%rbp), %edx
movq 0x18(%rbp), %rcx
movl $0x21, %esi
movl $0xe, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x1b8f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2c792
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c794
movzbl -0x11(%rbp), %edx
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl %edx, %ecx
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
movq -0x20(%rbp), %rdx
movl $0xe, %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c7d0
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c7d2
movl $0x0, -0x4(%rbp)
jmp 0x2cb64
cmpl $0x3, -0x18(%rbp)
jne 0x2c8c8
jmp 0x2c7ea
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
movl $0xe, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c816
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c818
jmp 0x2c81a
movq -0x10(%rbp), %rdi
movl 0x10(%rbp), %ecx
movq 0x18(%rbp), %r8
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c846
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c848
movq -0x10(%rbp), %rdi
movl $0x21, %esi
movl $0x3, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0xe, %r8d
movq %r9, %rcx
callq 0x1b8f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2c882
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c884
movzbl -0x11(%rbp), %edx
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl %edx, %ecx
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %r8d
movl $0xe, %ecx
movq %r8, %rdx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c8c1
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c8c3
jmp 0x2cb5d
cmpl $0x3f, -0x18(%rbp)
jg 0x2ca24
movl -0x18(%rbp), %eax
cmpl 0x10(%rbp), %eax
je 0x2ca24
movl 0x10(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2c90c
movl 0x10(%rbp), %eax
andl $0x3f, %eax
cmpl -0x18(%rbp), %eax
je 0x2ca24
movl 0x10(%rbp), %eax
sarl $0x8, %eax
andl $0x3f, %eax
cmpl -0x18(%rbp), %eax
je 0x2ca24
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0x2c944
jmp 0x2c916
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c940
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c942
jmp 0x2c944
jmp 0x2c946
movq -0x10(%rbp), %rdi
movl $0xe, %esi
xorl %eax, %eax
movl %eax, %r8d
movl $0x3, %ecx
movq %r8, %rdx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c974
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c976
jmp 0x2c978
movq -0x10(%rbp), %rdi
movl 0x10(%rbp), %ecx
movq 0x18(%rbp), %r8
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2c9a4
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c9a6
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %r8d
movl $0x21, %esi
movl $0x3, %edx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %rcx
callq 0x1b8f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2c9de
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2c9e0
movzbl -0x11(%rbp), %edx
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl %edx, %ecx
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %r8d
movl $0xe, %ecx
movq %r8, %rdx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2ca1d
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2ca1f
jmp 0x2cb5b
jmp 0x2ca26
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
movl $0xe, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2ca52
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2ca54
jmp 0x2ca56
movq -0x10(%rbp), %rdi
movl $0xf, %esi
xorl %eax, %eax
movl %eax, %r8d
movl $0x3, %ecx
movq %r8, %rdx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2ca84
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2ca86
jmp 0x2ca88
movq -0x10(%rbp), %rdi
movl 0x10(%rbp), %ecx
movq 0x18(%rbp), %r8
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2cab4
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2cab6
movq -0x10(%rbp), %rdi
movl $0x21, %esi
movl $0x3, %edx
xorl %eax, %eax
movl %eax, %r9d
movl $0xe, %r8d
movq %r9, %rcx
callq 0x1b8f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2caed
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2caef
movzbl -0x11(%rbp), %edx
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
orl %edx, %ecx
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %r8d
movl $0xf, %ecx
movq %r8, %rdx
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2cb29
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2cb2b
jmp 0x2cb2d
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
movq -0x20(%rbp), %rdx
movl $0xe, %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x1d0a0
cmpl $0x0, %eax
je 0x2cb57
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2cb64
jmp 0x2cb59
jmp 0x2cb5b
jmp 0x2cb5d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq