// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]maxpre/src/./SE.cpp
// Function: maxPreprocessor::Preprocessor::trySE(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&)
void Preprocessor::trySE(vector<int>& clauses, vector<int>& toRemove) {
	for (int c1 : clauses) {
		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)) {
				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 $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %r13
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rsp)
cmpq 0x8(%rsp), %r13
je 0x9c22
movl (%r13), %eax
movl %eax, 0x4(%rsp)
movq (%r14), %rbp
movq 0x8(%r14), %rbx
cmpq %rbx, %rbp
je 0x9c19
movl (%rbp), %edx
movl %edx, (%rsp)
movl 0x4(%rsp), %esi
cmpl %edx, %esi
jle 0x9c10
movq %r15, %rdi
callq 0x21738
testb %al, %al
je 0x9c10
movslq 0x4(%rsp), %rcx
movq (%r15), %rdi
imulq $0x28, %rcx, %rax
movq 0x8(%rdi,%rax), %rsi
subq (%rdi,%rax), %rsi
movslq (%rsp), %rdx
imulq $0x28, %rdx, %rax
movq 0x8(%rdi,%rax), %r8
subq (%rdi,%rax), %r8
cmpq %r8, %rsi
jne 0x9b1c
movq %r15, %rdi
movl %ecx, %esi
callq 0x2176a
movl 0x4(%rsp), %ecx
testb %al, %al
je 0x9b16
movl (%rsp), %esi
movq %r15, %rdi
movl %ecx, %edx
callq 0x2176a
movl 0x4(%rsp), %ecx
movq (%r15), %rdi
movl (%rsp), %edx
testb %al, %al
je 0x9b1c
movslq %ecx, %rax
movslq %edx, %rcx
imulq $0x28, %rax, %r12
addq %rdi, %r12
imulq $0x28, %rcx, %rdx
addq %rdi, %rdx
movq %r12, %rsi
callq 0x904c
testb %al, %al
je 0x9c10
movq %r12, %rdi
callq 0x21bac
testb %al, %al
je 0x9ab1
movslq (%rsp), %rax
imulq $0x28, %rax, %rdi
addq (%r15), %rdi
callq 0x21bac
movq %rsp, %rsi
testb %al, %al
jne 0x9c06
movslq 0x4(%rsp), %rax
imulq $0x28, %rax, %rdi
addq (%r15), %rdi
callq 0x21bac
movq %rsp, %rsi
testb %al, %al
jne 0x9c06
movslq (%rsp), %rax
imulq $0x28, %rax, %rdi
addq (%r15), %rdi
callq 0x21bac
leaq 0x4(%rsp), %rsi
testb %al, %al
jne 0x9c06
movslq (%rsp), %rax
movq (%r15), %rcx
imulq $0x28, %rax, %rax
movq 0x18(%rcx,%rax), %rdx
movslq 0x4(%rsp), %rsi
imulq $0x28, %rsi, %rsi
addq %rdx, 0x18(%rcx,%rsi)
andq $0x0, 0x18(%rcx,%rax)
movq %rsp, %rsi
jmp 0x9c06
movq (%r15), %rdi
movl (%rsp), %edx
movslq %ecx, %rax
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 0x9b98
movq %r15, %rdi
movl %edx, %esi
movl %ecx, %edx
callq 0x2176a
movl (%rsp), %edx
movq (%r15), %rdi
testb %al, %al
je 0x9b94
movslq %edx, %rax
imulq $0x28, %rax, %rax
addq %rax, %rdi
callq 0x21bac
movl (%rsp), %edx
movq (%r15), %rdi
movl 0x4(%rsp), %ecx
testb %al, %al
je 0x9b98
movslq %edx, %rax
movslq %ecx, %rcx
imulq $0x28, %rcx, %rsi
addq %rdi, %rsi
imulq $0x28, %rax, %rdx
addq %rdi, %rdx
callq 0x904c
leaq 0x4(%rsp), %rsi
jmp 0x9c02
movl 0x4(%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 0x9c10
movq %r15, %rdi
movl %ecx, %esi
callq 0x2176a
testb %al, %al
je 0x9c10
movslq 0x4(%rsp), %rax
imulq $0x28, %rax, %rdi
addq (%r15), %rdi
callq 0x21bac
testb %al, %al
je 0x9c10
movslq (%rsp), %rax
movq (%r15), %rcx
imulq $0x28, %rax, %rsi
addq %rcx, %rsi
movslq 0x4(%rsp), %rax
imulq $0x28, %rax, %rdx
addq %rcx, %rdx
callq 0x904c
movq %rsp, %rsi
testb %al, %al
je 0x9c10
movq 0x10(%rsp), %rdi
callq 0x68a4
addq $0x4, %rbp
jmp 0x99d7
addq $0x4, %r13
jmp 0x99bd
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop