// File: /workspace/github_c_makefile_star2_O0/rikuu[P]kermit/miniasm/asg.c
// Function: asg_pop_bubble
int asg_pop_bubble(asg_t *g, int max_dist)
{
	uint32_t v, n_vtx = g->n_seq * 2;
	uint64_t n_pop = 0;
	buf_t b;
	if (!g->is_symm) asg_symm(g);
	memset(&b, 0, sizeof(buf_t));
	b.a = (binfo_t*)calloc(n_vtx, sizeof(binfo_t));
	for (v = 0; v < n_vtx; ++v) {
		uint32_t i, n_arc = 0, nv = asg_arc_n(g, v);
		asg_arc_t *av = asg_arc_a(g, v);
		if (nv < 2 || g->seq[v>>1].del) continue;
		for (i = 0; i < nv; ++i) // asg_bub_pop1() may delete some edges/arcs
			if (!av[i].del) ++n_arc;
		if (n_arc > 1)
			n_pop += asg_bub_pop1(g, v, max_dist, &b);
	}
	free(b.a); free(b.S.a); free(b.T.a); free(b.b.a); free(b.e.a);
	if (n_pop) asg_cleanup(g);
	fprintf(stderr, "[M::%s] popped %d bubbles and trimmed %d tips\n", __func__, (uint32_t)n_pop, (uint32_t)(n_pop>>32));
	return n_pop;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x48d3
movq -0x8(%rbp), %rdi
callq 0x37d0
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x10c0
movl -0x14(%rbp), %eax
movl %eax, %edi
movl $0x10, %esi
callq 0x10e0
movq %rax, -0x88(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x4a0f
movl $0x0, -0x90(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x10(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x94(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rcx
movl -0x10(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
cmpl $0x2, -0x94(%rbp)
jb 0x497a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x10(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x497f
jmp 0x4a01
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x94(%rbp), %eax
jae 0x49d8
movq -0xa0(%rbp), %rax
movl -0x8c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x49c5
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x49c7
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x4989
cmpl $0x1, -0x90(%rbp)
jbe 0x49ff
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
movl -0xc(%rbp), %edx
leaq -0x88(%rbp), %rcx
callq 0x4a90
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4a01
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x4903
movq -0x88(%rbp), %rdi
callq 0x1040
movq -0x70(%rbp), %rdi
callq 0x1040
movq -0x58(%rbp), %rdi
callq 0x1040
movq -0x40(%rbp), %rdi
callq 0x1040
movq -0x28(%rbp), %rdi
callq 0x1040
cmpq $0x0, -0x20(%rbp)
je 0x4a4f
movq -0x8(%rbp), %rdi
callq 0x35d0
movq 0xe5a2(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
shrq $0x20, %rax
movl %eax, %r8d
leaq 0xa765(%rip), %rsi      # 0xf1d6
leaq 0xa78d(%rip), %rdx      # 0xf205
movb $0x0, %al
callq 0x1110
movq -0x20(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)