// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: adjust_asg_by_ug(ma_ug_t*, asg_t*)
void adjust_asg_by_ug(ma_ug_t *ug, asg_t *read_g)
{
    uint32_t v, n_vtx, i = 0, qn;
    asg_t* nsg = ug->g;
    n_vtx = nsg->n_seq;
    ma_utg_t* node = NULL;
    for (v = 0; v < n_vtx; ++v) 
    {
        if(nsg->seq[v].c == ALTER_LABLE)
        {
            node = &(ug->u.a[v]);
            for (i = 0; i < node->n; i++)
            {
                qn = node->a[i]>>33;
                read_g->seq[qn].c = ALTER_LABLE;
            }
        }
    }


    for (v = 0; v < n_vtx; ++v) 
    {
        if(nsg->seq[v].c == ALTER_LABLE)
        {
            node = &(ug->u.a[v]);
            for (i = 0; i < node->n; i++)
            {
                qn = node->a[i]>>33;
                ///read_g->seq[qn].c = ALTER_LABLE;
                asg_seq_drop(read_g, qn);
            }
        }
    }

    asg_cleanup(read_g);
	asg_symm(read_g);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, 0x8(%rsp)
movq 0x18(%rdi), %rax
movq %rax, 0x10(%rsp)
movl 0x14(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
je 0xe9839
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdx
xorl %esi, %esi
cmpb $0x1, 0x4(%rdx,%rsi,8)
jne 0xe96dc
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%rsi,%rsi,4), %rdi
movl 0x10(%rax,%rdi,8), %r8d
testq %r8, %r8
je 0xe96dc
leaq (%rax,%rdi,8), %rax
movq 0x18(%rax), %rax
movq 0x20(%rbx), %rdi
xorl %r9d, %r9d
movq (%rax,%r9,8), %r10
shrq $0x21, %r10
movb $0x1, 0x4(%rdi,%r10,8)
incq %r9
cmpq %r9, %r8
jne 0xe96c6
incq %rsi
cmpq %rcx, %rsi
jne 0xe9699
movl %ecx, %eax
movq %rax, 0x20(%rsp)
xorl %ecx, %ecx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x18(%rsp)
cmpb $0x1, 0x4(%rax,%rcx,8)
jne 0xe9826
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rcx,4), %rdi
cmpl $0x0, 0x10(%rax,%rdi,8)
je 0xe9826
leaq (%rax,%rdi,8), %r8
xorl %r9d, %r9d
movq 0x18(%r8), %rax
movq (%rax,%r9,8), %r10
shrq $0x21, %r10
movq 0x20(%rbx), %rax
cmpb $0x1, 0x4(%rax,%r10,8)
jne 0xe9816
addl %r10d, %r10d
xorl %r11d, %r11d
leaq (%r11,%r10), %r14
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rax
movq %rax, %r15
andq %rsi, %r15
je 0xe9806
shrq $0x20, %rax
leaq (%rax,%rax,2), %r12
shlq $0x3, %r12
addq 0x8(%rbx), %r12
xorl %r13d, %r13d
leaq (,%r13,2), %rdi
addq %r13, %rdi
movl 0xc(%r12,%rdi,8), %eax
testl %eax, %eax
js 0xe97fa
leaq (%r12,%rdi,8), %rbp
movq 0x20(%rbx), %rcx
movl 0x8(%rbp), %edx
movl %edx, %edi
shrl %edi
cmpb $0x1, 0x4(%rcx,%rdi,8)
je 0xe97fa
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, 0xc(%rbp)
xorq $0x1, %rdx
movq 0x28(%rbx), %rax
movq (%rax,%rdx,8), %rax
movq %rax, %rdi
andq %rsi, %rdi
je 0xe97fa
movq 0x8(%rbx), %rcx
shrq $0x20, %rax
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rbp
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rax
addq $0xc, %rax
xorl %edi, %edi
movl -0x4(%rax,%rdi), %ecx
xorl %r14d, %ecx
cmpl $0x1, %ecx
jne 0xe97f1
orb $-0x80, 0x3(%rax,%rdi)
addq $0x18, %rdi
cmpq %rdi, %rbp
jne 0xe97e0
incq %r13
cmpq %r15, %r13
jne 0xe977c
leaq 0x1(%r11), %rax
testq %r11, %r11
movq %rax, %r11
je 0xe9751
incq %r9
movl 0x10(%r8), %eax
cmpq %rax, %r9
jb 0xe972f
movq 0x18(%rsp), %rcx
incq %rcx
cmpq 0x20(%rsp), %rcx
jne 0xe96f2
movq %rbx, %rdi
callq 0xa02fa
movq %rbx, %rdi
callq 0xa0333
movq %rbx, %rdi
callq 0xa03e9
orb $-0x80, 0x17(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq