// File: Laakeri[P]maxpre/src/./SSR.cpp
// Function: maxPreprocessor::Preprocessor::SSRC(int, int, int)
bool Preprocessor::SSRC(int c1, int c2, int var) {
	uint64_t bmP = ((uint64_t)1 << (uint64_t)(posLit(var)&63));
	uint64_t bmN = ((uint64_t)1 << (uint64_t)(negLit(var)&63));
	
	bool canP = false;
	bool canN = false;
	
	if (((pi.clauses[c2].hash ^ bmN) | pi.clauses[c1].hash) == pi.clauses[c1].hash) canP = canSSR(var, pi.clauses[c2], pi.clauses[c1]);
	if (((pi.clauses[c1].hash ^ bmP) | pi.clauses[c2].hash) == pi.clauses[c2].hash) canN = canSSR(var, pi.clauses[c1], pi.clauses[c2]);
	if (pi.isClauseRemoved(c1)) return false;
	if (pi.isClauseRemoved(c2)) return false;
	if (canP && canN) {
		pi.removeLiteralFromClause(posLit(var), c1);
		pi.removeClause(c2);
		rLog.removeLiteral(1);
		rLog.removeClause(1);
		return true;
	}
	else if (canP) {
		pi.removeLiteralFromClause(posLit(var), c1);
		rLog.removeLiteral(1);
		return true;
	}
	else if (canN) {
		pi.removeLiteralFromClause(negLit(var), c2);
		rLog.removeLiteral(1);
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x1c(%rbp), %edi
callq 0x3c5d0
andl $0x3f, %eax
movslq %eax, %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %edi
callq 0x3c5e0
movq -0x50(%rbp), %rdi
andl $0x3f, %eax
movslq %eax, %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
movb $0x0, -0x32(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x3c600
movq -0x50(%rbp), %rdi
movq 0x20(%rax), %rax
xorq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x3c600
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movq -0x48(%rbp), %rax
orq 0x20(%rcx), %rax
movq %rax, -0x40(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x3c600
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq 0x20(%rcx), %rax
jne 0x1be27
movq -0x50(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x3c600
movq -0x50(%rbp), %rdi
movq %rax, -0x58(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x3c600
movq -0x50(%rbp), %rdi
movl -0x5c(%rbp), %esi
movq -0x58(%rbp), %rdx
movq %rax, %rcx
callq 0x1bbf0
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x50(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x3c600
movq -0x50(%rbp), %rdi
movq 0x20(%rax), %rax
xorq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x3c600
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movq -0x70(%rbp), %rax
orq 0x20(%rcx), %rax
movq %rax, -0x68(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x3c600
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq 0x20(%rcx), %rax
jne 0x1beb2
movq -0x50(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, -0x7c(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x3c600
movq -0x50(%rbp), %rdi
movq %rax, -0x78(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x3c600
movq -0x50(%rbp), %rdi
movl -0x7c(%rbp), %esi
movq -0x78(%rbp), %rdx
movq %rax, %rcx
callq 0x1bbf0
andb $0x1, %al
movb %al, -0x32(%rbp)
movq -0x50(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x5eb70
testb $0x1, %al
jne 0x1bec4
jmp 0x1becd
movb $0x0, -0x1(%rbp)
jmp 0x1bfce
movq -0x50(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x5eb70
testb $0x1, %al
jne 0x1bedf
jmp 0x1bee8
movb $0x0, -0x1(%rbp)
jmp 0x1bfce
testb $0x1, -0x31(%rbp)
je 0x1bf4e
testb $0x1, -0x32(%rbp)
je 0x1bf4e
movl -0x1c(%rbp), %edi
callq 0x3c5d0
movq -0x50(%rbp), %rdi
movl %eax, %esi
movl -0x14(%rbp), %edx
movl $0x1, %ecx
callq 0x5fb90
movq -0x50(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x5f7f0
movq -0x50(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0x1, %esi
callq 0x61510
movq -0x50(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0x1, %esi
callq 0x61410
movb $0x1, -0x1(%rbp)
jmp 0x1bfce
testb $0x1, -0x31(%rbp)
je 0x1bf8a
movl -0x1c(%rbp), %edi
callq 0x3c5d0
movq -0x50(%rbp), %rdi
movl %eax, %esi
movl -0x14(%rbp), %edx
movl $0x1, %ecx
callq 0x5fb90
movq -0x50(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0x1, %esi
callq 0x61510
movb $0x1, -0x1(%rbp)
jmp 0x1bfce
testb $0x1, -0x32(%rbp)
je 0x1bfc6
movl -0x1c(%rbp), %edi
callq 0x3c5e0
movq -0x50(%rbp), %rdi
movl %eax, %esi
movl -0x18(%rbp), %edx
movl $0x1, %ecx
callq 0x5fb90
movq -0x50(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0x1, %esi
callq 0x61510
movb $0x1, -0x1(%rbp)
jmp 0x1bfce
jmp 0x1bfc8
jmp 0x1bfca
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)