// File: yuanboli233[P]interdyck_graph_reduce/graphtest.cpp
// Function: exportMergeNodes(SummaryGraph&)
void exportMergeNodes(SummaryGraph& sGraph){
    unordered_map<unsigned, list<unsigned>*> mergemap;
    for(unsigned i = 0; i < sGraph.nodes.size(); i++){
        SummaryNode* node = sGraph.nodes[i];
        unsigned root = node->belongto;
        if(mergemap.find(root) == mergemap.end()){
            mergemap[root] = new list<unsigned>();
        }
        mergemap[root]->push_back(i);
    }

    ofstream out(merge_orig_to_colormerge);
    for(unordered_map<unsigned, list<unsigned>*>::iterator it = mergemap.begin(); it != mergemap.end(); it++){
        list<unsigned>* lst = it->second;
        unsigned root = it->first;
        out << root << ": ";
        for(list<unsigned>::iterator lit = lst->begin(); lit != lst->end(); lit++){
            out << *lit << " ";
        }
        out << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5310
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq %rax, -0x2c0(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
callq 0x5250
movq %rax, %rcx
movq -0x2c0(%rbp), %rax
cmpq %rcx, %rax
jae 0x45af
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
movl -0x44(%rbp), %eax
movl %eax, %esi
callq 0x4e30
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl 0x68(%rax), %eax
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0x5360
movq %rax, -0x2c8(%rbp)
jmp 0x44e2
movq -0x2c8(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5390
movq %rax, -0x78(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x5330
testb $0x1, %al
jne 0x450d
jmp 0x4574
movl $0x18, %edi
callq 0x3210
movq %rax, -0x2d0(%rbp)
jmp 0x4520
movq -0x2d0(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x53c0
leaq -0x40(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0x53e0
movq %rax, -0x2d8(%rbp)
jmp 0x4550
movq -0x2d8(%rbp), %rax
movq -0x2d0(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x4574
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x4760
leaq -0x40(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0x53e0
movq %rax, -0x2e0(%rbp)
jmp 0x458a
movq -0x2e0(%rbp), %rax
movq (%rax), %rdi
leaq -0x44(%rbp), %rsi
callq 0x5410
jmp 0x459f
jmp 0x45a1
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x447f
leaq 0x19c72(%rip), %rsi     # 0x1e228
leaq -0x278(%rbp), %rdi
movl $0x10, %edx
callq 0x33d0
jmp 0x45c9
leaq -0x40(%rbp), %rdi
callq 0x5450
movq %rax, -0x280(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5390
movq %rax, -0x288(%rbp)
leaq -0x280(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x5480
testb $0x1, %al
jne 0x4605
jmp 0x4742
leaq -0x280(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x54b0
movq -0x2f0(%rbp), %rdi
movq 0x8(%rax), %rax
movq %rax, -0x290(%rbp)
callq 0x54b0
movl (%rax), %eax
movl %eax, -0x294(%rbp)
movl -0x294(%rbp), %esi
leaq -0x278(%rbp), %rdi
callq 0x3300
movq %rax, -0x2e8(%rbp)
jmp 0x4652
movq -0x2e8(%rbp), %rdi
leaq 0xe9e5(%rip), %rsi      # 0x13045
callq 0x3200
jmp 0x4667
movq -0x290(%rbp), %rdi
callq 0x54e0
movq %rax, -0x2a0(%rbp)
movq -0x290(%rbp), %rdi
callq 0x5540
movq %rax, -0x2a8(%rbp)
leaq -0x2a0(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x5510
testb $0x1, %al
jne 0x46a6
jmp 0x4711
leaq -0x2a0(%rbp), %rdi
callq 0x5570
movl (%rax), %esi
leaq -0x278(%rbp), %rdi
callq 0x3300
movq %rax, -0x2f8(%rbp)
jmp 0x46c9
movq -0x2f8(%rbp), %rdi
leaq 0xe963(%rip), %rsi      # 0x1303a
callq 0x3200
jmp 0x46de
jmp 0x46e0
leaq -0x2a0(%rbp), %rdi
xorl %esi, %esi
callq 0x5590
movq %rax, -0x2b0(%rbp)
jmp 0x467a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x3330
jmp 0x4760
movq 0x198a8(%rip), %rsi     # 0x1dfc0
leaq -0x278(%rbp), %rdi
callq 0x3240
jmp 0x4726
jmp 0x4728
leaq -0x280(%rbp), %rdi
xorl %esi, %esi
callq 0x55c0
movq %rax, -0x2b8(%rbp)
jmp 0x45d9
leaq -0x278(%rbp), %rdi
callq 0x3330
leaq -0x40(%rbp), %rdi
callq 0x55f0
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x55f0
movq -0x68(%rbp), %rdi
callq 0x3390
nopw %cs:(%rax,%rax)