// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/assembler/ins_enc.c
// Function: ins_enc_movsxd
void ins_enc_movsxd(
	Instruction *ins,
	InstructionEncoderData *data
) {
	_CHECK_PARAMS(2);

	ParserASTNode *ins_node = data->ins_node;

	ParserASTNode *target = data->ins_node->childs[0];

	ParserASTNode *source = data->ins_node->childs[1];

	size_t target_size = ins_get_oprd_size(data->ctx, target);
	if (target_size != 8) {
		data->ctx->syntax_error_node_msg(
			data->ctx,
			target,
			"operand type not matched."
		);
	}

	size_t source_size = ins_get_oprd_size(data->ctx, source);
	if (source_size != 4) {
		data->ctx->syntax_error_node_msg(
			data->ctx,
			target,
			"operand type not matched."
		);
	}

	EncoderInstruction enc_ins;
	
	ins_init(data->ctx, ins, ins_node, &enc_ins);

	ins_fill_GX(data->ctx, ins, target, &enc_ins);

	ins_fill_EX(data->ctx, ins, source, &enc_ins);

	_output(data, &enc_ins);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1fc5c
jmp 0x1fc7b
leaq 0x29ea3(%rip), %rdi     # 0x49b06
leaq 0x2b3b6(%rip), %rsi     # 0x4b020
movl $0x22f, %edx            # imm = 0x22F
leaq 0x2b7f7(%rip), %rcx     # 0x4b46d
callq 0xa0b0
cmpq $0x0, -0x10(%rbp)
je 0x1fc84
jmp 0x1fca3
leaq 0x30364(%rip), %rdi     # 0x4ffef
leaq 0x2b38e(%rip), %rsi     # 0x4b020
movl $0x22f, %edx            # imm = 0x22F
leaq 0x2b7cf(%rip), %rcx     # 0x4b46d
callq 0xa0b0
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x1fcaf
jmp 0x1fcce
leaq 0x2b3c7(%rip), %rdi     # 0x4b07d
leaq 0x2b363(%rip), %rsi     # 0x4b020
movl $0x22f, %edx            # imm = 0x22F
leaq 0x2b7a4(%rip), %rcx     # 0x4b46d
callq 0xa0b0
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x2, 0x44(%rax)
jne 0x1fcdd
jmp 0x1fcfc
leaq 0x2b3a8(%rip), %rdi     # 0x4b08c
leaq 0x2b335(%rip), %rsi     # 0x4b020
movl $0x22f, %edx            # imm = 0x22F
leaq 0x2b776(%rip), %rcx     # 0x4b46d
callq 0xa0b0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1c580
movq %rax, -0x30(%rbp)
cmpq $0x8, -0x30(%rbp)
je 0x1fd69
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x20(%rbp), %rsi
leaq 0x2a36c(%rip), %rdx     # 0x4a0d3
callq *%rax
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x1c580
movq %rax, -0x38(%rbp)
cmpq $0x4, -0x38(%rbp)
je 0x1fda6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x20(%rbp), %rsi
leaq 0x2a32f(%rip), %rdx     # 0x4a0d3
callq *%rax
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x98(%rbp), %rcx
callq 0x1a9e0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x98(%rbp), %rcx
callq 0x1ab40
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x98(%rbp), %rcx
callq 0x1ad40
movq -0x10(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x1e570
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)