// File: chhylp123[P]hifiasm/hic.cpp
// Function: print_debug_hc_links(ha_ug_index*, bubble_type*, hc_links*, kv_u_trans_t*, kvec_pe_hit*)
void print_debug_hc_links(ha_ug_index* idx, bubble_type* bub, hc_links* lk, kv_u_trans_t *ta, kvec_pe_hit* hits)
{
    uint64_t k, len = 0, occ = 0, shif = 64 - idx->uID_bits, beg, end;
    hc_edge *e = NULL;
    for (k = 0; k < hits->a.n; ++k) 
    {
        beg = ((hits->a.a[k].s<<1)>>shif);
        end = ((hits->a.a[k].e<<1)>>shif);
        if(beg == end) continue;
        if(IF_HOM(beg, *bub)) continue;
        if(IF_HOM(end, *bub)) continue;
        len += (hits->a.a[k].len>>32) + ((uint32_t)hits->a.a[k].len);
        occ++;
    }

    fprintf(stderr, "# total Hi-C aligned bases: %lu\n", len);
    fprintf(stderr, "# total Hi-C aligned pairs: %lu\n", occ);
    for (k = 0; k < ta->n; k++)
    {
        e = get_hc_edge(lk, ta->a[k].qn, ta->a[k].tn, 0);
        fprintf(stderr, "s-utg%.6ul\td-utg%.6ul\tD:%lu\tW:%f\n", 
        ta->a[k].qn+1, ta->a[k].tn+1, e->dis == (uint64_t)-1? (uint64_t)-1 : e->dis>>3, ta->a[k].nw);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rcx
movl $0x40, %eax
subq 0x18(%rcx), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x2042ad
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
shlq %rax
movq -0x48(%rbp), %rcx
shrq %cl, %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shlq %rax
movq -0x48(%rbp), %rcx
shrq %cl, %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x58(%rbp), %rax
jne 0x204209
jmp 0x20429c
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x20422d
jmp 0x20429c
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x204251
jmp 0x20429c
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x30(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq 0x18(%rcx), %rcx
movl %ecx, %ecx
addq %rcx, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2041a0
movq 0x1bfd2c(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
leaq 0x188ec1(%rip), %rsi    # 0x38d183
movb $0x0, %al
callq 0x22a0
movq 0x1bfd10(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x40(%rbp), %rdx
leaq 0x188ec6(%rip), %rsi    # 0x38d1a4
movb $0x0, %al
callq 0x22a0
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x2043e3
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %esi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x60(%rbp)
movq 0x1bfca0(%rip), %rax    # 0x3c3fe0
movq (%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movq -0x60(%rbp), %rax
cmpq $-0x1, 0x10(%rax)
jne 0x204391
movq $-0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x2043a1
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x3, %rax
movq %rax, -0x78(%rbp)
movl -0x64(%rbp), %ecx
movl -0x68(%rbp), %edx
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %r8
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x30, -0x30(%rbp), %rsi
addq %rsi, %rax
movsd 0x20(%rax), %xmm0
leaq 0x188dfa(%rip), %rsi    # 0x38d1c5
movb $0x1, %al
callq 0x22a0
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2042ed
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)