// File: /workspace/github_cpp_makefile_star2_O3/Laakeri[P]maxpre/src/./BVA.cpp
// Function: maxPreprocessor::Preprocessor::doBVA()
int Preprocessor::doBVA() {
	rLog.startTechnique(Log::Technique::BVA);
	if (!rLog.requestTime(Log::Technique::BVA)) {
		rLog.stopTechnique(Log::Technique::BVA);
		return 0;
	}
	int removed = 0;
	vector<int> checkLit = pi.tl.getTouchedLiterals("BVA");
	vector<int> hClauses = pi.tl.getModClauses("BVAhash");
	for (int c : hClauses) {
		if (!rLog.requestTime(Log::Technique::BVA)) break;
		if (!pi.isClauseRemoved(c)) {
			addBVAHash(pi.clauses[c].lit, BVAHashTable);
		}
	}
	if (rLog.isTimeLimit()) {
		// The best literals to consider should be the ones that occur most
		// (at least the paper had this heuristic)
		auto cmp = [&](int lit1, int lit2) {
			return pi.litClauses[lit1].size() > pi.litClauses[lit2].size();
		};
		sort(checkLit.begin(), checkLit.end(), cmp);
	}
	for (int lit : checkLit) {
		if (!rLog.requestTime(Log::Technique::BVA)) break;
		if (pi.litClauses[lit].size() < 2) continue;
		removed += tryBVA(lit, BVAHashTable);
	}
	pi.tl.setItr("BVAhash");
	log(removed, " clauses removed by BVA");
	rLog.stopTechnique(Log::Technique::BVA);
	return removed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %r14
leaq 0x218(%rdi), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x28b9e
movq %rbx, %rdi
movl $0xa, %esi
callq 0x29718
testb %al, %al
je 0x1752c
leaq 0x68(%r14), %r13
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x21b8b(%rip), %rsi     # 0x38f4f
leaq 0x21b87(%rip), %rdx     # 0x38f52
leaq 0x88(%rsp), %r12
movq %r12, %rdi
callq 0x9466
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x2f7b6
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x17408
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x21b1b(%rip), %rsi     # 0x38f33
leaq 0x21b1b(%rip), %rdx     # 0x38f3a
leaq 0x68(%rsp), %rdi
callq 0x9466
leaq 0x20(%rsp), %rdi
leaq 0x68(%rsp), %rdx
movq %r13, %rsi
callq 0x2fc9e
movq %r13, 0x38(%rsp)
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x17457
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x20(%rsp), %rbp
movq 0x28(%rsp), %r15
cmpq %r15, %rbp
je 0x174b7
leaq 0x430(%r14), %r12
movslq (%rbp), %r13
movq %rbx, %rdi
movl $0xa, %esi
callq 0x29718
testb %al, %al
je 0x174b7
movq %r14, %rdi
movl %r13d, %esi
callq 0x27804
testb %al, %al
jne 0x174ae
leaq (,%r13,4), %rsi
addq %r13, %rsi
shlq $0x3, %rsi
addq (%r14), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x15f32
addq $0x4, %rbp
cmpq %r15, %rbp
jne 0x1746d
movq %rbx, %rdi
callq 0x29a46
testb %al, %al
je 0x1754e
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %r12
cmpq %r12, %r13
je 0x1754e
movq %r12, %r15
subq %r13, %r15
movq %r15, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x1cc1b
cmpq $0x41, %r15
jl 0x17540
leaq 0x40(%r13), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1cf11
cmpq %r12, %rbp
je 0x1754e
movq %rbp, %rdi
movq %r14, %rsi
callq 0x1cfac
addq $0x4, %rbp
jmp 0x17516
movq %rbx, %rdi
movl $0xa, %esi
callq 0x28be0
xorl %ebp, %ebp
jmp 0x1764f
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x1cf11
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r12
cmpq %r12, %r15
je 0x175ba
leaq 0x430(%r14), %rax
movq %rax, 0x40(%rsp)
xorl %ebp, %ebp
movslq (%r15), %r13
movq %rbx, %rdi
movl $0xa, %esi
callq 0x29718
testb %al, %al
je 0x175bc
movq 0x18(%r14), %rax
leaq (,%r13,2), %rcx
addq %r13, %rcx
movq 0x8(%rax,%rcx,8), %rdx
subq (%rax,%rcx,8), %rdx
cmpq $0x5, %rdx
jb 0x175af
movq %r14, %rdi
movl %r13d, %esi
movq 0x40(%rsp), %rdx
callq 0x161a2
addl %eax, %ebp
addq $0x4, %r15
cmpq %r12, %r15
jne 0x1756b
jmp 0x175bc
xorl %ebp, %ebp
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x21967(%rip), %rsi     # 0x38f33
leaq 0x21967(%rip), %rdx     # 0x38f3a
leaq 0x48(%rsp), %rdi
callq 0x9466
leaq 0x48(%rsp), %rsi
movq 0x38(%rsp), %rdi
callq 0x30052
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x17603
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x21931(%rip), %rdx     # 0x38f3b
movq %r14, %rdi
movl %ebp, %esi
callq 0x1e844
movq %rbx, %rdi
movl $0xa, %esi
callq 0x28be0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x17638
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1764f
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x176c1
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x176c1
jmp 0x176be
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x176d8
movq 0x78(%rsp), %rsi
incq %rsi
jmp 0x176d3
movq %rax, %rbx
jmp 0x176d8
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x176ef
movq 0x98(%rsp), %rsi
incq %rsi
jmp 0x176ea
jmp 0x176be
jmp 0x176be
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x176d8
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x176ef
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x34a0
nop