// File: /workspace/github_cpp_makefile_star2_O3/Laakeri[P]maxpre/src/AMSLEX.cpp
// Function: maxPreprocessor::AMSLEX::amsLexSENonPerm(std::vector<int, std::allocator<int>> const&)
vector<int> AMSLEX::amsLexSENonPerm(const vector<int>& clauses) {
	vector<int> D(clauses.size());
	for (unsigned i = 0; i < clauses.size(); i++) {
		D[i] = clauses[i];
	}
	auto cmp = [&](int a, int b) {
		return pi.clauses[a].lit < pi.clauses[b].lit;
	};
	sort(D.begin(), D.end(), cmp);
	vector<int> subsumed(D.size());
	unsigned S = 0;
	for (unsigned i = 1; i < D.size(); i++) {
		if (pi.clauses[D[S]].lit.size() <= pi.clauses[D[i]].lit.size() && isPrefix(pi.clauses[D[S]].lit, pi.clauses[D[i]].lit)) {
			subsumed[i] = true;
		}
		else {
			S = i;
		}
	}
	for (unsigned i = 0; i + 1 < D.size(); i++) {
		if (!subsumed[i] && CSO2(D, i + 1, D.size() - 1, pi.clauses[D[i]].lit, 0, 0)) {
			subsumed[i] = true;
		}
	}
	vector<int> ret;
	for (unsigned i = 0; i < D.size(); i++) {
		if (subsumed[i]) ret.push_back(D[i]);
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %rbx
movq 0x8(%rdx), %rsi
subq (%rdx), %rsi
sarq $0x2, %rsi
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x8c20
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
je 0x2abbc
sarq $0x2, %rcx
movq 0x10(%rsp), %rdx
xorl %esi, %esi
movl (%rax,%rsi,4), %edi
movl %edi, (%rdx,%rsi,4)
incq %rsi
movl %esi, %edi
cmpq %rdi, %rcx
ja 0x2abac
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
cmpq %r15, %r12
je 0x2ac30
movq %r15, %r14
subq %r12, %r14
movq %r14, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x2caa0
cmpq $0x41, %r14
jl 0x2ac22
leaq 0x40(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x2ce7f
cmpq %r15, %r13
je 0x2ac30
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2cf02
addq $0x4, %r13
jmp 0x2ac0c
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2ce7f
movq %rbp, 0x28(%rsp)
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x2, %rsi
leaq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x8c20
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r13
subq %r12, %r13
sarq $0x2, %r13
cmpq $0x2, %r13
jb 0x2ad79
movq 0x28(%rsp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
xorl %esi, %esi
movl $0x1, %ecx
movl $0x1, %edi
movq 0x38(%rsp), %rdx
movl %esi, %r8d
movslq (%r12,%r8,4), %r8
leaq (%r8,%r8,4), %r9
movq (%rax,%r9,8), %r8
movq 0x8(%rax,%r9,8), %r11
movq %r11, %r9
subq %r8, %r9
movslq (%r12,%rdi,4), %r10
leaq (%r10,%r10,4), %r14
movq (%rax,%r14,8), %r10
movq 0x8(%rax,%r14,8), %r14
subq %r10, %r14
movl %ecx, %ebp
cmpq %r14, %r9
ja 0x2acf3
cmpq %r8, %r11
je 0x2ace6
sarq $0x2, %r9
movl $0x1, %r11d
xorl %r14d, %r14d
movl (%r8,%r14,4), %ebp
cmpl (%r10,%r14,4), %ebp
jne 0x2acf1
movl %r11d, %r14d
incl %r11d
cmpq %r14, %r9
ja 0x2acd1
movl $0x1, (%rdx,%rdi,4)
movl %esi, %ebp
jmp 0x2acf3
movl %ecx, %ebp
incl %ecx
movq %rcx, %rdi
movl %ebp, %esi
cmpq %rcx, %r13
ja 0x2ac8a
cmpq $0x2, %r13
jb 0x2ad79
movq 0x38(%rsp), %r15
leal -0x1(%r13), %eax
movl %eax, 0x34(%rsp)
movq 0x28(%rsp), %rax
movq 0x68(%rax), %rax
movq %rax, 0x50(%rsp)
movl $0x2, %ebp
leal -0x2(%rbp), %r14d
cmpl $0x0, (%r15,%r14,4)
jne 0x2ad70
leal -0x1(%rbp), %edx
movslq (%r12,%r14,4), %rax
leaq (%rax,%rax,4), %r8
shlq $0x3, %r8
movq 0x50(%rsp), %rax
addq (%rax), %r8
movl $0x0, (%rsp)
movq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl 0x34(%rsp), %ecx
xorl %r9d, %r9d
callq 0x2a936
testb %al, %al
je 0x2ad70
movl $0x1, (%r15,%r14,4)
movl %ebp, %eax
incl %ebp
cmpq %rax, %r13
ja 0x2ad25
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq 0x10(%rsp), %rdi
cmpq %rdi, 0x18(%rsp)
je 0x2ade3
movl $0x1, %ebp
xorl %eax, %eax
movq 0x38(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
je 0x2adc9
leaq (%rdi,%rax,4), %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2adc1
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x2adc9
movq %rbx, %rdi
callq 0x98f8
movl %ebp, %eax
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
incl %ebp
cmpq %rax, %rcx
ja 0x2ad9a
movq 0x38(%rsp), %rax
testq %rax, %rax
je 0x2ae02
movq 0x48(%rsp), %rsi
subq %rax, %rsi
movq %rax, %rdi
callq 0x32b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2ae14
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x2ae59
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2ae42
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2ae59
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2ae70
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %r14, %rdi
callq 0x34a0