// File: /workspace/github_c_makefile_star2_O3/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 0x3c41f
movq %rsi, %rbp
movq %rdi, %r14
movq 0x20(%rsi), %rax
movq %rax, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsi)
movq 0x20(%rdi), %rbx
testq %rbx, %rbx
je 0x3c1ca
movq %rbx, %r15
movzwl (%r15), %eax
testb %al, %al
jle 0x3c1c1
xorl %r12d, %r12d
movq 0x18(%r15,%r12,8), %rdi
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x3c19a
testq %rdi, %rdi
je 0x3c1b2
addq $0x18, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movl $0x1, %ecx
callq 0x229de
movzwl (%r15), %eax
incq %r12
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r12
jl 0x3c185
movq 0x10(%r15), %r15
cmpq %rbx, %r15
jne 0x3c17a
leaq 0x28(%r14), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%r14), %rbx
testq %rbx, %rbx
je 0x3c2af
leaq 0x297e9(%rip), %r15     # 0x659d0
movq %rbx, %r12
movzwl (%r12), %eax
testb %al, %al
jle 0x3c2a1
xorl %r13d, %r13d
movq 0x18(%r12,%r13,8), %rdi
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3c20e
testq %rdi, %rdi
je 0x3c28d
cmpq $0x0, 0x8(%rdi)
je 0x3c28d
movl (%rdi), %eax
andl $0x7f, %eax
cmpl $0x45, %eax
jne 0x3c28d
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x3c286
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x3c28d
movq %rax, %rcx
movzwl (%rcx), %esi
movsbl %sil, %edx
testw %dx, %dx
jle 0x3c27b
movzwl %dx, %edx
movzwl %si, %esi
xorl %r8d, %r8d
cmpl $0x100, %esi            # imm = 0x100
setae %r10b
movq 0x18(%rcx,%r8,8), %r9
testq %r9, %r9
sete %r11b
testb %r11b, %r10b
jne 0x3c273
cmpq %r15, %r9
je 0x3c273
movq 0x18(%r9), %r9
cmpq %rbp, 0x8(%r9)
je 0x3c286
incq %r8
cmpq %r8, %rdx
jne 0x3c249
movq 0x10(%rcx), %rcx
cmpq %rax, %rcx
jne 0x3c234
jmp 0x3c28d
xorl %esi, %esi
callq 0x24a3f
incq %r13
movl (%r12), %eax
movsbq %al, %rcx
cmpq %rcx, %r13
jl 0x3c1fa
movq 0x10(%r12), %r12
cmpq %rbx, %r12
jne 0x3c1ea
movq 0x10(%rsp), %rdi
callq 0x22a6b
movq %rax, %rdi
xorl %esi, %esi
callq 0x24a3f
movq %rbp, 0x18(%rsp)
movq 0x28(%rbp), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x3c409
leaq 0x296ef(%rip), %rbp     # 0x659d0
movq 0x8(%rsp), %rdx
movzwl (%rdx), %eax
testb %al, %al
jle 0x3c3fa
xorl %esi, %esi
movq %rdx, 0x28(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x18(%rdx,%rsi,8), %r12
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3c315
testq %r12, %r12
je 0x3c3de
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x3c3de
cmpq 0x18(%rsp), %rax
jne 0x3c430
movl (%r12), %eax
andl $0x7f, %eax
cmpl $0x46, %eax
jne 0x3c3cc
movq 0x38(%r12), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x3c3de
movq 0x20(%rsp), %r15
movzwl (%r15), %eax
testb %al, %al
jle 0x3c3bf
xorl %ebx, %ebx
movq 0x18(%r15,%rbx,8), %rcx
movzwl %ax, %edx
cmpl $0x100, %edx            # imm = 0x100
setae %dl
testq %rcx, %rcx
sete %sil
testb %sil, %dl
jne 0x3c3b0
cmpq %rbp, %rcx
je 0x3c3b0
movq 0x18(%rcx), %r13
cmpq %r14, 0x8(%r13)
jne 0x3c3b0
movq 0x30(%r13), %rsi
movq %r12, %rdi
callq 0x3b384
movq %r13, %rdi
xorl %esi, %esi
callq 0x24a3f
movq %r12, %rdi
xorl %esi, %esi
callq 0x24a3f
movzwl (%r15), %eax
incq %rbx
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %rbx
jl 0x3c360
movq 0x10(%r15), %r15
cmpq 0x20(%rsp), %r15
jne 0x3c356
jmp 0x3c3de
movq %r14, 0x8(%r12)
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x227b4
movq 0x30(%rsp), %rsi
incq %rsi
movq 0x28(%rsp), %rdx
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %rsi
jl 0x3c2f8
movq 0x10(%rdx), %rdx
cmpq 0x8(%rsp), %rdx
jne 0x3c2e6
xorl %eax, %eax
movq 0x18(%rsp), %rcx
movq %rax, 0x28(%rcx)
movq %rax, 0x10(%rcx)
movl $0x4, %eax
jmp 0x3c421
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xed87(%rip), %rdi      # 0x4b1be
leaq 0xeb93(%rip), %rsi      # 0x4afd1
leaq 0xed89(%rip), %rcx      # 0x4b1ce
movl $0x399, %edx            # imm = 0x399
callq 0xe120