// File: chhylp123[P]hifiasm/hic.cpp
// Function: get_5_3_list(ha_ug_index*, s_hit*, unsigned long, s_hit**, unsigned long*, s_hit**, unsigned long*)
void get_5_3_list(ha_ug_index* idx, s_hit* p, uint64_t cnt, s_hit** l5, uint64_t* l5_occ, 
s_hit** l3, uint64_t* l3_occ)
{
    (*l5) = (*l3) = NULL;
    (*l5_occ) = (*l3_occ) = 0;
    uint64_t i, j, rev, uID, ref_p, self_p, eLen, tLen, cur_beg, num;
    uint64_t beg_5 = (uint64_t)-1;
    for (j = 1, i = 0, num = 0; j <= cnt; ++j)
    {
        if(j == cnt || p[j].off_cnt != p[i].off_cnt)
        {
            interpret_pos((ha_ug_index*)idx, &p[i], &rev, &uID, &ref_p, &self_p, &eLen, &tLen);
            ///cur_end = self_p;
            cur_beg = self_p + 1 - tLen;
            num++;
            if(cur_beg <= beg_5)
            {
                (*l3_occ) = (*l5_occ); (*l3) = (*l5);
                beg_5 = cur_beg; (*l5_occ) = j - i; (*l5) = p + i;
            }
            else
            {
                (*l3_occ) = j - i; (*l3) = p + i;
            }
            i = j;///must
        }
    }

    ///if(num > 2) fprintf(stderr, "ERROR: get_5_3_list\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq 0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq $-0x1, -0x88(%rbp)
movq $0x1, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x18(%rbp), %rax
ja 0x1c372a
movq -0x40(%rbp), %rax
cmpq -0x18(%rbp), %rax
je 0x1c363a
movq -0x10(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq -0x38(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
je 0x1c3717
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
leaq -0x48(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq -0x58(%rbp), %r8
leaq -0x60(%rbp), %r9
leaq -0x68(%rbp), %r10
leaq -0x70(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x213560
movq -0x60(%rbp), %rax
addq $0x1, %rax
subq -0x70(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x88(%rbp), %rax
ja 0x1c36ea
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x40(%rbp), %rcx
subq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x38(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1c370f
movq -0x40(%rbp), %rcx
subq -0x38(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x38(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x1c3719
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x1c35f6
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)