// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x28(%rsi), %rcx
testq %rcx, %rcx
je 0x3be91
movq %rdi, %rbx
xorl %esi, %esi
leaq 0x2acad(%rip), %rbp     # 0x669d0
movq %rcx, %rdx
movq %rcx, 0x20(%rsp)
movzwl (%rdx), %eax
testb %al, %al
jle 0x3be77
xorl %r10d, %r10d
movq %rdx, 0x10(%rsp)
movq 0x18(%rdx,%r10,8), %r12
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3bd56
testq %r12, %r12
je 0x3be57
cmpq $0x0, 0x8(%r12)
je 0x3be24
movl (%r12), %ecx
andl $0x7f, %ecx
movl $0x1, %edi
cmpl $0x46, %ecx
jne 0x3be2b
movq %r10, 0x18(%rsp)
movq 0x38(%r12), %rax
testq %rax, %rax
je 0x3be31
movq %rax, %r15
movq %rax, 0x28(%rsp)
movzwl (%r15), %eax
testb %al, %al
jle 0x3be0e
xorl %r13d, %r13d
movq 0x18(%r15,%r13,8), %rdx
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3bdb1
testq %rdx, %rdx
je 0x3bdff
movl $0xf, %edi
movb $0x1, %cl
cmpq %rbp, %rdx
je 0x3bdfb
movq 0x18(%rdx), %r14
cmpq %r12, 0x38(%r14)
jne 0x3beaf
cmpq %rbx, 0x8(%r14)
jne 0x3bdfb
leaq 0x30(%r14), %rdi
movq %rbp, 0x18(%r15,%r13,8)
movq %rsi, 0x30(%rsp)
callq 0x24aae
movq 0x30(%rsp), %rsi
movq $0x0, 0x8(%r14)
orl $0x1, %esi
movl $0x12, %edi
xorl %ecx, %ecx
testb %cl, %cl
je 0x3be36
incq %r13
movl (%r15), %eax
movsbq %al, %rcx
cmpq %rcx, %r13
jl 0x3bd9d
movq 0x10(%r15), %r15
movq 0x28(%rsp), %rax
cmpq %rax, %r15
jne 0x3bd92
xorl %edi, %edi
jmp 0x3be36
movl $0x8, %edi
jmp 0x3be51
movl %esi, 0xc(%rsp)
jmp 0x3be51
movl $0x9, %edi
cmpl $0x12, %edi
ja 0x3be6b
movl $0x40201, %eax          # imm = 0x40201
btl %edi, %eax
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %r10
jae 0x3be51
xorl %edi, %edi
testb $0x17, %dil
jne 0x3be8b
incq %r10
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %r10
jl 0x3bd3e
jmp 0x3be77
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %r10
jmp 0x3be51
movq 0x10(%rdx), %rdx
movq 0x20(%rsp), %rcx
cmpq %rcx, %rdx
jne 0x3bd2b
xorl %edi, %edi
movl 0xc(%rsp), %eax
jmp 0x3be98
xorl %esi, %esi
movl $0x2, %edi
testb $0x1d, %dil
jne 0x3bea0
movl %esi, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10192(%rip), %rdi     # 0x4c048
leaq 0x101a4(%rip), %rsi     # 0x4c061
leaq 0x101a4(%rip), %rcx     # 0x4c068
movl $0x33, %edx
callq 0xe120