// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]maxpre/src/AMSLEX.cpp
// Function: maxPreprocessor::AMSLEX::CSO2(std::vector<int, std::allocator<int>> const&, unsigned int, unsigned int, std::vector<int, std::allocator<int>> const&, unsigned int, unsigned int)
bool AMSLEX::CSO2(const vector<int>& D, unsigned b, unsigned e, const vector<int>& S, unsigned j, unsigned d) {
	while (j < S.size() && S[j] < pi.clauses[D[b]].lit[d]) j++;
	if (j >= S.size()) return false;
	
	if (S[j] == pi.clauses[D[b]].lit[d]) {
		unsigned ee = b;
		if (e - b < BSconst) {
			while (ee + 1 <= e && pi.clauses[D[ee + 1]].lit[d] == S[j]) ee++;
		}
		else {
			int mi = b;
			int ma = e - 1;
			while (mi <= ma) {
				int mid = (mi+ma)/2;
				if (pi.clauses[D[mid + 1]].lit[d] == S[j]) {
					ee = mid + 1;
					mi = mid + 1;
				}
				else {
					ma = mid - 1;
				}
			}
		}
		if (S.size() > d + 1 && pi.clauses[D[b]].lit.size() == d + 1) {
			return true;
		}
		if (j + 1 <= S.size()) {
			if (CSO2(D, b, ee, S, j + 1, d + 1)) {
				return true;
			}
		}
		b = ee + 1;
	}
	else {
		if (e - b < BSconst) {
			while (b <= e && pi.clauses[D[b]].lit[d] < S[j]) b++;
		}
		else {
			int mi = b;
			int ma = e;
			while (mi <= ma) {
				int mid = (mi+ma)/2;
				if (pi.clauses[D[mid]].lit[d] < S[j]) {
					b = mid + 1;
					mi = mid + 1;
				}
				else {
					ma = mid - 1;
				}
			}
		}
	}
	if (b <= e) return CSO2(D, b, e, S, j, d);
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %ebx
movl %edx, %ebp
movl 0x80(%rsp), %r10d
movq (%r8), %r14
movq %r8, 0x40(%rsp)
movq 0x8(%r8), %r13
subq %r14, %r13
sarq $0x2, %r13
movq 0x68(%rdi), %r15
movq %rsi, 0x38(%rsp)
movq (%rsi), %r12
movq %rdi, 0x30(%rsp)
movl 0x50(%rdi), %eax
movl %eax, 0x14(%rsp)
leal -0x1(%rcx), %eax
movl %eax, 0x24(%rsp)
leal 0x1(%r10), %eax
movq %rax, 0x28(%rsp)
movl %ebp, %eax
movl %ebx, %edx
cmpq %rdx, %r13
jbe 0x23cbf
movl (%r14,%rdx,4), %edi
movslq (%r12,%rax,4), %rdx
movq (%r15), %rsi
imulq $0x28, %rdx, %r9
movq (%rsi,%r9), %r8
movl (%r8,%r10,4), %edx
cmpl %edx, %edi
jge 0x23b4e
incl %ebx
jmp 0x23b24
movl %ecx, %eax
subl %ebp, %eax
cmpl %edx, %edi
jne 0x23be7
movq %rcx, 0x18(%rsp)
movl %ebp, 0x10(%rsp)
movl %ebp, %r10d
movl 0x24(%rsp), %edx
movl %edx, %r11d
cmpl 0x14(%rsp), %eax
jae 0x23bac
movl 0x10(%rsp), %eax
movq 0x18(%rsp), %rcx
movl 0x80(%rsp), %r10d
movq 0x28(%rsp), %r11
movl %eax, %ebp
leal 0x1(%rbp), %eax
cmpl %ecx, %eax
ja 0x23c23
movl %eax, %edx
movslq (%r12,%rdx,4), %rdx
imulq $0x28, %rdx, %rdx
movq (%rsi,%rdx), %rdx
cmpl %edi, (%rdx,%r10,4)
je 0x23b89
jmp 0x23c23
cmpl %r11d, %r10d
jg 0x23c11
leal (%r11,%r10), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movslq %eax, %rdx
movslq 0x4(%r12,%rdx,4), %rdx
imulq $0x28, %rdx, %rdx
movq (%rsi,%rdx), %rdx
movl 0x80(%rsp), %ecx
cmpl %edi, (%rdx,%rcx,4)
je 0x23bde
decl %eax
movl %eax, %r11d
jmp 0x23bac
incl %eax
movl %eax, %ebp
movl %eax, %r10d
jmp 0x23bac
cmpl 0x14(%rsp), %eax
jae 0x23c83
cmpl %ecx, %ebp
ja 0x23c79
movl %ebp, %eax
movslq (%r12,%rax,4), %rax
imulq $0x28, %rax, %rax
movq (%rsi,%rax), %rax
cmpl %edi, (%rax,%r10,4)
jge 0x23c79
incl %ebp
jmp 0x23bf1
movq 0x18(%rsp), %rcx
movl 0x80(%rsp), %r10d
movq 0x28(%rsp), %r11
cmpq %r11, %r13
jbe 0x23c3f
addq %r9, %rsi
movq 0x8(%rsi), %rax
subq %r8, %rax
sarq $0x2, %rax
cmpq %r11, %rax
je 0x23cd0
leal 0x1(%rbx), %r9d
cmpq %r9, %r13
jb 0x23c77
movl %r11d, (%rsp)
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x10(%rsp), %edx
movl %ebp, %ecx
movq 0x40(%rsp), %r8
callq 0x23acc
movl 0x80(%rsp), %r10d
movq 0x18(%rsp), %rcx
testb %al, %al
jne 0x23cd0
incl %ebp
cmpl %ecx, %ebp
jbe 0x23b22
jmp 0x23cbf
movl %ebp, %r8d
movl %ecx, %r9d
cmpl %r9d, %r8d
jg 0x23c79
leal (%r9,%r8), %eax
cltd
pushq $0x2
popq %r11
idivl %r11d
movslq %eax, %rdx
movslq (%r12,%rdx,4), %rdx
imulq $0x28, %rdx, %rdx
movq (%rsi,%rdx), %rdx
cmpl %edi, (%rdx,%r10,4)
jl 0x23cb6
decl %eax
movl %eax, %r9d
jmp 0x23c89
incl %eax
movl %eax, %ebp
movl %eax, %r8d
jmp 0x23c89
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
jmp 0x23cc1