// File: /workspace/github_cpp_makefile_star2_O3/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, 0x10(%rsp)
movq 0x18(%rdi), %rax
movq %rax, 0x8(%rsp)
movl 0x14(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
je 0xeb145
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdx
xorl %esi, %esi
cmpb $0x1, 0x4(%rdx,%rsi,8)
jne 0xeafd2
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%rsi,%rsi,4), %r9
movl 0x10(%rax,%r9,8), %r8d
testq %r8, %r8
je 0xeafd2
leaq (%rax,%r9,8), %rax
movq 0x18(%rax), %rax
movq 0x20(%rbx), %r9
xorl %r10d, %r10d
movq (%rax,%r10,8), %r11
shrq $0x21, %r11
movb $0x1, 0x4(%r9,%r11,8)
incq %r10
cmpq %r10, %r8
jne 0xeafbc
incq %rsi
cmpq %rcx, %rsi
jne 0xeaf8f
testl %ecx, %ecx
je 0xeb145
movl %ecx, %eax
movq %rax, 0x20(%rsp)
xorl %ecx, %ecx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x18(%rsp)
cmpb $0x1, 0x4(%rax,%rcx,8)
jne 0xeb132
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
movl 0x10(%rax,%rcx,8), %r11d
testl %r11d, %r11d
je 0xeb132
leaq (%rax,%rcx,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 0xeb123
addl %r10d, %r10d
movb $0x1, %r11b
xorl %r14d, %r14d
orq %r10, %r14
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rax
movq %rax, %r15
andq %rsi, %r15
je 0xeb109
shrq $0x20, %rax
leaq (%rax,%rax,2), %r12
shlq $0x3, %r12
addq 0x8(%rbx), %r12
xorl %r13d, %r13d
leaq (,%r13,2), %rcx
addq %r13, %rcx
movl 0xc(%r12,%rcx,8), %eax
testl %eax, %eax
js 0xeb0fd
leaq (%r12,%rcx,8), %rbp
movq 0x20(%rbx), %rdx
movl 0x8(%rbp), %edi
movl %edi, %ecx
shrl %ecx
cmpb $0x1, 0x4(%rdx,%rcx,8)
je 0xeb0fd
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, 0xc(%rbp)
xorq $0x1, %rdi
movq 0x28(%rbx), %rax
movq (%rax,%rdi,8), %rax
movq %rax, %rcx
andq %rsi, %rcx
je 0xeb0fd
movq 0x8(%rbx), %rdx
shrq $0x20, %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rbp
leaq (%rax,%rax,2), %rax
leaq (%rdx,%rax,8), %rax
addq $0xc, %rax
xorl %ecx, %ecx
movl -0x4(%rax,%rcx), %edx
xorl %r14d, %edx
cmpl $0x1, %edx
jne 0xeb0f4
orb $-0x80, 0x3(%rax,%rcx)
addq $0x18, %rcx
cmpq %rcx, %rbp
jne 0xeb0e3
incq %r13
cmpq %r15, %r13
jne 0xeb07f
movl $0x1, %r14d
testb $0x1, %r11b
movl $0x0, %r11d
jne 0xeb055
movl 0x10(%r8), %r11d
incq %r9
movl %r11d, %eax
cmpq %rax, %r9
jb 0xeb030
movq 0x18(%rsp), %rcx
incq %rcx
cmpq 0x20(%rsp), %rcx
jne 0xeaff0
movq %rbx, %rdi
callq 0xa0a7d
movq %rbx, %rdi
callq 0xa0ab6
movq %rbx, %rdi
callq 0xa0b79
orb $-0x80, 0x17(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq