// File: Laakeri[P]Triangulator/src/MCS.cpp
// Function: MCS::getChordlessCycle(Graph const&, int, std::vector<int, std::allocator<int>>&)
vector<int> getChordlessCycle(const Graph& G, int sv, vector<int>& rmV) {
	vector<int> order = MCS_L(G, sv, rmV);
	for (int i = 0; i < (int)order.size(); i++) {
		invOrd[order[i]] = i;
	}
	vector<int> ret;
	for (int i = 0; i < (int)order.size(); i++) {
		int w = order[i];
		f[w] = w;
		index[w] = i;
		for (int v : G.g[w]) {
			if (invOrd[v] >= i || rmV[v]) continue;
			index[v] = i;
			if (f[v] == v) f[v] = w;
		}
		for (int v : G.g[w]) {
			if (invOrd[v] >= i || rmV[v]) continue;
			if (index[f[v]] < i) {
				for (int nx : G.g[v]) {
					if (!rmV[nx]) mk[nx] = 1;
				}
				for (int nx : G.g[w]) {
					if (mk[nx]) rmV[nx] = 1;
				}
				ret = findShortestPath(G, v, w, rmV);
				assert(ret.size() > 3);
				for (int nx : G.g[w]) {
					if (mk[nx]) rmV[nx] = 0;
				}
				for (int nx : G.g[v]) {
					mk[nx] = 0;
				}
				break;
			}
		}
		if (ret.size() > 0) break;
	}
	if (ret.size() > 0) assert(ret.size() > 3);
	for (int x : order) {
		index[x] = 0;
		f[x] = 0;
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x160(%rbp)
movq %rdi, %rax
movq %rax, -0x158(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
leaq -0x38(%rbp), %rdi
callq 0x29a80
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x164(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x59a0
movq %rax, %rcx
movl -0x164(%rbp), %eax
cmpl %ecx, %eax
jge 0x2c539
movl -0x3c(%rbp), %eax
movl %eax, -0x168(%rbp)
movslq -0x3c(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x178f0
movl -0x168(%rbp), %edx
movslq (%rax), %rcx
leaq 0x480185(%rip), %rax    # 0x4ac6b0
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x2c4e6
movq -0x160(%rbp), %rdi
movb $0x0, -0x3d(%rbp)
callq 0xdf40
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x16c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x59a0
movq %rax, %rcx
movl -0x16c(%rbp), %eax
cmpl %ecx, %eax
jge 0x2ca64
movslq -0x44(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x178f0
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %edx
movslq -0x48(%rbp), %rcx
leaq 0x44f3dd(%rip), %rax    # 0x47b970
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %edx
movslq -0x48(%rbp), %rcx
leaq 0x41e68c(%rip), %rax    # 0x44ac30
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x48(%rbp), %rsi
callq 0xbba0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x6680
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x66b0
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x2c5e9
jmp 0x2c663
leaq -0x58(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movslq -0x64(%rbp), %rcx
leaq 0x4800ae(%rip), %rax    # 0x4ac6b0
movl (%rax,%rcx,4), %eax
cmpl -0x44(%rbp), %eax
jge 0x2c61c
movq -0x20(%rbp), %rdi
movslq -0x64(%rbp), %rsi
callq 0x178f0
cmpl $0x0, (%rax)
je 0x2c61e
jmp 0x2c655
movl -0x44(%rbp), %edx
movslq -0x64(%rbp), %rcx
leaq 0x41e604(%rip), %rax    # 0x44ac30
movl %edx, (%rax,%rcx,4)
movslq -0x64(%rbp), %rcx
leaq 0x44f336(%rip), %rax    # 0x47b970
movl (%rax,%rcx,4), %eax
cmpl -0x64(%rbp), %eax
jne 0x2c653
movl -0x48(%rbp), %edx
movslq -0x64(%rbp), %rcx
leaq 0x44f320(%rip), %rax    # 0x47b970
movl %edx, (%rax,%rcx,4)
jmp 0x2c655
leaq -0x58(%rbp), %rdi
callq 0xbc80
jmp 0x2c5d6
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x48(%rbp), %rsi
callq 0xbba0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x6680
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
callq 0x66b0
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x2c6a8
jmp 0x2ca40
leaq -0x78(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0x84(%rbp)
movslq -0x84(%rbp), %rcx
leaq 0x47ffe9(%rip), %rax    # 0x4ac6b0
movl (%rax,%rcx,4), %eax
cmpl -0x44(%rbp), %eax
jge 0x2c6e4
movq -0x20(%rbp), %rdi
movslq -0x84(%rbp), %rsi
callq 0x178f0
cmpl $0x0, (%rax)
je 0x2c6e9
jmp 0x2ca32
movslq -0x84(%rbp), %rcx
leaq 0x44f279(%rip), %rax    # 0x47b970
movslq (%rax,%rcx,4), %rcx
leaq 0x41e52e(%rip), %rax    # 0x44ac30
movl (%rax,%rcx,4), %eax
cmpl -0x44(%rbp), %eax
jge 0x2ca30
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x84(%rbp), %rsi
callq 0xbba0
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
callq 0x6680
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
callq 0x66b0
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x2c768
jmp 0x2c7b6
leaq -0x98(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0xa4(%rbp)
movq -0x20(%rbp), %rdi
movslq -0xa4(%rbp), %rsi
callq 0x178f0
cmpl $0x0, (%rax)
jne 0x2c7a6
movslq -0xa4(%rbp), %rcx
leaq 0x4b0c51(%rip), %rax    # 0x4dd3f0
movl $0x1, (%rax,%rcx,4)
jmp 0x2c7a8
leaq -0x98(%rbp), %rdi
callq 0xbc80
jmp 0x2c74f
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x48(%rbp), %rsi
callq 0xbba0
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x6680
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x66b0
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x2c80d
jmp 0x2c85b
leaq -0xb8(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0xc4(%rbp)
movslq -0xc4(%rbp), %rcx
leaq 0x4b0bc1(%rip), %rax    # 0x4dd3f0
cmpl $0x0, (%rax,%rcx,4)
je 0x2c84b
movq -0x20(%rbp), %rdi
movslq -0xc4(%rbp), %rsi
callq 0x178f0
movl $0x1, (%rax)
jmp 0x2c84d
leaq -0xb8(%rbp), %rdi
callq 0xbc80
jmp 0x2c7f4
movq -0x10(%rbp), %rsi
movl -0x84(%rbp), %edx
movl -0x48(%rbp), %ecx
movq -0x20(%rbp), %r8
leaq -0xe0(%rbp), %rdi
callq 0x2c170
jmp 0x2c87a
movq -0x160(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x12580
leaq -0xe0(%rbp), %rdi
callq 0x6d30
movq -0x160(%rbp), %rdi
callq 0x59a0
cmpq $0x3, %rax
jbe 0x2c8ad
jmp 0x2c8f8
leaq 0x2d795(%rip), %rdi     # 0x5a049
leaq 0x2d3f4(%rip), %rsi     # 0x59caf
movl $0x1f0, %edx            # imm = 0x1F0
leaq 0x2d791(%rip), %rcx     # 0x5a058
callq 0x31a0
movq -0x160(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
callq 0x6d30
leaq -0x38(%rbp), %rdi
callq 0x6d30
jmp 0x2cb70
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x48(%rbp), %rsi
callq 0xbba0
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x6680
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x66b0
movq %rax, -0x108(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x2c94f
jmp 0x2c99d
leaq -0x100(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0x10c(%rbp)
movslq -0x10c(%rbp), %rcx
leaq 0x4b0a7f(%rip), %rax    # 0x4dd3f0
cmpl $0x0, (%rax,%rcx,4)
je 0x2c98d
movq -0x20(%rbp), %rdi
movslq -0x10c(%rbp), %rsi
callq 0x178f0
movl $0x0, (%rax)
jmp 0x2c98f
leaq -0x100(%rbp), %rdi
callq 0xbc80
jmp 0x2c936
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x84(%rbp), %rsi
callq 0xbba0
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rdi
callq 0x6680
movq %rax, -0x120(%rbp)
movq -0x118(%rbp), %rdi
callq 0x66b0
movq %rax, -0x128(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x2c9f7
jmp 0x2ca2e
leaq -0x120(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0x12c(%rbp)
movslq -0x12c(%rbp), %rcx
leaq 0x4b09d7(%rip), %rax    # 0x4dd3f0
movl $0x0, (%rax,%rcx,4)
leaq -0x120(%rbp), %rdi
callq 0xbc80
jmp 0x2c9de
jmp 0x2ca40
jmp 0x2ca32
leaq -0x78(%rbp), %rdi
callq 0xbc80
jmp 0x2c692
movq -0x160(%rbp), %rdi
callq 0x59a0
cmpq $0x0, %rax
jbe 0x2ca54
jmp 0x2ca64
jmp 0x2ca56
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x2c550
movq -0x160(%rbp), %rdi
callq 0x59a0
cmpq $0x0, %rax
jbe 0x2caab
movq -0x160(%rbp), %rdi
callq 0x59a0
cmpq $0x3, %rax
jbe 0x2ca8a
jmp 0x2caa9
leaq 0x2d5b8(%rip), %rdi     # 0x5a049
leaq 0x2d217(%rip), %rsi     # 0x59caf
movl $0x1fc, %edx            # imm = 0x1FC
leaq 0x2d5b4(%rip), %rcx     # 0x5a058
callq 0x31a0
jmp 0x2caab
leaq -0x38(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rdi
callq 0xe060
movq %rax, -0x140(%rbp)
movq -0x138(%rbp), %rdi
callq 0xe090
movq %rax, -0x148(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0xe0c0
testb $0x1, %al
jne 0x2caf5
jmp 0x2cb41
leaq -0x140(%rbp), %rdi
callq 0xe100
movl (%rax), %eax
movl %eax, -0x14c(%rbp)
movslq -0x14c(%rbp), %rcx
leaq 0x41e119(%rip), %rax    # 0x44ac30
movl $0x0, (%rax,%rcx,4)
movslq -0x14c(%rbp), %rcx
leaq 0x44ee44(%rip), %rax    # 0x47b970
movl $0x0, (%rax,%rcx,4)
leaq -0x140(%rbp), %rdi
callq 0xe120
jmp 0x2cadc
movb $0x1, -0x3d(%rbp)
testb $0x1, -0x3d(%rbp)
jne 0x2cb57
movq -0x160(%rbp), %rdi
callq 0x6d30
leaq -0x38(%rbp), %rdi
callq 0x6d30
movq -0x158(%rbp), %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0xe8(%rbp), %rdi
callq 0x3480
nopl (%rax)