// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: integer_append_ug_ovlp(ul_resolve_t*, unsigned int, ul2ul_item_t*, ul2ul_idx_t*)
void integer_append_ug_ovlp(ul_resolve_t *uidx, uint32_t qid, ul2ul_item_t *o, ul2ul_idx_t *ul2)
{
    // if(o->is_del) return;
    uint64_t k; uc_block_t *xi; ul2ul_t *z; ul2ul_item_t *t; int32_t r;
    ma_ug_t *ug = uidx->l1_ug; ul_str_t *str = &(uidx->pstr.str.a[qid]);
    for (k = 0; k < str->cn; k++) {
        xi = &(uidx->idx->a[qid].bb.a[str->a[k]>>32]);
        assert(((xi->hid<<1)+xi->rev)==((uint32_t)str->a[k]));

        ///ul side
        kv_pushp(ul2ul_t, *o, &z);
        z->hid = xi->hid + ul2->uln; z->is_rev = xi->rev; z->is_del = o->is_del; z->is_ct = 0;
        z->qs = xi->qs; z->qe = xi->qe; z->ts = xi->ts; z->te = xi->te; 
        z->qs_k = k; z->qe_k = k + 1; z->ts_k = 0; z->te_k = 1;

        r = integer_hit2arc(z, uidx->idx->a[qid].rlen, ug->u.a[xi->hid].len, uidx->pstr.str.a[qid].cn, 
        1, qid, z->hid, 0, NULL);
        if(r == MA_HT_INT) {
            o->n--; continue;
        }
        ///ug side
        t = get_ul_ovlp(ul2, xi->hid, 0);
        assert(t);
        kv_pushp(ul2ul_t, *t, &z); 
        z->hid = qid; z->is_rev = xi->rev; z->is_del = o->is_del; z->is_ct = 0;
        z->qs = xi->ts; z->qe = xi->te; z->ts = xi->qs; z->te = xi->qe; 
        z->qs_k = 0; z->qe_k = 1; z->ts_k = k; z->te_k = k + 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x50(%rsp)
movq %rdx, %r14
movq 0x18(%rdi), %rax
movq %rax, 0x48(%rsp)
movl %esi, 0x24(%rsp)
movl %esi, %eax
movq %rax, %rcx
shlq $0x5, %rcx
movq %rdi, 0x30(%rsp)
movq 0x1d0(%rdi), %rdi
movq %rcx, 0x38(%rsp)
addq %rcx, %rdi
xorl %r13d, %r13d
movq %rax, 0x40(%rsp)
imulq $0x58, %rax, %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x50(%rsp), %r15
movl 0x18(%rdi), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %r13
jae 0x1bb0ac
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rax
movq 0x28(%rsp), %rcx
movq 0x30(%rax,%rcx), %rbp
movq 0x10(%rdi), %rax
movq (%rax,%r13,8), %rcx
movq %rcx, %rax
shrq $0x20, %rax
imulq $0x24, %rax, %rax
movl (%rbp,%rax), %r8d
movl 0x20(%rbp,%rax), %edx
shrl $0x5, %edx
andl $0x1, %edx
leal (%rdx,%r8,2), %edx
cmpl %ecx, %edx
jne 0x1bb0da
addq %rax, %rbp
movq (%r14), %rax
movq 0x8(%r14), %rcx
cmpq 0x10(%r14), %rcx
jne 0x1baef2
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rdx
movq %rdx, 0x10(%r14)
imulq $0x28, %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, (%r14)
movq 0x8(%r14), %rcx
movl (%rbp), %r8d
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%r14)
imulq $0x28, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addl 0x18(%r15), %r8d
movl %r8d, (%rax,%rcx)
movb 0x20(%rbp), %dl
shrb $0x5, %dl
andb $0x1, %dl
movb 0x24(%rax,%rcx), %sil
andb $-0x40, %sil
orb %dl, %sil
movb %sil, 0x24(%rax,%rcx)
movl 0x18(%r14), %esi
shrl $0x19, %esi
andb $0x40, %sil
orb %dl, %sil
movb %sil, 0x24(%rax,%rcx)
movdqu 0x4(%rbp), %xmm0
movdqu %xmm0, 0x4(%rax,%rcx)
movl %r13d, 0x14(%rax,%rcx)
leaq 0x1(%r13), %r12
movl %r12d, 0x18(%rax,%rcx)
movabsq $0x100000000, %rdx      # imm = 0x100000000
movq %rdx, 0x1c(%rax,%rcx)
movq 0x30(%rsp), %rsi
movq 0x30(%rsi), %rax
movq 0x48(%rsp), %rcx
movq 0x10(%rcx), %rcx
movl (%rbp), %ebx
imulq $0x28, %rbx, %rdx
movl (%rcx,%rdx), %edx
movq 0x1d0(%rsi), %rcx
movq 0x48(%rax), %rax
movq 0x28(%rsp), %rsi
movl 0x18(%rax,%rsi), %esi
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
andq %r9, %rdx
movq 0x38(%rsp), %rax
movl 0x18(%rcx,%rax), %ecx
andq %r9, %rcx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x8(%rsp)
movq %r8, (%rsp)
pushq $0x1
popq %r8
movq 0x40(%rsp), %r9
callq 0x1bb0f9
cmpl $-0x1, %eax
je 0x1bb09b
movq 0x18(%r15), %rax
shlq $0x2, %rax
addq 0x30(%r15), %rax
movl (%rax,%rbx,4), %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x1bb0bb
movq (%r15), %rbx
testq %rbx, %rbx
je 0x1bb0bb
shlq $0x5, %rax
addq %rax, %rbx
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq 0x10(%rbx), %rcx
jne 0x1bb02b
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rdx
movq %rdx, 0x10(%rbx)
imulq $0x28, %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, (%rbx)
movq 0x8(%rbx), %rcx
movq 0x18(%rsp), %rdi
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rbx)
imulq $0x28, %rcx, %rcx
movl 0x24(%rsp), %edx
movl %edx, (%rax,%rcx)
movb 0x20(%rbp), %dl
shrb $0x5, %dl
andb $0x1, %dl
movb 0x24(%rax,%rcx), %sil
andb $-0x40, %sil
orb %dl, %sil
movb %sil, 0x24(%rax,%rcx)
movl 0x18(%r14), %esi
shrl $0x19, %esi
andb $0x40, %sil
orb %dl, %sil
movb %sil, 0x24(%rax,%rcx)
movdqu 0x4(%rbp), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x4(%rax,%rcx)
movabsq $0x100000000, %rdx      # imm = 0x100000000
movq %rdx, 0x14(%rax,%rcx)
movl %r13d, 0x1c(%rax,%rcx)
movl %r12d, 0x20(%rax,%rcx)
jmp 0x1bb0a4
decq 0x8(%r14)
movq 0x18(%rsp), %rdi
movq %r12, %r13
jmp 0x1bae63
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2cdae(%rip), %rdi     # 0x1e7e70
leaq 0x3c410(%rip), %rsi     # 0x1f74d9
leaq 0x3e561(%rip), %rcx     # 0x1f9631
movl $0x1ae8, %edx           # imm = 0x1AE8
callq 0x2110
leaq 0x3e3b6(%rip), %rdi     # 0x1f9497
leaq 0x3c3f1(%rip), %rsi     # 0x1f74d9
leaq 0x3e542(%rip), %rcx     # 0x1f9631
movl $0x1ad9, %edx           # imm = 0x1AD9
callq 0x2110