// File: datourat[P]IP-label-for-graph-reachability/Graph.cpp
// Function: Graph::IPtest(int, int)
bool Graph::IPtest(const int u, const int v){
	int it1=0, it2=0;

	if(reachindex[u].Label[ reachindex[u].OutLimit-1 ] > reachindex[v].Label[0] ){
		while(it1!=reachindex[u].OutLimit && it2!=reachindex[v].OutLimit){
			if(reachindex[u].Label[it1] == reachindex[v].Label[it2]){
				it1++;
				it2++;
			}else if(reachindex[u].Label[it1] < reachindex[v].Label[it2]){
				it1++;
			}else
				return true;
		}
	}
	
	if(reachindex[v].Label[ reachindex[v].InLimit-1 ] <= reachindex[u].Label[ reachindex[u].OutLimit ])
		return false;

	it1=reachindex[v].OutLimit;
	it2=reachindex[u].OutLimit;

	while(it1!= reachindex[v].InLimit && it2!=reachindex[u].InLimit){
		if(reachindex[v].Label[it1] == reachindex[u].Label[it2]){
			it1++;
			it2++;
		}else if(reachindex[v].Label[it1] < reachindex[u].Label[it2]){
			it1++;
		}else
			return true;
	}

	return false;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movl %esi, 0x64(%rsp)
movl %edx, 0x60(%rsp)
movq 0x68(%rsp), %rdi
movq %rdi, 0x40(%rsp)
movl $0x0, 0x5c(%rsp)
movl $0x0, 0x58(%rsp)
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movq 0x40(%rsp), %rdi
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movq 0x40(%rsp), %rdi
movq %rax, %rcx
movq 0x48(%rsp), %rax
movzbl 0x4(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x54(%rsp)
addq $0xa8, %rdi
movslq 0x60(%rsp), %rsi
callq 0x142b0
movq %rax, %rcx
movl 0x54(%rsp), %eax
movq 0x8(%rcx), %rcx
cmpl (%rcx), %eax
jle 0x10d88
jmp 0x10c3f
movq 0x40(%rsp), %rdi
movl 0x5c(%rsp), %eax
movl %eax, 0x38(%rsp)
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movl 0x38(%rsp), %ecx
movzbl 0x4(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0x3f(%rsp)
je 0x10ca1
movq 0x40(%rsp), %rdi
movl 0x58(%rsp), %eax
movl %eax, 0x34(%rsp)
addq $0xa8, %rdi
movslq 0x60(%rsp), %rsi
callq 0x142b0
movq %rax, %rcx
movl 0x34(%rsp), %eax
movzbl 0x4(%rcx), %ecx
cmpl %ecx, %eax
setne %al
movb %al, 0x3f(%rsp)
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x10cae
jmp 0x10d86
movq 0x40(%rsp), %rdi
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movq 0x40(%rsp), %rdi
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x30(%rsp)
addq $0xa8, %rdi
movslq 0x60(%rsp), %rsi
callq 0x142b0
movq %rax, %rcx
movl 0x30(%rsp), %eax
movq 0x8(%rcx), %rcx
movslq 0x58(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x10d17
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x10d81
movq 0x40(%rsp), %rdi
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movq 0x40(%rsp), %rdi
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x2c(%rsp)
addq $0xa8, %rdi
movslq 0x60(%rsp), %rsi
callq 0x142b0
movq %rax, %rcx
movl 0x2c(%rsp), %eax
movq 0x8(%rcx), %rcx
movslq 0x58(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x10d75
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x10d7f
movb $0x1, 0x77(%rsp)
jmp 0x10faf
jmp 0x10d81
jmp 0x10c3f
jmp 0x10d88
movq 0x40(%rsp), %rdi
addq $0xa8, %rdi
movslq 0x60(%rsp), %rsi
callq 0x142b0
movq 0x40(%rsp), %rdi
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
addq $0xa8, %rdi
movslq 0x60(%rsp), %rsi
callq 0x142b0
movq 0x40(%rsp), %rdi
movq %rax, %rcx
movq 0x18(%rsp), %rax
movzbl 0x5(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x28(%rsp)
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movq 0x40(%rsp), %rdi
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movq 0x20(%rsp), %rcx
movq %rax, %rdx
movl 0x28(%rsp), %eax
movzbl 0x4(%rdx), %edx
cmpl (%rcx,%rdx,4), %eax
jg 0x10e2a
movb $0x0, 0x77(%rsp)
jmp 0x10faf
movq 0x40(%rsp), %rdi
addq $0xa8, %rdi
movslq 0x60(%rsp), %rsi
callq 0x142b0
movq 0x40(%rsp), %rdi
movzbl 0x4(%rax), %eax
movl %eax, 0x5c(%rsp)
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movzbl 0x4(%rax), %eax
movl %eax, 0x58(%rsp)
movq 0x40(%rsp), %rdi
movl 0x5c(%rsp), %eax
movl %eax, 0x10(%rsp)
addq $0xa8, %rdi
movslq 0x60(%rsp), %rsi
callq 0x142b0
movl 0x10(%rsp), %ecx
movzbl 0x5(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0x17(%rsp)
je 0x10ec8
movq 0x40(%rsp), %rdi
movl 0x58(%rsp), %eax
movl %eax, 0xc(%rsp)
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movq %rax, %rcx
movl 0xc(%rsp), %eax
movzbl 0x5(%rcx), %ecx
cmpl %ecx, %eax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x10ed5
jmp 0x10faa
movq 0x40(%rsp), %rdi
addq $0xa8, %rdi
movslq 0x60(%rsp), %rsi
callq 0x142b0
movq 0x40(%rsp), %rdi
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x8(%rsp)
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movq %rax, %rcx
movl 0x8(%rsp), %eax
movq 0x8(%rcx), %rcx
movslq 0x58(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x10f3e
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x10fa5
movq 0x40(%rsp), %rdi
addq $0xa8, %rdi
movslq 0x60(%rsp), %rsi
callq 0x142b0
movq 0x40(%rsp), %rdi
movq 0x8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x4(%rsp)
addq $0xa8, %rdi
movslq 0x64(%rsp), %rsi
callq 0x142b0
movq %rax, %rcx
movl 0x4(%rsp), %eax
movq 0x8(%rcx), %rcx
movslq 0x58(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x10f9c
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x10fa3
movb $0x1, 0x77(%rsp)
jmp 0x10faf
jmp 0x10fa5
jmp 0x10e66
movb $0x0, 0x77(%rsp)
movb 0x77(%rsp), %al
andb $0x1, %al
addq $0x78, %rsp
retq
nopw (%rax,%rax)