// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: print_hc_links(hc_links*, int, H_partition*)
void print_hc_links(hc_links* link, int dir, H_partition* hap)
{
    uint64_t i, k;
    if(dir == 0)
    {
        double f_w, r_w;
        for (i = 0; i < link->a.n; ++i) 
        { 
            f_w = r_w = 0;
            for (k = 0; k < link->a.a[i].e.n; k++)
            {
                if(link->a.a[i].e.a[k].del) continue;
                fprintf(stderr, "s-utg%.6dl(%c)\tCLU:%d:%u\td-utg%.6dl(%c)\tCLU:%d:%u\t%lu\t%c\t%f\te\n", 
                (int)(i+1), "01"[!!(link->a.a[i].e.a[k].dis&(uint64_t)2)],
                get_phase_status(hap, i), hap->hap[i]>>3, 
                (int)(link->a.a[i].e.a[k].uID+1), "01"[!!(link->a.a[i].e.a[k].dis&(uint64_t)1)],
                get_phase_status(hap, link->a.a[i].e.a[k].uID), hap->hap[link->a.a[i].e.a[k].uID]>>3, 
                link->a.a[i].e.a[k].dis == (uint64_t)-1? (uint64_t)-1 : link->a.a[i].e.a[k].dis>>3,
                "fb"[!!(link->a.a[i].e.a[k].dis&(uint64_t)4)], link->a.a[i].e.a[k].weight);  
                if(get_phase_status(hap, i) == get_phase_status(hap, link->a.a[i].e.a[k].uID))
                {
                    f_w += link->a.a[i].e.a[k].weight;
                }  
                else
                {
                    r_w += link->a.a[i].e.a[k].weight;
                }
            }

            // fprintf(stderr, "self-utg%.6dl\tFW:%f\tRW:%f\tRT:%f\n**************************************************\n", 
            // (int)(i+1), f_w, r_w, (f_w+r_w) != 0? r_w/(f_w+r_w):0);
        }
    }
    

    if(dir == 1)
    {
        for (i = 0; i < link->a.n; ++i) 
        { 
            for (k = 0; k < link->a.a[i].f.n; k++)
            {
                if(link->a.a[i].f.a[k].del) continue;
                fprintf(stderr, "s-utg%.6d\td-utg%.6d\t%lu\te\n", 
                (int)(i+1), (int)(link->a.a[i].f.a[k].uID+1), link->a.a[i].f.a[k].dis);    
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, 0x18(%rsp)
movq %rdi, %rbx
cmpl $0x1, %esi
je 0xff885
testl %esi, %esi
jne 0xff8ef
xorl %r13d, %r13d
movq 0x18(%rsp), %r15
cmpq (%rbx), %r13
jae 0xff8ef
leal 0x1(%r13), %eax
movl %eax, 0x4(%rsp)
movq 0x10(%rbx), %rax
imulq $0x30, %r13, %r12
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %r13, 0x10(%rsp)
cmpq (%rax,%r12), %r14
jae 0xff87d
leaq (%rax,%r12), %rcx
movq 0x10(%rcx), %rcx
cmpb $0x0, 0x18(%rcx,%rbp)
jns 0xff74a
incq %r14
addq $0x28, %rbp
jmp 0xff728
movq 0x15388f(%rip), %rax    # 0x252fe0
movq (%rax), %rax
movq %rax, 0x38(%rsp)
btl $0x1, 0x10(%rcx,%rbp)
leaq 0xee159(%rip), %rax     # 0x1ed8bf
adcq $0x0, %rax
movsbl (%rax), %eax
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movl %r13d, %esi
callq 0x121555
movl %eax, 0x8(%rsp)
movq 0x10(%r15), %rax
movq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %r13d
shrl $0x3, %r13d
movq 0x10(%rbx), %rax
movq 0x10(%rax,%r12), %rax
movl 0x8(%rax,%rbp), %esi
leal 0x1(%rsi), %ecx
movq %rcx, 0x40(%rsp)
movq 0x10(%rax,%rbp), %rax
andl $0x1, %eax
leaq 0xee10a(%rip), %rcx     # 0x1ed8bf
movsbl (%rax,%rcx), %eax
movq %rax, 0x30(%rsp)
movq %r15, %rdi
callq 0x121555
movq %rax, 0x28(%rsp)
movq 0x10(%r15), %rax
movq 0x10(%rbx), %rcx
movq 0x10(%rcx,%r12), %rcx
movl 0x8(%rcx,%rbp), %edx
movl (%rax,%rdx,4), %r11d
shrl $0x3, %r11d
movq 0x10(%rcx,%rbp), %rax
movq %rax, %r10
shrq $0x3, %r10
cmpq $-0x1, %rax
cmoveq %rax, %r10
btl $0x2, %eax
leaq 0xee0bf(%rip), %rax     # 0x1ed8c2
adcq $0x0, %rax
movsbl (%rax), %eax
movq %rax, 0x20(%rsp)
movsd (%rcx,%rbp), %xmm0
movq 0x38(%rsp), %rdi
leaq 0xee060(%rip), %rsi     # 0x1ed880
movl 0x4(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl %r13d, %r9d
movq 0x10(%rsp), %r13
movb $0x1, %al
pushq 0x20(%rsp)
pushq %r10
pushq %r11
pushq 0x40(%rsp)
pushq 0x50(%rsp)
pushq 0x68(%rsp)
callq 0x22b0
addq $0x30, %rsp
movq %r15, %rdi
movl %r13d, %esi
callq 0x121555
movq 0x10(%rbx), %rax
movq 0x10(%rax,%r12), %rax
movl 0x8(%rax,%rbp), %esi
movq %r15, %rdi
callq 0x121555
movq 0x10(%rbx), %rax
jmp 0xff741
incq %r13
jmp 0xff705
xorl %r13d, %r13d
cmpq (%rbx), %r13
jae 0xff8ef
leal 0x1(%r13), %ebp
imulq $0x30, %r13, %r15
pushq $0x18
popq %r12
xorl %r14d, %r14d
movq 0x10(%rbx), %rax
cmpq 0x18(%rax,%r15), %r14
jae 0xff8ea
addq %r15, %rax
addq $0x18, %rax
movq 0x10(%rax), %rax
cmpb $0x0, (%rax,%r12)
jns 0xff8c2
incq %r14
addq $0x28, %r12
jmp 0xff89c
movq 0x153717(%rip), %rcx    # 0x252fe0
movq (%rcx), %rdi
movl -0x10(%rax,%r12), %ecx
incl %ecx
movq -0x8(%rax,%r12), %r8
leaq 0xedfe6(%rip), %rsi     # 0x1ed8c5
movl %ebp, %edx
xorl %eax, %eax
callq 0x22b0
jmp 0xff8b9
incq %r13
jmp 0xff888
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq