// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/flow.c
// Function: remove_phisources
int remove_phisources(struct basic_block *par, struct basic_block *old)
{
	struct instruction *insn;
	int changed = 0;

	FOR_EACH_PTR(old->insns, insn) {
		pseudo_t phi;

		if (!insn->bb)
			continue;
		if (insn->opcode != OP_PHI)
			return changed;

		// found a phi-node in the target BB,
		// now look after its phi-sources.
		FOR_EACH_PTR(insn->phi_list, phi) {
			struct instruction *phisrc = phi->def;

			if (phi == VOID)
				continue;
			assert(phisrc->phi_node == insn);
			if (phisrc->bb != par)
				continue;
			// found a phi-source corresponding to this edge:
			// remove it but avoid the recursive killing.
			REPLACE_CURRENT_PTR(phi, VOID);
			remove_use(&phisrc->src);
			phisrc->bb = NULL;
			changed |= REPEAT_CSE;
			// Only the first one must be removed.
			goto next;
		} END_FOR_EACH_PTR(phi);
next: ;
	} END_FOR_EACH_PTR(insn);
	return changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%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 0x58b62
jmp 0x58d41
jmp 0x58b64
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 0x58d29
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x58bb6
cmpq $0x0, -0x20(%rbp)
jne 0x58bb6
jmp 0x58d1b
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x58bc6
jmp 0x58d1b
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
cmpl $0x46, %eax
je 0x58bdf
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x58d47
jmp 0x58be1
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x58c09
jmp 0x58d17
jmp 0x58c0b
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq -0x60(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x58cff
movq -0x60(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movq -0x60(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x58c5d
cmpq $0x0, -0x50(%rbp)
jne 0x58c5d
jmp 0x58cf1
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
leaq 0x33140(%rip), %rax     # 0x8bdb0
cmpq %rax, -0x50(%rbp)
jne 0x58c78
jmp 0x58cf1
movq -0x78(%rbp), %rax
movq 0x38(%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0x58c88
jmp 0x58ca7
leaq 0x1407d(%rip), %rdi     # 0x6cd0c
leaq 0x1408f(%rip), %rsi     # 0x6cd25
movl $0x33, %edx
leaq 0x1408a(%rip), %rcx     # 0x6cd2c
callq 0x11120
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x10(%rbp), %rax
je 0x58cb7
jmp 0x58cf1
jmp 0x58cb9
movq -0x60(%rbp), %rax
movslq -0x6c(%rbp), %rcx
leaq 0x330e8(%rip), %rdx     # 0x8bdb0
movq %rdx, 0x18(%rax,%rcx,8)
movq -0x78(%rbp), %rdi
addq $0x30, %rdi
callq 0x35220
movq -0x78(%rbp), %rax
movq $0x0, 0x8(%rax)
movl -0x24(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x58d19
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x58c12
jmp 0x58d01
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
cmpq -0x58(%rbp), %rax
jne 0x58c0b
jmp 0x58d19
jmp 0x58d1b
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x58b6b
jmp 0x58d2b
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq -0x30(%rbp), %rax
jne 0x58b64
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)