// File: 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
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movslq 0x44(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rax
movslq 0x40(%rax), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3716b3
movq -0x8(%rbp), %rdi
addq $0x1f0, %rdi            # imm = 0x1F0
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x3370e0
movq %rax, -0x80(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x80(%rbp)
movb %al, -0x99(%rbp)
je 0x3710df
movq -0x80(%rbp), %rax
movl 0x18(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x3710eb
jmp 0x3710ed
jmp 0x37110c
leaq 0x29bf7(%rip), %rdi     # 0x39aceb
leaq 0x250be(%rip), %rsi     # 0x3961b9
movl $0x4004, %edx           # imm = 0x4004
leaq 0x29bf6(%rip), %rcx     # 0x39acfd
callq 0x2130
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x80(%rbp), %rcx
movl 0x1c(%rcx), %ecx
cmpq %rcx, %rax
jae 0x3716ae
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movb 0x24(%rax), %al
shrb $0x6, %al
andb $0x1, %al
cmpb $0x0, %al
jne 0x371173
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x208(%rax), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovael %ecx, %eax
cmpl $0x0, %eax
jne 0x371178
jmp 0x37169d
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x208(%rax), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovael %ecx, %eax
cmpl $0x0, %eax
je 0x371216
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x208(%rcx), %rax
jb 0x3711eb
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
subq 0x208(%rcx), %rax
movq %rax, -0xb8(%rbp)
jmp 0x3711f6
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rax
movq -0xb8(%rbp), %rcx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, -0xbc(%rbp)
jmp 0x37127f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x208(%rcx), %rax
jb 0x371252
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
subq 0x208(%rcx), %rax
movq %rax, -0xd0(%rbp)
jmp 0x37125d
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rax
movq -0xd0(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movl %eax, %eax
movq %rax, -0xd8(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x208(%rax), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovael %ecx, %eax
cmpl $0x0, %eax
je 0x371353
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rax
movq %rax, -0xe0(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
cmpq 0x208(%rcx), %rax
jb 0x371318
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
subq 0x208(%rcx), %rax
movq %rax, -0xe8(%rbp)
jmp 0x371330
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq %rax, -0xe8(%rbp)
movq -0xe0(%rbp), %rax
movq -0xe8(%rbp), %rcx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, -0xec(%rbp)
jmp 0x3713e3
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0xf8(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
cmpq 0x208(%rcx), %rax
jb 0x3713a9
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
subq 0x208(%rcx), %rax
movq %rax, -0x100(%rbp)
jmp 0x3713c1
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rax
movq -0x100(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0xec(%rbp)
movl -0xec(%rbp), %eax
movl %eax, %eax
movq %rax, -0x108(%rbp)
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x208(%rax), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovael %ecx, %eax
cmpl $0x0, %eax
je 0x37147e
movq -0x8(%rbp), %rax
movq 0x1d0(%rax), %rax
movq %rax, -0x110(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x208(%rcx), %rax
jb 0x37144e
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
subq 0x208(%rcx), %rax
movq %rax, -0x118(%rbp)
jmp 0x371459
movq -0x10(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rax
movq -0x118(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x11c(%rbp)
jmp 0x37148b
movl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0x37148b
movl -0x11c(%rbp), %eax
cltq
movq %rax, -0x128(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x208(%rax), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovael %ecx, %eax
cmpl $0x0, %eax
je 0x371560
movq -0x8(%rbp), %rax
movq 0x1d0(%rax), %rax
movq %rax, -0x130(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
cmpq 0x208(%rcx), %rax
jb 0x371523
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
subq 0x208(%rcx), %rax
movq %rax, -0x138(%rbp)
jmp 0x37153b
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq %rax, -0x138(%rbp)
movq -0x130(%rbp), %rax
movq -0x138(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x13c(%rbp)
jmp 0x37156d
movl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0x37156d
movq -0x128(%rbp), %rcx
movq -0x108(%rbp), %rdx
movq -0xd8(%rbp), %rsi
movq -0xa8(%rbp), %rdi
movl -0x13c(%rbp), %eax
movslq %eax, %r8
movq -0x10(%rbp), %r9
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %r10
addq %r10, %rax
movl (%rax), %eax
xorl %r10d, %r10d
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
callq 0x338a20
cltq
movq %rax, -0x98(%rbp)
cmpq $-0x3, -0x98(%rbp)
je 0x3715dd
jmp 0x37169d
jmp 0x3715df
movq -0x20(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x80(%rcx), %rax
jne 0x371666
movq -0x20(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x371619
movq -0x20(%rbp), %rax
movq 0x80(%rax), %rax
shlq %rax
movq %rax, -0x148(%rbp)
jmp 0x371627
movl $0x2, %eax
movq %rax, -0x148(%rbp)
jmp 0x371627
movq -0x148(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x80(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x80(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, %edx
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x20(%rbp), %rsi
movq 0x78(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x78(%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x37169d
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x371114
jmp 0x3718b4
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jae 0x3718b2
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x40(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jae 0x37189f
movq -0x60(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, %eax
movq %rax, -0x50(%rbp)
movq -0x60(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x58(%rbp)
movq -0x60(%rbp), %rax
movq (%rax), %rdi
imulq $0x28, -0x48(%rbp), %rax
addq %rax, %rdi
leaq 0x53b62(%rip), %rax     # 0x3c52d0
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
leaq 0x53b4d(%rip), %rax     # 0x3c52d0
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %edx
movq -0x90(%rbp), %rax
movl %eax, %ecx
leaq 0x53057(%rip), %rax     # 0x3c47f8
movss 0x158(%rax), %xmm0
movq -0x88(%rbp), %rax
movl %eax, %r8d
leaq -0x78(%rbp), %r9
callq 0x31a080
cltq
movq %rax, -0x98(%rbp)
cmpq $-0x3, -0x98(%rbp)
je 0x3717d4
jmp 0x37188e
jmp 0x3717d6
movq -0x20(%rbp), %rax
movq 0x90(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x98(%rcx), %rax
jne 0x371860
movq -0x20(%rbp), %rax
cmpq $0x0, 0x98(%rax)
je 0x371813
movq -0x20(%rbp), %rax
movq 0x98(%rax), %rax
shlq %rax
movq %rax, -0x150(%rbp)
jmp 0x371821
movl $0x2, %eax
movq %rax, -0x150(%rbp)
jmp 0x371821
movq -0x150(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x20(%rbp), %rax
movq 0xa0(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x98(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0xa0(%rax)
movq -0x58(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0xa0(%rax), %rax
movq -0x20(%rbp), %rsi
movq 0x90(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x90(%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x37188e
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x371712
jmp 0x3718a1
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x3716cf
jmp 0x3718b4
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopl (%rax)