// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
testl %edx, %edx
js 0x27515
movl %r8d, %ebp
movl %ecx, %r14d
cmpl %r8d, %ecx
jg 0x27534
movl %edx, %r12d
movq %rdi, %rbx
cmpl %ebp, %edx
jle 0x271c4
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0xc13506(%rip), %rsi    # 0xc3a6c0
callq 0x402a
jmp 0x27315
movq %rsi, %r13
cmpl %r12d, %r14d
cmovlel %r12d, %r14d
leaq 0x80(%rsp), %rdi
callq 0x12a60
leaq 0xb0(%rsp), %rdi
movq %r13, %rsi
callq 0x431c
leaq 0xc8(%rsp), %rdi
leaq 0x18(%r13), %rsi
movq %rsi, 0x78(%rsp)
callq 0x7e36
movb 0x30(%r13), %al
leaq 0xe8(%rsp), %rdi
movb %al, -0x8(%rdi)
leaq 0x38(%r13), %r15
movq %r15, %rsi
callq 0x4164
movq 0x50(%r13), %rax
leaq 0xb0(%rsp), %rdi
movq %rax, 0x50(%rdi)
leaq 0x80(%rsp), %rsi
callq 0x9880
leaq 0xb0(%rsp), %rdi
callq 0x1374a
cmpl %r12d, %eax
jl 0x27553
cmpl %r14d, %eax
jle 0x2728e
movq 0x88(%rsp), %rcx
subq 0x80(%rsp), %rcx
cmpq $0x8, %rcx
ja 0x2732a
leaq 0x8(%rbx), %rdi
cmpl %ebp, %eax
jle 0x27411
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
leaq 0xc13439(%rip), %rsi    # 0xc3a6c0
callq 0x402a
jmp 0x272a4
movl %eax, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x80(%rsp), %rsi
callq 0x402a
leaq 0xe8(%rsp), %rdi
callq 0x41fe
leaq 0xc8(%rsp), %rdi
callq 0x43b8
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x272db
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x272f8
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x27315
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r12d, %esi
leaq 0x190(%rsp), %rdi
callq 0x1b2be
movl %ebp, %esi
leaq 0x160(%rsp), %rdi
callq 0x1b2be
movaps 0x160(%rsp), %xmm0
movaps 0x170(%rsp), %xmm1
movaps 0x180(%rsp), %xmm2
movaps %xmm2, 0x50(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps 0x190(%rsp), %xmm0
movaps 0x1a0(%rsp), %xmm1
movaps 0x1b0(%rsp), %xmm2
movaps %xmm2, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
movl $0x2, %edx
callq 0x202eb
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rax, %rsi
subq %rcx, %rsi
movq 0xc13309(%rip), %rdi    # 0xc3a6c8
movq 0xc132fa(%rip), %rdx    # 0xc3a6c0
subq %rdx, %rdi
cmpq %rdi, %rsi
jne 0x2743b
cmpq %rax, %rcx
sete %sil
je 0x27418
movl (%rcx), %esi
cmpl (%rdx), %esi
jne 0x2743b
movl 0x4(%rdx), %esi
cmpl %esi, 0x4(%rcx)
jne 0x2743b
addq $0x8, %rcx
addq $0xc, %rdx
cmpq %rax, %rcx
sete %sil
je 0x27418
movl (%rcx), %esi
cmpl -0x4(%rdx), %esi
jne 0x2743b
leaq 0x8(%rcx), %rsi
movl (%rdx), %edi
addq $0x8, %rdx
cmpl %edi, 0x4(%rcx)
movq %rsi, %rcx
je 0x273ed
jmp 0x2743b
movl %eax, (%rbx)
jmp 0x27297
testb %sil, %sil
je 0x2743b
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0xc1328f(%rip), %rsi    # 0xc3a6c0
callq 0x402a
jmp 0x274f5
leaq 0x108(%rsp), %rdi
movq %r13, %rsi
callq 0x431c
leaq 0x120(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x7e36
movb 0x30(%r13), %al
leaq 0x140(%rsp), %r14
movb %al, -0x8(%r14)
movq %r14, %rdi
movq %r15, %rsi
callq 0x4164
movq 0x50(%r13), %rax
leaq 0x108(%rsp), %rdi
movq %rax, 0x50(%rdi)
leaq 0x60(%rsp), %rsi
callq 0x9880
leaq 0x108(%rsp), %rdi
callq 0x1374a
cmpl %r12d, %eax
jl 0x27572
cmpl %ebp, %eax
jg 0x27591
movl %eax, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x60(%rsp), %rsi
callq 0x402a
movq %r14, %rdi
callq 0x41fe
leaq 0x120(%rsp), %rdi
callq 0x43b8
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x274f5
movq 0x118(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x272a4
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x272a4
leaq 0x2e22(%rip), %rdi      # 0x2a33e
leaq 0x4e1d(%rip), %rsi      # 0x2c340
leaq 0x4e24(%rip), %rcx      # 0x2c34e
movl $0x18, %edx
callq 0x2140
leaq 0x3310(%rip), %rdi      # 0x2a84b
leaq 0x4dfe(%rip), %rsi      # 0x2c340
leaq 0x4e05(%rip), %rcx      # 0x2c34e
movl $0x19, %edx
callq 0x2140
leaq 0x2d26(%rip), %rdi      # 0x2a280
leaq 0x4ddf(%rip), %rsi      # 0x2c340
leaq 0x4de6(%rip), %rcx      # 0x2c34e
movl $0x23, %edx
callq 0x2140
leaq 0x2d9d(%rip), %rdi      # 0x2a316
leaq 0x4dc0(%rip), %rsi      # 0x2c340
leaq 0x4dc7(%rip), %rcx      # 0x2c34e
movl $0x2e, %edx
callq 0x2140
leaq 0x2d92(%rip), %rdi      # 0x2a32a
leaq 0x4da1(%rip), %rsi      # 0x2c340
leaq 0x4da8(%rip), %rcx      # 0x2c34e
movl $0x2f, %edx
callq 0x2140
jmp 0x275ed
jmp 0x27658
jmp 0x275f2
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x43b8
jmp 0x275ce
movq %rax, %rbx
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x27602
movq 0x118(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x27602
movq %rax, %rbx
jmp 0x27602
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x412c
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x2765b
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x2765b
jmp 0x27658
jmp 0x27658
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x43b8
jmp 0x27634
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x27668
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x27668
movq %rax, %rbx
jmp 0x27668
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x412c
leaq 0x80(%rsp), %rdi
callq 0x40a0
movq %rbx, %rdi
callq 0x2310