// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movq %rdx, 0x18(%rsp)
movq %rdi, %rbx
cmpl $0x1, %esi
je 0x14134b
testl %esi, %esi
jne 0x1413a7
movl %esi, 0x10(%rsp)
cmpq $0x0, (%rbx)
je 0x141344
xorl %r15d, %r15d
movq 0x10(%rbx), %rcx
leaq (%r15,%r15,2), %r13
shlq $0x4, %r13
cmpq $0x0, (%rcx,%r13)
je 0x141338
movl %r15d, %eax
movq %rax, 0x20(%rsp)
leal 0x1(%r15), %eax
movl %eax, 0x14(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %r15, 0x28(%rsp)
movq 0x10(%rcx,%r13), %rax
cmpb $0x0, 0x18(%rax,%rbp)
jns 0x141205
incq %r12
movq 0x10(%rbx), %rcx
addq $0x28, %rbp
cmpq (%rcx,%r13), %r12
jb 0x1411e3
jmp 0x141338
btl $0x1, 0x10(%rax,%rbp)
leaq 0xee56d(%rip), %rax     # 0x22f77f
adcq $0x0, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %r9
movq 0x10(%r9), %r10
movq 0x20(%rsp), %rax
movl (%r10,%rax,4), %eax
movl 0x18(%r9), %r11d
xorl %edx, %edx
testl %eax, %r11d
setne %dl
leal (%rdx,%rdx,2), %edx
addl $-0x2, %edx
movl 0x1c(%r9), %edi
movl %edi, %esi
andl %eax, %esi
negl %esi
movl $0x0, %r8d
sbbl %r8d, %r8d
orl %edx, %r8d
movl 0x20(%r9), %r14d
testl %eax, %r14d
movl $0x0, %eax
cmovnel %eax, %r8d
movl (%r10,%r15,4), %r9d
shrl $0x3, %r9d
movq 0x10(%rcx,%r13), %rdx
movl 0x8(%rdx,%rbp), %esi
movq 0x10(%rdx,%rbp), %rcx
movl %ecx, %eax
andl $0x1, %eax
movl (%r10,%rsi,4), %r10d
xorl %r15d, %r15d
testl %r11d, %r10d
setne %r15b
leal (%r15,%r15,2), %r15d
addl $-0x2, %r15d
andl %r10d, %edi
negl %edi
movl $0x0, %r11d
sbbl %r11d, %r11d
orl %r15d, %r11d
testl %r14d, %r10d
movl $0x0, %edi
cmovnel %edi, %r11d
shrl $0x3, %r10d
movq %rcx, %r15
shrq $0x3, %r15
cmpq $-0x1, %rcx
cmoveq %rcx, %r15
btl $0x2, %ecx
movq 0x148d0f(%rip), %rcx    # 0x289fe0
movq (%rcx), %rdi
movq 0x8(%rsp), %rcx
movsbl (%rcx), %ecx
leal 0x1(%rsi), %esi
movq %rsi, 0x8(%rsp)
leaq 0xee494(%rip), %rsi     # 0x22f77f
movsbl (%rax,%rsi), %eax
movq %rax, 0x30(%rsp)
movsd (%rdx,%rbp), %xmm0
leaq 0xee482(%rip), %rax     # 0x22f782
adcq $0x0, %rax
movsbl (%rax), %r14d
leaq 0xee431(%rip), %rsi     # 0x22f740
movl 0x14(%rsp), %edx
movb $0x1, %al
pushq %r14
pushq %r15
movq 0x38(%rsp), %r15
pushq %r10
pushq %r11
pushq 0x50(%rsp)
pushq 0x30(%rsp)
callq 0x22b0
addq $0x30, %rsp
jmp 0x1411ef
incq %r15
cmpq (%rbx), %r15
jb 0x1411b2
cmpl $0x1, 0x10(%rsp)
jne 0x1413a7
cmpq $0x0, (%rbx)
je 0x1413a7
xorl %r14d, %r14d
movq 0x10(%rbx), %rax
leaq (%r14,%r14,2), %r15
shlq $0x4, %r15
cmpq $0x0, 0x18(%rax,%r15)
je 0x14139f
leal 0x1(%r14), %ebp
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x28(%rax,%r15), %rdi
cmpb $0x0, 0x18(%rdi,%r12)
jns 0x141393
incq %r13
movq 0x10(%rbx), %rax
addq $0x28, %r12
cmpq 0x18(%rax,%r15), %r13
jb 0x141372
jmp 0x14139f
addq %r12, %rdi
movl %ebp, %esi
callq 0x1cd5a
jmp 0x14137f
incq %r14
cmpq (%rbx), %r14
jb 0x141354
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq