// File: /workspace/github_cpp_makefile_star2_O3/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 0x26d0b
movl %r8d, %ebp
movl %ecx, %r14d
cmpl %r8d, %ecx
jg 0x26d2a
movl %edx, %r12d
movq %rdi, %rbx
cmpl %ebp, %edx
jle 0x269d4
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0xc12cf6(%rip), %rsi    # 0xc396c0
callq 0x3f7c
jmp 0x26b25
movq %rsi, %r13
cmpl %r12d, %r14d
cmovlel %r12d, %r14d
leaq 0x80(%rsp), %rdi
callq 0x12cbc
leaq 0xb0(%rsp), %rdi
movq %r13, %rsi
callq 0x42ce
leaq 0xc8(%rsp), %rdi
leaq 0x18(%r13), %rsi
movq %rsi, 0x78(%rsp)
callq 0x815a
movb 0x30(%r13), %al
leaq 0xe8(%rsp), %rdi
movb %al, -0x8(%rdi)
leaq 0x38(%r13), %r15
movq %r15, %rsi
callq 0x4110
movq 0x50(%r13), %rax
leaq 0xb0(%rsp), %rdi
movq %rax, 0x50(%rdi)
leaq 0x80(%rsp), %rsi
callq 0x9bd8
leaq 0xb0(%rsp), %rdi
callq 0x139e9
cmpl %r12d, %eax
jl 0x26d49
cmpl %r14d, %eax
jbe 0x26a9e
movq 0x88(%rsp), %rcx
subq 0x80(%rsp), %rcx
cmpq $0x8, %rcx
ja 0x26b3a
leaq 0x8(%rbx), %rdi
cmpl %ebp, %eax
jbe 0x26ccb
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
leaq 0xc12c29(%rip), %rsi    # 0xc396c0
callq 0x3f7c
jmp 0x26ab4
movl %eax, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x80(%rsp), %rsi
callq 0x3f7c
leaq 0xe8(%rsp), %rdi
callq 0x41aa
leaq 0xc8(%rsp), %rdi
callq 0x436a
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x26aeb
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x26b08
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x26b25
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 0x1b3f6
movl %ebp, %esi
leaq 0x160(%rsp), %rdi
callq 0x1b3f6
movaps 0x160(%rsp), %xmm0
movaps 0x170(%rsp), %xmm1
movaps 0x180(%rsp), %xmm2
movaps %xmm2, 0x50(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movapd 0x190(%rsp), %xmm0
movdqa 0x1a0(%rsp), %xmm1
movaps 0x1b0(%rsp), %xmm2
movaps %xmm2, 0x20(%rsp)
movdqa %xmm1, 0x10(%rsp)
movapd %xmm0, (%rsp)
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
movl $0x2, %edx
callq 0x20611
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
movq %rcx, %rsi
subq %rax, %rsi
movq 0xc12af5(%rip), %rdi    # 0xc396c8
movq 0xc12ae6(%rip), %rdx    # 0xc396c0
subq %rdx, %rdi
cmpq %rdi, %rsi
jne 0x26c0f
cmpq %rcx, %rax
je 0x26cd2
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 0x26c0f
addq $0x8, %rax
addq $0x8, %rdx
jmp 0x26be2
leaq 0x108(%rsp), %rdi
movq %r13, %rsi
callq 0x42ce
leaq 0x120(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x815a
movb 0x30(%r13), %al
leaq 0x140(%rsp), %r14
movb %al, -0x8(%r14)
movq %r14, %rdi
movq %r15, %rsi
callq 0x4110
movq 0x50(%r13), %rax
leaq 0x108(%rsp), %rdi
movq %rax, 0x50(%rdi)
leaq 0x60(%rsp), %rsi
callq 0x9bd8
leaq 0x108(%rsp), %rdi
callq 0x139e9
cmpl %r12d, %eax
jl 0x26d68
cmpl %ebp, %eax
jg 0x26d87
movl %eax, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x60(%rsp), %rsi
callq 0x3f7c
movq %r14, %rdi
callq 0x41aa
leaq 0x120(%rsp), %rdi
callq 0x436a
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x26ceb
movq 0x118(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x26ceb
movl %eax, (%rbx)
jmp 0x26aa7
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0xc129da(%rip), %rsi    # 0xc396c0
callq 0x3f7c
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x26ab4
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x26ab4
leaq 0x263c(%rip), %rdi      # 0x2934e
leaq 0x4637(%rip), %rsi      # 0x2b350
leaq 0x463e(%rip), %rcx      # 0x2b35e
movl $0x18, %edx
callq 0x2140
leaq 0x2b2a(%rip), %rdi      # 0x2985b
leaq 0x4618(%rip), %rsi      # 0x2b350
leaq 0x461f(%rip), %rcx      # 0x2b35e
movl $0x19, %edx
callq 0x2140
leaq 0x2540(%rip), %rdi      # 0x29290
leaq 0x45f9(%rip), %rsi      # 0x2b350
leaq 0x4600(%rip), %rcx      # 0x2b35e
movl $0x23, %edx
callq 0x2140
leaq 0x25b7(%rip), %rdi      # 0x29326
leaq 0x45da(%rip), %rsi      # 0x2b350
leaq 0x45e1(%rip), %rcx      # 0x2b35e
movl $0x2e, %edx
callq 0x2140
leaq 0x25ac(%rip), %rdi      # 0x2933a
leaq 0x45bb(%rip), %rsi      # 0x2b350
leaq 0x45c2(%rip), %rcx      # 0x2b35e
movl $0x2f, %edx
callq 0x2140
jmp 0x26de3
jmp 0x26e4e
jmp 0x26de8
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x436a
jmp 0x26dc4
movq %rax, %rbx
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x26df8
movq 0x118(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x26df8
movq %rax, %rbx
jmp 0x26df8
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x40d8
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x26e51
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x26e51
jmp 0x26e4e
jmp 0x26e4e
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x436a
jmp 0x26e2a
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x26e5e
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2210
jmp 0x26e5e
movq %rax, %rbx
jmp 0x26e5e
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x40d8
leaq 0x80(%rsp), %rdi
callq 0x3ff2
movq %rbx, %rdi
callq 0x2310