// File: 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:
subq $0x638, %rsp            # imm = 0x638
movq %rdi, 0x630(%rsp)
movq %rsi, 0x628(%rsp)
movq 0x630(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0x628(%rsp), %rdi
callq 0x3120
movq %rax, %rsi
leaq 0x420(%rsp), %rdi
movq %rdi, 0x120(%rsp)
movl $0x8, %edx
callq 0x3510
leaq 0x400(%rsp), %rdi
callq 0x33e0
leaq 0x3e0(%rsp), %rdi
callq 0x33e0
movq 0x120(%rsp), %rdi
callq 0x3460
movb %al, 0x12f(%rsp)
jmp 0xe121
movb 0x12f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xe1a6
movq 0x26e9f(%rip), %rdi     # 0x34fd8
leaq 0x1a411(%rip), %rsi     # 0x28551
callq 0x32c0
movq %rax, 0x110(%rsp)
jmp 0xe14f
movq 0x110(%rsp), %rdi
movq 0x628(%rsp), %rsi
callq 0x3270
movq %rax, 0x108(%rsp)
jmp 0xe16e
movq 0x108(%rsp), %rdi
movq 0x26e4b(%rip), %rsi     # 0x34fc8
callq 0x3300
jmp 0xe184
callq 0x4da0
jmp 0xe18b
jmp 0xe1a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d8(%rsp)
movl %eax, 0x3d4(%rsp)
jmp 0xebf4
movq 0x118(%rsp), %rax
movq %rax, %rdi
addq $0xa8, %rdi
movslq 0xc(%rax), %rsi
callq 0x14210
jmp 0xe1c3
leaq 0x420(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x3070
jmp 0xe1da
leaq 0x250(%rsp), %rdi
leaq 0x400(%rsp), %rsi
movl $0x8, %edx
callq 0x34b0
jmp 0xe1f6
movq 0x118(%rsp), %rsi
addq $0x8, %rsi
leaq 0x250(%rsp), %rdi
callq 0x11c30
jmp 0xe211
leaq 0x250(%rsp), %rdi
callq 0x3150
leaq 0x228(%rsp), %rdi
callq 0x11d10
leaq 0x210(%rsp), %rdi
callq 0x11d10
leaq 0x1f8(%rsp), %rdi
callq 0x11d10
leaq 0x1e0(%rsp), %rdi
callq 0x11d10
leaq 0x420(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x3070
movq %rax, 0x100(%rsp)
jmp 0xe271
movq 0x100(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3380
movb %al, 0xff(%rsp)
jmp 0xe291
movb 0xff(%rsp), %al
testb $0x1, %al
jne 0xe2a1
jmp 0xeb82
leaq 0x1a147(%rip), %rsi     # 0x283ef
xorl %eax, %eax
movl %eax, %edx
movq %rdx, 0xf0(%rsp)
leaq 0x400(%rsp), %rdi
movq %rdi, 0xe8(%rsp)
callq 0x3580
movq 0xe8(%rsp), %rdi
movq 0xf0(%rsp), %rdx
movl %eax, 0x24c(%rsp)
leaq 0x1a268(%rip), %rsi     # 0x2854f
callq 0x3580
movq 0xe8(%rsp), %rsi
movq 0xf0(%rsp), %rdx
movl %eax, 0x248(%rsp)
movslq 0x24c(%rsp), %rcx
leaq 0x1c0(%rsp), %rdi
callq 0x32e0
jmp 0xe31a
leaq 0x1c0(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0x3120
movq %rax, %rdi
callq 0x3440
movq 0xe0(%rsp), %rdi
movl %eax, 0x244(%rsp)
callq 0x31b0
movl 0x24c(%rsp), %ecx
movl %ecx, %eax
addl $0x2, %eax
movslq %eax, %rdx
movl 0x248(%rsp), %eax
subl %ecx, %eax
addl $-0x2, %eax
movslq %eax, %rcx
leaq 0x1a0(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x32e0
jmp 0xe380
leaq 0x3e0(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
leaq 0x1a0(%rsp), %rsi
movq %rsi, 0xd0(%rsp)
callq 0x3370
movq 0xd0(%rsp), %rdi
callq 0x31b0
movq 0xd8(%rsp), %rdi
movl $0x20, %esi
leaq 0x210(%rsp), %rdx
callq 0x6000
jmp 0xe3ce
movl 0x248(%rsp), %eax
movl %eax, 0x24c(%rsp)
movl 0x248(%rsp), %eax
incl %eax
movslq %eax, %rdx
leaq 0x400(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
movl $0x23, %esi
callq 0x33a0
movq 0xc8(%rsp), %rsi
movl %eax, 0x248(%rsp)
movl 0x24c(%rsp), %ecx
movl %ecx, %eax
addl $0x2, %eax
movslq %eax, %rdx
movl 0x248(%rsp), %eax
subl %ecx, %eax
addl $-0x2, %eax
movslq %eax, %rcx
leaq 0x180(%rsp), %rdi
callq 0x32e0
jmp 0xe43e
leaq 0x3e0(%rsp), %rdi
movq %rdi, 0xc0(%rsp)
leaq 0x180(%rsp), %rsi
movq %rsi, 0xb8(%rsp)
callq 0x3370
movq 0xb8(%rsp), %rdi
callq 0x31b0
movq 0xc0(%rsp), %rdi
movl $0x20, %esi
leaq 0x1f8(%rsp), %rdx
callq 0x6000
jmp 0xe48c
movl 0x248(%rsp), %eax
movl %eax, 0x24c(%rsp)
movl 0x248(%rsp), %eax
incl %eax
movslq %eax, %rdx
leaq 0x400(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
movl $0x23, %esi
callq 0x33a0
movq 0xb0(%rsp), %rsi
movl %eax, 0x248(%rsp)
movl 0x24c(%rsp), %ecx
movl %ecx, %eax
addl $0x2, %eax
movslq %eax, %rdx
movl 0x248(%rsp), %eax
subl %ecx, %eax
addl $-0x2, %eax
movslq %eax, %rcx
leaq 0x160(%rsp), %rdi
callq 0x32e0
jmp 0xe4fc
leaq 0x3e0(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
leaq 0x160(%rsp), %rsi
movq %rsi, 0xa0(%rsp)
callq 0x3370
movq 0xa0(%rsp), %rdi
callq 0x31b0
movq 0xa8(%rsp), %rdi
movl $0x20, %esi
leaq 0x1e0(%rsp), %rdx
callq 0x6000
jmp 0xe54a
leaq 0x210(%rsp), %rdi
callq 0x11d20
movq 0x118(%rsp), %rdi
movb %al, 0x6f(%rsp)
addq $0xa8, %rdi
movq %rdi, 0x90(%rsp)
movslq 0x244(%rsp), %rsi
callq 0x142b0
movb 0x6f(%rsp), %cl
movb %cl, 0x4(%rax)
leaq 0x1f8(%rsp), %rdi
callq 0x11d20
movq 0x90(%rsp), %rdi
movq %rax, 0x70(%rsp)
movslq 0x244(%rsp), %rsi
callq 0x142b0
movq 0x90(%rsp), %rdi
movq %rax, %rcx
movq 0x70(%rsp), %rax
movl 0x4(%rcx), %ecx
addl %ecx, %eax
movb %al, 0x7f(%rsp)
movslq 0x244(%rsp), %rsi
callq 0x142b0
movb 0x7f(%rsp), %cl
movb %cl, 0x5(%rax)
leaq 0x1e0(%rsp), %rdi
callq 0x11d20
movq 0x90(%rsp), %rdi
movq %rax, 0x80(%rsp)
movslq 0x244(%rsp), %rsi
callq 0x142b0
movq 0x90(%rsp), %rdi
movq %rax, %rcx
movq 0x80(%rsp), %rax
movzbl 0x5(%rcx), %ecx
addl %ecx, %eax
movb %al, 0x8f(%rsp)
movslq 0x244(%rsp), %rsi
callq 0x142b0
movb 0x8f(%rsp), %cl
movq 0x90(%rsp), %rdi
movb %cl, 0x6(%rax)
movslq 0x244(%rsp), %rsi
callq 0x142b0
movzbl 0x6(%rax), %eax
shll $0x2, %eax
movl %eax, %edi
callq 0x3030
movq %rax, 0x98(%rsp)
jmp 0xe668
movq 0x118(%rsp), %rdi
addq $0xa8, %rdi
movslq 0x244(%rsp), %rsi
callq 0x142b0
movq 0x98(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl $0x0, 0x15c(%rsp)
movl $0x0, 0x158(%rsp)
movslq 0x158(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x210(%rsp), %rdi
callq 0x11d20
movq %rax, %rcx
movq 0x60(%rsp), %rax
cmpq %rcx, %rax
jae 0xe7d1
movslq 0x158(%rsp), %rsi
leaq 0x210(%rsp), %rdi
callq 0x11e90
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3440
movq 0x118(%rsp), %rdi
movl %eax, 0x240(%rsp)
movl 0x240(%rsp), %eax
movl %eax, 0x5c(%rsp)
addq $0xa8, %rdi
movslq 0x244(%rsp), %rsi
callq 0x142b0
movl 0x5c(%rsp), %edx
movq 0x8(%rax), %rax
movslq 0x15c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x158(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x158(%rsp)
movl 0x15c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x15c(%rsp)
jmp 0xe6a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d8(%rsp)
movl %eax, 0x3d4(%rsp)
leaq 0x250(%rsp), %rdi
callq 0x3150
jmp 0xebf4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3d8(%rsp)
movl %eax, 0x3d4(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x11ed0
leaq 0x1f8(%rsp), %rdi
callq 0x11ed0
leaq 0x210(%rsp), %rdi
callq 0x11ed0
leaq 0x228(%rsp), %rdi
callq 0x11ed0
jmp 0xebf4
movl $0x0, 0x154(%rsp)
movslq 0x154(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x1f8(%rsp), %rdi
callq 0x11d20
movq %rax, %rcx
movq 0x50(%rsp), %rax
cmpq %rcx, %rax
jae 0xe894
movslq 0x154(%rsp), %rsi
leaq 0x1f8(%rsp), %rdi
callq 0x11e90
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3440
movq 0x118(%rsp), %rdi
movl %eax, 0x240(%rsp)
movl 0x240(%rsp), %eax
movl %eax, 0x4c(%rsp)
addq $0xa8, %rdi
movslq 0x244(%rsp), %rsi
callq 0x142b0
movl 0x4c(%rsp), %edx
movq 0x8(%rax), %rax
movslq 0x15c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x154(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x154(%rsp)
movl 0x15c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x15c(%rsp)
jmp 0xe7dc
movl $0x0, 0x150(%rsp)
movslq 0x150(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x11d20
movq %rax, %rcx
movq 0x40(%rsp), %rax
cmpq %rcx, %rax
jae 0xe957
movslq 0x150(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x11e90
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3440
movq 0x118(%rsp), %rdi
movl %eax, 0x240(%rsp)
movl 0x240(%rsp), %eax
movl %eax, 0x3c(%rsp)
addq $0xa8, %rdi
movslq 0x244(%rsp), %rsi
callq 0x142b0
movl 0x3c(%rsp), %edx
movq 0x8(%rax), %rax
movslq 0x15c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x150(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x150(%rsp)
movl 0x15c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x15c(%rsp)
jmp 0xe89f
movq 0x118(%rsp), %rdi
movl 0x15c(%rsp), %eax
movl %eax, 0x38(%rsp)
addq $0xa8, %rdi
movslq 0x244(%rsp), %rsi
callq 0x142b0
movq %rax, %rcx
movl 0x38(%rsp), %eax
movzbl 0x6(%rcx), %ecx
cmpl %ecx, %eax
je 0xe9bc
movq 0x26644(%rip), %rdi     # 0x34fd8
leaq 0x19bc3(%rip), %rsi     # 0x2855e
callq 0x32c0
movq %rax, 0x30(%rsp)
jmp 0xe9a7
movq 0x30(%rsp), %rdi
movq 0x26615(%rip), %rsi     # 0x34fc8
callq 0x3300
jmp 0xe9ba
jmp 0xe9bc
leaq 0x210(%rsp), %rdi
callq 0x11eb0
leaq 0x1f8(%rsp), %rdi
callq 0x11eb0
leaq 0x1e0(%rsp), %rdi
callq 0x11eb0
movl 0x248(%rsp), %eax
movl %eax, 0x24c(%rsp)
movl 0x248(%rsp), %eax
incl %eax
movslq %eax, %rdx
leaq 0x19b4b(%rip), %rsi     # 0x2854f
leaq 0x400(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x3580
movq 0x28(%rsp), %rsi
movl %eax, 0x248(%rsp)
movl 0x24c(%rsp), %ecx
movl %ecx, %eax
addl $0x2, %eax
movslq %eax, %rdx
movl 0x248(%rsp), %eax
subl %ecx, %eax
addl $-0x2, %eax
movslq %eax, %rcx
leaq 0x130(%rsp), %rdi
callq 0x32e0
jmp 0xea4f
leaq 0x3e0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
leaq 0x130(%rsp), %rsi
movq %rsi, 0x18(%rsp)
callq 0x3370
movq 0x18(%rsp), %rdi
callq 0x31b0
movq 0x20(%rsp), %rdi
movl $0x20, %esi
leaq 0x228(%rsp), %rdx
callq 0x6000
jmp 0xea91
leaq 0x228(%rsp), %rdi
callq 0x11d20
cmpq $0x2, %rax
je 0xeada
movq 0x2652d(%rip), %rdi     # 0x34fd8
leaq 0x19abe(%rip), %rsi     # 0x28570
callq 0x32c0
movq %rax, 0x10(%rsp)
jmp 0xeabe
movq 0x10(%rsp), %rdi
movq 0x264fe(%rip), %rsi     # 0x34fc8
callq 0x3300
jmp 0xead1
callq 0x4da0
jmp 0xead8
jmp 0xeada
leaq 0x228(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11e90
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3440
movq 0x118(%rsp), %rdi
movw %ax, 0xc(%rsp)
addq $0xa8, %rdi
movslq 0x244(%rsp), %rsi
callq 0x142b0
movw 0xc(%rsp), %cx
movw %cx, (%rax)
leaq 0x228(%rsp), %rdi
movl $0x1, %esi
callq 0x11e90
movq %rax, %rdi
callq 0x3120
movq %rax, %rdi
callq 0x3440
movq 0x118(%rsp), %rdi
movw %ax, 0xe(%rsp)
addq $0xa8, %rdi
movslq 0x244(%rsp), %rsi
callq 0x142b0
movw 0xe(%rsp), %cx
movw %cx, 0x2(%rax)
leaq 0x228(%rsp), %rdi
callq 0x11eb0
jmp 0xe252
leaq 0x420(%rsp), %rdi
callq 0x3080
jmp 0xeb91
leaq 0x1e0(%rsp), %rdi
callq 0x11ed0
leaq 0x1f8(%rsp), %rdi
callq 0x11ed0
leaq 0x210(%rsp), %rdi
callq 0x11ed0
leaq 0x228(%rsp), %rdi
callq 0x11ed0
leaq 0x3e0(%rsp), %rdi
callq 0x31b0
leaq 0x400(%rsp), %rdi
callq 0x31b0
leaq 0x420(%rsp), %rdi
callq 0x30b0
addq $0x638, %rsp            # imm = 0x638
retq
leaq 0x3e0(%rsp), %rdi
callq 0x31b0
leaq 0x400(%rsp), %rdi
callq 0x31b0
leaq 0x420(%rsp), %rdi
callq 0x30b0
movq 0x3d8(%rsp), %rdi
callq 0x34e0
nopl (%rax,%rax)