// File: 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
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xe0, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0xb8(%rax), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x58(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x1ff76b
movq -0x18(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdx
leaq -0x4c(%rbp), %rcx
leaq -0x40(%rbp), %r8
leaq -0x44(%rbp), %r9
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x1c4b20
leaq -0x80(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl -0x34(%rbp), %ecx
movl -0x34(%rbp), %eax
movl %eax, %r8d
movq -0x18(%rbp), %rax
movq 0x80(%rax), %r9
movl $0x1, %eax
xorl %esi, %esi
cmpq %r9, %r8
cmovbl %esi, %eax
movslq %eax, %rsi
leaq 0x18cfe8(%rip), %rax    # 0x38c5ef
movsbl (%rax,%rsi), %r8d
leaq 0x1877f3(%rip), %rsi    # 0x386e06
movb $0x0, %al
callq 0x2050
movq 0x1c49bf(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq -0x80(%rbp), %rdx
movl -0x44(%rbp), %ecx
leaq 0x18d960(%rip), %rsi    # 0x38cf92
movb $0x0, %al
callq 0x22a0
cmpl $-0x1, -0x48(%rbp)
je 0x1ff690
movq 0x1c499a(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x48(%rbp), %edx
shrl %edx
addl $0x1, %edx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x48(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x185c8c(%rip), %rax    # 0x385303
movsbl (%rax,%rcx), %ecx
leaq 0x18d920(%rip), %rsi    # 0x38cfa2
leaq 0x18d929(%rip), %r8     # 0x38cfb2
movb $0x0, %al
callq 0x22a0
cmpl $-0x1, -0x4c(%rbp)
je 0x1ff6e7
movq 0x1c4943(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x4c(%rbp), %edx
shrl %edx
addl $0x1, %edx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x4c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x185c35(%rip), %rax    # 0x385303
movsbl (%rax,%rcx), %ecx
leaq 0x18d8c9(%rip), %rsi    # 0x38cfa2
leaq 0x18d8d6(%rip), %r8     # 0x38cfb6
movb $0x0, %al
callq 0x22a0
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x44(%rbp), %eax
jae 0x1ff75b
movq -0x40(%rbp), %rax
movl -0x38(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x50(%rbp)
movq 0x1c48d4(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x50(%rbp), %edx
addl $0x1, %edx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x50(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x185bcc(%rip), %rax    # 0x385303
movsbl (%rax,%rcx), %ecx
leaq 0x18d860(%rip), %rsi    # 0x38cfa2
leaq 0x18d872(%rip), %r8     # 0x38cfbb
movb $0x0, %al
callq 0x22a0
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1ff6ee
jmp 0x1ff75d
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1ff594
movq $0x0, -0x88(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x58(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x1ffcd8
movl -0x34(%rbp), %eax
shll %eax
movl %eax, -0x90(%rbp)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x90(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x90(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x8c(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x8c(%rbp), %eax
jae 0x1ffa27
movq -0x88(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1ff81b
jmp 0x1ffa19
movq -0x88(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x94(%rbp)
movq 0x1c47a4(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
movl -0x90(%rbp), %ecx
shrl %ecx
movl -0x90(%rbp), %eax
shrl %eax
movl %eax, %eax
movl %eax, %r8d
movq -0x18(%rbp), %rax
movq 0x80(%rax), %r9
movl $0x1, %eax
xorl %esi, %esi
cmpq %r9, %r8
cmovbl %esi, %eax
movslq %eax, %rsi
leaq 0x18cd75(%rip), %rax    # 0x38c5ef
movsbl (%rax,%rsi), %r8d
movl -0x90(%rbp), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x183608(%rip), %rax    # 0x382e9b
movsbl (%rax,%rsi), %r9d
movq -0x28(%rbp), %rbx
movl -0x94(%rbp), %r11d
shrl %r11d
movl -0x94(%rbp), %eax
shrl %eax
movl %eax, %eax
movl %eax, %r10d
movq -0x18(%rbp), %rax
movq 0x80(%rax), %r14
movl $0x1, %eax
xorl %esi, %esi
cmpq %r14, %r10
cmovbl %esi, %eax
movslq %eax, %rsi
leaq 0x18cd1a(%rip), %rax    # 0x38c5ef
movsbl (%rax,%rsi), %r10d
movl -0x94(%rbp), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x1835ad(%rip), %rax    # 0x382e9b
movsbl (%rax,%rsi), %eax
leaq 0x18d6c6(%rip), %rsi    # 0x38cfbf
xorl %r14d, %r14d
movq %rbx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0x28(%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x94(%rbp), %edx
xorl $0x1, %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x94(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0xa4(%rbp)
movl $0x0, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
cmpl -0xa4(%rbp), %eax
jae 0x1ff9e5
movq -0xa0(%rbp), %rax
movl -0xa8(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1ff9ac
jmp 0x1ff9d4
movq -0xa0(%rbp), %rax
movl -0xa8(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x90(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1ff9d2
jmp 0x1ff9e5
jmp 0x1ff9d4
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0x1ff97d
movl -0xa8(%rbp), %eax
cmpl -0xa4(%rbp), %eax
jne 0x1ffa17
movq 0x1c45e6(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0xa4(%rbp), %edx
movl -0x8c(%rbp), %ecx
leaq 0x18d5d6(%rip), %rsi    # 0x38cfe6
movb $0x0, %al
callq 0x22a0
jmp 0x1ffa19
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1ff7eb
movl -0x34(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x90(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x90(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x8c(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x8c(%rbp), %eax
jae 0x1ffcc8
movq -0x88(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1ffabc
jmp 0x1ffcba
movq -0x88(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x94(%rbp)
movq 0x1c4503(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
movl -0x90(%rbp), %ecx
shrl %ecx
movl -0x90(%rbp), %eax
shrl %eax
movl %eax, %eax
movl %eax, %r8d
movq -0x18(%rbp), %rax
movq 0x80(%rax), %r9
movl $0x1, %eax
xorl %esi, %esi
cmpq %r9, %r8
cmovbl %esi, %eax
movslq %eax, %rsi
leaq 0x18cad4(%rip), %rax    # 0x38c5ef
movsbl (%rax,%rsi), %r8d
movl -0x90(%rbp), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x183367(%rip), %rax    # 0x382e9b
movsbl (%rax,%rsi), %r9d
movq -0x28(%rbp), %rbx
movl -0x94(%rbp), %r11d
shrl %r11d
movl -0x94(%rbp), %eax
shrl %eax
movl %eax, %eax
movl %eax, %r10d
movq -0x18(%rbp), %rax
movq 0x80(%rax), %r14
movl $0x1, %eax
xorl %esi, %esi
cmpq %r14, %r10
cmovbl %esi, %eax
movslq %eax, %rsi
leaq 0x18ca79(%rip), %rax    # 0x38c5ef
movsbl (%rax,%rsi), %r10d
movl -0x94(%rbp), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x18330c(%rip), %rax    # 0x382e9b
movsbl (%rax,%rsi), %eax
leaq 0x18d425(%rip), %rsi    # 0x38cfbf
xorl %r14d, %r14d
movq %rbx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0x28(%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x94(%rbp), %edx
xorl $0x1, %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x94(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0xb4(%rbp)
movl $0x0, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
cmpl -0xb4(%rbp), %eax
jae 0x1ffc86
movq -0xb0(%rbp), %rax
movl -0xb8(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1ffc4d
jmp 0x1ffc75
movq -0xb0(%rbp), %rax
movl -0xb8(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x90(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1ffc73
jmp 0x1ffc86
jmp 0x1ffc75
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x1ffc1e
movl -0xb8(%rbp), %eax
cmpl -0xb4(%rbp), %eax
jne 0x1ffcb8
movq 0x1c4345(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0xb4(%rbp), %edx
movl -0x8c(%rbp), %ecx
leaq 0x18d34c(%rip), %rsi    # 0x38cffd
movb $0x0, %al
callq 0x22a0
jmp 0x1ffcba
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1ffa8c
jmp 0x1ffcca
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1ff77d
addq $0xe0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)