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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq 0x20(%rbp), %rax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %r8, -0x20(%rbp)
movl %r9d, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x8(%rbp)
movq %rdi, -0x28(%rbp)
movq %rsi, -0x30(%rbp)
movl %edx, -0x34(%rbp)
movl %ecx, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x98(%rbp)
movl 0x10(%rbp), %eax
movl %eax, -0xa0(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x6f120
movl -0xa0(%rbp), %ecx
movl %eax, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x99(%rbp)
jae 0x67a02
movq -0x98(%rbp), %rax
movq 0x58(%rax), %rcx
movl -0x10(%rbp), %edx
addl 0x10(%rbp), %edx
movl %edx, %edx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0xa4(%rbp)
movq 0x58(%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, %esi
callq 0x6f140
movq -0xb0(%rbp), %rcx
movq %rax, %rdx
movl -0xa4(%rbp), %eax
movl (%rdx), %edx
addl 0x18(%rbp), %edx
movl %edx, %edx
cmpl (%rcx,%rdx,4), %eax
setl %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x67a0e
jmp 0x67a1c
movl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rbp)
jmp 0x67984
movl 0x10(%rbp), %eax
movl %eax, -0xb4(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x6f120
movl %eax, %ecx
movl -0xb4(%rbp), %eax
cmpl %ecx, %eax
jb 0x67a43
movb $0x0, -0x1(%rbp)
jmp 0x67ed0
movq -0x98(%rbp), %rax
movq 0x58(%rax), %rcx
movl -0x10(%rbp), %edx
addl 0x10(%rbp), %edx
movl %edx, %edx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0xb8(%rbp)
movq 0x58(%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, %esi
callq 0x6f140
movq -0xc0(%rbp), %rcx
movq %rax, %rdx
movl -0xb8(%rbp), %eax
movl (%rdx), %edx
addl 0x18(%rbp), %edx
movl %edx, %edx
cmpl (%rcx,%rdx,4), %eax
jne 0x67cf6
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, 0x18(%rbp)
jne 0x67ad6
movq -0x98(%rbp), %rax
movq 0x20(%rbp), %rdi
movq 0x58(%rax), %rax
movl -0x10(%rbp), %ecx
addl 0x10(%rbp), %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x3c5b0
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x67c1c
movq -0x98(%rbp), %rcx
movl -0x38(%rbp), %eax
subl -0x34(%rbp), %eax
cmpl 0x50(%rcx), %eax
jae 0x67b78
jmp 0x67aee
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
xorl %eax, %eax
cmpl -0x38(%rbp), %ecx
movb %al, -0xc1(%rbp)
ja 0x67b59
movq -0x98(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x30(%rbp), %rdi
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x6f140
movq -0x98(%rbp), %rcx
movq %rax, %rdx
movq -0xd0(%rbp), %rax
movl (%rdx), %edx
addl 0x18(%rbp), %edx
movl %edx, %edx
movl (%rax,%rdx,4), %eax
movq 0x58(%rcx), %rcx
movl -0x10(%rbp), %edx
addl 0x10(%rbp), %edx
movl %edx, %edx
cmpl (%rcx,%rdx,4), %eax
sete %al
movb %al, -0xc1(%rbp)
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x67b65
jmp 0x67b73
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x67aee
jmp 0x67c1a
movl -0x34(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x38(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x44(%rbp), %eax
jg 0x67c18
movl -0x40(%rbp), %eax
addl -0x44(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x98(%rbp), %rax
movl %ecx, -0x48(%rbp)
movq 0x58(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0x30(%rbp), %rdi
movl -0x48(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x6f140
movq -0x98(%rbp), %rcx
movq %rax, %rdx
movq -0xd8(%rbp), %rax
movl (%rdx), %edx
addl 0x18(%rbp), %edx
movl %edx, %edx
movl (%rax,%rdx,4), %eax
movq 0x58(%rcx), %rcx
movl -0x10(%rbp), %edx
addl 0x10(%rbp), %edx
movl %edx, %edx
cmpl (%rcx,%rdx,4), %eax
jne 0x67c0a
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x67c13
movl -0x48(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x67b87
jmp 0x67c1a
jmp 0x67c1c
leaq -0x10(%rbp), %rdi
callq 0x6f120
movl 0x18(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jbe 0x67c58
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, %esi
callq 0x6f140
movq %rax, %rdi
callq 0x6f120
movl 0x18(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x67c58
movb $0x1, -0x1(%rbp)
jmp 0x67ed0
movl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x6f120
movl %eax, %ecx
movl -0xdc(%rbp), %eax
cmpl %ecx, %eax
ja 0x67ce8
movq -0x98(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x3c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq %rax, -0x54(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl 0x10(%rbp), %r11d
addl $0x1, %r11d
movl 0x18(%rbp), %r10d
addl $0x1, %r10d
movq 0x20(%rbp), %rax
movq -0x54(%rbp), %r8
movq %r8, -0x64(%rbp)
movl -0x4c(%rbp), %r8d
movl %r8d, -0x5c(%rbp)
movq -0x64(%rbp), %r8
movl -0x5c(%rbp), %r9d
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x67940
testb $0x1, %al
jne 0x67cdd
jmp 0x67ce6
movb $0x1, -0x1(%rbp)
jmp 0x67ed0
jmp 0x67ce8
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x67e5b
cmpl $0x0, 0x18(%rbp)
jne 0x67d26
movq -0x98(%rbp), %rax
movq 0x20(%rbp), %rdi
movq 0x58(%rax), %rax
movl -0x10(%rbp), %ecx
addl 0x10(%rbp), %ecx
movl %ecx, %ecx
movslq (%rax,%rcx,4), %rsi
callq 0x3c5b0
movl (%rax), %eax
movl %eax, -0x34(%rbp)
jmp 0x67e59
movq -0x98(%rbp), %rcx
movl -0x38(%rbp), %eax
subl -0x34(%rbp), %eax
cmpl 0x50(%rcx), %eax
jae 0x67dbd
jmp 0x67d3e
movl -0x34(%rbp), %ecx
xorl %eax, %eax
cmpl -0x38(%rbp), %ecx
movb %al, -0xdd(%rbp)
ja 0x67da1
movq -0x98(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, %esi
callq 0x6f140
movq -0x98(%rbp), %rcx
movq %rax, %rdx
movq -0xe8(%rbp), %rax
movl (%rdx), %edx
addl 0x18(%rbp), %edx
movl %edx, %edx
movl (%rax,%rdx,4), %eax
movq 0x58(%rcx), %rcx
movl -0x10(%rbp), %edx
addl 0x10(%rbp), %edx
movl %edx, %edx
cmpl (%rcx,%rdx,4), %eax
setl %al
movb %al, -0xdd(%rbp)
movb -0xdd(%rbp), %al
testb $0x1, %al
jne 0x67dad
jmp 0x67db8
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x67d3e
jmp 0x67e57
movl -0x34(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jg 0x67e55
movl -0x68(%rbp), %eax
addl -0x6c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x98(%rbp), %rax
movl %ecx, -0x70(%rbp)
movq 0x58(%rax), %rax
movq %rax, -0xf0(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x70(%rbp), %rsi
callq 0x6f140
movq -0x98(%rbp), %rcx
movq %rax, %rdx
movq -0xf0(%rbp), %rax
movl (%rdx), %edx
addl 0x18(%rbp), %edx
movl %edx, %edx
movl (%rax,%rdx,4), %eax
movq 0x58(%rcx), %rcx
movl -0x10(%rbp), %edx
addl 0x10(%rbp), %edx
movl %edx, %edx
cmpl (%rcx,%rdx,4), %eax
jge 0x67e47
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x67e50
movl -0x70(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x67dc9
jmp 0x67e57
jmp 0x67e59
jmp 0x67e5b
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
ja 0x67ecc
movq -0x98(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
movq -0x10(%rbp), %rax
movq %rax, -0x7c(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x74(%rbp)
movl 0x10(%rbp), %r11d
movl 0x18(%rbp), %r10d
movq 0x20(%rbp), %rax
movq -0x7c(%rbp), %r8
movq %r8, -0x8c(%rbp)
movl -0x74(%rbp), %r8d
movl %r8d, -0x84(%rbp)
movq -0x8c(%rbp), %r8
movl -0x84(%rbp), %r9d
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x67940
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x67ed0
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nop