// File: /workspace/github_c_makefile_star2_O1/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 0x116ba
movq %rdx, %r14
movl 0x4(%rdx), %eax
leal -0x3(%rax), %ecx
cmpl $0x2, %ecx
jb 0x116ef
cmpl $0x5, %eax
je 0x1176b
cmpl $0x6, %eax
jne 0x117f4
movq 0x18(%r14), %rdx
movq (%rbx), %rcx
leaq 0x34cb7(%rip), %rsi     # 0x46365
leaq 0x34cc4(%rip), %r8      # 0x46379
jmp 0x11831
movslq 0x20(%r15), %rax
movl $0x0, 0x20(%r15)
movq $0x0, 0x28(%r15)
leaq 0x4dfdb(%rip), %rcx     # 0x5f6b0
movq (%rcx,%rax,8), %rdx
movq (%rbx), %rcx
leaq 0x34cdc(%rip), %rsi     # 0x463bf
leaq 0x34ce1(%rip), %r8      # 0x463cb
jmp 0x11831
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x1170e
movl (%rax), %ecx
andl $0x7f, %ecx
addl $-0x47, %ecx
cmpl $0x1, %ecx
ja 0x1170e
movq 0x20(%rax), %rdi
jmp 0x11818
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x11b87
testq %rax, %rax
je 0x11838
movq %rax, %r12
testb $0x1, 0x20(%rax)
je 0x1173c
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x11c29
movq 0x18(%r12), %rdi
callq 0x11b19
movq (%rbx), %r8
leaq 0x34b0b(%rip), %rsi     # 0x4625b
leaq 0x34c22(%rip), %r9      # 0x46379
movl $0x20, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x11334
jmp 0x11838
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x11b87
testq %rax, %rax
je 0x11815
movq %rax, %r12
movq 0x18(%rax), %rax
movl (%rax), %eax
leal -0x2(%rax), %ecx
cmpl $0x2, %ecx
jb 0x117c3
cmpl $0x1, %eax
jne 0x117a6
leaq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x11ab5
movq %rax, %r12
movq 0x18(%r12), %rax
movl $0x2, (%rax)
movl 0x5be0d(%rip), %ecx     # 0x6d5c4
leal 0x4(%rcx), %edx
movl %edx, 0x5be04(%rip)     # 0x6d5c4
movl %ecx, 0x10(%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x114a0
testq %rax, %rax
je 0x117de
movq %r15, %rdi
movq %rax, %rsi
callq 0x11883
movq 0x18(%r12), %rdi
callq 0x11b19
movq (%rbx), %rcx
leaq 0x34ba4(%rip), %rsi     # 0x46396
jmp 0x11827
movq (%rbx), %r15
movq %r14, %rdi
callq 0x18180
leaq 0x34ba1(%rip), %rsi     # 0x463a7
leaq 0x34b6c(%rip), %r8      # 0x46379
movq %r15, %rdx
movq %rax, %rcx
jmp 0x11831
movq %r14, %rdi
callq 0x18180
movq (%rbx), %rcx
leaq 0x34b5b(%rip), %rsi     # 0x46382
leaq 0x34b4b(%rip), %r8      # 0x46379
movq %rax, %rdx
xorl %eax, %eax
callq 0x11334
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq