// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/example.c
// Function: get_generic_operand
static struct operand *get_generic_operand(struct bb_state *state, pseudo_t pseudo)
{
	struct hardreg *reg;
	struct storage *src;
	struct storage_hash *hash;
	struct operand *op = malloc(sizeof(*op));

	memset(op, 0, sizeof(*op));
	switch (pseudo->type) {
	case PSEUDO_VAL:
		op->type = OP_VAL;
		op->value = pseudo->value;
		break;

	case PSEUDO_SYM: {
		struct symbol *sym = pseudo->sym;
		op->type = OP_ADDR;
		if (sym->ctype.modifiers & MOD_NONLOCAL) {
			op->sym = sym;
			break;
		}
		op->base = hardregs + REG_EBP;
		op->offset = get_sym_frame_offset(state, pseudo);
		break;
	}

	default:
		reg = find_in_reg(state, pseudo);
		if (reg) {
			op->type = OP_REG;
			op->reg = reg;
			reg->busy++;
			break;
		}
		hash = find_pseudo_storage(state, pseudo, NULL);
		if (!hash)
			break;
		src = hash->storage;
		switch (src->type) {
		case REG_REG:
			op->type = OP_REG;
			op->reg = hardregs + src->regno;
			op->reg->busy++;
			break;
		case REG_FRAME:
			op->type = OP_MEM;
			op->offset = src->offset;
			op->base = hardregs + REG_EBP;
			break;
		case REG_STACK:
			op->type = OP_MEM;
			op->offset = src->offset;
			op->base = hardregs + REG_ESP;
			break;
		default:
			break;
		}
	}
	return op;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x28, %edi
callq 0x11200
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
subl $0x5, %eax
je 0x14c42
jmp 0x14c15
movl -0x3c(%rbp), %eax
subl $0x6, %eax
jne 0x14cac
jmp 0x14c23
movq -0x30(%rbp), %rax
movl $0x2, (%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x14e11
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movl $0x4, (%rax)
movq -0x38(%rbp), %rax
movq 0x68(%rax), %rax
andq $0x18, %rax
cmpq $0x0, %rax
je 0x14c7b
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x14e11
movq -0x30(%rbp), %rax
leaq 0x7851a(%rip), %rcx     # 0x8d1a0
addq $0x90, %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x14e20
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x14e11
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x137c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x14d03
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
andl $0xffff, %edx           # imm = 0xFFFF
addl $0x1, %edx
movl 0x10(%rax), %ecx
andl $0xffff, %edx           # imm = 0xFFFF
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl %edx, %ecx
movl %ecx, 0x10(%rax)
jmp 0x14e11
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x144a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x14d24
jmp 0x14e11
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
subl $0x1, %eax
je 0x14d5b
jmp 0x14d40
movl -0x40(%rbp), %eax
subl $0x2, %eax
je 0x14ddd
jmp 0x14d4e
movl -0x40(%rbp), %eax
subl $0x3, %eax
je 0x14dad
jmp 0x14e0d
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
movq -0x20(%rbp), %rax
movslq 0x10(%rax), %rax
leaq 0x7842c(%rip), %rcx     # 0x8d1a0
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x10(%rax), %edx
andl $0xffff, %edx           # imm = 0xFFFF
addl $0x1, %edx
movl 0x10(%rax), %ecx
andl $0xffff, %edx           # imm = 0xFFFF
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl %edx, %ecx
movl %ecx, 0x10(%rax)
jmp 0x14e0f
movq -0x30(%rbp), %rax
movl $0x3, (%rax)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
leaq 0x783d0(%rip), %rcx     # 0x8d1a0
addq $0x90, %rcx
movq %rcx, 0x18(%rax)
jmp 0x14e0f
movq -0x30(%rbp), %rax
movl $0x3, (%rax)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
leaq 0x783a0(%rip), %rcx     # 0x8d1a0
addq $0xa8, %rcx
movq %rcx, 0x18(%rax)
jmp 0x14e0f
jmp 0x14e0f
jmp 0x14e11
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)