// File: /workspace/github_cpp_makefile_star2_O1/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 0x298e6
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2a464
testb %al, %al
je 0x17ce1
leaq 0x68(%r14), %r13
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2233b(%rip), %rsi     # 0x39e9f
leaq 0x22337(%rip), %rdx     # 0x39ea2
leaq 0x88(%rsp), %r12
movq %r12, %rdi
callq 0x945c
leaq 0x18(%rsp), %rdi
movq %r13, 0x10(%rsp)
movq %r13, %rsi
movq %r12, %rdx
callq 0x306be
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x17bad
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x222c6(%rip), %rsi     # 0x39e83
leaq 0x222c6(%rip), %rdx     # 0x39e8a
leaq 0x68(%rsp), %rdi
callq 0x945c
leaq 0x30(%rsp), %rdi
leaq 0x68(%rsp), %rdx
movq 0x10(%rsp), %rsi
callq 0x30bc2
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x17bf9
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x30(%rsp), %r15
movq 0x38(%rsp), %r12
cmpq %r12, %r15
je 0x17c6c
leaq 0x430(%r14), %rax
movq %rax, 0x8(%rsp)
addq $0x4, %r15
movslq -0x4(%r15), %r13
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2a464
movl %eax, %ebp
testb %al, %al
je 0x17c6c
movq %r14, %rdi
movl %r13d, %esi
callq 0x284dc
testb %al, %al
jne 0x17c5d
leaq (,%r13,4), %rsi
addq %r13, %rsi
shlq $0x3, %rsi
addq (%r14), %rsi
movq %r14, %rdi
movq 0x8(%rsp), %rdx
callq 0x166ce
cmpq %r12, %r15
setne %al
addq $0x4, %r15
testb %al, %bpl
jne 0x17c18
movq %rbx, %rdi
callq 0x2a792
testb %al, %al
je 0x17d03
movq 0x18(%rsp), %r13
movq 0x20(%rsp), %r12
cmpq %r12, %r13
je 0x17d03
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 0x1d76e
cmpq $0x41, %r15
jl 0x17cf5
leaq 0x40(%r13), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1da7b
cmpq %r12, %rbp
je 0x17d03
movq %rbp, %rdi
movq %r14, %rsi
callq 0x1db16
addq $0x4, %rbp
jmp 0x17ccb
movq %rbx, %rdi
movl $0xa, %esi
callq 0x29928
xorl %ebp, %ebp
jmp 0x17e19
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x1da7b
movq 0x18(%rsp), %r15
movq 0x20(%rsp), %r12
cmpq %r12, %r15
je 0x17d84
leaq 0x430(%r14), %rax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
movslq (%r15), %r13
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2a464
movl $0x4, %ecx
testb %al, %al
je 0x17d70
movq 0x18(%r14), %rax
leaq (,%r13,2), %rcx
addq %r13, %rcx
movq 0x8(%rax,%rcx,8), %rdx
subq (%rax,%rcx,8), %rdx
movl $0x5, %ecx
cmpq $0x5, %rdx
jb 0x17d70
movq %r14, %rdi
movl %r13d, %esi
movq 0x8(%rsp), %rdx
callq 0x16976
addl %eax, %ebp
xorl %ecx, %ecx
cmpl $0x5, %ecx
je 0x17d79
testl %ecx, %ecx
jne 0x17d86
addq $0x4, %r15
cmpq %r12, %r15
jne 0x17d20
jmp 0x17d86
xorl %ebp, %ebp
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x220ed(%rip), %rsi     # 0x39e83
leaq 0x220ed(%rip), %rdx     # 0x39e8a
leaq 0x48(%rsp), %rdi
callq 0x945c
leaq 0x48(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x30fe4
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x17dcd
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x220b7(%rip), %rdx     # 0x39e8b
movq %r14, %rdi
movl %ebp, %esi
callq 0x1f426
movq %rbx, %rdi
movl $0xa, %esi
callq 0x29928
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x17e02
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x17e19
movq 0x28(%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 0x17e8b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x17e8b
jmp 0x17e88
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x17ea2
movq 0x78(%rsp), %rsi
incq %rsi
jmp 0x17e9d
movq %rax, %rbx
jmp 0x17ea2
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x17eb9
movq 0x98(%rsp), %rsi
incq %rsi
jmp 0x17eb4
jmp 0x17e88
jmp 0x17e88
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x17ea2
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x17eb9
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x34a0
nop