// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x1d0(%rax), %rax
movl -0xc(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x58(%rbp), %rcx
movl 0x18(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x338a08
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x28(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %eax
shll %eax
movq -0x30(%rbp), %rcx
movb 0x20(%rcx), %cl
shrb $0x5, %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movq -0x58(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x28(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl %ecx, %eax
jne 0x33863c
jmp 0x33865b
leaq 0x5fb85(%rip), %rdi     # 0x3981c8
leaq 0x5db6f(%rip), %rsi     # 0x3961b9
movl $0x1ad9, %edx           # imm = 0x1AD9
leaq 0x5fd0c(%rip), %rcx     # 0x398362
callq 0x2130
jmp 0x33865d
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x3386c1
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x33868b
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x60(%rbp)
jmp 0x338696
movl $0x2, %eax
movq %rax, -0x60(%rbp)
jmp 0x338696
movq -0x60(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
imulq $0x28, 0x10(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %eax
movq -0x20(%rbp), %rcx
addq 0x18(%rcx), %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movb 0x20(%rax), %dl
shrb $0x5, %dl
andb $0x1, %dl
movq -0x38(%rbp), %rax
movb 0x24(%rax), %cl
andb $0x3f, %dl
andb $-0x40, %cl
orb %dl, %cl
movb %cl, 0x24(%rax)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
shrl $0x1f, %eax
movb %al, %dl
movq -0x38(%rbp), %rax
movb 0x24(%rax), %cl
andb $0x1, %dl
shlb $0x6, %dl
andb $-0x41, %cl
orb %dl, %cl
movb %cl, 0x24(%rax)
movq -0x38(%rbp), %rax
movb 0x24(%rax), %cl
andb $0x7f, %cl
orb $0x0, %cl
movb %cl, 0x24(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x38(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x38(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, %esi
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movl (%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x1d0(%rax), %rax
movl -0xc(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %ecx
movl -0xc(%rbp), %eax
movl %eax, %r9d
movq -0x38(%rbp), %rax
movl (%rax), %eax
movl $0x1, %r8d
xorl %r10d, %r10d
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
callq 0x338a20
movl %eax, -0x44(%rbp)
cmpl $-0x1, -0x44(%rbp)
jne 0x338866
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
jmp 0x3389f7
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x3370e0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x338888
jmp 0x3388a7
leaq 0x4e10d(%rip), %rdi     # 0x38699c
leaq 0x5d923(%rip), %rsi     # 0x3961b9
movl $0x1ae8, %edx           # imm = 0x1AE8
leaq 0x5fac0(%rip), %rcx     # 0x398362
callq 0x2130
jmp 0x3388a9
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x33890d
movq -0x40(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x3388d7
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x68(%rbp)
jmp 0x3388e2
movl $0x2, %eax
movq %rax, -0x68(%rbp)
jmp 0x3388e2
movq -0x68(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rax
imulq $0x28, 0x10(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl -0xc(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movb 0x20(%rax), %dl
shrb $0x5, %dl
andb $0x1, %dl
movq -0x38(%rbp), %rax
movb 0x24(%rax), %cl
andb $0x3f, %dl
andb $-0x40, %cl
orb %dl, %cl
movb %cl, 0x24(%rax)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
shrl $0x1f, %eax
movb %al, %dl
movq -0x38(%rbp), %rax
movb 0x24(%rax), %cl
andb $0x1, %dl
shlb $0x6, %dl
andb $-0x41, %cl
orb %dl, %cl
movb %cl, 0x24(%rax)
movq -0x38(%rbp), %rax
movb 0x24(%rax), %cl
andb $0x7f, %cl
orb $0x0, %cl
movb %cl, 0x24(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x38(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x38(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x3385b7
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)