// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]Triangulator/src/MCS.cpp
// Function: MCS::MCS_MP(Graph const&)
pair<vector<pair<int, int> >, vector<pair<int, int> > > MCS_MP(const Graph& G) {
	for (int i = 0; i < G.n; i++) {
		label[i] = 0;
		rm[i] = 0;
		reach[i].clear();
		rc[i] = 0;
	}
	vector<pair<int, int> > fill;
	vector<pair<int, int> > order(G.n);
	int s = -1;
	for (int it = G.n-1; it >= 0; it--) {
		int x = -1;
		for (int i = 0; i < G.n; i++) {
			if (rm[i] == 0 && label[i] >= label[x]) {
				x = i;
			}
		}
		assert(x >= 0 && rm[x] == 0 && label[x] < G.n);
		order[it] = {x, (label[x] <= s)};
		s = label[x];
		for (int i = 0; i < G.n; i++) {
			rc[i] = 0;
		}
		rc[x] = 1;
		rm[x] = 1;
		for (int y : G.g[x]) {
			if (rm[y] == 0) {
				rc[y] = 1;
				reach[label[y]].push_back(y);
			}
		}
		for (int j = 0; j < G.n; j++) {
			while (!reach[j].empty()) {
				int y = reach[j].back();
				reach[j].pop_back();
				for (int z : G.g[y]) {
					if (rm[z] == 0 && rc[z] == 0) {
						rc[z] = 1;
						if (label[z] > j) {
							reach[label[z]].push_back(z);
							label[z]++;
							fill.push_back({x, z});
						}
						else {
							reach[j].push_back(z);
						}
					}
				}
			}
		}
		for (int y : G.g[x]) {
			if (rm[y] == 0) {
				label[y]++;
			}
		}
	}
	return {fill, order};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, 0x38(%rsp)
leaq 0x21f3d(%rip), %rax     # 0x30268
xorl %ecx, %ecx
leaq 0x29cb6c(%rip), %r14    # 0x2aaea0
leaq 0x2cd8a5(%rip), %r12    # 0x2dbbe0
xorl %edx, %edx
movq 0x8(%rsp), %rsi
movslq 0x50(%rsi), %rsi
cmpq %rsi, %rdx
jge 0xe379
leaq 0x26be0e(%rip), %rsi    # 0x27a160
andl $0x0, (%rcx,%rsi)
andl $0x0, (%rcx,%r14)
movq -0x8(%rax), %rsi
cmpq %rsi, (%rax)
je 0xe367
movq %rsi, (%rax)
andl $0x0, (%rcx,%r12)
incq %rdx
addq $0x4, %rcx
addq $0x18, %rax
jmp 0xe33d
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x10724
movq 0x8(%rsp), %rax
movl 0x50(%rax), %r10d
pushq $-0x1
popq %r11
testl %r10d, %r10d
jle 0xe60b
decq %r10
movq 0x8(%rsp), %rax
movl 0x50(%rax), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
xorl %edx, %edx
xorl %esi, %esi
pushq $-0x1
popq %rdi
movl %edi, 0x4(%rsp)
cmpq %rsi, %rcx
je 0xe3fb
cmpl $0x0, (%rdx,%r14)
jne 0xe3f2
leaq 0x26bd81(%rip), %r9     # 0x27a160
movl (%rdx,%r9), %edi
movslq 0x4(%rsp), %r8
cmpl (%r9,%r8,4), %edi
jl 0xe3f2
movl %esi, 0x4(%rsp)
incq %rsi
addq $0x4, %rdx
jmp 0xe3cc
cmpl $0x0, 0x4(%rsp)
js 0xe648
movl 0x4(%rsp), %ecx
cmpl $0x0, (%r14,%rcx,4)
jne 0xe648
leaq 0x26bd44(%rip), %rdx    # 0x27a160
movl (%rdx,%rcx,4), %edx
cmpl %eax, %edx
jge 0xe648
xorl %esi, %esi
cmpl %r11d, %edx
setle %sil
movq 0x50(%rsp), %rdx
movl 0x4(%rsp), %edi
movl %edi, (%rdx,%r10,8)
movl %esi, 0x4(%rdx,%r10,8)
leaq 0x26bd17(%rip), %rdx    # 0x27a160
movl (%rdx,%rcx,4), %edi
movq %r12, %rdx
xorl %esi, %esi
cltq
cmpq %rax, %rsi
jge 0xe46c
andl $0x0, (%rdx)
incq %rsi
movq 0x8(%rsp), %rax
movl 0x50(%rax), %eax
addq $0x4, %rdx
jmp 0xe451
movl %edi, 0x1c(%rsp)
movq %r10, 0x48(%rsp)
pushq $0x1
popq %rax
movl %eax, (%r12,%rcx,4)
movl %eax, (%r14,%rcx,4)
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %rbx
movq %rcx, 0x40(%rsp)
movq 0x8(%rax,%rcx), %r15
cmpq %r15, %rbx
je 0xe4df
movslq (%rbx), %rax
movl %eax, 0x14(%rsp)
cmpl $0x0, (%r14,%rax,4)
jne 0xe4d9
movl $0x1, (%r12,%rax,4)
leaq 0x26bca3(%rip), %rcx    # 0x27a160
movslq (%rcx,%rax,4), %rax
imulq $0x18, %rax, %rdi
leaq 0x21d94(%rip), %rax     # 0x30260
addq %rax, %rdi
leaq 0x14(%rsp), %rsi
callq 0x6402
addq $0x4, %rbx
jmp 0xe49b
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movslq 0x50(%rax), %rax
cmpq %rax, %r15
jge 0xe5c7
imulq $0x18, %r15, %rbp
leaq 0x21d61(%rip), %rax     # 0x30260
addq %rax, %rbp
movq 0x8(%rbp), %rax
cmpq %rax, (%rbp)
je 0xe5bf
movslq -0x4(%rax), %rcx
addq $-0x4, %rax
movq %rax, 0x8(%rbp)
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %r13
movq 0x8(%rax,%rcx), %rbx
cmpq %rbx, %r13
je 0xe502
movslq (%r13), %rax
movl %eax, 0x10(%rsp)
cmpl $0x0, (%r14,%rax,4)
jne 0xe5b6
cmpl $0x0, (%r12,%rax,4)
jne 0xe5b6
movl $0x1, (%r12,%rax,4)
leaq 0x26bc04(%rip), %rcx    # 0x27a160
movslq (%rcx,%rax,4), %rax
cmpq %rax, %r15
jge 0xe5a9
imulq $0x18, %rax, %rdi
leaq 0x21cf0(%rip), %rax     # 0x30260
addq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x6402
movslq 0x10(%rsp), %rax
leaq 0x26bbd7(%rip), %rcx    # 0x27a160
incl (%rcx,%rax,4)
movl 0x4(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movl %eax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq 0x92ce
jmp 0xe5b6
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x6402
addq $0x4, %r13
jmp 0xe532
incq %r15
jmp 0xe4e2
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rcx
movq 0x40(%rsp), %rdx
movq (%rcx,%rdx), %rax
movq 0x8(%rcx,%rdx), %rcx
movq 0x48(%rsp), %r10
movl 0x1c(%rsp), %r11d
cmpq %rcx, %rax
je 0xe3a3
movslq (%rax), %rdx
cmpl $0x0, (%r14,%rdx,4)
jne 0xe605
leaq 0x26bb5e(%rip), %rsi    # 0x27a160
incl (%rsi,%rdx,4)
addq $0x4, %rax
jmp 0xe5e8
leaq 0x20(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x10776
leaq 0x50(%rsp), %rdi
callq 0x3bfe
leaq 0x20(%rsp), %rdi
callq 0x3bfe
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12669(%rip), %rdi     # 0x20cb8
leaq 0x12689(%rip), %rsi     # 0x20cdf
leaq 0x1268a(%rip), %rcx     # 0x20ce7
pushq $0x33
popq %rdx
callq 0x2150
jmp 0xe670
movq %rax, %rbx
jmp 0xe67d
jmp 0xe670
jmp 0xe670
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x3bfe
leaq 0x20(%rsp), %rdi
callq 0x3bfe
movq %rbx, %rdi
callq 0x2340