// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/liveness.c
// Function: track_instruction_usage
static void track_instruction_usage(struct basic_block *bb, struct instruction *insn,
	void (*def)(struct basic_block *, pseudo_t),
	void (*use)(struct basic_block *, pseudo_t))
{
	pseudo_t pseudo;

	#define USES(x)		use(bb, insn->x)
	#define DEFINES(x)	def(bb, insn->x)

	switch (insn->opcode) {
	case OP_RET:
	case OP_COMPUTEDGOTO:
		USES(src);
		break;

	case OP_CBR:
	case OP_SWITCH:
		USES(cond);
		break;

	/* Binary */
	case OP_BINARY ... OP_BINARY_END:
	case OP_FPCMP ... OP_FPCMP_END:
	case OP_BINCMP ... OP_BINCMP_END:
		USES(src1); USES(src2); DEFINES(target);
		break;

	/* Uni */
	case OP_UNOP ... OP_UNOP_END:
	case OP_SYMADDR:
	case OP_SLICE:
		USES(src); DEFINES(target);
		break;

	case OP_SEL:
		USES(src1); USES(src2); USES(src3); DEFINES(target);
		break;
	
	/* Memory */
	case OP_LOAD:
		USES(src); DEFINES(target);
		break;

	case OP_STORE:
		USES(src); USES(target);
		break;

	case OP_LABEL:
	case OP_SETVAL:
	case OP_SETFVAL:
		DEFINES(target);
		break;

	/* Other */
	case OP_PHI:
		/* Phi-nodes are "backwards" nodes. Their def doesn't matter */
		phi_defines(insn, insn->target, def);
		break;

	case OP_PHISOURCE:
		/*
		 * We don't care about the phi-source define, they get set
		 * up and expanded by the OP_PHI
		 */
		USES(phi_src);
		break;

	case OP_CALL:
		USES(func);
		if (insn->target != VOID)
			DEFINES(target);
		FOR_EACH_PTR(insn->arguments, pseudo) {
			use(bb, pseudo);
		} END_FOR_EACH_PTR(pseudo);
		break;

	case OP_ASM:
		asm_liveness(bb, insn, def, use);
		break;

	case OP_RANGE:
		USES(src1); USES(src2); USES(src3);
		break;

	case OP_BADOP:
	case OP_NOP:
	case OP_CONTEXT:
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x50, %eax
ja 0x5e47c
movq -0x50(%rbp), %rax
leaq 0xf051(%rip), %rcx      # 0x6d21c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
jmp 0x5e47c
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
jmp 0x5e47c
jmp 0x5e204
jmp 0x5e206
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x38(%rcx), %rsi
callq *%rax
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rsi
callq *%rax
jmp 0x5e47c
jmp 0x5e243
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rsi
callq *%rax
jmp 0x5e47c
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x38(%rcx), %rsi
callq *%rax
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rsi
callq *%rax
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rsi
callq *%rax
jmp 0x5e47c
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rsi
callq *%rax
jmp 0x5e47c
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rsi
callq *%rax
jmp 0x5e47c
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rsi
callq *%rax
jmp 0x5e47c
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x5ece0
jmp 0x5e47c
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
jmp 0x5e47c
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
movq -0x10(%rbp), %rax
leaq 0x2da40(%rip), %rcx     # 0x8bdb0
cmpq %rcx, 0x20(%rax)
je 0x5e388
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rsi
callq *%rax
jmp 0x5e38a
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x5e3af
jmp 0x5e429
jmp 0x5e3b1
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x38(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x5e415
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x5e3fc
cmpq $0x0, -0x28(%rbp)
jne 0x5e3fc
jmp 0x5e40a
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq *%rax
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x5e3b8
jmp 0x5e417
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq -0x30(%rbp), %rax
jne 0x5e3b1
jmp 0x5e47c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x5ede0
jmp 0x5e47c
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x38(%rcx), %rsi
callq *%rax
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rsi
callq *%rax
jmp 0x5e47c
jmp 0x5e47c
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)