// File: /workspace/github_cpp_makefile_star2_O1/ben-strasser[P]latex-checker/latex-checker.cpp
// Function: main
int main(){

	int line_num = 1;
	try{
		stack<Tag>s;

		
		auto skip_spaces = [&]{
			while(isspace(cin.peek())){
				if(cin.peek() == '\n'){
					++line_num;
				}
				cin.ignore();
			}
		};

		auto read_word = []{
			string word;
			while(isalnum(cin.peek()) || cin.peek() == '*')
				word += cin.get();
			return word;
		};

		auto check_close_tag = [&](string close_tag){
			if(s.empty()){
				if(close_tag == "}")
					throw string("} has no corresponding {");
				else if(close_tag == "]")
					throw string("\\] has no corresponding \\[");
				else 
					throw string("\"\\end{"+close_tag+"}\" has no corresponding \"\\begin{"+close_tag+"}\"");
			} else {
				auto x = s.top();
				s.pop();

				string wanted_close_tag = x.tag;
				if(wanted_close_tag == "{")
					wanted_close_tag = "}";
				if(wanted_close_tag == "[")
					wanted_close_tag = "]";


				if(close_tag != wanted_close_tag){
					ostringstream out;
					out << "on line "<<x.line_num << " a ";
					if(x.tag == "{")
						out << '{';
					else if(x.tag == "[")
						out << "\\[";
					else if(x.tag == "$")
						out << "$";
					else if(x.tag == "$$")
						out << "$$";
					else
						out << "\"\\begin{"<<x.tag << "}\"";
					out << " was opened but has not yet been closed. The ";
					if(close_tag == "}")
						out << '}';
					else if(close_tag == "]")
						out << "\\]";
					else if(close_tag == "$")
						out << "$";
					else if(close_tag == "$$")
						out << "$$";
					else
						out << "\"\\end{"<<close_tag << "}\"";
					out << " does not fit.";

					int unclosed = 1;
					while(!s.empty()){
						x = s.top();
						s.pop();

						wanted_close_tag = x.tag;
						if(wanted_close_tag == "{")
							wanted_close_tag = "}";
						if(wanted_close_tag == "[")
							wanted_close_tag = "]";
					
						if(close_tag == wanted_close_tag){
							out << " A matching ";
							if(x.tag == "{")
								out << '{';
							else if(x.tag == "[")
								out << "\\[";
							else if(x.tag == "$")
								out << "$";
							else if(x.tag == "$$")
								out << "$$";
							else
								out << "\"\\begin{"<<x.tag << "}\"";
							out << " was opened on line "<<x.line_num <<" but ";
							if(unclosed == 1)
								out << "one parenthesis";
							else
								out << unclosed << " parentheses";
							out << " must be closed first.";
							throw string(out.str());
						}else
							++unclosed;
					}
					out << " No matching tag was open.";
					throw string(out.str());
				}
			}
		};

		char c;
		while(c = cin.get(), cin){
			if(c == '%'){
				while(c = cin.get(), cin)
					if(c == '\n')
						break;
				++line_num;
			} else if(c == '\n'){
				++line_num;
			} else if(c == '{'){
				s.push(Tag{line_num, "{"});
			} else if(c == '}'){
				check_close_tag("}");
			} else if(c == '$'){
				string tag = "$";
				if(cin.peek() == '$'){
					cin.ignore();
					tag = "$$";
				}
				if(!s.empty() && s.top().tag == tag)
					check_close_tag(tag);
				else
					s.push(Tag{line_num, tag});
			} else if(c == '\\'){
				if(cin.peek() == '['){
					cin.ignore();
					s.push(Tag{line_num, "["});
				}else if(cin.peek() == ']'){
					cin.ignore();
					check_close_tag("]");
				}else{
					string cmd = read_word();
					if(cmd == "begin"){
						skip_spaces();
						if(cin.get() != '{')
							throw ("\"\\begin\" must be followed by an {");
						string tag = read_word();
						if(cin.get() != '}')
							throw ("\"\\begin{"+tag+"\" must be followed by an }");
						s.push(Tag{line_num, tag});
					}else if(cmd == "end"){
						skip_spaces();
						if(cin.get() != '{')
							throw ("\"\\begin\" must be followed by an {");
						string tag = read_word();
						if(cin.get() != '}')
							throw ("\"\\begin{"+tag+"\" must be followed by an }");
						check_close_tag(tag);
					}else if(cmd == ""){
						// next character is escaped. For example \{. This is not parenthesis that we should check for.
						c = cin.get();
						if(c == '\n')
							++line_num;
					}else if(is_begin_variation(cmd)){
						cout << "Warning in line "<<line_num<<": You wrote \""<< cmd << "{\". Did you mean \"begin{\"?" << endl;
					}else if(is_end_variation(cmd)){
						cout << "Warning in line "<<line_num<<": You wrote \""<< cmd << "{\". Did you mean \"end{\"?" << endl;
					}
				}
			}
		}

		if(!s.empty()){
			ostringstream out;
			out << "not all parentheses were closed, still open are :";
			while(!s.empty()){
				out << '\n';
				auto x = s.top();
				s.pop();
				if(x.tag == "[" || x.tag == "{")
					out << x.tag;
				else
					out << "\"\\begin{"<<x.tag<<"}\"";
				out << " opened on line "<<x.line_num;
			}
			throw string(out.str());
		}
	}catch(string&msg){
		cout << "Error in line "<<line_num<<": " << msg << endl;
		return 1;
	}catch(exception&err){
		cerr << "Exception: "<<err.what() << endl;
		return 2;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rbx
movaps %xmm0, 0x40(%rbx)
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x424c
leaq 0x28(%rsp), %rax
movq %rbx, (%rax)
movl $0x1, %ebx
movq 0x485e(%rip), %r13      # 0x6fd8
movq %rsp, %rbp
leaq 0x120(%rsp), %r12
leaq 0x30(%rsp), %r15
movq %r13, %rdi
callq 0x2210
movq (%r13), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%r13,%rcx)
jne 0x2ef2
movzbl %al, %eax
cmpl $0x5b, %eax
jg 0x27e3
cmpl $0xa, %eax
je 0x27df
cmpl $0x24, %eax
je 0x28a3
cmpl $0x25, %eax
jne 0x278a
movq %r13, %rdi
callq 0x2210
cmpb $0xa, %al
je 0x27df
movq (%r13), %rax
movq -0x18(%rax), %rax
movl 0x20(%r13,%rax), %eax
andl $0x5, %eax
je 0x27c1
incl %ebx
jmp 0x278a
cmpl $0x5c, %eax
je 0x2846
cmpl $0x7b, %eax
je 0x29ae
cmpl $0x7d, %eax
jne 0x278a
leaq 0x110(%rsp), %rax
movq %rax, 0x100(%rsp)
leaq 0x100(%rsp), %r14
movq %r14, %rdi
leaq 0x2850(%rip), %rsi      # 0x5068
leaq 0x284a(%rip), %rdx      # 0x5069
callq 0x4086
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x350c
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
jmp 0x29fd
movq %r13, %rdi
callq 0x20b0
cmpl $0x5b, %eax
jne 0x2a10
movq %r13, %rdi
callq 0x22f0
movl %ebx, 0x120(%rsp)
leaq 0x138(%rsp), %rax
movq %rax, 0x128(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x28be(%rip), %rsi      # 0x5143
leaq 0x28b8(%rip), %rdx      # 0x5144
callq 0x4086
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x4454
jmp 0x29ed
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
leaq 0x276f(%rip), %rsi      # 0x5025
leaq 0x2769(%rip), %rdx      # 0x5026
callq 0x4086
movq %r13, %rdi
callq 0x20b0
cmpl $0x24, %eax
jne 0x28f3
movq %r13, %rdi
callq 0x22f0
movq 0x8(%rsp), %rdx
movl $0x2, %r8d
movq %rbp, %rdi
xorl %esi, %esi
leaq 0x2736(%rip), %rcx      # 0x5024
callq 0x2260
movq 0x80(%rsp), %rax
cmpq 0x60(%rsp), %rax
je 0x294c
cmpq 0x88(%rsp), %rax
jne 0x2920
movq 0x98(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x1e0, %ecx            # imm = 0x1E0
addq %rcx, %rax
movq -0x18(%rax), %rdx
movq 0x8(%rsp), %r14
cmpq %r14, %rdx
jne 0x294c
testq %rdx, %rdx
je 0x2ba7
movq (%rsp), %rsi
movq -0x20(%rax), %rdi
callq 0x21f0
testl %eax, %eax
je 0x2ba7
movl %ebx, 0x120(%rsp)
leaq 0x138(%rsp), %rax
movq %rax, 0x128(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x128(%rsp), %rdi
callq 0x3ff6
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x4454
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x29a3
callq 0x21a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
jmp 0x29fd
movl %ebx, 0x120(%rsp)
leaq 0x138(%rsp), %rax
movq %rax, 0x128(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x2754(%rip), %rsi      # 0x5128
leaq 0x274e(%rip), %rdx      # 0x5129
callq 0x4086
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x4454
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x278a
callq 0x21a0
jmp 0x278a
movq %r13, %rdi
callq 0x20b0
cmpl $0x5d, %eax
jne 0x2a72
movq %r13, %rdi
callq 0x22f0
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
leaq 0x2759(%rip), %rsi      # 0x51a0
leaq 0x2753(%rip), %rdx      # 0x51a1
callq 0x4086
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x350c
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
jmp 0x29fd
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %r13, %rdi
callq 0x20b0
movl %eax, %edi
callq 0x21e0
testl %eax, %eax
jne 0x2aa9
movq %r13, %rdi
callq 0x20b0
cmpl $0x2a, %eax
jne 0x2abe
movq %r13, %rdi
callq 0x2210
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2180
jmp 0x2a89
movq %rbp, %rdi
leaq 0x255f(%rip), %rsi      # 0x5027
callq 0x2070
testl %eax, %eax
je 0x2bf5
movq %rbp, %rdi
leaq 0x258b(%rip), %rsi      # 0x506a
callq 0x2070
testl %eax, %eax
je 0x2d02
movq %rbp, %rdi
leaq 0x260b(%rip), %rsi      # 0x5101
callq 0x2070
testl %eax, %eax
je 0x2e25
leaq 0x46c6(%rip), %rdi      # 0x71d0
leaq 0x47bf(%rip), %rsi      # 0x72d0
movq %rbp, %rdx
callq 0x4116
leaq 0x47b0(%rip), %rcx      # 0x72d0
cmpq %rcx, %rax
je 0x2e3b
movl $0x10, %edx
movq 0x4493(%rip), %rdi      # 0x6fc8
leaq 0x2532(%rip), %rsi      # 0x506e
callq 0x2200
movq 0x4480(%rip), %rdi      # 0x6fc8
movl %ebx, %esi
callq 0x22c0
movq %rax, %r14
movl $0xd, %edx
movq %rax, %rdi
leaq 0x251e(%rip), %rsi      # 0x507f
callq 0x2200
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x2200
movq %rax, %r14
movl $0x1a, %edx
movq %rax, %rdi
leaq 0x2504(%rip), %rsi      # 0x508d
callq 0x2200
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
jmp 0x2eda
leaq 0xd0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq (%rsp), %rsi
addq %rsi, %r14
leaq 0xc0(%rsp), %rdi
movq %r14, %rdx
callq 0x3ff6
leaq 0x28(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x350c
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
jmp 0x2999
movq %r13, %rdi
callq 0x20b0
movl %eax, %edi
callq 0x2040
testl %eax, %eax
je 0x2c2c
movq %r13, %rdi
callq 0x20b0
xorl %ecx, %ecx
cmpl $0xa, %eax
sete %cl
addl %ecx, %ebx
movq %r13, %rdi
callq 0x22f0
movq %r13, %rdi
callq 0x20b0
jmp 0x2bfd
movq %r13, %rdi
callq 0x2210
cmpl $0x7b, %eax
jne 0x2f90
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x0, 0x40(%rsp)
movq %r13, %rdi
callq 0x20b0
movl %eax, %edi
callq 0x21e0
testl %eax, %eax
jne 0x2c75
movq %r13, %rdi
callq 0x20b0
cmpl $0x2a, %eax
jne 0x2c8a
movq %r13, %rdi
callq 0x2210
movsbl %al, %esi
movq %r15, %rdi
callq 0x2180
jmp 0x2c55
movq %r13, %rdi
callq 0x2210
cmpl $0x7d, %eax
jne 0x2fba
movl %ebx, 0x120(%rsp)
leaq 0x138(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x128(%rsp), %rdi
callq 0x3ff6
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x4454
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x2cf3
callq 0x21a0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
jmp 0x2999
movq %r13, %rdi
callq 0x20b0
movl %eax, %edi
callq 0x2040
testl %eax, %eax
je 0x2d39
movq %r13, %rdi
callq 0x20b0
xorl %ecx, %ecx
cmpl $0xa, %eax
sete %cl
addl %ecx, %ebx
movq %r13, %rdi
callq 0x22f0
movq %r13, %rdi
callq 0x20b0
jmp 0x2d0a
movq %r13, %rdi
callq 0x2210
cmpl $0x7b, %eax
jne 0x3014
leaq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
movq $0x0, 0x128(%rsp)
movb $0x0, 0x130(%rsp)
movq %r13, %rdi
callq 0x20b0
movl %eax, %edi
callq 0x21e0
testl %eax, %eax
jne 0x2d8e
movq %r13, %rdi
callq 0x20b0
cmpl $0x2a, %eax
jne 0x2da3
movq %r13, %rdi
callq 0x2210
movsbl %al, %esi
movq %r12, %rdi
callq 0x2180
jmp 0x2d6e
movq %r13, %rdi
callq 0x2210
cmpl $0x7d, %eax
jne 0x303b
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0x120(%rsp), %rsi
movq 0x128(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x3ff6
leaq 0x28(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x350c
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x2e10
callq 0x21a0
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
jmp 0x2999
movq %r13, %rdi
callq 0x2210
xorl %ecx, %ecx
cmpb $0xa, %al
sete %cl
addl %ecx, %ebx
jmp 0x29a3
leaq 0x448e(%rip), %rdi      # 0x72d0
leaq 0x4527(%rip), %rsi      # 0x7370
movq %rbp, %rdx
callq 0x4116
leaq 0x4518(%rip), %rcx      # 0x7370
cmpq %rcx, %rax
je 0x29a3
movl $0x10, %edx
movq 0x415b(%rip), %rdi      # 0x6fc8
leaq 0x21fa(%rip), %rsi      # 0x506e
callq 0x2200
movq 0x4148(%rip), %rdi      # 0x6fc8
movl %ebx, %esi
callq 0x22c0
movq %rax, %r14
movl $0xd, %edx
movq %rax, %rdi
leaq 0x21e6(%rip), %rsi      # 0x507f
callq 0x2200
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x2200
movq %rax, %r14
movl $0x18, %edx
movq %rax, %rdi
leaq 0x21e7(%rip), %rsi      # 0x50a8
callq 0x2200
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
jmp 0x29a3
movq 0x80(%rsp), %rax
cmpq 0x60(%rsp), %rax
jne 0x2f1f
leaq 0x50(%rsp), %rdi
callq 0x3ea0
xorl %eax, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x120(%rsp), %rdi
callq 0x2220
leaq 0x218e(%rip), %rsi      # 0x50c1
leaq 0x120(%rsp), %rdi
movl $0x31, %edx
callq 0x2200
movq 0x80(%rsp), %rax
cmpq 0x60(%rsp), %rax
jne 0x3090
movl $0x20, %edi
callq 0x20f0
movq %rax, %r12
leaq 0x128(%rsp), %rsi
movq %rax, %rdi
callq 0x2280
leaq 0x3e04(%rip), %rsi      # 0x6d80
movq 0x4025(%rip), %rdx      # 0x6fa8
movq %r12, %rdi
callq 0x22b0
jmp 0x3090
movl $0x8, %edi
callq 0x20f0
leaq 0x208c(%rip), %rcx      # 0x502d
movq %rcx, (%rax)
movq 0x4005(%rip), %rsi      # 0x6fb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x22b0
jmp 0x3090
movl $0x20, %edi
callq 0x20f0
movq %rax, %r12
leaq 0x2196(%rip), %rsi      # 0x5164
leaq 0x120(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x3db9
movb $0x1, %bpl
leaq 0x2065(%rip), %rdx      # 0x504f
leaq 0x120(%rsp), %rsi
movq %r12, %rdi
callq 0x3d66
xorl %ebp, %ebp
leaq 0x3d7d(%rip), %rsi      # 0x6d80
movq 0x3f9e(%rip), %rdx      # 0x6fa8
movq %r12, %rdi
callq 0x22b0
jmp 0x3090
movl $0x8, %edi
callq 0x20f0
leaq 0x2008(%rip), %rcx      # 0x502d
movq %rcx, (%rax)
movq 0x3f81(%rip), %rsi      # 0x6fb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x22b0
jmp 0x3090
movl $0x20, %edi
callq 0x20f0
movq %rax, %r12
leaq 0x2115(%rip), %rsi      # 0x5164
leaq 0x30(%rsp), %rdi
leaq 0x120(%rsp), %rdx
callq 0x3db9
movb $0x1, %bpl
leaq 0x1fe4(%rip), %rdx      # 0x504f
leaq 0x30(%rsp), %rsi
movq %r12, %rdi
callq 0x3d66
xorl %ebp, %ebp
leaq 0x3cff(%rip), %rsi      # 0x6d80
movq 0x3f20(%rip), %rdx      # 0x6fa8
movq %r12, %rdi
callq 0x22b0
leaq 0x8(%rsp), %r14
leaq 0x18(%rsp), %r13
leaq 0x120(%rsp), %r15
leaq 0x209a(%rip), %rbp      # 0x5143
leaq 0x2112(%rip), %r12      # 0x51c2
movb $0xa, (%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %rsp, %rsi
callq 0x2200
movq 0x80(%rsp), %rax
cmpq 0x88(%rsp), %rax
jne 0x30ea
movq 0x98(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x1e0, %ecx            # imm = 0x1E0
addq %rcx, %rax
movl -0x28(%rax), %ecx
movl %ecx, (%rsp)
movq %r13, 0x8(%rsp)
movq -0x20(%rax), %rsi
movq -0x18(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x3ff6
leaq 0x50(%rsp), %rdi
callq 0x43da
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2070
testl %eax, %eax
je 0x3170
movq %r14, %rdi
leaq 0x1ffd(%rip), %rsi      # 0x5128
callq 0x2070
testl %eax, %eax
je 0x3170
movl $0x8, %edx
movq %r15, %rdi
leaq 0x2021(%rip), %rsi      # 0x5164
callq 0x2200
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x2200
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1f8a(%rip), %rsi      # 0x50f3
callq 0x2200
jmp 0x3182
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x2200
movl $0x10, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2200
movl (%rsp), %esi
movq %r15, %rdi
callq 0x22c0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x31ac
callq 0x21a0
movq 0x80(%rsp), %rax
cmpq 0x60(%rsp), %rax
jne 0x30b0
jmp 0x2f58
jmp 0x32a4
jmp 0x32a4
movq %rdx, %r14
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x32aa
callq 0x21a0
jmp 0x32aa
movq %rdx, %r14
movq %rax, %r15
movq %r12, %rdi
callq 0x2150
jmp 0x32aa
movq %rdx, %r14
movq %rax, %r15
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3224
callq 0x21a0
jmp 0x3224
movq %rdx, %r14
movq %rax, %r15
movb $0x1, %bpl
testb %bpl, %bpl
je 0x33c4
movq %r12, %rdi
callq 0x2150
jmp 0x33c4
movq %rdx, %r14
movq %rax, %r15
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x3265
callq 0x21a0
jmp 0x3265
movq %rdx, %r14
movq %rax, %r15
movb $0x1, %bpl
testb %bpl, %bpl
je 0x33dc
movq %r12, %rdi
callq 0x2150
jmp 0x33dc
movq %rdx, %r14
movq %rax, %r15
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x33c4
callq 0x21a0
jmp 0x33c4
movq %rdx, %r14
movq %rax, %r15
movq 0x3d0f(%rip), %rsi      # 0x6fc0
leaq 0x120(%rsp), %rdi
callq 0x2110
leaq 0x190(%rsp), %rdi
callq 0x2090
jmp 0x3413
jmp 0x33d6
movq %rdx, %r14
movq %rax, %r15
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x33dc
callq 0x21a0
jmp 0x33dc
jmp 0x33d6
jmp 0x33f2
jmp 0x33be
jmp 0x33fa
movq %rdx, %r14
movq %rax, %r15
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
jmp 0x33e6
movq %rdx, %r14
movq %rax, %r15
movl $0x1, %ebx
jmp 0x341d
movq %rdx, %r14
movq %rax, %r15
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
jmp 0x3409
jmp 0x33f2
jmp 0x33f2
jmp 0x339a
movq %rdx, %r14
movq %rax, %r15
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
jmp 0x33e6
jmp 0x33fa
jmp 0x33fa
jmp 0x33f2
movq %rdx, %r14
movq %rax, %r15
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
jmp 0x3409
movq %rdx, %r14
movq %rax, %r15
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
jmp 0x3409
jmp 0x33f2
jmp 0x33f2
jmp 0x33fa
jmp 0x33fa
jmp 0x33fa
jmp 0x33f2
movq %rdx, %r14
movq %rax, %r15
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
jmp 0x33e6
movq %rdx, %r14
movq %rax, %r15
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3400
callq 0x21a0
jmp 0x3400
movq %rdx, %r14
movq %rax, %r15
jmp 0x3413
movq %rdx, %r14
movq %rax, %r15
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3413
callq 0x21a0
leaq 0x50(%rsp), %rdi
callq 0x3ea0
cmpl $0x2, %r14d
jne 0x3491
movq %r15, %rdi
callq 0x20c0
movq %rax, %r14
movq 0x3b93(%rip), %rdi      # 0x6fc8
leaq 0x1cc6(%rip), %rsi      # 0x5102
movl $0xe, %edx
callq 0x2200
movq 0x3b7b(%rip), %rdi      # 0x6fc8
movl %ebx, %esi
callq 0x22c0
movq %rax, %rbx
leaq 0x1ca1(%rip), %rsi      # 0x50ff
movl $0x2, %edx
movq %rax, %rdi
callq 0x2200
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x20e0
callq 0x22a0
movl $0x1, %eax
jmp 0x2f0d
cmpl $0x1, %r14d
jne 0x34fb
movq %r15, %rdi
callq 0x20c0
movq %rax, %rbx
movq 0x3b47(%rip), %rdi      # 0x6ff0
leaq 0x1c46(%rip), %rsi      # 0x50f6
movl $0xb, %edx
callq 0x2200
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x3b26(%rip), %rdi      # 0x6ff0
movq %rax, %rsi
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
callq 0x22a0
movl $0x2, %eax
jmp 0x2f0d
movq %rax, %r15
callq 0x22a0
jmp 0x34fb
movq %rax, %r15
callq 0x22a0
movq %r15, %rdi
callq 0x22d0
movq %rax, %rdi
callq 0x3e3a
nop