// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpq %rsi, %rdi
je 0x3592d
movq %rdi, %r14
movq 0x20(%rsi), %rax
movq %rax, 0x20(%rdi)
xorps %xmm0, %xmm0
movq %rsi, 0x8(%rsp)
movups %xmm0, 0x18(%rsi)
movq 0x20(%rdi), %rbx
testq %rbx, %rbx
je 0x35709
pushq $0x1
popq %rbp
movq %rbx, %r15
xorl %r12d, %r12d
movl (%r15), %eax
movsbq %al, %rcx
cmpq %rcx, %r12
jge 0x35700
movq 0x18(%r15,%r12,8), %rdi
cmpw $0x100, %ax             # imm = 0x100
jb 0x356e8
testq %rdi, %rdi
je 0x356fb
addq $0x18, %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x1fce4
incq %r12
jmp 0x356cc
movq 0x10(%r15), %r15
cmpq %rbx, %r15
jne 0x356c9
leaq 0x28(%r14), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%r14), %r15
testq %r15, %r15
movq 0x8(%rsp), %rbp
je 0x357ec
leaq 0x2a2a5(%rip), %r12     # 0x5f9d0
movq %r15, %rbx
xorl %r13d, %r13d
movl (%rbx), %eax
movsbq %al, %rcx
cmpq %rcx, %r13
jge 0x357df
movq 0x18(%rbx,%r13,8), %rdi
cmpw $0x100, %ax             # imm = 0x100
jb 0x35754
testq %rdi, %rdi
je 0x357d7
cmpq $0x0, 0x8(%rdi)
je 0x357d7
movl (%rdi), %eax
andl $0x7f, %eax
cmpl $0x45, %eax
jne 0x357d7
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x357d2
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x357d7
movq %rax, %rcx
movzwl (%rcx), %edx
movsbl %dl, %esi
testw %si, %si
movl $0x0, %r8d
cmovgl %esi, %r8d
movzwl %r8w, %esi
xorl %r8d, %r8d
cmpq %r8, %rsi
je 0x357c7
cmpw $0x100, %dx             # imm = 0x100
setae %r10b
movq 0x18(%rcx,%r8,8), %r9
testq %r9, %r9
sete %r11b
testb %r11b, %r10b
jne 0x357c2
cmpq %r12, %r9
je 0x357c2
movq 0x18(%r9), %r9
cmpq %rbp, 0x8(%r9)
je 0x357d2
incq %r8
jmp 0x35794
movq 0x10(%rcx), %rcx
cmpq %rax, %rcx
jne 0x3577a
jmp 0x357d7
callq 0x35fab
incq %r13
jmp 0x35731
movq 0x10(%rbx), %rbx
cmpq %r15, %rbx
jne 0x3572e
movq 0x18(%rsp), %rdi
callq 0x1fd69
movq %rax, %rdi
callq 0x35fab
movq 0x28(%rbp), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x35919
leaq 0x2a1b9(%rip), %rbp     # 0x5f9d0
movq 0x10(%rsp), %rdx
xorl %esi, %esi
movq %rdx, 0x28(%rsp)
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %rsi
jge 0x3590a
movq %rsi, 0x30(%rsp)
movq 0x18(%rdx,%rsi,8), %r12
cmpw $0x100, %ax             # imm = 0x100
jb 0x3584b
testq %r12, %r12
je 0x358f8
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x358f8
cmpq 0x8(%rsp), %rax
jne 0x3593e
movl (%r12), %eax
andl $0x7f, %eax
cmpl $0x46, %eax
jne 0x358e6
movq 0x38(%r12), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x358f8
movq 0x20(%rsp), %r15
xorl %ebx, %ebx
movl (%r15), %ecx
movsbq %cl, %rax
cmpq %rax, %rbx
jge 0x358d9
movq 0x18(%r15,%rbx,8), %rax
cmpw $0x100, %cx             # imm = 0x100
setae %cl
testq %rax, %rax
sete %dl
testb %dl, %cl
jne 0x358d4
cmpq %rbp, %rax
je 0x358d4
movq 0x18(%rax), %r13
cmpq %r14, 0x8(%r13)
jne 0x358d4
movq 0x30(%r13), %rsi
movq %r12, %rdi
callq 0x34a2a
movq %r13, %rdi
callq 0x35fab
movq %r12, %rdi
callq 0x35fab
incq %rbx
jmp 0x35886
movq 0x10(%r15), %r15
cmpq 0x20(%rsp), %r15
jne 0x35884
jmp 0x358f8
movq %r14, 0x8(%r12)
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x1fae9
movq 0x30(%rsp), %rsi
incq %rsi
movq 0x28(%rsp), %rdx
jmp 0x35823
movq 0x10(%rdx), %rdx
cmpq 0x10(%rsp), %rdx
jne 0x3581c
movq 0x8(%rsp), %rax
andq $0x0, 0x28(%rax)
andq $0x0, 0x10(%rax)
pushq $0x4
popq %rax
jmp 0x3592f
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xeac9(%rip), %rdi      # 0x4440e
leaq 0xe8d5(%rip), %rsi      # 0x44221
leaq 0xeacb(%rip), %rcx      # 0x4441e
movl $0x399, %edx            # imm = 0x399
callq 0xe120