// File: /workspace/github_cpp_makefile_star2_O3/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 $0x1c8, %rsp            # imm = 0x1C8
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
leal -0x1(%r15), %eax
cmpl $0x4, %eax
jae 0x20764
cmpl $0x4, %r15d
jne 0x2065a
movq 0x62f473(%rip), %rax    # 0x64fab8
subq 0x62f464(%rip), %rax    # 0x64fab0
shrq $0x2, %rax
cmpl %eax, 0x50(%r14)
jne 0x20a5c
leaq 0x230(%rsp), %r13
leaq 0x200(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x1b4e8
testb %al, %al
je 0x2068d
leaq 0x5cd970(%rip), %rsi    # 0x5edff0
movq %rbx, %rdi
callq 0x3f7c
jmp 0x2074f
movaps (%r13), %xmm0
movaps 0x10(%r13), %xmm1
movaps 0x20(%r13), %xmm2
movaps %xmm2, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1d948
cmpl $0x6, %r15d
ja 0x2078d
movl $0x4e, %eax
btl %r15d, %eax
jae 0x2078d
leaq 0xa8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x4110
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 0x1e38f
leaq 0xa8(%rsp), %rdi
callq 0x41aa
leaq 0x68(%rsp), %rdi
callq 0x41aa
movq %rbx, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x6, %r15d
je 0x20638
leaq 0xa914(%rip), %rdi      # 0x2b089
leaq 0x9f4a(%rip), %rsi      # 0x2a6c6
leaq 0xa999(%rip), %rcx      # 0x2b11c
movl $0x32f, %edx            # imm = 0x32F
callq 0x2140
cmpl $0x4, %r15d
jne 0x20a7b
cmpl $0x1, 0x20(%r13)
jne 0x20a9a
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq (%r12), %rbp
movq (%r13), %rax
movq %rax, 0xa0(%rsp)
cmpq %rax, %rbp
jle 0x207ea
leaq 0x5cd81b(%rip), %rsi    # 0x5edff0
movq %rbx, %rdi
callq 0x3f7c
leaq 0x80(%rsp), %rdi
jmp 0x20740
leaq 0x190(%rsp), %r15
movq 0x68(%rsp), %rcx
movq 0x70(%rsp), %rax
subq %rcx, %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
testl %eax, %eax
jle 0x20933
xorl %r12d, %r12d
movslq %r12d, %rax
leaq (%rax,%rax,2), %r13
leaq (%rcx,%r13,8), %rdx
movq %rbp, 0xc0(%rsp)
movl $0x1, 0xe0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xf0(%rsp)
movq $0x0, 0x100(%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 %xmm2, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq %r15, %rdi
movq %r14, %rsi
leaq 0xf0(%rsp), %rcx
movl $0x4, %r8d
callq 0x1bfef
movq %r15, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x1b4e8
movq 0x68(%rsp), %rcx
testb %al, %al
jne 0x20915
leaq (%rcx,%r13,8), %rsi
leaq 0x80(%rsp), %rdi
callq 0xaaa4
movq 0x68(%rsp), %rcx
movq 0x70(%rsp), %rax
leaq -0x18(%rax), %rdx
movq (%rcx,%r13,8), %rdi
movq 0x8(%rcx,%r13,8), %r8
movq 0x10(%rcx,%r13,8), %rsi
movups -0x18(%rax), %xmm0
movups %xmm0, (%rcx,%r13,8)
movq -0x8(%rax), %r9
movq %r9, 0x10(%rcx,%r13,8)
movq %rdi, -0x18(%rax)
movq %r8, -0x10(%rax)
movq %rsi, -0x8(%rax)
movq %rdx, 0x70(%rsp)
testq %rdi, %rdi
je 0x20912
subq %rdi, %rsi
callq 0x2210
movq 0x68(%rsp), %rcx
decl %r12d
incl %r12d
movq 0x70(%rsp), %rax
subq %rcx, %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cmpl %eax, %r12d
jl 0x20814
leaq 0x178(%rsp), %r12
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x4110
movl $0x1, %eax
movl %eax, 0x160(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x140(%rsp)
movl %eax, 0x130(%rsp)
movq %rcx, 0x110(%rsp)
movaps 0x110(%rsp), %xmm0
movaps 0x120(%rsp), %xmm1
movaps 0x130(%rsp), %xmm2
movaps %xmm2, 0x50(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps 0x140(%rsp), %xmm0
movaps 0x150(%rsp), %xmm1
movaps 0x160(%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 0x1e38f
movq %r12, %rdi
callq 0x41aa
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
movq %rax, %rdx
subq %rdi, %rdx
movq 0x5cd60c(%rip), %rsi    # 0x5edff8
movq 0x5cd5fd(%rip), %rcx    # 0x5edff0
subq %rcx, %rsi
cmpq %rsi, %rdx
jne 0x207dd
cmpq %rax, %rdi
je 0x20a31
xorl %edx, %edx
movl (%rdi,%rdx), %esi
cmpl (%rcx,%rdx), %esi
jne 0x207dd
movl 0x4(%rcx,%rdx), %esi
cmpl %esi, 0x4(%rdi,%rdx)
jne 0x207dd
leaq (%rdi,%rdx), %rsi
addq $0x8, %rdx
addq $0x8, %rsi
cmpq %rax, %rsi
jne 0x20a06
testq %rdi, %rdi
je 0x20a42
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2210
leaq 0x1(%rbp), %rax
cmpq 0xa0(%rsp), %rbp
movq %rax, %rbp
jne 0x207f2
jmp 0x207ce
leaq 0xa6ff(%rip), %rdi      # 0x2b162
leaq 0x9c5c(%rip), %rsi      # 0x2a6c6
leaq 0xa6ab(%rip), %rcx      # 0x2b11c
movl $0x331, %edx            # imm = 0x331
callq 0x2140
leaq 0x86ee(%rip), %rdi      # 0x29170
leaq 0x9c3d(%rip), %rsi      # 0x2a6c6
leaq 0xa68c(%rip), %rcx      # 0x2b11c
movl $0x34d, %edx            # imm = 0x34D
callq 0x2140
leaq 0xa01b(%rip), %rdi      # 0x2aabc
leaq 0x9c1e(%rip), %rsi      # 0x2a6c6
leaq 0xa66d(%rip), %rcx      # 0x2b11c
movl $0x33a, %edx            # imm = 0x33A
callq 0x2140
jmp 0x20ae1
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0x41aa
jmp 0x20ae4
jmp 0x20ae1
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x20aec
movq %rax, %rbx
jmp 0x20af1
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x41aa
leaq 0x68(%rsp), %rdi
callq 0x41aa
movq %rbx, %rdi
callq 0x2310