// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movl %r9d, %ebx
movl %ecx, %r13d
movl %edx, %r12d
movl 0x70(%rsp), %eax
movl %eax, %r14d
movq %r8, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq (%r8), %rax
movq 0x8(%r8), %r15
subq %rax, %r15
sarq $0x2, %r15
movl %ebx, %edx
cmpq %rdx, %r15
seta %cl
jbe 0x2b91d
movq 0x68(%rdi), %r10
movl %r12d, %r11d
movq (%rsi), %r9
movslq (%r9,%r11,4), %r9
movq (%r10), %r10
leaq (%r9,%r9,4), %r9
movq (%r10,%r9,8), %r9
movl (%r9,%r14,4), %r9d
cmpl %r9d, (%rax,%rdx,4)
jge 0x2b759
incl %ebx
cmpq %rbx, %r15
seta %cl
jbe 0x2b91d
movq %rbx, %rdx
cmpl %r9d, (%rax,%rbx,4)
jl 0x2b742
testb %cl, %cl
je 0x2b91d
movl (%rax,%rdx,4), %ecx
movq 0x68(%rdi), %rax
movq (%rsi), %rdx
movslq (%rdx,%r11,4), %r9
movq (%rax), %rax
leaq (%r9,%r9,4), %rbp
movq (%rax,%rbp,8), %r11
movl %r13d, %r9d
subl %r12d, %r9d
movl 0x50(%rdi), %r10d
cmpl (%r11,%r14,4), %ecx
jne 0x2b7c6
movq %rbp, 0x28(%rsp)
movq %r11, 0x30(%rsp)
cmpl %r10d, %r9d
jae 0x2b801
movl %r12d, %r9d
movl %r9d, %ebp
leal 0x1(%rbp), %r9d
cmpl %r13d, %r9d
ja 0x2b858
movl %r9d, %r10d
movslq (%rdx,%r10,4), %r10
leaq (%r10,%r10,4), %r10
movq (%rax,%r10,8), %r10
cmpl %ecx, (%r10,%r14,4)
je 0x2b79c
jmp 0x2b858
cmpl %r10d, %r9d
jae 0x2b8ca
movl %r12d, %r11d
cmpl %r12d, %r13d
jb 0x2b911
movl %r11d, %r9d
movslq (%rdx,%r9,4), %r9
leaq (%r9,%r9,4), %r9
movq (%rax,%r9,8), %r9
cmpl %ecx, (%r9,%r14,4)
jge 0x2b911
incl %r11d
cmpl %r13d, %r11d
jbe 0x2b7db
jmp 0x2b911
leal -0x1(%r13), %r9d
movl %r12d, %ebp
cmpl %r12d, %r9d
jl 0x2b858
movl %r12d, %r10d
movl %r12d, %ebp
movq %r13, %rsi
leal (%r9,%r10), %r13d
movl %r13d, %r11d
shrl $0x1f, %r11d
addl %r13d, %r11d
sarl %r11d
movslq %r11d, %r13
movslq 0x4(%rdx,%r13,4), %r13
leaq (%r13,%r13,4), %r13
movq (%rax,%r13,8), %r13
cmpl %ecx, (%r13,%r14,4)
je 0x2b847
decl %r11d
movl %r11d, %r9d
jmp 0x2b850
incl %r11d
movl %r11d, %ebp
movl %r11d, %r10d
cmpl %r9d, %r10d
movq %rsi, %r13
jle 0x2b813
movl 0x70(%rsp), %ecx
incl %ecx
cmpq %rcx, %r15
jbe 0x2b87e
movq 0x28(%rsp), %rdx
leaq (%rax,%rdx,8), %rax
movq 0x8(%rax), %rax
subq 0x30(%rsp), %rax
sarq $0x2, %rax
cmpq %rcx, %rax
je 0x2b8a7
leal 0x1(%rbx), %r9d
cmpq %r9, %r15
jb 0x2b8ab
movl %ecx, (%rsp)
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %r12d, %edx
movl %ebp, %ecx
movq 0x20(%rsp), %r8
callq 0x2b6d6
testb %al, %al
je 0x2b8ab
xorl %eax, %eax
jmp 0x2b8b2
incl %ebp
movb $0x1, %al
movl %ebp, %r12d
movl %r12d, %r11d
testb %al, %al
movq 0x20(%rsp), %r8
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
jne 0x2b911
jmp 0x2b92e
movl %r13d, %r15d
movl %r12d, %r11d
cmpl %r12d, %r13d
jl 0x2b911
leal (%r15,%r12), %r9d
movl %r9d, %r10d
shrl $0x1f, %r10d
addl %r9d, %r10d
sarl %r10d
movslq %r10d, %r9
movslq (%rdx,%r9,4), %r9
leaq (%r9,%r9,4), %r9
movq (%rax,%r9,8), %r9
cmpl %ecx, (%r9,%r14,4)
jl 0x2b903
decl %r10d
movl %r10d, %r15d
jmp 0x2b90c
incl %r10d
movl %r10d, %r11d
movl %r10d, %r12d
cmpl %r15d, %r12d
jle 0x2b8d5
movl %r11d, %r12d
cmpl %r13d, %r11d
jbe 0x2b703
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
jmp 0x2b91f