// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: debug_whole_graph(Graph*)
void debug_whole_graph(Graph* g)
{
    long long i, j, k;
    for (i = 0; i < (long long)g->g_nodes.length; i++)
    {
        if(g->g_nodes.list[i].deletion_edges.length!= 0 &&
        g->g_nodes.list[i].deletion_edges.length!= 1)
        {
            fprintf(stderr, "g->g_nodes.list[i].deletion_edges.length: %lu\n",
            (unsigned long)g->g_nodes.list[i].deletion_edges.length);
        }
    }

    for (i = g->s_start_nodeID; i < (long long)g->s_end_nodeID; i++)
    {
        if(g->g_nodes.list[i].mismatch_edges.length > 4 
        || 
        g->g_nodes.list[i].mismatch_edges.length < 1)
        {
            fprintf(stderr, "g->s_end_nodeID: %lu, g->g_nodes.list[%lld].mismatch_edges.length: %lu\n",
            (unsigned long)g->s_end_nodeID, i, (unsigned long)g->g_nodes.list[i].mismatch_edges.length);
        }
    }

    char current[1000];
    char compare[1000];
    long long total_weight = 0;
    for (i = g->s_start_nodeID; i < (long long)g->s_end_nodeID; i++)
    {
        total_weight = 0;
        for (j = 0; j < (long long)G_Node(*g, i).insertion_edges.length; j++)
        {
            
            total_weight = total_weight + G_Node(*g, i).insertion_edges.list[j].weight;

            extract_path(g, i, j, current);

            for (k = j + 1; k < (long long)G_Node(*g, i).insertion_edges.length; k++)
            {
                extract_path(g, i, k, compare);
                if(strcmp(current, compare)==0)
                {
                    fprintf(stderr,"error\n");
                }
            }
        }

        if(total_weight != (long long)G_Node(*g, i).num_insertions)
        {
            fprintf(stderr,"error\n");
        }
    }

        

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7f8, %rsp            # imm = 0x7F8
movq %rdi, %r13
movq 0x60(%rdi), %rax
testq %rax, %rax
jle 0x4cee3
movl $0x50, %ebx
movq 0x248136(%rip), %r15    # 0x294fe0
leaq 0x1e4c6b(%rip), %r14    # 0x231b1c
xorl %r12d, %r12d
movq 0x18(%r13), %rcx
movq (%rcx,%rbx), %rdx
cmpq $0x2, %rdx
jae 0x4ced0
incq %r12
subq $-0x80, %rbx
cmpq %rax, %r12
jl 0x4ceb4
jmp 0x4cee3
movq (%r15), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x22b0
movq 0x60(%r13), %rax
jmp 0x4cec2
movq 0xa8(%r13), %rbp
movq 0xb0(%r13), %rdx
cmpq %rdx, %rbp
jge 0x4cf4f
movq %rbp, %rbx
shlq $0x7, %rbx
orq $0x30, %rbx
movq 0x2480d8(%rip), %r14    # 0x294fe0
leaq 0x1e4c3c(%rip), %r15    # 0x231b4b
movq 0x18(%r13), %rax
movq (%rax,%rbx), %r8
leaq -0x5(%r8), %rax
cmpq $-0x5, %rax
jbe 0x4cf2f
incq %rbp
subq $-0x80, %rbx
cmpq %rdx, %rbp
jl 0x4cf0f
jmp 0x4cf48
movq (%r14), %rdi
movq %r15, %rsi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x22b0
movq 0xb0(%r13), %rdx
jmp 0x4cf21
movq 0xa8(%r13), %rbp
cmpq %rdx, %rbp
jge 0x4d0d1
leaq 0x20(%rsp), %r12
movq %r13, 0x8(%rsp)
movq 0x18(%r13), %r13
movq %rbp, %r14
shlq $0x7, %r14
movq 0x70(%r13,%r14), %rax
testq %rax, %rax
movq %rbp, 0x10(%rsp)
jle 0x4d0a4
movslq %ebp, %rbp
shlq $0x7, %rbp
xorl %r9d, %r9d
xorl %r15d, %r15d
movq 0x60(%r13,%r14), %rcx
movq 0x60(%r13,%rbp), %rsi
movslq %r15d, %rdx
imulq $0x38, %rdx, %rdi
movq 0x20(%rsi,%rdi), %rdx
testl %edx, %edx
jle 0x4cfd6
addq %rdi, %rsi
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %edi, %edi
movslq 0x8(%rsi), %rsi
shlq $0x7, %rsi
movb 0x18(%r13,%rsi), %r8b
movb %r8b, 0x410(%rsp,%rdi)
incq %rdi
movq 0x60(%r13,%rsi), %rsi
cmpq %rdi, %rdx
jne 0x4cfb2
jmp 0x4cfd8
xorl %edx, %edx
imulq $0x38, %r15, %rsi
addq 0x10(%rcx,%rsi), %r9
movq %r9, 0x18(%rsp)
movb $0x0, 0x410(%rsp,%rdx)
incq %r15
cmpq %rax, %r15
jge 0x4d08f
movq %r15, %rbx
movq 0x60(%r13,%rbp), %rcx
movslq %ebx, %rax
imulq $0x38, %rax, %rdx
movq 0x20(%rcx,%rdx), %rax
testl %eax, %eax
jle 0x4d03d
addq %rdx, %rcx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
movslq 0x8(%rcx), %rcx
shlq $0x7, %rcx
movb 0x18(%r13,%rcx), %sil
movb %sil, 0x20(%rsp,%rdx)
incq %rdx
movq 0x60(%r13,%rcx), %rcx
cmpq %rdx, %rax
jne 0x4d01c
jmp 0x4d03f
xorl %eax, %eax
movb $0x0, 0x20(%rsp,%rax)
leaq 0x410(%rsp), %rdi
movq %r12, %rsi
callq 0x2290
testl %eax, %eax
je 0x4d064
incq %rbx
cmpq 0x70(%r13,%r14), %rbx
jl 0x4cffd
jmp 0x4d08f
movq 0x247f75(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
movl $0x6, %esi
movl $0x1, %edx
leaq 0x1e499e(%rip), %rdi    # 0x231a1d
callq 0x2410
movq 0x8(%rsp), %rax
movq 0x18(%rax), %r13
jmp 0x4d058
movq 0x70(%r13,%r14), %rax
cmpq %rax, %r15
movq 0x18(%rsp), %r9
jl 0x4cf8d
jmp 0x4d0a7
xorl %r9d, %r9d
cmpq 0x10(%r13,%r14), %r9
jne 0x4d0ca
movq 0x10(%rsp), %rbp
incq %rbp
movq 0x8(%rsp), %r13
cmpq 0xb0(%r13), %rbp
jl 0x4cf62
jmp 0x4d0d1
callq 0x5940
jmp 0x4d0ae
addq $0x7f8, %rsp            # imm = 0x7F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq