// File: /workspace/github_c_makefile_star2_O1/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 0x3d365
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
movq %rsi, 0x8(%rsp)
je 0x3d0c6
movq %rbx, %r15
movzwl (%r15), %eax
testb %al, %al
jle 0x3d0bd
xorl %r12d, %r12d
movq 0x18(%r15,%r12,8), %rdi
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3d098
testq %rdi, %rdi
je 0x3d0ae
addq $0x18, %rdi
movq %r14, %rdx
movl $0x1, %ecx
callq 0x22a71
movq 0x8(%rsp), %rsi
incq %r12
movl (%r15), %eax
movsbq %al, %rcx
cmpq %rcx, %r12
jl 0x3d084
movq 0x10(%r15), %r15
cmpq %rbx, %r15
jne 0x3d079
leaq 0x28(%r14), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%r14), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x3d1fe
leaq 0x298e8(%rip), %rdx     # 0x669d0
movq 0x18(%rsp), %r13
movzwl (%r13), %eax
testb %al, %al
jle 0x3d1ef
xorl %r15d, %r15d
movq 0x18(%r13,%r15,8), %r12
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3d115
testq %r12, %r12
je 0x3d1db
cmpq $0x0, 0x8(%r12)
je 0x3d1db
movl (%r12), %eax
andl $0x7f, %eax
cmpl $0x45, %eax
jne 0x3d1db
movq 0x38(%r12), %rax
testq %rax, %rax
je 0x3d1c5
movq 0x38(%rax), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x3d1db
movq 0x10(%rsp), %rbx
movzwl (%rbx), %eax
testb %al, %al
jle 0x3d1b8
xorl %ebp, %ebp
movq 0x18(%rbx,%rbp,8), %rcx
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3d173
testq %rcx, %rcx
je 0x3d1aa
cmpq %rdx, %rcx
je 0x3d1a1
movq 0x18(%rcx), %rcx
xorl %eax, %eax
cmpq %rsi, 0x8(%rcx)
jne 0x3d1a6
movq %r12, %rdi
xorl %esi, %esi
callq 0x24adf
leaq 0x2983b(%rip), %rdx     # 0x669d0
movq 0x8(%rsp), %rsi
movl $0x1, %eax
jmp 0x3d1a6
movl $0x8, %eax
testb $0x7, %al
jne 0x3d1db
incq %rbp
movl (%rbx), %eax
movsbq %al, %rcx
cmpq %rcx, %rbp
jl 0x3d15f
movq 0x10(%rbx), %rbx
cmpq 0x10(%rsp), %rbx
jne 0x3d156
jmp 0x3d1db
movq %r12, %rdi
xorl %esi, %esi
callq 0x24adf
leaq 0x297fa(%rip), %rdx     # 0x669d0
movq 0x8(%rsp), %rsi
incq %r15
movl (%r13), %eax
movsbq %al, %rcx
cmpq %rcx, %r15
jl 0x3d0fd
movq 0x10(%r13), %r13
cmpq 0x18(%rsp), %r13
jne 0x3d0ed
movq 0x28(%rsp), %rdi
movq %rsi, %rbx
callq 0x22b10
movq %rax, %rdi
xorl %esi, %esi
callq 0x24adf
movq 0x28(%rbx), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x3d34f
leaq 0x297a2(%rip), %rbp     # 0x669d0
movq 0x20(%rsp), %rdx
movzwl (%rdx), %eax
testb %al, %al
jle 0x3d340
xorl %esi, %esi
movq %rdx, 0x30(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x18(%rdx,%rsi,8), %r12
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x3d262
testq %r12, %r12
je 0x3d324
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x3d324
cmpq 0x8(%rsp), %rax
jne 0x3d376
movl (%r12), %eax
andl $0x7f, %eax
cmpl $0x46, %eax
jne 0x3d312
movq 0x38(%r12), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x3d324
movq 0x10(%rsp), %r15
movzwl (%r15), %eax
testb %al, %al
jle 0x3d305
xorl %ebx, %ebx
movq 0x18(%r15,%rbx,8), %rcx
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
setae %al
testq %rcx, %rcx
sete %dl
testb %dl, %al
jne 0x3d2f6
cmpq %rbp, %rcx
je 0x3d2f6
movq 0x18(%rcx), %r13
cmpq %r14, 0x8(%r13)
jne 0x3d2f6
movq 0x30(%r13), %rsi
movq %r12, %rdi
callq 0x3c2b1
movq %r13, %rdi
xorl %esi, %esi
callq 0x24adf
movq %r12, %rdi
xorl %esi, %esi
callq 0x24adf
incq %rbx
movl (%r15), %eax
movsbq %al, %rcx
cmpq %rcx, %rbx
jl 0x3d2ad
movq 0x10(%r15), %r15
cmpq 0x10(%rsp), %r15
jne 0x3d2a3
jmp 0x3d324
movq %r14, 0x8(%r12)
movq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x2285b
movq 0x18(%rsp), %rsi
incq %rsi
movq 0x30(%rsp), %rdx
movl (%rdx), %eax
movsbq %al, %rcx
cmpq %rcx, %rsi
jl 0x3d245
movq 0x10(%rdx), %rdx
cmpq 0x20(%rsp), %rdx
jne 0x3d233
xorl %eax, %eax
movq 0x8(%rsp), %rcx
movq %rax, 0x28(%rcx)
movq %rax, 0x10(%rcx)
movl $0x4, %eax
jmp 0x3d367
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xeed1(%rip), %rdi      # 0x4c24e
leaq 0xecdd(%rip), %rsi      # 0x4c061
leaq 0xeed3(%rip), %rcx      # 0x4c25e
movl $0x399, %edx            # imm = 0x399
callq 0xe120