// File: /workspace/github_cpp_makefile_star2_O1/Laakeri[P]maxpre/src/./BCR.cpp
// Function: maxPreprocessor::Preprocessor::tryBCR(int, int)
bool Preprocessor::tryBCR(int c, int l11) {
	int l1 = pi.clauses[c].lit[0];
	int l2 = pi.clauses[c].lit[1];
	if (l2 == l11) swap(l1, l2);
	assert(l1 == l11);
	
	if (pi.litClauses[l1].size() < 2) return false;
	if (pi.litClauses[l2].size() < 2) return false;
	assert(pi.litClauses[litNegation(l1)].size() == 1);
	assert(pi.litClauses[litNegation(l2)].size() == 1);
	
	vector<vector<int> > newClauses;
	
	int sizeLimit = pi.litClauses[l1].size() + pi.litClauses[l2].size();
	
	for (int c1 : pi.litClauses[l1]) {
		if (c1 != c) {
			for (int l : pi.clauses[c1].lit) {
				if (l == l2) return false;
			}
		}
		for (int c2 : pi.litClauses[l2]) {
			if (c1 == c || c2 == c) continue;
			vector<int> nc;
			for (int l : pi.clauses[c1].lit) {
				if (l != l1) nc.push_back(l);
			}
			for (int l : pi.clauses[c2].lit) {
				if (l != l1) nc.push_back(l);
			}
			sort(nc.begin(), nc.end());
			nc.erase(unique(nc.begin(), nc.end()), nc.end());
			bool taut = false;
			for (unsigned i = 1; i < nc.size(); i++) {
				if (litNegation(nc[i]) == nc[i - 1]) {
					taut = true;
					break;
				}
			}
			if (taut) continue;
			if ((int)newClauses.size() >= sizeLimit) return false;
			newClauses.push_back(nc);
		}
	}
	vector<int> toRemove;
	vector<vector<int> > nClauses;
	pi.removeClause(pi.litClauses[litNegation(l1)][0]);
	for (int cc : pi.litClauses[l1]) {
		if (!pi.isClauseRemoved(cc)) {
			pi.removeClause(cc);
			rLog.removeClause(1);
		}
		if (cc != c) {
			nClauses.push_back(vector<int>());
			for (int l : pi.clauses[cc].lit) {
				nClauses.back().push_back(l);
			}
		}
	}
	for (int cc : pi.litClauses[l2]) {
		if (!pi.isClauseRemoved(cc)) {
			pi.removeClause(cc);
			rLog.removeClause(1);
		}
	}
	for (auto& nc : newClauses) {
		pi.addClause(nc);
		rLog.removeClause(-1);
	}
	rLog.removeLabel(1);
	trace.removeWeight(pi.clauses[pi.litClauses[litNegation(l2)][0]].weight);
	trace.BCR(l1, l2, nClauses);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movslq %esi, %rax
movq (%rdi), %rcx
leaq (%rax,%rax,4), %rax
movq (%rcx,%rax,8), %rax
movl (%rax), %ebx
movl 0x4(%rax), %eax
cmpl %edx, %eax
movl %eax, %ecx
cmovel %ebx, %ecx
movl %ecx, 0xc(%rsp)
cmovel %eax, %ebx
cmpl %edx, %ebx
jne 0x12e2e
movq %rdi, %rbp
movslq %ebx, %rcx
movq 0x18(%rdi), %rax
leaq (%rcx,%rcx,2), %rdx
movq 0x8(%rax,%rdx,8), %rcx
movq %rdx, 0x88(%rsp)
subq (%rax,%rdx,8), %rcx
cmpq $0x5, %rcx
jb 0x12850
movslq 0xc(%rsp), %rcx
leaq (%rcx,%rcx,2), %rdx
movq 0x8(%rax,%rdx,8), %rcx
movq %rdx, 0x50(%rsp)
subq (%rax,%rdx,8), %rcx
cmpq $0x5, %rcx
jae 0x12857
xorl %eax, %eax
jmp 0x12e1c
movl %ebx, %ecx
xorl $0x1, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rdx
movq 0x8(%rax,%rdx,8), %rcx
movq %rdx, 0x98(%rsp)
subq (%rax,%rdx,8), %rcx
cmpq $0x4, %rcx
jne 0x12e4d
movl 0xc(%rsp), %ecx
xorl $0x1, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rdx
movq 0x8(%rax,%rdx,8), %rcx
movq %rdx, 0x90(%rsp)
subq (%rax,%rdx,8), %rcx
cmpq $0x4, %rcx
jne 0x12e6c
movl %esi, %r12d
movq 0x88(%rsp), %rcx
leaq (%rax,%rcx,8), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq (%rcx), %r8
movq 0x8(%rcx), %rcx
movq %rcx, 0xa0(%rsp)
movq %rcx, %r9
subq %r8, %r9
movq %rbp, (%rsp)
je 0x12bdb
movq 0x50(%rsp), %rcx
leaq (%rax,%rcx,8), %rax
shrq $0x2, %r9
movq 0x8(%rax), %rcx
subq (%rax), %rcx
shrq $0x2, %rcx
addl %ecx, %r9d
movq %r9, 0xb0(%rsp)
movslq (%r8), %r13
cmpl %r12d, %r13d
je 0x1296c
movq (%rsp), %rax
movq (%rax), %rax
leaq (,%r13,4), %rcx
addq %r13, %rcx
movq (%rax,%rcx,8), %rdx
movq 0x8(%rax,%rcx,8), %rcx
movl $0x4, %ebp
cmpq %rcx, %rdx
sete %al
je 0x12964
movl 0xc(%rsp), %esi
cmpl %esi, (%rdx)
je 0x1295f
addq $0x4, %rdx
cmpq %rcx, %rdx
sete %al
je 0x12964
leaq 0x4(%rdx), %rsi
movl 0xc(%rsp), %edi
cmpl %edi, (%rdx)
movq %rsi, %rdx
jne 0x12948
movl $0x1, %ebp
testb %al, %al
je 0x12bb4
movq %r8, 0xa8(%rsp)
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %r15
movq 0x8(%rax,%rcx,8), %rax
cmpq %rax, %r15
je 0x12b9c
leaq (,%r13,4), %rcx
addq %r13, %rcx
movq %rcx, 0x68(%rsp)
movq %r13, 0x60(%rsp)
movq %rax, 0x58(%rsp)
movl $0x7, %ebp
cmpl %r12d, %r13d
je 0x12b86
movl (%r15), %r14d
cmpl %r12d, %r14d
je 0x12b86
movl %r12d, %r13d
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq (%rsp), %rax
movq (%rax), %rax
movq 0x68(%rsp), %rcx
movq (%rax,%rcx,8), %rbp
movq 0x8(%rax,%rcx,8), %r12
cmpq %r12, %rbp
je 0x12a2e
movl (%rbp), %eax
movl %eax, 0x30(%rsp)
cmpl %ebx, %eax
je 0x12a28
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x12a19
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x12a28
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x98e8
addq $0x4, %rbp
jmp 0x129f0
movslq %r14d, %rax
movq (%rsp), %rcx
movq (%rcx), %rcx
leaq (%rax,%rax,4), %rax
movq (%rcx,%rax,8), %r14
movq 0x8(%rcx,%rax,8), %r12
cmpq %r12, %r14
je 0x12a83
movl (%r14), %eax
movl %eax, 0x30(%rsp)
cmpl %ebx, %eax
je 0x12a7d
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x12a6e
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x12a7d
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x98e8
addq $0x4, %r14
jmp 0x12a45
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %r14
cmpq %r14, %rbp
je 0x12abf
movq %r14, %rax
subq %rbp, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x22eaf
movq %rbp, %rdi
movq %r14, %rsi
callq 0x22f92
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x2352e
movl %r13d, %r12d
movq 0x18(%rsp), %rcx
cmpq %rcx, %rax
movq 0x60(%rsp), %r13
je 0x12af8
movq 0x18(%rsp), %rdx
movq %rdx, %rsi
subq %rcx, %rsi
addq %rsi, %rax
cmpq %rax, %rdx
je 0x12af8
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq $0x2, %rcx
jb 0x12b30
movl $0x1, %esi
movl $0x2, %edx
leal -0x2(%rdx), %edi
movl (%rax,%rdi,4), %edi
xorl (%rax,%rsi,4), %edi
cmpl $0x1, %edi
je 0x12b65
movl %edx, %esi
incl %edx
cmpq %rsi, %rcx
ja 0x12b19
movq 0x78(%rsp), %rax
subq 0x70(%rsp), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
movl $0x1, %ebp
cmpl 0xb0(%rsp), %eax
jge 0x12b6a
xorl %ebp, %ebp
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1fc42
jmp 0x12b6a
movl $0x7, %ebp
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x12b81
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x58(%rsp), %rax
cmpl $0x7, %ebp
je 0x12b8f
testl %ebp, %ebp
jne 0x12ba1
addq $0x4, %r15
cmpq %rax, %r15
jne 0x129ad
movl $0x6, %ebp
cmpl $0x6, %ebp
movl $0x0, %eax
cmovel %eax, %ebp
movq 0xa8(%rsp), %r8
testl %ebp, %ebp
jne 0x12bcf
addq $0x4, %r8
cmpq 0xa0(%rsp), %r8
jne 0x1290c
movl $0x2, %ebp
cmpl $0x2, %ebp
sete %al
movq (%rsp), %rbp
jmp 0x12bdd
movb $0x1, %al
movl %eax, 0x58(%rsp)
testb %al, %al
je 0x12e0e
movl %r12d, 0x68(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x18(%rbp), %rax
movq 0x98(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movq %rbp, %rdi
callq 0x28c34
movq 0x18(%rbp), %rax
movq 0x88(%rsp), %rcx
movq (%rax,%rcx,8), %r14
movq 0x8(%rax,%rcx,8), %r15
cmpq %r15, %r14
je 0x12d14
leaq 0x218(%rbp), %rax
movq %rax, 0x60(%rsp)
leaq 0x30(%rsp), %r12
movl (%r14), %r13d
movq %rbp, %rdi
movl %r13d, %esi
callq 0x284dc
testb %al, %al
jne 0x12c74
movq %rbp, %rdi
movl %r13d, %esi
callq 0x28c34
movq 0x60(%rsp), %rdi
movl $0x1, %esi
callq 0x29970
cmpl 0x68(%rsp), %r13d
jne 0x12c8d
addq $0x4, %r14
cmpq %r15, %r14
movq (%rsp), %rbp
jne 0x12c48
jmp 0x12d14
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x23202
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
movq (%rsp), %rbp
je 0x12cc6
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movslq %r13d, %rax
movq (%rbp), %rcx
leaq (%rax,%rax,4), %rax
movq (%rcx,%rax,8), %r13
movq 0x8(%rcx,%rax,8), %rbp
cmpq %rbp, %r13
je 0x12c7b
movl (%r13), %eax
movl %eax, 0x30(%rsp)
movq 0x18(%rsp), %rdi
movq -0x10(%rdi), %rsi
cmpq -0x8(%rdi), %rsi
je 0x12d02
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x10(%rdi)
jmp 0x12d0e
addq $-0x18, %rdi
movq %r12, %rdx
callq 0x98e8
addq $0x4, %r13
jmp 0x12cda
movq 0x18(%rbp), %rax
movq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %r14
movq 0x8(%rax,%rcx,8), %r12
cmpq %r12, %r14
je 0x12d69
movq (%rsp), %rax
leaq 0x218(%rax), %r15
movl (%r14), %ebp
movq (%rsp), %rdi
movl %ebp, %esi
callq 0x284dc
testb %al, %al
jne 0x12d60
movq (%rsp), %rdi
movl %ebp, %esi
callq 0x28c34
movq %r15, %rdi
movl $0x1, %esi
callq 0x29970
addq $0x4, %r14
cmpq %r12, %r14
jne 0x12d36
movq 0x70(%rsp), %r15
movq 0x78(%rsp), %r13
cmpq %r13, %r15
movq (%rsp), %rbp
je 0x12db1
leaq 0x218(%rbp), %r12
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x28c8e
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x29970
addq $0x18, %r15
cmpq %r13, %r15
jne 0x12d8d
leaq 0x218(%rbp), %rdi
movl $0x1, %esi
callq 0x29a24
leaq 0x2f0(%rbp), %r14
movq (%rbp), %rax
movq 0x18(%rbp), %rcx
movq 0x90(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx), %rcx
leaq (%rcx,%rcx,4), %rcx
movq 0x18(%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x27d0c
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %esi
movl 0xc(%rsp), %edx
callq 0x27872
leaq 0x10(%rsp), %rdi
callq 0x8f6e
leaq 0x70(%rsp), %rdi
callq 0x8f6e
movl 0x58(%rsp), %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26aba(%rip), %rdi     # 0x398ef
leaq 0x26abd(%rip), %rsi     # 0x398f9
leaq 0x26ac0(%rip), %rcx     # 0x39903
movl $0x5, %edx
callq 0x31b0
leaq 0x26ae4(%rip), %rdi     # 0x39938
leaq 0x26a9e(%rip), %rsi     # 0x398f9
leaq 0x26aa1(%rip), %rcx     # 0x39903
movl $0x9, %edx
callq 0x31b0
leaq 0x26af0(%rip), %rdi     # 0x39963
leaq 0x26a7f(%rip), %rsi     # 0x398f9
leaq 0x26a82(%rip), %rcx     # 0x39903
movl $0xa, %edx
callq 0x31b0
jmp 0x12eb1
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x12eb4
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
jmp 0x12eb4
jmp 0x12ec6
jmp 0x12eb1
jmp 0x12eb1
jmp 0x12eb1
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x8f6e
jmp 0x12ee0
jmp 0x12ec6
jmp 0x12ec6
jmp 0x12ec6
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x12ee0
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0x70(%rsp), %rdi
callq 0x8f6e
movq %rbx, %rdi
callq 0x34a0