// File: /workspace/github_cpp_makefile_star2_O1/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 0x8c32
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
je 0x2b98a
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 0x2b97a
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
cmpq %r15, %r12
je 0x2b9fe
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 0x2d620
cmpq $0x41, %r14
jl 0x2b9f0
leaq 0x40(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x2da3b
cmpq %r15, %r13
je 0x2b9fe
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2dacb
addq $0x4, %r13
jmp 0x2b9da
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2da3b
movq %rbp, 0x28(%rsp)
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x2, %rsi
leaq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x8c32
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r13
subq %r12, %r13
sarq $0x2, %r13
cmpq $0x2, %r13
jb 0x2bae3
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 0x2bad3
cmpq %r8, %r11
sete %r11b
je 0x2bac3
movl (%r8), %r11d
movl %ecx, %ebp
cmpl (%r10), %r11d
jne 0x2bad3
sarq $0x2, %r9
movl $0x1, %ebp
movl %ebp, %r14d
cmpq %r14, %r9
setbe %r11b
jbe 0x2bac3
movl (%r8,%r14,4), %r15d
leal 0x1(%r14), %ebp
cmpl (%r10,%r14,4), %r15d
je 0x2baa9
movl %ecx, %ebp
testb %r11b, %r11b
je 0x2bad3
movl $0x1, (%rdx,%rdi,4)
movl %esi, %ebp
incl %ecx
movq %rcx, %rdi
movl %ebp, %esi
cmpq %rcx, %r13
ja 0x2ba58
cmpq $0x2, %r13
jb 0x2bb5d
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 0x2bb54
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 0x2b6d6
testb %al, %al
je 0x2bb54
movl $0x1, (%r15,%r14,4)
movl %ebp, %eax
incl %ebp
cmpq %rax, %r13
ja 0x2bb09
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x2bbc7
movl $0x1, %ebp
xorl %ecx, %ecx
movq 0x38(%rsp), %rdx
cmpl $0x0, (%rdx,%rcx,4)
je 0x2bbad
leaq (%rax,%rcx,4), %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2bba5
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x2bbad
movq %rbx, %rdi
callq 0x98e8
movl %ebp, %ecx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x2bb7e
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2bbde
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2bbf5
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 0x2bc3a
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2bc23
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2bc3a
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2bc51
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %r14, %rdi
callq 0x34a0
nop