// File: /workspace/github_c_makefile_star2_O1/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 0x3e80b
leaq 0x571(%rip), %r14       # 0x3ecb9
leaq 0x5a3(%rip), %r15       # 0x3ecf2
movq 0x8(%rsp), %rdx
movzwl (%rdx), %eax
testb %al, %al
jle 0x3e7fc
xorl %esi, %esi
movq %rdx, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x18(%rdx,%rsi,8), %r12
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3e77f
testq %r12, %r12
je 0x3e7e0
movq 0x28(%r12), %r13
testq %r13, %r13
je 0x3e7e0
movq %r13, %rbx
movzwl (%rbx), %eax
testb %al, %al
jle 0x3e7d7
xorl %ebp, %ebp
movq 0x18(%rbx,%rbp,8), %rsi
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3e7a9
testq %rsi, %rsi
je 0x3e7c9
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x3e7c9
cmpq %r12, %rax
jne 0x3eb25
movq %r12, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x3eb44
incq %rbp
movl (%rbx), %eax
movsbq %al, %rcx
cmpq %rcx, %rbp
jl 0x3e795
movq 0x10(%rbx), %rbx
cmpq %r13, %rbx
jne 0x3e78c
movq 0x18(%rsp), %rsi
incq %rsi
movq 0x10(%rsp), %rdx
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %rsi
jl 0x3e766
movq 0x10(%rdx), %rdx
cmpq 0x8(%rsp), %rdx
jne 0x3e754
movb $0x0, 0x5276e(%rip)     # 0x90f80
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x3e95b
movq 0x28(%rsp), %rcx
movq 0x8(%rcx), %rcx
movsbl (%rcx), %eax
testw %ax, %ax
jle 0x3e950
cwtl
decl %eax
movq %rcx, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq 0x18(%rcx,%rax,8), %rax
movq %rax, 0x10(%rsp)
cmpw $0x100, (%rcx)          # imm = 0x100
jb 0x3e868
cmpq $0x0, 0x10(%rsp)
je 0x3e939
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x3e939
movq 0x8(%rsp), %rdx
movzwl (%rdx), %eax
testb %al, %al
jle 0x3e92a
xorl %ebp, %ebp
movq %rdx, 0x18(%rsp)
movq 0x18(%rdx,%rbp,8), %r14
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3e8aa
testq %r14, %r14
je 0x3e913
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rbx
testq %rbx, %rbx
je 0x3e913
movq %rbx, %r13
movzwl (%r13), %eax
testb %al, %al
jle 0x3e90a
xorl %r12d, %r12d
movq 0x18(%r13,%r12,8), %r15
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3e8db
testq %r15, %r15
je 0x3e8fa
movq 0x50(%r15), %rdi
movq %r14, %rsi
callq 0x22938
testb %al, %al
jne 0x3e8fa
addq $0x48, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3f2eb
incq %r12
movl (%r13), %eax
movsbq %al, %rcx
cmpq %rcx, %r12
jl 0x3e8c7
movq 0x10(%r13), %r13
cmpq %rbx, %r13
jne 0x3e8bb
incq %rbp
movq 0x18(%rsp), %rdx
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %rbp
jl 0x3e896
movq 0x10(%rdx), %rdx
cmpq 0x8(%rsp), %rdx
jne 0x3e884
movq 0x38(%rsp), %rcx
leaq -0x1(%rcx), %rax
testq %rcx, %rcx
movq 0x30(%rsp), %rcx
jg 0x3e846
cmpq 0x28(%rsp), %rcx
jne 0x3e82e
cmpb $0x0, 0x5261e(%rip)     # 0x90f80
jne 0x3e80b
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x3eb16
movq 0x40(%rsp), %rdx
movzwl (%rdx), %eax
testb %al, %al
jle 0x3eb07
xorl %esi, %esi
movq %rdx, 0x20(%rsp)
movq 0x18(%rdx,%rsi,8), %rdi
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3e9ae
testq %rdi, %rdi
je 0x3eaf5
movq %rsi, 0x28(%rsp)
movq 0x50(%rdi), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x3eae2
movq 0x30(%rsp), %r8
movq %rdi, 0x8(%rsp)
movzwl (%r8), %eax
testb %al, %al
jle 0x3ead3
leaq 0x18(%r8), %r9
leaq 0x10(%r8), %rcx
movq %rcx, 0x38(%rsp)
xorl %r12d, %r12d
movq %r8, 0x18(%rsp)
movq %r9, 0x10(%rsp)
movslq %r12d, %r13
movq (%r9,%r13,8), %r14
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3ea0f
testq %r14, %r14
je 0x3eac1
movq 0x20(%rdi), %rbp
testq %rbp, %rbp
je 0x3ea60
movq %rbp, %rbx
movzwl (%rbx), %eax
testb %al, %al
jle 0x3ea57
xorl %r15d, %r15d
movq 0x18(%rbx,%r15,8), %rcx
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3ea39
testq %rcx, %rcx
je 0x3ea49
movq 0x48(%rcx), %rdi
movq %r14, %rsi
callq 0x22938
testb %al, %al
jne 0x3ea9a
incq %r15
movl (%rbx), %eax
movsbq %al, %rcx
cmpq %rcx, %r15
jl 0x3ea25
movq 0x10(%rbx), %rbx
cmpq %rbp, %rbx
jne 0x3ea1b
movq 0x10(%rsp), %r9
leaq (%r9,%r13,8), %rax
movq 0x18(%rsp), %r8
movsbq (%r8), %rcx
movq 0x38(%rsp), %rdx
leaq (%rdx,%rcx,8), %rcx
cmpq %rcx, %rax
jae 0x3eaab
movq 0x8(%rsp), %rdi
leaq 0x8(%rax), %rdx
movq 0x8(%rax), %rsi
movq %rsi, (%rax)
movq %rdx, %rax
cmpq %rcx, %rdx
jb 0x3ea85
jmp 0x3eab3
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r9
jmp 0x3eac1
movq %rax, %rdx
movq 0x8(%rsp), %rdi
movl $0xf0f0f0f0, %eax       # imm = 0xF0F0F0F0
movq %rax, (%rdx)
decb (%r8)
decl %r12d
incl %r12d
movl (%r8), %eax
movsbl %al, %ecx
cmpl %ecx, %r12d
jl 0x3e9f5
movq 0x10(%r8), %r8
cmpq 0x30(%rsp), %r8
jne 0x3e9cf
addq $0x50, %rdi
callq 0x22731
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
incq %rsi
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %rsi
jl 0x3e996
movq 0x10(%rdx), %rdx
cmpq 0x40(%rsp), %rdx
jne 0x3e984
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x43b4(%rip), %rdi      # 0x42ee0
leaq 0xdb5d(%rip), %rsi      # 0x4c690
leaq 0xdb61(%rip), %rcx      # 0x4c69b
movl $0xd5, %edx
callq 0xe120