// File: /workspace/github_cpp_makefile_star2_O1/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 $0x7e8, %rsp            # imm = 0x7E8
movq %rdi, %rbx
cmpq $0x0, 0x60(%rdi)
jle 0x4dca6
movl $0x50, %r15d
movq 0x23c371(%rip), %r12    # 0x289fe0
leaq 0x1d7d96(%rip), %r14    # 0x225a0c
xorl %r13d, %r13d
movq 0x18(%rbx), %rax
movq (%rax,%r15), %rdx
cmpq $0x2, %rdx
jae 0x4dc96
incq %r13
subq $-0x80, %r15
cmpq 0x60(%rbx), %r13
jl 0x4dc79
jmp 0x4dca6
movq (%r12), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x22b0
jmp 0x4dc87
movq 0xa8(%rbx), %r14
movq 0xb0(%rbx), %rdx
cmpq %rdx, %r14
jge 0x4dd0c
movq %r14, %r12
shlq $0x7, %r12
orq $0x30, %r12
movq 0x23c315(%rip), %r13    # 0x289fe0
leaq 0x1d7d69(%rip), %r15    # 0x225a3b
movq 0x18(%rbx), %rax
movq (%rax,%r12), %r8
leaq -0x5(%r8), %rax
cmpq $-0x5, %rax
jbe 0x4dcf9
incq %r14
movq 0xb0(%rbx), %rdx
subq $-0x80, %r12
cmpq %rdx, %r14
jl 0x4dcd2
jmp 0x4dd0c
movq (%r13), %rdi
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x22b0
jmp 0x4dce4
movq 0xa8(%rbx), %rcx
cmpq 0xb0(%rbx), %rcx
jge 0x4de73
leaq 0x10(%rsp), %r15
movq 0x18(%rbx), %rax
movq %rcx, %r13
shlq $0x7, %r13
cmpq $0x0, 0x70(%rax,%r13)
movq %rcx, (%rsp)
jle 0x4de4c
movslq %ecx, %r12
shlq $0x7, %r12
xorl %r8d, %r8d
xorl %r14d, %r14d
movq 0x60(%rax,%r12), %rdx
movslq %r14d, %rcx
imulq $0x38, %rcx, %rsi
movq 0x20(%rdx,%rsi), %rcx
testl %ecx, %ecx
jle 0x4dd93
addq %rsi, %rdx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %esi, %esi
movslq 0x8(%rdx), %rdx
shlq $0x7, %rdx
movb 0x18(%rax,%rdx), %dil
movb %dil, 0x400(%rsp,%rsi)
incq %rsi
movq 0x60(%rax,%rdx), %rdx
cmpq %rsi, %rcx
jne 0x4dd6d
movl %esi, %ecx
jmp 0x4dd95
xorl %ecx, %ecx
movq 0x60(%rax,%r13), %rax
imulq $0x38, %r14, %rdx
addq 0x10(%rax,%rdx), %r8
movq %r8, 0x8(%rsp)
movb $0x0, 0x400(%rsp,%rcx)
incq %r14
movq 0x18(%rbx), %rax
cmpq 0x70(%rax,%r13), %r14
jge 0x4de36
movq %r14, %rbp
movq 0x60(%rax,%r12), %rdx
movslq %ebp, %rcx
imulq $0x38, %rcx, %rsi
movq 0x20(%rdx,%rsi), %rcx
testl %ecx, %ecx
jle 0x4de04
addq %rsi, %rdx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %esi, %esi
movslq 0x8(%rdx), %rdx
shlq $0x7, %rdx
movb 0x18(%rax,%rdx), %dil
movb %dil, 0x10(%rsp,%rsi)
incq %rsi
movq 0x60(%rax,%rdx), %rdx
cmpq %rsi, %rcx
jne 0x4dde1
movl %esi, %eax
jmp 0x4de06
xorl %eax, %eax
movb $0x0, 0x10(%rsp,%rax)
leaq 0x400(%rsp), %rdi
movq %r15, %rsi
callq 0x2290
testl %eax, %eax
je 0x4de2f
incq %rbp
movq 0x18(%rbx), %rax
cmpq 0x70(%rax,%r13), %rbp
jl 0x4ddc1
jmp 0x4de36
callq 0x5860
jmp 0x4de1f
movq 0x18(%rbx), %rax
cmpq 0x70(%rax,%r13), %r14
movq 0x8(%rsp), %r8
jl 0x4dd4d
jmp 0x4de4f
xorl %r8d, %r8d
cmpq 0x10(%rax,%r13), %r8
jne 0x4de6c
movq (%rsp), %rcx
incq %rcx
cmpq 0xb0(%rbx), %rcx
jl 0x4dd25
jmp 0x4de73
callq 0x587c
jmp 0x4de56
addq $0x7e8, %rsp            # imm = 0x7E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq