// File: /workspace/github_cpp_makefile_star2_O3/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 $0x78, %rsp
movq %rsi, %r13
movslq 0x50(%rsi), %rsi
testq %rsi, %rsi
jle 0x12d2a
leaq 0x2257b(%rip), %rax     # 0x35258
xorl %ecx, %ecx
leaq 0x29d1aa(%rip), %rdx    # 0x2afe90
leaq 0x2cdee3(%rip), %r10    # 0x2e0bd0
xorl %r8d, %r8d
xorl %r9d, %r9d
leaq 0x26c456(%rip), %rsi    # 0x27f150
movl %ecx, (%r8,%rsi)
movl %ecx, (%r8,%rdx)
movq -0x8(%rax), %rsi
cmpq %rsi, (%rax)
je 0x12d0e
movq %rsi, (%rax)
movl $0x0, (%r8,%r10)
incq %r9
movslq 0x50(%r13), %rsi
addq $0x4, %r8
addq $0x18, %rax
cmpq %rsi, %r9
jl 0x12cf3
movq %rdi, 0x58(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x15a0e
movslq 0x50(%r13), %rdi
testq %rdi, %rdi
jle 0x1306c
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq 0x29d128(%rip), %r15    # 0x2afe90
movslq 0x50(%r13), %rax
testq %rax, %rax
jle 0x130c3
movq %rdi, %r11
leaq -0x1(%rdi), %r10
leaq (,%rax,4), %rcx
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
xorl %edx, %edx
xorl %esi, %esi
cmpl $0x0, (%rsi,%r15)
jne 0x12db1
leaq 0x26c3b2(%rip), %r9     # 0x27f150
movl (%rsi,%r9), %edi
movslq 0xc(%rsp), %r8
cmpl (%r9,%r8,4), %edi
jl 0x12db1
movl %edx, 0xc(%rsp)
addq $0x4, %rsi
incl %edx
cmpq %rsi, %rcx
jne 0x12d90
cmpl $0x0, 0xc(%rsp)
js 0x130c3
movl 0xc(%rsp), %ecx
cmpl $0x0, (%r15,%rcx,4)
jne 0x130c3
leaq 0x26c373(%rip), %rdx    # 0x27f150
movl (%rdx,%rcx,4), %edx
cmpl %eax, %edx
jge 0x130c3
movq %r11, 0x68(%rsp)
xorl %esi, %esi
cmpl %ebx, %edx
setle %sil
movq 0x40(%rsp), %rdx
movl 0xc(%rsp), %edi
movl %edi, (%rdx,%r10,8)
movq %r10, 0x70(%rsp)
movl %esi, 0x4(%rdx,%r10,8)
testl %eax, %eax
jle 0x12e2f
leaq 0x2cddb9(%rip), %rax    # 0x2e0bd0
xorl %edx, %edx
movl $0x0, (%rax)
incq %rdx
movslq 0x50(%r13), %rsi
addq $0x4, %rax
cmpq %rsi, %rdx
jl 0x12e19
leaq 0x26c31a(%rip), %rax    # 0x27f150
movl (%rax,%rcx,4), %eax
movl %eax, 0x1c(%rsp)
leaq 0x2cdd8c(%rip), %rax    # 0x2e0bd0
movl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl %edx, (%r15,%rcx,4)
movq 0x38(%r13), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rbx
movq %rcx, 0x60(%rsp)
movq 0x8(%rax,%rcx,8), %r14
cmpq %r14, %rbx
je 0x12ec9
movl (%rbx), %eax
movl %eax, 0x14(%rsp)
movslq %eax, %rcx
cmpl $0x0, (%r15,%rcx,4)
jne 0x12ec3
leaq 0x2cdd4e(%rip), %rdx    # 0x2e0bd0
movl $0x1, (%rdx,%rcx,4)
leaq 0x26c2c0(%rip), %rdx    # 0x27f150
movslq (%rdx,%rcx,4), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x223b1(%rip), %rdx     # 0x35250
leaq (%rdx,%rcx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x12eb9
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x12ec3
leaq 0x14(%rsp), %rdx
callq 0x92c4
addq $0x4, %rbx
jmp 0x12e66
movl 0x50(%r13), %edx
testl %edx, %edx
jle 0x13020
xorl %r14d, %r14d
leaq (%r14,%r14,2), %rsi
leaq 0x2236d(%rip), %rcx     # 0x35250
movq (%rcx,%rsi,8), %rax
movq 0x8(%rcx,%rsi,8), %rcx
cmpq %rcx, %rax
je 0x13011
leaq 0x22354(%rip), %rdx     # 0x35250
leaq (%rdx,%rsi,8), %rbp
movslq -0x4(%rcx), %rdx
addq $-0x4, %rcx
movq %rcx, 0x8(%rbp)
movq %r13, %r12
movq 0x38(%r13), %rsi
leaq (%rdx,%rdx,2), %rdx
movq (%rsi,%rdx,8), %r13
movq 0x8(%rsi,%rdx,8), %rbx
cmpq %rbx, %r13
je 0x13001
movl (%r13), %eax
movl %eax, 0x10(%rsp)
movslq %eax, %rcx
cmpl $0x0, (%r15,%rcx,4)
jne 0x12fec
leaq 0x2cdc8a(%rip), %rdx    # 0x2e0bd0
cmpl $0x0, (%rdx,%rcx,4)
jne 0x12fec
leaq 0x2cdc79(%rip), %rdx    # 0x2e0bd0
movl $0x1, (%rdx,%rcx,4)
leaq 0x26c1eb(%rip), %rdx    # 0x27f150
movslq (%rdx,%rcx,4), %rcx
cmpq %rcx, %r14
jge 0x12f93
leaq (%rcx,%rcx,2), %rcx
leaq 0x222d7(%rip), %rdx     # 0x35250
leaq (%rdx,%rcx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x12fa9
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x12fb3
movq 0x8(%rbp), %rsi
cmpq 0x10(%rbp), %rsi
je 0x12fdf
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbp)
jmp 0x12fec
leaq 0x10(%rsp), %rdx
callq 0x92c4
movslq 0x10(%rsp), %rax
leaq 0x26c191(%rip), %rcx    # 0x27f150
incl (%rcx,%rax,4)
movl 0xc(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movl %eax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq 0xb2ae
jmp 0x12fec
movq %rbp, %rdi
leaq 0x10(%rsp), %rdx
callq 0x92c4
addq $0x4, %r13
cmpq %rbx, %r13
jne 0x12f29
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
cmpq %rcx, %rax
movq %r12, %r13
jne 0x12f00
movl 0x50(%r13), %edx
incq %r14
movslq %edx, %rax
cmpq %rax, %r14
jl 0x12ed8
movq 0x38(%r13), %rcx
movq 0x60(%rsp), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rcx
cmpq %rcx, %rax
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %r8
movl 0x1c(%rsp), %ebx
je 0x13062
movslq (%rax), %rdx
cmpl $0x0, (%r15,%rdx,4)
jne 0x13059
leaq 0x26c0fa(%rip), %rsi    # 0x27f150
incl (%rsi,%rdx,4)
addq $0x4, %rax
cmpq %rcx, %rax
jne 0x13045
cmpq $0x2, %r8
jge 0x12d68
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x15a7c
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1309a
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x130b1
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16bee(%rip), %rdi     # 0x29cb8
leaq 0x16c0e(%rip), %rsi     # 0x29cdf
leaq 0x16c0f(%rip), %rcx     # 0x29ce7
movl $0x33, %edx
callq 0x2140
jmp 0x130ed
movq %rax, %rbx
jmp 0x13107
jmp 0x130ed
jmp 0x130ed
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x13107
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1311e
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2310