// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]maxpre/src/./BCR.cpp
// Function: maxPreprocessor::Preprocessor::doBCR2()
void Preprocessor::doBCR2() {
	for (int i = 0; i < pi.vars; i++) {
		if (pi.isLabel[i] && !pi.isVarRemoved(i)) {
			if (pi.isLabel[i] == VAR_TRUE) {
				assert(pi.litClauses[posLit(i)].size() == 1);
				for (int c : pi.litClauses[negLit(i)]) {
					if (pi.clauses[c].lit.size() == 2) {
						if (pi.isLabel[litVariable(pi.clauses[c].lit[0])] && pi.isLabel[litVariable(pi.clauses[c].lit[1])]) {
							if (pi.clauses[pi.litClauses[litNegation(pi.clauses[c].lit[0])][0]].weight == pi.clauses[pi.litClauses[litNegation(pi.clauses[c].lit[1])][0]].weight) {
								if (tryBCR(c, negLit(i))) {
									print("FAIL BCR ", i);
									abort();
								}
							}
						}
					}
				}
			}
			else if(pi.isLabel[i] == VAR_FALSE) {
				assert(pi.litClauses[negLit(i)].size() == 1);
				for (int c : pi.litClauses[posLit(i)]) {
					if (pi.clauses[c].lit.size() == 2) {
						if (pi.isLabel[litVariable(pi.clauses[c].lit[0])] && pi.isLabel[litVariable(pi.clauses[c].lit[1])]) {
							if (pi.clauses[pi.litClauses[litNegation(pi.clauses[c].lit[0])][0]].weight == pi.clauses[pi.litClauses[litNegation(pi.clauses[c].lit[1])][0]].weight) {
								if (tryBCR(c, posLit(i))) {
									print("FAIL BCR ", i);
									abort();
								}
							}
						}
					}
				}
			}
			else{
				assert(0);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
xorl %ebx, %ebx
movslq 0x60(%r14), %rax
cmpq %rax, %rbx
jge 0xf3f1
movq 0x48(%r14), %rax
cmpl $0x0, (%rax,%rbx,4)
je 0xf224
movq %r14, %rdi
movl %ebx, %esi
callq 0x20fae
testb %al, %al
je 0xf229
incq %rbx
jmp 0xf1ff
movq 0x48(%r14), %rax
movl (%rax,%rbx,4), %eax
cmpl $0x2, %eax
je 0xf31a
cmpl $0x1, %eax
jne 0xf42f
movq %rbx, %rcx
shlq $0x21, %rcx
sarq $0x20, %rcx
movq 0x18(%r14), %rax
imulq $0x18, %rcx, %rcx
movq 0x8(%rax,%rcx), %rdx
subq (%rax,%rcx), %rdx
cmpq $0x4, %rdx
jne 0xf410
leal 0x1(,%rbx,2), %ebp
movslq %ebp, %rcx
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %r15
movq 0x8(%rax,%rcx), %r12
cmpq %r12, %r15
je 0xf224
movslq (%r15), %rsi
movq (%r14), %rax
imulq $0x28, %rsi, %rcx
movq (%rax,%rcx), %rdx
movq 0x8(%rax,%rcx), %rcx
subq %rdx, %rcx
cmpq $0x8, %rcx
jne 0xf311
movslq (%rdx), %rcx
movl %ecx, %edi
sarl %edi
movslq %edi, %r8
movq 0x48(%r14), %rdi
cmpl $0x0, (%rdi,%r8,4)
je 0xf311
movslq 0x4(%rdx), %rdx
movl %edx, %r8d
sarl %r8d
movslq %r8d, %r8
cmpl $0x0, (%rdi,%r8,4)
je 0xf311
xorq $0x1, %rcx
movq 0x18(%r14), %rdi
imulq $0x18, %rcx, %rcx
movq (%rdi,%rcx), %rcx
movslq (%rcx), %rcx
imulq $0x28, %rcx, %rcx
movq 0x18(%rax,%rcx), %rcx
xorq $0x1, %rdx
imulq $0x18, %rdx, %rdx
movq (%rdi,%rdx), %rdx
movslq (%rdx), %rdx
imulq $0x28, %rdx, %rdx
cmpq 0x18(%rax,%rdx), %rcx
jne 0xf311
movq %r14, %rdi
movl %ebp, %edx
callq 0xe83e
testb %al, %al
jne 0xf3fa
addq $0x4, %r15
jmp 0xf27f
movq %rbx, %rcx
shlq $0x21, %rcx
sarq $0x20, %rcx
incq %rcx
movq 0x18(%r14), %rax
imulq $0x18, %rcx, %rcx
movq 0x8(%rax,%rcx), %rdx
subq (%rax,%rcx), %rdx
cmpq $0x4, %rdx
jne 0xf44e
leal (%rbx,%rbx), %ebp
movslq %ebp, %rcx
imulq $0x18, %rcx, %rcx
movq (%rax,%rcx), %r15
movq 0x8(%rax,%rcx), %r12
cmpq %r12, %r15
je 0xf224
movslq (%r15), %rsi
movq (%r14), %rax
imulq $0x28, %rsi, %rcx
movq (%rax,%rcx), %rdx
movq 0x8(%rax,%rcx), %rcx
subq %rdx, %rcx
cmpq $0x8, %rcx
jne 0xf3e8
movslq (%rdx), %rcx
movl %ecx, %edi
sarl %edi
movslq %edi, %r8
movq 0x48(%r14), %rdi
cmpl $0x0, (%rdi,%r8,4)
je 0xf3e8
movslq 0x4(%rdx), %rdx
movl %edx, %r8d
sarl %r8d
movslq %r8d, %r8
cmpl $0x0, (%rdi,%r8,4)
je 0xf3e8
xorq $0x1, %rcx
movq 0x18(%r14), %rdi
imulq $0x18, %rcx, %rcx
movq (%rdi,%rcx), %rcx
movslq (%rcx), %rcx
imulq $0x28, %rcx, %rcx
movq 0x18(%rax,%rcx), %rcx
xorq $0x1, %rdx
imulq $0x18, %rdx, %rdx
movq (%rdi,%rdx), %rdx
movslq (%rdx), %rdx
imulq $0x28, %rdx, %rdx
cmpq 0x18(%rax,%rdx), %rcx
jne 0xf3e8
movq %r14, %rdi
movl %ebp, %edx
callq 0xe83e
testb %al, %al
jne 0xf3fa
addq $0x4, %r15
jmp 0xf356
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2069f(%rip), %rsi     # 0x2faa0
movq %r14, %rdi
movl %ebx, %edx
callq 0x18c04
callq 0x3190
leaq 0x20637(%rip), %rdi     # 0x2fa4e
leaq 0x2050b(%rip), %rsi     # 0x2f929
leaq 0x2064e(%rip), %rcx     # 0x2fa73
movl $0x8b, %edx
callq 0x31c0
leaq 0x2188f(%rip), %rdi     # 0x30cc5
leaq 0x204ec(%rip), %rsi     # 0x2f929
leaq 0x2062f(%rip), %rcx     # 0x2fa73
movl $0xa9, %edx
callq 0x31c0
leaq 0x20655(%rip), %rdi     # 0x2faaa
leaq 0x204cd(%rip), %rsi     # 0x2f929
leaq 0x20610(%rip), %rcx     # 0x2fa73
movl $0x9a, %edx
callq 0x31c0
nop