// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: print_bubble_graph(bubble_type*, ma_ug_t*, char const*, _IO_FILE*)
void print_bubble_graph(bubble_type* bub, ma_ug_t* ug, const char* prefix, FILE *fp)
{
    uint32_t i, k, *a, n, beg, sink, x;
    asg_t *b_g = bub->b_g;
    char name[32];
    for (i = 0; i < b_g->n_seq; i++)
    {
        get_bubbles(bub, i, &beg, &sink, &a, &n, NULL);
        sprintf(name, "%s%.6d%c", prefix, i, "fb"[i<bub->f_bub?0:1]);
        fprintf(stderr, "S\t%s\t*\tLN:i:%d\n", name, n);

        if(beg != (uint32_t)-1) fprintf(stderr, "A\tutg%.6d%c\t%s\n", (beg>>1)+1, "lc"[ug->u.a[(beg>>1)].circ], "beg");
        if(sink != (uint32_t)-1) fprintf(stderr, "A\tutg%.6d%c\t%s\n", (sink>>1)+1, "lc"[ug->u.a[(sink>>1)].circ], "sink");
        for (k = 0; k < n; k++)
        {
            x = a[k]>>1;
            fprintf(stderr, "A\tutg%.6d%c\t%s\n", x+1, "lc"[ug->u.a[x].circ], "mid");
        }
    }

    asg_arc_t* au = NULL;
    uint32_t nu, u, v;
    for (i = 0; i < b_g->n_seq; i++)
    {
        u = i<<1;
        au = asg_arc_a(b_g, u);
        nu = asg_arc_n(b_g, u);
        for (k = 0; k < nu; k++)
        {
            if(au[k].del) continue;
            v = au[k].v;
            fprintf(stderr, "L\t%s%.6d%c\t%c\t%s%.6d%c\t%c\t%dM\tL1:i:%d\n", 
            prefix, u>>1, "fb"[(u>>1)<bub->f_bub?0:1], "+-"[u&1],
            prefix, v>>1, "fb"[(v>>1)<bub->f_bub?0:1], "+-"[v&1], 0, 0);


            asg_arc_t* av = asg_arc_a(b_g, v^1);
            uint32_t nv = asg_arc_n(b_g, v^1), m;
            for (m = 0; m < nv; m++)
            {
                if(av[m].del) continue;
                if(av[m].v == (u^1)) break;
            }

            if(m == nv) fprintf(stderr, "sb1sb, nv: %u, nu: %u\n", nv, nu);
        }


        u = (i<<1) + 1;
        au = asg_arc_a(ug->g, u);
        nu = asg_arc_n(ug->g, u);
        for (k = 0; k < nu; k++)
        {
            if(au[k].del) continue;
            v = au[k].v;
            fprintf(stderr, "L\t%s%.6d%c\t%c\t%s%.6d%c\t%c\t%dM\tL1:i:%d\n", 
            prefix, u>>1, "fb"[(u>>1)<bub->f_bub?0:1], "+-"[u&1],
            prefix, v>>1, "fb"[(v>>1)<bub->f_bub?0:1], "+-"[v&1], 0, 0);

            asg_arc_t* av = asg_arc_a(b_g, v^1);
            uint32_t nv = asg_arc_n(b_g, v^1), m;
            for (m = 0; m < nv; m++)
            {
                if(av[m].del) continue;
                if(av[m].v == (u^1)) break;
            }

            if(m == nv) fprintf(stderr, "sb2sb, nv: %u, nu: %u\n", nv, nu);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdi, 0x28(%rsp)
movq 0xb8(%rdi), %rdx
testl $0x7fffffff, 0x14(%rdx) # imm = 0x7FFFFFFF
je 0x15caa5
movq 0x38(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
movq %rdx, 0x10(%rsp)
movq 0x28(%rsp), %rcx
movq 0x28(%rcx), %rdx
movq 0x40(%rcx), %rax
movl (%rax,%r13,4), %r14d
movl 0x4(%rax,%r13,4), %r12d
subl %r14d, %r12d
addl $-0x2, %r12d
movl (%rdx,%r14,4), %ebp
leal 0x1(%r14), %eax
movq %rdx, 0x18(%rsp)
movl (%rdx,%rax,4), %ebx
cmpq 0x80(%rcx), %r13
leaq 0xdf2ca(%rip), %rax     # 0x23b9d2
sbbq $-0x1, %rax
movsbl (%rax), %r8d
leaq 0x40(%rsp), %r15
movq %r15, %rdi
leaq 0xd9cbb(%rip), %rsi     # 0x2363da
movq 0x30(%rsp), %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2050
movq 0x1388ab(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0xdfbf2(%rip), %rsi     # 0x23c331
movq %r15, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x22b0
cmpl $-0x1, %ebp
jne 0x15c776
cmpl $-0x1, %ebx
movq 0x10(%rsp), %rdx
jne 0x15c784
testl %r12d, %r12d
jne 0x15c797
incq %r13
movl 0x14(%rdx), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %r13
jb 0x15c6cd
jmp 0x15c7b8
movl %ebp, %edi
movq 0x8(%rsp), %rsi
callq 0x1cb1c
jmp 0x15c751
movl %ebx, %edi
movq 0x8(%rsp), %rsi
callq 0x1cb5e
movq 0x10(%rsp), %rdx
jmp 0x15c75b
movq 0x18(%rsp), %rax
leaq (%rax,%r14,4), %rsi
addq $0x8, %rsi
movl %r12d, %edi
movq 0x8(%rsp), %rdx
callq 0x1cba0
movq 0x10(%rsp), %rdx
jmp 0x15c760
testl %eax, %eax
je 0x15caa5
xorl %r9d, %r9d
movq 0x28(%rdx), %rax
movq %r9, %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rax
leaq 0x1(,%r9,2), %r12
movq %rax, 0x20(%rsp)
testl %eax, %eax
movq %r9, 0x18(%rsp)
je 0x15c92b
movq 0x20(%rsp), %rcx
movq %rcx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %r15
shlq $0x3, %r15
addq 0x8(%rdx), %r15
movl %ecx, %ebx
xorl %r14d, %r14d
leaq (%r14,%r14,2), %rax
cmpl $0x0, 0xc(%r15,%rax,8)
jns 0x15c822
incq %r14
cmpq %rbx, %r14
jne 0x15c809
jmp 0x15c92b
leaq (%r15,%rax,8), %rax
movl 0x8(%rax), %r13d
movq 0x28(%rsp), %rax
movq 0x80(%rax), %rax
cmpq %rax, %r9
leaq 0xdf192(%rip), %rdx     # 0x23b9d2
movq %rdx, %rcx
sbbq $-0x1, %rcx
movq 0x138792(%rip), %rsi    # 0x294fe0
movq (%rsi), %rdi
movsbl (%rcx), %r8d
movl %r13d, %r10d
shrl %r10d
cmpq %rax, %r10
movq %rdx, %rax
sbbq $-0x1, %rax
movsbl (%rax), %eax
movq %rax, 0x8(%rsp)
movl %r13d, %eax
andl $0x1, %eax
leaq 0xd5a59(%rip), %rcx     # 0x2322d3
movsbl (%rax,%rcx), %r11d
xorl %ebp, %ebp
leaq 0xdfad6(%rip), %rsi     # 0x23c35e
movq 0x30(%rsp), %rdx
movl %r9d, %ecx
movl $0x2b, %r9d
xorl %eax, %eax
pushq %rbp
pushq %rbp
pushq %r11
pushq 0x20(%rsp)
pushq %r10
pushq %rdx
callq 0x22b0
movq 0x48(%rsp), %r9
movq 0x40(%rsp), %rcx
addq $0x30, %rsp
movq 0x28(%rcx), %rax
xorq $0x1, %r13
movq (%rax,%r13,8), %rdx
testl %edx, %edx
je 0x15c8fc
movq 0x8(%rcx), %rcx
movq %rdx, %rsi
shrq $0x20, %rsi
movl %edx, %eax
leaq (%rsi,%rsi,2), %rsi
leaq (%rcx,%rsi,8), %rcx
addq $0xc, %rcx
xorl %ebp, %ebp
cmpl $0x0, (%rcx)
js 0x15c8ee
movl -0x4(%rcx), %esi
cmpq %rsi, %r12
je 0x15c8fc
incq %rbp
addq $0x18, %rcx
cmpq %rbp, %rax
jne 0x15c8e1
jmp 0x15c904
cmpl %edx, %ebp
jne 0x15c815
movq 0x1386d5(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0xdfa70(%rip), %rsi     # 0x23c385
movq 0x20(%rsp), %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rsp), %r9
jmp 0x15c815
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rcx
movq (%rcx,%r12,8), %rcx
movq %rcx, 0x20(%rsp)
testl %ecx, %ecx
je 0x15ca8c
leaq (%r9,%r9), %r12
movq 0x20(%rsp), %rdx
movq %rdx, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %r15
shlq $0x3, %r15
addq 0x8(%rax), %r15
movl %edx, %ebx
xorl %r14d, %r14d
leaq (%r14,%r14,2), %rax
cmpl $0x0, 0xc(%r15,%rax,8)
jns 0x15c983
incq %r14
cmpq %rbx, %r14
jne 0x15c96a
jmp 0x15ca8c
leaq (%r15,%rax,8), %rax
movl 0x8(%rax), %r13d
movq 0x28(%rsp), %rax
movq 0x80(%rax), %rax
cmpq %rax, %r9
leaq 0xdf031(%rip), %rdx     # 0x23b9d2
movq %rdx, %rcx
sbbq $-0x1, %rcx
movq 0x138631(%rip), %rsi    # 0x294fe0
movq (%rsi), %rdi
movsbl (%rcx), %r8d
movl %r13d, %r10d
shrl %r10d
cmpq %rax, %r10
movq %rdx, %rax
sbbq $-0x1, %rax
movsbl (%rax), %eax
movq %rax, 0x8(%rsp)
movl %r13d, %eax
andl $0x1, %eax
leaq 0xd58f8(%rip), %rcx     # 0x2322d3
movsbl (%rax,%rcx), %r11d
xorl %ebp, %ebp
leaq 0xdf975(%rip), %rsi     # 0x23c35e
movq 0x30(%rsp), %rdx
movl %r9d, %ecx
movl $0x2d, %r9d
xorl %eax, %eax
pushq %rbp
pushq %rbp
pushq %r11
pushq 0x20(%rsp)
pushq %r10
pushq %rdx
callq 0x22b0
movq 0x48(%rsp), %r9
addq $0x30, %rsp
movq 0x10(%rsp), %rcx
movq 0x28(%rcx), %rax
xorq $0x1, %r13
movq (%rax,%r13,8), %rdx
testl %edx, %edx
je 0x15ca5d
movq 0x8(%rcx), %rcx
movq %rdx, %rsi
shrq $0x20, %rsi
movl %edx, %eax
leaq (%rsi,%rsi,2), %rsi
leaq (%rcx,%rsi,8), %rcx
addq $0xc, %rcx
xorl %ebp, %ebp
cmpl $0x0, (%rcx)
js 0x15ca4f
movl -0x4(%rcx), %esi
cmpq %rsi, %r12
je 0x15ca5d
incq %rbp
addq $0x18, %rcx
cmpq %rbp, %rax
jne 0x15ca42
jmp 0x15ca65
cmpl %edx, %ebp
jne 0x15c976
movq 0x138574(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0xdf926(%rip), %rsi     # 0x23c39c
movq 0x20(%rsp), %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rsp), %r9
jmp 0x15c976
incq %r9
movq 0x10(%rsp), %rdx
movl 0x14(%rdx), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %r9
jb 0x15c7c3
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq