// File: /workspace/github_cpp_makefile_star2_O3/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 $0x4a8, %rsp            # imm = 0x4A8
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %rsi
leaq 0x2a0(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x3490
leaq 0x20(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x40(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x318(%rsp), %rdi
callq 0x3080
testb %al, %al
jne 0xa3fa
movq 0xbc31(%rip), %rdi      # 0x15fd8
leaq 0x6203(%rip), %rsi      # 0x105b1
movl $0xc, %edx
callq 0x32e0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0xbc12(%rip), %rdi      # 0x15fd8
callq 0x32e0
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
callq 0x4948
leaq 0xa8(%rbx), %rdi
movslq 0xc(%rbx), %rsi
movq %rdi, 0xd0(%rsp)
callq 0xcada
movq 0x2a0(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %edx
leaq 0x2a0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x34a0
leaq 0x120(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x8, %edx
callq 0x3430
addq $0x8, %rbx
leaq 0x120(%rsp), %rdi
movq %rbx, %rsi
callq 0x3170
movq 0xbb5e(%rip), %rsi      # 0x15fd0
leaq 0x120(%rsp), %rbp
movq %rbp, %rdi
callq 0x3360
leaq 0x198(%rsp), %rdi
callq 0x30e0
xorl %eax, %eax
leaq 0xb0(%rsp), %rcx
movq %rax, 0x10(%rcx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rcx)
leaq 0x90(%rsp), %rcx
movq %rax, 0x10(%rcx)
movaps %xmm0, (%rcx)
leaq 0x70(%rsp), %rcx
movq %rax, 0x10(%rcx)
movaps %xmm0, (%rcx)
leaq 0x50(%rsp), %rcx
movq %rax, 0x10(%rcx)
movaps %xmm0, (%rcx)
movq 0x2a0(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0x2a0(%rsp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %edx
leaq 0x2a0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x34a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xab97
movl $0x1, %ecx
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
leaq 0x5f29(%rip), %rsi      # 0x1044f
xorl %edx, %edx
callq 0x3450
movq %rax, %r14
movl $0x1, %ecx
movq %rbx, %rdi
leaq 0x6070(%rip), %rsi      # 0x105af
xorl %edx, %edx
callq 0x3450
movq %rax, %r12
movslq %r14d, %rcx
movq %rbp, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x32a0
movq 0x120(%rsp), %rbp
movq %rbp, %rdi
callq 0x33c0
movl %eax, %ebx
leaq 0x130(%rsp), %rax
cmpq %rax, %rbp
je 0xa580
movq %rbp, %rdi
callq 0x3260
movq %r14, %rdx
shlq $0x20, %rdx
movabsq $0x200000000, %rax      # imm = 0x200000000
addq %rax, %rdx
sarq $0x20, %rdx
movl %r12d, %ecx
subl %r14d, %ecx
shlq $0x20, %rcx
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
leaq 0x120(%rsp), %r15
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x32a0
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x3310
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0xa5ef
callq 0x3260
leaq 0x30(%rsp), %rdi
movl $0x20, %esi
leaq 0x90(%rsp), %rdx
callq 0x5658
movq %r12, %rbp
shlq $0x20, %rbp
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%rax,%rbp), %rdx
sarq $0x20, %rdx
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl $0x23, %esi
callq 0x3330
movq %rax, %r14
movabsq $0x200000000, %rax      # imm = 0x200000000
addq %rax, %rbp
sarq $0x20, %rbp
movl %r14d, %ecx
subl %r12d, %ecx
shlq $0x20, %rcx
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x32a0
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x3310
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0xa695
callq 0x3260
leaq 0x30(%rsp), %rdi
movl $0x20, %esi
leaq 0x70(%rsp), %rdx
callq 0x5658
movq %r14, %r12
shlq $0x20, %r12
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%r12,%rax), %rdx
sarq $0x20, %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x23, %esi
callq 0x3330
movq %rax, %r13
movabsq $0x200000000, %rax      # imm = 0x200000000
addq %rax, %r12
sarq $0x20, %r12
movl %r13d, %ecx
subl %r14d, %ecx
shlq $0x20, %rcx
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
leaq 0x120(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x32a0
movq %r13, 0x100(%rsp)
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x3310
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0xa748
callq 0x3260
leaq 0x30(%rsp), %rdi
movl $0x20, %esi
leaq 0x50(%rsp), %rdx
callq 0x5658
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %r12
movq %r12, %r15
movq %rax, 0xd8(%rsp)
subq %rax, %r15
sarq $0x5, %r15
movslq %ebx, %r14
movq 0xd0(%rsp), %rax
movq (%rax), %rbp
shlq $0x4, %r14
movb %r15b, 0x4(%rbp,%r14)
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %r13
movq %r13, 0x110(%rsp)
movq %rax, 0xe0(%rsp)
subq %rax, %r13
sarq $0x5, %r13
leal (%r15,%r13), %eax
movb %al, 0x5(%rbp,%r14)
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %rdx
movq %rdx, 0x118(%rsp)
movq %rcx, 0xe8(%rsp)
subq %rcx, %rdx
sarq $0x5, %rdx
movq %rdx, 0xf0(%rsp)
addl %edx, %eax
movb %al, 0x6(%rbp,%r14)
movzbl %al, %edi
shll $0x2, %edi
callq 0x3030
movq %rax, %rbx
movq %r14, 0x108(%rsp)
addq %r14, %rbp
movq %rax, 0x8(%rbp)
movq %r12, 0xf8(%rsp)
movq 0xd8(%rsp), %rax
cmpq %rax, %r12
movq %rbp, 0x8(%rsp)
je 0xa85b
movq %rax, %r14
cmpq $0x1, %r15
adcq $0x0, %r15
xorl %r12d, %r12d
movq (%r14), %rdi
callq 0x33c0
movl %eax, (%rbx,%r12,4)
incq %r12
addq $0x20, %r14
cmpq %r12, %r15
jne 0xa834
leaq 0x120(%rsp), %rbp
movq 0x8(%rsp), %rax
jmp 0xa869
movq %rbp, %rax
xorl %r15d, %r15d
leaq 0x120(%rsp), %rbp
movq 0xe0(%rsp), %rcx
cmpq %rcx, 0x110(%rsp)
je 0xa8c5
cmpq $0x1, %r13
movl $0x0, %r12d
sbbq %r13, %r12
movl %r15d, %r15d
leaq (%rbx,%r15,4), %r14
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%rcx,%rbp,8), %rdi
callq 0x33c0
movq 0xe0(%rsp), %rcx
movl %eax, (%r14,%rbp)
addq $0x4, %rbp
decq %r13
cmpq %r13, %r12
jne 0xa894
subl %r13d, %r15d
leaq 0x120(%rsp), %rbp
movq 0x8(%rsp), %rax
movq 0xe8(%rsp), %rcx
cmpq %rcx, 0x118(%rsp)
je 0xa921
movq 0xf0(%rsp), %rax
cmpq $0x1, %rax
movl $0x0, %r12d
sbbq %rax, %r12
movl %r15d, %r15d
leaq (%rbx,%r15,4), %r14
xorl %ebx, %ebx
xorl %r13d, %r13d
movq (%rcx,%r13,8), %rdi
callq 0x33c0
movq 0xe8(%rsp), %rcx
movl %eax, (%r14,%r13)
addq $0x4, %r13
decq %rbx
cmpq %rbx, %r12
jne 0xa8f8
subl %ebx, %r15d
movq 0x8(%rsp), %rax
movzbl 0x6(%rax), %eax
cmpl %eax, %r15d
movq 0xb6a9(%rip), %r12      # 0x15fd8
movq 0x108(%rsp), %r13
movq 0xd8(%rsp), %rbx
movq 0xf8(%rsp), %r15
je 0xa995
movl $0x11, %edx
movq %r12, %rdi
leaq 0x5c66(%rip), %rsi      # 0x105be
callq 0x32e0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq 0x90(%rsp), %rbx
movq 0x98(%rsp), %r15
cmpq %rbx, %r15
je 0xa9bf
movq %rbx, %r14
movq (%rbx), %rdi
addq $0x10, %rbx
cmpq %rbx, %rdi
je 0xa9ae
callq 0x3260
addq $0x10, %rbx
cmpq %r15, %rbx
jne 0xa99d
movq %r14, 0x98(%rsp)
movq 0x70(%rsp), %rbx
movq 0x78(%rsp), %r14
cmpq %rbx, %r14
je 0xa9f0
movq %rbx, %r15
movq (%r15), %rdi
addq $0x10, %r15
cmpq %r15, %rdi
je 0xa9e2
callq 0x3260
addq $0x10, %r15
cmpq %r14, %r15
jne 0xa9d1
movq %rbx, 0x78(%rsp)
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %r14
cmpq %rbx, %r14
je 0xaa21
movq %rbx, %r15
movq (%r15), %rdi
addq $0x10, %r15
cmpq %r15, %rdi
je 0xaa13
callq 0x3260
addq $0x10, %r15
cmpq %r14, %r15
jne 0xaa02
movq %rbx, 0x58(%rsp)
movq 0x100(%rsp), %r15
movq %r15, %rbx
shlq $0x20, %rbx
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%rbx,%rax), %rdx
sarq $0x20, %rdx
movl $0x1, %ecx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
leaq 0x5b59(%rip), %rsi      # 0x105af
callq 0x3450
movabsq $0x200000000, %rcx      # imm = 0x200000000
addq %rcx, %rbx
sarq $0x20, %rbx
subl %r15d, %eax
shlq $0x20, %rax
movabsq $-0x200000000, %rcx     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x32a0
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x3310
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0xaab9
callq 0x3260
leaq 0x30(%rsp), %rdi
movl $0x20, %esi
leaq 0xb0(%rsp), %rdx
callq 0x5658
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
movq %r14, %rax
subq %rbx, %rax
cmpq $0x40, %rax
je 0xab3d
movl $0x10, %edx
movq %r12, %rdi
leaq 0x5ad5(%rip), %rsi      # 0x105d0
callq 0x32e0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
callq 0x4948
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
movq (%rbx), %rdi
callq 0x33c0
movq 0xd0(%rsp), %rcx
movq (%rcx), %r15
movw %ax, (%r15,%r13)
movq 0x20(%rbx), %rdi
callq 0x33c0
movw %ax, 0x2(%r15,%r13)
cmpq %rbx, %r14
je 0xa4ca
movq %rbx, %r15
movq (%r15), %rdi
addq $0x10, %r15
cmpq %r15, %rdi
je 0xab81
callq 0x3260
addq $0x10, %r15
cmpq %r14, %r15
jne 0xab70
movq %rbx, 0xb8(%rsp)
jmp 0xa4ca
leaq 0x2a0(%rsp), %rdi
callq 0x3070
leaq 0x50(%rsp), %rdi
callq 0xc1a8
leaq 0x70(%rsp), %rdi
callq 0xc1a8
leaq 0x90(%rsp), %rdi
callq 0xc1a8
leaq 0xb0(%rsp), %rdi
callq 0xc1a8
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %rbx
je 0xabeb
callq 0x3260
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0xabfa
callq 0x3260
leaq 0x2a0(%rsp), %rdi
callq 0x3090
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xac54
movq %rax, %rbx
movq 0xb3ab(%rip), %rsi      # 0x15fd0
leaq 0x120(%rsp), %rdi
callq 0x3360
leaq 0x198(%rsp), %rdi
callq 0x30e0
jmp 0xac85
jmp 0xac43
movq %rax, %rbx
jmp 0xac85
jmp 0xac54
jmp 0xac54
jmp 0xac54
jmp 0xac54
jmp 0xac54
jmp 0xac54
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xc1a8
leaq 0x70(%rsp), %rdi
callq 0xc1a8
leaq 0x90(%rsp), %rdi
callq 0xc1a8
leaq 0xb0(%rsp), %rdi
callq 0xc1a8
leaq 0x20(%rsp), %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xac9e
callq 0x3260
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xacad
callq 0x3260
leaq 0x2a0(%rsp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x3460