// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/flow.c
// Function: merge_bb
static int merge_bb(struct basic_block *top, struct basic_block *bot)
{
	struct instruction *insn;
	struct basic_block *bb;

	if (top == bot)
		return 0;

	top->children = bot->children;
	bot->children = NULL;
	bot->parents = NULL;

	FOR_EACH_PTR(top->children, bb) {
		replace_bb_in_list(&bb->parents, bot, top, 1);
	} END_FOR_EACH_PTR(bb);

	FOR_EACH_PTR(top->insns, insn) {
		if (!insn->bb)
			continue;
		if (insn->opcode != OP_PHISOURCE)
			continue;
		remove_merging_phisrc(insn, bot);
	} END_FOR_EACH_PTR(insn);

	kill_instruction(delete_last_instruction(&top->insns));
	FOR_EACH_PTR(bot->insns, insn) {
		if (!insn->bb)
			continue;
		assert(insn->bb == bot);
		switch (insn->opcode) {
		case OP_PHI:
			remove_merging_phi(top, insn);
			continue;
		}
		insn->bb = top;
		add_instruction(&top->insns, insn);
	} END_FOR_EACH_PTR(insn);
	bot->insns = NULL;
	bot->ep = NULL;
	return REPEAT_CFG_CLEANUP;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x5a709
movl $0x0, -0x4(%rbp)
jmp 0x5aa01
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%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 0x5a759
jmp 0x5a7e3
jmp 0x5a75b
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 0x5a7cb
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x5a7a6
cmpq $0x0, -0x28(%rbp)
jne 0x5a7a6
jmp 0x5a7c0
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl $0x1, %ecx
callq 0x5b9d0
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x5a762
jmp 0x5a7cd
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq -0x30(%rbp), %rax
jne 0x5a75b
jmp 0x5a7e5
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x5a80d
jmp 0x5a8a7
jmp 0x5a80f
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x58(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x5a88f
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x58(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x5a85a
cmpq $0x0, -0x20(%rbp)
jne 0x5a85a
jmp 0x5a884
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x5a867
jmp 0x5a884
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
cmpl $0x45, %eax
je 0x5a877
jmp 0x5a884
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5c010
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x5a816
jmp 0x5a891
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq -0x50(%rbp), %rax
jne 0x5a80f
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
callq 0x5c140
movq %rax, %rdi
callq 0x5c120
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x5a8e4
jmp 0x5a9e2
jmp 0x5a8e6
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
movq -0x78(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x5a9ca
movq -0x78(%rbp), %rax
movslq -0x84(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x78(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x5a93e
cmpq $0x0, -0x20(%rbp)
jne 0x5a93e
jmp 0x5a9b6
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x5a94b
jmp 0x5a9b6
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x5a95b
jmp 0x5a97a
leaq 0x125b0(%rip), %rdi     # 0x6cf12
leaq 0x123bc(%rip), %rsi     # 0x6cd25
movl $0x399, %edx            # imm = 0x399
leaq 0x125ad(%rip), %rcx     # 0x6cf22
callq 0x11120
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
subl $0x46, %eax
jne 0x5a999
jmp 0x5a98a
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x5c160
jmp 0x5a9b6
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
movq -0x20(%rbp), %rsi
callq 0x5c270
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x5a8f0
jmp 0x5a9cc
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
cmpq -0x70(%rbp), %rax
jne 0x5a8e6
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movl $0x4, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)