// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Correct.cpp
// Function: push_emask_flt(kv_emask_t*, unsigned long*, unsigned long, unsigned long, kv_ul_ov_t*)
uint32_t push_emask_flt(kv_emask_t *in, uint64_t *flt, uint64_t flt_n, uint64_t qn, kv_ul_ov_t *res)
{
    uint32_t k = 0, z = 0, tn, rn0 = res->n; ul_ov_t *p;
    while (k < in->n && z < flt_n) {
        if (in->a[k].tn < (flt[z]>>32)) {
            k++;
        } else if((flt[z]>>32) < in->a[k].tn) {
            z++;
        } else {///in->a[k].tn == (flt[z]>>32)
            for (tn = in->a[k].tn; k < in->n && in->a[k].tn == tn; k++) {
                kv_pushp(ul_ov_t, *res, &p);
                p->qn = qn; p->qs = in->a[k].qs; p->qe = in->a[k].qe; 
                p->tn = in->a[k].tn; p->ts = in->a[k].ts; p->te = in->a[k].te; 
                p->rev = in->a[k].rev; p->el = in->a[k].full; p->sec = k;
            }
            for (; z < flt_n && (flt[z]>>32) == tn; z++);
        }
    }
    return res->n-rn0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r11
movq 0x8(%r8), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rdi)
sete %al
testq %rdx, %rdx
sete %dil
orb %al, %dil
jne 0x73d24
movq %rcx, %r12
xorl %eax, %eax
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
xorl %r10d, %r10d
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %rdx, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %r8, 0x20(%rsp)
movq (%r11), %rdi
shlq $0x5, %r10
movl (%rdi,%r10), %r13d
movq (%rsi,%rax,8), %rax
shrq $0x20, %rax
cmpq %r13, %rax
jbe 0x73bee
incl %r15d
jmp 0x73d0f
cmpl %r13d, %eax
jae 0x73bfb
incl %r14d
jmp 0x73d0f
movl %r15d, %ebp
cmpq %rbp, 0x8(%r11)
jbe 0x73ceb
movq (%r11), %rax
shlq $0x5, %rbp
cmpl %r13d, (%rax,%rbp)
jne 0x73ceb
movq 0x10(%r8), %rax
cmpq %rax, 0x8(%r8)
jne 0x73c5e
leaq (%rax,%rax), %rdx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rdx
movq %rdx, 0x10(%r8)
movq (%r8), %rdi
leaq (%rdx,%rdx,8), %rax
leaq (%rax,%rax,2), %rsi
addq %rdx, %rsi
movq %r11, %rbx
callq 0x2370
movq %rbx, %r11
movq 0x20(%rsp), %r8
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movq %rax, (%r8)
movq (%r8), %rax
movq 0x8(%r8), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x8(%r8)
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rbx
addq %rdx, %rbx
movl %r12d, (%rax,%rbx)
movq (%r11), %rdx
movl 0xc(%rdx,%rbp), %esi
movl %esi, 0x4(%rax,%rbx)
movl 0x10(%rdx,%rbp), %esi
movl %esi, 0x8(%rax,%rbx)
movl (%rdx,%rbp), %esi
movl %esi, 0xc(%rax,%rbx)
movl 0x14(%rdx,%rbp), %esi
movl %esi, 0x10(%rax,%rbx)
movl 0x18(%rdx,%rbp), %esi
movl %esi, 0x14(%rax,%rbx)
movl 0x1c(%rdx,%rbp), %edx
andl $-0x80, %edx
shll $0x18, %edx
movl 0x18(%rax,%rbx), %esi
andl %r9d, %esi
orl %edx, %esi
movl %esi, 0x18(%rax,%rbx)
movq (%r11), %rsi
movl 0x1c(%rsi,%rbp), %esi
andl $0x40, %esi
shll $0x18, %esi
movl %r15d, %edi
andl $0x3fffffff, %edi       # imm = 0x3FFFFFFF
orl %esi, %edi
orl %edx, %edi
movl %edi, 0x18(%rax,%rbx)
incl %r15d
movq %r15, %rbp
cmpq %r15, 0x8(%r11)
ja 0x73c08
movl %r14d, %eax
movq 0x18(%rsp), %rdx
cmpq %rdx, %rax
movq 0x10(%rsp), %rsi
jae 0x73d0f
cmpl %r13d, 0x4(%rsi,%rax,8)
jne 0x73d0f
incl %r14d
movq %r14, %rax
cmpq %rdx, %r14
jb 0x73cfd
movl %r15d, %r10d
cmpq %r10, 0x8(%r11)
jbe 0x73d24
movl %r14d, %eax
cmpq %rdx, %rax
jb 0x73bce
movl 0x8(%r8), %eax
subl 0x8(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq