// File: /workspace/github_cpp_makefile_star2_O1/Laakeri[P]Triangulator/src/minfill.cpp
// Function: MinFill::SolveAtom::solveAtom0(Graph&, int, int, int)
vector<pair<int, int> > solveAtom0(Graph& G, int lowerBound, int upperBound, int depth) {
	assert(lowerBound >= 0);
	if (lowerBound > upperBound) return FAILSOLUTION;
	if (G.n <= 3) return {};
	if ((int64_t)G.n*(int64_t)(G.n-1) == (int64_t)G.m*2) return {};
	if (upperBound <= 0) {
		auto cycle = MCS::getChordlessCycle(G);
		if (cycle.size() == 0) return {};
		else return FAILSOLUTION;
	}
	bool hasd2 = false;
	for (int i = 0; i < G.n; i++) {
		assert(G.g[i].size() > 1);
		if (G.g[i].size() == 2) {
			hasd2 = true;
			break;
		}
	}
	if (hasd2) {
		auto sol0 = greedyDegree2(G);
		auto sol = SolveGraph::solveGraph(G, max(0, lowerBound - (int)sol0.size()), upperBound - (int)sol0.size(), depth);
		if (sol == FAILSOLUTION) return FAILSOLUTION;
		sol.insert(sol.end(), sol0.begin(), sol0.end());
		assert((int)sol.size() <= upperBound);
		return sol;
	}
	auto nbC = nbClique(G);
	if (nbC.S.F != -1) {
		auto sol0 = nbC.S;
		G.addEdge(sol0.F, sol0.S);
		auto sol = SolveGraph::solveGraph(G, max(0, lowerBound-1), upperBound-1, depth);
		if (sol == FAILSOLUTION) return FAILSOLUTION;
		sol.push_back(sol0);
		assert((int)sol.size() <= upperBound);
		return sol;
	}
	else {
		assert(nbC.F >= 2);
		lowerBound = max(lowerBound, nbC.F);
		if (lowerBound > upperBound) return FAILSOLUTION;
	}
	auto ret = solveAtom1(G, lowerBound, upperBound, depth);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testl %edx, %edx
js 0x1940e
movl %ecx, %r14d
movl %edx, %r12d
movq %rdi, %rbx
cmpl %ecx, %edx
jle 0x190cc
leaq 0x4b0f8e(%rip), %rsi    # 0x4ca050
movq %rbx, %rdi
callq 0x402a
jmp 0x190fa
movq %rsi, %r15
movslq 0x50(%rsi), %rcx
cmpq $0x3, %rcx
jle 0x190ec
leal -0x1(%rcx), %eax
imulq %rcx, %rax
movslq 0x54(%r15), %rdx
addq %rdx, %rdx
cmpq %rdx, %rax
jne 0x1910c
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r14d, %r14d
jle 0x19225
movl %r8d, %ebp
movq 0x38(%r15), %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
movq 0x8(%rax,%rdx), %rsi
subq (%rax,%rdx), %rsi
cmpq $0x4, %rsi
jbe 0x193ef
cmpq $0x8, %rsi
je 0x19256
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x19126
movq %r15, %rdi
callq 0x18e34
movq %rax, 0x20(%rsp)
movl %edx, 0x28(%rsp)
cmpl $-0x1, 0x24(%rsp)
je 0x1933f
movq 0x24(%rsp), %rsi
movq %rsi, 0x40(%rsp)
movl 0x44(%rsp), %edx
movq %r15, %rdi
callq 0x9512
cmpl $0x2, %r12d
movl $0x1, %edx
cmovgel %r12d, %edx
decl %edx
leal -0x1(%r14), %ecx
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %r8d
callq 0x16405
movq (%r12), %rcx
movq 0x8(%r12), %rax
movq %rax, %rsi
subq %rcx, %rsi
movq 0x4b0ea0(%rip), %rdi    # 0x4ca058
movq 0x4b0e91(%rip), %rdx    # 0x4ca050
subq %rdx, %rdi
cmpq %rdi, %rsi
jne 0x1938b
cmpq %rax, %rcx
sete %sil
je 0x19375
movl (%rcx), %esi
cmpl (%rdx), %esi
jne 0x1938b
movl 0x4(%rdx), %esi
cmpl %esi, 0x4(%rcx)
jne 0x1938b
addq $0x8, %rcx
addq $0xc, %rdx
cmpq %rax, %rcx
sete %sil
je 0x19375
movl (%rcx), %esi
cmpl -0x4(%rdx), %esi
jne 0x1938b
leaq 0x8(%rcx), %rsi
movl (%rdx), %edi
addq $0x8, %rdx
cmpl %edi, 0x4(%rcx)
movq %rsi, %rcx
je 0x191f6
jmp 0x1938b
movq %rsp, %r14
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x153c7
movq 0x8(%r14), %rax
cmpq (%r14), %rax
je 0x1932c
leaq 0x4b0e07(%rip), %rsi    # 0x4ca050
movq %rbx, %rdi
callq 0x402a
jmp 0x193d0
movq %rsp, %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x188e6
movq 0x8(%r13), %rax
subq (%r13), %rax
shrq $0x3, %rax
subl %eax, %r12d
xorl %edx, %edx
testl %r12d, %r12d
cmovgl %r12d, %edx
movl %r14d, %ecx
subl %eax, %ecx
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
movl %ebp, %r8d
callq 0x16405
leaq 0x4b0db8(%rip), %rsi    # 0x4ca050
leaq 0x20(%rsp), %rdi
callq 0x1a9e2
testb %al, %al
je 0x192b7
leaq 0x4b0da3(%rip), %rsi    # 0x4ca050
movq %rbx, %rdi
callq 0x402a
jmp 0x1930c
leaq 0x20(%rsp), %rdi
movq 0x8(%rdi), %rsi
movq (%rsp), %rdx
movq 0x8(%rsp), %rcx
callq 0x8bb4
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x3, %rdx
cmpl %r14d, %edx
jg 0x1944c
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x193d0
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x193d0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
jmp 0x193d0
movl 0x20(%rsp), %eax
cmpl $0x1, %eax
jle 0x1946b
cmpl %r12d, %eax
cmovgl %eax, %r12d
cmpl %r14d, %r12d
jg 0x190bb
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
movl %r14d, %ecx
movl %ebp, %r8d
callq 0x16e60
jmp 0x190fa
testb %sil, %sil
je 0x1938b
leaq 0x4b0ccf(%rip), %rsi    # 0x4ca050
movq %rbx, %rdi
callq 0x402a
jmp 0x193d0
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x1a976
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rax, %rdx
subq %rcx, %rdx
shrq $0x3, %rdx
cmpl %r14d, %edx
jg 0x1942d
movq %rcx, (%rbx)
movq %rax, 0x8(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x190fa
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x190fa
leaq 0x1207d(%rip), %rdi     # 0x2b473
leaq 0x11d0b(%rip), %rsi     # 0x2b108
leaq 0x1215c(%rip), %rcx     # 0x2b560
movl $0x20c, %edx            # imm = 0x20C
callq 0x2140
leaq 0x10f29(%rip), %rdi     # 0x2a33e
leaq 0x11cec(%rip), %rsi     # 0x2b108
leaq 0x1213d(%rip), %rcx     # 0x2b560
movl $0x201, %edx            # imm = 0x201
callq 0x2140
leaq 0x1217a(%rip), %rdi     # 0x2b5ae
leaq 0x11ccd(%rip), %rsi     # 0x2b108
leaq 0x1211e(%rip), %rcx     # 0x2b560
movl $0x221, %edx            # imm = 0x221
callq 0x2140
leaq 0x1215b(%rip), %rdi     # 0x2b5ae
leaq 0x11cae(%rip), %rsi     # 0x2b108
leaq 0x120ff(%rip), %rcx     # 0x2b560
movl $0x217, %edx            # imm = 0x217
callq 0x2140
leaq 0x1215a(%rip), %rdi     # 0x2b5cc
leaq 0x11c8f(%rip), %rsi     # 0x2b108
leaq 0x120e0(%rip), %rcx     # 0x2b560
movl $0x225, %edx            # imm = 0x225
callq 0x2140
jmp 0x19495
jmp 0x19490
jmp 0x19490
movq %rax, %rbx
jmp 0x194af
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x194af
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x194c5
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2310