// File: 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:
subq $0x248, %rsp            # imm = 0x248
movq %rdi, 0x240(%rsp)
movl %esi, 0x23c(%rsp)
movq 0x240(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0x1e8(%rsp), %rdi
callq 0x12e10
movq 0xc8(%rsp), %rax
movslq 0xc(%rax), %rax
movq %rax, 0xd0(%rsp)
movb $0x0, 0x1bf(%rsp)
leaq 0x1be(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
callq 0x12e40
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rcx
leaq 0x1c0(%rsp), %rdi
leaq 0x1bf(%rsp), %rdx
callq 0x12e50
jmp 0x94db
leaq 0x1be(%rsp), %rdi
callq 0x12ed0
movq 0xc8(%rsp), %rax
movslq 0xc(%rax), %rax
movq %rax, 0xb8(%rsp)
movb $0x0, 0x17f(%rsp)
leaq 0x17e(%rsp), %rdi
movq %rdi, 0xc0(%rsp)
callq 0x12e40
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rcx
leaq 0x180(%rsp), %rdi
leaq 0x17f(%rsp), %rdx
callq 0x12e50
jmp 0x9540
leaq 0x17e(%rsp), %rdi
callq 0x12ed0
cmpl $-0x1, 0x23c(%rsp)
jge 0x962e
movq 0x2ba76(%rip), %rdi     # 0x34fd8
leaq 0x1ef58(%rip), %rsi     # 0x284c1
callq 0x32c0
movq %rax, 0xb0(%rsp)
jmp 0x9578
movq 0xb0(%rsp), %rdi
movl 0x23c(%rsp), %esi
callq 0x34d0
movq %rax, 0xa8(%rsp)
jmp 0x9596
movq 0xa8(%rsp), %rdi
movq 0x2ba23(%rip), %rsi     # 0x34fc8
callq 0x3300
jmp 0x95ac
movl $0x1, 0x174(%rsp)
jmp 0x9bdd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x1be(%rsp), %rdi
callq 0x12ed0
jmp 0x9c19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x17e(%rsp), %rdi
callq 0x12ed0
jmp 0x9c0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x180(%rsp), %rdi
callq 0x13030
jmp 0x9c0c
cmpl $-0x1, 0x23c(%rsp)
jne 0x970b
movl $0x0, 0x170(%rsp)
movq 0xc8(%rsp), %rcx
movl 0x170(%rsp), %eax
cmpl 0xc(%rcx), %eax
jge 0x9706
movq 0xc8(%rsp), %rdi
addq $0x30, %rdi
movslq 0x170(%rsp), %rsi
callq 0x11d40
cmpl $0x0, 0x8(%rax)
jne 0x96ee
leaq 0x1e8(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x12ee0
jmp 0x9695
movslq 0x170(%rsp), %rsi
leaq 0x180(%rsp), %rdi
callq 0x12f10
movq %rdx, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
jmp 0x96bc
movq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq %rcx, 0x160(%rsp)
movq %rax, 0x168(%rsp)
leaq 0x160(%rsp), %rdi
movl $0x1, %esi
callq 0x12f70
jmp 0x96f0
movl 0x170(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x170(%rsp)
jmp 0x9647
jmp 0x9904
movslq 0x23c(%rsp), %rsi
leaq 0x1c0(%rsp), %rdi
callq 0x12f10
movq %rdx, 0x88(%rsp)
movq %rax, 0x90(%rsp)
jmp 0x9732
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
movq %rcx, 0x150(%rsp)
movq %rax, 0x158(%rsp)
leaq 0x150(%rsp), %rdi
movl $0x1, %esi
callq 0x12f70
movl $0x0, 0x14c(%rsp)
movq 0xc8(%rsp), %rdi
movslq 0x14c(%rsp), %rax
movq %rax, 0x80(%rsp)
addq $0x48, %rdi
movslq 0x23c(%rsp), %rsi
callq 0x11d60
movq %rax, %rdi
addq $0x18, %rdi
callq 0x4c10
movq %rax, %rcx
movq 0x80(%rsp), %rax
cmpq %rcx, %rax
jae 0x9902
movq 0xc8(%rsp), %rdi
addq $0x48, %rdi
movslq 0x23c(%rsp), %rsi
callq 0x11d60
movq %rax, %rdi
addq $0x18, %rdi
movslq 0x14c(%rsp), %rsi
callq 0x12960
movslq (%rax), %rsi
leaq 0x1c0(%rsp), %rdi
callq 0x12f10
movq %rdx, 0x70(%rsp)
movq %rax, 0x78(%rsp)
jmp 0x9801
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
movq %rcx, 0x138(%rsp)
movq %rax, 0x140(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x12fc0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x98ea
movq 0xc8(%rsp), %rdi
addq $0x48, %rdi
movslq 0x23c(%rsp), %rsi
callq 0x11d60
movq %rax, %rdi
addq $0x18, %rdi
movslq 0x14c(%rsp), %rsi
callq 0x12960
movq %rax, %rsi
leaq 0x1e8(%rsp), %rdi
callq 0x12ee0
jmp 0x9875
movq 0xc8(%rsp), %rdi
addq $0x48, %rdi
movslq 0x23c(%rsp), %rsi
callq 0x11d60
movq %rax, %rdi
addq $0x18, %rdi
movslq 0x14c(%rsp), %rsi
callq 0x12960
movslq (%rax), %rsi
leaq 0x180(%rsp), %rdi
callq 0x12f10
movq %rdx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
jmp 0x98be
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
movq %rcx, 0x128(%rsp)
movq %rax, 0x130(%rsp)
leaq 0x128(%rsp), %rdi
movl $0x1, %esi
callq 0x12f70
jmp 0x98ec
movl 0x14c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14c(%rsp)
jmp 0x976f
jmp 0x9904
jmp 0x9906
leaq 0x1e8(%rsp), %rdi
callq 0x12ff0
movb %al, 0x5f(%rsp)
jmp 0x9919
movb 0x5f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x9bd2
leaq 0x1e8(%rsp), %rdi
callq 0x13010
movq %rax, 0x50(%rsp)
jmp 0x993f
movq 0x50(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x178(%rsp)
leaq 0x1e8(%rsp), %rdi
callq 0x13020
jmp 0x995c
movslq 0x178(%rsp), %rsi
leaq 0x1c0(%rsp), %rdi
callq 0x12f10
movq %rdx, 0x40(%rsp)
movq %rax, 0x48(%rsp)
jmp 0x997d
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rcx, 0x118(%rsp)
movq %rax, 0x120(%rsp)
leaq 0x118(%rsp), %rdi
movl $0x1, %esi
callq 0x12f70
movl $0x0, 0x114(%rsp)
movq 0xc8(%rsp), %rdi
movslq 0x114(%rsp), %rax
movq %rax, 0x38(%rsp)
addq $0x48, %rdi
movslq 0x178(%rsp), %rsi
callq 0x11d60
movq %rax, %rdi
addq $0x18, %rdi
callq 0x4c10
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x9bcd
movq 0xc8(%rsp), %rdi
addq $0x48, %rdi
movslq 0x178(%rsp), %rsi
callq 0x11d60
movq %rax, %rdi
addq $0x18, %rdi
movslq 0x114(%rsp), %rsi
callq 0x12960
movslq (%rax), %rsi
leaq 0x1c0(%rsp), %rdi
callq 0x12f10
movq %rdx, 0x28(%rsp)
movq %rax, 0x30(%rsp)
jmp 0x9a40
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x100(%rsp)
movq %rax, 0x108(%rsp)
leaq 0x100(%rsp), %rdi
callq 0x12fc0
andb $0x1, %al
movzbl %al, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x27(%rsp)
jne 0x9af6
movq 0xc8(%rsp), %rdi
addq $0x48, %rdi
movslq 0x178(%rsp), %rsi
callq 0x11d60
movq %rax, %rdi
addq $0x18, %rdi
movslq 0x114(%rsp), %rsi
callq 0x12960
movslq (%rax), %rsi
leaq 0x180(%rsp), %rdi
callq 0x12f10
movq %rdx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
jmp 0x9ac0
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, 0xf0(%rsp)
movq %rax, 0xf8(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x12fc0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x9b03
jmp 0x9bb5
movq 0xc8(%rsp), %rdi
addq $0x48, %rdi
movslq 0x178(%rsp), %rsi
callq 0x11d60
movq %rax, %rdi
addq $0x18, %rdi
movslq 0x114(%rsp), %rsi
callq 0x12960
movq %rax, %rsi
leaq 0x1e8(%rsp), %rdi
callq 0x12ee0
jmp 0x9b42
movq 0xc8(%rsp), %rdi
addq $0x48, %rdi
movslq 0x178(%rsp), %rsi
callq 0x11d60
movq %rax, %rdi
addq $0x18, %rdi
movslq 0x114(%rsp), %rsi
callq 0x12960
movslq (%rax), %rsi
leaq 0x180(%rsp), %rdi
callq 0x12f10
movq %rdx, (%rsp)
movq %rax, 0x8(%rsp)
jmp 0x9b8a
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0xe0(%rsp)
movq %rax, 0xe8(%rsp)
leaq 0xe0(%rsp), %rdi
movl $0x1, %esi
callq 0x12f70
jmp 0x9bb7
movl 0x114(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x114(%rsp)
jmp 0x99b4
jmp 0x9906
movl $0x0, 0x174(%rsp)
leaq 0x180(%rsp), %rdi
callq 0x13030
leaq 0x1c0(%rsp), %rdi
callq 0x13030
leaq 0x1e8(%rsp), %rdi
callq 0x13040
addq $0x248, %rsp            # imm = 0x248
retq
leaq 0x1c0(%rsp), %rdi
callq 0x13030
leaq 0x1e8(%rsp), %rdi
callq 0x13040
movq 0x1b0(%rsp), %rdi
callq 0x34e0
nopw %cs:(%rax,%rax)