// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/flow.c
// Function: rewrite_parent_branch
static int rewrite_parent_branch(struct basic_block *bb, struct basic_block *old, struct basic_block *new)
{
	int changed = 0;
	struct instruction *insn = last_instruction(bb->insns);

	if (!insn)
		return 0;

	/* Infinite loops: let's not "optimize" them.. */
	if (old == new)
		return 0;

	switch (insn->opcode) {
	case OP_CBR:
		changed |= rewrite_branch(bb, &insn->bb_false, old, new);
		/* fall through */
	case OP_BR:
		changed |= rewrite_branch(bb, &insn->bb_true, old, new);
		assert(changed);
		return changed;
	case OP_SWITCH: {
		struct multijmp *jmp;
		FOR_EACH_PTR(insn->multijmp_list, jmp) {
			changed |= rewrite_branch(bb, &jmp->target, old, new);
		} END_FOR_EACH_PTR(jmp);
		assert(changed);
		return changed;
	}
	default:
		return 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x5a540
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x5be5f
movl $0x0, -0x4(%rbp)
jmp 0x5c002
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x5be75
movl $0x0, -0x4(%rbp)
jmp 0x5c002
movq -0x30(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
movl %eax, -0x58(%rbp)
subl $0x3, %eax
je 0x5bec2
jmp 0x5be88
movl -0x58(%rbp), %eax
subl $0x4, %eax
je 0x5be9f
jmp 0x5be92
movl -0x58(%rbp), %eax
subl $0x5, %eax
je 0x5bf17
jmp 0x5bffb
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x30, %rsi
addq $0x10, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x5b910
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x30, %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x5b910
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x5beed
jmp 0x5bf0c
leaq 0x10fba(%rip), %rdi     # 0x6ceae
leaq 0x10e2a(%rip), %rsi     # 0x6cd25
movl $0x2aa, %edx            # imm = 0x2AA
leaq 0x10faf(%rip), %rcx     # 0x6ceb6
callq 0x11120
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x5c002
jmp 0x5bf19
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x5bf41
jmp 0x5bfcc
jmp 0x5bf43
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x48(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x5bfb4
movq -0x48(%rbp), %rax
movslq -0x54(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x5bf8e
cmpq $0x0, -0x38(%rbp)
jne 0x5bf8e
jmp 0x5bfa9
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x5b910
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x5bf4a
jmp 0x5bfb6
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq -0x40(%rbp), %rax
jne 0x5bf43
cmpl $0x0, -0x24(%rbp)
je 0x5bfd4
jmp 0x5bff3
leaq 0x10ed3(%rip), %rdi     # 0x6ceae
leaq 0x10d43(%rip), %rsi     # 0x6cd25
movl $0x2b1, %edx            # imm = 0x2B1
leaq 0x10ec8(%rip), %rcx     # 0x6ceb6
callq 0x11120
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x5c002
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)