// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]maxpre/src/./SSR.cpp
// Function: maxPreprocessor::Preprocessor::trySSRAmsLex(int)
int Preprocessor::trySSRAmsLex(int var) {
	pair<vector<int>, vector<int> > cand = amsLex.amsLexSSR(pi.litClauses[posLit(var)], pi.litClauses[negLit(var)], var);
	int removed = 0;
	for (int c1 : cand.F) {
		if (pi.isClauseRemoved(c1)) continue;
		for (int c2 : pi.litClauses[negLit(var)]) {
			if (pi.isClauseRemoved(c2)) continue;
			if (!binary_search(pi.clauses[c1].lit.begin(), pi.clauses[c1].lit.end(), posLit(var))) continue;
			if (!binary_search(pi.clauses[c2].lit.begin(), pi.clauses[c2].lit.end(), negLit(var))) continue;
			if (SSRC(c1, c2, var)) {
				removed++;
			}
		}
	}
	for (int c1 : pi.litClauses[posLit(var)]) {
		if (pi.isClauseRemoved(c1)) continue;
		for (int c2 : cand.S) {
			if (pi.isClauseRemoved(c2)) continue;
			if (!binary_search(pi.clauses[c1].lit.begin(), pi.clauses[c1].lit.end(), posLit(var))) continue;
			if (!binary_search(pi.clauses[c2].lit.begin(), pi.clauses[c2].lit.end(), negLit(var))) continue;
			if (SSRC(c1, c2, var)) {
				removed++;
			}
		}
	}
	return removed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %r8d
movq %rdi, %r14
leaq 0x330(%rdi), %rsi
leal (%r8,%r8), %ebx
movslq %ebx, %rax
movq 0x18(%rdi), %rcx
imulq $0x18, %rax, %rax
movq %rax, 0x28(%rsp)
leaq (%rcx,%rax), %rdx
leal 0x1(,%r8,2), %eax
movl %eax, 0xc(%rsp)
cltq
imulq $0x18, %rax, %rax
movq %rax, 0x10(%rsp)
addq %rax, %rcx
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq %r8, 0x20(%rsp)
callq 0x252da
movq (%r15), %r12
movq 0x8(%r15), %r15
movl $0x0, 0x8(%rsp)
movq %r15, 0x30(%rsp)
cmpq %r15, %r12
je 0xcf1f
movl (%r12), %esi
movq %r14, %rdi
movl %esi, 0x4(%rsp)
callq 0x20f14
testb %al, %al
jne 0xcf16
movq %r12, 0x18(%rsp)
movslq 0x4(%rsp), %rax
movq 0x18(%r14), %rcx
movq 0x10(%rsp), %rdx
movq (%rcx,%rdx), %rbp
movq 0x8(%rcx,%rdx), %r15
imulq $0x28, %rax, %r12
cmpq %r15, %rbp
je 0xcf0c
movl (%rbp), %r13d
movq %r14, %rdi
movl %r13d, %esi
callq 0x20f14
testb %al, %al
jne 0xcf06
movq (%r14), %rax
movq (%rax,%r12), %rdi
movq 0x8(%rax,%r12), %rsi
movl %ebx, (%rsp)
movq %rsp, %rdx
callq 0x18f6e
testb %al, %al
je 0xcf06
movslq %r13d, %rax
movq (%r14), %rcx
imulq $0x28, %rax, %rax
movq (%rcx,%rax), %rdi
movq 0x8(%rcx,%rax), %rsi
movl 0xc(%rsp), %eax
movl %eax, (%rsp)
movq %rsp, %rdx
callq 0x18f6e
testb %al, %al
je 0xcf06
movq %r14, %rdi
movl 0x4(%rsp), %esi
movl %r13d, %edx
movq 0x20(%rsp), %rcx
callq 0xcc58
movzbl %al, %eax
addl %eax, 0x8(%rsp)
addq $0x4, %rbp
jmp 0xce92
movq 0x18(%rsp), %r12
movq 0x30(%rsp), %r15
addq $0x4, %r12
jmp 0xce51
movq 0x18(%r14), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx), %r15
movq 0x8(%rax,%rcx), %r12
movq %r12, 0x10(%rsp)
cmpq %r12, %r15
je 0xcffb
movl (%r15), %esi
movq %r14, %rdi
movl %esi, 0x4(%rsp)
callq 0x20f14
testb %al, %al
jne 0xcff2
movq %r15, 0x18(%rsp)
movslq 0x4(%rsp), %rax
movq 0x50(%rsp), %rbp
movq 0x58(%rsp), %r15
imulq $0x28, %rax, %r12
cmpq %r15, %rbp
je 0xcfe8
movl (%rbp), %r13d
movq %r14, %rdi
movl %r13d, %esi
callq 0x20f14
testb %al, %al
jne 0xcfe2
movq (%r14), %rax
movq (%rax,%r12), %rdi
movq 0x8(%rax,%r12), %rsi
movl %ebx, (%rsp)
movq %rsp, %rdx
callq 0x18f6e
testb %al, %al
je 0xcfe2
movslq %r13d, %rax
movq (%r14), %rcx
imulq $0x28, %rax, %rax
movq (%rcx,%rax), %rdi
movq 0x8(%rcx,%rax), %rsi
movl 0xc(%rsp), %eax
movl %eax, (%rsp)
movq %rsp, %rdx
callq 0x18f6e
testb %al, %al
je 0xcfe2
movq %r14, %rdi
movl 0x4(%rsp), %esi
movl %r13d, %edx
movq 0x20(%rsp), %rcx
callq 0xcc58
movzbl %al, %eax
addl %eax, 0x8(%rsp)
addq $0x4, %rbp
jmp 0xcf6e
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r12
addq $0x4, %r15
jmp 0xcf36
leaq 0x38(%rsp), %rdi
callq 0x18fc2
movl 0x8(%rsp), %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd026
jmp 0xd026
jmp 0xd026
jmp 0xd026
jmp 0xd026
jmp 0xd026
jmp 0xd026
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x18fc2
movq %rbx, %rdi
callq 0x3490
nop