// File: /workspace/github_cpp_makefile_star2_O2/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
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movq 0x38(%rdi), %r10
testq %rsi, %rsi
je 0x92e9d
xorl %r8d, %r8d
leaq 0x154ec9(%rip), %rbx    # 0x1e7cd0
xorl %ecx, %ecx
xorl %r9d, %r9d
xorl %eax, %eax
xorl %r14d, %r14d
movl %r14d, %r14d
cmpq %r14, %r10
jbe 0x92f03
movq 0x48(%rdi), %r11
movl (%r11,%r14,4), %r11d
shrl %r11d
movq 0x10(%rsi), %r15
imulq $0x28, %r11, %r12
cmpl $0x0, 0xc(%r15,%r12)
je 0x92e95
addq %r12, %r15
movl 0x10(%r15), %r12d
leaq 0x1c13ea(%rip), %r11    # 0x254230
movq 0x28(%r11), %r13
xorl %ebp, %ebp
cmpq %rbp, %r12
je 0x92e95
movq 0x18(%r15), %r11
movq (%r11,%rbp,8), %r11
shrq $0x21, %r11
movzbl (%r13,%r11), %r11d
cmpq $0x5, %r11
ja 0x92e90
movslq (%rbx,%r11,4), %r11
addq %rbx, %r11
jmpq *%r11
incl %r9d
movl %r9d, 0x8(%rdx)
jmp 0x92e90
incl %ecx
movl %ecx, 0x4(%rdx)
jmp 0x92e90
incl %r8d
movl %r8d, (%rdx)
jmp 0x92e90
incl %eax
movl %eax, 0xc(%rdx)
incq %rbp
jmp 0x92e4c
incl %r14d
jmp 0x92e11
leaq 0x1c138c(%rip), %rax    # 0x254230
movq 0x28(%rax), %rsi
xorl %eax, %eax
leaq 0x154e37(%rip), %r11    # 0x1e7ce8
xorl %r9d, %r9d
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %ebx, %ebx
movl %ebx, %ebx
cmpq %rbx, %r10
jbe 0x92f03
movq 0x48(%rdi), %r14
movl (%r14,%rbx,4), %r14d
shrl %r14d
movzbl (%rsi,%r14), %r14d
cmpq $0x5, %r14
ja 0x92eff
movslq (%r11,%r14,4), %r14
addq %r11, %r14
jmpq *%r14
incl %r9d
movl %r9d, 0x8(%rdx)
jmp 0x92eff
incl %ecx
movl %ecx, 0x4(%rdx)
jmp 0x92eff
incl %r8d
movl %r8d, (%rdx)
jmp 0x92eff
incl %eax
movl %eax, 0xc(%rdx)
incl %ebx
jmp 0x92ebb
addl %r9d, %eax
addl %r8d, %ecx
addl %eax, %ecx
movl %ecx, 0x10(%rdx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq