// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rsi, %rdx
movq %rdi, %r15
leaq 0x330(%rdi), %rsi
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rdx, 0x18(%rsp)
callq 0x2c61a
movq (%r12), %r13
movq 0x8(%r12), %rax
movq %rax, 0x10(%rsp)
cmpq %rax, %r13
je 0xc4d6
movl (%r13), %eax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rbp
movq 0x8(%rax), %r14
cmpq %r14, %rbp
je 0xc4c7
movl (%rbp), %edx
movl %edx, 0x8(%rsp)
movl 0xc(%rsp), %esi
cmpl %edx, %esi
je 0xc4be
movq %r15, %rdi
callq 0x28ff6
testb %al, %al
je 0xc4be
movslq 0xc(%rsp), %rsi
movq (%r15), %rax
leaq (%rsi,%rsi,4), %rcx
movq 0x8(%rax,%rcx,8), %rdi
subq (%rax,%rcx,8), %rdi
movslq 0x8(%rsp), %rdx
leaq (%rdx,%rdx,4), %rcx
movq 0x8(%rax,%rcx,8), %r8
subq (%rax,%rcx,8), %r8
cmpq %r8, %rdi
jne 0xc31b
movq %r15, %rdi
callq 0x29028
testb %al, %al
je 0xc31b
movl 0x8(%rsp), %esi
movl 0xc(%rsp), %edx
movq %r15, %rdi
callq 0x29028
testb %al, %al
je 0xc31b
movslq 0xc(%rsp), %rax
movslq 0x8(%rsp), %rcx
cmpl %ecx, %eax
jle 0xc31b
movq (%r15), %rdx
leaq (%rax,%rax,4), %rax
leaq (%rdx,%rax,8), %r12
leaq (%rcx,%rcx,4), %rax
leaq (%rdx,%rax,8), %rdx
movq %r12, %rsi
callq 0xba2c
testb %al, %al
je 0xc4be
movq %r12, %rdi
callq 0x29586
testb %al, %al
je 0xc2e7
movslq 0x8(%rsp), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq (%r15), %rdi
callq 0x29586
testb %al, %al
jne 0xc304
movslq 0xc(%rsp), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq (%r15), %rdi
callq 0x29586
testb %al, %al
je 0xc44c
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xc4b1
movl 0x8(%rsp), %eax
jmp 0xc477
movslq 0xc(%rsp), %rdx
movq (%r15), %rax
leaq (%rdx,%rdx,4), %rcx
movq 0x8(%rax,%rcx,8), %rdi
subq (%rax,%rcx,8), %rdi
movslq 0x8(%rsp), %rsi
leaq (%rsi,%rsi,4), %rcx
movq 0x8(%rax,%rcx,8), %r8
subq (%rax,%rcx,8), %r8
cmpq %r8, %rdi
jbe 0xc3ae
movq %r15, %rdi
callq 0x29028
testb %al, %al
je 0xc3ae
movslq 0x8(%rsp), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq (%r15), %rdi
callq 0x29586
testb %al, %al
je 0xc3ae
movslq 0xc(%rsp), %r12
movq (%r15), %rax
leaq (%r12,%r12,4), %rcx
leaq (%rax,%rcx,8), %rsi
movslq 0x8(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rdx
callq 0xba2c
testb %al, %al
je 0xc4be
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jne 0xc43f
leaq 0xc(%rsp), %rdx
jmp 0xc4b6
movslq 0x8(%rsp), %rdx
movq (%r15), %rax
leaq (%rdx,%rdx,4), %rcx
movq 0x8(%rax,%rcx,8), %rdi
subq (%rax,%rcx,8), %rdi
movslq 0xc(%rsp), %rsi
leaq (%rsi,%rsi,4), %rcx
movq 0x8(%rax,%rcx,8), %r8
subq (%rax,%rcx,8), %r8
cmpq %r8, %rdi
jbe 0xc4be
movq %r15, %rdi
callq 0x29028
testb %al, %al
je 0xc4be
movslq 0xc(%rsp), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq (%r15), %rdi
callq 0x29586
testb %al, %al
je 0xc4be
movslq 0x8(%rsp), %r12
movq (%r15), %rax
leaq (%r12,%r12,4), %rcx
leaq (%rax,%rcx,8), %rsi
movslq 0xc(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rdx
callq 0xba2c
testb %al, %al
je 0xc4be
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xc4b1
movl %r12d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xc4be
movslq 0x8(%rsp), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq (%r15), %rdi
callq 0x29586
testb %al, %al
je 0xc47b
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xc3a4
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
jmp 0xc442
movslq 0x8(%rsp), %rax
movq (%r15), %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(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xc4b1
movl %eax, (%rsi)
jmp 0xc442
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x98e8
addq $0x4, %rbp
jmp 0xc20d
addq $0x4, %r13
cmpq 0x10(%rsp), %r13
jne 0xc1f9
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xc4ed
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
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 0xc516
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x34a0