// File: /workspace/github_cpp_makefile_star2_O2/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 0xdb37(%rip), %al       # 0x152d0
testb %al, %al
je 0x7a23
movb 0xdb49(%rip), %al       # 0x152f0
testb %al, %al
je 0x7a74
movb 0xdb5b(%rip), %al       # 0x15310
testb %al, %al
je 0x7ac5
movq 0xdb34(%rip), %rax      # 0x152f8
cmpq %rax, 0xdb35(%rip)      # 0x15300
je 0x77d4
movq %rax, 0xdb2c(%rip)      # 0x15300
movq 0xdadd(%rip), %rax      # 0x152b8
cmpq %rax, 0xdade(%rip)      # 0x152c0
je 0x77eb
movq %rax, 0xdad5(%rip)      # 0x152c0
movslq %ebp, %r14
movq 0xdae3(%rip), %rax      # 0x152d8
cmpq %rax, 0xdae4(%rip)      # 0x152e0
je 0x7805
movq %rax, 0xdadb(%rip)      # 0x152e0
movq 0x78(%rbx), %rax
imulq $0x18, %r14, %r12
movq (%rax,%r12), %rax
movq %rsp, %r15
andl $0x0, (%r15)
movq %rax, 0x8(%r15)
leaq 0xdab5(%rip), %rdi      # 0x152d8
movq %r15, %rsi
callq 0xcc3a
movq 0x78(%rbx), %rax
movq %r12, 0x10(%rsp)
movq 0x8(%rax,%r12), %rax
movq %rax, (%r15)
leaq 0xda75(%rip), %r13      # 0x152b8
movq %rsp, %rsi
movq %r13, %rdi
callq 0xcd96
movq 0x48(%rbx), %rax
imulq $0x30, %r14, %r14
movq 0x18(%rax,%r14), %rbp
pushq $0x1
popq %r12
cmpq 0x20(%rax,%r14), %rbp
je 0x78bb
movslq (%rbp), %rax
movq 0x78(%rbx), %rcx
imulq $0x18, %rax, %rax
movq (%rcx,%rax), %rax
movl %r12d, (%rsp)
movq %rax, 0x8(%rsp)
leaq 0xda52(%rip), %rdi      # 0x152d8
movq %r15, %rsi
callq 0xcc3a
movslq (%rbp), %rax
movq 0x78(%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 0x785f
movq 0xda16(%rip), %rdi      # 0x152d8
movq 0xda17(%rip), %rsi      # 0x152e0
callq 0x9f7f
movq 0xda03(%rip), %rax      # 0x152d8
movslq (%rax), %r14
movq 0x8(%rax), %r15
leaq 0xda15(%rip), %rdi      # 0x152f8
movq %r15, %rsi
callq 0x9a0e
movl (%r15), %r12d
movq 0xd9e3(%rip), %rdi      # 0x152d8
movq 0xd9e4(%rip), %rsi      # 0x152e0
callq 0x9f8c
addq $0x4, %r15
movq 0xd9ac(%rip), %rcx      # 0x152b8
movq 0xd9cd(%rip), %rax      # 0x152e0
cmpq (%rcx,%r14,8), %r15
je 0x7932
movq %r15, -0x8(%rax)
movq 0xd9b4(%rip), %rdi      # 0x152d8
movq 0xd9b5(%rip), %rsi      # 0x152e0
callq 0x9faf
jmp 0x793d
addq $-0x10, %rax
movq %rax, 0xd9a3(%rip)      # 0x152e0
pushq $0x1
popq %r13
leaq 0xd9b0(%rip), %r15      # 0x152f8
cmpl (%rbx), %r13d
jge 0x79ff
movq 0xd980(%rip), %rax      # 0x152d8
cmpq 0xd981(%rip), %rax      # 0x152e0
je 0x79ff
movslq (%rax), %r14
movq 0x8(%rax), %rbp
cmpl (%rbp), %r12d
jge 0x7986
movq %r15, %rdi
movq %rbp, %rsi
callq 0x9a0e
incl %r13d
movl (%rbp), %r12d
jmp 0x79a8
jle 0x79a8
movq 0xd649(%rip), %rdi      # 0x14fd8
leaq 0x6b8d(%rip), %rsi      # 0xe523
callq 0x3270
movq %rax, %rdi
callq 0x3140
callq 0x41b8
movq 0xd929(%rip), %rdi      # 0x152d8
movq 0xd92a(%rip), %rsi      # 0x152e0
callq 0x9f8c
addq $0x4, %rbp
movq 0xd8f2(%rip), %rcx      # 0x152b8
movq 0xd913(%rip), %rax      # 0x152e0
cmpq (%rcx,%r14,8), %rbp
je 0x79ef
movq %rbp, -0x8(%rax)
movq 0xd8fa(%rip), %rdi      # 0x152d8
movq 0xd8fb(%rip), %rsi      # 0x152e0
callq 0x9faf
jmp 0x7948
addq $-0x10, %rax
movq %rax, 0xd8e6(%rip)      # 0x152e0
jmp 0x7948
movq 0x10(%rsp), %rdi
addq 0x78(%rbx), %rdi
leaq 0xd8e9(%rip), %rsi      # 0x152f8
callq 0x98ce
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd8a6(%rip), %rdi      # 0x152d0
callq 0x3440
testl %eax, %eax
je 0x77a1
xorps %xmm0, %xmm0
movups %xmm0, 0xd877(%rip)     # 0x152b8
andq $0x0, 0xd87f(%rip)      # 0x152c8
leaq 0xd868(%rip), %rsi      # 0x152b8
leaq 0x251d(%rip), %rdi      # 0x9f74
leaq 0xd80a(%rip), %rdx      # 0x15268
callq 0x3210
leaq 0xd866(%rip), %rdi      # 0x152d0
callq 0x31b0
jmp 0x77a1
leaq 0xd875(%rip), %rdi      # 0x152f0
callq 0x3440
testl %eax, %eax
je 0x77af
xorps %xmm0, %xmm0
movups %xmm0, 0xd846(%rip)     # 0x152d8
andq $0x0, 0xd84e(%rip)      # 0x152e8
leaq 0xd837(%rip), %rsi      # 0x152d8
leaq 0x24d2(%rip), %rdi      # 0x9f7a
leaq 0xd7b9(%rip), %rdx      # 0x15268
callq 0x3210
leaq 0xd835(%rip), %rdi      # 0x152f0
callq 0x31b0
jmp 0x77af
leaq 0xd844(%rip), %rdi      # 0x15310
callq 0x3440
testl %eax, %eax
je 0x77bd
movslq (%rbx), %rsi
leaq 0xd815(%rip), %rdi      # 0x152f8
movq %rsp, %rdx
callq 0x9a92
leaq 0x1b28(%rip), %rdi      # 0x961a
leaq 0xd7ff(%rip), %rsi      # 0x152f8
leaq 0xd768(%rip), %rdx      # 0x15268
callq 0x3210
leaq 0xd804(%rip), %rdi      # 0x15310
callq 0x31b0
jmp 0x77bd
movq %rax, %rbx
leaq 0xd7f0(%rip), %rdi      # 0x15310
callq 0x31a0
movq %rbx, %rdi
callq 0x3430
nop