// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]Triangulator/src/treewidth.cpp
// Function: TreeWidth::SolveAtom::solveAtom1(Graph const&, int, int, int)
pair<int, vector<pair<int, int> > > solveAtom1(const Graph& G, int lowerBound, int okWidth, int upperBound) {
	assert(lowerBound >= 0);
	assert(okWidth <= upperBound);
	if (lowerBound > upperBound) return {-1, FAILSOLUTION};
	okWidth = max(okWidth, lowerBound);
	
	auto fill = MCS::MCS_MP(G);
	
	Graph gFill = G;
	gFill.addEdges(fill.F);
	
	int fillWidth = MCS::getTreeWidth(gFill);
	assert(fillWidth >= lowerBound);
	if (fillWidth <= okWidth) return {fillWidth, fill.F};
	if (fill.F.size() <= 1) {
		if (fillWidth > upperBound) return {-1, FAILSOLUTION};
		return {fillWidth, fill.F};
	}
	auto fillO = PMC::solve(G, (int64_t)lowerBound, (int64_t)upperBound, PROBLEM_TREEWIDTH);
	if (fillO == FAILSOLUTION) return {-1, FAILSOLUTION};
	Graph gFillO = G;
	gFillO.addEdges(fillO);
	int width = MCS::getTreeWidth(gFillO);
	assert(width >= lowerBound);
	assert(width <= upperBound);
	return {width, fillO};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1c0, %rsp            # imm = 0x1C0
testl %edx, %edx
js 0x1e97e
movl %r8d, %ebp
movl %ecx, %r12d
cmpl %r8d, %ecx
jg 0x1e997
movl %edx, %r14d
movq %rdi, %rbx
cmpl %ebp, %edx
jle 0x1e78f
orl $-0x1, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0xc15f4b(%rip), %rsi    # 0xc346d0
callq 0x35f2
jmp 0x1e96b
movq %rsi, %r15
cmpl %r14d, %r12d
cmovlel %r14d, %r12d
leaq 0x80(%rsp), %rdi
callq 0xe30c
leaq 0x168(%rsp), %rdi
movq %r15, %rsi
callq 0x5152
leaq 0x168(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x7cf8
leaq 0x168(%rsp), %rdi
callq 0xed88
cmpl %r14d, %eax
jl 0x1e9b0
cmpl %r12d, %eax
jbe 0x1e81c
movq 0x88(%rsp), %rcx
subq 0x80(%rsp), %rcx
cmpq $0x8, %rcx
ja 0x1e837
leaq 0x8(%rbx), %rdi
cmpl %ebp, %eax
jbe 0x1e8e0
orl $-0x1, (%rbx)
leaq 0xc15ebe(%rip), %rsi    # 0xc346d0
callq 0x35f2
jmp 0x1e951
movl %eax, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x80(%rsp), %rsi
callq 0x35f2
jmp 0x1e951
movl %r14d, %esi
leaq 0xe0(%rsp), %rdi
callq 0x14b7c
movl %ebp, %esi
leaq 0xb0(%rsp), %rdi
callq 0x14b7c
movaps 0xb0(%rsp), %xmm0
movaps 0xc0(%rsp), %xmm1
movaps 0xd0(%rsp), %xmm2
movaps %xmm2, 0x50(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps 0xe0(%rsp), %xmm0
movaps 0xf0(%rsp), %xmm1
movaps 0x100(%rsp), %xmm2
movaps %xmm2, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0x68(%rsp), %rdi
pushq $0x2
popq %rdx
movq %r15, %rsi
callq 0x18a6f
leaq 0xc15e16(%rip), %rsi    # 0xc346d0
leaq 0x68(%rsp), %rdi
callq 0x35c8
testb %al, %al
je 0x1e8e7
orl $-0x1, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0xc15df7(%rip), %rsi    # 0xc346d0
callq 0x35f2
jmp 0x1e947
movl %eax, (%rbx)
jmp 0x1e825
leaq 0x110(%rsp), %rdi
movq %r15, %rsi
callq 0x5152
leaq 0x110(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x7cf8
leaq 0x110(%rsp), %rdi
callq 0xed88
cmpl %r14d, %eax
jl 0x1e9cd
cmpl %ebp, %eax
ja 0x1e9e6
movl %eax, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x68(%rsp), %rsi
callq 0x35f2
leaq 0x110(%rsp), %rdi
callq 0x36d2
leaq 0x68(%rsp), %rdi
callq 0x3bfe
leaq 0x168(%rsp), %rdi
callq 0x36d2
leaq 0x80(%rsp), %rdi
callq 0x3642
movq %rbx, %rax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19c9(%rip), %rdi      # 0x2034e
leaq 0x39c4(%rip), %rsi      # 0x22350
leaq 0x39cb(%rip), %rcx      # 0x2235e
pushq $0x18
jmp 0x1e9c7
leaq 0x1ebd(%rip), %rdi      # 0x2085b
leaq 0x39ab(%rip), %rsi      # 0x22350
leaq 0x39b2(%rip), %rcx      # 0x2235e
pushq $0x19
jmp 0x1e9c7
leaq 0x18d9(%rip), %rdi      # 0x20290
leaq 0x3992(%rip), %rsi      # 0x22350
leaq 0x3999(%rip), %rcx      # 0x2235e
pushq $0x23
popq %rdx
callq 0x2150
leaq 0x1952(%rip), %rdi      # 0x20326
leaq 0x3975(%rip), %rsi      # 0x22350
leaq 0x397c(%rip), %rcx      # 0x2235e
pushq $0x2e
jmp 0x1e9c7
leaq 0x194d(%rip), %rdi      # 0x2033a
leaq 0x395c(%rip), %rsi      # 0x22350
leaq 0x3963(%rip), %rcx      # 0x2235e
pushq $0x2f
jmp 0x1e9c7
jmp 0x1ea07
jmp 0x1ea19
jmp 0x1ea19
jmp 0x1ea31
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x36d2
jmp 0x1ea1c
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x3bfe
jmp 0x1ea34
jmp 0x1ea31
jmp 0x1ea31
movq %rax, %rbx
jmp 0x1ea41
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x36d2
leaq 0x80(%rsp), %rdi
callq 0x3642
movq %rbx, %rdi
callq 0x2340