// File: /workspace/github_cpp_makefile_star2_O2/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, 0x8(%rsp)
movq %rdi, %r14
movq 0x8(%rdx), %rsi
subq (%rdx), %rsi
sarq $0x2, %rsi
leaq 0x20(%rsp), %r12
leaq 0x38(%rsp), %rdx
movq %r12, %rdi
callq 0x6852
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
xorl %edx, %edx
movq (%r12), %r12
movl %edx, %edx
cmpq %rdx, %rcx
jbe 0x23d30
movl (%rax,%rdx,4), %esi
movl %esi, (%r12,%rdx,4)
incl %edx
jmp 0x23d1e
movq 0x28(%rsp), %r15
cmpq %r15, %r12
je 0x23da7
movq %r15, %rbx
subq %r12, %rbx
movq %rbx, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rcx
callq 0x252e8
cmpq $0x41, %rbx
jl 0x23d97
leaq 0x40(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
movq 0x8(%rsp), %rdx
callq 0x25629
cmpq %r15, %r13
je 0x23da7
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0x256b4
addq $0x4, %r13
jmp 0x23d7f
movq %r12, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
callq 0x25629
movq %r14, 0x50(%rsp)
movq 0x28(%rsp), %rsi
subq 0x20(%rsp), %rsi
sarq $0x2, %rsi
leaq 0x38(%rsp), %rdi
leaq 0x17(%rsp), %rdx
callq 0x6852
movq 0x20(%rsp), %r13
movq 0x28(%rsp), %rbx
subq %r13, %rbx
sarq $0x2, %rbx
movq 0x8(%rsp), %rax
movq 0x68(%rax), %r15
pushq $0x1
popq %rbp
xorl %r14d, %r14d
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movl %ebp, %r12d
cmpq %r12, %rbx
jbe 0x23e54
movl %r14d, %eax
movslq (%r13,%rax,4), %rcx
movq (%r15), %rax
imulq $0x28, %rcx, %rsi
movq 0x8(%rax,%rsi), %rdi
subq (%rax,%rsi), %rdi
movslq (%r13,%r12,4), %rcx
imulq $0x28, %rcx, %rdx
movq 0x8(%rax,%rdx), %r8
subq (%rax,%rdx), %r8
movl %ebp, %ecx
cmpq %r8, %rdi
ja 0x23e4d
addq %rax, %rsi
addq %rax, %rdx
callq 0x237e4
movl %ebp, %ecx
testb %al, %al
je 0x23e4d
movq 0x18(%rsp), %rax
movl $0x1, (%rax,%r12,4)
movl %r14d, %ecx
incl %ebp
movl %ecx, %r14d
jmp 0x23df3
movq 0x38(%rsp), %r14
leal -0x1(%rbx), %eax
movl %eax, 0x18(%rsp)
movq 0x8(%rsp), %rax
movq 0x68(%rax), %r15
xorl %ecx, %ecx
leal 0x1(%rcx), %r12d
cmpq %r12, %rbx
jbe 0x23ebd
movl %ecx, %ebp
cmpl $0x0, (%r14,%rbp,4)
movl %r12d, %ecx
jne 0x23e6b
movslq (%r13,%rbp,4), %rax
imulq $0x28, %rax, %r8
addq (%r15), %r8
andl $0x0, (%rsp)
movq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl %r12d, %edx
movl 0x18(%rsp), %ecx
xorl %r9d, %r9d
callq 0x23acc
movl %r12d, %ecx
testb %al, %al
je 0x23e6b
movl $0x1, (%r14,%rbp,4)
movl %r12d, %ecx
jmp 0x23e6b
xorps %xmm0, %xmm0
movq 0x50(%rsp), %r15
movups %xmm0, (%r15)
andq $0x0, 0x10(%r15)
xorl %ebx, %ebx
movl %ebx, %ebx
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbx, %rcx
jbe 0x23f03
movq 0x38(%rsp), %rcx
cmpl $0x0, (%rcx,%rbx,4)
je 0x23eff
leaq (%rax,%rbx,4), %rsi
movq %r15, %rdi
callq 0x68a4
incl %ebx
jmp 0x23ed0
leaq 0x38(%rsp), %rdi
callq 0x7512
leaq 0x20(%rsp), %rdi
callq 0x7512
movq %r15, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x23f2d
jmp 0x23f2d
movq %rax, %r14
jmp 0x23f47
movq %rax, %r14
movq %r15, %rdi
callq 0x7512
leaq 0x38(%rsp), %rdi
callq 0x7512
leaq 0x20(%rsp), %rdi
callq 0x7512
movq %r14, %rdi
callq 0x3490
nop