// File: 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
movq %rsp, %rbp
subq $0x810, %rsp            # imm = 0x810
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x60(%rcx), %rax
jge 0x3961b
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
cmpq $0x0, 0x50(%rax)
je 0x39608
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
cmpq $0x1, 0x50(%rax)
je 0x39608
movq 0x38aa00(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x50(%rax), %rdx
leaq 0x3490e3(%rip), %rsi    # 0x3826e4
movb $0x0, %al
callq 0x22a0
jmp 0x3960a
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x39597
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0xb0(%rcx), %rax
jge 0x396c4
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
cmpq $0x4, 0x30(%rax)
ja 0x39673
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
cmpq $0x1, 0x30(%rax)
jae 0x396b1
movq 0x38a966(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rdx
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rsi
shlq $0x7, %rsi
addq %rsi, %rax
movq 0x30(%rax), %r8
leaq 0x349069(%rip), %rsi    # 0x382713
movb $0x0, %al
callq 0x22a0
jmp 0x396b3
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3962a
movq $0x0, -0x808(%rbp)
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0xb0(%rcx), %rax
jge 0x39857
movq $0x0, -0x808(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x10(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rcx
cmpq 0x70(%rcx), %rax
jge 0x3980c
movq -0x808(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x10(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rcx
movq 0x60(%rcx), %rcx
imulq $0x38, -0x18(%rbp), %rdx
addq %rdx, %rcx
addq 0x10(%rcx), %rax
movq %rax, -0x808(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl %eax, %esi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq -0x410(%rbp), %rcx
callq 0xa0260
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x10(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rcx
cmpq 0x70(%rcx), %rax
jge 0x397f9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl %eax, %esi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq -0x800(%rbp), %rcx
callq 0xa0260
leaq -0x410(%rbp), %rdi
leaq -0x800(%rbp), %rsi
callq 0x2280
cmpl $0x0, %eax
jne 0x397e9
movq 0x38a808(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x348e03(%rip), %rsi    # 0x3825e5
movb $0x0, %al
callq 0x22a0
jmp 0x397eb
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x39780
jmp 0x397fb
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x39706
movq -0x808(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x10(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rcx
cmpq 0x10(%rcx), %rax
je 0x39844
movq 0x38a7ad(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x348da8(%rip), %rsi    # 0x3825e5
movb $0x0, %al
callq 0x22a0
jmp 0x39846
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x396de
addq $0x810, %rsp            # imm = 0x810
popq %rbp
retq