// File: /workspace/github_cpp_makefile_star2_O3/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 0x146fd4
testl %esi, %esi
jne 0x147054
movq (%rbx), %rax
testq %rax, %rax
je 0x147054
movq 0x10(%rbx), %rcx
xorl %r15d, %r15d
movq %rbx, 0x10(%rsp)
leaq (%r15,%r15,2), %r12
shlq $0x4, %r12
cmpq $0x0, (%rcx,%r12)
je 0x146fc3
movl %r15d, %eax
movq %rax, 0x20(%rsp)
leal 0x1(%r15), %eax
movl %eax, 0xc(%rsp)
movl $0x18, %r13d
xorl %ebp, %ebp
movq %r15, 0x28(%rsp)
movq 0x10(%rcx,%r12), %rax
cmpb $0x0, (%rax,%r13)
jns 0x146e94
incq %rbp
addq $0x28, %r13
cmpq (%rcx,%r12), %rbp
jb 0x146e76
jmp 0x146fc0
movq -0x8(%rax,%r13), %rcx
btl $0x1, %ecx
leaq 0xf4b2b(%rip), %rdx     # 0x23b9cf
adcq $0x0, %rdx
movq 0x18(%rsp), %r14
movq 0x10(%r14), %r10
movq 0x20(%rsp), %rsi
movl (%r10,%rsi,4), %esi
movl 0x18(%r14), %r11d
xorl %edi, %edi
testl %esi, %r11d
setne %dil
leal (%rdi,%rdi,2), %r9d
addl $-0x2, %r9d
movl 0x1c(%r14), %edi
movl %edi, %r8d
andl %esi, %r8d
negl %r8d
movl $0x0, %r8d
sbbl %r8d, %r8d
orl %r9d, %r8d
movl 0x20(%r14), %r14d
testl %esi, %r14d
movl $0x0, %esi
cmovnel %esi, %r8d
movl (%r10,%r15,4), %r9d
shrl $0x3, %r9d
movl -0x10(%rax,%r13), %esi
movl %ecx, %ebx
andl $0x1, %ebx
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 0x14e085(%rip), %rcx    # 0x294fe0
movq (%rcx), %rdi
movsbl (%rdx), %ecx
leal 0x1(%rsi), %edx
movq %rdx, 0x30(%rsp)
leaq 0xf4a5f(%rip), %rdx     # 0x23b9cf
movsbl (%rbx,%rdx), %ebx
movsd -0x18(%rax,%r13), %xmm0
leaq 0xf4a50(%rip), %rax     # 0x23b9d2
adcq $0x0, %rax
movsbl (%rax), %r14d
leaq 0xf49ff(%rip), %rsi     # 0x23b990
movl 0xc(%rsp), %edx
movb $0x1, %al
pushq %r14
pushq %r15
movq 0x38(%rsp), %r15
pushq %r10
pushq %r11
pushq %rbx
movq 0x38(%rsp), %rbx
pushq 0x58(%rsp)
callq 0x22b0
addq $0x30, %rsp
movq 0x10(%rbx), %rcx
jmp 0x146e82
movq (%rbx), %rax
incq %r15
cmpq %rax, %r15
jb 0x146e46
jmp 0x147054
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x147054
movq 0x10(%rbx), %rax
xorl %r12d, %r12d
leaq (%r12,%r12,2), %r13
shlq $0x4, %r13
cmpq $0x0, 0x18(%rax,%r13)
je 0x14704c
leal 0x1(%r12), %ebp
movl $0x18, %r15d
xorl %r14d, %r14d
movq 0x28(%rax,%r13), %rdx
cmpb $0x0, (%rdx,%r15)
jns 0x14701d
incq %r14
addq $0x28, %r15
cmpq 0x18(%rax,%r13), %r14
jb 0x147001
jmp 0x147049
movq 0x14dfbc(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
movl -0x10(%rdx,%r15), %ecx
incl %ecx
movq -0x8(%rdx,%r15), %r8
leaq 0xf499b(%rip), %rsi     # 0x23b9d5
movl %ebp, %edx
xorl %eax, %eax
callq 0x22b0
movq 0x10(%rbx), %rax
jmp 0x14700d
movq (%rbx), %rcx
incq %r12
cmpq %rcx, %r12
jb 0x146fe3
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq