// File: /workspace/github_cpp_makefile_star2_O3/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 0x2ca92
movq (%r12), %r14
movq 0x8(%r12), %rax
movq %rax, 0x10(%rsp)
cmpq %rax, %r14
je 0x1031f
movl $0x0, 0x4(%rsp)
movl (%r14), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x27804
testb %al, %al
jne 0x1030e
movq 0x18(%r15), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rbx
movq 0x8(%rax,%rcx,8), %rbp
cmpq %rbp, %rbx
je 0x1030e
movl %r12d, 0x8(%rsp)
movslq %r12d, %rax
movq %rax, 0x18(%rsp)
movl (%rbx), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x27804
testb %al, %al
jne 0x10301
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 0x10285
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 0x1025a
cmpq %rdx, %rcx
je 0x10301
cmpl (%rcx), %r13d
jl 0x10301
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 0x102d9
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 0x102ae
cmpq %rax, %rcx
je 0x10301
movl 0xc(%rsp), %eax
cmpl (%rcx), %eax
jl 0x10301
movq %r15, %rdi
movl 0x8(%rsp), %esi
movl %r12d, %edx
movq 0x20(%rsp), %rcx
callq 0xfff2
movzbl %al, %eax
addl %eax, 0x4(%rsp)
addq $0x4, %rbx
cmpq %rbp, %rbx
jne 0x10220
addq $0x4, %r14
cmpq 0x10(%rsp), %r14
jne 0x101e2
jmp 0x10327
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 0x1047a
movl (%rbx), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x27804
testb %al, %al
movq %rbx, 0x18(%rsp)
jne 0x10466
movq 0x50(%rsp), %r14
movq 0x58(%rsp), %rbp
cmpq %rbp, %r14
je 0x10466
movl %r12d, 0x8(%rsp)
movslq %r12d, %rax
leaq (%rax,%rax,4), %rbx
movl (%r14), %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x27804
testb %al, %al
jne 0x10459
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 0x103dd
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 0x103b2
cmpq %rdx, %rcx
je 0x10459
cmpl (%rcx), %r13d
jl 0x10459
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 0x10431
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 0x10406
cmpq %rax, %rcx
je 0x10459
movl 0xc(%rsp), %eax
cmpl (%rcx), %eax
jl 0x10459
movq %r15, %rdi
movl 0x8(%rsp), %esi
movl %r12d, %edx
movq 0x20(%rsp), %rcx
callq 0xfff2
movzbl %al, %eax
addl %eax, 0x4(%rsp)
addq $0x4, %r14
cmpq %rbp, %r14
jne 0x10381
movq 0x18(%rsp), %rbx
addq $0x4, %rbx
cmpq 0x10(%rsp), %rbx
jne 0x10347
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x10491
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x104a8
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 0x104c1
jmp 0x104c1
jmp 0x104c1
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x1f0aa
movq %rbx, %rdi
callq 0x34a0