// File: /workspace/github_cpp_makefile_star2_O2/yuanboli233[P]interdyck_graph_reduce/graphtest.cpp
// Function: createNodeMergeMap(SummaryGraph&)
void createNodeMergeMap(SummaryGraph& sGraph){
    unordered_map<unsigned, unsigned> node2orig = sGraph.node2orignodeid;
    unordered_map<unsigned, string> eid2orig = sGraph.eid2origeidstring;
    ofstream out("tmp_color_reach_dk_node_merge.txt", ofstream::out);
    unordered_map<unsigned, list<unsigned>*> mergeMap;
    for(unsigned i = 0; i < sGraph.nodes.size(); i++){
        SummaryNode* node = sGraph.nodes[i];
        if(node->id != root(node->id, sGraph)){
            unsigned existID = node->belongto;
            if(mergeMap.find(existID) == mergeMap.end()){
                mergeMap[existID] = new list<unsigned>();
            }
            mergeMap[existID]->push_back(node->id);
        }else{
            unsigned id = node->id;
            if(mergeMap.find(id) == mergeMap.end()){
                mergeMap[id] = new list<unsigned>();
            }
            mergeMap[id]->push_back(id);
        }
    }

    for(unordered_map<unsigned, list<unsigned>*>::iterator mit = mergeMap.begin(); mit != mergeMap.end(); mit++){
        unsigned existID = mit->first;
        list<unsigned>* l = mit->second;
        out << node2orig[existID] << ": ";
        for(list<unsigned>::iterator lit = l->begin(); lit != l->end(); lit++){
            out << node2orig[*lit] << " ";
        }
        out << endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, %rbx
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x3398
leaq 0x38(%rbx), %rsi
leaq 0x80(%rsp), %rdi
callq 0x361c
leaq 0x46a3(%rip), %rsi      # 0x705b
leaq 0xb8(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x21f0
leaq 0x40(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
leaq 0x20(%rsp), %r12
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movl $0x3f800000, 0x10(%r12) # imm = 0x3F800000
movups %xmm0, 0x18(%r12)
xorl %r14d, %r14d
leaq 0xc(%rsp), %r15
movl %r14d, %r14d
movq 0x70(%rbx), %rax
movq 0x78(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0x2aea
movq (%rax,%r14,8), %r13
movl (%r13), %ebp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x246c
cmpl %eax, %ebp
jne 0x2a89
movl (%r13), %eax
movl %eax, 0xc(%rsp)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5ccc
testq %rax, %rax
jne 0x2a6f
pushq $0x18
popq %rdi
callq 0x21c0
movq %rax, %r13
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5d48
movq %r13, (%rax)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5d48
movq (%rax), %rdi
movq %r15, %rsi
callq 0x30ec
jmp 0x2ae2
movl 0x68(%r13), %eax
movl %eax, 0xc(%rsp)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5ccc
testq %rax, %rax
jne 0x2aca
pushq $0x18
popq %rdi
callq 0x21c0
movq %rax, %rbp
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5d48
movq %rbp, (%rax)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5d48
movq (%rax), %rdi
movq %r13, %rsi
callq 0x30ec
incl %r14d
jmp 0x29fd
leaq 0x48(%rsp), %rbx
leaq 0xb8(%rsp), %r15
leaq 0x4538(%rip), %r13      # 0x7036
movq (%r12), %r12
testq %r12, %r12
je 0x2b73
movl 0x8(%r12), %eax
movl %eax, 0xc(%rsp)
movq 0x10(%r12), %rbp
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
callq 0x544e
movl (%rax), %esi
movq %r15, %rdi
callq 0x2110
movq %rax, %rdi
leaq 0x450b(%rip), %rsi      # 0x7041
callq 0x21b0
movq %rbp, %r14
movq (%r14), %r14
cmpq %rbp, %r14
je 0x2b69
leaq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x544e
movl (%rax), %esi
movq %r15, %rdi
callq 0x2110
movq %rax, %rdi
movq %r13, %rsi
callq 0x21b0
jmp 0x2b3e
movq %r15, %rdi
callq 0x20c0
jmp 0x2afe
leaq 0x10(%rsp), %rdi
callq 0x3920
leaq 0xb8(%rsp), %rdi
callq 0x2250
leaq 0x80(%rsp), %rdi
callq 0x38e8
leaq 0x48(%rsp), %rdi
callq 0x3904
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2be1
movq %rax, %rbx
jmp 0x2bee
jmp 0x2bc7
jmp 0x2bc7
jmp 0x2bc7
jmp 0x2bc7
jmp 0x2bc7
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3920
leaq 0xb8(%rsp), %rdi
callq 0x2250
leaq 0x80(%rsp), %rdi
callq 0x38e8
leaq 0x48(%rsp), %rdi
callq 0x3904
movq %rbx, %rdi
callq 0x22b0