// File: /workspace/github_cpp_makefile_star2_O3/datourat[P]IP-label-for-graph-reachability/Graph.cpp
// Function: Graph::PrintMapGraph(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Graph::PrintMapGraph(const string& filename){
	ofstream output(filename.c_str());
	if(output.is_open()==false){
		cout << filename << " is not found." << endl;
		quit();
	}
	
	vector<int> indexmap(vsize, 0);
	for(int i=0; i<vsize; i++){
		indexmap[i]=vl[i].topoID-1;
	}
	ofstream indexmapout((name+"_indexmap.txt").c_str());
	for(int i=0; i<vsize; i++){
		indexmapout << i << "\t" << indexmap[i] << endl;
	}
	indexmapout.close();

	vector< vector<int> > SortedGraph(vsize, vector<int>());
	int u, v;
	for(int i=0; i<vsize; i++){
		u=indexmap[i];
		for(int j=0; j<graph[i].outList.size(); j++){
			v=indexmap[graph[i].outList[j]];
			SortedGraph[u].push_back(v);
		}
	}

	output << "graph_for_greach" << endl;
	output << vsize << endl;
	for(int i=0; i<vsize; i++){
		output << i << ": ";
		for(int j=0; j<SortedGraph[i].size(); j++){
			output << SortedGraph[i][j] << " ";
		}
		output << "#" << endl;
	}


	output.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
leaq 0x58(%rsp), %rdi
movl $0x10, %edx
callq 0x32c0
leaq 0xc8(%rsp), %rdi
callq 0x3080
testb %al, %al
jne 0x7e1c
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0xe204(%rip), %rdi      # 0x15fd8
callq 0x32e0
movq %rax, %r14
leaq 0x8750(%rip), %rsi      # 0x10533
movl $0xe, %edx
movq %rax, %rdi
callq 0x32e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
callq 0x4948
movslq 0xc(%rbx), %rsi
leaq 0x258(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rcx
callq 0xc51c
cmpl $0x0, 0xc(%rbx)
jle 0x7e69
movq 0x30(%rbx), %rax
movq 0x28(%rsp), %rcx
addq $0x4, %rax
xorl %edx, %edx
movl (%rax), %esi
decl %esi
movl %esi, (%rcx,%rdx,4)
incq %rdx
movslq 0xc(%rbx), %rsi
addq $0x10, %rax
cmpq %rsi, %rdx
jl 0x7e52
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x4834
leaq 0x86b4(%rip), %rsi      # 0x10542
leaq 0x8(%rsp), %rdi
callq 0x34b0
movq 0x8(%rsp), %rsi
leaq 0x258(%rsp), %rdi
movl $0x10, %edx
callq 0x32c0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x7ebe
callq 0x3260
cmpl $0x0, 0xc(%rbx)
jle 0x7f3b
xorl %r14d, %r14d
leaq 0x258(%rsp), %r15
leaq 0x867a(%rip), %r12      # 0x10550
movq %r15, %rdi
movl %r14d, %esi
callq 0x3440
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x32e0
movq 0x28(%rsp), %rax
movl (%rax,%r14,4), %esi
movq %r13, %rdi
callq 0x3440
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
incq %r14
movslq 0xc(%rbx), %rax
cmpq %rax, %r14
jl 0x7ed6
leaq 0x258(%rsp), %rdi
callq 0x3350
movslq 0xc(%rbx), %rsi
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rcx
callq 0xc828
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7f7d
callq 0x3260
movl 0xc(%rbx), %ecx
testl %ecx, %ecx
jle 0x801d
movq 0x48(%rbx), %rax
xorl %r15d, %r15d
leaq 0x40(%rsp), %r14
leaq (%r15,%r15,2), %r12
shlq $0x4, %r12
movq 0x18(%rax,%r12), %rdx
cmpq %rdx, 0x20(%rax,%r12)
je 0x800e
movq 0x28(%rsp), %rcx
movslq (%rcx,%r15,4), %rcx
leaq (%rcx,%rcx,2), %r13
xorl %ebp, %ebp
movslq (%rdx,%rbp,4), %rcx
movq 0x28(%rsp), %rdx
movl (%rdx,%rcx,4), %ecx
movl %ecx, 0x40(%rsp)
movq 0x8(%rsp), %rdx
leaq (%rdx,%r13,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x7fe6
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x7ff2
movq %r14, %rdx
callq 0xdd36
movq 0x48(%rbx), %rax
incq %rbp
movq 0x18(%rax,%r12), %rdx
movq 0x20(%rax,%r12), %rcx
subq %rdx, %rcx
sarq $0x2, %rcx
cmpq %rbp, %rcx
ja 0x7fb7
movl 0xc(%rbx), %ecx
incq %r15
movslq %ecx, %rdx
cmpq %rdx, %r15
jl 0x7f94
leaq 0x8409(%rip), %rsi      # 0x1042d
leaq 0x58(%rsp), %r14
movl $0x10, %edx
movq %r14, %rdi
callq 0x32e0
movq 0x58(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
leaq 0x58(%rsp), %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movl 0xc(%rbx), %esi
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x3440
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
cmpl $0x0, 0xc(%rbx)
jle 0x816b
xorl %r15d, %r15d
leaq 0x84ec(%rip), %rbp      # 0x1059b
movq %r14, %rdi
movl %r15d, %esi
callq 0x3440
movl $0x2, %edx
movq %rax, %rdi
leaq 0x82d7(%rip), %rsi      # 0x103a0
callq 0x32e0
movq 0x8(%rsp), %rcx
leaq (%r15,%r15,2), %r12
movq (%rcx,%r12,8), %rax
cmpq %rax, 0x8(%rcx,%r12,8)
je 0x811e
xorl %r13d, %r13d
movl (%rax,%r13,4), %esi
movq %r14, %rdi
callq 0x3440
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x32e0
incq %r13
movq 0x8(%rsp), %rcx
movq (%rcx,%r12,8), %rax
movq 0x8(%rcx,%r12,8), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
ja 0x80e5
movl $0x1, %edx
movq %r14, %rdi
leaq 0x8482(%rip), %rsi      # 0x105af
callq 0x32e0
movq 0x58(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
incq %r15
movslq 0xc(%rbx), %rax
cmpq %rax, %r15
jl 0x80af
leaq 0x58(%rsp), %rdi
callq 0x3350
leaq 0x8(%rsp), %rdi
callq 0xbe3e
movq 0xde42(%rip), %rax      # 0x15fc8
movq (%rax), %rbx
movq 0x18(%rax), %r14
leaq 0x260(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movq -0x18(%rbx), %rax
movq %r14, 0x258(%rsp,%rax)
callq 0x3220
leaq 0x350(%rsp), %rdi
callq 0x30e0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x81c6
callq 0x3260
leaq 0x60(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movq -0x18(%rbx), %rax
movq %r14, 0x58(%rsp,%rax)
callq 0x3220
leaq 0x150(%rsp), %rdi
callq 0x30e0
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x824c
callq 0x3260
jmp 0x824c
jmp 0x8238
jmp 0x8214
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x8259
callq 0x3260
jmp 0x8259
movq %rax, %rbx
jmp 0x8259
jmp 0x822f
movq %rax, %rbx
jmp 0x8268
jmp 0x823f
jmp 0x823f
movq %rax, %rbx
jmp 0x824c
jmp 0x823f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xbe3e
leaq 0x258(%rsp), %rdi
callq 0x3380
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x8268
callq 0x3260
leaq 0x58(%rsp), %rdi
callq 0x3380
movq %rbx, %rdi
callq 0x3460