// File: /workspace/github_cpp_makefile_star2_O1/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 0x55b2
leaq 0xb5e9(%rip), %rsi      # 0x1043d
leaq 0x28(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
je 0x4ea8
movq 0x1116f(%rip), %r15     # 0x15fd8
leaq 0xb5de(%rip), %rsi      # 0x1044e
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 0x1113d(%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 0x110d9(%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 0xc168
movq 0x30(%r14), %rdi
movaps 0x70(%rsp), %xmm0
movq 0x80(%rsp), %rax
movq %rdi, 0x70(%rsp)
movups 0x38(%r14), %xmm1
movups %xmm0, 0x30(%r14)
movq %rax, 0x40(%r14)
movups %xmm1, 0x78(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
testq %rdi, %rdi
je 0x4f86
callq 0x3260
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x4f95
callq 0x3260
movslq 0xc(%rsp), %rsi
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rdx
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x50(%rsp), %rdi
leaq 0xb(%rsp), %rcx
callq 0xbe70
leaq 0x10(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movups 0x48(%r14), %xmm0
movq 0x58(%r14), %rax
leaq 0x50(%rsp), %rbx
movaps (%rbx), %xmm1
movups %xmm1, 0x48(%r14)
movq 0x10(%rbx), %rcx
movq %rcx, 0x58(%r14)
movq 0x10(%rdi), %rcx
movq %rax, 0x10(%rdi)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movaps %xmm1, (%rbx)
movq %rcx, 0x10(%rbx)
callq 0xbdc2
movq %rbx, %rdi
callq 0xbdc2
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x5021
callq 0x3260
movq %r12, 0x48(%rsp)
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x5035
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 0x521e
movl $0x1, %ecx
movq %r12, %rdi
leaq 0xb3ca(%rip), %rsi      # 0x1045f
xorl %edx, %edx
callq 0x3450
movq %rax, %r15
movl $0x1, %ecx
movq %r12, %rdi
leaq 0xb511(%rip), %rsi      # 0x105bf
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 0x50f3
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 0x5147
callq 0x3260
movq %r12, %rdi
movl $0x20, %esi
leaq 0x10(%rsp), %rdx
callq 0x5666
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 0xc1e4
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r15
cmpq %rbx, %r15
je 0x51ed
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 0x5770
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 0x51a7
cmpq %rbx, %r15
je 0x5048
movq %rbx, %r12
movq (%r12), %rdi
addq $0x10, %r12
cmpq %r12, %rdi
je 0x520b
callq 0x3260
addq $0x10, %r12
cmpq %r15, %r12
jne 0x51f9
movq %rbx, 0x18(%rsp)
jmp 0x5048
leaq 0x10(%rsp), %rdi
callq 0xc272
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x523c
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 0xbf04
jmp 0x529e
jmp 0x5286
movq %rax, %rbx
movq 0x10d67(%rip), %rsi     # 0x15fd0
leaq 0x70(%rsp), %rdi
callq 0x3360
leaq 0xe8(%rsp), %rdi
callq 0x30e0
jmp 0x529e
jmp 0x5286
jmp 0x5286
movq %rax, %rbx
jmp 0x529e
jmp 0x5291
jmp 0x5291
jmp 0x5291
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xc272
leaq 0x38(%rsp), %rax
movq 0x28(%rsp), %rdi
cmpq %rax, %rdi
je 0x52b2
callq 0x3260
movq %rbx, %rdi
callq 0x3460