// File: chhylp123[P]hifiasm/Correct.cpp
// Function: push_consist_ul_ovlps(ma_ug_t*, kv_ul_ov_t*, unsigned long, unsigned long, double, ul_ov_t*, idx_emask_t*, kv_ul_ov_t*, unsigned long, unsigned long*)
void push_consist_ul_ovlps(ma_ug_t *ug, kv_ul_ov_t *ov_db, uint64_t s, uint64_t e, double len_diff, ul_ov_t *ref, idx_emask_t *mm, kv_ul_ov_t *out, uint64_t flip_res, uint64_t *is_exact)
{
    (*is_exact) = 0;
    if(s >= e) return;
    uint64_t k, z, ql = ug->g->seq[ref->qn].len, tl = ug->g->seq[ref->tn].len; ul_ov_t *p;
    for (k = s; k < e && ov_db->a[k].tn < ref->tn; k++);
    for (; k < e && ov_db->a[k].tn == ref->tn; k++) {
        if((!check_ul_ov_t_consist(ref, &(ov_db->a[k]), ql, tl, len_diff))) continue;
        z = k;
        if(is_ul_ov_pe(ov_db->a, ov_db->n, k, (*mm))) {
            k++; if((!check_ul_ov_t_consist(ref, &(ov_db->a[k]), ql, tl, len_diff))) continue;
        }
        if(is_exact_ov(ov_db->a[k], (*mm))) {
            (*is_exact) = 1; return;
        }

        for (; z <= k; z++) {
            kv_pushp(ul_ov_t, *out, &p);
            *p = ov_db->a[k];
            if(flip_res) {
                p->qn = ov_db->a[k].tn; p->tn = ov_db->a[k].qn;
                p->qs = ov_db->a[k].ts; p->qe = ov_db->a[k].te;
                p->ts = ov_db->a[k].qs; p->te = ov_db->a[k].qe;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq 0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x7d34b
jmp 0x7d9ee
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rcx
movl (%rcx), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0x61(%rbp)
jae 0x7d3c2
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl 0xc(%rcx), %eax
setb %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x7d3cb
jmp 0x7d3db
jmp 0x7d3cd
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x7d394
jmp 0x7d3dd
movq -0x40(%rbp), %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0x62(%rbp)
jae 0x7d40b
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl 0xc(%rcx), %eax
sete %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0x7d417
jmp 0x7d9ee
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
imulq $0x1c, -0x40(%rbp), %rax
addq %rax, %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movsd -0x28(%rbp), %xmm0
callq 0x2c8a40
cmpq $0x0, %rax
jne 0x7d447
jmp 0x7d9dd
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x7d775
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
addq $0x1, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x7d775
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
addq $0x1, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jne 0x7d775
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
addq $0x1, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
shrl $0x1f, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
shrl $0x1f, %ecx
cmpl %ecx, %eax
jne 0x7d775
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
addq $0x1, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x7d775
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl %eax, %eax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x1c, -0x40(%rbp), %rsi
addq %rsi, %rdx
movl (%rdx), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jae 0x7d775
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
addq $0x1, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl %eax, %eax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
imulq $0x1c, %rsi, %rsi
addq %rsi, %rdx
movl (%rdx), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jae 0x7d775
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movl %ecx, %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movb 0x1c(%rax), %al
shrb $0x5, %al
andb $0x1, %al
cmpb $0x0, %al
je 0x7d775
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq -0x40(%rbp), %rdx
addq $0x1, %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq -0x40(%rbp), %rdx
addq $0x1, %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movl %ecx, %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movb 0x1c(%rax), %al
shrb $0x5, %al
andb $0x1, %al
cmpb $0x0, %al
je 0x7d775
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movl %ecx, %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movb 0x1c(%rax), %al
andb $0x1f, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x7d775
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq -0x40(%rbp), %rdx
addq $0x1, %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq -0x40(%rbp), %rdx
addq $0x1, %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movl %ecx, %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movb 0x1c(%rax), %al
andb $0x1f, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7d775
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
imulq $0x1c, -0x40(%rbp), %rax
addq %rax, %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movsd -0x28(%rbp), %xmm0
callq 0x2c8a40
cmpq $0x0, %rax
jne 0x7d773
jmp 0x7d9dd
jmp 0x7d775
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl %eax, %eax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x1c, -0x40(%rbp), %rsi
addq %rsi, %rdx
movl (%rdx), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jae 0x7d85f
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movl %ecx, %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movb 0x1c(%rax), %al
shrb $0x5, %al
andb $0x1, %al
cmpb $0x0, %al
jne 0x7d85f
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movl %ecx, %ecx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $-0x1, 0x8(%rax)
jne 0x7d85f
movq 0x20(%rbp), %rax
movq $0x1, (%rax)
jmp 0x7d9ee
jmp 0x7d861
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
ja 0x7d9db
jmp 0x7d871
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x7d8d5
movq 0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x7d89f
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x70(%rbp)
jmp 0x7d8aa
movl $0x2, %eax
movq %rax, -0x70(%rbp)
jmp 0x7d8aa
movq -0x70(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rbp), %rax
movq (%rax), %rdi
movq 0x10(%rbp), %rax
imulq $0x1c, 0x10(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
imulq $0x1c, -0x40(%rbp), %rax
addq %rax, %rcx
movq -0x60(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
cmpq $0x0, 0x18(%rbp)
je 0x7d9c8
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq -0x60(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x14(%rax)
jmp 0x7d9ca
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x7d861
jmp 0x7d9dd
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x7d3dd
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)