// File: chhylp123[P]hifiasm/hic.cpp
// Function: debug_bub_utg(bubble_type*, ma_ug_t*, asg_t*, unsigned int)
void debug_bub_utg(bubble_type* bub, ma_ug_t *bug, asg_t *bsg, uint32_t check_het)
{
    uint32_t i, k, rId, rId_next, ori, ori_next, root, beg, end;
    uint64_t id0, id1;
    ma_utg_t *u = NULL;
    asg_arc_t *t = NULL;
    for (i = 0; i < bug->u.n; i++)
    {
        u = &(bug->u.a[i]);
        if(u->n == 0) continue;
        for (k = 0; k < u->n; k++)
        {
            if(k+1 >= u->n) continue;
            rId = u->a[k]>>33;
            ori = u->a[k]>>32&1;
            get_bubbles(bub, rId, ori == 1?&root:NULL, ori == 0?&root:NULL, NULL, NULL, NULL);

            t = &(arc_first(bsg, u->a[k]>>32));
            get_bub_id(bub, root>>1, &id0, &id1, check_het);
            if(id0 == (uint64_t)-1 || (t->el == 1 && id1 == (uint64_t)-1) || (t->el == 0 && id1 != (uint64_t)-1))
            {
                fprintf(stderr, "sbsbsb0sbsbsb-utg%.6d, check_het: %u\n", (int)((root>>1)+1), check_het);
                fprintf(stderr, "id0: %lu, id1: %lu, t->el: %u\n", id0, id1, t->el);
                continue;
            }

            ///fprintf(stderr, "aaaaaaaa10aaaaaaaa-utg%.6d\n", (int)((root>>1)+1));

            rId_next = u->a[k+1]>>33;
            ori_next = u->a[k+1]>>32&1;


            get_bubbles(bub, rId, &beg, &end, NULL, NULL, NULL);
            if(ori == 1)
            {
                if(root != beg) fprintf(stderr, "sbsbsb1sbsbsb, root: %u, beg: %u, end: %u\n", root, beg, end);
            }
            else
            {
                if(root != end) fprintf(stderr, "sbsbsb2sbsbsb, root: %u, beg: %u, end: %u\n", root, beg, end);
            }

            if(t->el == 1)
            {
                get_bubbles(bub, rId_next, &beg, &end, NULL, NULL, NULL);
                if(ori_next == 0)
                {
                    if(root != (beg^1)) fprintf(stderr, "sbsbsb3sbsbsb, root: %u, beg: %u, end: %u\n", root, beg, end);
                }
                else
                {
                    if(root != (end^1)) fprintf(stderr, "sbsbsb4sbsbsb, root: %u, beg: %u, end: %u\n", root, beg, end);
                }
            }
        }
    }

    fprintf(stderr, "[M::%s]\n", __func__);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1dd0b5
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x20(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x1dcd96
jmp 0x1dd0a7
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1dd0a5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movq -0x58(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jb 0x1dcdc1
jmp 0x1dd097
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x28(%rbp)
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0x28(%rbp), %eax
movq %rax, -0x68(%rbp)
cmpl $0x1, -0x30(%rbp)
jne 0x1dce10
leaq -0x38(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x1dce18
xorl %eax, %eax
movq %rax, -0x78(%rbp)
jmp 0x1dce18
movq -0x78(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x1dce33
leaq -0x38(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1dce3e
xorl %eax, %eax
movq %rax, -0x88(%rbp)
jmp 0x1dce3e
movq -0x80(%rbp), %rdx
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdi
movq -0x88(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x58(%rbp), %rdx
movq 0x18(%rdx), %rdx
movl -0x24(%rbp), %esi
movq (%rdx,%rsi,8), %rdx
shrq $0x20, %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %esi
shrl %esi
movl -0x1c(%rbp), %r8d
leaq -0x48(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0x1dc360
cmpq $-0x1, -0x48(%rbp)
je 0x1dcee5
movq -0x60(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x1, %eax
jne 0x1dced1
cmpq $-0x1, -0x50(%rbp)
je 0x1dcee5
movq -0x60(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x0, %eax
jne 0x1dcf36
cmpq $-0x1, -0x50(%rbp)
je 0x1dcf36
movq 0x1e70f4(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x38(%rbp), %edx
shrl %edx
addl $0x1, %edx
movl -0x1c(%rbp), %ecx
leaq 0x1af9ac(%rip), %rsi    # 0x38c8ad
movb $0x0, %al
callq 0x22a0
movq 0x1e70d1(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x60(%rbp), %rax
movzbl 0x12(%rax), %r8d
leaq 0x1af9a9(%rip), %rsi    # 0x38c8d3
movb $0x0, %al
callq 0x22a0
jmp 0x1dd097
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x2c(%rbp)
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, %esi
leaq -0x3c(%rbp), %rdx
leaq -0x40(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
cmpl $0x1, -0x30(%rbp)
jne 0x1dcfc8
movl -0x38(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0x1dcfc6
movq 0x1e7035(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x38(%rbp), %edx
movl -0x3c(%rbp), %ecx
movl -0x40(%rbp), %r8d
leaq 0x1af933(%rip), %rsi    # 0x38c8f2
movb $0x0, %al
callq 0x22a0
jmp 0x1dcff4
movl -0x38(%rbp), %eax
cmpl -0x40(%rbp), %eax
je 0x1dcff2
movq 0x1e7009(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x38(%rbp), %edx
movl -0x3c(%rbp), %ecx
movl -0x40(%rbp), %r8d
leaq 0x1af932(%rip), %rsi    # 0x38c91d
movb $0x0, %al
callq 0x22a0
jmp 0x1dcff4
movq -0x60(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x1, %eax
jne 0x1dd095
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
leaq -0x3c(%rbp), %rdx
leaq -0x40(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1c4b20
cmpl $0x0, -0x34(%rbp)
jne 0x1dd062
movl -0x38(%rbp), %eax
movl -0x3c(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
je 0x1dd060
movq 0x1e6f9b(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x38(%rbp), %edx
movl -0x3c(%rbp), %ecx
movl -0x40(%rbp), %r8d
leaq 0x1af8ef(%rip), %rsi    # 0x38c948
movb $0x0, %al
callq 0x22a0
jmp 0x1dd093
movl -0x38(%rbp), %eax
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
je 0x1dd091
movq 0x1e6f6a(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x38(%rbp), %edx
movl -0x3c(%rbp), %ecx
movl -0x40(%rbp), %r8d
leaq 0x1af8e9(%rip), %rsi    # 0x38c973
movb $0x0, %al
callq 0x22a0
jmp 0x1dd093
jmp 0x1dd095
jmp 0x1dd097
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1dcd9d
jmp 0x1dd0a7
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1dcd61
movq 0x1e6f24(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x1b0067(%rip), %rsi    # 0x38d12d
leaq 0x1af8d1(%rip), %rdx    # 0x38c99e
movb $0x0, %al
callq 0x22a0
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)