// File: Laakeri[P]Triangulator/src/minfill.cpp
// Function: MinFill::SolveAtom::findCycle2(Graph const&, int, int, std::vector<int, std::allocator<int>>&)
vector<int> findCycle2(const Graph& G, int x, int y, vector<int>& removedFromB) {
	int bfsBack = 0;
	int tmpBack = 0;
	bfs[bfsBack++] = y;
	d[y] = 1;
	int i2 = 1;
	for (int ny : G.g[y]) {
		if (!del1[ny] && !removedFromB[ny]) {
			d[ny] = 1;
			from[ny] = y;
			bfs[bfsBack++] = ny;
		}
		else if (ny != x) {
			d[ny] = 1;
			tmp[tmpBack++] = ny;
		}
	}
	bool fo = false;
	while (i2 < bfsBack) {
		int t = bfs[i2++];
		for (int nt : G.g[t]) {
			if (d[nt]) continue;
			if (del1[nt]) continue;
			if (nt == x) {
				fo = true;
				from[x] = t;
				bfs[bfsBack++] = nt;
				break;
			}
			d[nt] = d[t]+1;
			from[nt] = t;
			bfs[bfsBack++] = nt;
		}
		if (fo) break;
	}
	vector<int> ret;
	if (fo) {
		while (x != y) {
			ret.push_back(x);
			x = from[x];
		}
		ret.push_back(y);
	}
	for (int i = 0; i < bfsBack; i++) {
		d[bfs[i]] = 0;
		from[bfs[i]] = 0;
	}
	for (int i = 0; i < tmpBack; i++) {
		d[tmp[i]] = 0;
		from[tmp[i]] = 0;
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0xa0(%rbp)
movq %rdi, %rax
movq %rax, -0x98(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x18(%rbp), %edx
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %eax, %rcx
leaq 0x5a0adc(%rip), %rax    # 0x5d1650
movl %edx, (%rax,%rcx,4)
movslq -0x18(%rbp), %rcx
leaq 0x50e30e(%rip), %rax    # 0x53ee90
movl $0x1, (%rax,%rcx,4)
movl $0x1, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x18(%rbp), %rsi
callq 0xbba0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x6680
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x66b0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x30bd5
jmp 0x30c8d
leaq -0x40(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
movslq -0x4c(%rbp), %rcx
leaq 0x4dd562(%rip), %rax    # 0x50e150
cmpl $0x0, (%rax,%rcx,4)
jne 0x30c46
movq -0x20(%rbp), %rdi
movslq -0x4c(%rbp), %rsi
callq 0x178f0
cmpl $0x0, (%rax)
jne 0x30c46
movslq -0x4c(%rbp), %rcx
leaq 0x50e27f(%rip), %rax    # 0x53ee90
movl $0x1, (%rax,%rcx,4)
movl -0x18(%rbp), %edx
movslq -0x4c(%rbp), %rcx
leaq 0x53efaa(%rip), %rax    # 0x56fbd0
movl %edx, (%rax,%rcx,4)
movl -0x4c(%rbp), %edx
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %eax, %rcx
leaq 0x5a0a0f(%rip), %rax    # 0x5d1650
movl %edx, (%rax,%rcx,4)
jmp 0x30c7d
movl -0x4c(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x30c7b
movslq -0x4c(%rbp), %rcx
leaq 0x50e237(%rip), %rax    # 0x53ee90
movl $0x1, (%rax,%rcx,4)
movl -0x4c(%rbp), %edx
movl -0x28(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x28(%rbp)
movslq %eax, %rcx
leaq 0x5d1718(%rip), %rax    # 0x602390
movl %edx, (%rax,%rcx,4)
jmp 0x30c7d
jmp 0x30c7f
leaq -0x40(%rbp), %rdi
callq 0xbc80
jmp 0x30bbf
movb $0x0, -0x4d(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x30dd7
movl -0x2c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x2c(%rbp)
movslq %eax, %rcx
leaq 0x5a099e(%rip), %rax    # 0x5d1650
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x54(%rbp), %rsi
callq 0xbba0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x6680
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
callq 0x66b0
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x30cfd
jmp 0x30dca
leaq -0x68(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0x74(%rbp)
movslq -0x74(%rbp), %rcx
leaq 0x50e17a(%rip), %rax    # 0x53ee90
cmpl $0x0, (%rax,%rcx,4)
je 0x30d21
jmp 0x30dbc
movslq -0x74(%rbp), %rcx
leaq 0x4dd424(%rip), %rax    # 0x50e150
cmpl $0x0, (%rax,%rcx,4)
je 0x30d37
jmp 0x30dbc
movl -0x74(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x30d71
movb $0x1, -0x4d(%rbp)
movl -0x54(%rbp), %edx
movslq -0x14(%rbp), %rcx
leaq 0x53ee7f(%rip), %rax    # 0x56fbd0
movl %edx, (%rax,%rcx,4)
movl -0x74(%rbp), %edx
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %eax, %rcx
leaq 0x5a08e4(%rip), %rax    # 0x5d1650
movl %edx, (%rax,%rcx,4)
jmp 0x30dca
movslq -0x54(%rbp), %rcx
leaq 0x50e114(%rip), %rax    # 0x53ee90
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movslq -0x74(%rbp), %rcx
leaq 0x50e103(%rip), %rax    # 0x53ee90
movl %edx, (%rax,%rcx,4)
movl -0x54(%rbp), %edx
movslq -0x74(%rbp), %rcx
leaq 0x53ee32(%rip), %rax    # 0x56fbd0
movl %edx, (%rax,%rcx,4)
movl -0x74(%rbp), %edx
movl -0x24(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %eax, %rcx
leaq 0x5a0897(%rip), %rax    # 0x5d1650
movl %edx, (%rax,%rcx,4)
leaq -0x68(%rbp), %rdi
callq 0xbc80
jmp 0x30ce7
testb $0x1, -0x4d(%rbp)
je 0x30dd2
jmp 0x30dd7
jmp 0x30c91
movq -0xa0(%rbp), %rdi
movb $0x0, -0x75(%rbp)
callq 0xdf40
testb $0x1, -0x4d(%rbp)
je 0x30e50
jmp 0x30def
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0x30e3c
movq -0xa0(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0xdff0
jmp 0x30e09
movslq -0x14(%rbp), %rcx
leaq 0x53edbc(%rip), %rax    # 0x56fbd0
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
jmp 0x30def
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
callq 0x6d30
jmp 0x30f42
movq -0xa0(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xdff0
jmp 0x30e4e
jmp 0x30e50
movl $0x0, -0x88(%rbp)
movl -0x88(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x30eb6
movslq -0x88(%rbp), %rcx
leaq 0x5a07dd(%rip), %rax    # 0x5d1650
movslq (%rax,%rcx,4), %rcx
leaq 0x50e012(%rip), %rax    # 0x53ee90
movl $0x0, (%rax,%rcx,4)
movslq -0x88(%rbp), %rcx
leaq 0x5a07bd(%rip), %rax    # 0x5d1650
movslq (%rax,%rcx,4), %rcx
leaq 0x53ed32(%rip), %rax    # 0x56fbd0
movl $0x0, (%rax,%rcx,4)
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x30e5a
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x30f1c
movslq -0x8c(%rbp), %rcx
leaq 0x5d14b7(%rip), %rax    # 0x602390
movslq (%rax,%rcx,4), %rcx
leaq 0x50dfac(%rip), %rax    # 0x53ee90
movl $0x0, (%rax,%rcx,4)
movslq -0x8c(%rbp), %rcx
leaq 0x5d1497(%rip), %rax    # 0x602390
movslq (%rax,%rcx,4), %rcx
leaq 0x53eccc(%rip), %rax    # 0x56fbd0
movl $0x0, (%rax,%rcx,4)
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x30ec0
movb $0x1, -0x75(%rbp)
testb $0x1, -0x75(%rbp)
jne 0x30f32
movq -0xa0(%rbp), %rdi
callq 0x6d30
movq -0x98(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x3480
nopl (%rax,%rax)