// File: /workspace/github_cpp_makefile_star2_O1/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
movl 0x50(%rsi), %r9d
testl %r9d, %r9d
jle 0x12ace
leaq 0x237d7(%rip), %rax     # 0x36258
xorl %ecx, %ecx
leaq 0x29e406(%rip), %rdx    # 0x2b0e90
leaq 0x2cf13f(%rip), %rsi    # 0x2e1bd0
xorl %r10d, %r10d
xorl %r8d, %r8d
leaq 0x26d6b2(%rip), %r9     # 0x280150
movl %ecx, (%r10,%r9)
movl %ecx, (%r10,%rdx)
movq -0x8(%rax), %r9
cmpq %r9, (%rax)
je 0x12ab2
movq %r9, (%rax)
movl $0x0, (%r10,%rsi)
incq %r8
movslq 0x50(%r13), %r9
addq $0x4, %r10
addq $0x18, %rax
cmpq %r9, %r8
jl 0x12a97
movq %rdi, 0x58(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movslq %r9d, %rsi
leaq 0x40(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x1578c
movslq 0x50(%r13), %r12
testq %r12, %r12
jle 0x12e10
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
leaq 0x29e380(%rip), %r15    # 0x2b0e90
movslq 0x50(%r13), %rax
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
testq %rax, %rax
jle 0x12b61
leaq (,%rax,4), %rcx
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
xorl %edx, %edx
xorl %esi, %esi
cmpl $0x0, (%rsi,%r15)
jne 0x12b56
leaq 0x26d60d(%rip), %r9     # 0x280150
movl (%rsi,%r9), %edi
movslq 0xc(%rsp), %r8
cmpl (%r9,%r8,4), %edi
jl 0x12b56
movl %edx, 0xc(%rsp)
addq $0x4, %rsi
incl %edx
cmpq %rsi, %rcx
jne 0x12b35
cmpl $0x0, 0xc(%rsp)
js 0x12e67
movl 0xc(%rsp), %ecx
cmpl $0x0, (%r15,%rcx,4)
jne 0x12e67
leaq 0x26d5ce(%rip), %rdx    # 0x280150
cmpl %eax, (%rdx,%rcx,4)
jge 0x12e67
leaq -0x1(%r12), %rdi
xorl %eax, %eax
leaq 0x26d5b7(%rip), %rdx    # 0x280150
cmpl %r10d, (%rdx,%rcx,4)
setle %al
movq 0x40(%rsp), %rdx
movl 0xc(%rsp), %esi
movl %esi, (%rdx,%rdi,8)
movq %rdi, 0x70(%rsp)
movl %eax, 0x4(%rdx,%rdi,8)
cmpl $0x0, 0x50(%r13)
jle 0x12bdb
leaq 0x2cf00d(%rip), %rax    # 0x2e1bd0
xorl %edx, %edx
movl $0x0, (%rax)
incq %rdx
movslq 0x50(%r13), %rsi
addq $0x4, %rax
cmpq %rsi, %rdx
jl 0x12bc5
leaq 0x26d56e(%rip), %rax    # 0x280150
movl (%rax,%rcx,4), %ebp
leaq 0x2cefe4(%rip), %rax    # 0x2e1bd0
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, 0x68(%rsp)
movq 0x8(%rax,%rcx,8), %r14
cmpq %r14, %rbx
je 0x12c71
movl (%rbx), %eax
movl %eax, 0x14(%rsp)
movslq %eax, %rcx
cmpl $0x0, (%r15,%rcx,4)
jne 0x12c6b
leaq 0x2cefa6(%rip), %rdx    # 0x2e1bd0
movl $0x1, (%rdx,%rcx,4)
leaq 0x26d518(%rip), %rdx    # 0x280150
movslq (%rdx,%rcx,4), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x23609(%rip), %rdx     # 0x36250
leaq (%rdx,%rcx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x12c61
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x12c6b
leaq 0x14(%rsp), %rdx
callq 0x8fde
addq $0x4, %rbx
jmp 0x12c0e
movl %ebp, 0x1c(%rsp)
movq %r12, 0x60(%rsp)
cmpl $0x0, 0x50(%r13)
jle 0x12dc3
xorl %r14d, %r14d
leaq (%r14,%r14,2), %rcx
leaq 0x235bd(%rip), %rdx     # 0x36250
movq 0x8(%rdx,%rcx,8), %rax
cmpq %rax, (%rdx,%rcx,8)
je 0x12db3
leaq 0x235a7(%rip), %rdx     # 0x36250
leaq (%rdx,%rcx,8), %rbp
movslq -0x4(%rax), %rcx
addq $-0x4, %rax
movq %rax, 0x8(%rbp)
movq %r13, %r12
movq 0x38(%r13), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %r13
movq 0x8(%rax,%rcx,8), %rbx
cmpq %rbx, %r13
je 0x12da2
movl (%r13), %eax
movl %eax, 0x10(%rsp)
movslq %eax, %rcx
cmpl $0x0, (%r15,%rcx,4)
jne 0x12d99
leaq 0x2ceedd(%rip), %rdx    # 0x2e1bd0
cmpl $0x0, (%rdx,%rcx,4)
jne 0x12d99
leaq 0x2ceecc(%rip), %rdx    # 0x2e1bd0
movl $0x1, (%rdx,%rcx,4)
leaq 0x26d43e(%rip), %rdx    # 0x280150
movslq (%rdx,%rcx,4), %rcx
cmpq %rcx, %r14
jge 0x12d40
leaq (%rcx,%rcx,2), %rcx
leaq 0x2352a(%rip), %rdx     # 0x36250
leaq (%rdx,%rcx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x12d56
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x12d60
movq 0x8(%rbp), %rsi
cmpq 0x10(%rbp), %rsi
je 0x12d8c
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbp)
jmp 0x12d99
leaq 0x10(%rsp), %rdx
callq 0x8fde
movslq 0x10(%rsp), %rax
leaq 0x26d3e4(%rip), %rcx    # 0x280150
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 0xafe4
jmp 0x12d99
movq %rbp, %rdi
leaq 0x10(%rsp), %rdx
callq 0x8fde
addq $0x4, %r13
jmp 0x12ccd
movq 0x8(%rbp), %rax
cmpq %rax, (%rbp)
movq %r12, %r13
jne 0x12cad
incq %r14
movslq 0x50(%r13), %rax
cmpq %rax, %r14
jl 0x12c88
movq 0x38(%r13), %rcx
movq 0x68(%rsp), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rcx
cmpq %rcx, %rax
movq 0x60(%rsp), %rdi
movl 0x1c(%rsp), %r10d
je 0x12e01
movslq (%rax), %rdx
cmpl $0x0, (%r15,%rdx,4)
jne 0x12df8
leaq 0x26d35b(%rip), %rsi    # 0x280150
incl (%rsi,%rdx,4)
addq $0x4, %rax
cmpq %rcx, %rax
jne 0x12de4
cmpq $0x2, %rdi
movq 0x70(%rsp), %r12
jge 0x12b10
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x15804
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x12e3e
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x12e55
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 0x17e3a(%rip), %rdi     # 0x2aca8
leaq 0x17e5a(%rip), %rsi     # 0x2accf
leaq 0x17e5b(%rip), %rcx     # 0x2acd7
movl $0x33, %edx
callq 0x2140
jmp 0x12e91
movq %rax, %rbx
jmp 0x12eab
jmp 0x12e91
jmp 0x12e91
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x12eab
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x12ec2
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2310