// File: /workspace/github_c_makefile_star2_O3/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
leaq 0xd62d(%rip), %rdi      # 0x4ebff
testq %rdx, %rdx
je 0x41604
movzbl (%rdx), %ecx
movq %rdx, %rax
cmpl $0x3, %ecx
jne 0x415e9
movq 0x60(%rdx), %rax
movzbl (%rax), %ecx
movl 0x50(%rdx), %esi
cmpl $0x4, %ecx
je 0x41609
movq 0x68(%rax), %rax
btl $0xe, %eax
jb 0x41609
leaq 0xd5f7(%rip), %rdi      # 0x4ebf9
jmp 0x41609
movl $0x20, %esi
movl (%r14), %eax
cmpl $0x3, (%rbx)
movl %eax, %ecx
jne 0x41661
cmpl $0x3, %eax
jne 0x4163f
cmpq %rbx, %r14
je 0x416ae
movq 0x10(%r14), %rcx
movq 0x8(%rcx), %rax
testq %rax, %rax
je 0x41638
cmpq %rcx, 0x10(%rax)
je 0x416ce
xorl %eax, %eax
jmp 0x416d6
movq 0x10(%r14), %rcx
testq %rcx, %rcx
je 0x4164e
cmpq %r14, 0x8(%rcx)
je 0x416b4
movq 0x10(%rbx), %rcx
movq %r14, 0x8(%rcx)
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%r14)
movl (%r14), %ecx
cmpl $0x3, %ecx
jne 0x41676
movq 0x10(%r14), %rcx
movq %rbx, 0x8(%rcx)
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rbx)
cmpl $0x10, %esi
je 0x41680
cmpl $0x8, %esi
jne 0x41690
cmpl $0x3, %eax
leaq 0xd56b(%rip), %rax      # 0x4ebf5
cmoveq %rax, %rdi
jmp 0x41697
leaq 0xd55e(%rip), %rdi      # 0x4ebf5
callq 0x416f7
leaq 0x5534d(%rip), %rdi     # 0x969f0
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %rcx
jmp 0x416ed
popq %rbx
popq %r14
popq %r15
retq
movzbl 0x10(%rcx), %eax
leaq (%rax,%rax,2), %rax
shll $0x4, %eax
leaq 0x27dda(%rip), %r14     # 0x694a0
addq %rax, %r14
jmp 0x41618
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
movq 0x10(%rbx), %rcx
movq %rax, 0x8(%rcx)
leaq 0xd510(%rip), %rdi      # 0x4ebf5
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0x4151d