// File: /workspace/github_cpp_makefile_star2_O1/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 $0xb8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0xe1d8
movslq 0xc(%rbx), %rsi
leaq 0x10(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %rcx
callq 0xc7c0
movslq 0xc(%rbx), %rsi
leaq 0x8(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0xc7c0
cmpl $-0x2, %ebp
jg 0x77d2
movq 0xe854(%rip), %rdi      # 0x15fd8
leaq 0x8da6(%rip), %rsi      # 0x10531
movl $0x11, %edx
callq 0x32e0
movq 0xe83c(%rip), %rdi      # 0x15fd8
movl %ebp, %esi
callq 0x3440
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
jmp 0x7b7d
movabsq $-0x8000000000000000, %r12 # imm = 0x8000000000000000
cmpl $-0x1, %ebp
je 0x78fd
movq 0x38(%rsp), %rax
movl %ebp, %edx
movl $0x1, %esi
movl %ebp, %ecx
shlq %cl, %rsi
shrl $0x6, %edx
orq %rsi, (%rax,%rdx,8)
movl %ebp, %eax
movq 0x48(%rbx), %rcx
leaq (%rax,%rax,2), %r15
shlq $0x4, %r15
movq 0x18(%rcx,%r15), %rsi
cmpq %rsi, 0x20(%rcx,%r15)
je 0x79b2
xorl %r13d, %r13d
leaq 0x3f(%r12), %rbp
xorl %r14d, %r14d
movslq (%rsi,%r13), %rax
leaq 0x3f(%rax), %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
sarq $0x6, %rcx
shlq $0x3, %rcx
addq 0x38(%rsp), %rcx
movq %rax, %rdx
andq %rbp, %rdx
xorl %edi, %edi
cmpq %r12, %rdx
setbe %dil
movq -0x8(%rcx,%rdi,8), %rcx
btq %rax, %rcx
jb 0x78d3
movq 0x90(%rsp), %rcx
movq 0xa0(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x7885
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x90(%rsp)
jmp 0x7892
addq %r13, %rsi
leaq 0x60(%rsp), %rdi
callq 0xe406
movq 0x48(%rbx), %rax
movq 0x18(%rax,%r15), %rax
movslq (%rax,%r13), %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0x10(%rsp), %rax
movq %rcx, %rdx
andq %rbp, %rdx
xorl %esi, %esi
cmpq %r12, %rdx
setbe %sil
movl $0x1, %edx
shlq %cl, %rdx
orq %rdx, -0x8(%rax,%rsi,8)
incq %r14
movq 0x48(%rbx), %rax
movq 0x18(%rax,%r15), %rsi
movq 0x20(%rax,%r15), %rax
subq %rsi, %rax
sarq $0x2, %rax
addq $0x4, %r13
cmpq %r14, %rax
ja 0x7826
jmp 0x79b2
movl $0x0, 0x8(%rsp)
cmpl $0x0, 0xc(%rbx)
jle 0x79b2
xorl %eax, %eax
leaq 0x60(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x3f(%r12), %r13
movslq %eax, %rcx
movq 0x30(%rbx), %rdx
shlq $0x4, %rcx
cmpl $0x0, 0x8(%rdx,%rcx)
jne 0x799f
movq 0x90(%rsp), %rcx
movq 0xa0(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x795b
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x90(%rsp)
jmp 0x7966
movq %r14, %rdi
movq %r15, %rsi
callq 0xe406
movslq 0x8(%rsp), %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0x10(%rsp), %rax
movq %rcx, %rdx
andq %r13, %rdx
xorl %esi, %esi
cmpq %r12, %rdx
setbe %sil
movl $0x1, %edx
shlq %cl, %rdx
orq %rdx, -0x8(%rax,%rsi,8)
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpl 0xc(%rbx), %eax
jl 0x7920
movq 0x70(%rsp), %rax
cmpq %rax, 0x90(%rsp)
je 0x7b7d
leaq 0x3f(%r12), %r13
movslq (%rax), %r15
movq 0x80(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x79e4
addq $0x4, %rax
jmp 0x7a1a
movq 0x78(%rsp), %rdi
callq 0x3260
movq 0x88(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x88(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x78(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x80(%rsp)
leaq 0x3f(%r15), %rdx
testq %r15, %r15
cmovnsq %r15, %rdx
sarq $0x6, %rdx
shlq $0x3, %rdx
addq 0x38(%rsp), %rdx
movq %r15, %rcx
andq %r13, %rcx
xorl %esi, %esi
cmpq %r12, %rcx
setbe %sil
movl $0x1, %edi
movl %r15d, %ecx
shlq %cl, %rdi
movq %rax, 0x70(%rsp)
orq %rdi, -0x8(%rdx,%rsi,8)
movq 0x48(%rbx), %rax
leaq (%r15,%r15,2), %r15
shlq $0x4, %r15
movq 0x18(%rax,%r15), %rsi
cmpq %rsi, 0x20(%rax,%r15)
je 0x7b6a
xorl %ebp, %ebp
xorl %r14d, %r14d
movslq (%rsi,%rbp), %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
movq 0x38(%rsp), %r8
addq %rax, %r8
movq %rcx, %rdi
andq %r13, %rdi
xorl %edx, %edx
cmpq %r12, %rdi
setbe %dl
movl $0x1, %edi
shlq %cl, %rdi
movq -0x8(%r8,%rdx,8), %r8
btq %rcx, %r8
jb 0x7b45
leaq -0x8(,%rdx,8), %rdx
addq 0x10(%rsp), %rax
testq %rdi, (%rdx,%rax)
jne 0x7b45
movq 0x90(%rsp), %rax
movq 0xa0(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rax
je 0x7af7
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x90(%rsp)
jmp 0x7b04
addq %rbp, %rsi
leaq 0x60(%rsp), %rdi
callq 0xe406
movq 0x48(%rbx), %rax
movq 0x18(%rax,%r15), %rax
movslq (%rax,%rbp), %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0x10(%rsp), %rax
movq %rcx, %rdx
andq %r13, %rdx
xorl %esi, %esi
cmpq %r12, %rdx
setbe %sil
movl $0x1, %edx
shlq %cl, %rdx
orq %rdx, -0x8(%rax,%rsi,8)
incq %r14
movq 0x48(%rbx), %rax
movq 0x18(%rax,%r15), %rsi
movq 0x20(%rax,%r15), %rax
subq %rsi, %rax
sarq $0x2, %rax
addq $0x4, %rbp
cmpq %r14, %rax
ja 0x7a77
movq 0x70(%rsp), %rax
cmpq %rax, 0x90(%rsp)
jne 0x79ca
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7ba5
callq 0x3260
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x7bcd
callq 0x3260
xorl %eax, %eax
movq %rax, 0x38(%rsp)
movl %eax, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movl %eax, 0x50(%rsp)
movq %rax, 0x58(%rsp)
leaq 0x60(%rsp), %rdi
callq 0xcc2c
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7bf9
jmp 0x7bf9
movq %rax, %rbx
jmp 0x7c24
movq %rax, %rbx
jmp 0x7c4c
jmp 0x7bf9
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7c24
callq 0x3260
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x7c4c
callq 0x3260
xorl %eax, %eax
movq %rax, 0x38(%rsp)
movl %eax, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movl %eax, 0x50(%rsp)
movq %rax, 0x58(%rsp)
leaq 0x60(%rsp), %rdi
callq 0xcc2c
movq %rbx, %rdi
callq 0x3460