// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: print_phased_bubble(G_partition*, bubble_type*, unsigned int)
void print_phased_bubble(G_partition* x, bubble_type* bub, uint32_t utg_n)
{
    uint64_t i, k;
    uint32_t beg = 0, sink = 0, h0_n, h1_n, *h0, *h1, full_bub = 0, bubID = 0;

    for (i = 0; i < x->n; i++)
    {
        get_phased_block(x, bub, i, &beg, &sink, &h0, &h0_n, &h1, &h1_n, &full_bub, &bubID);

        fprintf(stderr, "\n[%lu]\tbeg:utg%.6ul\tsink:utg%.6ul\tphased=%u\n", i, (beg>>1)+1, (sink>>1)+1, full_bub);
        for (k = 0; k < h0_n; k++)
        {
            fprintf(stderr, "(0) utg%.6ul\n", h0[k] + 1);
        }

        for (k = 0; k < h1_n; k++)
        {
            fprintf(stderr, "(1) utg%.6ul\n", h1[k] + 1);
        }

        uint32_t n, *a;
        get_bubbles(bub, bubID, &beg, &sink, &a, &n, NULL);
        if(n > 2) fprintf(stderr, "complex\n");
    }

    /*******************************for debug************************************/
    for (i = 0; i < utg_n; i++)
    {
        if(x->index[i] == (uint32_t)-1) continue;
        partition_warp* p = &(x->a[x->index[i]]);
        for (k = 0; k < p->a.n; k++)
        {
            if(p->a.a[k] != i) break;
        }

        if(k == p->a.n) fprintf(stderr, "ERROR\n");
    }
    /*******************************for debug************************************/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, 0xc(%rsp)
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x14a4a3
movq %rsi, %r14
movl $0x20, %r13d
xorl %edx, %edx
xorl %r15d, %r15d
xorl %r8d, %r8d
xorl %r12d, %r12d
movq %rsi, 0x18(%rsp)
movq 0x10(%rbx), %rax
testq %r14, %r14
je 0x14a3ca
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
cmpq $0x0, -0x20(%rax,%r13)
jne 0x14a38f
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x14a3c4
movq -0x10(%rax,%r13), %rcx
movl (%rcx), %ecx
movq (%r14), %rdi
movq 0x80(%r14), %rsi
movl (%rdi,%rcx,4), %r12d
incq %rsi
cmpq %r12, %rsi
jbe 0x14a3c4
movq 0x28(%r14), %rcx
movq 0x40(%r14), %rsi
movl (%rsi,%r12,4), %esi
movl (%rcx,%rsi,4), %r15d
incl %esi
movl (%rcx,%rsi,4), %r8d
jmp 0x14a3ca
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq %r12, 0x20(%rsp)
movq -0x10(%rax,%r13), %r12
movl -0x8(%rax,%r13), %r14d
leaq (%r12,%r14,4), %rcx
movl -0x4(%rax,%r13), %ebp
testq %rbp, %rbp
movzbl (%rax,%r13), %r9d
cmoveq %rbp, %rcx
movq %rcx, 0x10(%rsp)
movq 0x14abe6(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
shrl %r15d
incl %r15d
shrl %r8d
incl %r8d
leaq 0xf1789(%rip), %rsi     # 0x23bb99
movq %rdx, (%rsp)
movl %r15d, %ecx
xorl %eax, %eax
callq 0x22b0
testq %r14, %r14
cmoveq %r14, %r12
jne 0x14a472
testq %rbp, %rbp
movq (%rsp), %rdx
jne 0x14a47f
movq 0x20(%rsp), %r12
movl %r12d, %eax
movq 0x18(%rsp), %r14
movq 0x28(%r14), %rcx
movq 0x40(%r14), %rdi
movl (%rdi,%rax,4), %esi
movl 0x4(%rdi,%rax,4), %eax
subl %esi, %eax
movl (%rcx,%rsi,4), %r15d
incl %esi
movl (%rcx,%rsi,4), %r8d
addl $-0x5, %eax
cmpl $-0x4, %eax
jbe 0x14a492
incq %rdx
addq $0x48, %r13
cmpq (%rbx), %rdx
jb 0x14a370
jmp 0x14a4a3
movq %r12, %rdi
movq %r14, %rsi
callq 0x1c6d6
jmp 0x14a427
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x1c71c
movq (%rsp), %rdx
jmp 0x14a430
movl %r8d, %ebp
callq 0x1c762
movl %ebp, %r8d
movq (%rsp), %rdx
jmp 0x14a460
movl 0xc(%rsp), %eax
testl %eax, %eax
je 0x14a509
movl %eax, %r14d
xorl %r15d, %r15d
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rax
movl (%rax,%r15,4), %eax
cmpq %r12, %rax
je 0x14a4f8
movq 0x10(%rbx), %rcx
leaq (%rax,%rax,8), %rdx
movq (%rcx,%rdx,8), %rax
testq %rax, %rax
je 0x14a4f1
leaq (%rcx,%rdx,8), %rcx
movq 0x10(%rcx), %rdx
xorl %ecx, %ecx
movl (%rdx,%rcx,4), %esi
cmpq %rsi, %r15
jne 0x14a4f3
incq %rcx
cmpq %rcx, %rax
jne 0x14a4df
jmp 0x14a502
xorl %ecx, %ecx
cmpq %rax, %rcx
je 0x14a502
incq %r15
cmpq %r14, %r15
jne 0x14a4b7
jmp 0x14a509
callq 0x1c77e
jmp 0x14a4f8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq