// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]maxpre/src/./SE.cpp
// Function: maxPreprocessor::Preprocessor::trySEAmsLex(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&)
void Preprocessor::trySEAmsLex(vector<int>& clauses, vector<int>& toRemove) {
	vector<int> cand = amsLex.amsLexSE(clauses);
	for (int c1 : cand) {
		for (int c2 : clauses) {
			if (c1 == c2) continue;
			if (!pi.canSubsume1(c1, c2)) continue;
			if (pi.clauses[c1].lit.size() == pi.clauses[c2].lit.size() && pi.canSubsume(c1, c2) && pi.canSubsume(c2, c1) && c1 > c2) {
				if (isSubsumed(pi.clauses[c1].lit, pi.clauses[c2].lit)) {
					if (pi.clauses[c1].isHard() && pi.clauses[c2].isHard()) {
						toRemove.push_back(c2);
					}
					else if(pi.clauses[c1].isHard()) {
						toRemove.push_back(c2);
					}
					else if(pi.clauses[c2].isHard()) {
						toRemove.push_back(c1);
					}
					else {
						pi.clauses[c1].weight += pi.clauses[c2].weight;
						pi.clauses[c2].weight = 0;
						toRemove.push_back(c2);
					}
				}
			}
			else if (pi.clauses[c1].lit.size() > pi.clauses[c2].lit.size() && pi.canSubsume(c2, c1) && pi.clauses[c2].isHard()) {
				if (isSubsumed(pi.clauses[c1].lit, pi.clauses[c2].lit)) {
					toRemove.push_back(c1);
				}
			}
			else if (pi.clauses[c2].lit.size() > pi.clauses[c1].lit.size() && pi.canSubsume(c1, c2) && pi.clauses[c1].isHard()) {
				if (isSubsumed(pi.clauses[c2].lit, pi.clauses[c1].lit)) {
					toRemove.push_back(c2);
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x18(%rsp)
movq %rsi, %r14
movq %rdi, %r15
leaq 0x330(%rdi), %rsi
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0x246ea
movq (%r12), %r13
movq 0x8(%r12), %rax
movq %rax, 0x10(%rsp)
cmpq 0x10(%rsp), %r13
je 0x9969
movl (%r13), %eax
movl %eax, 0xc(%rsp)
movq (%r14), %rbp
movq 0x8(%r14), %rbx
cmpq %rbx, %rbp
je 0x9960
movl (%rbp), %edx
movl %edx, 0x8(%rsp)
movl 0xc(%rsp), %esi
cmpl %edx, %esi
je 0x9957
movq %r15, %rdi
callq 0x21738
testb %al, %al
je 0x9957
movslq 0xc(%rsp), %rcx
movq (%r15), %rax
imulq $0x28, %rcx, %rdx
movq 0x8(%rax,%rdx), %rsi
subq (%rax,%rdx), %rsi
movslq 0x8(%rsp), %rdx
imulq $0x28, %rdx, %rdi
movq 0x8(%rax,%rdi), %r8
subq (%rax,%rdi), %r8
cmpq %r8, %rsi
jne 0x985b
movq %r15, %rdi
movl %ecx, %esi
callq 0x2176a
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %edx
testb %al, %al
je 0x985b
movq %r15, %rdi
movl %edx, %esi
movl %ecx, %edx
callq 0x2176a
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %edx
cmpl %edx, %ecx
setg %sil
andb %sil, %al
cmpb $0x1, %al
jne 0x985b
movslq %ecx, %rax
movslq %edx, %rcx
movq (%r15), %rsi
imulq $0x28, %rax, %r12
addq %rsi, %r12
imulq $0x28, %rcx, %rdx
addq %rsi, %rdx
movq %r12, %rsi
callq 0x904c
testb %al, %al
je 0x9957
movq %r12, %rdi
callq 0x21bac
testb %al, %al
je 0x97f0
movslq 0x8(%rsp), %rax
imulq $0x28, %rax, %rdi
addq (%r15), %rdi
callq 0x21bac
leaq 0x8(%rsp), %rsi
testb %al, %al
jne 0x994d
movslq 0xc(%rsp), %rax
imulq $0x28, %rax, %rdi
addq (%r15), %rdi
callq 0x21bac
leaq 0x8(%rsp), %rsi
testb %al, %al
jne 0x994d
movslq 0x8(%rsp), %rax
imulq $0x28, %rax, %rdi
addq (%r15), %rdi
callq 0x21bac
leaq 0xc(%rsp), %rsi
testb %al, %al
jne 0x994d
movslq 0x8(%rsp), %rax
movq (%r15), %rcx
imulq $0x28, %rax, %rax
movq 0x18(%rcx,%rax), %rdx
movslq 0xc(%rsp), %rsi
imulq $0x28, %rsi, %rsi
addq %rdx, 0x18(%rcx,%rsi)
andq $0x0, 0x18(%rcx,%rax)
leaq 0x8(%rsp), %rsi
jmp 0x994d
movslq %ecx, %rax
movq (%r15), %rdi
imulq $0x28, %rax, %rax
movq 0x8(%rdi,%rax), %rsi
subq (%rdi,%rax), %rsi
movslq %edx, %rax
imulq $0x28, %rax, %rax
movq 0x8(%rdi,%rax), %r8
subq (%rdi,%rax), %r8
cmpq %r8, %rsi
jbe 0x98dc
movq %r15, %rdi
movl %edx, %esi
movl %ecx, %edx
callq 0x2176a
movl 0x8(%rsp), %edx
movq (%r15), %rdi
testb %al, %al
je 0x98d8
movslq %edx, %rax
imulq $0x28, %rax, %rax
addq %rax, %rdi
callq 0x21bac
movl 0x8(%rsp), %edx
movq (%r15), %rdi
movl 0xc(%rsp), %ecx
testb %al, %al
je 0x98dc
movslq %edx, %rax
movslq %ecx, %rcx
imulq $0x28, %rcx, %rsi
addq %rdi, %rsi
imulq $0x28, %rax, %rdx
addq %rdi, %rdx
callq 0x904c
leaq 0xc(%rsp), %rsi
jmp 0x9949
movl 0xc(%rsp), %ecx
movslq %edx, %rax
imulq $0x28, %rax, %rax
movq 0x8(%rdi,%rax), %rsi
subq (%rdi,%rax), %rsi
movslq %ecx, %rax
imulq $0x28, %rax, %rax
movq 0x8(%rdi,%rax), %r8
subq (%rdi,%rax), %r8
cmpq %r8, %rsi
jbe 0x9957
movq %r15, %rdi
movl %ecx, %esi
callq 0x2176a
testb %al, %al
je 0x9957
movslq 0xc(%rsp), %rax
imulq $0x28, %rax, %rdi
addq (%r15), %rdi
callq 0x21bac
testb %al, %al
je 0x9957
movslq 0x8(%rsp), %rax
movq (%r15), %rcx
imulq $0x28, %rax, %rsi
addq %rcx, %rsi
movslq 0xc(%rsp), %rax
imulq $0x28, %rax, %rdx
addq %rcx, %rdx
callq 0x904c
leaq 0x8(%rsp), %rsi
testb %al, %al
je 0x9957
movq 0x18(%rsp), %rdi
callq 0x68a4
addq $0x4, %rbp
jmp 0x9704
addq $0x4, %r13
jmp 0x96ea
leaq 0x20(%rsp), %rdi
callq 0x7512
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x7512
movq %rbx, %rdi
callq 0x3490
nop