// File: /workspace/github_cpp_makefile_star2_O1/Laakeri[P]Triangulator/src/MCS.cpp
// Function: MCS::getAtoms(Graph const&, Graph const&, std::pair<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>> const&)
pair<int, vector<Graph> > getAtoms(const Graph& G, const Graph& gFill, const pair<vector<pair<int, int> >, vector<pair<int, int> > >& fill) {
	assert(G.n == gFill.n);
	for (int i = 0; i < G.n; i++) {
		rm[i] = 0;
		rc[i] = 0;
		ca[i] = 0;
	}
	int maxSep = 0;
	vector<Graph> ret;
	for (int i = 0; i < G.n; i++) {
		if (fill.S[i].S) {
			vector<int> cand;
			for (int nx : gFill.g[fill.S[i].F]) {
				if (rm[nx] == 0) {
					cand.push_back(nx);
				}
			}
			for (int x : cand) {
				ca[x] = 1;
			}
			bool no = false;
			for (int x : cand) {
				int fo = 0;
				for (int nx : G.g[x]) {
					if (ca[nx]) fo++;
				}
				if (fo < (int)cand.size()-1) {
					no = true;
				}
			}
			if (!no) {
				maxSep = max(maxSep, (int)cand.size()+1);
				vector<pair<int, int> > es;
				findCC(fill.S[i].F, G, es);
				for (int j = 0; j < (int)cand.size(); j++) {
					for (int jj = j+1; jj < (int)cand.size(); jj++) {
						es.push_back({cand[j], cand[jj]});
					}
				}
				ret.push_back(es);
			}
			for (int x : cand) {
				ca[x] = 0;
			}
		}
		rm[fill.S[i].F] = 1;
	}
	int fo = 0;
	for (int i = 0; i < G.n; i++) {
		if (!rc[i]) {
			vector<pair<int, int> > es;
			findCC(i, G, es);
			ret.push_back(Graph(es));
			fo++;
		}
	}
	assert(fo == 1);
	return {maxSep, ret};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl 0x50(%rsi), %eax
movq %rdx, 0x78(%rsp)
cmpl 0x50(%rdx), %eax
jne 0x13466
movq %rcx, %r15
movq %rsi, %r12
cmpl $0x0, 0x50(%rsi)
leaq 0x29dea3(%rip), %r10    # 0x2b0e90
jle 0x1301f
xorl %eax, %eax
leaq 0x2cebd8(%rip), %rcx    # 0x2e1bd0
leaq 0x2ff911(%rip), %rdx    # 0x312910
xorl %esi, %esi
xorl %r9d, %r9d
movl %eax, (%rsi,%r10)
movl %eax, (%rsi,%rcx)
movl %eax, (%rsi,%rdx)
incq %r9
movslq 0x50(%r12), %r8
addq $0x4, %rsi
cmpq %r8, %r9
jl 0x13004
movq %rdi, 0x70(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
cmpl $0x0, 0x50(%r12)
jle 0x13338
xorl %ecx, %ecx
leaq 0x80(%rsp), %r13
leaq 0x2ff8be(%rip), %r14    # 0x312910
xorl %ebp, %ebp
movq %r12, 0x40(%rsp)
movq %r15, 0x38(%rsp)
movq 0x18(%r15), %rax
cmpl $0x0, 0x4(%rax,%rcx,8)
je 0x13305
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %rcx, 0x48(%rsp)
movslq (%rax,%rcx,8), %rax
movq 0x78(%rsp), %rcx
movq 0x38(%rcx), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %r15
movq 0x8(%rcx,%rax,8), %r12
cmpq %r12, %r15
leaq 0x29ddea(%rip), %rbx    # 0x2b0e90
je 0x130e5
movslq (%r15), %rax
movl %eax, 0x80(%rsp)
cmpl $0x0, (%rbx,%rax,4)
jne 0x130dc
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x130d1
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x130dc
movq %rsp, %rdi
movq %r13, %rdx
callq 0x8fde
addq $0x4, %r15
cmpq %r12, %r15
jne 0x130a8
movq (%rsp), %rax
movq 0x8(%rsp), %rbx
movq %rax, %rcx
cmpq %rbx, %rax
movq 0x40(%rsp), %r12
je 0x1310f
movslq (%rcx), %rdx
movl $0x1, (%r14,%rdx,4)
addq $0x4, %rcx
cmpq %rbx, %rcx
jne 0x130fb
cmpq %rbx, %rax
movq 0x38(%rsp), %r15
je 0x13189
movq 0x38(%r12), %rcx
movq %rbx, %rdx
subq %rax, %rdx
shrq $0x2, %rdx
decl %edx
xorl %esi, %esi
movq %rax, %rdi
movslq (%rdi), %r8
leaq (%r8,%r8,2), %r9
movq (%rcx,%r9,8), %r8
movq 0x8(%rcx,%r9,8), %r9
movl $0x0, %r10d
cmpq %r9, %r8
je 0x13162
xorl %r10d, %r10d
movslq (%r8), %r11
cmpl $0x1, (%r14,%r11,4)
sbbl $-0x1, %r10d
addq $0x4, %r8
cmpq %r9, %r8
jne 0x1314d
cmpl %edx, %r10d
movzbl %sil, %esi
movl $0x1, %r8d
cmovll %r8d, %esi
addq $0x4, %rdi
cmpq %rbx, %rdi
jne 0x1312f
testb $0x1, %sil
je 0x13189
movl %ebp, %ebx
jmp 0x132c7
subq %rax, %rbx
shrq $0x2, %rbx
incl %ebx
cmpl %ebx, %ebp
cmovgl %ebp, %ebx
movq %rbx, 0x18(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x18(%r15), %rax
movq 0x48(%rsp), %rcx
movl (%rax,%rcx,8), %edi
movq %r12, %rsi
leaq 0x20(%rsp), %rdx
callq 0x12eca
movq 0x8(%rsp), %rax
subq (%rsp), %rax
shrq $0x2, %rax
testl %eax, %eax
jle 0x13250
movl $0x1, %ebx
xorl %r12d, %r12d
movq %r12, %r15
incq %r12
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r12
jge 0x13239
movq %rbx, %rbp
movl (%rax,%r15,4), %ecx
movl %ecx, 0x80(%rsp)
movl (%rax,%rbp,4), %eax
movl %eax, 0x84(%rsp)
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0xafe4
incq %rbp
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
cmpl %ecx, %ebp
jl 0x13200
movq 0x8(%rsp), %rax
subq (%rsp), %rax
shrq $0x2, %rax
cltq
incq %rbx
cmpq %rax, %r12
jl 0x131df
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
callq 0x95cc
leaq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x15a90
leaq 0xb8(%rsp), %rdi
callq 0x41fe
leaq 0x98(%rsp), %rdi
callq 0x43b8
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
movq 0x18(%rsp), %rbx
je 0x132a6
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
movq 0x40(%rsp), %r12
movq 0x38(%rsp), %r15
je 0x132c7
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rdi, %rcx
cmpq %rax, %rdi
je 0x132ec
movslq (%rcx), %rdx
movl $0x0, (%r14,%rdx,4)
addq $0x4, %rcx
cmpq %rax, %rcx
jne 0x132d8
testq %rdi, %rdi
je 0x132fe
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x48(%rsp), %rcx
jmp 0x13307
movl %ebp, %ebx
movq 0x18(%r15), %rax
movslq (%rax,%rcx,8), %rax
movq %rcx, %rdx
leaq 0x29db77(%rip), %rcx    # 0x2b0e90
movl $0x1, (%rcx,%rax,4)
movq %rdx, %rcx
incq %rcx
movslq 0x50(%r12), %rax
movl %ebx, %ebp
cmpq %rax, %rcx
jl 0x1305e
jmp 0x1333a
xorl %ebx, %ebx
movq %rbx, 0x18(%rsp)
cmpl $0x0, 0x50(%r12)
jle 0x13447
leaq 0x2ce87e(%rip), %r14    # 0x2e1bd0
xorl %r15d, %r15d
movq %rsp, %r13
leaq 0x80(%rsp), %rbp
xorl %ebx, %ebx
cmpl $0x0, (%r14)
jne 0x133f1
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movl %r15d, %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x12eca
movq %rbp, %rdi
movq %r13, %rsi
callq 0x95cc
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x15a90
leaq 0xb8(%rsp), %rdi
callq 0x41fe
leaq 0x98(%rsp), %rdi
callq 0x43b8
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x133d9
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x133ef
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
incl %ebx
incq %r15
movslq 0x50(%r12), %rax
addq $0x4, %r14
cmpq %rax, %r15
jl 0x13362
cmpl $0x1, %ebx
jne 0x13447
movq 0x70(%rsp), %rbx
movq 0x18(%rsp), %rax
movl %eax, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x50(%rsp), %rsi
callq 0x15904
leaq 0x50(%rsp), %rdi
callq 0x69a0
movq %rbx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1796b(%rip), %rdi     # 0x2adb9
leaq 0x1787a(%rip), %rsi     # 0x2accf
leaq 0x178da(%rip), %rcx     # 0x2ad36
movl $0xa3, %edx
callq 0x2140
leaq 0x178ba(%rip), %rdi     # 0x2ad27
leaq 0x1785b(%rip), %rsi     # 0x2accf
leaq 0x178bb(%rip), %rcx     # 0x2ad36
movl $0x6c, %edx
callq 0x2140
movq %rax, %rbx
jmp 0x134eb
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x412c
jmp 0x134be
jmp 0x134bb
jmp 0x134bb
jmp 0x134b6
jmp 0x134b6
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x412c
jmp 0x134d5
movq %rax, %rbx
jmp 0x134d5
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x134d5
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x134eb
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
leaq 0x50(%rsp), %rdi
callq 0x69a0
movq %rbx, %rdi
callq 0x2310