// File: /workspace/github_cpp_makefile_star2_O1/Laakeri[P]Triangulator/src/PMC.cpp
// Function: PMC::solve(Graph const&, PMC::valueT, PMC::valueT, int)
vector<pair<int, int> > solve(const Graph& G, valueT lowerBound, valueT upperBound, int PROBLEM) {
	assert(PROBLEM == PROBLEM_MINFILL || PROBLEM == PROBLEM_TREEWIDTH || PROBLEM == PROBLEM_BAYES || PROBLEM == PROBLEM_HYPER || PROBLEM == PROBLEM_FRACHYPER);
	if (PROBLEM == PROBLEM_HYPER) {
		assert((int)vertMap.size() == G.n);
	}
	if (lowerBound > upperBound) return FAILSOLUTION;
	vector<vector<int> > PMCs = findPMCs(G, upperBound, PROBLEM);
	
	if (PROBLEM == PROBLEM_MINFILL || PROBLEM == PROBLEM_TREEWIDTH || PROBLEM == PROBLEM_BAYES || PROBLEM == PROBLEM_FRACHYPER) {
		return solvedp(G, PMCs, lowerBound, upperBound, PROBLEM);
	}
	else if (PROBLEM == PROBLEM_HYPER) {
		assert(upperBound.TYPE == valueT::TYPE_INT);
		vector<vector<int> > goodPMCs;
		for (int64_t k = lowerBound.valInt; k <= upperBound.valInt; k++) {
			for (int i = 0; i < (int)PMCs.size(); i++) {
				if (canFill(G, PMCs[i], k, PROBLEM_HYPER)) {
					goodPMCs.push_back(PMCs[i]);
					swap(PMCs[i], PMCs.back());
					PMCs.pop_back();
					i--;
				}
			}
			auto sol0 = solvedp(G, goodPMCs, (int64_t)0, (int64_t)0, PROBLEM_DECIDE);
			if (sol0 != FAILSOLUTION) {
				return sol0;
			}
		}
		return FAILSOLUTION;
	}
	else {
		assert(0);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
leal -0x1(%r15), %eax
cmpl $0x4, %eax
jae 0x2043e
cmpl $0x4, %r15d
jne 0x20334
movq 0x630799(%rip), %rax    # 0x650ab8
subq 0x63078a(%rip), %rax    # 0x650ab0
shrq $0x2, %rax
cmpl %eax, 0x50(%r14)
jne 0x20718
leaq 0x1d0(%rsp), %r13
leaq 0x1a0(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x1b3b0
testb %al, %al
je 0x20367
leaq 0x5cec96(%rip), %rsi    # 0x5eeff0
movq %rbx, %rdi
callq 0x402a
jmp 0x20429
movaps (%r13), %xmm0
movaps 0x10(%r13), %xmm1
movaps 0x20(%r13), %xmm2
movaps %xmm2, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1d6c9
cmpl $0x6, %r15d
ja 0x20467
movl $0x4e, %eax
btl %r15d, %eax
jae 0x20467
leaq 0xa8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x4164
movaps (%r13), %xmm0
movaps 0x10(%r13), %xmm1
movaps 0x20(%r13), %xmm2
movaps %xmm2, 0x50(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps (%r12), %xmm0
movaps 0x10(%r12), %xmm1
movaps 0x20(%r12), %xmm2
movaps %xmm2, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0xa8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %ecx
callq 0x1e08c
leaq 0xa8(%rsp), %rdi
callq 0x41fe
leaq 0x70(%rsp), %rdi
callq 0x41fe
movq %rbx, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x6, %r15d
je 0x20312
leaq 0xbc2a(%rip), %rdi      # 0x2c079
leaq 0xb260(%rip), %rsi      # 0x2b6b6
leaq 0xbcaf(%rip), %rcx      # 0x2c10c
movl $0x32f, %edx            # imm = 0x32F
callq 0x2140
cmpl $0x4, %r15d
jne 0x20737
cmpl $0x1, 0x20(%r13)
jne 0x20756
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
movq (%r12), %rbp
movq (%r13), %rax
movq %rax, 0x88(%rsp)
cmpq %rax, %rbp
setg %cl
jg 0x206fc
leaq 0x90(%rsp), %r15
movb %cl, 0x6f(%rsp)
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
testl %ecx, %ecx
jle 0x205bd
xorl %r13d, %r13d
movslq %r13d, %rcx
leaq (%rcx,%rcx,2), %r12
leaq (%rax,%r12,8), %rsi
movl $0x1, 0x140(%rsp)
movq %rbp, 0x120(%rsp)
movaps 0x120(%rsp), %xmm0
movaps 0x130(%rsp), %xmm1
movaps 0x140(%rsp), %xmm2
movaps %xmm2, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq %r14, %rdi
movl $0x4, %edx
callq 0x1c57a
testb %al, %al
je 0x2059a
leaq (,%r12,8), %rsi
addq 0x70(%rsp), %rsi
movq %r15, %rdi
callq 0xa744
movq 0x70(%rsp), %rcx
movq 0x78(%rsp), %rax
leaq -0x18(%rax), %rdx
movq (%rcx,%r12,8), %rdi
movups 0x8(%rcx,%r12,8), %xmm0
movq -0x18(%rax), %rsi
movq %rsi, (%rcx,%r12,8)
movq -0x10(%rax), %rsi
movq %rsi, 0x8(%rcx,%r12,8)
movq -0x8(%rax), %rsi
movq %rsi, 0x10(%rcx,%r12,8)
movq %rdi, -0x18(%rax)
movups %xmm0, -0x10(%rax)
movq %rdx, 0x78(%rsp)
testq %rdi, %rdi
je 0x20597
movq -0x8(%rax), %rsi
subq %rdi, %rsi
callq 0x2210
decl %r13d
incl %r13d
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
cmpl %ecx, %r13d
jl 0x204dd
leaq 0x150(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x4164
movl $0x1, %eax
movl %eax, 0x110(%rsp)
xorl %ecx, %ecx
movq %rcx, 0xf0(%rsp)
movl %eax, 0xe0(%rsp)
movq %rcx, 0xc0(%rsp)
movaps 0xc0(%rsp), %xmm0
movaps 0xd0(%rsp), %xmm1
movaps 0xe0(%rsp), %xmm2
movaps %xmm2, 0x50(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps 0xf0(%rsp), %xmm0
movaps 0x100(%rsp), %xmm1
movaps 0x110(%rsp), %xmm2
movaps %xmm2, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl $0x5, %ecx
callq 0x1e08c
movq %r12, %rdi
callq 0x41fe
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
movq %rax, %rdx
subq %rdi, %rdx
movq 0x5ce987(%rip), %rsi    # 0x5eeff8
movq 0x5ce978(%rip), %rcx    # 0x5eeff0
subq %rcx, %rsi
cmpq %rsi, %rdx
jne 0x206f5
cmpq %rax, %rdi
sete %sil
je 0x206c5
movl (%rdi), %edx
cmpl (%rcx), %edx
jne 0x206f5
movl 0x4(%rcx), %edx
cmpl %edx, 0x4(%rdi)
jne 0x206f5
leaq 0x8(%rdi), %rdx
addq $0xc, %rcx
cmpq %rax, %rdx
sete %sil
je 0x206c5
movl (%rdx), %esi
cmpl -0x4(%rcx), %esi
jne 0x206f5
leaq 0x8(%rdx), %rsi
movl (%rcx), %r8d
addq $0x8, %rcx
cmpl %r8d, 0x4(%rdx)
movq %rsi, %rdx
je 0x2069f
jmp 0x206f5
testb %sil, %sil
je 0x206f5
testq %rdi, %rdi
je 0x206db
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2210
leaq 0x1(%rbp), %rax
cmpq 0x88(%rsp), %rbp
setge %cl
movq %rax, %rbp
jne 0x204b7
jmp 0x206fc
testb $0x1, 0x6f(%rsp)
je 0x2070b
leaq 0x5ce8ed(%rip), %rsi    # 0x5eeff0
movq %rbx, %rdi
callq 0x402a
leaq 0x90(%rsp), %rdi
jmp 0x2041a
leaq 0xba33(%rip), %rdi      # 0x2c152
leaq 0xaf90(%rip), %rsi      # 0x2b6b6
leaq 0xb9df(%rip), %rcx      # 0x2c10c
movl $0x331, %edx            # imm = 0x331
callq 0x2140
leaq 0x9a4e(%rip), %rdi      # 0x2a18c
leaq 0xaf71(%rip), %rsi      # 0x2b6b6
leaq 0xb9c0(%rip), %rcx      # 0x2c10c
movl $0x34d, %edx            # imm = 0x34D
callq 0x2140
leaq 0xb34f(%rip), %rdi      # 0x2baac
leaq 0xaf52(%rip), %rsi      # 0x2b6b6
leaq 0xb9a1(%rip), %rcx      # 0x2c10c
movl $0x33a, %edx            # imm = 0x33A
callq 0x2140
jmp 0x2079d
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x41fe
jmp 0x207a0
jmp 0x2079d
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x207a8
movq %rax, %rbx
jmp 0x207ad
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x41fe
leaq 0x70(%rsp), %rdi
callq 0x41fe
movq %rbx, %rdi
callq 0x2310