// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: cmp_untig_graph(ma_ug_t*, ma_ug_t*)
uint32_t cmp_untig_graph(ma_ug_t *src, ma_ug_t *dest)
{
    uint32_t nv, nw;
	asg_arc_t *av = NULL, *aw = NULL;
    uint32_t v, i, k, n_vtx = dest->g->n_seq*2;
    if(src->g->n_seq!=dest->g->n_seq)
    {
        fprintf(stderr, "src->g->n_seq: %u, dest->g->n_seq: %u\n", src->g->n_seq, dest->g->n_seq);
        ///return 1;
    } 
    if(src->g->r_seq!=dest->g->r_seq)
    {
        fprintf(stderr, "src->g->r_seq: %u, dest->g->r_seq: %u\n", src->g->r_seq, dest->g->r_seq);
        ///return 1;
    } 
    if(src->g->is_srt!=dest->g->is_srt)
    {
        fprintf(stderr, "src->g->is_srt: %u, dest->g->is_srt: %u\n", src->g->is_srt, dest->g->is_srt);
        ///return 1;
    } 
    if(src->g->is_symm!=dest->g->is_symm)
    {
        fprintf(stderr, "src->g->is_symm: %u, dest->g->is_symm: %u\n", src->g->is_symm, dest->g->is_symm);
        ///return 1;
    } 
    ///if(memcmp(src->g->seq, dest->g->seq, sizeof(asg_seq_t)*src->g->n_seq)!=0) return 1;

    n_vtx = dest->g->n_seq;
    for (v = 0; v < n_vtx; v++)
    {
        if(src->g->seq[v].c != dest->g->seq[v].c)
        {
            fprintf(stderr, "src->g->seq[%u].c: %u, dest->g->seq[%u].c: %u\n", 
            v, src->g->seq[v].c, v, dest->g->seq[v].c);
        }

        if(src->g->seq[v].del != dest->g->seq[v].del)
        {
            fprintf(stderr, "src->g->seq[%u].del: %u, dest->g->seq[%u].del: %u\n", 
            v, src->g->seq[v].del, v, dest->g->seq[v].del);
        }

        if(src->g->seq[v].len != dest->g->seq[v].len)
        {
            fprintf(stderr, "src->g->seq[%u].len: %u, dest->g->seq[%u].len: %u\n", 
            v, src->g->seq[v].len, v, dest->g->seq[v].len);
        }
        
        if(src->u.a[v].n != dest->u.a[v].n)
        {
            fprintf(stderr, "src->u.a[%u].n: %u, dest->u.a[%u].n: %u\n", 
            v, src->u.a[v].n, v, dest->u.a[v].n);
        }

        if(src->u.a[v].a[0] != dest->u.a[v].a[0] || 
                    src->u.a[v].a[src->u.a[v].n-1] != dest->u.a[v].a[dest->u.a[v].n - 1]) 
        {
            fprintf(stderr, "unequal beg/end node\n");
        }
    }
    

    n_vtx = dest->g->n_seq*2;
    for (v = 0; v < n_vtx; v++)
    {
        nv = asg_arc_n(src->g, v);
	    av = asg_arc_a(src->g, v);
        nw = asg_arc_n(dest->g, v);
        aw = asg_arc_a(dest->g, v);
        if(get_real_length(src->g, v, NULL) != get_real_length(dest->g, v, NULL))
        {
            fprintf(stderr, "v>>1: %u, v&1: %u, get_real_length(src->g, v, NULL): %u, get_real_length(dest->g, v, NULL): %u\n", 
            v>>1, v&1, get_real_length(src->g, v, NULL), get_real_length(dest->g, v, NULL));
            ///return 1;
        } 

        for (i = 0; i < nv; i++)
        {
            if(av[i].del) continue;
            for (k = 0; k < nw; k++)
            {
                if(aw[k].del) continue;
                if(av[i].v == aw[k].v) break;
            }

            if(k == nw) return 1;
        }
    }

    n_vtx = dest->g->n_seq;
    ma_utg_t *src_u = NULL, *dest_u = NULL;
    for (v = 0; v < n_vtx; v++)
    {
        src_u = &(src->u.a[v]);
        dest_u = &(dest->u.a[v]);
        if(src_u->circ!=dest_u->circ) return 1;
        if(src_u->end!=dest_u->end) return 1;
        if(src_u->len!=dest_u->len) return 1;
        if(src_u->n!=dest_u->n) return 1;
        if(src_u->start!=dest_u->start) return 1;
        if(memcmp(src_u->a, dest_u->a, 8*src_u->n)!=0) return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rsi), %rax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl 0x14(%rax), %ecx
andl %edx, %ecx
movq 0x18(%rdi), %rax
andl 0x14(%rax), %edx
cmpl %ecx, %edx
jne 0xd0fb0
movq 0x18(%r14), %rax
movl 0x18(%rax), %edx
movq 0x18(%rbx), %rax
movl 0x18(%rax), %ecx
cmpl %ecx, %edx
jne 0xd0fcd
movq 0x18(%r14), %rax
movl 0x4(%rax), %edx
shrl $0x1f, %edx
movq 0x18(%rbx), %rax
movl 0x4(%rax), %ecx
shrl $0x1f, %ecx
cmpl %ecx, %edx
jne 0xd0fea
movq 0x18(%r14), %rax
movl 0x14(%rax), %edx
shrl $0x1f, %edx
movq 0x18(%rbx), %rax
movl 0x14(%rax), %ecx
shrl $0x1f, %ecx
cmpl %ecx, %edx
jne 0xd1007
movq 0x18(%rbx), %rax
movl 0x14(%rax), %r12d
andq $0x7fffffff, %r12       # imm = 0x7FFFFFFF
je 0xd0ce8
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
movzbl 0x4(%rax,%r15,8), %ecx
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rax
movzbl 0x4(%rax,%r15,8), %r9d
cmpb %r9b, %cl
jne 0xd0c5c
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
movl (%rax,%r15,8), %ecx
shrl $0x1f, %ecx
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rax
movl (%rax,%r15,8), %r9d
shrl $0x1f, %r9d
cmpl %r9d, %ecx
jne 0xd0c7f
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
movl (%rax,%r15,8), %ecx
andl %r13d, %ecx
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rax
movl (%rax,%r15,8), %r9d
andl %r13d, %r9d
cmpl %r9d, %ecx
jne 0xd0ca2
movq 0x10(%r14), %rax
movl 0x10(%rax,%rbp), %ecx
movq 0x10(%rbx), %rax
movl 0x10(%rax,%rbp), %r9d
cmpl %r9d, %ecx
jne 0xd0cc5
movq 0x10(%r14), %rsi
movq 0x18(%rsi,%rbp), %rcx
movq (%rcx), %rdi
movq 0x10(%rbx), %rdx
movq 0x18(%rdx,%rbp), %rax
cmpq (%rax), %rdi
jne 0xd0c55
movl 0x10(%rsi,%rbp), %esi
decl %esi
movq (%rcx,%rsi,8), %rcx
movl 0x10(%rdx,%rbp), %edx
decl %edx
cmpq (%rax,%rdx,8), %rcx
jne 0xd0c55
incq %r15
addq $0x28, %rbp
cmpq %r15, %r12
jne 0xd0b82
jmp 0xd0ce8
callq 0x10e88
jmp 0xd0c40
movq 0x1b937d(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x15a5c6(%rip), %rsi    # 0x22b233
movl %r15d, %edx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x22b0
jmp 0xd0ba7
movq 0x1b935a(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x15a5d2(%rip), %rsi    # 0x22b262
movl %r15d, %edx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x22b0
jmp 0xd0bcf
movq 0x1b9337(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x15a5e2(%rip), %rsi    # 0x22b295
movl %r15d, %edx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x22b0
jmp 0xd0bf6
movq 0x1b9314(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x15a5f2(%rip), %rsi    # 0x22b2c8
movl %r15d, %edx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x22b0
jmp 0xd0c10
movq 0x18(%rbx), %rax
movl 0x14(%rax), %eax
addl %eax, %eax
je 0xd0f21
movl %eax, %r11d
xorl %ebp, %ebp
movq 0x18(%r14), %rax
movq 0x8(%rax), %r9
movq 0x28(%rax), %rax
movq (%rax,%rbp,8), %r10
movq %r10, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %r15
movq %r10, %rax
movl $0x0, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rax
je 0xd0d58
leaq (%r9,%r15,8), %rdx
addq $0xc, %rdx
leaq (,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rsi
xorl %edi, %edi
xorl %ecx, %ecx
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %ecx
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0xd0d41
movq %r15, 0x8(%rsp)
movq %r9, 0x10(%rsp)
movq 0x18(%rbx), %rdx
movq 0x8(%rdx), %rsi
movq 0x28(%rdx), %rdx
movq (%rdx,%rbp,8), %r12
movq %r12, %r13
shrq $0x20, %r13
movq %r12, %r15
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %r15
movq %rsi, (%rsp)
je 0xd0dc7
leaq (,%r13,2), %rdx
addq %r13, %rdx
leaq (%rsi,%rdx,8), %rdx
addq $0xc, %rdx
leaq (,%r15,8), %rsi
leaq (%rsi,%rsi,2), %rdi
xorl %r8d, %r8d
xorl %esi, %esi
movl (%rdx,%r8), %r9d
notl %r9d
shrl $0x1f, %r9d
addl %r9d, %esi
addq $0x18, %r8
cmpq %r8, %rdi
jne 0xd0dae
jmp 0xd0dc9
xorl %esi, %esi
cmpl %esi, %ecx
jne 0xd0e5e
testl %r10d, %r10d
je 0xd0e4d
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
leaq (%rax,%rcx,8), %rax
movl %r10d, %ecx
leaq (,%r13,2), %rdx
addq %r13, %rdx
movq (%rsp), %rsi
leaq (%rsi,%rdx,8), %rdx
addq $0xc, %rdx
xorl %esi, %esi
leaq (%rsi,%rsi,2), %rdi
cmpl $0x0, 0xc(%rax,%rdi,8)
js 0xd0e45
testl %r12d, %r12d
je 0xd0e3a
leaq (%rax,%rdi,8), %r8
movq %rdx, %r9
xorl %edi, %edi
cmpl $0x0, (%r9)
js 0xd0e29
movl 0x8(%r8), %r10d
cmpl -0x4(%r9), %r10d
je 0xd0e3c
incq %rdi
addq $0x18, %r9
cmpq %rdi, %r15
jne 0xd0e19
movl %r12d, %edi
jmp 0xd0e3c
xorl %edi, %edi
cmpl %r12d, %edi
je 0xd0f1a
incq %rsi
cmpq %rcx, %rsi
jne 0xd0e00
incq %rbp
cmpq %r11, %rbp
jne 0xd0cfc
jmp 0xd0f21
xorl %r9d, %r9d
movl $0x0, %r8d
testq %rax, %rax
je 0xd0e9f
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rdx
leaq (%rcx,%rdx,8), %rcx
addq $0xc, %rcx
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
xorl %edx, %edx
xorl %r8d, %r8d
movl (%rcx,%rdx), %esi
notl %esi
shrl $0x1f, %esi
addl %esi, %r8d
addq $0x18, %rdx
cmpq %rdx, %rax
jne 0xd0e8b
movq %r10, 0x18(%rsp)
movq %r11, 0x20(%rsp)
testq %r15, %r15
je 0xd0eea
leaq (,%r13,2), %rax
addq %r13, %rax
movq (%rsp), %rcx
leaq (%rcx,%rax,8), %rax
addq $0xc, %rax
leaq (,%r15,8), %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
xorl %r9d, %r9d
movl (%rax,%rdx), %esi
notl %esi
shrl $0x1f, %esi
addl %esi, %r9d
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0xd0ed6
movl %ebp, %edx
shrl %edx
movl %ebp, %ecx
andl $0x1, %ecx
movq 0x1b90e6(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x15a403(%rip), %rsi    # 0x22b307
xorl %eax, %eax
callq 0x22b0
movq 0x20(%rsp), %r11
movq 0x18(%rsp), %r10
jmp 0xd0dd1
movl $0x1, %ebx
jmp 0xd0f9f
movq 0x18(%rbx), %rax
movl 0x14(%rax), %eax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
je 0xd0f9d
movq 0x10(%r14), %r14
movq 0x10(%rbx), %r15
shlq $0x3, %rax
leaq (%rax,%rax,4), %r12
xorl %r13d, %r13d
movl $0x1, %ebx
movl (%r14,%r13), %eax
movl (%r15,%r13), %ecx
movl %ecx, %edx
xorl %eax, %edx
js 0xd0f9f
cmpl %ecx, %eax
jne 0xd0f9f
movl 0x8(%r15,%r13), %eax
cmpl %eax, 0x8(%r14,%r13)
jne 0xd0f9f
movl 0x10(%r14,%r13), %edx
cmpl 0x10(%r15,%r13), %edx
jne 0xd0f9f
movl 0x4(%r14,%r13), %eax
cmpl 0x4(%r15,%r13), %eax
jne 0xd0f9f
movq 0x18(%r14,%r13), %rdi
movq 0x18(%r15,%r13), %rsi
shll $0x3, %edx
callq 0x21a0
testl %eax, %eax
jne 0xd0f9f
addq $0x28, %r13
cmpq %r13, %r12
jne 0xd0f48
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1b9029(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x15a1d0(%rip), %rsi    # 0x22b191
xorl %eax, %eax
callq 0x22b0
jmp 0xd0b14
movq 0x1b900c(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x15a1da(%rip), %rsi    # 0x22b1b8
xorl %eax, %eax
callq 0x22b0
jmp 0xd0b2a
movq 0x1b8fef(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x15a1e4(%rip), %rsi    # 0x22b1df
xorl %eax, %eax
callq 0x22b0
jmp 0xd0b46
movq 0x1b8fd2(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x15a1f0(%rip), %rsi    # 0x22b208
xorl %eax, %eax
callq 0x22b0
jmp 0xd0b62