// File: /workspace/github_c_makefile_star2_O3/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 0x11684
movq %rdx, %r14
movl 0x4(%rdx), %eax
leal -0x3(%rax), %ecx
cmpl $0x2, %ecx
jb 0x116b9
cmpl $0x5, %eax
je 0x11735
cmpl $0x6, %eax
jne 0x117bd
movq 0x18(%r14), %rdx
movq (%rbx), %rcx
leaq 0x33ced(%rip), %rsi     # 0x45365
leaq 0x33cfa(%rip), %r8      # 0x45379
jmp 0x117fa
movslq 0x20(%r15), %rax
movl $0x0, 0x20(%r15)
movq $0x0, 0x28(%r15)
leaq 0x4c021(%rip), %rcx     # 0x5d6c0
movq (%rcx,%rax,8), %rdx
movq (%rbx), %rcx
leaq 0x33d12(%rip), %rsi     # 0x453bf
leaq 0x33d17(%rip), %r8      # 0x453cb
jmp 0x117fa
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x116d8
movl (%rax), %ecx
andl $0x7f, %ecx
addl $-0x47, %ecx
cmpl $0x1, %ecx
ja 0x116d8
movq 0x20(%rax), %rdi
jmp 0x117e1
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x11b0c
testq %rax, %rax
je 0x11801
movq %rax, %r12
testb $0x1, 0x20(%rax)
je 0x11706
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x11bae
movq 0x18(%r12), %rdi
callq 0x11a9e
movq (%rbx), %r8
leaq 0x33b41(%rip), %rsi     # 0x4525b
leaq 0x33c58(%rip), %r9      # 0x45379
movl $0x20, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x11320
jmp 0x11801
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x11b0c
testq %rax, %rax
je 0x117de
movq %rax, %r12
movq 0x18(%rax), %rax
movl (%rax), %ecx
leal -0x2(%rcx), %edx
cmpl $0x2, %edx
jb 0x1178c
cmpl $0x1, %ecx
jne 0x11774
leaq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x11a3a
movq %rax, %r12
movq 0x18(%rax), %rax
movl $0x2, (%rax)
movl 0x59e44(%rip), %ecx     # 0x6b5c4
leal 0x4(%rcx), %edx
movl %edx, 0x59e3b(%rip)     # 0x6b5c4
movl %ecx, 0x10(%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1148c
testq %rax, %rax
je 0x117a7
movq %r15, %rdi
movq %rax, %rsi
callq 0x11810
movq 0x18(%r12), %rdi
callq 0x11a9e
movq (%rbx), %rcx
leaq 0x33bdb(%rip), %rsi     # 0x45396
jmp 0x117f0
movq (%rbx), %r15
movq %r14, %rdi
callq 0x17f3c
leaq 0x33bd8(%rip), %rsi     # 0x453a7
leaq 0x33ba3(%rip), %r8      # 0x45379
movq %r15, %rdx
movq %rax, %rcx
jmp 0x117fa
movq %r14, %rdi
callq 0x17f3c
movq (%rbx), %rcx
leaq 0x33b92(%rip), %rsi     # 0x45382
leaq 0x33b82(%rip), %r8      # 0x45379
movq %rax, %rdx
xorl %eax, %eax
callq 0x11320
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq