// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, 0xc(%rsp)
movq %rdx, 0x50(%rsp)
movq %rdi, 0x20(%rsp)
movabsq $0x100000000, %r15      # imm = 0x100000000
xorl %eax, %eax
movq %rsi, 0x40(%rsp)
movl %eax, %eax
cmpq %rax, (%rsi)
jbe 0x1035e8
movq 0x10(%rsi), %rbp
movq %rax, 0x48(%rsp)
imulq $0x28, %rax, %rcx
movl 0x10(%rbp,%rcx), %eax
testl %eax, %eax
je 0x1035d7
addq %rcx, %rbp
xorl %ebx, %ebx
movq %rbp, 0x28(%rsp)
movl %eax, %eax
cmpq %rax, %rbx
jae 0x1035d7
movq %rbx, %r14
incq %rbx
cmpq %rax, %rbx
jae 0x1035b9
movq %rbx, 0x18(%rsp)
movq 0x18(%rbp), %rax
movq (%rax,%r14,8), %rbx
movq %rbx, %r13
shrq $0x21, %r13
movq %rbx, %rdx
andq %r15, %rdx
leaq 0x14(%rsp), %rax
cmovneq %rax, %rdx
movl $0x0, %ecx
cmoveq %rax, %rcx
andq $0x0, (%rsp)
movq %rbp, %r15
movq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xf6ab5
movq 0x50(%rsp), %rdx
movq 0x28(%rdx), %rax
movq 0x18(%r15), %rcx
movl 0x4(%rcx,%r14,8), %ecx
movl 0x4(%rax,%rcx,8), %eax
imulq $0x18, %rax, %r12
addq 0x8(%rdx), %r12
movl 0x14(%rsp), %r15d
movl %r15d, 0x10(%rsp)
shrl %r15d
movq %rbp, %rdi
movl %r15d, %esi
leaq 0x38(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movl 0xc(%rsp), %r8d
callq 0x102d73
cmpq $-0x1, 0x38(%rsp)
je 0x103562
movb 0x12(%r12), %al
cmpb $0x1, %al
sete %dl
movq 0x30(%rsp), %rcx
cmpq $-0x1, %rcx
sete %sil
testb %sil, %dl
jne 0x103562
testb %al, %al
sete %al
cmpq $-0x1, %rcx
setne %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x103562
movq 0x28(%rsp), %rbp
movq 0x18(%rbp), %rax
movq 0x8(%rax,%r14,8), %r14
movq 0x20(%rsp), %rcx
movq 0x28(%rcx), %rax
movq 0x40(%rcx), %rcx
movl (%rcx,%r13,4), %ecx
leal 0x1(%rcx), %edx
movl (%rax,%rcx,4), %ecx
movl (%rax,%rdx,4), %r8d
movabsq $0x100000000, %r15      # imm = 0x100000000
testq %r15, %rbx
jne 0x1034d3
leaq 0xea726(%rip), %rsi     # 0x1edbf0
movl 0x10(%rsp), %edx
cmpl %r8d, %edx
jmp 0x1034e0
leaq 0xea6eb(%rip), %rsi     # 0x1edbc5
movl 0x10(%rsp), %edx
cmpl %ecx, %edx
movq 0x18(%rsp), %rbx
jne 0x1035c1
cmpb $0x1, 0x12(%r12)
jne 0x1035b9
movq %r14, %rax
shrq $0x21, %rax
movq 0x20(%rsp), %rcx
movq 0x28(%rcx), %rdx
movq 0x40(%rcx), %rcx
movl (%rcx,%rax,4), %eax
movl (%rdx,%rax,4), %ecx
incl %eax
movl (%rdx,%rax,4), %r8d
movl 0x14(%rsp), %edx
movl %edx, %eax
testq %r15, %r14
jne 0x103540
xorl %ecx, %eax
cmpl $0x1, %eax
je 0x1035b9
movq 0x14faac(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xea6dd(%rip), %rsi     # 0x1edc1b
jmp 0x103559
xorl %r8d, %eax
cmpl $0x1, %eax
je 0x1035b9
movq 0x14fa91(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xea6ed(%rip), %rsi     # 0x1edc46
xorl %eax, %eax
callq 0x22b0
jmp 0x1035b9
movq 0x14fa77(%rip), %rbx    # 0x252fe0
movq (%rbx), %rdi
incl %r15d
leaq 0xea60a(%rip), %rsi     # 0x1edb80
movl %r15d, %edx
movl 0xc(%rsp), %ecx
xorl %eax, %eax
callq 0x22b0
movq (%rbx), %rdi
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
movzbl 0x12(%r12), %r8d
leaq 0xea608(%rip), %rsi     # 0x1edba6
xorl %eax, %eax
callq 0x22b0
movabsq $0x100000000, %r15      # imm = 0x100000000
movq 0x28(%rsp), %rbp
movq 0x18(%rsp), %rbx
movl 0x10(%rbp), %eax
jmp 0x10339f
movq 0x14fa18(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
xorl %eax, %eax
callq 0x22b0
jmp 0x1034eb
movq 0x48(%rsp), %rax
incl %eax
movq 0x40(%rsp), %rsi
jmp 0x103371
movq 0x14f9f1(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xeadc3(%rip), %rsi     # 0x1ee3bc
leaq 0xea671(%rip), %rdx     # 0x1edc71
xorl %eax, %eax
callq 0x22b0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq