// File: /workspace/github_cpp_makefile_star2_O3/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 0xc863(%rip), %al       # 0x16340
testb %al, %al
je 0x9f95
movb 0xc875(%rip), %al       # 0x16360
testb %al, %al
je 0x9f9f
movb 0xc887(%rip), %al       # 0x16380
testb %al, %al
je 0x9fa9
movq 0xc860(%rip), %rax      # 0x16368
cmpq %rax, 0xc861(%rip)      # 0x16370
je 0x9b18
movq %rax, 0xc858(%rip)      # 0x16370
movq 0xc809(%rip), %rax      # 0x16328
cmpq %rax, 0xc80a(%rip)      # 0x16330
je 0x9b2f
movq %rax, 0xc801(%rip)      # 0x16330
movslq %ebp, %rax
movq 0xc80f(%rip), %rcx      # 0x16348
movq 0xc810(%rip), %rsi      # 0x16350
cmpq %rcx, %rsi
je 0x9b4f
movq %rcx, 0xc804(%rip)      # 0x16350
movq %rcx, %rsi
movq 0x90(%rbx), %rcx
leaq (%rax,%rax,2), %r14
movq (%rcx,%r14,8), %rax
movl $0x0, (%rsp)
movq %rax, 0x8(%rsp)
cmpq 0xc7e7(%rip), %rsi      # 0x16358
je 0x9b84
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0xc7ce(%rip)     # 0x16350
jmp 0x9b93
leaq 0xc7bd(%rip), %rdi      # 0x16348
movq %rsp, %rdx
callq 0xf1c2
movq 0x90(%rbx), %rax
movq 0x8(%rax,%r14,8), %rax
movq %rax, (%rsp)
movq 0xc786(%rip), %rsi      # 0x16330
cmpq 0xc787(%rip), %rsi      # 0x16338
je 0x9bc0
movq %rax, (%rsi)
addq $0x8, 0xc772(%rip)      # 0x16330
jmp 0x9bcf
leaq 0xc761(%rip), %rdi      # 0x16328
movq %rsp, %rdx
callq 0xf2fa
movq 0x48(%rbx), %rax
movq %r14, 0x10(%rsp)
shlq $0x4, %r14
movq (%rax,%r14), %rbp
cmpq 0x8(%rax,%r14), %rbp
je 0x9c9d
movl $0x1, %r15d
movq %rsp, %r12
leaq 0xc72d(%rip), %r13      # 0x16328
movslq (%rbp), %rax
movq 0x90(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rax
movl %r15d, (%rsp)
movq %rax, 0x8(%rsp)
movq 0xc732(%rip), %rsi      # 0x16350
cmpq 0xc733(%rip), %rsi      # 0x16358
je 0x9c38
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0xc71a(%rip)     # 0x16350
jmp 0x9c47
leaq 0xc709(%rip), %rdi      # 0x16348
movq %r12, %rdx
callq 0xf1c2
movslq (%rbp), %rax
movq 0x90(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movq 0x8(%rcx,%rax,8), %rax
movq %rax, (%rsp)
movq 0xc6ca(%rip), %rsi      # 0x16330
cmpq 0xc6cb(%rip), %rsi      # 0x16338
je 0x9c7c
movq %rax, (%rsi)
addq $0x8, 0xc6b6(%rip)      # 0x16330
jmp 0x9c87
movq %r13, %rdi
movq %r12, %rdx
callq 0xf2fa
incl %r15d
addq $0x4, %rbp
movq 0x48(%rbx), %rax
cmpq 0x8(%rax,%r14), %rbp
jne 0x9bfb
movq 0xc6a4(%rip), %rdi      # 0x16348
movq 0xc6a5(%rip), %rsi      # 0x16350
movq %rsp, %rdx
callq 0xf437
movq 0xc68e(%rip), %rax      # 0x16348
movslq (%rax), %r14
movq 0x8(%rax), %r15
movq 0xc6a8(%rip), %rsi      # 0x16370
cmpq 0xc6a9(%rip), %rsi      # 0x16378
je 0x9ce4
movl (%r15), %r13d
movl %r13d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xc68e(%rip)      # 0x16370
jmp 0x9cf6
leaq 0xc67d(%rip), %rdi      # 0x16368
movq %r15, %rdx
callq 0xdd36
movl (%r15), %r13d
movq 0xc64b(%rip), %rdi      # 0x16348
movq 0xc64c(%rip), %rax      # 0x16350
movq %rax, %rcx
subq %rdi, %rcx
cmpq $0x11, %rcx
jl 0x9d36
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 0xc5e7(%rip), %rcx      # 0x16328
movq 0xc608(%rip), %rax      # 0x16350
cmpq (%rcx,%r14,8), %r15
je 0x9dc2
movq %r15, -0x8(%rax)
movq 0xc5ef(%rip), %rax      # 0x16348
movq 0xc5f0(%rip), %rdi      # 0x16350
movl -0x10(%rdi), %ecx
movq -0x8(%rdi), %rdx
subq %rax, %rdi
sarq $0x4, %rdi
leaq -0x1(%rdi), %rsi
cmpq $0x2, %rdi
jl 0x9db4
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 0x9db4
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 0x9d78
xorl %esi, %esi
shlq $0x4, %rsi
movl %ecx, (%rax,%rsi)
movq %rdx, 0x8(%rax,%rsi)
jmp 0x9dcd
addq $-0x10, %rax
movq %rax, 0xc583(%rip)      # 0x16350
cmpl $0x2, (%rbx)
jl 0x9f6a
movl $0x1, %r15d
movq 0xc56d(%rip), %rax      # 0x16350
movq 0xc1ee(%rip), %r12      # 0x15fd8
movq 0xc557(%rip), %rcx      # 0x16348
cmpq %rax, %rcx
je 0x9f6a
movslq (%rcx), %r14
movq 0x8(%rcx), %rbp
movl (%rbp), %eax
cmpl %eax, %r13d
jge 0x9e28
movq 0xc560(%rip), %rsi      # 0x16370
cmpq 0xc561(%rip), %rsi      # 0x16378
je 0x9e6d
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xc54a(%rip)      # 0x16370
jmp 0x9e7c
jle 0x9e83
movl $0x19, %edx
movq %r12, %rdi
leaq 0x674a(%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 0x9e83
leaq 0xc4f4(%rip), %rdi      # 0x16368
movq %rbp, %rdx
callq 0xdd36
incl %r15d
movl (%rbp), %r13d
movq 0xc4be(%rip), %rdi      # 0x16348
movq 0xc4bf(%rip), %rax      # 0x16350
movq %rax, %rcx
subq %rdi, %rcx
cmpq $0x11, %rcx
jl 0x9ec3
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 0xc45a(%rip), %rcx      # 0x16328
movq 0xc47b(%rip), %rax      # 0x16350
cmpq (%rcx,%r14,8), %rbp
je 0x9f56
movq %rbp, -0x8(%rax)
movq 0xc462(%rip), %rax      # 0x16348
movq 0xc463(%rip), %rdi      # 0x16350
movl -0x10(%rdi), %ecx
movq -0x8(%rdi), %rdx
subq %rax, %rdi
sarq $0x4, %rdi
leaq -0x1(%rdi), %rsi
cmpq $0x2, %rdi
jl 0x9f41
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 0x9f41
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 0x9f05
xorl %esi, %esi
shlq $0x4, %rsi
movl %ecx, (%rax,%rsi)
movq %rdx, 0x8(%rax,%rsi)
movq 0xc3fc(%rip), %rax      # 0x16350
jmp 0x9f61
addq $-0x10, %rax
movq %rax, 0xc3ef(%rip)      # 0x16350
cmpl (%rbx), %r15d
jl 0x9dea
movq 0x10(%rsp), %rdi
shlq $0x3, %rdi
addq 0x90(%rbx), %rdi
leaq 0xc3e7(%rip), %rsi      # 0x16368
callq 0xc1f2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3588
jmp 0x9ae5
callq 0x35d4
jmp 0x9af3
leaq 0xc3d0(%rip), %rdi      # 0x16380
callq 0x3480
testl %eax, %eax
je 0x9b01
movslq (%rbx), %rsi
leaq 0xc3a1(%rip), %rdi      # 0x16368
movq %rsp, %rdx
callq 0xc3d2
leaq 0x1ef4(%rip), %rdi      # 0xbeca
leaq 0xc38b(%rip), %rsi      # 0x16368
leaq 0xc294(%rip), %rdx      # 0x16278
callq 0x3240
leaq 0xc390(%rip), %rdi      # 0x16380
callq 0x31a0
jmp 0x9b01
movq %rax, %rbx
leaq 0xc37c(%rip), %rdi      # 0x16380
callq 0x3190
movq %rbx, %rdi
callq 0x3460
nop