// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: clc_contain(ul_resolve_t*, unsigned long, unsigned long, integer_t*)
void clc_contain(ul_resolve_t *uidx, uint64_t id, uint64_t is_ul, integer_t *buf)
{
    ma_ug_t *raw = uidx->l1_ug; ma_utg_t *ru; ug_opt_t *uopt = uidx->uopt;
    uint64_t k, m, qn, tn; ma_hit_t_alloc *x; asg_arc_t e; ul2ul_item_t *o;
    int64_t min_ovlp = uopt->min_ovlp, max_hang = uopt->max_hang, r;

    if(is_ul) {
        o = get_ul_ovlp(&(uidx->uovl), id, 1);
        assert(o && (!o->is_del));
        for (k = 0; k < o->cn; k++) {
            if((o->a[k].is_del) || (!ulg_type(uidx->uovl, o->a[k].hid))) continue;
            r = integer_hit2arc(&(o->a[k]), ulg_len(*uidx, id), ulg_len(*uidx, o->a[k].hid), 
                                        ulg_occ(*uidx, id), ulg_occ(*uidx, o->a[k].hid), id, o->a[k].hid, 0, NULL);
            if(r != MA_HT_TCONT) continue;
            kv_push(uint64_t, buf->o, o->a[k].hid);
        }
    } else {
        ru = &(raw->u.a[id]); 
        for (k = 0; k < ru->n; k++) {
            x = &(uopt->sources[ru->a[k]>>33]);
            for (m = 0; m < x->length; m++) {
                qn = Get_qn(x->buffer[m]); tn = Get_tn(x->buffer[m]);
                r = ma_hit2arc(&(x->buffer[m]), Get_READ_LENGTH(R_INF, qn), Get_READ_LENGTH(R_INF, tn), 
                                                    max_hang, asm_opt.max_hang_rate, min_ovlp, &e);
                if(r != MA_HT_TCONT) continue;
                kv_push(uint64_t, buf->u, tn);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x48(%rsp)
testq %rdx, %rdx
je 0x228295
movq 0x220(%rdi), %rax
movl (%rax,%rsi,4), %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x2284fb
movq 0x1f0(%rdi), %rcx
testq %rcx, %rcx
je 0x2284fb
shlq $0x5, %rax
addq %rax, %rcx
cmpl $0x0, 0x18(%rcx)
js 0x2284fb
movq %rcx, 0x40(%rsp)
movl 0x1c(%rcx), %r10d
testl %r10d, %r10d
je 0x2284ec
movq 0x40(%rsp), %rax
movq (%rax), %rdx
xorl %r13d, %r13d
imulq $0x58, %rsi, %rax
movq %rax, 0x38(%rsp)
movq %rsi, %rax
shlq $0x5, %rax
movq %rax, 0x30(%rsp)
xorl %ebp, %ebp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
movb 0x24(%rdx,%r13), %r15b
testb $0x40, %r15b
jne 0x2280d7
movl (%rdx,%r13), %r9d
movq 0x208(%rdi), %rcx
cmpq %r9, %rcx
jbe 0x2280d7
movq %rsi, %rax
subq %rcx, %rax
jae 0x22800c
movq 0x30(%rdi), %rax
movq 0x1d0(%rdi), %rsi
movq 0x48(%rax), %rax
movq 0x38(%rsp), %rcx
movl 0x18(%rax,%rcx), %r8d
movq 0x30(%rsp), %rcx
movq %rsi, 0x28(%rsp)
movl 0x18(%rsi,%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
jmp 0x22803d
movq 0x18(%rdi), %rcx
movq 0x30(%rdi), %rsi
movq 0x10(%rcx), %rcx
leaq (%rax,%rax,4), %rax
movl (%rcx,%rax,8), %r8d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r8d
movq 0x48(%rsi), %rax
movq 0x1d0(%rdi), %rcx
movq %rcx, 0x28(%rsp)
movl $0x1, %ecx
movq %rcx, 0x20(%rsp)
imulq $0x58, %r9, %rcx
movl 0x18(%rax,%rcx), %esi
testb $0x3f, %r15b
movl %r10d, 0xc(%rsp)
je 0x228067
movl 0xc(%rdx,%r13), %edi
movl 0x10(%rdx,%r13), %ebx
subq %rbx, %rsi
movq %rdi, %r12
jmp 0x22807a
movl 0xc(%rdx,%r13), %edi
movl 0x10(%rdx,%r13), %ebx
subq %rbx, %rsi
movq %rsi, %r12
movq %rdi, %rsi
movl %r8d, %r10d
movl 0x4(%rdx,%r13), %r14d
cmpq %r14, %rsi
movq %r14, %r8
cmovlq %rsi, %r8
movl 0x8(%rdx,%r13), %eax
movq %r10, %rcx
subq %rax, %rcx
cmpq %r12, %rcx
movq %r12, %r11
cmovlq %rcx, %r11
testq %r8, %r8
jg 0x2280c8
testq %r11, %r11
jg 0x2280c8
movq %rdi, 0x50(%rsp)
shlq $0x5, %r9
movq 0x28(%rsp), %rdi
movl 0x18(%rdi,%r9), %r9d
cmpq %rsi, %r14
jg 0x2280ef
cmpq %r12, %rcx
jg 0x2280ef
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0xc(%rsp), %r10d
incq %rbp
movl %r10d, %eax
addq $0x28, %r13
cmpq %rax, %rbp
jb 0x227fb2
jmp 0x2284ec
cmpq %rsi, %r14
jl 0x228157
cmpq %r12, %rcx
jl 0x228157
movq 0x48(%rsp), %rbx
movq 0x78(%rbx), %rcx
movq 0x88(%rbx), %rax
cmpq 0x80(%rbx), %rcx
jne 0x2281a4
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x80(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x88(%rbx)
movq 0x40(%rsp), %rsi
movq (%rsi), %rdx
movq 0x78(%rbx), %rcx
movl 0x1c(%rsi), %r10d
movq 0x10(%rsp), %rdi
jmp 0x2281ae
addq %rax, %r12
subq %r12, %r10
movq %r14, %r12
subq %rsi, %r12
cmovleq %r10, %r12
addq %r8, %r11
subq %r14, %rax
addq %r11, %rax
js 0x2280c8
movl %ebx, %eax
addq %rax, %r11
movl 0x50(%rsp), %eax
cmpq %rax, %r11
jl 0x2280c8
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
testb $0x3f, %r15b
je 0x2281c8
movl 0x1c(%rdx,%r13), %edi
movl 0x20(%rdx,%r13), %eax
subq %rax, %r9
jmp 0x2281db
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %r10d
movl (%rdx,%r13), %esi
leaq 0x1(%rcx), %r8
movq %r8, 0x78(%rbx)
movq %rsi, (%rax,%rcx,8)
movq 0x18(%rsp), %rsi
jmp 0x2280d7
movl 0x1c(%rdx,%r13), %eax
movl 0x20(%rdx,%r13), %ecx
subq %rcx, %r9
movq %r9, %rdi
movq %rax, %r9
movq 0x20(%rsp), %rbx
movl 0x14(%rdx,%r13), %ecx
movl 0x18(%rdx,%r13), %eax
subq %rax, %rbx
cmpq %rcx, %r9
setle %al
movq %rcx, %r11
cmovlq %r9, %r11
cmpq %rdi, %rbx
setge %r8b
movq %rdi, %r10
cmovlq %rbx, %r10
testq %r11, %r11
jg 0x2280c8
testq %r10, %r10
jg 0x2280c8
orb %r8b, %al
je 0x2280c8
cmpq %rcx, %r9
jge 0x228231
cmpq %rdi, %rbx
jg 0x2280f9
cmpq %rcx, %r9
jne 0x22824a
cmpq %rdi, %rbx
jne 0x22824a
cmpl $-0x3, %r12d
jne 0x2280c8
jmp 0x2280f9
cmpq %rdi, %rbx
setg %al
setge %dil
cmpq %rsi, %r14
setg %sil
cmpq %rcx, %r9
setl %cl
setne %r8b
orb %al, %r8b
xorb %r8b, %cl
notb %r8b
andb %dil, %r8b
xorb %sil, %cl
orb %r8b, %cl
cmpb $0x1, %cl
jne 0x2280c8
movl %r12d, %eax
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
cmpl %ecx, %eax
je 0x2280f9
jmp 0x2280c8
movq 0x18(%rdi), %rax
movq 0x10(%rax), %rcx
leaq (%rsi,%rsi,4), %rdx
movl 0x10(%rcx,%rdx,8), %eax
testl %eax, %eax
je 0x2284ec
movq (%rdi), %rsi
movl 0x40(%rsi), %edi
movl %edi, 0x10(%rsp)
movq %rsi, 0x20(%rsp)
movl 0x44(%rsi), %esi
movl %esi, 0x38(%rsp)
leaq (%rcx,%rdx,8), %rsi
xorl %edi, %edi
movq %rsi, 0x30(%rsp)
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x18(%rsi), %rdx
movq (%rdx,%rdi,8), %rdx
shrq $0x21, %rdx
leaq (%rdx,%rdx,2), %rdx
movl 0xc(%rcx,%rdx,8), %r8d
movl %r8d, 0xc(%rsp)
testl %r8d, %r8d
je 0x2284de
movq %rdi, 0x18(%rsp)
leaq (%rcx,%rdx,8), %rax
movq %rax, 0x28(%rsp)
leaq 0x6df21(%rip), %rax     # 0x296230
movq 0x18(%rax), %rdx
leaq 0x6d43e(%rip), %rax     # 0x295758
movss 0x158(%rax), %xmm0
movl $0x18, %r15d
xorl %r12d, %r12d
movq 0x28(%rsp), %rax
movq (%rax), %rcx
movl -0xc(%rcx,%r15), %ebx
movl (%rdx,%rbx,8), %eax
testb $-0x80, 0x3(%rcx,%r15)
jne 0x228357
movl -0x8(%rcx,%r15), %r11d
movl -0x4(%rcx,%r15), %r10d
subl %r10d, %eax
movl %eax, %esi
movl %r11d, %eax
jmp 0x228367
movl -0x8(%rcx,%r15), %r11d
movl -0x4(%rcx,%r15), %r10d
subl %r10d, %eax
movl %r11d, %esi
movq -0x18(%rcx,%r15), %rdi
movq %rdi, %r8
shrq $0x20, %r8
movl (%rdx,%r8,8), %r14d
cmpl %edi, %eax
movl %edi, %ebp
cmovll %eax, %ebp
movl -0x10(%rcx,%r15), %r9d
movl %r14d, %r8d
subl %r9d, %r8d
cmpl %esi, %r8d
movl %esi, %r13d
cmovll %r8d, %r13d
movl 0x10(%rsp), %ecx
cmpl %ecx, %ebp
jg 0x228495
cmpl %ecx, %r13d
jg 0x228495
movl %r9d, %ecx
subl %edi, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
addl %ebp, %ecx
addl %r13d, %ecx
xorps %xmm2, %xmm2
cvtsi2ss %rcx, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
ja 0x228495
subl %r11d, %r10d
xorps %xmm1, %xmm1
cvtsi2ss %r10, %xmm1
addl %ebp, %r13d
addl %r10d, %r13d
xorps %xmm2, %xmm2
cvtsi2ss %r13, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
ja 0x228495
cmpl %eax, %edi
jg 0x228402
cmpl %esi, %r8d
jle 0x228495
cmpl %eax, %edi
jl 0x2284ab
cmpl %esi, %r8d
jl 0x2284ab
movq 0x48(%rsp), %r14
movq 0x90(%r14), %rcx
movq 0xa0(%r14), %rax
cmpq 0x98(%r14), %rcx
jne 0x228486
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x98(%r14)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0xa0(%r14)
leaq 0x6ddd0(%rip), %rcx     # 0x296230
movq 0x18(%rcx), %rdx
leaq 0x6d2ed(%rip), %rcx     # 0x295758
movss 0x158(%rcx), %xmm0
movq 0x90(%r14), %rcx
movq 0x28(%rsp), %rsi
movl 0xc(%rsi), %esi
movl %esi, 0xc(%rsp)
leaq 0x1(%rcx), %rsi
movq %rsi, 0x90(%r14)
movq %rbx, (%rax,%rcx,8)
incq %r12
movl 0xc(%rsp), %eax
addq $0x28, %r15
cmpq %rax, %r12
jb 0x22832b
jmp 0x2284d1
movl 0x38(%rsp), %r8d
cmpl %r8d, %ecx
jl 0x228495
cmpl %r8d, %r13d
jl 0x228495
addl %r9d, %esi
subl %esi, %r14d
subl %eax, %edi
cmovlel %r14d, %edi
cmpl $-0x3, %edi
je 0x228413
jmp 0x228495
movq 0x30(%rsp), %rsi
movl 0x10(%rsi), %eax
movq 0x18(%rsp), %rdi
incq %rdi
movl %eax, %ecx
cmpq %rcx, %rdi
jb 0x2282ce
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21af9(%rip), %rdi     # 0x249ffb
leaq 0x1d100(%rip), %rsi     # 0x245609
leaq 0x21afd(%rip), %rcx     # 0x24a00d
movl $0x4004, %edx           # imm = 0x4004
callq 0x2110