// File: /workspace/github_cpp_makefile_star2_O2/datourat[P]IP-label-for-graph-reachability/Graph.cpp
// Function: Graph::BFS(int)
void Graph::BFS(const int root){
	queue<int> que;
	vector<bool> BFSflag(vsize, false);
	vector<bool> QueFlag(vsize, false);
	int now;

	if(root<-1){
		cout << "BFS Input Error: " << root << endl;
		return;
	}

	if(root==-1){
		for(int i=0; i<vsize; i++){
			if(vl[i].indegree==0){
				que.push(i);
				QueFlag[i]=true;
			}
		}
	}else{
		BFSflag[root]=true;
		for(int i=0; i<graph[root].outList.size(); i++){
			if(BFSflag[graph[root].outList[i]]==false){
				que.push(graph[root].outList[i]);
				QueFlag[graph[root].outList[i]]=true;
			}
		}
	}

	while(que.empty()==false){
		now=que.front();
		que.pop();

		BFSflag[now]=true;
		for(int i=0; i<graph[now].outList.size(); i++){
			if((BFSflag[graph[now].outList[i]]==false)&&(QueFlag[graph[now].outList[i]]==false)){
				que.push(graph[now].outList[i]);
				QueFlag[graph[now].outList[i]]=true;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x58(%rsp), %rdi
callq 0x9c54
movslq 0xc(%rbx), %rsi
leaq 0x8(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
movq %rsp, %rcx
callq 0x9c70
movslq 0xc(%rbx), %rsi
movq %rsp, %rdx
movb $0x0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rcx
callq 0x9c70
cmpl $-0x2, %ebp
jg 0x6402
movq 0xec24(%rip), %rdi      # 0x14fd8
leaq 0x8106(%rip), %rsi      # 0xe4c1
callq 0x3270
movq %rax, %rdi
movl %ebp, %esi
callq 0x3420
movq %rax, %rdi
callq 0x3140
leaq 0x8(%rsp), %rdi
callq 0x9d0e
leaq 0x30(%rsp), %rdi
callq 0x9d0e
leaq 0x58(%rsp), %rdi
callq 0xa054
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $-0x1, %ebp
je 0x6499
movl %ebp, %r14d
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x9cd4
orq %rdx, (%rax)
xorl %r13d, %r13d
imulq $0x30, %r14, %rbp
leaq 0x30(%rsp), %r14
leaq 0x58(%rsp), %r15
leaq 0x8(%rsp), %r12
movq 0x48(%rbx), %rcx
movq 0x18(%rcx,%rbp), %rax
movq 0x20(%rcx,%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x64e3
movslq (%rax,%r13,4), %rsi
movq %r14, %rdi
callq 0x9cd4
testq %rdx, (%rax)
jne 0x6494
movq 0x48(%rbx), %rax
leaq (,%r13,4), %rsi
addq 0x18(%rax,%rbp), %rsi
movq %r15, %rdi
callq 0xbc62
movq 0x48(%rbx), %rax
movq 0x18(%rax,%rbp), %rax
movslq (%rax,%r13,4), %rsi
movq %r12, %rdi
callq 0x9cd4
orq %rdx, (%rax)
incq %r13
jmp 0x6434
xorl %eax, %eax
leaq 0x58(%rsp), %r14
movq %rsp, %r15
leaq 0x8(%rsp), %r12
movl %eax, (%rsp)
cmpl 0xc(%rbx), %eax
jge 0x64e3
movslq %eax, %rcx
movq 0x30(%rbx), %rdx
shlq $0x4, %rcx
cmpl $0x0, 0x8(%rdx,%rcx)
jne 0x64df
movq %r14, %rdi
movq %r15, %rsi
callq 0xbc62
movslq (%rsp), %rsi
movq %r12, %rdi
callq 0x9cd4
orq %rdx, (%rax)
movl (%rsp), %eax
incl %eax
jmp 0x64a8
leaq 0x58(%rsp), %r14
leaq 0x30(%rsp), %r15
leaq 0x8(%rsp), %r12
movq 0x68(%rsp), %rax
cmpq %rax, 0x88(%rsp)
je 0x63d2
movslq (%rax), %r13
movq %r14, %rdi
callq 0xbe9a
movq %r15, %rdi
movq %r13, %rsi
callq 0x9cd4
orq %rdx, (%rax)
imulq $0x30, %r13, %r13
xorl %ebp, %ebp
movq 0x48(%rbx), %rcx
movq 0x18(%rcx,%r13), %rax
movq 0x20(%rcx,%r13), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbp, %rcx
jbe 0x64f2
movslq (%rax,%rbp,4), %rsi
movq %r15, %rdi
callq 0x9cd4
testq %rdx, (%rax)
jne 0x659a
movq 0x48(%rbx), %rax
movq 0x18(%rax,%r13), %rax
movslq (%rax,%rbp,4), %rsi
movq %r12, %rdi
callq 0x9cd4
testq %rdx, (%rax)
jne 0x659a
movq 0x48(%rbx), %rax
leaq (,%rbp,4), %rsi
addq 0x18(%rax,%r13), %rsi
movq %r14, %rdi
callq 0xbc62
movq 0x48(%rbx), %rax
movq 0x18(%rax,%r13), %rax
movslq (%rax,%rbp,4), %rsi
movq %r12, %rdi
callq 0x9cd4
orq %rdx, (%rax)
incq %rbp
jmp 0x6524
jmp 0x65bf
movq %rax, %rbx
jmp 0x65cc
movq %rax, %rbx
jmp 0x65d6
jmp 0x65bf
jmp 0x65bf
jmp 0x65bf
jmp 0x65bf
jmp 0x65bf
jmp 0x65bf
jmp 0x65bf
jmp 0x65bf
jmp 0x65bf
jmp 0x65bf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x9d0e
leaq 0x30(%rsp), %rdi
callq 0x9d0e
leaq 0x58(%rsp), %rdi
callq 0xa054
movq %rbx, %rdi
callq 0x3430