// File: /workspace/github_cpp_makefile_star2_O1/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 0x136fe
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x147c99(%rip), %rsi    # 0x15b1d8
cmpq 0x147c9a(%rip), %rsi    # 0x15b1e0
movq %rdi, 0x10(%rsp)
je 0x1355c
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x147c7e(%rip)    # 0x15b1d8
jmp 0x1356d
leaq 0x147c6d(%rip), %rdi    # 0x15b1d0
leaq 0x1c(%rsp), %rdx
callq 0x8fde
xorl %r13d, %r13d
leaq 0x147c59(%rip), %r15    # 0x15b1d0
leaq 0x360e12(%rip), %rbp    # 0x374390
movl %r13d, %eax
leaq (%rax,%rax,2), %rcx
movq 0x8(%r15,%rcx,8), %rdx
cmpq (%r15,%rcx,8), %rdx
je 0x135cb
leaq (%rax,%rax,2), %rcx
movq 0x8(%r15,%rcx,8), %rdx
movslq -0x4(%rdx), %rax
addq $-0x4, %rdx
movl %eax, 0x8(%rsp)
movq %rdx, 0x8(%r15,%rcx,8)
cmpl $0x0, (%rbp,%rax,4)
jne 0x13680
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x135d3
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x135e0
decl %r13d
jmp 0x13680
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x8fde
movslq 0x8(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x38(%rcx), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rbx
movq 0x8(%rcx,%rax,8), %r12
cmpq %r12, %rbx
je 0x1366e
movl (%rbx), %eax
movl %eax, 0xc(%rsp)
movslq %eax, %rcx
movq (%r14), %rdx
cmpl $0x0, (%rdx,%rcx,4)
jne 0x13668
cmpl $0x0, (%rbp,%rcx,4)
jne 0x13668
leaq 0x330030(%rip), %rsi    # 0x343650
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 0x13648
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x13652
leaq 0xc(%rsp), %rdx
callq 0x8fde
movslq 0xc(%rsp), %rax
leaq 0x32fff2(%rip), %rcx    # 0x343650
movl (%rcx,%rax,4), %eax
cmpl %eax, %r13d
cmovlel %eax, %r13d
addq $0x4, %rbx
jmp 0x135fb
movslq 0x8(%rsp), %rax
movl $0x1, (%rbp,%rax,4)
movq 0x10(%rsp), %rbx
testl %r13d, %r13d
jns 0x1357e
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 0x136cb
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 0x136af
cmpq %rcx, %rax
leaq 0x32ff7b(%rip), %rdi    # 0x343650
je 0x136ec
xorl %edx, %edx
movslq (%rax), %rsi
movl %edx, (%rbp,%rsi,4)
movl %edx, (%rdi,%rsi,4)
addq $0x4, %rax
cmpq %rcx, %rax
jne 0x136d9
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x176bc(%rip), %rdi     # 0x2adc1
leaq 0x175c3(%rip), %rsi     # 0x2accf
leaq 0x176bb(%rip), %rcx     # 0x2adce
movl $0xa8, %edx
callq 0x2140
jmp 0x13721
jmp 0x13721
movq %rax, %r14
movq 0x10(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x13742
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x2210
movq %r14, %rdi
callq 0x2310