// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
leaq 0x330(%rdi), %rsi
leal (%r8,%r8), %r13d
movslq %r13d, %rax
movq 0x18(%rdi), %rcx
leaq (%rax,%rax,2), %rax
movq %rax, 0x28(%rsp)
leaq (%rcx,%rax,8), %rdx
leal 0x1(%r8,%r8), %eax
movl %eax, 0xc(%rsp)
cltq
leaq (%rax,%rax,2), %rax
movq %rax, 0x30(%rsp)
leaq (%rcx,%rax,8), %rcx
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r8, 0x20(%rsp)
callq 0x2d612
movq (%r12), %r14
movq 0x8(%r12), %rax
movq %rax, 0x10(%rsp)
cmpq %rax, %r14
je 0x1080f
movl $0x0, 0x4(%rsp)
movl (%r14), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x284dc
testb %al, %al
jne 0x107fe
movq 0x18(%r15), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rbx
movq 0x8(%rax,%rcx,8), %rbp
cmpq %rbp, %rbx
je 0x107fe
movl %r12d, 0x8(%rsp)
movslq %r12d, %rax
movq %rax, 0x18(%rsp)
movl (%rbx), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x284dc
testb %al, %al
jne 0x107f1
movq (%r15), %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rcx,4), %rdx
movq (%rax,%rdx,8), %rcx
movq 0x8(%rax,%rdx,8), %rdx
movq %rdx, %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
testq %rsi, %rsi
jle 0x10775
movq %rsi, %rdi
shrq %rdi
movq %rdi, %r8
notq %r8
addq %rsi, %r8
leaq (%rcx,%rdi,4), %rsi
addq $0x4, %rsi
cmpl %r13d, -0x4(%rsi)
cmovlq %rsi, %rcx
cmovgeq %rdi, %r8
movq %r8, %rsi
testq %r8, %r8
jg 0x1074a
cmpq %rdx, %rcx
je 0x107f1
cmpl (%rcx), %r13d
jl 0x107f1
movslq %r12d, %rcx
leaq (%rcx,%rcx,4), %rdx
movq (%rax,%rdx,8), %rcx
movq 0x8(%rax,%rdx,8), %rax
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
testq %rdx, %rdx
jle 0x107c9
movq %rdx, %rsi
shrq %rsi
movq %rsi, %rdi
notq %rdi
addq %rdx, %rdi
leaq (%rcx,%rsi,4), %rdx
addq $0x4, %rdx
cmpl %r13d, -0x4(%rdx)
cmovleq %rdx, %rcx
cmovgq %rsi, %rdi
movq %rdi, %rdx
testq %rdi, %rdi
jg 0x1079e
cmpq %rax, %rcx
je 0x107f1
movl 0xc(%rsp), %eax
cmpl (%rcx), %eax
jl 0x107f1
movq %r15, %rdi
movl 0x8(%rsp), %esi
movl %r12d, %edx
movq 0x20(%rsp), %rcx
callq 0x104e2
movzbl %al, %eax
addl %eax, 0x4(%rsp)
addq $0x4, %rbx
cmpq %rbp, %rbx
jne 0x10710
addq $0x4, %r14
cmpq 0x10(%rsp), %r14
jne 0x106d2
jmp 0x10817
movl $0x0, 0x4(%rsp)
movq 0x18(%r15), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rbx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
cmpq %rax, %rbx
je 0x1096a
movl (%rbx), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x284dc
testb %al, %al
movq %rbx, 0x18(%rsp)
jne 0x10956
movq 0x50(%rsp), %r14
movq 0x58(%rsp), %rbp
cmpq %rbp, %r14
je 0x10956
movl %r12d, 0x8(%rsp)
movslq %r12d, %rax
leaq (%rax,%rax,4), %rbx
movl (%r14), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x284dc
testb %al, %al
jne 0x10949
movq (%r15), %rax
movq (%rax,%rbx,8), %rcx
movq 0x8(%rax,%rbx,8), %rdx
movq %rdx, %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
testq %rsi, %rsi
jle 0x108cd
movq %rsi, %rdi
shrq %rdi
movq %rdi, %r8
notq %r8
addq %rsi, %r8
leaq (%rcx,%rdi,4), %rsi
addq $0x4, %rsi
cmpl %r13d, -0x4(%rsi)
cmovlq %rsi, %rcx
cmovgeq %rdi, %r8
movq %r8, %rsi
testq %r8, %r8
jg 0x108a2
cmpq %rdx, %rcx
je 0x10949
cmpl (%rcx), %r13d
jl 0x10949
movslq %r12d, %rcx
leaq (%rcx,%rcx,4), %rdx
movq (%rax,%rdx,8), %rcx
movq 0x8(%rax,%rdx,8), %rax
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
testq %rdx, %rdx
jle 0x10921
movq %rdx, %rsi
shrq %rsi
movq %rsi, %rdi
notq %rdi
addq %rdx, %rdi
leaq (%rcx,%rsi,4), %rdx
addq $0x4, %rdx
cmpl %r13d, -0x4(%rdx)
cmovleq %rdx, %rcx
cmovgq %rsi, %rdi
movq %rdi, %rdx
testq %rdi, %rdi
jg 0x108f6
cmpq %rax, %rcx
je 0x10949
movl 0xc(%rsp), %eax
cmpl (%rcx), %eax
jl 0x10949
movq %r15, %rdi
movl 0x8(%rsp), %esi
movl %r12d, %edx
movq 0x20(%rsp), %rcx
callq 0x104e2
movzbl %al, %eax
addl %eax, 0x4(%rsp)
addq $0x4, %r14
cmpq %rbp, %r14
jne 0x10871
movq 0x18(%rsp), %rbx
addq $0x4, %rbx
cmpq 0x10(%rsp), %rbx
jne 0x10837
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x10981
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x10998
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movl 0x4(%rsp), %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x109b1
jmp 0x109b1
jmp 0x109b1
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x1fc6e
movq %rbx, %rdi
callq 0x34a0