// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x8(%rsp)
movl %edx, (%rsp)
movl %ecx, 0x4(%rsp)
movl %ecx, 0x576a82(%rip)    # 0x58d570
movslq %ecx, %rdi
leaq 0x4e42b8(%rip), %r15    # 0x4fadb0
movl $0x1, (%r15,%rdi,4)
movq 0x38(%rsi), %rax
leaq (%rdi,%rdi,2), %rdi
movq (%rax,%rdi,8), %rsi
movq %rax, 0x20(%rsp)
movq 0x8(%rax,%rdi,8), %rdi
cmpq %rdi, %rsi
je 0x16ba8
movq (%r8), %r8
movq $0x0, 0x10(%rsp)
movl $0x1, %r13d
leaq 0x4b3538(%rip), %r9     # 0x4ca070
leaq 0x514fb1(%rip), %rax    # 0x52baf0
leaq 0x576a2a(%rip), %r11    # 0x58d570
leaq 0x5a7763(%rip), %rbx    # 0x5be2b0
movl (%rsi), %ebp
movslq %ebp, %r14
cmpl $0x0, (%r9,%r14,4)
jne 0x16b60
cmpl $0x0, (%r8,%r14,4)
je 0x16b81
cmpl %edx, %ebp
je 0x16b9d
movl $0x1, (%r15,%r14,4)
movq 0x10(%rsp), %r10
movl %r10d, %r14d
incl %r10d
movq %rbx, %r12
movq %r10, 0x10(%rsp)
jmp 0x16b96
movl $0x1, (%r15,%r14,4)
movl %ecx, (%rax,%r14,4)
movl %r13d, %r14d
incl %r13d
movq %r11, %r12
movslq %r14d, %r10
movl %ebp, (%r12,%r10,4)
addq $0x4, %rsi
cmpq %rdi, %rsi
jne 0x16b4d
jmp 0x16bb7
movl $0x1, %r13d
movq $0x0, 0x10(%rsp)
movslq %edx, %rax
movq %rax, 0x18(%rsp)
movl $0x1, %edi
xorl %ecx, %ecx
leaq 0x5769a3(%rip), %rbx    # 0x58d570
leaq 0x4b349c(%rip), %r8     # 0x4ca070
leaq 0x514f15(%rip), %rbp    # 0x52baf0
movslq %r13d, %rsi
cmpq %rsi, %rdi
jge 0x16c72
movq %rbx, %rax
movl (%rbx,%rdi,4), %r9d
movslq %r9d, %r10
leaq (%r10,%r10,2), %rsi
movq 0x20(%rsp), %rbx
movq (%rbx,%rsi,8), %r11
movq 0x8(%rbx,%rsi,8), %rbx
cmpq %rbx, %r11
je 0x16c63
movl (%r11), %esi
movslq %esi, %r14
movl $0x7, %r12d
cmpl $0x0, (%r15,%r14,4)
jne 0x16c52
cmpl $0x0, (%r8,%r14,4)
jne 0x16c52
cmpl %edx, %esi
jne 0x16c35
movl $0x6, %r12d
movb $0x1, %cl
movq 0x18(%rsp), %r14
jmp 0x16c43
movl (%r15,%r10,4), %r12d
incl %r12d
movl %r12d, (%r15,%r14,4)
xorl %r12d, %r12d
movl %r9d, (%rbp,%r14,4)
movslq %r13d, %r14
incl %r13d
movl %esi, (%rax,%r14,4)
cmpl $0x7, %r12d
je 0x16c5d
testl %r12d, %r12d
jne 0x16c63
addq $0x4, %r11
jmp 0x16c03
incq %rdi
testb $0x1, %cl
movq %rax, %rbx
je 0x16bdb
xorps %xmm0, %xmm0
movq 0x8(%rsp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
testb $0x1, %cl
je 0x16cf3
movl (%rsp), %eax
movl 0x4(%rsp), %ecx
cmpl %ecx, %eax
je 0x16cce
movq %rsp, %r14
movq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x16cb3
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x16cbb
movq %r14, %rdx
callq 0x8fde
movslq (%rsp), %rax
movl (%rbp,%rax,4), %eax
movl %eax, (%rsp)
movl 0x4(%rsp), %ecx
cmpl %ecx, %eax
jne 0x16c98
movq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x16ce9
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x16cf3
leaq 0x4(%rsp), %rdx
callq 0x8fde
testl %r13d, %r13d
jle 0x16d18
movl %r13d, %eax
shlq $0x2, %rax
xorl %ecx, %ecx
xorl %edx, %edx
movslq (%rdx,%rbx), %rsi
movl %ecx, (%r15,%rsi,4)
movl %ecx, (%rbp,%rsi,4)
addq $0x4, %rdx
cmpq %rdx, %rax
jne 0x16d03
movq 0x10(%rsp), %rax
testl %eax, %eax
jle 0x16d47
movl %eax, %eax
shlq $0x2, %rax
xorl %ecx, %ecx
leaq 0x5a7580(%rip), %rdx    # 0x5be2b0
xorl %esi, %esi
movslq (%rsi,%rdx), %rdi
movl %ecx, (%r15,%rdi,4)
movl %ecx, (%rbp,%rdi,4)
addq $0x4, %rsi
cmpq %rsi, %rax
jne 0x16d32
movq 0x8(%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16d5d
movq %rax, %r14
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x16d7e
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x2210
movq %r14, %rdi
callq 0x2310