// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r13
movq %rdi, %rbx
movabsq $0x800000000000000, %r14 # imm = 0x800000000000000
callq 0x8dac
movq %rbx, %rdi
callq 0x8e4a
movq %rbx, %r15
movq 0x8(%rbx), %rax
movl (%rax), %r12d
movl $0x10, %edi
callq 0x2330
movq %rax, %rbp
movl $0x1, %edi
movl $0x20, %esi
callq 0x2290
movq %rax, %rbx
movq %r14, (%rax)
movq $0x3, 0x10(%rax)
movl $0x10, %edi
callq 0x2330
movq %rbx, (%rsp)
movq %rax, 0x18(%rbx)
movl $0x1, %esi
movq %r12, %rdi
callq 0x2290
movq %rax, %rdi
testq %r12, %r12
je 0x9973
movl $0x3, %r11d
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
xorl %r14d, %r14d
movl $0x0, 0x3c(%rsp)
movq (%rsp), %rsi
movq %rbp, %r8
movq %rdi, 0x18(%rsp)
movabsq $0x800000000000000, %r9 # imm = 0x800000000000000
movq %r13, 0x48(%rsp)
movq %r15, 0x40(%rsp)
movq %r12, 0x58(%rsp)
movl %r14d, %eax
cmpb $0x0, (%rdi,%rax)
jne 0x9965
leal (%r14,%r14), %ecx
movq %r9, %rdx
andq %r10, %rdx
andq %r11, %rdx
movl %ecx, (%r8,%rdx,4)
movq (%rsi), %rdx
movq 0x10(%rsi), %r15
movq 0x18(%rsi), %rbx
movq $0x1, 0x8(%rsi)
movq %rdx, %rcx
andq %r10, %rcx
movq %r15, 0x30(%rsp)
andq %r15, %rcx
movl %r14d, (%rbx,%rcx,4)
movb $0x1, (%rdi,%rax)
movl $0x1, %r12d
movl $0x1, %r15d
movl $0x1, %r13d
movq %rdx, 0x10(%rsp)
leaq 0x1(%r9), %rax
movq %r9, %rcx
movq %r9, %rdx
andq %r10, %rdx
andq %r10, %rax
movabsq $-0x400000000000000, %r9 # imm = 0xFC00000000000000
andq %r9, %rcx
andq %r11, %rax
movl (%r8,%rdx,4), %edx
movq %rax, %r9
orq %rcx, %r9
decq %r13
movq 0x40(%rsp), %rcx
movq 0x28(%rcx), %rax
movq %rdx, 0x60(%rsp)
movq (%rax,%rdx,8), %r14
movq %r14, %rbp
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rbp
je 0x9491
shrq $0x1b, %r14
andq $-0x20, %r14
addq 0x20(%rcx), %r14
shlq $0x5, %rbp
addq %r14, %rbp
movq 0x10(%rsp), %rdx
movq %rbp, %rcx
movq %rbp, 0x50(%rsp)
movl 0x4(%r14), %ebp
movl %ebp, %eax
shrl %eax
cmpb $0x0, (%rdi,%rax)
jne 0x944a
movq %r9, %rax
shrq $0x3a, %rax
movl $0x1, %edx
movl %eax, %ecx
shlq %cl, %rdx
cmpq %rdx, %r13
jne 0x92a1
leal 0x1(%rax), %ebx
movl $0x1, %r12d
movl %ebx, %ecx
shlq %cl, %r12
cmpq %r13, %r12
jae 0x91db
movq $-0x1, %rbx
incq %rbx
movq %r13, %rdx
movl %ebx, %ecx
shrq %cl, %rdx
cmpq $0x3f, %rbx
ja 0x91c2
testq %rdx, %rdx
jne 0x91ac
cmpq %rbx, %rax
je 0x92a1
movl $0x1, %r12d
movl %ebx, %ecx
shlq %cl, %r12
cmpq %rax, %rbx
jbe 0x9204
movq %r9, %r15
movl $0x4, %esi
movl %ebx, %ecx
shlq %cl, %rsi
movq %r8, %rdi
callq 0x2390
movq %rax, %r8
movq (%rsp), %rsi
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq %r15, %r9
movq %r9, %r15
andq %r10, %r15
leaq (%r15,%r13), %rdx
cmpq %r13, %rdx
jbe 0x9256
movq %r13, %rdx
subq %r15, %rdx
movq %r12, %rax
subq %rdx, %rax
leaq (%r8,%rax,4), %rdi
leaq (%r8,%r15,4), %rsi
shlq $0x2, %rdx
movq %r8, 0x8(%rsp)
movq %r9, %r15
callq 0x23a0
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq 0x8(%rsp), %r8
movq (%rsp), %rsi
subq %r13, %r15
addq %r12, %r15
andq %r10, %r15
jmp 0x927f
subq %r12, %rdx
jbe 0x927f
leaq (%r8,%r12,4), %rsi
shlq $0x2, %rdx
movq %r8, %rdi
movq %r8, %r12
callq 0x23a0
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq %r12, %r8
movq (%rsp), %rsi
movq 0x18(%rsp), %rdi
movq %rbx, %r9
movq $-0x1, %r11
movl %ebx, %ecx
shlq %cl, %r11
shlq $0x3a, %r9
orq %r15, %r9
notq %r11
movq 0x8(%rsi), %r15
movq %r9, %rax
andq %r10, %rax
addq %r13, %rax
andq %r11, %rax
movl %ebp, (%r8,%rax,4)
movl 0x4(%r14), %eax
movl %eax, 0x30(%rsp)
movq (%rsi), %rax
movq %rax, %rbp
shrq $0x3a, %rax
movl $0x1, %edx
movl %eax, %ecx
shlq %cl, %rdx
cmpq %rdx, %r15
jne 0x930d
leal 0x1(%rax), %r12d
movl $0x1, %ebx
movl %r12d, %ecx
shlq %cl, %rbx
cmpq %r15, %rbx
jae 0x9315
movq $-0x1, %r12
incq %r12
movq %r15, %rdx
movl %r12d, %ecx
shrq %cl, %rdx
cmpq $0x3f, %r12
ja 0x9304
testq %rdx, %rdx
jne 0x92ed
cmpq %r12, %rax
jne 0x9459
movq %rbp, %rdx
jmp 0x940b
movq %r11, 0x20(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x8(%rsp)
movq %r13, 0x10(%rsp)
movq (%rsp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
movl %r12d, %ecx
shlq %cl, %rsi
callq 0x2390
movq (%rsp), %rsi
movq %rax, 0x18(%rsi)
movq 0x18(%rsp), %rdi
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq %rbp, %r13
andq %r10, %rbp
leaq (%r15,%rbp), %rdx
cmpq %r15, %rdx
jbe 0x93a9
movq 0x18(%rsi), %rax
movq %r15, %rdx
subq %rbp, %rdx
movq %rbx, %rcx
subq %rdx, %rcx
leaq (%rax,%rcx,4), %rdi
leaq (%rax,%rbp,4), %rsi
shlq $0x2, %rdx
callq 0x23a0
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq 0x18(%rsp), %rdi
movq (%rsp), %rsi
subq %r15, %r13
addq %rbx, %r13
andq %r10, %r13
movq %r13, %rbp
jmp 0x93d6
subq %rbx, %rdx
jbe 0x93d6
movq (%rsp), %rax
movq 0x18(%rax), %rdi
leaq (%rdi,%rbx,4), %rsi
shlq $0x2, %rdx
callq 0x23a0
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq 0x18(%rsp), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %r8
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %r11
movq 0x10(%rsp), %r13
movq %r12, %rdx
shlq $0x3a, %rdx
movq $-0x1, %rax
movl %r12d, %ecx
shlq %cl, %rax
orq %rbp, %rdx
movq %rdx, (%rsi)
notq %rax
movq %rax, 0x10(%rsi)
incq %r13
movl 0x30(%rsp), %ebp
shrl %ebp
movq 0x10(%rsi), %rcx
movq 0x18(%rsi), %rbx
leaq 0x1(%r15), %r12
movq %r12, 0x8(%rsi)
movq %rdx, %rax
andq %r10, %rax
addq %r15, %rax
movq %rcx, 0x30(%rsp)
andq %rcx, %rax
movl %ebp, (%rbx,%rax,4)
movl 0x4(%r14), %eax
shrl %eax
movb $0x1, (%rdi,%rax)
movq %r12, %r15
movq 0x50(%rsp), %rcx
addq $0x20, %r14
cmpq %rcx, %r14
jb 0x9166
jmp 0x9486
movl $0x1, %ebx
movl %r12d, %ecx
shlq %cl, %rbx
cmpq %rax, %r12
movq %r8, 0x8(%rsp)
movq %r9, 0x28(%rsp)
movq %r11, 0x20(%rsp)
ja 0x9324
movq %r13, 0x10(%rsp)
jmp 0x9358
movq 0x40(%rsp), %rax
movq 0x28(%rax), %rax
jmp 0x9496
movq 0x10(%rsp), %rdx
movq 0x60(%rsp), %rcx
xorq $0x1, %rcx
movq (%rax,%rcx,8), %r14
movq %r14, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rax, %rcx
je 0x97f4
shrq $0x1b, %r14
andq $-0x20, %r14
movq 0x40(%rsp), %rax
addq 0x20(%rax), %r14
shlq $0x5, %rcx
addq %r14, %rcx
movq %rcx, 0x50(%rsp)
movl 0x4(%r14), %ebp
movl %ebp, %eax
shrl %eax
cmpb $0x0, (%rdi,%rax)
jne 0x97b8
movq %r9, %rax
shrq $0x3a, %rax
movl $0x1, %edx
movl %eax, %ecx
shlq %cl, %rdx
cmpq %rdx, %r13
jne 0x960c
leal 0x1(%rax), %ebx
movl $0x1, %r15d
movl %ebx, %ecx
shlq %cl, %r15
cmpq %r13, %r15
jae 0x9546
movq $-0x1, %rbx
incq %rbx
movq %r13, %rdx
movl %ebx, %ecx
shrq %cl, %rdx
cmpq $0x3f, %rbx
ja 0x952d
testq %rdx, %rdx
jne 0x9517
cmpq %rbx, %rax
je 0x960c
movl $0x1, %r15d
movl %ebx, %ecx
shlq %cl, %r15
cmpq %rax, %rbx
jbe 0x956f
movq %r9, %r12
movl $0x4, %esi
movl %ebx, %ecx
shlq %cl, %rsi
movq %r8, %rdi
callq 0x2390
movq %rax, %r8
movq (%rsp), %rsi
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq %r12, %r9
movq %r9, %r12
andq %r10, %r12
leaq (%r12,%r13), %rdx
cmpq %r13, %rdx
jbe 0x95c1
movq %r13, %rdx
subq %r12, %rdx
movq %r15, %rax
subq %rdx, %rax
leaq (%r8,%rax,4), %rdi
leaq (%r8,%r12,4), %rsi
shlq $0x2, %rdx
movq %r8, 0x8(%rsp)
movq %r9, %r12
callq 0x23a0
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq 0x8(%rsp), %r8
movq (%rsp), %rsi
subq %r13, %r12
addq %r15, %r12
andq %r10, %r12
jmp 0x95ea
subq %r15, %rdx
jbe 0x95ea
leaq (%r8,%r15,4), %rsi
shlq $0x2, %rdx
movq %r8, %rdi
movq %r8, %r15
callq 0x23a0
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq %r15, %r8
movq (%rsp), %rsi
movq 0x18(%rsp), %rdi
movq %rbx, %r9
movq $-0x1, %r11
movl %ebx, %ecx
shlq %cl, %r11
shlq $0x3a, %r9
orq %r12, %r9
notq %r11
movq 0x8(%rsi), %r12
xorl $0x1, %ebp
movq %r9, %rax
andq %r10, %rax
addq %r13, %rax
andq %r11, %rax
movl %ebp, (%r8,%rax,4)
movl 0x4(%r14), %eax
movl %eax, 0x30(%rsp)
movq (%rsi), %rax
movq %rax, %rbp
shrq $0x3a, %rax
movl $0x1, %edx
movl %eax, %ecx
shlq %cl, %rdx
cmpq %rdx, %r12
jne 0x9679
leal 0x1(%rax), %ebx
movl $0x1, %r15d
movl %ebx, %ecx
shlq %cl, %r15
cmpq %r12, %r15
jae 0x9681
movq $-0x1, %rbx
incq %rbx
movq %r12, %rdx
movl %ebx, %ecx
shrq %cl, %rdx
cmpq $0x3f, %rbx
ja 0x9670
testq %rdx, %rdx
jne 0x965a
cmpq %rbx, %rax
jne 0x97c7
movq %rbp, %rdx
jmp 0x9778
movq %r11, 0x20(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x8(%rsp)
movq %r13, 0x10(%rsp)
movq (%rsp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
movl %ebx, %ecx
shlq %cl, %rsi
callq 0x2390
movq (%rsp), %rsi
movq %rax, 0x18(%rsi)
movq 0x18(%rsp), %rdi
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq %rbp, %rax
andq %r10, %rbp
leaq (%r12,%rbp), %rdx
cmpq %r12, %rdx
jbe 0x9717
movq %rax, %r13
movq 0x18(%rsi), %rax
movq %r12, %rdx
subq %rbp, %rdx
movq %r15, %rcx
subq %rdx, %rcx
leaq (%rax,%rcx,4), %rdi
leaq (%rax,%rbp,4), %rsi
shlq $0x2, %rdx
callq 0x23a0
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq 0x18(%rsp), %rdi
movq (%rsp), %rsi
subq %r12, %r13
addq %r15, %r13
andq %r10, %r13
movq %r13, %rbp
jmp 0x9744
subq %r15, %rdx
jbe 0x9744
movq (%rsp), %rax
movq 0x18(%rax), %rdi
leaq (%rdi,%r15,4), %rsi
shlq $0x2, %rdx
callq 0x23a0
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq 0x18(%rsp), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %r8
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %r11
movq 0x10(%rsp), %r13
movq %rbx, %rdx
shlq $0x3a, %rdx
movq $-0x1, %rax
movl %ebx, %ecx
shlq %cl, %rax
orq %rbp, %rdx
movq %rdx, (%rsi)
notq %rax
movq %rax, 0x10(%rsi)
incq %r13
movl 0x30(%rsp), %ebp
shrl %ebp
movq 0x10(%rsi), %rcx
movq 0x18(%rsi), %rbx
leaq 0x1(%r12), %r15
movq %r15, 0x8(%rsi)
movq %rdx, %rax
andq %r10, %rax
addq %r12, %rax
movq %rcx, 0x30(%rsp)
andq %rcx, %rax
movl %ebp, (%rbx,%rax,4)
movl 0x4(%r14), %eax
shrl %eax
movb $0x1, (%rdi,%rax)
movq %r15, %r12
movq 0x50(%rsp), %rcx
addq $0x20, %r14
cmpq %rcx, %r14
jb 0x94d1
jmp 0x97f4
movl $0x1, %r15d
movl %ebx, %ecx
shlq %cl, %r15
cmpq %rax, %rbx
movq %r8, 0x8(%rsp)
movq %r9, 0x28(%rsp)
movq %r11, 0x20(%rsp)
ja 0x9690
movq %r13, 0x10(%rsp)
jmp 0x96c3
testq %r13, %r13
jne 0x90f1
testq %r12, %r12
je 0x98f9
movq %r11, 0x20(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rdx, 0x10(%rsp)
movq %rdx, %rcx
andq %r10, %rcx
xorl %r14d, %r14d
xorl %r8d, %r8d
movq 0x48(%rsp), %r15
movq 0x30(%rsp), %rsi
leaq (%rcx,%r14), %rdx
andq %rsi, %rdx
movl (%rbx,%rdx,4), %edx
imulq $0x58, %rdx, %rdx
addq 0x8(%rax,%rdx), %r8
incq %r14
movl %r14d, %edx
cmpq %rdx, %r12
ja 0x983d
movl 0x3c(%rsp), %edx
incl %edx
movq %r15, %rdi
movq %rsi, 0x30(%rsp)
leaq 0x18b94(%rip), %rsi     # 0x22404
movl %edx, 0x3c(%rsp)
movq %r12, %rcx
xorl %eax, %eax
callq 0x22c0
movabsq $-0x400000000000000, %rbp # imm = 0xFC00000000000000
movabsq $0x3ffffffffffffff, %r13 # imm = 0x3FFFFFFFFFFFFFF
movq 0x10(%rsp), %r15
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
leaq 0x1(%r15), %rcx
movq %r15, %rdx
andq %r13, %r15
andq %r13, %rcx
andq %rbp, %rdx
andq 0x30(%rsp), %rcx
movl (%rbx,%r15,4), %esi
movq %rcx, %r15
orq %rdx, %r15
imulq $0x58, %rsi, %rcx
movq (%rax,%rcx), %rdx
movq 0x48(%rsp), %rdi
leaq 0x18879(%rip), %rsi     # 0x22150
xorl %eax, %eax
callq 0x22c0
decq %r12
jne 0x9897
movq (%rsp), %rax
movq %r15, (%rax)
movq $0x0, 0x8(%rax)
movq 0x48(%rsp), %r13
jmp 0x9931
movq %r11, 0x20(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x8(%rsp)
movl 0x3c(%rsp), %edx
incl %edx
xorl %r14d, %r14d
movq 0x48(%rsp), %r13
movq %r13, %rdi
leaq 0x18ae4(%rip), %rsi     # 0x22404
movl %edx, 0x3c(%rsp)
movq %r12, %rcx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x22c0
movl $0xa, %edi
movq %r13, %rsi
callq 0x2260
movq (%rsp), %rsi
movq 0x58(%rsp), %r12
movq 0x8(%rsp), %r8
movq 0x18(%rsp), %rdi
movabsq $0x3ffffffffffffff, %r10 # imm = 0x3FFFFFFFFFFFFFF
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %r11
incl %r14d
cmpl %r12d, %r14d
jb 0x9098
jmp 0x997a
movq (%rsp), %rsi
movq %rbp, %r8
movq %rsi, %rbx
movq %rdi, %r14
movq %r8, %rdi
callq 0x2060
movq 0x18(%rbx), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2060
movq %r14, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2060