// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]yahs/graph.c
// Function: graph_print_all_clusters
void graph_print_all_clusters(graph_t *g, FILE *fp)
{
    uint32_t nv, na, v, i, c;
    uint64_t lens;
    graph_arc_t *av, *a;
    kdq_t(uint32_t) *q, *s;
    
    graph_remove_multi_arcs(g);
    graph_add_symm_arcs(g);

    nv = graph_n_vtx(g);
    q = kdq_init(uint32_t);
    s = kdq_init(uint32_t);
    uint8_t *visited = calloc(nv, sizeof(uint8_t));

    c = 0;
    for (i = 0; i < nv; ++i) {
        if (visited[i]) 
            continue;
        kdq_push(uint32_t, q, i << 1);
        kdq_push(uint32_t, s, i);
        visited[i] = 1;
        while (kdq_size(q) > 0) {
            v = *kdq_shift(uint32_t, q);
            na = graph_arc_n(g, v);
            if (na) {
                av = graph_arc_a(g, v);
                for (a = av; a < av + na; ++a) {
                    if (!visited[(a->w) >> 1]) {
                        kdq_push(uint32_t, q, a->w);
                        kdq_push(uint32_t, s, a->w >> 1);
                        visited[a->w >> 1] = 1;
                    }
                }
            }
            na = graph_arc_n(g, v^1);
            if (na) {
                av = graph_arc_a(g, v^1);
                for (a = av; a < av + na; ++a) {
                    if (!visited[(a->w^1) >> 1]) {
                        kdq_push(uint32_t, q, a->w^1);
                        kdq_push(uint32_t, s, (a->w^1) >> 1);
                        visited[(a->w^1) >> 1] = 1;
                    }
                }    
            }
        }

        lens = 0;
        for (i = 0; i < kdq_size(s); ++i)
            lens += g->sdict->s[kdq_at(s, i)].len;
        fprintf(fp, "Cluster %d [%ld seqs, %ld bp]:", ++c, kdq_size(s), lens);
        while (kdq_size(s) > 0)
            fprintf(fp, " %s", g->sdict->s[*kdq_shift(uint32_t, s)].name);
        fprintf(fp, "\n");
    }
    
    kdq_destroy(uint32_t, q);
    kdq_destroy(uint32_t, s);
    free(visited);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8bd0
movq -0x8(%rbp), %rdi
callq 0x8d50
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
callq 0xb7c0
movq %rax, -0x48(%rbp)
callq 0xb7c0
movq %rax, -0x50(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2290
movq %rax, -0x58(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x9311
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
cmpb $0x0, (%rax,%rcx)
je 0x9030
jmp 0x9303
movq -0x48(%rbp), %rdi
movl -0x20(%rbp), %esi
shll %esi
callq 0x9340
movq -0x50(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x9340
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movq -0x48(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0x9207
movq -0x48(%rbp), %rdi
callq 0x93d0
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x912f
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x1c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movl -0x18(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x912d
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rcx
movl 0x4(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
jne 0x911d
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x9340
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x4(%rax), %esi
shrl %esi
callq 0x9340
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rcx
movl 0x4(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
jmp 0x911f
movq -0x40(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x40(%rbp)
jmp 0x90bc
jmp 0x912f
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x9202
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x1c(%rbp), %edx
xorl $0x1, %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movl -0x18(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x9200
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rcx
movl 0x4(%rcx), %ecx
xorl $0x1, %ecx
shrl %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
jne 0x91f0
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x4(%rax), %esi
xorl $0x1, %esi
callq 0x9340
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x4(%rax), %esi
xorl $0x1, %esi
shrl %esi
callq 0x9340
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rcx
movl 0x4(%rcx), %ecx
xorl $0x1, %ecx
shrl %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
jmp 0x91f2
movq -0x40(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x40(%rbp)
jmp 0x9183
jmp 0x9202
jmp 0x9055
movq $0x0, -0x30(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x9277
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq -0x50(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x50(%rbp), %rsi
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
andq (%rsi), %rdx
movl -0x20(%rbp), %esi
addq %rsi, %rdx
movq -0x50(%rbp), %rsi
andq 0x10(%rsi), %rdx
movl (%rcx,%rdx,4), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9216
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x30(%rbp), %r8
leaq 0x28115(%rip), %rsi     # 0x313ac
movb $0x0, %al
callq 0x22c0
movq -0x50(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0x92f1
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rdi
callq 0x93d0
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movq -0x60(%rbp), %rax
movl (%rcx), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x27e54(%rip), %rsi     # 0x3113c
movb $0x0, %al
callq 0x22c0
jmp 0x929e
movq -0x10(%rbp), %rdi
leaq 0x2826f(%rip), %rsi     # 0x3156b
movb $0x0, %al
callq 0x22c0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9012
movq -0x48(%rbp), %rdi
callq 0x94b0
movq -0x50(%rbp), %rdi
callq 0x94b0
movq -0x58(%rbp), %rdi
callq 0x2050
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)