// File: /workspace/github_cpp_makefile_star2_O3/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 $0xf8, %rsp
movl 0x50(%rsi), %eax
movq %rdx, 0x98(%rsp)
cmpl 0x50(%rdx), %eax
jne 0x136da
testl %eax, %eax
jle 0x136f9
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, 0x88(%rsp)
xorl %eax, %eax
leaq 0x29cc35(%rip), %rbp    # 0x2afe90
leaq 0x2cd96e(%rip), %rdi    # 0x2e0bd0
leaq 0x2fe6a7(%rip), %r14    # 0x311910
xorl %ecx, %ecx
xorl %edx, %edx
movl %eax, (%rcx,%rbp)
movl %eax, (%rcx,%rdi)
movl %eax, (%rcx,%r14)
incq %rdx
movslq 0x50(%r12), %rsi
addq $0x4, %rcx
cmpq %rsi, %rdx
jl 0x1326d
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
testl %esi, %esi
jle 0x1370a
movq 0x18(%r15), %rcx
xorl %edx, %edx
leaq 0xa0(%rsp), %r13
movl $0x0, 0xc(%rsp)
movq %r12, 0x38(%rsp)
movq %r15, 0x90(%rsp)
cmpl $0x0, 0x4(%rcx,%rdx,8)
je 0x135a8
movq %r14, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq %rdx, 0x80(%rsp)
movslq (%rcx,%rdx,8), %rax
movq 0x98(%rsp), %rcx
movq 0x38(%rcx), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %r14
movq 0x8(%rcx,%rax,8), %r12
cmpq %r12, %r14
je 0x13409
movslq (%r14), %rax
movl %eax, 0xa0(%rsp)
cmpl $0x0, (%rbp,%rax,4)
jne 0x13348
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x1333b
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x13348
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x92c4
addq $0x4, %r14
cmpq %r12, %r14
jne 0x13311
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
movq %rdi, %rcx
cmpq %rax, %rdi
movq 0x38(%rsp), %r12
movq %rbx, %r14
je 0x13412
movslq (%rcx), %rdx
movl $0x1, (%r14,%rdx,4)
addq $0x4, %rcx
cmpq %rax, %rcx
jne 0x1336f
cmpq %rax, %rdi
je 0x13412
movq 0x38(%r12), %rcx
movq %rax, %rdx
subq %rdi, %rdx
shrq $0x2, %rdx
movq %rdx, 0x30(%rsp)
leal -0x1(%rdx), %esi
xorl %edx, %edx
movq %rdi, %r8
movslq (%r8), %r9
leaq (%r9,%r9,2), %r10
movq (%rcx,%r10,8), %r9
movq 0x8(%rcx,%r10,8), %r10
movl $0x0, %r11d
cmpq %r10, %r9
je 0x133de
xorl %r11d, %r11d
movslq (%r9), %r14
cmpl $0x1, (%rbx,%r14,4)
movq %rbx, %r14
sbbl $-0x1, %r11d
addq $0x4, %r9
cmpq %r10, %r9
jne 0x133c6
cmpl %esi, %r11d
setl %r9b
orb %r9b, %dl
addq $0x4, %r8
cmpq %rax, %r8
jne 0x133a8
testb $0x1, %dl
movq 0x30(%rsp), %rcx
je 0x1341b
movl 0xc(%rsp), %ecx
movq %rcx, 0x30(%rsp)
jmp 0x13565
xorl %eax, %eax
xorl %edi, %edi
movq 0x38(%rsp), %r12
subq %rdi, %rax
shrq $0x2, %rax
movl %eax, %ecx
incl %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
cmovgl %eax, %ecx
movq %rcx, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x18(%r15), %rax
movq 0x80(%rsp), %rcx
movl (%rax,%rcx,8), %edi
movq %r12, %rsi
leaq 0x40(%rsp), %rdx
callq 0x13126
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x2, %rdx
testl %edx, %edx
jle 0x134e3
movl $0x1, %r15d
xorl %r12d, %r12d
movq %r12, %r14
incq %r12
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x2, %rdx
movslq %edx, %rdx
cmpq %rdx, %r12
jge 0x134db
movq %r15, %rbp
movl (%rax,%r14,4), %ecx
movl %ecx, 0xa0(%rsp)
movl (%rax,%rbp,4), %eax
movl %eax, 0xa4(%rsp)
leaq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0xb2ae
incq %rbp
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x2, %rdx
cmpl %edx, %ebp
jl 0x13494
movslq %edx, %rdx
leaq 0x29c9b5(%rip), %rbp    # 0x2afe90
incq %r15
cmpq %rdx, %r12
jl 0x13479
movq %r13, %rdi
leaq 0x40(%rsp), %rsi
callq 0x98ec
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
callq 0x15cfe
movq %rbx, %r14
leaq 0xd8(%rsp), %rdi
callq 0x41aa
leaq 0xb8(%rsp), %rdi
callq 0x436a
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x13537
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
movq 0x38(%rsp), %r12
movq 0x90(%rsp), %r15
je 0x1355b
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
movq %rdi, %rcx
cmpq %rax, %rdi
je 0x13581
movslq (%rcx), %rdx
movl $0x0, (%r14,%rdx,4)
addq $0x4, %rcx
cmpq %rax, %rcx
jne 0x1356d
testq %rdi, %rdi
je 0x13593
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x18(%r15), %rcx
movq 0x30(%rsp), %rax
movl %eax, 0xc(%rsp)
movq 0x80(%rsp), %rdx
movslq (%rcx,%rdx,8), %rax
movl $0x1, (%rbp,%rax,4)
incq %rdx
movslq 0x50(%r12), %rax
cmpq %rax, %rdx
jl 0x132c4
testl %eax, %eax
jle 0x1370a
xorl %r15d, %r15d
leaq 0x10(%rsp), %r13
leaq 0xa0(%rsp), %rbp
xorl %r14d, %r14d
leaq 0x2cd5e9(%rip), %rdx    # 0x2e0bd0
movq %rdx, %rbx
cmpl $0x0, (%rdx)
jne 0x13680
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl %r15d, %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x13126
movq %rbp, %rdi
movq %r13, %rsi
callq 0x98ec
leaq 0x60(%rsp), %rdi
movq %rbp, %rsi
callq 0x15cfe
leaq 0xd8(%rsp), %rdi
callq 0x41aa
leaq 0xb8(%rsp), %rdi
callq 0x436a
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x13661
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x13678
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
incl %r14d
movl 0x50(%r12), %eax
incq %r15
movslq %eax, %rcx
movq %rbx, %rdx
addq $0x4, %rdx
cmpq %rcx, %r15
jl 0x135e7
cmpl $0x1, %r14d
jne 0x1370a
movq 0x88(%rsp), %rbx
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x60(%rsp), %rsi
callq 0x15b72
leaq 0x60(%rsp), %rdi
callq 0x6b12
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16656(%rip), %rdi     # 0x29d37
leaq 0x165f7(%rip), %rsi     # 0x29cdf
leaq 0x16657(%rip), %rcx     # 0x29d46
movl $0x6c, %edx
callq 0x2140
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
leaq 0x166b8(%rip), %rdi     # 0x29dc9
leaq 0x165c7(%rip), %rsi     # 0x29cdf
leaq 0x16627(%rip), %rcx     # 0x29d46
movl $0xa3, %edx
callq 0x2140
movq %rax, %rbx
jmp 0x13790
jmp 0x1375a
jmp 0x1375a
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x40d8
jmp 0x13779
jmp 0x1375f
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x40d8
jmp 0x13762
jmp 0x1375f
movq %rax, %rbx
jmp 0x13779
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x13779
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x13790
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
leaq 0x60(%rsp), %rdi
callq 0x6b12
movq %rbx, %rdi
callq 0x2310