// File: /workspace/github_cpp_makefile_star2_O1/Laakeri[P]maxpre/src/preprocessor.cpp
// Function: maxPreprocessor::Preprocessor::doPreprocess(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int, bool, bool)
int Preprocessor::doPreprocess(const string& techniques, int l, int r, bool debug, bool topLevel) {
	int found = 0;
	if (l == r) {
		char tc = techniques[l];
		if (tc == 'b') {
			while (int f = doBCE()) {
				found += f;
			}
			if (debug) doBCE2();
		}
		else if (tc == 'u') {
			while (int f = doUP()) {
				found += f;
			}
			if (debug) doUP2();
		}
		else if (tc == 'v') {
			while (int f = doBVE()) {
				found += f;
			}
			if (debug) doBVE2();
		}
		else if (tc == 's') {
			while (int f = doSE()) {
				found += f;
			}
			if (debug) doSE2();
		}
		else if (tc == 'r') {
			while (int f = doSSR()) {
				found += f;
			}
			if (debug) doSSR2();
		}
		else if (tc == 'l') {
			while (int f = doSLE()) {
				found += f;
			}
			if (debug) doSLE2();
		}
		else if (tc == 'c') {
			while (int f = doBCR()) {
				found += f;
			}
			if (debug) doBCR2();
		}
		else if (tc == 'i') {
			while (int f = doSIE()) {
				found += f;
			}
			if (debug) doSIE2();
		}
		else if (tc == 'e') {
			while (int f = doBIG(false)) {
				found += f;
			}
			if (debug) doBIG2(false);
		}
		else if (tc == 'a') {
			while (int f = doBVA()) {
				found += f;
			}
			if (debug) doBVA2();
		}
		else if (tc == 'g') {
			while (int f = doGSLE()) {
				found += f;
			}
			if (debug) doGSLE2();
		}
		else if (tc == 'p') {
			while (int f = doFLP()) {
				found += f;
			}
			// FLP already checks every label
		}
		else if (tc == 'h') {
			while (int f = doBIG(true)) {
				found += f;
			}
			if (debug) doBIG2(true);
		}
		else if (tc == 't') {
			found += doLS();
		}
		else {
			abort();
		}
		pi.tl.shrink(logLevel > 0);
	}
	else {
		int lp = l;
		int br = 0;
		for (int i = l; i <= r; i++) {
			if (techniques[i] == '[') {
				br++;
			}
			else if(techniques[i] == ']') {
				br--;
				if (br == 0) {
					while (int f = doPreprocess(techniques, lp + 1, i - 1, debug, false)) {
						found += f;
					}
					if (topLevel) {
						for (int j = lp + 1; j <= i - 1; j++) {
							if (techniques[j] != ']' && techniques[j] != '[' && (techniques[j] < '0' || techniques[j] > '9')) {
								bool neverAgain = true;
								for (int jj = i + 1; jj <= r; jj++) {
									if (techniques[jj] == techniques[j]) {
										neverAgain = false;
									}
								}
								if (neverAgain) {
									rLog.neverAgain(techniques[j]);
								}
							}
						}
					}
					lp = i + 1;
				}
			}
			else {
				if (br == 0) {
					assert(lp == i);
					found += doPreprocess(techniques, i, i, debug, false);
					if (topLevel) {
						bool neverAgain = true;
						for (int j = i + 1; j <= r; j++) {
							if (techniques[j] == techniques[i]) {
								neverAgain = false;
							}
						}
						if (neverAgain) {
							rLog.neverAgain(techniques[i]);
						}
					}
					lp = i + 1;
				}
			}
		}
		assert(br == 0);
	}
	return found;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %r14d
movl %edx, %r13d
movq %rdi, %rbx
cmpl %ecx, %edx
jne 0x1a9af
movslq %r13d, %rax
movq (%rsi), %rcx
movzbl (%rcx,%rax), %eax
addl $-0x61, %eax
cmpl $0x15, %eax
ja 0x1ada0
leaq 0x1e920(%rip), %rcx     # 0x392a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x17b10
addl %eax, %ebp
testl %eax, %eax
jne 0x1a98b
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
callq 0x17ec2
jmp 0x1ad5a
jle 0x1a9ba
xorl %ebp, %ebp
movb $0x1, %al
jmp 0x1ab85
movl %r9d, %r15d
leaq 0x218(%rbx), %rax
movq %rax, 0x30(%rsp)
movl %r14d, %eax
movslq %r13d, %r14
movslq %ecx, %rdx
movq %rdx, 0x20(%rsp)
incl %ecx
movzbl %al, %r12d
movl %r15d, %eax
xorb $0x1, %al
movb %al, 0xf(%rsp)
xorl %ebp, %ebp
xorl %edx, %edx
movl %ecx, 0x14(%rsp)
movl %r12d, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
movl %r9d, 0x28(%rsp)
movq (%rsi), %rax
movzbl (%rax,%r14), %eax
cmpl $0x5d, %eax
je 0x1aa1a
cmpl $0x5b, %eax
jne 0x1aae3
incl %edx
jmp 0x1ab74
decl %edx
jne 0x1ab74
movl %edx, 0x2c(%rsp)
incl %r13d
leal -0x1(%r14), %r15d
movq %rbx, %rdi
movl %r13d, %edx
movl %r15d, %ecx
movl %r12d, %r8d
xorl %r9d, %r9d
callq 0x1a948
movq 0x18(%rsp), %rsi
addl %eax, %ebp
testl %eax, %eax
jne 0x1aa2d
movq %rbx, %r15
movslq %r13d, %rbx
cmpq %rbx, %r14
setle %al
orb 0xf(%rsp), %al
movq 0x20(%rsp), %r8
jne 0x1aac5
movq (%rsi), %rcx
movzbl (%rcx,%rbx), %eax
cmpl $0x5b, %eax
je 0x1aabd
cmpl $0x5d, %eax
je 0x1aabd
leal -0x3a(%rax), %edx
cmpb $-0xb, %dl
ja 0x1aabd
cmpq %r8, %r14
jge 0x1aaa6
movb $0x1, %dl
movq %r14, %r10
xorl %r9d, %r9d
cmpb %al, 0x1(%rcx,%r10)
leaq 0x1(%r10), %rdi
movzbl %dl, %edx
cmovel %r9d, %edx
movq %rdi, %r10
cmpq %r8, %rdi
jl 0x1aa89
testb $0x1, %dl
je 0x1aabd
movsbl %al, %esi
movq 0x30(%rsp), %rdi
callq 0x2a73e
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %r8
incq %rbx
cmpq %r14, %rbx
jl 0x1aa63
leal 0x1(%r14), %r13d
movq %r15, %rbx
movl 0x28(%rsp), %r15d
movl 0x14(%rsp), %ecx
movl 0x10(%rsp), %r12d
movl 0x2c(%rsp), %edx
jmp 0x1ab74
testl %edx, %edx
jne 0x1ab74
cmpl %r14d, %r13d
jne 0x1ad81
movq %rbx, %rdi
movl %r14d, %edx
movl %r14d, %ecx
movl %r12d, %r8d
xorl %r9d, %r9d
callq 0x1a948
movq 0x18(%rsp), %rsi
movl %eax, %r13d
testb %r15b, %r15b
movq 0x20(%rsp), %r8
je 0x1ab62
cmpq %r8, %r14
jge 0x1ab4b
movq (%rsi), %rax
movb (%rax,%r14), %dl
movb $0x1, %cl
movq %r14, %r10
xorl %r9d, %r9d
cmpb %dl, 0x1(%rax,%r10)
leaq 0x1(%r10), %rdi
movzbl %cl, %ecx
cmovel %r9d, %ecx
movq %rdi, %r10
cmpq %r8, %rdi
jl 0x1ab2e
testb $0x1, %cl
je 0x1ab62
movq (%rsi), %rax
movsbl (%rax,%r14), %esi
movq 0x30(%rsp), %rdi
callq 0x2a73e
movq 0x18(%rsp), %rsi
addl %r13d, %ebp
leal 0x1(%r14), %r13d
xorl %edx, %edx
movl 0x14(%rsp), %ecx
movl 0x10(%rsp), %r12d
incq %r14
cmpl %r14d, %ecx
jne 0x1a9fd
testl %edx, %edx
sete %al
testb %al, %al
jne 0x1ad70
leaq 0x1f61d(%rip), %rdi     # 0x3a1b1
leaq 0x1e79c(%rip), %rsi     # 0x39337
leaq 0x1f5b9(%rip), %rcx     # 0x3a15b
movl $0x2a2, %edx            # imm = 0x2A2
callq 0x31b0
movq %rbx, %rdi
callq 0x19f36
movl %eax, %ebp
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x11516
addl %eax, %ebp
testl %eax, %eax
jne 0x1abbd
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
callq 0x117d4
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0xb336
addl %eax, %ebp
testl %eax, %eax
jne 0x1abe3
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
callq 0xb4be
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0xc8c8
addl %eax, %ebp
testl %eax, %eax
jne 0x1ac09
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
callq 0xcc22
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x19736
addl %eax, %ebp
testl %eax, %eax
jne 0x1ac2f
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0xffb4
addl %eax, %ebp
testl %eax, %eax
jne 0x1ac44
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
callq 0x1038c
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x18ace
addl %eax, %ebp
testl %eax, %eax
jne 0x1ac6a
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
callq 0x18efc
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x11ac2
addl %eax, %ebp
testl %eax, %eax
jne 0x1ac90
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
callq 0x11dfe
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x16380
addl %eax, %ebp
testl %eax, %eax
jne 0x1acb6
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x1ad36
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x12ef2
addl %eax, %ebp
testl %eax, %eax
jne 0x1acde
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
callq 0x13396
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x12284
addl %eax, %ebp
testl %eax, %eax
jne 0x1acfd
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
callq 0x1265e
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x16380
addl %eax, %ebp
testl %eax, %eax
jne 0x1ad1c
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
xorl %esi, %esi
callq 0x165a8
jmp 0x1ad5a
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x13dde
addl %eax, %ebp
testl %eax, %eax
jne 0x1ad3f
testb %r14b, %r14b
je 0x1ad5a
movq %rbx, %rdi
callq 0x13ef2
leaq 0x68(%rbx), %rdi
xorl %esi, %esi
cmpl $0x0, 0x2e8(%rbx)
setg %sil
callq 0x2f37e
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f3cb(%rip), %rdi     # 0x3a153
leaq 0x1e5a8(%rip), %rsi     # 0x39337
leaq 0x1f3c5(%rip), %rcx     # 0x3a15b
movl $0x291, %edx            # imm = 0x291
callq 0x31b0
callq 0x3180
nop