// File: /workspace/github_cpp_makefile_star2_O2/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 $0x78, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, 0x28(%rsp)
movq 0xb8(%rdi), %r8
leaq 0x38(%rsp), %r13
leaq 0x50(%rsp), %r15
leaq 0xd040c(%rip), %r12     # 0x1e668b
leaq 0xd7fab(%rip), %rbp     # 0x1ee231
xorl %r14d, %r14d
movq %r8, (%rsp)
movl 0x14(%r8), %eax
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpq %rcx, %r14
jae 0x11641b
subq $0x8, %rsp
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x44(%rsp), %rdx
movq %r13, %rcx
leaq 0x50(%rsp), %r8
leaq 0x14(%rsp), %r9
pushq $0x0
callq 0xf6ab5
popq %rax
popq %rcx
cmpq 0x80(%rbx), %r14
leaq 0xd75e8(%rip), %rax     # 0x1ed8c2
sbbq $-0x1, %rax
movsbl (%rax), %r8d
movq %r15, %rdi
leaq 0xd1fee(%rip), %rsi     # 0x1e82da
movq 0x30(%rsp), %rdx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x2050
movq 0x13ccde(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movl 0xc(%rsp), %ecx
leaq 0xd7f11(%rip), %rsi     # 0x1ee221
movq %r15, %rdx
xorl %eax, %eax
callq 0x22b0
movl 0x3c(%rsp), %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
jne 0x116396
movl 0x38(%rsp), %eax
cmpq %rcx, %rax
movq (%rsp), %r8
jne 0x1163d9
xorl %ebx, %ebx
movl 0xc(%rsp), %eax
cmpq %rax, %rbx
jae 0x11638e
movq 0x48(%rsp), %rax
movl (%rax,%rbx,4), %eax
shrl %eax
movq 0x13cc8b(%rip), %rcx    # 0x252fe0
movq (%rcx), %rdi
imulq $0x28, %rax, %rcx
movl %eax, %edx
incl %edx
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax,%rcx), %eax
shrl $0x1f, %eax
movsbl (%rax,%r12), %ecx
movq %rbp, %rsi
leaq 0xd7ecc(%rip), %r8      # 0x1ee24a
xorl %eax, %eax
callq 0x22b0
movq (%rsp), %r8
incq %rbx
jmp 0x11633b
incq %r14
jmp 0x11628d
movq 0x13cc43(%rip), %rcx    # 0x252fe0
movq (%rcx), %rdi
shrl %eax
movl %eax, %edx
incl %edx
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, %rax, %rax
movl (%rcx,%rax), %eax
shrl $0x1f, %eax
movsbl (%rax,%r12), %ecx
movq %rbp, %rsi
leaq 0xd7e79(%rip), %r8      # 0x1ee241
xorl %eax, %eax
callq 0x22b0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jmp 0x116328
movq 0x13cc00(%rip), %rcx    # 0x252fe0
movq (%rcx), %rdi
shrl %eax
movl %eax, %edx
incl %edx
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, %rax, %rax
movl (%rcx,%rax), %eax
shrl $0x1f, %eax
movsbl (%rax,%r12), %ecx
movq %rbp, %rsi
leaq 0xd7e3a(%rip), %r8      # 0x1ee245
xorl %eax, %eax
callq 0x22b0
movq (%rsp), %r8
jmp 0x116339
xorl %r9d, %r9d
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %r9
jae 0x1166d1
movq 0x28(%r8), %rax
movq %r9, %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rcx
movq %rcx, %rax
shrq $0x20, %rax
imulq $0x18, %rax, %r15
addq 0x8(%r8), %r15
leaq (%r9,%r9), %r12
leaq 0x1(,%r9,2), %rbx
movq %rcx, 0x40(%rsp)
movl %ecx, %r13d
xorl %ebp, %ebp
movq %r9, 0x18(%rsp)
cmpq %r13, %rbp
je 0x116584
imulq $0x18, %rbp, %rax
cmpl $0x0, 0xc(%r15,%rax)
jns 0x11647f
incq %rbp
jmp 0x116465
addq %r15, %rax
movl 0x8(%rax), %r14d
movq 0x28(%rsp), %rax
movq 0x80(%rax), %rax
cmpq %rax, %r9
leaq 0xd7426(%rip), %rdx     # 0x1ed8c2
movq %rdx, %rcx
sbbq $-0x1, %rcx
movq 0x13cb36(%rip), %rsi    # 0x252fe0
movq (%rsi), %rdi
movsbl (%rcx), %r8d
movl %r14d, %r10d
shrl %r10d
cmpq %rax, %r10
movq %rdx, %rax
sbbq $-0x1, %rax
movsbl (%rax), %eax
movq %rax, 0x20(%rsp)
movl %r14d, %eax
andl $0x1, %eax
leaq 0xcdd4d(%rip), %rcx     # 0x1e4223
movsbl (%rax,%rcx), %r11d
leaq 0xd7d6c(%rip), %rsi     # 0x1ee24e
movq 0x30(%rsp), %rdx
movl %r9d, %ecx
pushq $0x2b
popq %r9
xorl %eax, %eax
pushq $0x0
pushq $0x0
pushq %r11
pushq 0x38(%rsp)
pushq %r10
pushq %rdx
callq 0x22b0
movq 0x48(%rsp), %r9
movq 0x30(%rsp), %r8
addq $0x30, %rsp
movq 0x8(%r8), %rcx
movq 0x28(%r8), %rax
xorq $0x1, %r14
movq (%rax,%r14,8), %rdx
movq %rdx, %rsi
shrq $0x20, %rsi
movl %edx, %eax
imulq $0x18, %rsi, %rsi
addq %rcx, %rsi
addq $0xc, %rsi
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x116559
cmpl $0x0, (%rsi)
js 0x116548
movl -0x4(%rsi), %edi
cmpq %rdi, %rbx
je 0x116551
incq %rcx
addq $0x18, %rsi
jmp 0x116536
cmpl %ecx, %edx
jne 0x11647a
movq 0x13ca80(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xd7d0b(%rip), %rsi     # 0x1ee275
movq 0x40(%rsp), %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rsp), %r9
movq (%rsp), %r8
jmp 0x11647a
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rcx
movq (%rcx,%rbx,8), %rdx
movq %rdx, %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rbx
addq 0x8(%rax), %rbx
movq %rdx, 0x20(%rsp)
movl %edx, %r15d
xorl %r13d, %r13d
cmpq %r15, %r13
je 0x1166c5
imulq $0x18, %r13, %rax
cmpl $0x0, 0xc(%rbx,%rax)
jns 0x1165c8
incq %r13
jmp 0x1165af
addq %rbx, %rax
movl 0x8(%rax), %r14d
movq 0x28(%rsp), %rax
movq 0x80(%rax), %rax
cmpq %rax, %r9
leaq 0xd72dd(%rip), %rdx     # 0x1ed8c2
movq %rdx, %rcx
sbbq $-0x1, %rcx
movq 0x13c9ed(%rip), %rsi    # 0x252fe0
movq (%rsi), %rdi
movsbl (%rcx), %r8d
movl %r14d, %r10d
shrl %r10d
cmpq %rax, %r10
movq %rdx, %rax
sbbq $-0x1, %rax
movsbl (%rax), %r11d
movl %r14d, %eax
andl $0x1, %eax
leaq 0xcdc08(%rip), %rcx     # 0x1e4223
movsbl (%rax,%rcx), %ebp
leaq 0xd7c28(%rip), %rsi     # 0x1ee24e
movq 0x30(%rsp), %rdx
movl %r9d, %ecx
pushq $0x2d
popq %r9
xorl %eax, %eax
pushq $0x0
pushq $0x0
pushq %rbp
pushq %r11
pushq %r10
pushq %rdx
callq 0x22b0
movq 0x48(%rsp), %r9
movq 0x30(%rsp), %r8
addq $0x30, %rsp
movq 0x8(%r8), %rcx
movq 0x28(%r8), %rax
xorq $0x1, %r14
movq (%rax,%r14,8), %rdx
movq %rdx, %rsi
shrq $0x20, %rsi
movl %edx, %eax
imulq $0x18, %rsi, %rsi
addq %rcx, %rsi
addq $0xc, %rsi
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x11669a
cmpl $0x0, (%rsi)
js 0x116689
movl -0x4(%rsi), %edi
cmpq %rdi, %r12
je 0x116692
incq %rcx
addq $0x18, %rsi
jmp 0x116677
cmpl %ecx, %edx
jne 0x1165c3
movq 0x13c93f(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xd7be1(%rip), %rsi     # 0x1ee28c
movq 0x20(%rsp), %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rsp), %r9
movq (%rsp), %r8
jmp 0x1165c3
incq %r9
movl 0x14(%r8), %eax
jmp 0x11641e
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq