// File: /workspace/github_cpp_makefile_star2_O3/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
movl %esi, %r12d
movslq %esi, %rax
movq (%rdi), %rcx
leaq (%rax,%rax,4), %rax
movq (%rcx,%rax,8), %rax
movl (%rax), %ecx
movl 0x4(%rax), %esi
cmpl %edx, %esi
cmovel %ecx, %esi
sete %al
cmpl %edx, %ecx
sete %cl
orb %al, %cl
je 0x126ed
movl %edx, %ebx
movq %rdi, %r13
movslq %edx, %rcx
movq 0x18(%rdi), %rax
leaq (%rcx,%rcx,2), %r15
movq 0x8(%rax,%r15,8), %rcx
subq (%rax,%r15,8), %rcx
cmpq $0x5, %rcx
jb 0x12121
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rbp
movq 0x8(%rax,%rbp,8), %rcx
subq (%rax,%rbp,8), %rcx
cmpq $0x5, %rcx
jae 0x12128
xorl %ebx, %ebx
jmp 0x126d9
movl %ebx, %ecx
xorl $0x1, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rdx
movq 0x8(%rax,%rdx,8), %rcx
movq %rdx, 0x80(%rsp)
subq (%rax,%rdx,8), %rcx
cmpq $0x4, %rcx
jne 0x1270c
movl %esi, %ecx
xorl $0x1, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rdx
movq 0x8(%rax,%rdx,8), %rcx
movq %rdx, 0x78(%rsp)
subq (%rax,%rdx,8), %rcx
cmpq $0x4, %rcx
jne 0x1272b
leaq (%rax,%r15,8), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movq (%rcx), %rdi
movq 0x8(%rcx), %rcx
movq %rcx, 0x90(%rsp)
movq %rcx, %r8
subq %rdi, %r8
movq %r13, 0x8(%rsp)
movl %r12d, 0x2c(%rsp)
movl %esi, 0x3c(%rsp)
je 0x124ae
leaq (%rax,%rbp,8), %rax
shrq $0x2, %r8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
shrq $0x2, %rcx
addl %ecx, %r8d
leaq 0x10(%rsp), %r13
movq %rbp, 0x58(%rsp)
movq %r15, 0x88(%rsp)
movq %r8, 0xa0(%rsp)
movslq (%rdi), %rcx
movq %rcx, 0x30(%rsp)
cmpl %r12d, %ecx
jne 0x12471
movq %rdi, 0x98(%rsp)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax,%rbp,8), %r15
movq 0x8(%rax,%rbp,8), %rax
movq %rax, 0xb0(%rsp)
cmpq %rax, %r15
je 0x12444
movq 0x30(%rsp), %rax
leaq (%rax,%rax,4), %rax
movq %rax, 0xa8(%rsp)
cmpl %r12d, 0x30(%rsp)
je 0x12432
movl (%r15), %ebp
cmpl %r12d, %ebp
je 0x12432
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0xa8(%rsp), %rcx
movq (%rax,%rcx,8), %r14
movq 0x8(%rax,%rcx,8), %r12
cmpq %r12, %r14
je 0x122b6
movl (%r14), %eax
movl %eax, 0x40(%rsp)
cmpl %ebx, %eax
je 0x122a5
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x12298
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x122a5
movq %r13, %rdi
leaq 0x40(%rsp), %rdx
callq 0x98f8
addq $0x4, %r14
cmpq %r12, %r14
jne 0x12274
movq 0x8(%rsp), %rax
movq (%rax), %rax
movslq %ebp, %rcx
leaq (%rcx,%rcx,4), %rcx
movq (%rax,%rcx,8), %r14
movq 0x8(%rax,%rcx,8), %r12
cmpq %r12, %r14
je 0x12302
movl (%r14), %eax
movl %eax, 0x40(%rsp)
cmpl %ebx, %eax
je 0x122fc
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x122ef
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x122fc
movq %r13, %rdi
leaq 0x40(%rsp), %rdx
callq 0x98f8
addq $0x4, %r14
jmp 0x122c6
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %r14
cmpq %r14, %rbp
je 0x12387
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 0x2226b
movl 0x2c(%rsp), %r12d
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2234e
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %rax
cmpq %rax, %rbp
je 0x123a2
leaq 0x4(%rbp), %rcx
cmpq %rax, %rcx
je 0x123a2
movl -0x4(%rcx), %edx
leaq 0x4(%rcx), %rsi
cmpl (%rcx), %edx
movq %rsi, %rcx
jne 0x12356
leaq -0x8(%rsi), %rcx
cmpq %rax, %rsi
je 0x12391
movl %edx, %edi
movl (%rsi), %edx
cmpl %edx, %edi
je 0x12381
movl %edx, 0x4(%rcx)
addq $0x4, %rcx
addq $0x4, %rsi
jmp 0x1236d
movq %rbp, %rax
movl 0x2c(%rsp), %r12d
jmp 0x123a2
addq $0x4, %rcx
cmpq %rax, %rcx
je 0x123a2
movq %rcx, 0x18(%rsp)
movq %rcx, %rax
subq %rbp, %rax
sarq $0x2, %rax
cmpq $0x2, %rax
jb 0x123d2
movl $0x1, %edx
movl $0x2, %ecx
leal -0x2(%rcx), %esi
movl (%rbp,%rsi,4), %esi
xorl (%rbp,%rdx,4), %esi
cmpl $0x1, %esi
je 0x12411
movl %ecx, %edx
incl %ecx
cmpq %rdx, %rax
ja 0x123b9
movq 0x68(%rsp), %rax
subq 0x60(%rsp), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
movl $0x1, %r14d
cmpl 0xa0(%rsp), %eax
jge 0x1240a
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
callq 0x1f07e
xorl %r14d, %r14d
movq 0x10(%rsp), %rbp
testq %rbp, %rbp
jne 0x12417
jmp 0x12427
movl $0x7, %r14d
movq 0x20(%rsp), %rsi
subq %rbp, %rsi
movq %rbp, %rdi
callq 0x32b0
cmpl $0x7, %r14d
je 0x12432
testl %r14d, %r14d
jne 0x1249e
addq $0x4, %r15
cmpq 0xb0(%rsp), %r15
jne 0x1222e
movq 0x98(%rsp), %rdi
addq $0x4, %rdi
cmpq 0x90(%rsp), %rdi
movl 0x3c(%rsp), %esi
movq 0x58(%rsp), %rbp
movq 0x88(%rsp), %r15
jne 0x121e1
jmp 0x124a5
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq 0x30(%rsp), %rax
leaq (%rax,%rax,4), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rcx
cmpq %rcx, %rax
je 0x121f2
cmpl %esi, (%rax)
je 0x1249e
addq $0x4, %rax
jmp 0x1248b
xorl %ebx, %ebx
jmp 0x126cf
movq 0x8(%rsp), %r13
movq 0x18(%r13), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x80(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movq %r13, %rdi
callq 0x27f28
movq 0x18(%r13), %rax
movq (%rax,%r15,8), %r14
movq 0x8(%rax,%r15,8), %r15
cmpq %r15, %r14
je 0x125de
movq %rbp, 0x58(%rsp)
leaq 0x218(%r13), %rax
movq %rax, 0x30(%rsp)
leaq 0x40(%rsp), %rbp
movl (%r14), %r13d
movq 0x8(%rsp), %rdi
movl %r13d, %esi
callq 0x27804
testb %al, %al
jne 0x12531
movq 0x8(%rsp), %rdi
movl %r13d, %esi
callq 0x27f28
movq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x28c28
cmpl %r12d, %r13d
jne 0x12549
addq $0x4, %r14
cmpq %r15, %r14
movl 0x2c(%rsp), %r12d
jne 0x12501
jmp 0x125d0
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x2259a
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1257e
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movslq %r13d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
leaq (%rax,%rax,4), %rax
movq (%rcx,%rax,8), %r13
movq 0x8(%rcx,%rax,8), %r12
cmpq %r12, %r13
je 0x12536
movl (%r13), %eax
movl %eax, 0x40(%rsp)
movq 0x18(%rsp), %rdi
movq -0x10(%rdi), %rsi
cmpq -0x8(%rdi), %rsi
je 0x125be
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x10(%rdi)
jmp 0x125ca
addq $-0x18, %rdi
movq %rbp, %rdx
callq 0x98f8
addq $0x4, %r13
jmp 0x12596
movq 0x8(%rsp), %r13
movq 0x18(%r13), %rax
movq 0x58(%rsp), %rbp
movq (%rax,%rbp,8), %r14
movq 0x8(%rax,%rbp,8), %r12
cmpq %r12, %r14
je 0x12624
leaq 0x218(%r13), %r15
movl (%r14), %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x27804
testb %al, %al
jne 0x1261b
movq %r13, %rdi
movl %ebp, %esi
callq 0x27f28
movq %r15, %rdi
movl $0x1, %esi
callq 0x28c28
addq $0x4, %r14
cmpq %r12, %r14
jne 0x125f3
movq 0x60(%rsp), %r15
movq 0x68(%rsp), %r14
cmpq %r14, %r15
je 0x1266f
movq 0x8(%rsp), %rax
leaq 0x218(%rax), %r12
movabsq $-0x8000000000000000, %r13 # imm = 0x8000000000000000
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x27f82
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x28c28
addq $0x18, %r15
cmpq %r14, %r15
jne 0x12649
movq 0x8(%rsp), %r15
leaq 0x218(%r15), %rdi
movl $0x1, %esi
callq 0x28cdc
leaq 0x2f0(%r15), %r14
movq (%r15), %rax
movq 0x18(%r15), %rcx
movq 0x78(%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 0x27030
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %esi
movl 0x3c(%rsp), %edx
callq 0x26b98
leaq 0x10(%rsp), %rdi
callq 0x8f5e
movb $0x1, %bl
leaq 0x60(%rsp), %rdi
callq 0x8f5e
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x262ab(%rip), %rdi     # 0x3899f
leaq 0x262ae(%rip), %rsi     # 0x389a9
leaq 0x262b1(%rip), %rcx     # 0x389b3
movl $0x5, %edx
callq 0x31b0
leaq 0x262d5(%rip), %rdi     # 0x389e8
leaq 0x2628f(%rip), %rsi     # 0x389a9
leaq 0x26292(%rip), %rcx     # 0x389b3
movl $0x9, %edx
callq 0x31b0
leaq 0x262e1(%rip), %rdi     # 0x38a13
leaq 0x26270(%rip), %rsi     # 0x389a9
leaq 0x26273(%rip), %rcx     # 0x389b3
movl $0xa, %edx
callq 0x31b0
jmp 0x12772
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x12775
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
jmp 0x12775
jmp 0x12783
jmp 0x12772
jmp 0x12772
jmp 0x12772
jmp 0x12783
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x8f5e
jmp 0x1279d
jmp 0x12783
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1279d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0x60(%rsp), %rdi
callq 0x8f5e
movq %rbx, %rdi
callq 0x34a0
nop