// File: /workspace/github_cpp_makefile_star2_O3/datourat[P]IP-label-for-graph-reachability/Graph.cpp
// Function: Graph::readGraph(std::istream&)
void Graph::readGraph(istream& in) {
	string buf;
	getline(in, buf);

	strTrimRight(buf);
	if (buf != "graph_for_greach") {
		cout << "BAD FILE FORMAT!" << endl;
	//	exit(0);
	}
	
	int n;
	getline(in, buf);
	istringstream(buf) >> n;
	// initialize
	vsize = n;
	vl = VertexList(n, Vertex());
	graph = GRA(n, In_OutList());	
/*
	for (int i = 0; i < n; i++)
		addVertex(i);
*/
//	for(int i=0; i<vsize; i++)
//		vl[i].id=i;

	int begin, end;
	int sid, tid;
	vector<string> neighbors;
	while (getline(in, buf)) {
//		istringstream(buf) >> sid;
		begin = buf.find(":");
		end = buf.find_last_of("#");
		sid = atoi((buf.substr(0, begin)).c_str());
		buf = buf.substr(begin+2,end-begin-2);
		split(buf, ' ', neighbors);
		vl[sid].outdegree=neighbors.size();
		graph[sid].outList.reserve(vl[sid].outdegree);
		for (int i = 0; i < neighbors.size(); i++) {
			tid = atoi(neighbors[i].c_str());
			addEdge(sid,tid);
			vl[tid].indegree++;
		}
		neighbors.clear();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rsi, %r12
movq %rdi, %r14
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%rsi), %rax
movq -0x18(%rax), %rdi
addq %rsi, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %edx
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x34a0
leaq 0x28(%rsp), %rsi
callq 0x55a4
leaq 0xb5cb(%rip), %rsi      # 0x1042d
leaq 0x28(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
je 0x4eb6
movq 0x11161(%rip), %r15     # 0x15fd8
leaq 0xb5c0(%rip), %rsi      # 0x1043e
movl $0x10, %edx
movq %r15, %rdi
callq 0x32e0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq 0x1112f(%rip), %rdi     # 0x15fd8
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %edx
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x34a0
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x8, %edx
callq 0x3430
leaq 0x70(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x3170
movq 0x110cb(%rip), %rsi     # 0x15fd0
leaq 0x70(%rsp), %rdi
callq 0x3360
leaq 0xe8(%rsp), %rdi
callq 0x30e0
movslq 0xc(%rsp), %rsi
movl %esi, 0xc(%r14)
leaq 0x10(%rsp), %rdx
movw $0x0, (%rdx)
movl $0x0, 0xc(%rdx)
movq $0x0, 0x4(%rdx)
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rcx
callq 0xc08e
movq 0x30(%r14), %rdi
movaps 0x70(%rsp), %xmm0
movups %xmm0, 0x30(%r14)
movq 0x80(%rsp), %rax
movq %rax, 0x40(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
testq %rdi, %rdi
je 0x4f94
callq 0x3260
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x4f94
callq 0x3260
movslq 0xc(%rsp), %rsi
leaq 0x70(%rsp), %rdx
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x50(%rsp), %rdi
leaq 0xb(%rsp), %rcx
callq 0xbd88
movq 0x58(%r14), %rax
leaq 0x50(%rsp), %rbx
movaps (%rbx), %xmm0
movq 0x10(%rbx), %rcx
movq %rcx, 0x58(%r14)
movups 0x48(%r14), %xmm1
movups %xmm0, 0x48(%r14)
leaq 0x10(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
callq 0xbcd8
movq %rbx, %rdi
callq 0xbcd8
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x5012
callq 0x3260
movq %r12, 0x48(%rsp)
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x5026
callq 0x3260
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq 0x48(%rsp), %rbx
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3280
leaq 0x28(%rsp), %r12
movsbl %al, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x34a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x520f
movl $0x1, %ecx
movq %r12, %rdi
leaq 0xb3c9(%rip), %rsi      # 0x1044f
xorl %edx, %edx
callq 0x3450
movq %rax, %r15
movl $0x1, %ecx
movq %r12, %rdi
leaq 0xb510(%rip), %rsi      # 0x105af
movq $-0x1, %rdx
callq 0x34d0
movq %rax, %r13
movslq %r15d, %rcx
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x32a0
movq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x33c0
movl %eax, %ebp
leaq 0x80(%rsp), %rax
cmpq %rax, %rbx
je 0x50e4
movq %rbx, %rdi
callq 0x3260
movq %r15, %rdx
shlq $0x20, %rdx
movabsq $0x200000000, %rax      # imm = 0x200000000
addq %rax, %rdx
sarq $0x20, %rdx
subl %r15d, %r13d
addl $-0x2, %r13d
movslq %r13d, %rcx
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x32a0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3310
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x5138
callq 0x3260
movq %r12, %rdi
movl $0x20, %esi
leaq 0x10(%rsp), %rdx
callq 0x5658
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
shrq $0x5, %rax
movslq %ebp, %rcx
movq 0x30(%r14), %rdx
leaq (%rcx,%rcx,2), %rsi
shlq $0x4, %rcx
movl %eax, 0xc(%rdx,%rcx)
movq 0x48(%r14), %rcx
shlq $0x4, %rsi
leaq (%rcx,%rsi), %rdi
addq $0x18, %rdi
movslq %eax, %rsi
callq 0xc116
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r15
cmpq %rbx, %r15
je 0x51de
xorl %r13d, %r13d
xorl %r12d, %r12d
movq (%rbx,%r13), %rdi
callq 0x33c0
movl %eax, %ebx
movq %r14, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0x5762
movslq %ebx, %rax
movq 0x30(%r14), %rcx
shlq $0x4, %rax
incl 0x8(%rcx,%rax)
incq %r12
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r15
movq %r15, %rax
subq %rbx, %rax
sarq $0x5, %rax
addq $0x20, %r13
cmpq %r12, %rax
ja 0x5198
cmpq %rbx, %r15
je 0x5039
movq %rbx, %r12
movq (%r12), %rdi
addq $0x10, %r12
cmpq %r12, %rdi
je 0x51fc
callq 0x3260
addq $0x10, %r12
cmpq %r15, %r12
jne 0x51ea
movq %rbx, 0x18(%rsp)
jmp 0x5039
leaq 0x10(%rsp), %rdi
callq 0xc1a8
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x522d
callq 0x3260
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0xbe1c
jmp 0x528f
jmp 0x5277
movq %rax, %rbx
movq 0x10d76(%rip), %rsi     # 0x15fd0
leaq 0x70(%rsp), %rdi
callq 0x3360
leaq 0xe8(%rsp), %rdi
callq 0x30e0
jmp 0x528f
jmp 0x5277
jmp 0x5277
movq %rax, %rbx
jmp 0x528f
jmp 0x5282
jmp 0x5282
jmp 0x5282
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xc1a8
leaq 0x38(%rsp), %rax
movq 0x28(%rsp), %rdi
cmpq %rax, %rdi
je 0x52a3
callq 0x3260
movq %rbx, %rdi
callq 0x3460
nop