// File: iPapatsoris[P]Maximum-Independent-Set/src/Graph.cpp
// Function: Graph::print(bool) const
void Graph::print(bool direction) const {
    cout << "\nNodes: " << nodeIndex.size() << " Edges: " << edgeBuffer->size() / 2 << "\n";
    for (uint32_t pos = 0 ; pos < nodeIndex.size() ; pos++) {
        if (!nodeIndex[pos].removed) {
            uint32_t node = (!mapping ? pos : (*posToId)[pos]);
            if (!nodeIndex[pos].edges) {
                cout << node << "\n";
            }
            uint32_t nextNodeOffset = (pos == nodeIndex.size()-1 ? edgeBuffer->size() : nodeIndex[pos+1].offset);
            for (uint32_t offset = nodeIndex[pos].offset ; offset < nextNodeOffset ; offset++) {
                uint32_t nPos = (!mapping ? (*edgeBuffer)[offset] : idToPos->at((*edgeBuffer)[offset]));
                if (!nodeIndex[nPos].removed && (direction || !direction && node < (*edgeBuffer)[offset])) {
                    cout << node << "\t" << (*edgeBuffer)[offset] << "\n";
                }
            }
        }
    }
    /*cout << "Zero degree nodes: \n";
    for (uint32_t i = 0 ; i < zeroDegreeNodes.size() ; i++) {
        cout << zeroDegreeNodes[i] << "\n";
    }*/
}

// Assembly:
subq $0x78, %rsp
movb %sil, %al
movq %rdi, 0x70(%rsp)
andb $0x1, %al
movb %al, 0x6f(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x4f3ad(%rip), %rdi     # 0x5dfd0
leaq 0x37963(%rip), %rsi     # 0x4658d
callq 0x2190
movq 0x48(%rsp), %rdi
movq %rax, 0x40(%rsp)
callq 0x18830
movq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x2060
movq %rax, %rdi
leaq 0x37941(%rip), %rsi     # 0x46596
callq 0x2190
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x50(%rsp)
movq 0x18(%rax), %rdi
callq 0x188e0
movq 0x50(%rsp), %rdi
movq %rax, %rsi
shrq %rsi
callq 0x2060
movq %rax, %rdi
leaq 0x3792a(%rip), %rsi     # 0x465b4
callq 0x2190
movl $0x0, 0x68(%rsp)
movq 0x48(%rsp), %rdi
movl 0x68(%rsp), %eax
movq %rax, 0x38(%rsp)
callq 0x18830
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0xeeeb
movq 0x48(%rsp), %rdi
movl 0x68(%rsp), %eax
movl %eax, %esi
callq 0x18850
testb $0x1, 0x8(%rax)
jne 0xeed9
movq 0x48(%rsp), %rax
testb $0x1, 0x3c(%rax)
jne 0xecea
movl 0x68(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0xed04
movq 0x48(%rsp), %rax
movq 0x48(%rax), %rdi
movl 0x68(%rsp), %eax
movl %eax, %esi
callq 0x18900
movl (%rax), %eax
movl %eax, 0x34(%rsp)
movq 0x48(%rsp), %rdi
movl 0x34(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x68(%rsp), %eax
movl %eax, %esi
callq 0x18850
cmpl $0x0, 0x4(%rax)
jne 0xed41
movl 0x64(%rsp), %esi
movq 0x4f2a3(%rip), %rdi     # 0x5dfd0
callq 0x2230
movq %rax, %rdi
leaq 0x37878(%rip), %rsi     # 0x465b4
callq 0x2190
movq 0x48(%rsp), %rdi
movl 0x68(%rsp), %eax
movq %rax, 0x28(%rsp)
callq 0x18830
movq %rax, %rcx
movq 0x28(%rsp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0xed7a
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x188e0
movq %rax, 0x20(%rsp)
jmp 0xed96
movq 0x48(%rsp), %rdi
movl 0x68(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x18850
movl (%rax), %eax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rax
movl %eax, 0x60(%rsp)
movl 0x68(%rsp), %eax
movl %eax, %esi
callq 0x18850
movl (%rax), %eax
movl %eax, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
cmpl 0x60(%rsp), %eax
jae 0xeed7
movq 0x48(%rsp), %rax
testb $0x1, 0x3c(%rax)
jne 0xedea
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
movl 0x5c(%rsp), %eax
movl %eax, %esi
callq 0x18900
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
jmp 0xee1a
movq 0x48(%rsp), %rax
movq 0x40(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rdi
movl 0x5c(%rsp), %eax
movl %eax, %esi
callq 0x18900
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x188b0
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
movq 0x48(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x58(%rsp)
movl 0x58(%rsp), %eax
movl %eax, %esi
callq 0x18850
testb $0x1, 0x8(%rax)
jne 0xeec5
testb $0x1, 0x6f(%rsp)
jne 0xee71
testb $0x1, 0x6f(%rsp)
jne 0xeec5
movq 0x48(%rsp), %rax
movl 0x64(%rsp), %ecx
movl %ecx, 0xc(%rsp)
movq 0x18(%rax), %rdi
movl 0x5c(%rsp), %eax
movl %eax, %esi
callq 0x18900
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl (%rcx), %eax
jae 0xeec5
movl 0x64(%rsp), %esi
movq 0x4f154(%rip), %rdi     # 0x5dfd0
callq 0x2230
movq %rax, %rdi
leaq 0x37714(%rip), %rsi     # 0x4659f
callq 0x2190
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, (%rsp)
movq 0x18(%rax), %rdi
movl 0x5c(%rsp), %eax
movl %eax, %esi
callq 0x18900
movq (%rsp), %rdi
movl (%rax), %esi
callq 0x2230
movq %rax, %rdi
leaq 0x376f4(%rip), %rsi     # 0x465b4
callq 0x2190
jmp 0xeec7
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0xedb5
jmp 0xeed9
jmp 0xeedb
movl 0x68(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x68(%rsp)
jmp 0xec97
addq $0x78, %rsp
retq