// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movl %r8d, %r15d
movl %edx, %r14d
movq %rdi, %r13
cmpl %ecx, %edx
jne 0x1a063
movslq %r14d, %rax
movq (%rsi), %rcx
movzbl (%rcx,%rax), %eax
addl $-0x61, %eax
cmpl $0x15, %eax
ja 0x1a424
leaq 0x1e31c(%rip), %rcx     # 0x38350
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x17370
addl %eax, %ebp
testl %eax, %eax
jne 0x1a03f
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
callq 0x176f8
jmp 0x1a3dd
xorl %ebp, %ebp
cmpl %ecx, %r14d
jg 0x1a3f4
leaq 0x218(%r13), %rax
movq %rax, 0x20(%rsp)
movslq %r14d, %rbx
movslq %ecx, %rax
movq %rax, 0x10(%rsp)
incl %ecx
xorl %ebp, %ebp
movzbl %r15b, %r12d
movl %r9d, 0x18(%rsp)
movl %r9d, %eax
xorb $0x1, %al
movb %al, 0x3(%rsp)
xorl %eax, %eax
movl %ecx, %r15d
movl %r12d, 0x4(%rsp)
movq %rsi, 0x8(%rsp)
movl %ecx, 0x1c(%rsp)
movq (%rsi), %rcx
movzbl (%rcx,%rbx), %ecx
cmpl $0x5d, %ecx
je 0x1a0ca
cmpl $0x5b, %ecx
jne 0x1a17c
incl %eax
jmp 0x1a1fc
decl %eax
jne 0x1a1fc
incl %r14d
movq %r13, %r15
leal -0x1(%rbx), %r13d
movq %r15, %rdi
movl %r14d, %edx
movl %r13d, %ecx
movl %r12d, %r8d
xorl %r9d, %r9d
callq 0x19ffc
movq 0x8(%rsp), %rsi
addl %eax, %ebp
testl %eax, %eax
jne 0x1a0dc
movslq %r14d, %r14
cmpq %r14, %rbx
setle %al
orb 0x3(%rsp), %al
movq %r15, %r13
movl 0x1c(%rsp), %r15d
movq 0x10(%rsp), %r8
jne 0x1a176
movq (%rsi), %rcx
movzbl (%rcx,%r14), %eax
cmpl $0x5b, %eax
je 0x1a16e
cmpl $0x5d, %eax
je 0x1a16e
leal -0x3a(%rax), %edx
cmpb $-0xb, %dl
ja 0x1a16e
cmpq %r8, %rbx
jge 0x1a157
movb $0x1, %dl
movq %rbx, %r9
cmpb %al, 0x1(%rcx,%r9)
leaq 0x1(%r9), %rdi
setne %r9b
andb %r9b, %dl
movq %rdi, %r9
cmpq %r8, %rdi
jl 0x1a13b
testb %dl, %dl
je 0x1a16e
movsbl %al, %esi
movq 0x20(%rsp), %rdi
callq 0x299f2
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %r8
incq %r14
cmpq %rbx, %r14
jl 0x1a117
leal 0x1(%rbx), %r14d
jmp 0x1a1f5
testl %eax, %eax
jne 0x1a1fc
cmpl %ebx, %r14d
jne 0x1a405
movq %r13, %rdi
movl %r14d, %edx
movl %r14d, %ecx
movl %r12d, %r8d
xorl %r9d, %r9d
callq 0x19ffc
movq 0x8(%rsp), %rsi
movl %eax, %r12d
cmpb $0x0, 0x18(%rsp)
movq 0x10(%rsp), %r8
je 0x1a1ef
movq (%rsi), %rcx
movb (%rcx,%rbx), %al
cmpq %r8, %rbx
jge 0x1a1dd
movb $0x1, %dl
movq %rbx, %r9
cmpb %al, 0x1(%rcx,%r9)
leaq 0x1(%r9), %rdi
setne %r9b
andb %r9b, %dl
movq %rdi, %r9
cmpq %r8, %rdi
jl 0x1a1c1
testb %dl, %dl
je 0x1a1ef
movsbl %al, %esi
movq 0x20(%rsp), %rdi
callq 0x299f2
movq 0x8(%rsp), %rsi
addl %r12d, %ebp
incl %r14d
xorl %eax, %eax
movl 0x4(%rsp), %r12d
incq %rbx
cmpl %ebx, %r15d
jne 0x1a0ae
testl %eax, %eax
je 0x1a3f4
leaq 0x1f04a(%rip), %rdi     # 0x39261
leaq 0x1e1c9(%rip), %rsi     # 0x383e7
leaq 0x1efe6(%rip), %rcx     # 0x3920b
movl $0x2a2, %edx            # imm = 0x2A2
callq 0x31b0
movq %r13, %rdi
callq 0x196a0
movl %eax, %ebp
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x10fb6
addl %eax, %ebp
testl %eax, %eax
jne 0x1a240
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
callq 0x1123e
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
callq 0xb208
addl %eax, %ebp
testl %eax, %eax
jne 0x1a266
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
callq 0xb370
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
callq 0xc80e
addl %eax, %ebp
testl %eax, %eax
jne 0x1a28c
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
callq 0xcb2c
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x18f46
addl %eax, %ebp
testl %eax, %eax
jne 0x1a2b2
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
callq 0xfb10
addl %eax, %ebp
testl %eax, %eax
jne 0x1a2c7
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
callq 0xfe94
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x182e8
addl %eax, %ebp
testl %eax, %eax
jne 0x1a2ed
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
callq 0x1869a
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x114ce
addl %eax, %ebp
testl %eax, %eax
jne 0x1a313
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
callq 0x117be
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
movl $0x1, %esi
callq 0x15bee
addl %eax, %ebp
testl %eax, %eax
jne 0x1a339
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
movl $0x1, %esi
jmp 0x1a3b9
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x127b0
addl %eax, %ebp
testl %eax, %eax
jne 0x1a361
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
callq 0x12be4
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x11baa
addl %eax, %ebp
testl %eax, %eax
jne 0x1a380
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
callq 0x11f32
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
xorl %esi, %esi
callq 0x15bee
addl %eax, %ebp
testl %eax, %eax
jne 0x1a39f
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
xorl %esi, %esi
callq 0x15e02
jmp 0x1a3dd
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x135bc
addl %eax, %ebp
testl %eax, %eax
jne 0x1a3c2
testb %r15b, %r15b
je 0x1a3dd
movq %r13, %rdi
callq 0x136d0
leaq 0x68(%r13), %rdi
xorl %esi, %esi
cmpl $0x0, 0x2e8(%r13)
setg %sil
callq 0x2e66e
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1edf7(%rip), %rdi     # 0x39203
leaq 0x1dfd4(%rip), %rsi     # 0x383e7
leaq 0x1edf1(%rip), %rcx     # 0x3920b
movl $0x291, %edx            # imm = 0x291
callq 0x31b0
callq 0x3180
nop