// File: /workspace/github_cpp_makefile_star2_O1/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 %rdi, 0x18(%rsp)
movq 0x1d0(%rdi), %rdi
movl %esi, 0x24(%rsp)
movl %esi, %eax
movq %rax, 0x30(%rsp)
shlq $0x5, %rax
movq %rax, 0x28(%rsp)
testl $0x7fffffff, 0x18(%rdi,%rax) # imm = 0x7FFFFFFF
je 0x1fbc57
movq %rdx, %r14
addq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x48(%rsp)
xorl %r13d, %r13d
imulq $0x58, 0x30(%rsp), %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0x40(%rsp)
movq 0x50(%rsp), %r15
movq 0x18(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rax
movq 0x38(%rsp), %rcx
movq 0x30(%rax,%rcx), %rbx
movq 0x10(%rdi), %rax
movq (%rax,%r13,8), %rax
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,8), %r12
movl (%rbx,%r12,4), %ecx
movl 0x20(%rbx,%r12,4), %edx
shrl $0x5, %edx
andl $0x1, %edx
leal (%rdx,%rcx,2), %ecx
cmpl %eax, %ecx
jne 0x1fbc66
movq 0x10(%r14), %rax
cmpq %rax, 0x8(%r14)
jne 0x1fba7b
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x10(%r14)
movq (%r14), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rsi
callq 0x2370
movq %rax, (%r14)
leaq (%rbx,%r12,4), %rbp
movq (%r14), %rax
movq 0x8(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%r14)
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rdi
movl (%rbp), %eax
addl 0x18(%r15), %eax
movl %eax, (%rdi)
movb 0x20(%rbp), %cl
shrb $0x5, %cl
andb $0x1, %cl
movb 0x24(%rdi), %dl
andb $-0x40, %dl
orb %cl, %dl
movb %dl, 0x24(%rdi)
movl 0x18(%r14), %edx
shrl $0x19, %edx
andb $0x40, %dl
orb %cl, %dl
movb %dl, 0x24(%rdi)
movl 0x4(%rbp), %ecx
movl %ecx, 0x4(%rdi)
movl 0x8(%rbp), %ecx
movl %ecx, 0x8(%rdi)
movl 0xc(%rbp), %ecx
movl %ecx, 0xc(%rdi)
movl 0x10(%rbp), %ecx
movl %ecx, 0x10(%rdi)
movl %r13d, 0x14(%rdi)
leaq 0x1(%r13), %r12
movl %r12d, 0x18(%rdi)
movabsq $0x100000000, %rcx      # imm = 0x100000000
movq %rcx, 0x1c(%rdi)
movq 0x18(%rsp), %r8
movq 0x30(%r8), %rcx
movq 0x48(%rsp), %rdx
movq 0x10(%rdx), %rdx
movl (%rbp), %ebx
leaq (%rbx,%rbx,4), %rsi
movl (%rdx,%rsi,8), %edx
movq 0x1d0(%r8), %r8
movq 0x48(%rcx), %rcx
movq 0x38(%rsp), %rsi
movl 0x18(%rcx,%rsi), %esi
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
andq %r9, %rdx
movq 0x28(%rsp), %rcx
movl 0x18(%r8,%rcx), %ecx
andq %r9, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movq %rax, (%rsp)
movl $0x1, %r8d
movq 0x30(%rsp), %r9
callq 0x1fbca4
cmpl $-0x1, %eax
je 0x1fbb7d
movq 0x18(%r15), %rax
shlq $0x2, %rax
addq 0x30(%r15), %rax
movl (%rax,%rbx,4), %ebx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rbx
je 0x1fbb86
shlq $0x5, %rbx
addq (%r15), %rbx
jmp 0x1fbb88
decq 0x8(%r14)
jmp 0x1fbc3e
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x1fbc85
movq 0x10(%rbx), %rax
cmpq %rax, 0x8(%rbx)
jne 0x1fbbc2
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x10(%rbx)
movq (%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rsi
callq 0x2370
movq %rax, (%rbx)
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rbx)
leaq (%rcx,%rcx,4), %rcx
movl 0x24(%rsp), %edx
movl %edx, (%rax,%rcx,8)
movb 0x20(%rbp), %dl
shrb $0x5, %dl
andb $0x1, %dl
movb 0x24(%rax,%rcx,8), %sil
andb $-0x40, %sil
orb %dl, %sil
movb %sil, 0x24(%rax,%rcx,8)
movl 0x18(%r14), %esi
shrl $0x19, %esi
andb $0x40, %sil
orb %dl, %sil
movb %sil, 0x24(%rax,%rcx,8)
movl 0xc(%rbp), %edx
movl %edx, 0x4(%rax,%rcx,8)
movl 0x10(%rbp), %edx
movl %edx, 0x8(%rax,%rcx,8)
movl 0x4(%rbp), %edx
movl %edx, 0xc(%rax,%rcx,8)
movl 0x8(%rbp), %edx
movl %edx, 0x10(%rax,%rcx,8)
movabsq $0x100000000, %rdx      # imm = 0x100000000
movq %rdx, 0x14(%rax,%rcx,8)
movl %r13d, 0x1c(%rax,%rcx,8)
movl %r12d, 0x20(%rax,%rcx,8)
movq 0x40(%rsp), %rdi
movl 0x18(%rdi), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %r12, %r13
cmpq %rax, %r12
jb 0x1fba06
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3f587(%rip), %rdi     # 0x23b1f4
leaq 0x3d6b1(%rip), %rsi     # 0x239325
leaq 0x3f713(%rip), %rcx     # 0x23b38e
movl $0x1ad9, %edx           # imm = 0x1AD9
callq 0x2110
leaq 0x2e0f4(%rip), %rdi     # 0x229d80
leaq 0x3d692(%rip), %rsi     # 0x239325
leaq 0x3f6f4(%rip), %rcx     # 0x23b38e
movl $0x1ae8, %edx           # imm = 0x1AE8
callq 0x2110