// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_trio_labs(buf_t*, ma_ug_t*, Trio_counter*)
void get_trio_labs(buf_t* b, ma_ug_t *ug, Trio_counter* flag)
{    
    flag->father_occ = flag->mother_occ = flag->ambig_occ = flag->drop_occ = 0;
    uint32_t i, v, k, rId;
    if(ug == NULL)
    {
        for (i = 0; i < b->b.n; ++i)
        {
            if(R_INF.trio_flag[b->b.a[i]>>1]==FATHER)
            {
                flag->father_occ++;
            }
            else if(R_INF.trio_flag[b->b.a[i]>>1]==MOTHER)
            {
                flag->mother_occ++;
            }
            else if(R_INF.trio_flag[b->b.a[i]>>1]==AMBIGU)
            {
                flag->ambig_occ++;
            }
            else if(R_INF.trio_flag[b->b.a[i]>>1]==DROP)
            {
                flag->drop_occ++;
            }
        }
    }
    else
    {
        ma_utg_t* u = NULL;
        for (i = 0; i < b->b.n; ++i)
        {
            v = b->b.a[i]>>1;
            u = &(ug->u.a[v]);
            if(u->m == 0) continue;
            for (k = 0; k < u->n; k++)
            {
                rId = u->a[k]>>33;
                if(R_INF.trio_flag[rId]==FATHER)
                {
                    flag->father_occ++;
                }
                else if(R_INF.trio_flag[rId]==MOTHER)
                {
                    flag->mother_occ++;
                }
                else if(R_INF.trio_flag[rId]==AMBIGU)
                {
                    flag->ambig_occ++;
                }
                else if(R_INF.trio_flag[rId]==DROP)
                {
                    flag->drop_occ++;
                }
            }
        }
    }

    flag->total = flag->father_occ + flag->mother_occ + flag->ambig_occ + flag->drop_occ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0xc(%rdx), %rax
leaq 0x8(%rdx), %rcx
leaq 0x4(%rdx), %r8
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movq 0x38(%rdi), %r9
testq %rsi, %rsi
je 0xcca03
testq %r9, %r9
je 0xcca58
movq 0x48(%rdi), %rdi
movq 0x10(%rsi), %rsi
leaq 0x1be8a7(%rip), %r10    # 0x28b230
movq 0x28(%r10), %r10
xorl %r11d, %r11d
leaq 0x15d249(%rip), %rbx    # 0x229be0
movl (%rdi,%r11,4), %r14d
shrl %r14d
leaq (%r14,%r14,4), %r14
cmpl $0x0, 0xc(%rsi,%r14,8)
je 0xcc9f6
leaq (%rsi,%r14,8), %r15
movl 0x10(%r15), %r14d
testq %r14, %r14
je 0xcc9f6
movq 0x18(%r15), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %r13
shrq $0x21, %r13
movzbl (%r10,%r13), %r13d
cmpq $0x5, %r13
ja 0xcc9ee
movslq (%rbx,%r13,4), %rbp
addq %rbx, %rbp
movq %rdx, %r13
jmpq *%rbp
movq %rcx, %r13
jmp 0xcc9ea
movq %r8, %r13
jmp 0xcc9ea
movq %rax, %r13
incl (%r13)
incq %r12
cmpq %r12, %r14
jne 0xcc9be
incq %r11
movl %r11d, %r14d
cmpq %r14, %r9
ja 0xcc997
jmp 0xcca58
testq %r9, %r9
je 0xcca58
leaq 0x1be821(%rip), %rsi    # 0x28b230
movq 0x28(%rsi), %rsi
movq 0x48(%rdi), %rdi
xorl %r10d, %r10d
leaq 0x15d1d7(%rip), %r11    # 0x229bf8
movl (%rdi,%r10,4), %ebx
shrl %ebx
movzbl (%rsi,%rbx), %ebx
cmpq $0x5, %rbx
ja 0xcca4d
movslq (%r11,%rbx,4), %r14
addq %r11, %r14
movq %rdx, %rbx
jmpq *%r14
movq %rcx, %rbx
jmp 0xcca4b
movq %r8, %rbx
jmp 0xcca4b
movq %rax, %rbx
incl (%rbx)
incq %r10
movl %r10d, %ebx
cmpq %rbx, %r9
ja 0xcca21
movl 0x4(%rdx), %eax
addl (%rdx), %eax
addl 0x8(%rdx), %eax
addl 0xc(%rdx), %eax
movl %eax, 0x10(%rdx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq