// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
testl %edx, %edx
js 0x19426
movl %ecx, %r14d
movl %edx, %r12d
movq %rdi, %rbx
cmpl %ecx, %edx
jle 0x1912d
leaq 0x4aff2d(%rip), %rsi    # 0x4c9050
movq %rbx, %rdi
callq 0x3f7c
jmp 0x1915d
movq %rsi, %r15
movslq 0x50(%rsi), %rcx
cmpq $0x3, %rcx
jle 0x1914d
leal -0x1(%rcx), %eax
imulq %rcx, %rax
movslq 0x54(%r15), %rdx
addq %rdx, %rdx
cmpq %rdx, %rax
jne 0x1916f
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r14d, %r14d
je 0x19205
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 0x19407
cmpq $0x8, %rsi
je 0x19236
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x19189
movq %r15, %rdi
callq 0x18f2a
movq %rax, 0x18(%rsp)
movl %edx, 0x20(%rsp)
movabsq $-0x100000001, %rcx     # imm = 0xFFFFFFFEFFFFFFFF
cmpq %rcx, %rax
jbe 0x192fe
cmpl $0x1, %eax
jle 0x19464
cmpl %r12d, %eax
cmovgl %eax, %r12d
cmpl %r14d, %r12d
jg 0x1911c
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
movl %r14d, %ecx
movl %ebp, %r8d
callq 0x16f96
jmp 0x1915d
movq %rsp, %r14
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1566e
movq (%r14), %rdi
cmpq %rdi, 0x8(%r14)
je 0x19389
leaq 0x4afe27(%rip), %rsi    # 0x4c9050
movq %rbx, %rdi
callq 0x3f7c
jmp 0x193e8
movq %rsp, %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x189e2
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 0x18(%rsp), %rdi
movq %r15, %rsi
movl %ebp, %r8d
callq 0x16589
leaq 0x4afdd8(%rip), %rsi    # 0x4c9050
leaq 0x18(%rsp), %rdi
callq 0x1ab70
testb %al, %al
je 0x192b5
leaq 0x4afdc3(%rip), %rsi    # 0x4c9050
movq %rbx, %rdi
callq 0x3f7c
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x193e8
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x193e8
leaq 0x18(%rsp), %rdi
movq 0x8(%rdi), %rsi
movq (%rsp), %rdx
movq 0x8(%rsp), %rcx
callq 0x8ecc
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x3, %rdx
cmpl %r14d, %edx
jg 0x19445
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x193e8
movq 0x1c(%rsp), %rsi
movq %rsi, 0x30(%rsp)
movq %rsi, %rdx
shrq $0x20, %rdx
movq %r15, %rdi
callq 0x9836
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 0x16589
movq (%r12), %rax
movq 0x8(%r12), %rcx
movq %rcx, %rsi
subq %rax, %rsi
movq 0x4afd07(%rip), %rdi    # 0x4c9058
movq 0x4afcf8(%rip), %rdx    # 0x4c9050
subq %rdx, %rdi
cmpq %rdi, %rsi
jne 0x1939b
cmpq %rcx, %rax
je 0x193d9
movq (%rax), %xmm0
movq (%rdx), %xmm1
pcmpeqd %xmm0, %xmm1
pshufd $0x50, %xmm1, %xmm0     # xmm0 = xmm1[0,0,1,1]
movmskpd %xmm0, %esi
cmpl $0x3, %esi
jne 0x1939b
addq $0x8, %rax
addq $0x8, %rdx
jmp 0x19360
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
jmp 0x193ec
movq %rsp, %rdi
leaq 0x30(%rsp), %rsi
callq 0x1aafe
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rax, %rdx
subq %rcx, %rdx
shrq $0x3, %rdx
cmpl %r14d, %edx
jg 0x19483
movq %rcx, (%rbx)
movq %rax, 0x8(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x1915d
leaq 0x4afc70(%rip), %rsi    # 0x4c9050
movq %rbx, %rdi
callq 0x3f7c
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1915d
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x1915d
leaq 0x11075(%rip), %rdi     # 0x2a483
leaq 0x10d03(%rip), %rsi     # 0x2a118
leaq 0x11154(%rip), %rcx     # 0x2a570
movl $0x20c, %edx            # imm = 0x20C
callq 0x2140
leaq 0xff21(%rip), %rdi      # 0x2934e
leaq 0x10ce4(%rip), %rsi     # 0x2a118
leaq 0x11135(%rip), %rcx     # 0x2a570
movl $0x201, %edx            # imm = 0x201
callq 0x2140
leaq 0x11172(%rip), %rdi     # 0x2a5be
leaq 0x10cc5(%rip), %rsi     # 0x2a118
leaq 0x11116(%rip), %rcx     # 0x2a570
movl $0x217, %edx            # imm = 0x217
callq 0x2140
leaq 0x11171(%rip), %rdi     # 0x2a5dc
leaq 0x10ca6(%rip), %rsi     # 0x2a118
leaq 0x110f7(%rip), %rcx     # 0x2a570
movl $0x225, %edx            # imm = 0x225
callq 0x2140
leaq 0x11134(%rip), %rdi     # 0x2a5be
leaq 0x10c87(%rip), %rsi     # 0x2a118
leaq 0x110d8(%rip), %rcx     # 0x2a570
movl $0x221, %edx            # imm = 0x221
callq 0x2140
jmp 0x194a8
jmp 0x194ad
jmp 0x194a8
movq %rax, %rbx
jmp 0x194c7
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x194c7
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x194dd
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2310