// File: 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
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa800
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x14e47
jmp 0x151ef
leaq -0x28(%rbp), %rdi
callq 0xa8a0
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0xa800
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0xa830
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x14e8d
jmp 0x151df
leaq -0x48(%rbp), %rdi
callq 0xa8a0
movl (%rax), %eax
movl %eax, -0x54(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x54(%rbp), %eax
jg 0x14ea8
jmp 0x151d1
movq -0x60(%rbp), %rdi
movl -0x34(%rbp), %esi
movl -0x54(%rbp), %edx
callq 0x5fc50
testb $0x1, %al
jne 0x14ec0
jmp 0x151d1
movq -0x60(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xf940
movq -0x60(%rbp), %rdi
movq %rax, -0x68(%rbp)
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq %rcx, %rax
jne 0x1505c
movq -0x60(%rbp), %rdi
movl -0x34(%rbp), %esi
movl -0x54(%rbp), %edx
callq 0x5fcf0
testb $0x1, %al
jne 0x14f16
jmp 0x1505c
movq -0x60(%rbp), %rdi
movl -0x54(%rbp), %esi
movl -0x34(%rbp), %edx
callq 0x5fcf0
testb $0x1, %al
jne 0x14f2e
jmp 0x1505c
movq -0x60(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq -0x60(%rbp), %rdi
movq %rax, -0x70(%rbp)
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq %rax, %rdx
callq 0x13a00
testb $0x1, %al
jne 0x14f65
jmp 0x15057
movq -0x60(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0x60e90
testb $0x1, %al
jne 0x14f80
jmp 0x14fad
movq -0x60(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0x60e90
testb $0x1, %al
jne 0x14f9b
jmp 0x14fad
movq -0x18(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0xa8c0
jmp 0x15055
movq -0x60(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0x60e90
testb $0x1, %al
jne 0x14fc8
jmp 0x14fd7
movq -0x18(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0xa8c0
jmp 0x15053
movq -0x60(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0x60e90
testb $0x1, %al
jne 0x14ff2
jmp 0x15001
movq -0x18(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0xa8c0
jmp 0x15051
movq -0x60(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq -0x60(%rbp), %rdi
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq -0x78(%rbp), %rcx
movq -0x60(%rbp), %rdi
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0xa8c0
jmp 0x15053
jmp 0x15055
jmp 0x15057
jmp 0x151cf
movq -0x60(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xf940
movq -0x60(%rbp), %rdi
movq %rax, -0x80(%rbp)
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movq -0x80(%rbp), %rax
cmpq %rcx, %rax
jbe 0x15112
movq -0x60(%rbp), %rdi
movl -0x54(%rbp), %esi
movl -0x34(%rbp), %edx
callq 0x5fcf0
testb $0x1, %al
jne 0x150ab
jmp 0x15112
movq -0x60(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0x60e90
testb $0x1, %al
jne 0x150c6
jmp 0x15112
movq -0x60(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq -0x60(%rbp), %rdi
movq %rax, -0x88(%rbp)
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq -0x60(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq %rax, %rdx
callq 0x13a00
testb $0x1, %al
jne 0x15100
jmp 0x1510d
movq -0x18(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0xa8c0
jmp 0x151cd
movq -0x60(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xf940
movq -0x60(%rbp), %rdi
movq %rax, -0x90(%rbp)
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xf940
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
jbe 0x151cb
movq -0x60(%rbp), %rdi
movl -0x34(%rbp), %esi
movl -0x54(%rbp), %edx
callq 0x5fcf0
testb $0x1, %al
jne 0x15167
jmp 0x151cb
movq -0x60(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0x60e90
testb $0x1, %al
jne 0x15182
jmp 0x151cb
movq -0x60(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0x3c600
movq -0x60(%rbp), %rdi
movq %rax, -0x98(%rbp)
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq -0x60(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq %rax, %rdx
callq 0x13a00
testb $0x1, %al
jne 0x151bc
jmp 0x151c9
movq -0x18(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0xa8c0
jmp 0x151cb
jmp 0x151cd
jmp 0x151cf
jmp 0x151d1
leaq -0x48(%rbp), %rdi
callq 0xa930
jmp 0x14e77
jmp 0x151e1
leaq -0x28(%rbp), %rdi
callq 0xa930
jmp 0x14e31
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)