// File: /workspace/github_c_makefile_star2_O0/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: sljit_emit_ijump
int sljit_emit_ijump(struct sljit_compiler *compiler, int type, int src, long srcw)
{
	u_char *inst;
	struct sljit_jump *jump;

	CHECK_ERROR();
	CHECK(check_sljit_emit_ijump(compiler, type, src, srcw));
	ADJUST_LOCAL_OFFSET(src, srcw);

	CHECK_EXTRA_REGS(src, srcw, (void)0);

	if (compiler->flags_saved) {
		if (type <= SLJIT_JUMP)
			FAIL_IF(emit_restore_flags(compiler, 0));
		compiler->flags_saved = 0;
	}

	if (type >= SLJIT_CALL1) {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
		if (src == SLJIT_R2) {
			EMIT_MOV(compiler, TMP_REG1, 0, src, 0);
			src = TMP_REG1;
		}
		if (src == SLJIT_MEM1(SLJIT_SP) && type >= SLJIT_CALL3)
			srcw += sizeof(long);
#endif
#endif
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) && defined(_WIN64)
		if (src == SLJIT_R2) {
			EMIT_MOV(compiler, TMP_REG1, 0, src, 0);
			src = TMP_REG1;
		}
#endif
		FAIL_IF(call_with_args(compiler, type));
	}

	if (src == SLJIT_IMM) {
		jump = ensure_abuf(compiler, sizeof(struct sljit_jump));
		if (jump == NULL) {
			compiler->error = SLJIT_ERR_ALLOC_FAILED;
			return SLJIT_ERR_ALLOC_FAILED;
		}
		set_jump(jump, compiler, JUMP_ADDR);
		jump->u.target = srcw;

		/* Worst case size. */
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
		compiler->size += 5;
#else
		compiler->size += 10 + 3;
#endif

		inst = ensure_buf(compiler, 2);
		if (inst == NULL) {
			compiler->error = SLJIT_ERR_ALLOC_FAILED;
			return SLJIT_ERR_ALLOC_FAILED;
		}

		*inst++ = 0;
		*inst++ = type + 4;
	}
	else {
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
		/* REX_W is not necessary (src is not immediate). */
		compiler->mode32 = 1;
#endif
		inst = emit_x86_instruction(compiler, 1, 0, 0, src, srcw);
		FAIL_IF(!inst);
		*inst++ = GROUP_FF;
		*inst |= (type >= SLJIT_FAST_CALL) ? CALL_rm : JMP_rm;
	}
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x288dd
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x28aaa
jmp 0x288df
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0x28ac0
cmpl $0x8d, -0x18(%rbp)
jne 0x28907
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x74(%rax)
je 0x28946
cmpl $0x16, -0x14(%rbp)
jg 0x2893b
jmp 0x28919
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x21db0
cmpl $0x0, %eax
je 0x28937
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x28aaa
jmp 0x28939
jmp 0x2893b
movq -0x10(%rbp), %rax
movl $0x0, 0x74(%rax)
cmpl $0x19, -0x14(%rbp)
jl 0x28971
jmp 0x2894e
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x28770
cmpl $0x0, %eax
je 0x2896d
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x28aaa
jmp 0x2896f
jmp 0x28971
cmpl $0x40, -0x18(%rbp)
jne 0x28a34
movq -0x10(%rbp), %rdi
movl $0x20, %esi
callq 0x18f40
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x289aa
movq -0x10(%rbp), %rax
movl $0x2, (%rax)
movl $0x2, -0x4(%rbp)
jmp 0x28aaa
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
callq 0x28710
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0xd, %rcx
movq %rcx, 0x60(%rax)
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x1a330
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x28a07
movq -0x10(%rbp), %rax
movl $0x2, (%rax)
movl $0x2, -0x4(%rbp)
jmp 0x28aaa
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0x0, (%rax)
movl -0x14(%rbp), %eax
addl $0x4, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
jmp 0x28aa3
movq -0x10(%rbp), %rax
movl $0x1, 0x70(%rax)
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %r8d
movq -0x20(%rbp), %r9
movl $0x1, %esi
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1b8f0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x28a71
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x28aaa
jmp 0x28a73
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $-0x1, (%rax)
movl -0x14(%rbp), %ecx
movl $0x20, %edx
movl $0x10, %eax
cmpl $0x17, %ecx
cmovgel %eax, %edx
movq -0x28(%rbp), %rax
movzbl (%rax), %ecx
orl %edx, %ecx
movb %cl, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)