// File: /workspace/github_cpp_makefile_star2_O3/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), %r9
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
sete %al
testq %rdx, %rdx
sete %dil
orb %al, %dil
movq %r9, %rax
jne 0x7382f
movq %rcx, %r13
movq %r9, 0x10(%rsp)
xorl %r9d, %r9d
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r10d, %r10d
xorl %eax, %eax
xorl %ebp, %ebp
movq %rdx, 0x18(%rsp)
movq %rsi, 0x8(%rsp)
movq (%r11), %rdi
shlq $0x5, %r10
movl (%rdi,%r10), %r14d
movq (%rsi,%r9,8), %rdi
shrq $0x20, %rdi
cmpq %r14, %rdi
jbe 0x736b3
incl %eax
jmp 0x73812
cmpl %r14d, %edi
jae 0x736bf
incl %ebp
jmp 0x73812
movl %eax, %r15d
cmpq %r15, %rbx
jbe 0x737e9
movq (%r11), %rdx
movq %r15, %rsi
shlq $0x5, %rsi
cmpl %r14d, (%rdx,%rsi)
movq %r14, 0x20(%rsp)
jne 0x737e9
movl %eax, %r10d
movq (%r8), %rax
movq 0x8(%r8), %rsi
cmpq 0x10(%r8), %rsi
jne 0x7374e
leaq (%rsi,%rsi), %rdi
testq %rsi, %rsi
movl $0x2, %edx
cmoveq %rdx, %rdi
movq %rdi, 0x10(%r8)
leaq (%rdi,%rdi,8), %rdx
leaq (%rdx,%rdx,2), %rsi
addq %rdi, %rsi
movq %rax, %rdi
movq %r8, %r12
movq %r11, %rbx
movq %r10, %r14
callq 0x2370
movq %r14, %r10
movq 0x20(%rsp), %r14
movq %rbx, %r11
movq %r12, %r8
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq %rax, (%r8)
movq 0x8(%r8), %rsi
movq (%rbx), %rdx
movq %r15, %rdi
shlq $0x5, %rdi
movl (%rdx,%rdi), %edi
jmp 0x73751
movl %r14d, %edi
leaq 0x1(%rsi), %r9
movq %r9, 0x8(%r8)
leaq (%rsi,%rsi,8), %r9
leaq (%r9,%r9,2), %r9
addq %rsi, %r9
movl %r13d, (%rax,%r9)
shlq $0x5, %r15
movq 0xc(%rdx,%r15), %rsi
movq %rsi, 0x4(%rax,%r9)
movl %edi, 0xc(%rax,%r9)
movq 0x14(%rdx,%r15), %rsi
movq %rsi, 0x10(%rax,%r9)
movl 0x1c(%rdx,%r15), %edx
andl $-0x80, %edx
shll $0x18, %edx
movl 0x18(%rax,%r9), %esi
andl %r12d, %esi
orl %edx, %esi
movl %esi, 0x18(%rax,%r9)
movq (%r11), %rsi
movl 0x1c(%rsi,%r15), %esi
andl $0x40, %esi
shll $0x18, %esi
movl %r10d, %edi
andl $0x3fffffff, %edi       # imm = 0x3FFFFFFF
orl %esi, %edi
orl %edx, %edi
movl %edi, 0x18(%rax,%r9)
leal 0x1(%r10), %eax
movq 0x8(%r11), %rbx
cmpq %rax, %rbx
jbe 0x737e3
movq (%r11), %rdx
movq %rax, %rsi
shlq $0x5, %rsi
movq %rax, %r15
cmpl %r14d, (%rdx,%rsi)
je 0x736e4
incl %r10d
movl %r10d, %eax
movl %ebp, %edi
movq 0x18(%rsp), %rdx
cmpq %rdx, %rdi
jae 0x7380d
movq 0x8(%rsp), %rsi
cmpl %r14d, 0x4(%rsi,%rdi,8)
jne 0x73812
incl %ebp
movq %rbp, %rdi
cmpq %rdx, %rbp
jb 0x737fa
jmp 0x73812
movq 0x8(%rsp), %rsi
movl %eax, %r10d
cmpq %r10, %rbx
jbe 0x73826
movl %ebp, %r9d
cmpq %rdx, %r9
jb 0x73694
movq 0x8(%r8), %rax
movq 0x10(%rsp), %r9
subl %r9d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq