// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/example.c
// Function: fill_reg
static struct hardreg *fill_reg(struct bb_state *state, struct hardreg *hardreg, pseudo_t pseudo)
{
	struct storage_hash *src;
	struct instruction *def;

	if (state->cc_target == pseudo) {
		flush_cc_cache_to_reg(state, pseudo, hardreg);
		return hardreg;
	}

	switch (pseudo->type) {
	case PSEUDO_VAL:
		output_insn(state, "movl $%lld,%s", pseudo->value, hardreg->name);
		break;
	case PSEUDO_SYM:
		src = find_pseudo_storage(state, pseudo, NULL);
		/* Static thing? */
		if (!src) {
			output_insn(state, "movl $<%s>,%s", show_pseudo(pseudo), hardreg->name);
			break;
		}
		switch (src->storage->type) {
		case REG_REG:
			/* Aiaiaiaiaii! Need to flush it to temporary memory */
			src = find_or_create_hash(pseudo, &state->internal);
			/* Fall through */
		default:
			alloc_stack(state, src->storage);
			/* Fall through */
		case REG_STACK:
		case REG_FRAME:
			flush_pseudo(state, pseudo, src->storage);
			output_insn(state, "leal %s,%s", show_memop(src->storage), hardreg->name);
			break;
		}
		break;
	case PSEUDO_ARG:
	case PSEUDO_REG:
		def = pseudo->def;
		if (def && (def->opcode == OP_SETVAL || def->opcode == OP_LABEL)) {
			output_insn(state, "movl $<%s>,%s", show_pseudo(def->target), hardreg->name);
			break;
		}
		src = find_pseudo_storage(state, pseudo, hardreg);
		if (!src)
			break;
		if (src->flags & TAG_DEAD)
			mark_reg_dead(state, pseudo, hardreg);
		output_insn(state, "mov.%d %s,%s", 32, show_memop(src->storage), hardreg->name);
		break;
	default:
		output_insn(state, "reload %s from %s", hardreg->name, show_pseudo(pseudo));
		break;
	}
	return hardreg;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
cmpq %rdx, 0x28(%rdi)
je 0x10f5b
movq %rdx, %r14
movl 0x4(%rdx), %eax
leal -0x3(%rax), %ecx
cmpl $0x2, %ecx
jb 0x10f6b
cmpl $0x5, %eax
je 0x10fe5
cmpl $0x6, %eax
jne 0x1106d
movq 0x18(%r14), %rdx
movq (%rbx), %rcx
leaq 0x2c416(%rip), %rsi     # 0x3d365
leaq 0x2c423(%rip), %r8      # 0x3d379
jmp 0x110aa
movq %r15, %rdi
movq %rbx, %rsi
callq 0x11406
jmp 0x110b1
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x10f8a
movl (%rax), %ecx
andl $0x7f, %ecx
addl $-0x47, %ecx
cmpl $0x1, %ecx
ja 0x10f8a
movq 0x20(%rax), %rdi
jmp 0x11091
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x11436
testq %rax, %rax
je 0x110b1
movq %rax, %r12
testb $0x1, 0x20(%rax)
je 0x10fb8
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x114e2
movq 0x18(%r12), %rdi
callq 0x11398
movq (%rbx), %r8
leaq 0x2c28f(%rip), %rsi     # 0x3d25b
leaq 0x2c3a6(%rip), %r9      # 0x3d379
pushq $0x20
popq %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x10bf5
jmp 0x110b1
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x11436
testq %rax, %rax
je 0x1108e
movq %rax, %r12
movq 0x18(%rax), %rax
movl (%rax), %ecx
leal -0x2(%rcx), %edx
cmpl $0x2, %edx
jb 0x1103c
cmpl $0x1, %ecx
jne 0x11024
leaq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x11336
movq %rax, %r12
movq 0x18(%rax), %rax
movl $0x2, (%rax)
movl 0x54594(%rip), %ecx     # 0x655c4
leal 0x4(%rcx), %edx
movl %edx, 0x5458b(%rip)     # 0x655c4
movl %ecx, 0x10(%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x10d8b
testq %rax, %rax
je 0x11057
movq %r15, %rdi
movq %rax, %rsi
callq 0x1111e
movq 0x18(%r12), %rdi
callq 0x11398
movq (%rbx), %rcx
leaq 0x2c32b(%rip), %rsi     # 0x3d396
jmp 0x110a0
movq (%rbx), %r15
movq %r14, %rdi
callq 0x1734a
leaq 0x2c328(%rip), %rsi     # 0x3d3a7
leaq 0x2c2f3(%rip), %r8      # 0x3d379
movq %r15, %rdx
movq %rax, %rcx
jmp 0x110aa
movq %r14, %rdi
callq 0x1734a
movq (%rbx), %rcx
leaq 0x2c2e2(%rip), %rsi     # 0x3d382
leaq 0x2c2d2(%rip), %r8      # 0x3d379
movq %rax, %rdx
xorl %eax, %eax
callq 0x10bf5
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq