// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: print_utg_hap(ma_ug_t*, asg_t*, unsigned int, ma_hit_t_alloc*, R_to_U*)
void print_utg_hap(ma_ug_t *ug, asg_t* read_g, uint32_t uid, ma_hit_t_alloc* reverse_sources, 
R_to_U* ruIndex)
{
    
    uint32_t k, rId, qn, i, is_Unitig;
    ma_utg_t* u = &(ug->u.a[uid]);
    fprintf(stderr, "\nuid: %u, u->n: %u\n", uid, u->n);
    for (k = 0; k < u->n; k++)
    {
        rId = u->a[k]>>33;
        fprintf(stderr, "self[%u]: %u\n", k, rId);
    }

    for (k = 0; k < u->n; k++)
    {
        qn = u->a[k]>>33;
        fprintf(stderr, "****self[%u]: %u, Len: %u\n", k, qn, reverse_sources[qn].length);
        for (i = 0; i < reverse_sources[qn].length; i++)
        {
            rId = Get_tn(reverse_sources[qn].buffer[i]);
            if(read_g->seq[rId].del == 1)
            {
                ///get the id of read that contains it 
                get_R_to_U(ruIndex, rId, &rId, &is_Unitig);
                if(rId == (uint32_t)-1 || is_Unitig == 1 || read_g->seq[rId].del == 1) continue;
            }
            fprintf(stderr, "hap[%u]: %u\n", i, rId);
        }
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq 0x275f68(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x14(%rbp), %edx
movq -0x48(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x23b60c(%rip), %rsi    # 0x389698
movb $0x0, %al
callq 0x22a0
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x14e0e5
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x30(%rbp)
movq 0x275f1d(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %ecx
leaq 0x23b5d9(%rip), %rsi    # 0x3896ac
movb $0x0, %al
callq 0x22a0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x14e09a
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x14e210
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x34(%rbp)
movq 0x275ec7(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x2c(%rbp), %edx
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl -0x34(%rbp), %esi
imulq $0x18, %rsi, %rsi
addq %rsi, %rax
movl 0xc(%rax), %r8d
leaq 0x23b57f(%rip), %rsi    # 0x3896ba
movb $0x0, %al
callq 0x22a0
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x20(%rbp), %rcx
movl -0x34(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jae 0x14e200
movq -0x20(%rbp), %rax
movl -0x34(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0x38(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x1, %eax
jne 0x14e1d4
movq -0x28(%rbp), %rdi
movl -0x30(%rbp), %esi
leaq -0x30(%rbp), %rdx
leaq -0x3c(%rbp), %rcx
callq 0xd3d50
cmpl $-0x1, -0x30(%rbp)
je 0x14e1d0
cmpl $0x1, -0x3c(%rbp)
je 0x14e1d0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x1, %eax
jne 0x14e1d2
jmp 0x14e1f2
jmp 0x14e1d4
movq 0x275e05(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x38(%rbp), %edx
movl -0x30(%rbp), %ecx
leaq 0x23b4ea(%rip), %rsi    # 0x3896d5
movb $0x0, %al
callq 0x22a0
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x14e149
jmp 0x14e202
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x14e0ec
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)