// File: 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
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0xa0(%rbp)
movq %rdi, %rax
movq %rax, -0x98(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x17a50
cmpl $0x0, (%rax)
jne 0x29abf
jmp 0x29ade
leaq 0x302db(%rip), %rdi     # 0x59da1
leaq 0x301e2(%rip), %rsi     # 0x59caf
movl $0xa8, %edx
leaq 0x302d5(%rip), %rcx     # 0x59dae
callq 0x31a0
movq -0xa0(%rbp), %rdi
movb $0x0, -0x21(%rbp)
callq 0xdf40
leaq 0x1757bb(%rip), %rdi    # 0x19f2b0
leaq -0x14(%rbp), %rsi
callq 0xdff0
jmp 0x29b00
movl $0x0, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jl 0x29cb0
movslq -0x38(%rbp), %rax
leaq 0x175794(%rip), %rdi    # 0x19f2b0
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x59a0
cmpq $0x0, %rax
jne 0x29b56
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x29b07
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x6d30
jmp 0x29d89
movslq -0x38(%rbp), %rax
leaq 0x17574f(%rip), %rdi    # 0x19f2b0
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x17940
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movslq -0x38(%rbp), %rax
leaq 0x175733(%rip), %rdi    # 0x19f2b0
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x178c0
movslq -0x3c(%rbp), %rcx
leaq 0x38e8dc(%rip), %rax    # 0x3b8470
cmpl $0x0, (%rax,%rcx,4)
je 0x29b9f
jmp 0x29b07
movq -0xa0(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0xdff0
jmp 0x29bb1
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x3c(%rbp), %rsi
callq 0xbba0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x6680
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
callq 0x66b0
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xbbc0
testb $0x1, %al
jne 0x29bf6
jmp 0x29c99
leaq -0x50(%rbp), %rdi
callq 0xbc00
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x5c(%rbp), %rsi
callq 0x17a50
cmpl $0x0, (%rax)
jne 0x29c89
movslq -0x5c(%rbp), %rcx
leaq 0x38e84f(%rip), %rax    # 0x3b8470
cmpl $0x0, (%rax,%rcx,4)
jne 0x29c89
movslq -0x5c(%rbp), %rcx
leaq 0x35dafe(%rip), %rax    # 0x387730
movl (%rax,%rcx,4), %edx
incl %edx
movl %edx, (%rax,%rcx,4)
movslq -0x5c(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
leaq (%rax,%rax,2), %rcx
leaq 0x175663(%rip), %rax    # 0x19f2b0
leaq (%rax,%rcx,8), %rdi
leaq -0x5c(%rbp), %rsi
callq 0xdff0
jmp 0x29c5c
movslq -0x5c(%rbp), %rcx
leaq 0x35dac9(%rip), %rax    # 0x387730
leaq (%rax,%rcx,4), %rsi
leaq -0x38(%rbp), %rdi
callq 0x23c80
movq %rax, -0xa8(%rbp)
jmp 0x29c7d
movq -0xa8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x38(%rbp)
jmp 0x29c8b
leaq -0x50(%rbp), %rdi
callq 0xbc80
jmp 0x29be0
movslq -0x3c(%rbp), %rcx
leaq 0x38e7cc(%rip), %rax    # 0x3b8470
movl $0x1, (%rax,%rcx,4)
jmp 0x29b07
movq -0xa0(%rbp), %rdi
callq 0xe060
movq -0xa0(%rbp), %rdi
movq %rax, -0x68(%rbp)
callq 0xe090
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x2ddc0
jmp 0x29cdf
movq -0xa0(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0xe060
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
callq 0xe090
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xe0c0
testb $0x1, %al
jne 0x29d1d
jmp 0x29d63
leaq -0x80(%rbp), %rdi
callq 0xe100
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
movslq -0x8c(%rbp), %rcx
leaq 0x38e734(%rip), %rax    # 0x3b8470
movl $0x0, (%rax,%rcx,4)
movslq -0x8c(%rbp), %rcx
leaq 0x35d9df(%rip), %rax    # 0x387730
movl $0x0, (%rax,%rcx,4)
leaq -0x80(%rbp), %rdi
callq 0xe120
jmp 0x29d07
movb $0x1, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
jne 0x29d79
movq -0xa0(%rbp), %rdi
callq 0x6d30
movq -0x98(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x3480
nopw %cs:(%rax,%rax)