// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rsi, %r15
movq %rdi, %r14
testq %rdx, %rdx
je 0x21ca03
movq 0x220(%r14), %rax
movl (%rax,%r15,4), %r12d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r12
je 0x21cb40
shlq $0x5, %r12
addq 0x1f0(%r14), %r12
jmp 0x21cb43
movq 0x18(%r14), %rax
movq 0x10(%rax), %rax
leaq (%r15,%r15,4), %rcx
cmpl $0x0, 0x10(%rax,%rcx,8)
je 0x21cca9
movq (%r14), %rdx
movl 0x40(%rdx), %esi
movl %esi, 0x28(%rsp)
movq %rdx, 0x38(%rsp)
movl 0x44(%rdx), %r14d
leaq (%rax,%rcx,8), %rcx
xorl %edx, %edx
movq %rcx, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rcx), %rcx
movq %rdx, 0x20(%rsp)
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
leaq (%rcx,%rcx,2), %rcx
cmpl $0x0, 0xc(%rax,%rcx,8)
je 0x21cb22
leaq (%rax,%rcx,8), %r13
xorl %r12d, %r12d
xorl %r15d, %r15d
movq (%r13), %rax
leaq (%rax,%r12), %rdi
movl 0x4(%rax,%r12), %ecx
movl 0xc(%rax,%r12), %ebp
leaq 0x6e7ac(%rip), %rax     # 0x28b230
movq 0x18(%rax), %rax
movl (%rax,%rcx,8), %esi
movl (%rax,%rbp,8), %edx
leaq 0x6dcc3(%rip), %rax     # 0x28a758
movss 0x158(%rax), %xmm0
movl 0x28(%rsp), %ecx
movl %r14d, %r8d
leaq 0x40(%rsp), %r9
callq 0x1eb21b
cmpl $-0x3, %eax
jne 0x21cb0e
movq 0x98(%rbx), %rax
cmpq %rax, 0x90(%rbx)
jne 0x21caf1
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x98(%rbx)
movq 0xa0(%rbx), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0xa0(%rbx)
movq 0x90(%rbx), %rax
movq 0xa0(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x90(%rbx)
movq %rbp, (%rcx,%rax,8)
incq %r15
movl 0xc(%r13), %eax
addq $0x28, %r12
cmpq %rax, %r15
jb 0x21ca6b
movq 0x20(%rsp), %rdx
incq %rdx
movq 0x30(%rsp), %rcx
movl 0x10(%rcx), %eax
cmpq %rax, %rdx
jb 0x21ca38
jmp 0x21cca9
xorl %r12d, %r12d
testq %r12, %r12
je 0x21ccb8
cmpl $0x0, 0x18(%r12)
js 0x21ccb8
cmpl $0x0, 0x1c(%r12)
je 0x21cca9
xorl %r13d, %r13d
imulq $0x58, %r15, %rax
movq %rax, 0x28(%rsp)
movq %r15, %rax
shlq $0x5, %rax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
movq (%r12), %rdi
testb $0x40, 0x24(%rdi,%r13)
jne 0x21cc94
addq %r13, %rdi
movl (%rdi), %eax
movq 0x208(%r14), %rdx
cmpq %rax, %rdx
jbe 0x21cc94
movq %r15, %rcx
subq %rdx, %rcx
jae 0x21cbbe
movq 0x30(%r14), %rcx
movq 0x48(%rcx), %rcx
movq 0x28(%rsp), %rsi
movl 0x18(%rcx,%rsi), %esi
jmp 0x21cbd4
movq 0x18(%r14), %rsi
movq 0x10(%rsi), %rsi
leaq (%rcx,%rcx,4), %rcx
movl (%rsi,%rcx,8), %esi
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %esi
movl $0x1, %ecx
cmpq %rdx, %r15
jae 0x21cbf4
movq 0x1d0(%r14), %rcx
movq 0x20(%rsp), %rdx
movl 0x18(%rcx,%rdx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
imulq $0x58, %rax, %rdx
movl %esi, %esi
movq 0x30(%r14), %r8
movq 0x48(%r8), %r8
movl 0x18(%r8,%rdx), %edx
movq 0x1d0(%r14), %r8
movq %rax, %r9
shlq $0x5, %r9
movl 0x18(%r8,%r9), %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movq %rax, (%rsp)
movq %r15, %r9
callq 0x1fbca4
cmpl $-0x3, %eax
jne 0x21cc94
movq 0x80(%rbx), %rax
cmpq %rax, 0x78(%rbx)
jne 0x21cc75
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x80(%rbx)
movq 0x88(%rbx), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x88(%rbx)
movq (%r12), %rax
movl (%rax,%r13), %eax
movq 0x78(%rbx), %rcx
movq 0x88(%rbx), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x78(%rbx)
movq %rax, (%rdx,%rcx,8)
incq %rbp
movl 0x1c(%r12), %eax
addq $0x28, %r13
cmpq %rax, %rbp
jb 0x21cb7e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21058(%rip), %rdi     # 0x23dd17
leaq 0x1c65f(%rip), %rsi     # 0x239325
leaq 0x2105c(%rip), %rcx     # 0x23dd29
movl $0x4004, %edx           # imm = 0x4004
callq 0x2110