// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/compile-i386.c
// Function: emit_move
static void emit_move(struct storage *src, struct storage *dest,
		      struct symbol *ctype, const char *comment)
{
	unsigned int bits;
	unsigned int is_signed;
	unsigned int is_dest = (src->type == STOR_REG);
	const char *opname;

	if (ctype) {
		bits = ctype->bit_size;
		is_signed = is_signed_type(ctype);
	} else {
		bits = 32;
		is_signed = 0;
	}

	/*
	 * Are we moving from a register to a register?
	 * Make the new reg to be the "cache".
	 */
	if ((dest->type == STOR_REG) && (src->type == STOR_REG)) {
		struct storage *backing;

reg_reg_move:
		if (dest == src)
			return;

		backing = src->reg->contains;
		if (backing) {
			/* Is it still valid? */
			if (backing->reg != src->reg)
				backing = NULL;
			else
				backing->reg = dest->reg;
		}
		dest->reg->contains = backing;
		insn("mov", src, dest, NULL);
		return;
	}

	/*
	 * Are we moving to a register from a non-reg?
	 *
	 * See if we have the non-reg source already cached
	 * in a register..
	 */
	if (dest->type == STOR_REG) {
		if (src->reg) {
			struct reg_info *info = src->reg;
			if (info->contains == src) {
				src = reginfo_reg(info);
				goto reg_reg_move;
			}
		}
		dest->reg->contains = src;
		src->reg = dest->reg;
	}

	if (src->type == STOR_REG) {
		/* We could just mark the register dirty here and do lazy store.. */
		src->reg->contains = dest;
		dest->reg = src->reg;
	}

	if ((bits == 8) || (bits == 16)) {
		if (is_dest)
			opname = "mov";
		else
			opname = is_signed ? "movsx" : "movzx";
	} else
		opname = "mov";

	insn(opbits(opname, bits), src, dest, comment);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %eax
leaq 0xd61a(%rip), %rcx      # 0x4fc6f
testq %rdx, %rdx
je 0x42686
cmpb $0x3, (%rdx)
movq %rdx, %rdi
jne 0x42666
movq 0x60(%rdx), %rdi
movl 0x50(%rdx), %esi
cmpb $0x4, (%rdi)
je 0x4268b
testb $0x40, 0x69(%rdi)
leaq 0xd5f0(%rip), %rdx      # 0x4fc69
leaq 0xd5ef(%rip), %rcx      # 0x4fc6f
cmoveq %rdx, %rcx
jmp 0x4268b
movl $0x20, %esi
movl %eax, %edi
xorl $0x3, %edi
movl (%rbx), %edx
movl %edx, %r8d
xorl $0x3, %r8d
orl %edi, %r8d
je 0x42715
cmpl $0x3, %edx
jne 0x426e5
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x426d5
movq 0x8(%rdi), %rdx
movq %r14, %r8
cmpq %r14, %rdx
jne 0x426cd
movzbl 0x10(%rdi), %edi
leaq (%rdi,%rdi,2), %rdi
shll $0x4, %edi
leaq 0x28dd6(%rip), %r8      # 0x6b4a0
addq %rdi, %r8
cmpq %r14, %rdx
movq %r8, %r14
je 0x42715
movq 0x10(%rbx), %rdx
movq %r14, 0x8(%rdx)
movq 0x10(%rbx), %rdx
movq %rdx, 0x10(%r14)
cmpl $0x3, (%r14)
jne 0x426fb
movq 0x10(%r14), %rdx
movq %rbx, 0x8(%rdx)
movq 0x10(%r14), %rdx
movq %rdx, 0x10(%rbx)
cmpl $0x10, %esi
je 0x42705
cmpl $0x8, %esi
jne 0x42737
cmpl $0x3, %eax
leaq 0xd556(%rip), %rdi      # 0x4fc65
cmovneq %rcx, %rdi
jmp 0x4273e
cmpq %rbx, %r14
je 0x42731
movq 0x10(%r14), %rcx
movq 0x8(%rcx), %rax
testq %rax, %rax
je 0x4272d
cmpq %rcx, 0x10(%rax)
je 0x42755
xorl %eax, %eax
jmp 0x4275d
popq %rbx
popq %r14
popq %r15
retq
leaq 0xd527(%rip), %rdi      # 0x4fc65
callq 0x4277e
leaq 0x562a6(%rip), %rdi     # 0x989f0
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %rcx
jmp 0x42774
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
movq 0x10(%rbx), %rcx
movq %rax, 0x8(%rcx)
leaq 0xd4f9(%rip), %rdi      # 0x4fc65
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0x4259e