// File: /workspace/github_cpp_makefile_star2_O3/Laakeri[P]Triangulator/src/MCS.cpp
// Function: MCS::MCS_L(Graph const&, int, std::vector<int, std::allocator<int>> const&)
vector<int> MCS_L(const Graph& G, int sv, const vector<int>& rmV) {
	assert(rmV[sv] == 0);
	vector<int> order;
	q[0].push_back(sv);
	int mLb = 0;
	while (mLb >= 0) {
		if (q[mLb].size() == 0) {
			mLb--;
			continue;
		}
		int x = q[mLb].back();
		q[mLb].pop_back();
		if (tr[x]) continue;
		order.push_back(x);
		for (int nx : G.g[x]) {
			if (!rmV[nx] && !tr[nx]) {
				lb[nx]++;
				q[lb[nx]].push_back(nx);
				mLb = max(mLb, lb[nx]);
			}
		}
		tr[x] = 1;
	}
	reverse(order.begin(), order.end());
	for (int x : order) {
		tr[x] = 0;
		lb[x] = 0;
	}
	return order;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rsi, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movslq %edx, %rax
movq (%rcx), %rcx
cmpl $0x0, (%rcx,%rax,4)
jne 0x1399d
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x1469f4(%rip), %rsi    # 0x15a1d8
cmpq 0x1469f5(%rip), %rsi    # 0x15a1e0
movq %rdi, 0x10(%rsp)
je 0x13801
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x1469d9(%rip)    # 0x15a1d8
jmp 0x13812
leaq 0x1469c8(%rip), %rdi    # 0x15a1d0
leaq 0x1c(%rsp), %rdx
callq 0x92c4
xorl %r13d, %r13d
leaq 0x1469b4(%rip), %r15    # 0x15a1d0
leaq 0x35fb6d(%rip), %rbp    # 0x373390
movl %r13d, %eax
leaq (%rax,%rax,2), %rcx
movq 0x8(%r15,%rcx,8), %rdx
cmpq (%r15,%rcx,8), %rdx
je 0x13867
movslq -0x4(%rdx), %rax
addq $-0x4, %rdx
movl %eax, 0x8(%rsp)
movq %rdx, 0x8(%r15,%rcx,8)
cmpl $0x0, (%rbp,%rax,4)
jne 0x1391f
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x1386f
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x1387c
decl %r13d
jmp 0x1391f
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x92c4
movslq 0x8(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x38(%rcx), %rcx
leaq (%rax,%rax,2), %rdx
movq (%rcx,%rdx,8), %rbx
movq 0x8(%rcx,%rdx,8), %r12
cmpq %r12, %rbx
je 0x13912
movl (%rbx), %eax
movl %eax, 0xc(%rsp)
movslq %eax, %rcx
movq (%r14), %rdx
cmpl $0x0, (%rdx,%rcx,4)
jne 0x13904
cmpl $0x0, (%rbp,%rcx,4)
jne 0x13904
leaq 0x32ed94(%rip), %rsi    # 0x342650
movslq (%rsi,%rcx,4), %rdx
incq %rdx
movl %edx, (%rsi,%rcx,4)
leaq (%rdx,%rdx,2), %rcx
leaq (%r15,%rcx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x138e4
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x138ee
leaq 0xc(%rsp), %rdx
callq 0x92c4
movslq 0xc(%rsp), %rax
leaq 0x32ed56(%rip), %rcx    # 0x342650
movl (%rcx,%rax,4), %eax
cmpl %eax, %r13d
cmovlel %eax, %r13d
addq $0x4, %rbx
cmpq %r12, %rbx
jne 0x1389c
movslq 0x8(%rsp), %rax
movl $0x1, (%rbp,%rax,4)
movq 0x10(%rsp), %rbx
testl %r13d, %r13d
jns 0x13823
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rcx, %rax
setne %sil
leaq -0x4(%rcx), %rdx
cmpq %rax, %rdx
seta %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x1396a
leaq 0x4(%rax), %rsi
movl -0x4(%rsi), %edi
movl (%rdx), %r8d
movl %r8d, -0x4(%rsi)
movl %edi, (%rdx)
addq $-0x4, %rdx
leaq 0x4(%rsi), %rdi
cmpq %rdx, %rsi
movq %rdi, %rsi
jb 0x1394e
cmpq %rcx, %rax
leaq 0x32ecdc(%rip), %rdi    # 0x342650
je 0x1398b
xorl %edx, %edx
movslq (%rax), %rsi
movl %edx, (%rbp,%rsi,4)
movl %edx, (%rdi,%rsi,4)
addq $0x4, %rax
cmpq %rcx, %rax
jne 0x13978
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1642d(%rip), %rdi     # 0x29dd1
leaq 0x16334(%rip), %rsi     # 0x29cdf
leaq 0x1642c(%rip), %rcx     # 0x29dde
movl $0xa8, %edx
callq 0x2140
jmp 0x139c0
jmp 0x139c0
movq %rax, %r14
movq 0x10(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x139e1
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x2210
movq %r14, %rdi
callq 0x2310