// File: Laakeri[P]maxpre/src/./SSR.cpp
// Function: maxPreprocessor::Preprocessor::trySSR2(int)
int Preprocessor::trySSR2(int var) {
	int removed = 0;
	
	uint64_t bmP = ((uint64_t)1 << (uint64_t)(posLit(var)&63));
	uint64_t bmN = ((uint64_t)1 << (uint64_t)(negLit(var)&63));
	
	bool f = true;
	while (f) {
		f = false;
		for (int c1 : pi.litClauses[posLit(var)]) {
			for (int c2 : pi.litClauses[negLit(var)]) {
				if ((((pi.clauses[c1].hash ^ bmP) | pi.clauses[c2].hash) != pi.clauses[c2].hash) && (((pi.clauses[c2].hash ^ bmN) | pi.clauses[c1].hash) != pi.clauses[c1].hash)) continue;
				
				if (SSRC(c1, c2, var)) {
					f = true;
					removed++;
					break;
				}
			}
			if (f) break;
		}
	}
	return removed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x10(%rbp)
movl -0xc(%rbp), %edi
callq 0x3c5d0
andl $0x3f, %eax
movslq %eax, %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %edi
callq 0x3c5e0
andl $0x3f, %eax
movslq %eax, %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x20(%rbp)
movb $0x1, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
je 0x1d6ea
movq -0x70(%rbp), %rax
movb $0x0, -0x21(%rbp)
addq $0x18, %rax
movq %rax, -0x78(%rbp)
movl -0xc(%rbp), %edi
callq 0x3c5d0
movq -0x78(%rbp), %rdi
movslq %eax, %rsi
callq 0xaab0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xa800
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0xa830
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x1d56b
jmp 0x1d6e5
leaq -0x38(%rbp), %rdi
callq 0xa8a0
movq %rax, %rcx
movq -0x70(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x44(%rbp)
addq $0x18, %rax
movq %rax, -0x80(%rbp)
movl -0xc(%rbp), %edi
callq 0x3c5e0
movq -0x80(%rbp), %rdi
movslq %eax, %rsi
callq 0xaab0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0xa800
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0xa830
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x1d5d0
jmp 0x1d6cd
leaq -0x58(%rbp), %rdi
callq 0xa8a0
movq -0x70(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movslq -0x44(%rbp), %rsi
callq 0x3c600
movq -0x70(%rbp), %rdi
movq 0x20(%rax), %rax
xorq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movslq -0x64(%rbp), %rsi
callq 0x3c600
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movq -0x90(%rbp), %rax
orq 0x20(%rcx), %rax
movq %rax, -0x88(%rbp)
movslq -0x64(%rbp), %rsi
callq 0x3c600
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq 0x20(%rcx), %rax
je 0x1d696
movq -0x70(%rbp), %rdi
movslq -0x64(%rbp), %rsi
callq 0x3c600
movq -0x70(%rbp), %rdi
movq 0x20(%rax), %rax
xorq -0x20(%rbp), %rax
movq %rax, -0xa0(%rbp)
movslq -0x44(%rbp), %rsi
callq 0x3c600
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movq -0xa0(%rbp), %rax
orq 0x20(%rcx), %rax
movq %rax, -0x98(%rbp)
movslq -0x44(%rbp), %rsi
callq 0x3c600
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq 0x20(%rcx), %rax
je 0x1d696
jmp 0x1d6bf
movq -0x70(%rbp), %rdi
movl -0x44(%rbp), %esi
movl -0x64(%rbp), %edx
movl -0xc(%rbp), %ecx
callq 0x1bd40
testb $0x1, %al
jne 0x1d6ae
jmp 0x1d6bd
movb $0x1, -0x21(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1d6cd
jmp 0x1d6bf
leaq -0x58(%rbp), %rdi
callq 0xa930
jmp 0x1d5ba
testb $0x1, -0x21(%rbp)
je 0x1d6d5
jmp 0x1d6e5
jmp 0x1d6d7
leaq -0x38(%rbp), %rdi
callq 0xa930
jmp 0x1d555
jmp 0x1d509
movl -0x10(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)