// File: /workspace/github_cpp_makefile_star2_O3/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, %r15
movq 0x1d0(%rdi), %r12
movl %esi, 0x24(%rsp)
movl %esi, %eax
movq %rax, %rcx
shlq $0x5, %rcx
movq %rcx, 0x28(%rsp)
testl $0x7fffffff, 0x18(%r12,%rcx) # imm = 0x7FFFFFFF
je 0x207325
movq %rdx, %r14
movq %rdi, %r13
addq 0x28(%rsp), %r12
movq 0x18(%rdi), %rcx
movq %rcx, 0x40(%rsp)
movq $-0x1, 0x30(%rsp)
xorl %ebp, %ebp
imulq $0x58, %rax, %rbx
movq %rbx, 0x38(%rsp)
movq 0x30(%r13), %rax
movq 0x48(%rax), %rax
movq 0x30(%rax,%rbx), %rax
movq 0x10(%r12), %rcx
movq (%rcx,%rbp,8), %rsi
movq %rsi, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,8), %rdx
movl (%rax,%rdx,4), %ecx
movl 0x20(%rax,%rdx,4), %edi
shrl $0x5, %edi
andl $0x1, %edi
leal (%rdi,%rcx,2), %edi
cmpl %esi, %edi
jne 0x207334
leaq (%rax,%rdx,4), %r10
movq (%r14), %rax
movq 0x8(%r14), %rdx
cmpq 0x10(%r14), %rdx
movq %r10, 0x18(%rsp)
jne 0x207034
leaq (%rdx,%rdx), %rcx
testq %rdx, %rdx
movl $0x2, %edx
cmoveq %rdx, %rcx
movq %rcx, 0x10(%r14)
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rsi
movq %rax, %rdi
callq 0x2370
movq 0x18(%rsp), %r10
movq %rax, (%r14)
movq 0x8(%r14), %rdx
movl (%r10), %ecx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x8(%r14)
addl 0x18(%r15), %ecx
leaq (%rdx,%rdx,4), %rdx
movl %ecx, (%rax,%rdx,8)
movb 0x20(%r10), %r9b
shrb $0x5, %r9b
andb $0x1, %r9b
movb 0x24(%rax,%rdx,8), %cl
andb $-0x40, %cl
orb %r9b, %cl
movb %cl, 0x24(%rax,%rdx,8)
movl 0x18(%r14), %ecx
shrl $0x19, %ecx
andb $0x40, %cl
orb %r9b, %cl
movb %cl, 0x24(%rax,%rdx,8)
movl 0x4(%r10), %ecx
movl %ecx, 0x4(%rax,%rdx,8)
movl 0x8(%r10), %edi
movl %edi, 0x8(%rax,%rdx,8)
movl 0xc(%r10), %esi
movl %esi, 0xc(%rax,%rdx,8)
movl 0x10(%r10), %r11d
movl %r11d, 0x10(%rax,%rdx,8)
movl %ebp, 0x14(%rax,%rdx,8)
movq %rbp, 0x8(%rsp)
leaq 0x1(%rbp), %r8
movq %r8, 0x10(%rsp)
movl %r8d, 0x18(%rax,%rdx,8)
movabsq $0x100000000, %r8       # imm = 0x100000000
movq %r8, 0x1c(%rax,%rdx,8)
movq 0x30(%r13), %rax
movq 0x48(%rax), %rax
movq 0x40(%rsp), %rdx
movq 0x10(%rdx), %rdx
movl (%r10), %r8d
movq %r8, 0x50(%rsp)
leaq (%r8,%r8,4), %r10
movl (%rdx,%r10,8), %edx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andq %r8, %rdx
movq %r11, 0x48(%rsp)
subq %r11, %rdx
testb %r9b, %r9b
movq %rsi, %r9
cmoveq %rdx, %r9
cmoveq %rsi, %rdx
cmpq %rcx, %rdx
movq %rcx, %r11
cmovlq %rdx, %r11
movl 0x18(%rax,%rbx), %eax
movq %rax, %rbx
subq %rdi, %rbx
cmpq %r9, %rbx
movq %r9, %r10
cmovlq %rbx, %r10
testq %r11, %r11
jg 0x2072fc
testq %r10, %r10
jg 0x2072fc
cmpq %r9, %rbx
setl 0x7(%rsp)
movq %r14, %rbx
movq %r15, %r14
setle %r15b
cmpq %rdx, %rcx
movq %r12, %r8
movq %r13, %r12
setle %r13b
setl %bpl
testb %r15b, %r13b
movq %r12, %r13
movq %r8, %r12
movq %r14, %r15
movq %rbx, %r14
jne 0x2071bf
orb 0x7(%rsp), %bpl
je 0x2071bf
addq %rdi, %r9
subq %r9, %rax
movq %rcx, %r9
subq %rdx, %r9
cmovleq %rax, %r9
addq %r11, %r10
subq %rcx, %rdi
addq %r10, %rdi
js 0x2071bf
addq 0x48(%rsp), %r10
cmpq %rsi, %r10
jl 0x2071bf
movq 0x1d0(%r13), %rax
movq 0x28(%rsp), %rsi
movl 0x18(%rax,%rsi), %edi
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdi
movq 0x30(%rsp), %rax
leaq (%rax,%rdi), %rsi
cmpq $0x0, 0x8(%rsp)
je 0x2072a7
testq %rsi, %rsi
jle 0x2072a7
movq 0x18(%r15), %rax
shlq $0x2, %rax
addq 0x30(%r15), %rax
movq 0x50(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x207353
movq (%r15), %rbx
testq %rbx, %rbx
je 0x207353
shlq $0x5, %rax
addq %rax, %rbx
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq 0x10(%rbx), %rcx
jne 0x20722c
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x10(%rbx)
shlq $0x3, %rdx
leaq (%rdx,%rdx,4), %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, (%rbx)
movq 0x8(%rbx), %rcx
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r9
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rbx)
leaq (%rcx,%rcx,4), %rcx
movl 0x24(%rsp), %edx
movl %edx, (%rax,%rcx,8)
movb 0x20(%r8), %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)
movdqu 0x4(%r8), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x4(%rax,%rcx,8)
movabsq $0x100000000, %rdx      # imm = 0x100000000
movq %rdx, 0x14(%rax,%rcx,8)
movl %edi, 0x1c(%rax,%rcx,8)
movl %r9d, 0x20(%rax,%rcx,8)
jmp 0x207305
movq 0x8(%rsp), %rax
testq %rax, %rax
jne 0x2072c4
cmpq %rdi, 0x10(%rsp)
jne 0x2072c4
cmpl $-0x1, %r9d
jne 0x2071bf
jmp 0x2072fc
testq %rax, %rax
setne %al
testq %rsi, %rsi
setg %sil
setns %dil
cmpq %rdx, %rcx
setg %cl
orb %al, %sil
xorb %sil, %al
notb %sil
andb %dil, %sil
xorb %cl, %al
orb %sil, %al
cmpb $0x1, %al
jne 0x2072fc
movl %r9d, %eax
cmpl $-0x1, %eax
jne 0x2071bf
decq 0x8(%r14)
movq 0x10(%rsp), %r9
movl 0x18(%r12), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
decq 0x30(%rsp)
movq %r9, %rbp
cmpq %rax, %r9
movq 0x38(%rsp), %rbx
jb 0x206fb2
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4019d(%rip), %rdi     # 0x2474d8
leaq 0x3e2c7(%rip), %rsi     # 0x245609
leaq 0x40329(%rip), %rcx     # 0x247672
movl $0x1ad9, %edx           # imm = 0x1AD9
callq 0x2110
leaq 0x2ec16(%rip), %rdi     # 0x235f70
leaq 0x3e2a8(%rip), %rsi     # 0x245609
leaq 0x4030a(%rip), %rcx     # 0x247672
movl $0x1ae8, %edx           # imm = 0x1AE8
callq 0x2110