// File: /workspace/github_cpp_makefile_star2_O1/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 $0x498, %rsp            # imm = 0x498
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %rsi
leaq 0x290(%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 0xd8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x308(%rsp), %rdi
callq 0x3080
testb %al, %al
jne 0xa509
movq 0xbb22(%rip), %rdi      # 0x15fd8
leaq 0x6104(%rip), %rsi      # 0x105c1
movl $0xc, %edx
callq 0x32e0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0xbb03(%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 0x48f8
leaq 0xa8(%rbx), %rdi
movslq 0xc(%rbx), %rsi
movq %rdi, 0xb0(%rsp)
callq 0xcb64
movq 0x290(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %edx
leaq 0x290(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x34a0
leaq 0x110(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x8, %edx
callq 0x3430
addq $0x8, %rbx
leaq 0x110(%rsp), %rdi
movq %rbx, %rsi
callq 0x3170
movq 0xba4f(%rip), %rsi      # 0x15fd0
leaq 0x110(%rsp), %rdi
callq 0x3360
leaq 0x188(%rsp), %rdi
callq 0x30e0
xorl %eax, %eax
leaq 0x90(%rsp), %rcx
movq %rax, 0x10(%rcx)
xorps %xmm0, %xmm0
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)
leaq 0x30(%rsp), %rcx
movq %rax, 0x10(%rcx)
movaps %xmm0, (%rcx)
movq 0x290(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0x290(%rsp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %edx
leaq 0x290(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x34a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xac64
movl $0x1, %ecx
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
leaq 0x5e30(%rip), %rsi      # 0x1045f
xorl %edx, %edx
callq 0x3450
movq %rax, %r14
movl $0x1, %ecx
movq %rbx, %rdi
leaq 0x5f77(%rip), %rsi      # 0x105bf
xorl %edx, %edx
callq 0x3450
movq %rax, %r12
movslq %r14d, %rcx
leaq 0x110(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x32a0
movq 0x110(%rsp), %rbp
movq %rbp, %rdi
callq 0x33c0
movl %eax, %ebx
leaq 0x120(%rsp), %rax
cmpq %rax, %rbp
je 0xa691
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
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x32a0
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3310
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0xa6fe
callq 0x3260
movq %r14, %rdi
movl $0x20, %esi
leaq 0x70(%rsp), %rdx
callq 0x5666
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
leaq 0x110(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x32a0
leaq 0xc8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3310
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0xa7ad
callq 0x3260
movq %r12, %rdi
movl $0x20, %esi
leaq 0x50(%rsp), %rdx
callq 0x5666
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 0x110(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x32a0
movq %r13, 0xf8(%rsp)
leaq 0xc8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3310
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0xa864
callq 0x3260
movq %r15, %rdi
movl $0x20, %esi
leaq 0x30(%rsp), %rdx
callq 0x5666
movq 0x70(%rsp), %r13
movq 0x78(%rsp), %r15
movq %r15, 0x8(%rsp)
subq %r13, %r15
sarq $0x5, %r15
movslq %ebx, %r14
movq 0xb0(%rsp), %rax
movq (%rax), %rbp
shlq $0x4, %r14
movb %r15b, 0x4(%rbp,%r14)
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %r12
movq %r12, 0x100(%rsp)
movq %rax, 0xb8(%rsp)
subq %rax, %r12
sarq $0x5, %r12
leal (%r12,%r15), %eax
movb %al, 0x5(%rbp,%r14)
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
movq %rdx, 0x108(%rsp)
movq %rcx, 0xc0(%rsp)
subq %rcx, %rdx
sarq $0x5, %rdx
movq %rdx, 0xe8(%rsp)
addl %edx, %eax
movb %al, 0x6(%rbp,%r14)
movzbl %al, %edi
shll $0x2, %edi
callq 0x3030
movq %rax, %rbx
addq %r14, %rbp
movq %rax, 0x8(%rbp)
cmpq %r13, 0x8(%rsp)
movq %rbp, 0x8(%rsp)
je 0xa947
cmpq $0x1, %r15
adcq $0x0, %r15
xorl %ebp, %ebp
movq (%r13), %rdi
callq 0x33c0
movl %eax, (%rbx,%rbp,4)
incq %rbp
addq $0x20, %r13
cmpq %rbp, %r15
jne 0xa928
movq 0x8(%rsp), %rax
jmp 0xa94c
movq %rbp, %rax
xorl %ebp, %ebp
movq %r14, 0xf0(%rsp)
movq 0xb8(%rsp), %rcx
cmpq %rcx, 0x100(%rsp)
je 0xa9a8
cmpq $0x1, %r12
movl $0x0, %r13d
sbbq %r12, %r13
movl %ebp, %ebp
leaq (%rbx,%rbp,4), %r12
xorl %r15d, %r15d
xorl %r14d, %r14d
movq (%rcx,%r14,8), %rdi
callq 0x33c0
movq 0xb8(%rsp), %rcx
movl %eax, (%r12,%r14)
addq $0x4, %r14
decq %r15
cmpq %r15, %r13
jne 0xa97f
subl %r15d, %ebp
movq 0x8(%rsp), %rax
movq 0xc0(%rsp), %rcx
cmpq %rcx, 0x108(%rsp)
leaq 0x110(%rsp), %r13
je 0xaa0a
movq 0xe8(%rsp), %rax
cmpq $0x1, %rax
movl $0x0, %r14d
sbbq %rax, %r14
movl %ebp, %ebp
leaq (%rbx,%rbp,4), %r15
xorl %ebx, %ebx
xorl %r12d, %r12d
movq (%rcx,%r12,8), %rdi
callq 0x33c0
movq 0xc0(%rsp), %rcx
movl %eax, (%r15,%r12)
addq $0x4, %r12
decq %rbx
cmpq %rbx, %r14
jne 0xa9e2
subl %ebx, %ebp
movq 0x8(%rsp), %rax
movzbl 0x6(%rax), %eax
cmpl %eax, %ebp
leaq 0xc8(%rsp), %r12
movq 0xb5b9(%rip), %rbp      # 0x15fd8
je 0xaa5d
movl $0x11, %edx
movq %rbp, %rdi
leaq 0x5b9e(%rip), %rsi      # 0x105ce
callq 0x32e0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq 0x70(%rsp), %rbx
movq 0x78(%rsp), %r14
cmpq %rbx, %r14
je 0xaa8e
movq %rbx, %r15
movq (%r15), %rdi
addq $0x10, %r15
cmpq %r15, %rdi
je 0xaa80
callq 0x3260
addq $0x10, %r15
cmpq %r14, %r15
jne 0xaa6f
movq %rbx, 0x78(%rsp)
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %r14
cmpq %rbx, %r14
je 0xaabf
movq %rbx, %r15
movq (%r15), %rdi
addq $0x10, %r15
cmpq %r15, %rdi
je 0xaab1
callq 0x3260
addq $0x10, %r15
cmpq %r14, %r15
jne 0xaaa0
movq %rbx, 0x58(%rsp)
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
cmpq %rbx, %r14
je 0xaaf0
movq %rbx, %r15
movq (%r15), %rdi
addq $0x10, %r15
cmpq %r15, %rdi
je 0xaae2
callq 0x3260
addq $0x10, %r15
cmpq %r14, %r15
jne 0xaad1
movq %rbx, 0x38(%rsp)
movq 0xf8(%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 0x5a9a(%rip), %rsi      # 0x105bf
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 %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x32a0
movq %r12, %rdi
movq %r13, %rsi
callq 0x3310
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0xab86
callq 0x3260
movq %r12, %rdi
movl $0x20, %esi
leaq 0x90(%rsp), %rdx
callq 0x5666
movq 0x98(%rsp), %rax
subq 0x90(%rsp), %rax
cmpq $0x40, %rax
je 0xabf2
movl $0x10, %edx
movq %rbp, %rdi
leaq 0x5a20(%rip), %rsi      # 0x105e0
callq 0x32e0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
callq 0x48f8
movq 0x90(%rsp), %rbx
movq (%rbx), %rdi
callq 0x33c0
movq 0xb0(%rsp), %rcx
movq (%rcx), %r14
movq 0xf0(%rsp), %r15
movw %ax, (%r14,%r15)
movq 0x20(%rbx), %rdi
callq 0x33c0
movw %ax, 0x2(%r14,%r15)
movq 0x98(%rsp), %r14
cmpq %rbx, %r14
je 0xa5d3
movq %rbx, %r15
movq (%r15), %rdi
addq $0x10, %r15
cmpq %r15, %rdi
je 0xac4e
callq 0x3260
addq $0x10, %r15
cmpq %r14, %r15
jne 0xac3d
movq %rbx, 0x98(%rsp)
jmp 0xa5d3
leaq 0x290(%rsp), %rdi
callq 0x3070
leaq 0x30(%rsp), %rdi
callq 0xc272
leaq 0x50(%rsp), %rdi
callq 0xc272
leaq 0x70(%rsp), %rdi
callq 0xc272
leaq 0x90(%rsp), %rdi
callq 0xc272
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %rbx
je 0xacbb
callq 0x3260
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0xacca
callq 0x3260
leaq 0x290(%rsp), %rdi
callq 0x3090
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xad24
movq %rax, %rbx
movq 0xb2db(%rip), %rsi      # 0x15fd0
leaq 0x110(%rsp), %rdi
callq 0x3360
leaq 0x188(%rsp), %rdi
callq 0x30e0
jmp 0xad52
jmp 0xad13
movq %rax, %rbx
jmp 0xad52
jmp 0xad24
jmp 0xad24
jmp 0xad24
jmp 0xad24
jmp 0xad24
jmp 0xad24
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xc272
leaq 0x50(%rsp), %rdi
callq 0xc272
leaq 0x70(%rsp), %rdi
callq 0xc272
leaq 0x90(%rsp), %rdi
callq 0xc272
leaq 0x20(%rsp), %r14
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0xad71
callq 0x3260
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xad80
callq 0x3260
leaq 0x290(%rsp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x3460
nop