// File: /workspace/github_cpp_makefile_star2_O3/datourat[P]IP-label-for-graph-reachability/Graph.cpp
// Function: Graph::SubComputeProLabelOut(int)
void Graph::SubComputeProLabelOut(int u){
	int edgelistsize=graph[u].outList.size();
	int v;
	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, ProLabelOut[u].begin()));
	iterend.push_back(ProLabelOut[u].end());
/*
	for(int i=0; i<edgelistsize; i++){
		v=graph[u].outList[i];
		iterlist.push_back( make_pair(i+1, ProLabelOut[v].begin()) );
		iterend.push_back(ProLabelOut[v].end());
	}
*/
	int i=1;
	for(vector<int>::iterator it=graph[u].outList.begin(); it!=graph[u].outList.end(); i++, it++){
		iterlist.push_back( make_pair(i, ProLabelOut[*it].begin()) );
		iterend.push_back( ProLabelOut[*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> ());
		}
	}

	ProLabelOut[u]=label;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movb 0xce27(%rip), %al       # 0x162e0
testb %al, %al
je 0x9963
movb 0xce39(%rip), %al       # 0x16300
testb %al, %al
je 0x996d
movb 0xce4b(%rip), %al       # 0x16320
testb %al, %al
je 0x9977
movq 0xce24(%rip), %rax      # 0x16308
cmpq %rax, 0xce25(%rip)      # 0x16310
je 0x94f4
movq %rax, 0xce1c(%rip)      # 0x16310
movq 0xcdcd(%rip), %rax      # 0x162c8
cmpq %rax, 0xcdce(%rip)      # 0x162d0
je 0x950b
movq %rax, 0xcdc5(%rip)      # 0x162d0
movslq %ebp, %rax
movq 0xcdd3(%rip), %rcx      # 0x162e8
movq 0xcdd4(%rip), %rsi      # 0x162f0
cmpq %rcx, %rsi
je 0x952b
movq %rcx, 0xcdc8(%rip)      # 0x162f0
movq %rcx, %rsi
movq 0x78(%rbx), %rcx
leaq (%rax,%rax,2), %r14
movq (%rcx,%r14,8), %rax
movl $0x0, (%rsp)
movq %rax, 0x8(%rsp)
cmpq 0xcdae(%rip), %rsi      # 0x162f8
je 0x955d
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0xcd95(%rip)     # 0x162f0
jmp 0x956c
leaq 0xcd84(%rip), %rdi      # 0x162e8
movq %rsp, %rdx
callq 0xf1c2
movq 0x78(%rbx), %rax
movq 0x8(%rax,%r14,8), %rax
movq %rax, (%rsp)
movq 0xcd50(%rip), %rsi      # 0x162d0
cmpq 0xcd51(%rip), %rsi      # 0x162d8
je 0x9596
movq %rax, (%rsi)
addq $0x8, 0xcd3c(%rip)      # 0x162d0
jmp 0x95a5
leaq 0xcd2b(%rip), %rdi      # 0x162c8
movq %rsp, %rdx
callq 0xf2fa
movq 0x48(%rbx), %rax
movq %r14, 0x10(%rsp)
shlq $0x4, %r14
movq 0x18(%rax,%r14), %rbp
cmpq 0x20(%rax,%r14), %rbp
je 0x966e
movl $0x1, %r15d
movq %rsp, %r12
leaq 0xccf6(%rip), %r13      # 0x162c8
movslq (%rbp), %rax
movq 0x78(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rax
movl %r15d, (%rsp)
movq %rax, 0x8(%rsp)
movq 0xccfe(%rip), %rsi      # 0x162f0
cmpq 0xccff(%rip), %rsi      # 0x162f8
je 0x960c
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0xcce6(%rip)     # 0x162f0
jmp 0x961b
leaq 0xccd5(%rip), %rdi      # 0x162e8
movq %r12, %rdx
callq 0xf1c2
movslq (%rbp), %rax
movq 0x78(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movq 0x8(%rcx,%rax,8), %rax
movq %rax, (%rsp)
movq 0xcc99(%rip), %rsi      # 0x162d0
cmpq 0xcc9a(%rip), %rsi      # 0x162d8
je 0x964d
movq %rax, (%rsi)
addq $0x8, 0xcc85(%rip)      # 0x162d0
jmp 0x9658
movq %r13, %rdi
movq %r12, %rdx
callq 0xf2fa
incl %r15d
addq $0x4, %rbp
movq 0x48(%rbx), %rax
cmpq 0x20(%rax,%r14), %rbp
jne 0x95d2
movq 0xcc73(%rip), %rdi      # 0x162e8
movq 0xcc74(%rip), %rsi      # 0x162f0
movq %rsp, %rdx
callq 0xf437
movq 0xcc5d(%rip), %rax      # 0x162e8
movslq (%rax), %r14
movq 0x8(%rax), %r15
movq 0xcc77(%rip), %rsi      # 0x16310
cmpq 0xcc78(%rip), %rsi      # 0x16318
je 0x96b5
movl (%r15), %r13d
movl %r13d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xcc5d(%rip)      # 0x16310
jmp 0x96c7
leaq 0xcc4c(%rip), %rdi      # 0x16308
movq %r15, %rdx
callq 0xdd36
movl (%r15), %r13d
movq 0xcc1a(%rip), %rdi      # 0x162e8
movq 0xcc1b(%rip), %rax      # 0x162f0
movq %rax, %rcx
subq %rdi, %rcx
cmpq $0x11, %rcx
jl 0x9707
leaq -0x10(%rax), %rdx
movl -0x10(%rax), %ecx
movq -0x8(%rax), %r8
movl (%rdi), %esi
movl %esi, -0x10(%rax)
movq 0x8(%rdi), %rsi
movq %rsi, -0x8(%rax)
subq %rdi, %rdx
sarq $0x4, %rdx
xorl %esi, %esi
callq 0xf495
addq $0x4, %r15
movq 0xcbb6(%rip), %rcx      # 0x162c8
movq 0xcbd7(%rip), %rax      # 0x162f0
cmpq (%rcx,%r14,8), %r15
je 0x9793
movq %r15, -0x8(%rax)
movq 0xcbbe(%rip), %rax      # 0x162e8
movq 0xcbbf(%rip), %rdi      # 0x162f0
movl -0x10(%rdi), %ecx
movq -0x8(%rdi), %rdx
subq %rax, %rdi
sarq $0x4, %rdi
leaq -0x1(%rdi), %rsi
cmpq $0x2, %rdi
jl 0x9785
leaq -0x1(%rsi), %rdi
movq %rdi, %r8
shrq %r8
movq %r8, %r10
shlq $0x4, %r10
movq 0x8(%rax,%r10), %r9
movl (%r9), %r11d
cmpl (%rdx), %r11d
jle 0x9785
addq %rax, %r10
shlq $0x4, %rsi
movl (%r10), %r10d
movl %r10d, (%rax,%rsi)
movq %r9, 0x8(%rax,%rsi)
movq %r8, %rsi
cmpq $0x1, %rdi
ja 0x9749
xorl %esi, %esi
shlq $0x4, %rsi
movl %ecx, (%rax,%rsi)
movq %rdx, 0x8(%rax,%rsi)
jmp 0x979e
addq $-0x10, %rax
movq %rax, 0xcb52(%rip)      # 0x162f0
cmpl $0x2, (%rbx)
jl 0x993b
movl $0x1, %r15d
movq 0xcb3c(%rip), %rax      # 0x162f0
movq 0xc81d(%rip), %r12      # 0x15fd8
movq 0xcb26(%rip), %rcx      # 0x162e8
cmpq %rax, %rcx
je 0x993b
movslq (%rcx), %r14
movq 0x8(%rcx), %rbp
movl (%rbp), %eax
cmpl %eax, %r13d
jge 0x97f9
movq 0xcb2f(%rip), %rsi      # 0x16310
cmpq 0xcb30(%rip), %rsi      # 0x16318
je 0x983e
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xcb19(%rip)      # 0x16310
jmp 0x984d
jle 0x9854
movl $0x19, %edx
movq %r12, %rdi
leaq 0x6d79(%rip), %rsi      # 0x10583
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
jmp 0x9854
leaq 0xcac3(%rip), %rdi      # 0x16308
movq %rbp, %rdx
callq 0xdd36
incl %r15d
movl (%rbp), %r13d
movq 0xca8d(%rip), %rdi      # 0x162e8
movq 0xca8e(%rip), %rax      # 0x162f0
movq %rax, %rcx
subq %rdi, %rcx
cmpq $0x11, %rcx
jl 0x9894
leaq -0x10(%rax), %rdx
movl -0x10(%rax), %ecx
movq -0x8(%rax), %r8
movl (%rdi), %esi
movl %esi, -0x10(%rax)
movq 0x8(%rdi), %rsi
movq %rsi, -0x8(%rax)
subq %rdi, %rdx
sarq $0x4, %rdx
xorl %esi, %esi
callq 0xf495
addq $0x4, %rbp
movq 0xca29(%rip), %rcx      # 0x162c8
movq 0xca4a(%rip), %rax      # 0x162f0
cmpq (%rcx,%r14,8), %rbp
je 0x9927
movq %rbp, -0x8(%rax)
movq 0xca31(%rip), %rax      # 0x162e8
movq 0xca32(%rip), %rdi      # 0x162f0
movl -0x10(%rdi), %ecx
movq -0x8(%rdi), %rdx
subq %rax, %rdi
sarq $0x4, %rdi
leaq -0x1(%rdi), %rsi
cmpq $0x2, %rdi
jl 0x9912
leaq -0x1(%rsi), %rdi
movq %rdi, %r8
shrq %r8
movq %r8, %r10
shlq $0x4, %r10
movq 0x8(%rax,%r10), %r9
movl (%r9), %r11d
cmpl (%rdx), %r11d
jle 0x9912
addq %rax, %r10
shlq $0x4, %rsi
movl (%r10), %r10d
movl %r10d, (%rax,%rsi)
movq %r9, 0x8(%rax,%rsi)
movq %r8, %rsi
cmpq $0x1, %rdi
ja 0x98d6
xorl %esi, %esi
shlq $0x4, %rsi
movl %ecx, (%rax,%rsi)
movq %rdx, 0x8(%rax,%rsi)
movq 0xc9cb(%rip), %rax      # 0x162f0
jmp 0x9932
addq $-0x10, %rax
movq %rax, 0xc9be(%rip)      # 0x162f0
cmpl (%rbx), %r15d
jl 0x97bb
movq 0x10(%rsp), %rdi
shlq $0x3, %rdi
addq 0x78(%rbx), %rdi
leaq 0xc9b9(%rip), %rsi      # 0x16308
callq 0xc1f2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x34f0
jmp 0x94c1
callq 0x353c
jmp 0x94cf
leaq 0xc9a2(%rip), %rdi      # 0x16320
callq 0x3480
testl %eax, %eax
je 0x94dd
movslq (%rbx), %rsi
leaq 0xc973(%rip), %rdi      # 0x16308
movq %rsp, %rdx
callq 0xc3d2
leaq 0x2526(%rip), %rdi      # 0xbeca
leaq 0xc95d(%rip), %rsi      # 0x16308
leaq 0xc8c6(%rip), %rdx      # 0x16278
callq 0x3240
leaq 0xc962(%rip), %rdi      # 0x16320
callq 0x31a0
jmp 0x94dd
movq %rax, %rbx
leaq 0xc94e(%rip), %rdi      # 0x16320
callq 0x3190
movq %rbx, %rdi
callq 0x3460
nop