// File: /workspace/github_cpp_makefile_star2_O2/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, %r9
movq %rdi, %r8
testq %rdx, %rdx
je 0x1d8a67
movq 0x220(%r8), %rax
movl (%rax,%r9,4), %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x1d8b94
movq 0x1f0(%r8), %r12
testq %r12, %r12
je 0x1d8b94
shlq $0x5, %rax
addq %rax, %r12
cmpl $0x0, 0x18(%r12)
js 0x1d8b94
xorl %r13d, %r13d
imulq $0x58, %r9, %rax
movq %rax, 0x30(%rsp)
movq %r9, %rax
shlq $0x5, %rax
movq %rax, 0x28(%rsp)
xorl %ebp, %ebp
movq %r8, 0x20(%rsp)
movl 0x1c(%r12), %eax
cmpq %rax, %rbp
jae 0x1d8b85
movq (%r12), %rdi
testb $0x40, 0x24(%rdi,%r13)
jne 0x1d8a5b
addq %r13, %rdi
movl (%rdi), %r14d
movq 0x208(%r8), %rcx
cmpq %r14, %rcx
jbe 0x1d8a5b
movq %r9, %rax
subq %rcx, %rax
jae 0x1d8998
movq 0x30(%r8), %rcx
movq 0x1d0(%r8), %rax
movq 0x48(%rcx), %rdx
movq 0x30(%rsp), %rcx
movl 0x18(%rdx,%rcx), %esi
movq 0x28(%rsp), %rcx
movl 0x18(%rax,%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
jmp 0x1d89c0
movq 0x18(%r8), %rcx
movq 0x30(%r8), %rdx
movq 0x10(%rcx), %rcx
imulq $0x28, %rax, %rax
movl (%rcx,%rax), %esi
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %esi
movq 0x48(%rdx), %rdx
movq 0x1d0(%r8), %rax
pushq $0x1
popq %rcx
movl %esi, %esi
imulq $0x58, %r14, %r8
movl 0x18(%rdx,%r8), %edx
movq %r14, %r8
shlq $0x5, %r8
movl 0x18(%rax,%r8), %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movq %r14, (%rsp)
movq %r9, %r15
callq 0x1bb0f9
movq %r15, %r9
cmpl $-0x3, %eax
movq 0x20(%rsp), %r8
jne 0x1d8a5b
movq 0x78(%rbx), %rcx
movq 0x88(%rbx), %rax
cmpq 0x80(%rbx), %rcx
jne 0x1d8a4f
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x80(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x20(%rsp), %r8
movq %r15, %r9
movq %rax, 0x88(%rbx)
movq (%r12), %rcx
movl (%rcx,%r13), %r14d
movq 0x78(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x78(%rbx)
movq %r14, (%rax,%rcx,8)
incq %rbp
addq $0x28, %r13
jmp 0x1d8933
movq (%r8), %rcx
movq 0x18(%r8), %rax
movl 0x40(%rcx), %edx
movl %edx, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movl 0x44(%rcx), %r15d
imulq $0x28, %r9, %rcx
addq 0x10(%rax), %rcx
xorl %edx, %edx
movq %rcx, 0x38(%rsp)
movl 0x10(%rcx), %eax
cmpq %rax, %rdx
jae 0x1d8b85
movq 0x18(%rcx), %rax
movq %rdx, 0x30(%rsp)
movq (%rax,%rdx,8), %rax
shrq $0x21, %rax
imulq $0x18, %rax, %r13
movq 0x28(%rsp), %rax
addq 0x8(%rax), %r13
xorl %r12d, %r12d
xorl %r14d, %r14d
movl 0xc(%r13), %eax
cmpq %rax, %r14
jae 0x1d8b73
movq (%r13), %rax
leaq (%rax,%r12), %rdi
movl 0x4(%rax,%r12), %ecx
movl 0xc(%rax,%r12), %ebp
leaq 0x7b74d(%rip), %rax     # 0x254230
movq 0x18(%rax), %rax
movl (%rax,%rcx,8), %esi
movl (%rax,%rbp,8), %edx
leaq 0x7ac64(%rip), %rax     # 0x253758
movss 0x158(%rax), %xmm0
movl 0x20(%rsp), %ecx
movl %r15d, %r8d
leaq 0x40(%rsp), %r9
callq 0x1aac6d
cmpl $-0x3, %eax
jne 0x1d8b67
movq 0x90(%rbx), %rcx
movq 0xa0(%rbx), %rax
cmpq 0x98(%rbx), %rcx
jne 0x1d8b58
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x98(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0xa0(%rbx)
movq 0x90(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x90(%rbx)
movq %rbp, (%rax,%rcx,8)
incq %r14
addq $0x28, %r12
jmp 0x1d8abd
movq 0x30(%rsp), %rdx
incq %rdx
movq 0x38(%rsp), %rcx
jmp 0x1d8a8d
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2341f(%rip), %rdi     # 0x1fbfba
leaq 0x1e937(%rip), %rsi     # 0x1f74d9
leaq 0x23423(%rip), %rcx     # 0x1fbfcc
movl $0x4004, %edx           # imm = 0x4004
callq 0x2110