// File: /workspace/github_cpp_makefile_star2_O2/datourat[P]IP-label-for-graph-reachability/Graph.cpp
// Function: Graph::SubComputeProLabelIn(int)
void Graph::SubComputeProLabelIn(int v){
	int edgelistsize=graph[v].inList.size();
	int u;
	int tmpi;
	int tmpvalue;
	vector<int>::iterator tmpiter;
	static vector< vector<int>::iterator > iterend;
	static vector< pair<int, vector<int>::iterator> > iterlist;
	static vector<int> label(KEYNUM);

	label.clear();
	iterend.clear();
	iterlist.clear();

	iterlist.push_back(make_pair(0, ProLabelIn[v].begin()));
	iterend.push_back(ProLabelIn[v].end());
/*
	for(int i=0; i<edgelistsize; i++){
		u=graph[v].inList[i];
		iterlist.push_back( make_pair(i+1, ProLabelIn[u].begin()) );
		iterend.push_back(ProLabelIn[u].end());
	}
*/
	int i=1;
	for(vector<int>::iterator it=graph[v].inList.begin(); it!=graph[v].inList.end(); i++, it++){
		iterlist.push_back( make_pair(i, ProLabelIn[*it].begin()) );
                iterend.push_back(ProLabelIn[*it].end());
	}

	int k=0;
	make_heap(iterlist.begin(), iterlist.end(), PairComparePointer<int, vector<int>::iterator> ());
	tmpi=iterlist.front().first;
	tmpiter=iterlist.front().second;
	label.push_back( *(tmpiter) );
	k++;
	tmpvalue=*tmpiter;
	pop_heap(iterlist.begin(), iterlist.end(),  PairComparePointer<int, vector<int>::iterator> ());
	tmpiter++;
	if(tmpiter==iterend[tmpi]){
		iterlist.pop_back();
	}else{
		iterlist[iterlist.size()-1].second=tmpiter;
		push_heap(iterlist.begin(), iterlist.end(),  PairComparePointer<int, vector<int>::iterator> ());
	}

	while(k<KEYNUM && iterlist.empty()==false){
		tmpi=iterlist.front().first;
		tmpiter=iterlist.front().second;
		if(tmpvalue < *tmpiter){
			label.push_back( *(tmpiter) );
			k++;
			tmpvalue=*tmpiter;
		}else if(tmpvalue > *tmpiter){
			cout << "Something must be wrong! " << endl;
			quit();
		}
		pop_heap(iterlist.begin(), iterlist.end(),  PairComparePointer<int, vector<int>::iterator> ());
		tmpiter++;
		if(tmpiter==iterend[tmpi]){
			iterlist.pop_back();
		}else{
			iterlist[iterlist.size()-1].second=tmpiter;
			push_heap(iterlist.begin(), iterlist.end(),  PairComparePointer<int, vector<int>::iterator> ());
		}
	}

	ProLabelIn[v]=label;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movb 0xd71b(%rip), %al       # 0x15330
testb %al, %al
je 0x7ead
movb 0xd72d(%rip), %al       # 0x15350
testb %al, %al
je 0x7efe
movb 0xd73f(%rip), %al       # 0x15370
testb %al, %al
je 0x7f4f
movq 0xd718(%rip), %rax      # 0x15358
cmpq %rax, 0xd719(%rip)      # 0x15360
je 0x7c50
movq %rax, 0xd710(%rip)      # 0x15360
movq 0xd6c1(%rip), %rax      # 0x15318
cmpq %rax, 0xd6c2(%rip)      # 0x15320
je 0x7c67
movq %rax, 0xd6b9(%rip)      # 0x15320
movslq %ebp, %r14
movq 0xd6c7(%rip), %rax      # 0x15338
cmpq %rax, 0xd6c8(%rip)      # 0x15340
je 0x7c81
movq %rax, 0xd6bf(%rip)      # 0x15340
movq 0x90(%rbx), %rax
imulq $0x18, %r14, %r12
movq (%rax,%r12), %rax
movq %rsp, %r15
andl $0x0, (%r15)
movq %rax, 0x8(%r15)
leaq 0xd696(%rip), %rdi      # 0x15338
movq %r15, %rsi
callq 0xcc3a
movq 0x90(%rbx), %rax
movq %r12, 0x10(%rsp)
movq 0x8(%rax,%r12), %rax
movq %rax, (%r15)
leaq 0xd653(%rip), %r13      # 0x15318
movq %rsp, %rsi
movq %r13, %rdi
callq 0xcd96
movq 0x48(%rbx), %rax
imulq $0x30, %r14, %r14
movq (%rax,%r14), %rbp
pushq $0x1
popq %r12
cmpq 0x8(%rax,%r14), %rbp
je 0x7d42
movslq (%rbp), %rax
movq 0x90(%rbx), %rcx
imulq $0x18, %rax, %rax
movq (%rcx,%rax), %rax
movl %r12d, (%rsp)
movq %rax, 0x8(%rsp)
leaq 0xd62e(%rip), %rdi      # 0x15338
movq %r15, %rsi
callq 0xcc3a
movslq (%rbp), %rax
movq 0x90(%rbx), %rcx
imulq $0x18, %rax, %rax
movq 0x8(%rcx,%rax), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0xcd96
incl %r12d
addq $0x4, %rbp
movq 0x48(%rbx), %rax
jmp 0x7ce0
movq 0xd5ef(%rip), %rdi      # 0x15338
movq 0xd5f0(%rip), %rsi      # 0x15340
callq 0x9f7f
movq 0xd5dc(%rip), %rax      # 0x15338
movslq (%rax), %r14
movq 0x8(%rax), %r15
leaq 0xd5ee(%rip), %rdi      # 0x15358
movq %r15, %rsi
callq 0x9a0e
movl (%r15), %r12d
movq 0xd5bc(%rip), %rdi      # 0x15338
movq 0xd5bd(%rip), %rsi      # 0x15340
callq 0x9f8c
addq $0x4, %r15
movq 0xd585(%rip), %rcx      # 0x15318
movq 0xd5a6(%rip), %rax      # 0x15340
cmpq (%rcx,%r14,8), %r15
je 0x7db9
movq %r15, -0x8(%rax)
movq 0xd58d(%rip), %rdi      # 0x15338
movq 0xd58e(%rip), %rsi      # 0x15340
callq 0x9faf
jmp 0x7dc4
addq $-0x10, %rax
movq %rax, 0xd57c(%rip)      # 0x15340
pushq $0x1
popq %r13
leaq 0xd589(%rip), %r15      # 0x15358
cmpl (%rbx), %r13d
jge 0x7e86
movq 0xd559(%rip), %rax      # 0x15338
cmpq 0xd55a(%rip), %rax      # 0x15340
je 0x7e86
movslq (%rax), %r14
movq 0x8(%rax), %rbp
cmpl (%rbp), %r12d
jge 0x7e0d
movq %r15, %rdi
movq %rbp, %rsi
callq 0x9a0e
incl %r13d
movl (%rbp), %r12d
jmp 0x7e2f
jle 0x7e2f
movq 0xd1c2(%rip), %rdi      # 0x14fd8
leaq 0x6706(%rip), %rsi      # 0xe523
callq 0x3270
movq %rax, %rdi
callq 0x3140
callq 0x41b8
movq 0xd502(%rip), %rdi      # 0x15338
movq 0xd503(%rip), %rsi      # 0x15340
callq 0x9f8c
addq $0x4, %rbp
movq 0xd4cb(%rip), %rcx      # 0x15318
movq 0xd4ec(%rip), %rax      # 0x15340
cmpq (%rcx,%r14,8), %rbp
je 0x7e76
movq %rbp, -0x8(%rax)
movq 0xd4d3(%rip), %rdi      # 0x15338
movq 0xd4d4(%rip), %rsi      # 0x15340
callq 0x9faf
jmp 0x7dcf
addq $-0x10, %rax
movq %rax, 0xd4bf(%rip)      # 0x15340
jmp 0x7dcf
movq 0x10(%rsp), %rdi
addq 0x90(%rbx), %rdi
leaq 0xd4bf(%rip), %rsi      # 0x15358
callq 0x98ce
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd47c(%rip), %rdi      # 0x15330
callq 0x3440
testl %eax, %eax
je 0x7c1d
xorps %xmm0, %xmm0
movups %xmm0, 0xd44d(%rip)     # 0x15318
andq $0x0, 0xd455(%rip)      # 0x15328
leaq 0xd43e(%rip), %rsi      # 0x15318
leaq 0x2093(%rip), %rdi      # 0x9f74
leaq 0xd380(%rip), %rdx      # 0x15268
callq 0x3210
leaq 0xd43c(%rip), %rdi      # 0x15330
callq 0x31b0
jmp 0x7c1d
leaq 0xd44b(%rip), %rdi      # 0x15350
callq 0x3440
testl %eax, %eax
je 0x7c2b
xorps %xmm0, %xmm0
movups %xmm0, 0xd41c(%rip)     # 0x15338
andq $0x0, 0xd424(%rip)      # 0x15348
leaq 0xd40d(%rip), %rsi      # 0x15338
leaq 0x2048(%rip), %rdi      # 0x9f7a
leaq 0xd32f(%rip), %rdx      # 0x15268
callq 0x3210
leaq 0xd40b(%rip), %rdi      # 0x15350
callq 0x31b0
jmp 0x7c2b
leaq 0xd41a(%rip), %rdi      # 0x15370
callq 0x3440
testl %eax, %eax
je 0x7c39
movslq (%rbx), %rsi
leaq 0xd3eb(%rip), %rdi      # 0x15358
movq %rsp, %rdx
callq 0x9a92
leaq 0x169e(%rip), %rdi      # 0x961a
leaq 0xd3d5(%rip), %rsi      # 0x15358
leaq 0xd2de(%rip), %rdx      # 0x15268
callq 0x3210
leaq 0xd3da(%rip), %rdi      # 0x15370
callq 0x31b0
jmp 0x7c39
movq %rax, %rbx
leaq 0xd3c6(%rip), %rdi      # 0x15370
callq 0x31a0
movq %rbx, %rdi
callq 0x3430
nop