// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/liveness.c
// Function: track_pseudo_liveness
void track_pseudo_liveness(struct entrypoint *ep)
{
	struct basic_block *bb;

	/* Add all the bb pseudo usage */
	FOR_EACH_PTR(ep->bbs, bb) {
		struct instruction *insn;
		FOR_EACH_PTR(bb->insns, insn) {
			if (!insn->bb)
				continue;
			assert(insn->bb == bb);
			track_instruction_usage(bb, insn, insn_defines, insn_uses);
		} END_FOR_EACH_PTR(insn);
	} END_FOR_EACH_PTR(bb);

	/* Calculate liveness.. */
	do {
		liveness_changed = 0;
		FOR_EACH_PTR_REVERSE(ep->bbs, bb) {
			track_bb_liveness(bb);
		} END_FOR_EACH_PTR_REVERSE(bb);
	} while (liveness_changed);

	/* Remove the pseudos from the "defines" list that are used internally */
	FOR_EACH_PTR(ep->bbs, bb) {
		pseudo_t def;
		FOR_EACH_PTR(bb->defines, def) {
			struct basic_block *child;
			FOR_EACH_PTR(bb->children, child) {
				if (pseudo_in_list(child->needs, def))
					goto is_used;
			} END_FOR_EACH_PTR(child);
			DELETE_CURRENT_PTR(def);
is_used:
		;
		} END_FOR_EACH_PTR(def);
		PACK_PTR_LIST(&bb->defines);
	} END_FOR_EACH_PTR(bb);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, 0x20(%rsp)
movq 0x18(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x36d91
leaq 0x5f5(%rip), %r14       # 0x371c2
leaq 0x627(%rip), %r15       # 0x371fb
movq 0x8(%rsp), %rdx
xorl %esi, %esi
movq %rdx, 0x10(%rsp)
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %rsi
jge 0x36c6a
movq %rsi, 0x18(%rsp)
movq 0x18(%rdx,%rsi,8), %r12
cmpw $0x100, %ax             # imm = 0x100
jb 0x36c00
testq %r12, %r12
je 0x36c58
movq 0x28(%r12), %r13
testq %r13, %r13
je 0x36c58
movq %r13, %rbx
xorl %ebp, %ebp
movl (%rbx), %eax
movsbq %al, %rcx
cmpq %rcx, %rbp
jge 0x36c4f
movq 0x18(%rbx,%rbp,8), %rsi
cmpw $0x100, %ax             # imm = 0x100
jb 0x36c2a
testq %rsi, %rsi
je 0x36c4a
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x36c4a
cmpq %r12, %rax
jne 0x36f48
movq %r12, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x36f67
incq %rbp
jmp 0x36c0f
movq 0x10(%rbx), %rbx
cmpq %r13, %rbx
jne 0x36c0d
movq 0x18(%rsp), %rsi
incq %rsi
movq 0x10(%rsp), %rdx
jmp 0x36be0
movq 0x10(%rdx), %rdx
cmpq 0x8(%rsp), %rdx
jne 0x36bd9
jmp 0x36d91
movq %rcx, %rdx
movq %rcx, 0x38(%rsp)
movq 0x8(%rdx), %rdx
movsbq (%rdx), %rax
movl %eax, %eax
movq %rdx, 0x28(%rsp)
testl %eax, %eax
jle 0x36d7f
movq 0x10(%rdx,%rax,8), %rsi
decq %rax
cmpw $0x100, (%rdx)          # imm = 0x100
jb 0x36cb1
testq %rsi, %rsi
je 0x36c95
movq 0x48(%rsi), %rdi
testq %rdi, %rdi
je 0x36c95
movq %rsi, 0x10(%rsp)
movq %rax, 0x30(%rsp)
movq %rdi, %rdx
movq %rdi, 0x8(%rsp)
xorl %ebp, %ebp
movq %rdx, 0x18(%rsp)
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %rbp
jge 0x36d59
movq 0x18(%rdx,%rbp,8), %r14
cmpw $0x100, %ax             # imm = 0x100
jb 0x36cee
testq %r14, %r14
je 0x36d4c
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rbx
testq %rbx, %rbx
je 0x36d4c
movq %rbx, %r13
xorl %r12d, %r12d
movl (%r13), %eax
movsbq %al, %rcx
cmpq %rcx, %r12
jge 0x36d43
movq 0x18(%r13,%r12,8), %r15
cmpw $0x100, %ax             # imm = 0x100
jb 0x36d1f
testq %r15, %r15
je 0x36d3e
movq 0x50(%r15), %rdi
movq %r14, %rsi
callq 0x36b34
testl %eax, %eax
jne 0x36d3e
addq $0x48, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x37658
incq %r12
jmp 0x36d02
movq 0x10(%r13), %r13
cmpq %rbx, %r13
jne 0x36cff
incq %rbp
movq 0x18(%rsp), %rdx
jmp 0x36cd3
movq 0x10(%rdx), %rdx
movq 0x8(%rsp), %rdi
cmpq %rdi, %rdx
jne 0x36ccc
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rax
jmp 0x36c95
cmpq %rcx, %rdx
jne 0x36c86
cmpb $0x0, 0x531f1(%rip)     # 0x89f80
je 0x36daf
movb $0x0, 0x531e8(%rip)     # 0x89f80
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rcx
testq %rcx, %rcx
jne 0x36c7e
jmp 0x36f39
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x36f39
movq 0x40(%rsp), %rdx
xorl %esi, %esi
movq %rdx, 0x20(%rsp)
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %rsi
jge 0x36f2a
movq 0x18(%rdx,%rsi,8), %rdi
cmpw $0x100, %ax             # imm = 0x100
jb 0x36df5
testq %rdi, %rdi
je 0x36f22
movq %rsi, 0x38(%rsp)
movq 0x50(%rdi), %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x36f0f
movq 0x28(%rsp), %rsi
movq %rdi, 0x8(%rsp)
leaq 0x18(%rsi), %r8
leaq 0x10(%rsi), %rax
movq %rax, 0x30(%rsp)
xorl %r12d, %r12d
movq %rsi, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movl (%rsi), %eax
movsbl %al, %ecx
cmpl %ecx, %r12d
jge 0x36efc
movslq %r12d, %rbp
movq (%r8,%rbp,8), %r14
cmpw $0x100, %ax             # imm = 0x100
jb 0x36e54
testq %r14, %r14
je 0x36ef4
movq 0x20(%rdi), %r13
testq %r13, %r13
je 0x36ec1
movq %r13, %rbx
xorl %r15d, %r15d
movl (%rbx), %eax
movsbq %al, %rcx
cmpq %rcx, %r15
jge 0x36e93
movq 0x18(%rbx,%r15,8), %rcx
cmpw $0x100, %ax             # imm = 0x100
jb 0x36e7e
testq %rcx, %rcx
je 0x36e8e
movq 0x48(%rcx), %rdi
movq %r14, %rsi
callq 0x36b34
testl %eax, %eax
jne 0x36eb0
incq %r15
jmp 0x36e63
movq 0x10(%rbx), %rbx
cmpq %r13, %rbx
jne 0x36e60
movq 0x18(%rsp), %rsi
movsbl (%rsi), %ecx
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %r8
jmp 0x36ec4
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %r8
jmp 0x36ef4
movsbl %al, %ecx
leaq (%r8,%rbp,8), %rax
movswq %cx, %rcx
movq 0x30(%rsp), %rdx
leaq (%rdx,%rcx,8), %rcx
cmpq %rcx, %rax
jae 0x36ee7
movq 0x8(%rax), %rdx
movq %rdx, (%rax)
addq $0x8, %rax
jmp 0x36ed5
movl $0xf0f0f0f0, %ecx       # imm = 0xF0F0F0F0
movq %rcx, (%rax)
decb (%rsi)
decl %r12d
incl %r12d
jmp 0x36e30
movq 0x30(%rsp), %rax
movq (%rax), %rsi
cmpq 0x28(%rsp), %rsi
jne 0x36e16
addq $0x50, %rdi
callq 0x1fa10
movq 0x20(%rsp), %rdx
movq 0x38(%rsp), %rsi
incq %rsi
jmp 0x36dd2
movq 0x10(%rdx), %rdx
cmpq 0x40(%rsp), %rdx
jne 0x36dcb
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3fc1(%rip), %rdi      # 0x3af10
leaq 0xd8fa(%rip), %rsi      # 0x44850
leaq 0xd8fe(%rip), %rcx      # 0x4485b
movl $0xd5, %edx
callq 0xe120