// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rsi, %rdx
movq %rdi, %r12
leaq 0x330(%rdi), %rsi
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movq %rdx, 0x18(%rsp)
callq 0x2b946
movq (%r13), %rbx
movq 0x8(%r13), %rax
movq %rax, 0x10(%rsp)
cmpq %rax, %rbx
je 0xc40c
movl (%rbx), %eax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rbp
movq 0x8(%rax), %r15
cmpq %r15, %rbp
je 0xc3f8
movl (%rbp), %edx
movl %edx, 0x8(%rsp)
movl 0xc(%rsp), %esi
cmpl %edx, %esi
je 0xc3ef
movq %r12, %rdi
callq 0x282ce
testb %al, %al
je 0xc3ef
movslq 0xc(%rsp), %r13
movq (%r12), %rax
leaq (,%r13,4), %rcx
addq %r13, %rcx
movq 0x8(%rax,%rcx,8), %rsi
subq (%rax,%rcx,8), %rsi
movslq 0x8(%rsp), %rdx
leaq (%rdx,%rdx,4), %rcx
movq 0x8(%rax,%rcx,8), %rdi
subq (%rax,%rcx,8), %rdi
cmpq %rdi, %rsi
jne 0xc235
movq %r12, %rdi
movl %r13d, %esi
callq 0x28300
movl 0xc(%rsp), %r13d
movl 0x8(%rsp), %edx
testb %al, %al
je 0xc235
movq %r12, %rdi
movl %edx, %esi
movl %r13d, %edx
callq 0x28300
movl 0xc(%rsp), %r13d
movl 0x8(%rsp), %edx
cmpl %edx, %r13d
setg %cl
andb %cl, %al
cmpb $0x1, %al
jne 0xc235
movslq %r13d, %rax
movslq %edx, %rcx
movq (%r12), %rdx
leaq (%rax,%rax,4), %rax
leaq (%rdx,%rax,8), %r13
leaq (%rcx,%rcx,4), %rax
leaq (%rdx,%rax,8), %rdx
movq %r13, %rsi
callq 0xb912
testb %al, %al
je 0xc3ef
movq %r13, %rdi
callq 0x2883e
testb %al, %al
je 0xc200
movslq 0x8(%rsp), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq (%r12), %rdi
callq 0x2883e
testb %al, %al
jne 0xc21e
movslq 0xc(%rsp), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq (%r12), %rdi
callq 0x2883e
testb %al, %al
je 0xc373
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0xc3e2
movl 0x8(%rsp), %eax
jmp 0xc39f
movslq %r13d, %rax
movq (%r12), %rcx
leaq (%rax,%rax,4), %rax
movq 0x8(%rcx,%rax,8), %rsi
subq (%rcx,%rax,8), %rsi
movslq %edx, %rax
leaq (%rax,%rax,4), %rax
movq 0x8(%rcx,%rax,8), %rdi
subq (%rcx,%rax,8), %rdi
cmpq %rdi, %rsi
jbe 0xc2d8
movq %r12, %rdi
movl %edx, %esi
movl %r13d, %edx
callq 0x28300
movl 0x8(%rsp), %edx
movq (%r12), %rcx
testb %al, %al
je 0xc2d3
movslq %edx, %rax
leaq (%rax,%rax,4), %rax
leaq (%rcx,%rax,8), %rdi
callq 0x2883e
movl 0x8(%rsp), %edx
movq (%r12), %rcx
movl 0xc(%rsp), %r13d
testb %al, %al
je 0xc2d8
movslq %edx, %rax
movslq %r13d, %rdx
leaq (%rdx,%rdx,4), %rdx
leaq (%rcx,%rdx,8), %rsi
leaq (%rax,%rax,4), %rax
leaq (%rcx,%rax,8), %rdx
callq 0xb912
testb %al, %al
je 0xc3ef
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
jne 0xc36e
leaq 0xc(%rsp), %rdx
jmp 0xc3e7
movl 0xc(%rsp), %r13d
movslq %edx, %rax
leaq (%rax,%rax,4), %rax
movq 0x8(%rcx,%rax,8), %rsi
subq (%rcx,%rax,8), %rsi
movslq %r13d, %rax
leaq (%rax,%rax,4), %rax
movq 0x8(%rcx,%rax,8), %rdi
subq (%rcx,%rax,8), %rdi
cmpq %rdi, %rsi
jbe 0xc3ef
movq %r12, %rdi
movl %r13d, %esi
callq 0x28300
testb %al, %al
je 0xc3ef
movslq 0xc(%rsp), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq (%r12), %rdi
callq 0x2883e
testb %al, %al
je 0xc3ef
movslq 0x8(%rsp), %r13
movq (%r12), %rax
leaq (,%r13,4), %rcx
addq %r13, %rcx
leaq (%rax,%rcx,8), %rsi
movslq 0xc(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rdx
callq 0xb912
testb %al, %al
je 0xc3ef
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0xc3e2
movl %r13d, (%rsi)
jmp 0xc3a1
movslq 0x8(%rsp), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq (%r12), %rdi
callq 0x2883e
testb %al, %al
je 0xc3ab
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0xc2c9
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0xc3ef
movslq 0x8(%rsp), %rax
movq (%r12), %rcx
leaq (%rax,%rax,4), %rdx
movq 0x18(%rcx,%rdx,8), %rsi
movslq 0xc(%rsp), %rdi
leaq (%rdi,%rdi,4), %rdi
addq %rsi, 0x18(%rcx,%rdi,8)
movq $0x0, 0x18(%rcx,%rdx,8)
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0xc3e2
movl %eax, (%rsi)
jmp 0xc3a1
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x98f8
addq $0x4, %rbp
jmp 0xc10a
addq $0x4, %rbx
cmpq 0x10(%rsp), %rbx
jne 0xc0f8
movq 0x20(%rsp), %rbx
testq %rbx, %rbx
je 0xc421
movq 0x30(%rsp), %rsi
subq %rbx, %rsi
movq %rbx, %rdi
callq 0x32b0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xc44a
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x34a0