// File: /workspace/github_cpp_makefile_star2_O2/datourat[P]IP-label-for-graph-reachability/Graph.cpp
// Function: Graph::ReadIndex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Graph::ReadIndex(const string& filename){
	ifstream in(filename.c_str());
	string buf, tmpbuf;
	if(in.is_open()==false){
		cout << "Cannot open " << filename << endl;
		quit();
	}
	reachindex.resize(vsize);
	getline(in, buf);
	istringstream(buf) >> hugenode;

	int begin, end;
	int u, v;
	vector<string> levellabel, outlabel, inlabel, hv;
	while (getline(in, buf)) {
		begin = buf.find(":");
		end = buf.find("#");
		u = atoi((buf.substr(0, begin)).c_str());

		tmpbuf = buf.substr(begin+2, end-begin-2);
		split(tmpbuf, ' ', outlabel);
		begin=end;
		end=buf.find('#', end+1);
		tmpbuf=buf.substr(begin+2, end-begin-2);
		split(tmpbuf, ' ', inlabel);
		begin=end;
		end=buf.find('#', end+1);
		tmpbuf=buf.substr(begin+2, end-begin-2);
		split(tmpbuf, ' ', hv);

		reachindex[u].OutLimit=outlabel.size();
		reachindex[u].InLimit=inlabel.size()+reachindex[u].OutLimit;
		reachindex[u].HLimit=hv.size()+reachindex[u].InLimit;
		reachindex[u].Label = new int[reachindex[u].HLimit];
		int labelit=0;
		for(int i=0; i<outlabel.size(); i++, labelit++){
			v = atoi(outlabel[i].c_str());
			reachindex[u].Label[labelit]=v;
		}
		for(int i=0; i<inlabel.size(); i++, labelit++){
			v = atoi(inlabel[i].c_str());
			reachindex[u].Label[labelit]=v;
		}
		for(int i=0; i<hv.size(); i++, labelit++){
			v = atoi(hv[i].c_str());
			reachindex[u].Label[labelit]=v;
		}
		if(labelit!=reachindex[u].HLimit)
			cout << "Index Input Error" << endl;
		outlabel.clear();
		inlabel.clear();
		hv.clear();
		begin=end;
		end=buf.find("#", end+1);
		tmpbuf = buf.substr(begin+2,end-begin-2);
		split(tmpbuf, ' ', levellabel);
		if(levellabel.size()!=2){
			cout << "Index file error" << endl;
			quit();
		}
		reachindex[u].layerup=atoi(levellabel[0].c_str());
		reachindex[u].layerdown=atoi(levellabel[1].c_str());
		levellabel.clear();
	}

	in.close();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
leaq 0x280(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x3450
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0xf0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rax)
movb %dl, (%rcx)
leaq 0x2f8(%rsp), %rdi
callq 0x3090
testb %al, %al
jne 0x825b
movq 0xcda1(%rip), %rdi      # 0x14fd8
leaq 0x6313(%rip), %rsi      # 0xe551
callq 0x3270
movq %rax, %rdi
movq %r14, %rsi
callq 0x3220
movq %rax, %rdi
callq 0x3140
callq 0x41b8
leaq 0xa8(%rbx), %rdi
movslq 0xc(%rbx), %rsi
movq %rdi, 0x10(%rsp)
callq 0x9fd0
leaq 0x280(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x3060
leaq 0x100(%rsp), %rdi
leaq 0x40(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x3410
addq $0x8, %rbx
leaq 0x100(%rsp), %rdi
movq %rbx, %rsi
callq 0x3180
leaq 0x100(%rsp), %rdi
callq 0x3130
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0xa0(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x80(%rsp), %rax
andq $0x0, 0x10(%rax)
leaq 0x60(%rsp), %rcx
andq $0x0, 0x10(%rcx)
movaps %xmm0, (%rax)
movaps %xmm0, (%rcx)
leaq 0x40(%rsp), %r15
leaq 0x280(%rsp), %rdi
movq %r15, %rsi
callq 0x3060
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x8799
leaq 0x40(%rsp), %r15
movq %r15, %rdi
leaq 0x60c4(%rip), %rsi      # 0xe3ef
xorl %edx, %edx
callq 0x34b0
movq %rax, %r12
movq %r15, %rdi
leaq 0x6210(%rip), %rsi      # 0xe54f
xorl %edx, %edx
callq 0x34b0
movq %rax, %rbp
movslq %r12d, %rcx
leaq 0x100(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3290
movq %r12, %r13
shlq $0x20, %r13
movq 0x100(%rsp), %rdi
callq 0x33a0
movl %eax, %ebx
movq %r14, %rdi
callq 0x3120
movabsq $0x200000000, %rax      # imm = 0x200000000
addq %rax, %r13
sarq $0x20, %r13
movl %ebp, %ecx
subl %r12d, %ecx
shlq $0x20, %rcx
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3290
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3300
movq %r14, %rdi
callq 0x3120
movq %r15, %rdi
pushq $0x20
popq %rsi
leaq 0xa0(%rsp), %rdx
callq 0x4b96
movq %rbp, %r12
shlq $0x20, %r12
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%r12,%rax), %rdx
sarq $0x20, %rdx
leaq 0x40(%rsp), %r15
movq %r15, %rdi
pushq $0x23
popq %rsi
callq 0x3330
movq %rax, %r13
movabsq $0x200000000, %rax      # imm = 0x200000000
addq %rax, %r12
sarq $0x20, %r12
movl %r13d, %ecx
subl %ebp, %ecx
shlq $0x20, %rcx
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
leaq 0x100(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3290
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3300
movq %r14, %rdi
callq 0x3120
movq %r15, %rdi
pushq $0x20
popq %rsi
leaq 0x80(%rsp), %rdx
callq 0x4b96
movq %r13, %r12
shlq $0x20, %r12
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%r12,%rax), %rdx
sarq $0x20, %rdx
leaq 0x40(%rsp), %r15
movq %r15, %rdi
pushq $0x23
popq %rsi
callq 0x3330
movq %rax, %rcx
movabsq $0x200000000, %rax      # imm = 0x200000000
addq %rax, %r12
sarq $0x20, %r12
movq %rcx, 0xd0(%rsp)
subl %r13d, %ecx
shlq $0x20, %rcx
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
leaq 0x100(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3290
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3300
movq %r14, %rdi
callq 0x3120
movq %r15, %rdi
pushq $0x20
popq %rsi
leaq 0x60(%rsp), %rdx
callq 0x4b96
movq 0xa0(%rsp), %rbp
movq 0xa8(%rsp), %r13
subq %rbp, %r13
sarq $0x5, %r13
movslq %ebx, %rbx
movq 0x10(%rsp), %rax
movq (%rax), %r12
shlq $0x4, %rbx
movb %r13b, 0x4(%r12,%rbx)
movq 0x80(%rsp), %rax
movq 0x88(%rsp), %rcx
movq %rax, 0xd8(%rsp)
subq %rax, %rcx
sarq $0x5, %rcx
movq %rcx, 0x18(%rsp)
leal (%rcx,%r13), %eax
movb %al, 0x5(%r12,%rbx)
movq 0x60(%rsp), %r15
movq 0x68(%rsp), %r14
subq %r15, %r14
sarq $0x5, %r14
addl %r14d, %eax
movb %al, 0x6(%r12,%rbx)
movzbl %al, %edi
shll $0x2, %edi
callq 0x3030
movq %rbx, 0xc0(%rsp)
addq %rbx, %r12
movq %rax, 0x8(%rsp)
movq %rax, 0x8(%r12)
xorl %ebx, %ebx
cmpq %rbx, %r13
je 0x85d1
movq (%rbp), %rdi
callq 0x33a0
movq 0x8(%rsp), %rcx
movl %eax, (%rcx,%rbx,4)
incq %rbx
addq $0x20, %rbp
jmp 0x85b2
movq %r12, 0xc8(%rsp)
movl %r13d, %r13d
negq 0x18(%rsp)
movq 0x8(%rsp), %rax
leaq (%rax,%r13,4), %rbp
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpq %r12, 0x18(%rsp)
je 0x8614
movq 0xd8(%rsp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x33a0
movl %eax, (%rbp,%rbx)
decq %r12
addq $0x4, %rbx
jmp 0x85ef
subq %r12, %r13
movq 0xc8(%rsp), %rbx
movq 0x8(%rsp), %r12
subq $0x1, %r14
jb 0x863f
movq (%r15), %rdi
callq 0x33a0
movl %eax, (%r12,%r13,4)
incq %r13
addq $0x20, %r15
jmp 0x8624
movzbl 0x6(%rbx), %eax
cmpq %r13, %rax
leaq 0x100(%rsp), %r14
leaq 0x40(%rsp), %r15
je 0x8670
movq 0xc97c(%rip), %rdi      # 0x14fd8
leaq 0x5efb(%rip), %rsi      # 0xe55e
callq 0x3270
movq %rax, %rdi
callq 0x3140
leaq 0xa0(%rsp), %rdi
callq 0x98a4
leaq 0x80(%rsp), %rdi
callq 0x98a4
leaq 0x60(%rsp), %rdi
callq 0x98a4
movq 0xd0(%rsp), %r12
movq %r12, %rbx
shlq $0x20, %rbx
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%rbx,%rax), %rdx
sarq $0x20, %rdx
movq %r15, %rdi
leaq 0x5e90(%rip), %rsi      # 0xe54f
callq 0x34b0
movabsq $0x200000000, %rcx      # imm = 0x200000000
addq %rcx, %rbx
sarq $0x20, %rbx
subl %r12d, %eax
shlq $0x20, %rax
movabsq $-0x200000000, %rcx     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3290
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3300
movq %r14, %rdi
callq 0x3120
movq %rbx, %rdi
pushq $0x20
popq %rsi
leaq 0x20(%rsp), %rdx
callq 0x4b96
movq 0x20(%rsp), %rbx
movq 0x28(%rsp), %rax
subq %rbx, %rax
cmpq $0x40, %rax
je 0x875e
movq 0xc898(%rip), %rdi      # 0x14fd8
leaq 0x5e29(%rip), %rsi      # 0xe570
callq 0x3270
movq %rax, %rdi
callq 0x3140
callq 0x41b8
movq 0x20(%rsp), %rbx
movq (%rbx), %rdi
callq 0x33a0
movq 0x10(%rsp), %rcx
movq (%rcx), %r14
movq 0xc0(%rsp), %r12
movw %ax, (%r14,%r12)
movq 0x20(%rbx), %rdi
callq 0x33a0
movw %ax, 0x2(%r14,%r12)
leaq 0x20(%rsp), %rdi
callq 0x98a4
jmp 0x82fa
leaq 0x280(%rsp), %rdi
callq 0x3070
leaq 0x60(%rsp), %rdi
callq 0x98ac
leaq 0x80(%rsp), %rdi
callq 0x98ac
leaq 0xa0(%rsp), %rdi
callq 0x98ac
leaq 0x20(%rsp), %rdi
callq 0x98ac
leaq 0xe0(%rsp), %rdi
callq 0x3120
leaq 0x40(%rsp), %rdi
callq 0x3120
leaq 0x280(%rsp), %rdi
callq 0x30a0
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8831
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x3130
jmp 0x8862
jmp 0x8820
movq %rax, %rbx
jmp 0x8862
jmp 0x8831
jmp 0x8831
jmp 0x8831
jmp 0x8831
jmp 0x8831
jmp 0x8831
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x98ac
leaq 0x80(%rsp), %rdi
callq 0x98ac
leaq 0xa0(%rsp), %rdi
callq 0x98ac
leaq 0x20(%rsp), %rdi
callq 0x98ac
leaq 0xe0(%rsp), %rdi
callq 0x3120
leaq 0x40(%rsp), %rdi
callq 0x3120
leaq 0x280(%rsp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x3430