// File: /workspace/github_cpp_makefile_star2_O3/scattana[P]Crossword-Anagram-CPP/crossword.cpp
// Function: main
int main(int argc, char *argv[]){
	// display welcome message
	cout << "\n\n------------------------------------------------" << endl;
	cout << "Welcome to the Crossword Anagram Puzzle Program" << endl;
	cout << "------------------------------------------------\n\n" << endl;
	// create a vector list of strings either from user input
	// or from a text file passed at command line
	vector<string> list;
	string temp;

	if(argc == 1) {
		// create vector<string> list from user input
		cout << "Entering manual input mode" << endl;
		cout << "Instructions: Enter  a list of up to 20 words, max 15";
		cout << " letters each.\nType RETURN after each word, and enter a period";
		cout << " '.' after the final word:" << endl;
		getline(cin, temp);
		while(temp[0] != '.'){
			if(list.size()==20){
				cout << "--------------------------------------------" << endl;
				cout << "20 words have been placed - Maximum Reached" << endl;
				cout << "--------------------------------------------" << endl;
				cout << "\n" << endl;
				break;
			}
			if(checkForLetters(temp)){
				list.push_back(temp);
			}
			else{
				cout << "Error: " << temp << " is not a valid word";
				cout << " or has too many letters (max 15)" << endl;
			}

			getline(cin, temp);
		}

		cout << "\nThank you, the list has been saved.\n" << endl;
	}
	if(argc==2 || argc==3) {
		// read data file from argument and create vector<string> list
		ifstream ifs;
		string file = argv[1];
		ifs.open(file);

		// check for valid file; if not valid, prompt for valid file or exit
		while(!ifs){
			cout << "\nInvalid file name. Please enter valid file, ";
			cout << "or type 'quit' to exit the program: " << endl;
			getline(cin, file);
			if(file=="quit"||file=="Quit"||file=="QUIT"){
				return 1;
			}
			ifs.open(file);
		}

		// populate list from file
		while(ifs.peek() != '.'){
			if(list.size()==20){
				cout << "--------------------------------------------" << endl;
				cout << "20 words have been placed - Maximum Reached" << endl;
				cout << "--------------------------------------------" << endl;
				cout << "\n" << endl;
				break;
			}
			getline(ifs, temp, '\n');
			if(checkForLetters(temp)){
				list.push_back(temp);
			}
			else{
				cout << "Error: " << temp << " is not a valid word";
				cout << " or has too many letters (max 15)" << endl;
			}
		}
	}

	// create Board object
	Board board;

	// sort list and make all capital
	sortHighLow(list);
	makeCaps(list);

	// print list in sorted order
	cout << "\nHere's the list of words to be placed: " << endl;
	cout << "--------------------------------------" << endl;
	for(int a=0; a<list.size(); a++){
		cout << list[a] << endl;
	}
	cout << endl;

	// place list on board
	board.placeList(list);

	// print solution board
	cout << "---------------------------------------------" << endl;
	cout << "Your crossword puzzle has been generated!" << endl;
	cout << "Here's the solution:\n" << endl;
	board.printBoard();

	// print "disguised" crossword
	cout << "\n\nHere's the hidden crossword puzzle:\n" << endl;
	board.printHidden();

	// generate and display clues (anagrams)
	cout<<"\n\nHere are the clues! Each clue is an anagram of its solution\n"<<endl;
	for(int s=0; s<list.size(); s++){
		random_shuffle(list[s].begin(), list[s].end());
	}

	for(int t=0; t<list.size(); t++){
		if(list[t][0] != ' '){
			cout << "Row: "<<board.getRowLoc(t)<<", Column: "<<board.getColLoc(t);
			cout << "\t" << board.getDir(t);
			cout << "\t\t" << list[t] << endl;
		}
	}

	// lastly, if 3 arguments are provided at the command line, output
	// the words, solution, crossword, and clues to the file
	if(argc==3){
		ofstream ofs;
		string fileout = argv[2];
		ofs.open(fileout);
		if(!ofs){
			cout << "\n-------------------------------------" << endl;
			cout << "Error: Could not open file '" << fileout << "'" << endl;
			cout << "-------------------------------------\n" << endl;
		}

		ofs << "\n-----------------------------" << endl;
		ofs << "   CROSSWORD PUZZLE SOLUTION   " << endl;
		ofs << "-----------------------------\n" << endl;
		// output to file the solution board
		for(int i=0; i<15; i++){
			for(int j=0; j<15; j++){
				ofs << board.getSpot(i,j) << " ";
			}
			ofs << endl;
		}
		ofs << "\n\n" << endl;

		// output to file the  hidden board
		ofs << "\n-----------------------------" << endl;
		ofs << "  GENERATED CROSSWORD PUZZLE   " << endl;
		ofs << "-----------------------------\n" << endl;
		for(int i=0; i<15; i++){
			for(int j=0; j<15; j++){
				if(board.getSpot(i,j)=='_') ofs << "# ";
				else ofs << "_ ";
			}
			ofs << endl;
		}
		ofs << "\n\n" << endl;

		// lastly, output to file the anagram clues
		ofs << "Here are the clues! Each clue is an anagram of its solution" << endl;
		ofs <<"-----------------------------------------------------------" << endl;
		for(int t=0; t<list.size(); t++){
			if(list[t][0] != ' '){
				ofs << "Row: "<<board.getRowLoc(t)<<", Column: "<<board.getColLoc(t);
				ofs << "\t\t" << board.getDir(t);
				ofs << "\t\t" << list[t] << endl;
			}
		}

		ofs.close();
	} // end of "if(argc==3)" statement

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6d8, %rsp            # imm = 0x6D8
movq %rsi, -0x70(%rbp)
movl %edi, %ebx
movq 0x4b53(%rip), %r15      # 0x6fd0
leaq 0x2b80(%rip), %rsi      # 0x5004
movl $0x32, %edx
movq %r15, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x2b78(%rip), %rsi      # 0x5037
movl $0x2f, %edx
movq %r15, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x2b6d(%rip), %rsi      # 0x5067
movl $0x32, %edx
movq %r15, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
xorl %eax, %eax
movq %rax, -0x30(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
leaq -0x58(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
movl %ebx, -0x44(%rbp)
cmpl $0x1, %ebx
jne 0x290a
movq 0x4a73(%rip), %rbx      # 0x6fd0
leaq 0x2b36(%rip), %rsi      # 0x509a
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x4a41(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x4a2d(%rip), %rdi      # 0x6fd0
leaq 0x2b0b(%rip), %rsi      # 0x50b5
movl $0x35, %edx
callq 0x21d0
movq 0x4a15(%rip), %rdi      # 0x6fd0
leaq 0x2b29(%rip), %rsi      # 0x50eb
movl $0x3e, %edx
callq 0x21d0
movq 0x49fd(%rip), %rbx      # 0x6fd0
leaq 0x2b50(%rip), %rsi      # 0x512a
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x49cb(%rip), %r12      # 0x6fd0
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x49c4(%rip), %rdi      # 0x6fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %edx
movq 0x49a9(%rip), %r13      # 0x6fe0
leaq -0x68(%rbp), %rsi
movq %r13, %rdi
callq 0x2280
leaq -0xe0(%rbp), %rbx
leaq -0x68(%rbp), %r14
movq -0x68(%rbp), %rsi
cmpb $0x2e, (%rsi)
je 0x28c4
movq -0x38(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x280, %rax            # imm = 0x280
je 0x27ac
movq %rbx, -0xf0(%rbp)
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf0(%rbp), %rdi
callq 0x3c48
movq -0xe8(%rbp), %rax
cmpq $0x10, %rax
jb 0x26a2
movq -0xf0(%rbp), %rdi
xorl %r15d, %r15d
jmp 0x26e5
movq -0xf0(%rbp), %rdi
testq %rax, %rax
je 0x26e2
decq %rax
xorl %ecx, %ecx
movb (%rdi,%rcx), %dl
leal -0x41(%rdx), %esi
cmpb $0x3a, %sil
setb %sil
addb $-0x61, %dl
cmpb $-0x6, %dl
setb %r15b
andb %sil, %r15b
cmpb $0x1, %r15b
jne 0x26e5
leaq 0x1(%rcx), %rdx
cmpq %rcx, %rax
movq %rdx, %rcx
jne 0x26b3
jmp 0x26e5
movb $0x1, %r15b
cmpq %rbx, %rdi
je 0x26ef
callq 0x2180
testb %r15b, %r15b
je 0x2709
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x3b96
movq 0x48c9(%rip), %r15      # 0x6fd0
jmp 0x2784
movl $0x7, %edx
movq %r12, %rdi
leaq 0x2a59(%rip), %rsi      # 0x5171
callq 0x21d0
movq 0x48ac(%rip), %r15      # 0x6fd0
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r12, %rdi
callq 0x21d0
movl $0x14, %edx
movq %rax, %rdi
leaq 0x2a36(%rip), %rsi      # 0x5179
callq 0x21d0
movl $0x21, %edx
movq %r12, %rdi
leaq 0x2a37(%rip), %rsi      # 0x518e
callq 0x21d0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x2280
jmp 0x264e
movq 0x481d(%rip), %rbx      # 0x6fd0
leaq 0x2850(%rip), %rsi      # 0x500a
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x47eb(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x47d7(%rip), %rbx      # 0x6fd0
leaq 0x2945(%rip), %rsi      # 0x5145
movl $0x2b, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x47a5(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x4791(%rip), %rbx      # 0x6fd0
leaq 0x27c4(%rip), %rsi      # 0x500a
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x475f(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x474b(%rip), %rbx      # 0x6fd0
leaq 0x280c(%rip), %rsi      # 0x5098
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x4719(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x4705(%rip), %rbx      # 0x6fd0
leaq 0x28de(%rip), %rsi      # 0x51b0
movl $0x25, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x46d3(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movl -0x44(%rbp), %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x2cfd
leaq -0x700(%rbp), %rdi
callq 0x21c0
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x2f0(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x20b0
leaq -0x700(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
movl $0x8, %edx
callq 0x2160
movq 0x4681(%rip), %r13      # 0x6fe0
leaq -0x2f0(%rbp), %rbx
movl $0x1, %r12d
movq -0x700(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x6e0(%rbp,%rax), %r14d
testb $0x5, %r14b
je 0x2a59
movl $0x2d, %edx
movq %r15, %rdi
leaq 0x283e(%rip), %rsi      # 0x51d6
callq 0x21d0
movl $0x24, %edx
movq %r15, %rdi
leaq 0x2858(%rip), %rsi      # 0x5204
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %edx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2280
movq %rbx, %rdi
leaq 0x2824(%rip), %rsi      # 0x5229
callq 0x2070
testl %eax, %eax
je 0x2cd2
movq %rbx, %rdi
leaq 0x2812(%rip), %rsi      # 0x522e
callq 0x2070
testl %eax, %eax
je 0x2cd2
movq %rbx, %rdi
leaq 0x2800(%rip), %rsi      # 0x5233
callq 0x2070
testl %eax, %eax
je 0x2cd2
leaq -0x700(%rbp), %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x2160
jmp 0x296c
leaq -0xc0(%rbp), %r13
leaq -0x700(%rbp), %rbx
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x20a0
cmpl $0x2e, %eax
je 0x2cd2
movq -0x38(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq $0x280, %rax            # imm = 0x280
je 0x2bba
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
movl $0xa, %edx
callq 0x2280
movq %r13, -0xd0(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %rdi
callq 0x3c48
movq -0xc8(%rbp), %rax
cmpq $0x10, %rax
jb 0x2ad7
movq -0xd0(%rbp), %rdi
xorl %r15d, %r15d
jmp 0x2b1a
movq -0xd0(%rbp), %rdi
testq %rax, %rax
je 0x2b17
decq %rax
xorl %ecx, %ecx
movb (%rdi,%rcx), %dl
leal -0x41(%rdx), %esi
cmpb $0x3a, %sil
setb %sil
addb $-0x61, %dl
cmpb $-0x6, %dl
setb %r15b
andb %sil, %r15b
cmpb $0x1, %r15b
jne 0x2b1a
leaq 0x1(%rcx), %rdx
cmpq %rcx, %rax
movq %rdx, %rcx
jne 0x2ae8
jmp 0x2b1a
movb $0x1, %r15b
cmpq %r13, %rdi
je 0x2b24
callq 0x2180
testb %r15b, %r15b
je 0x2b3b
leaq -0x40(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3b96
jmp 0x2a6a
movl $0x7, %edx
movq 0x4489(%rip), %r15      # 0x6fd0
movq %r15, %rdi
leaq 0x2620(%rip), %rsi      # 0x5171
callq 0x21d0
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r15, %rdi
callq 0x21d0
movl $0x14, %edx
movq %rax, %rdi
leaq 0x2604(%rip), %rsi      # 0x5179
callq 0x21d0
movl $0x21, %edx
movq %r15, %rdi
leaq 0x2605(%rip), %rsi      # 0x518e
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
jmp 0x2a6a
movq 0x440f(%rip), %rbx      # 0x6fd0
leaq 0x2442(%rip), %rsi      # 0x500a
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x43dd(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x43c9(%rip), %rbx      # 0x6fd0
leaq 0x2537(%rip), %rsi      # 0x5145
movl $0x2b, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x4397(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x4383(%rip), %rbx      # 0x6fd0
leaq 0x23b6(%rip), %rsi      # 0x500a
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x4351(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x433d(%rip), %rbx      # 0x6fd0
leaq 0x23fe(%rip), %rsi      # 0x5098
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x430b(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq -0x2e0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ce7
callq 0x2180
leaq -0x700(%rbp), %rdi
callq 0x2040
testb $0x5, %r14b
jne 0x3892
leaq -0x700(%rbp), %rdi
callq 0x3ef4
leaq -0x40(%rbp), %rdi
callq 0x39f5
leaq -0x40(%rbp), %rdi
callq 0x3b15
movq 0x42ae(%rip), %rbx      # 0x6fd0
leaq 0x250f(%rip), %rsi      # 0x5238
movl $0x28, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x427c(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x4268(%rip), %rbx      # 0x6fd0
leaq 0x22a1(%rip), %rsi      # 0x5010
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x4236(%rip), %rbx      # 0x6fd0
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq -0x40(%rbp), %rax
cmpq %rax, -0x38(%rbp)
je 0x2e1a
movl $0x8, %r12d
xorl %r13d, %r13d
movq 0x420c(%rip), %r14      # 0x6fd0
movq -0x8(%rax,%r12), %rsi
movq (%rax,%r12), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
incq %r13
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r12
cmpq %r13, %rcx
ja 0x2dc4
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x4198(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq -0x700(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4194
movq 0x4174(%rip), %rbx      # 0x6fd0
leaq 0x21a6(%rip), %rsi      # 0x5009
movl $0x2d, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x4142(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x412e(%rip), %rbx      # 0x6fd0
leaq 0x23b8(%rip), %rsi      # 0x5261
movl $0x29, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x40fc(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x40e8(%rip), %rbx      # 0x6fd0
leaq 0x239c(%rip), %rsi      # 0x528b
movl $0x15, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x40b6(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq -0x700(%rbp), %rdi
callq 0x3fea
movq 0x4096(%rip), %rbx      # 0x6fd0
leaq 0x2360(%rip), %rsi      # 0x52a1
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x4064(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq -0x700(%rbp), %rdi
callq 0x4092
movq 0x4044(%rip), %rbx      # 0x6fd0
leaq 0x2335(%rip), %rsi      # 0x52c8
movl $0x3e, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x4012(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq %rax, %rcx
je 0x3041
xorl %ebx, %ebx
movq %rbx, %rdx
shlq $0x5, %rdx
movq 0x8(%rax,%rdx), %r14
cmpq $0x2, %r14
jb 0x302f
movq (%rax,%rdx), %r15
movl $0x1, %r12d
callq 0x2050
cltq
leaq 0x1(%r12), %rcx
cqto
idivq %rcx
cmpq %rdx, %r12
je 0x301f
addq %r15, %r12
addq %r15, %rdx
movb (%r12), %al
movb (%rdx), %sil
movb %sil, (%r12)
movb %al, (%rdx)
movq %rcx, %r12
cmpq %rcx, %r14
jne 0x2ff6
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
incq %rbx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rbx, %rdx
ja 0x2fda
cmpq %rax, %rcx
je 0x3189
xorl %r12d, %r12d
movq 0x3f7c(%rip), %rbx      # 0x6fd0
leaq -0x700(%rbp), %r15
xorl %r13d, %r13d
movq (%rax,%r12), %rdx
cmpb $0x20, (%rdx)
je 0x316f
movl $0x5, %edx
movq %rbx, %rdi
leaq 0x228d(%rip), %rsi      # 0x5307
callq 0x21d0
movq %r15, %rdi
movl %r13d, %esi
callq 0x4170
movq %rbx, %rdi
movl %eax, %esi
callq 0x2250
movq %rax, %r14
movl $0xa, %edx
movq %rax, %rdi
leaq 0x2267(%rip), %rsi      # 0x530d
callq 0x21d0
movq %r15, %rdi
movl %r13d, %esi
callq 0x4182
movq %r14, %rdi
movl %eax, %esi
callq 0x2250
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x224a(%rip), %rsi      # 0x5319
callq 0x21d0
leaq -0x2f0(%rbp), %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x4938
movq -0x2f0(%rbp), %rsi
movq -0x2e8(%rbp), %rdx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rdi
leaq -0x2e0(%rbp), %rax
cmpq %rax, %rdi
je 0x3114
callq 0x2180
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x21f5(%rip), %rsi      # 0x5318
callq 0x21d0
movq -0x40(%rbp), %rax
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq %rbx, %rdi
callq 0x21d0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
incq %r13
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
addq $0x20, %r12
cmpq %r13, %rdx
ja 0x305e
cmpl $0x3, -0x44(%rbp)
jne 0x3883
leaq -0x2f0(%rbp), %rdi
callq 0x2240
movq -0x70(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x20b0
leaq -0x2f0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
movl $0x10, %edx
callq 0x20d0
movq -0x2f0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2d0(%rbp,%rax)
je 0x32e7
movq 0x3dde(%rip), %rbx      # 0x6fd0
leaq 0x2122(%rip), %rsi      # 0x531b
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x3dac(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x3d98(%rip), %rdi      # 0x6fd0
leaq 0x2103(%rip), %rsi      # 0x5342
movl $0x1c, %edx
callq 0x21d0
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq 0x3d72(%rip), %rdi      # 0x6fd0
callq 0x21d0
movq %rax, %rbx
leaq 0x20f0(%rip), %rsi      # 0x535d
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x3d28(%rip), %rbx      # 0x6fd0
leaq 0x20b0(%rip), %rsi      # 0x535f
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x3cf6(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x2098(%rip), %rsi      # 0x5386
leaq -0x2f0(%rbp), %rbx
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x206d(%rip), %rsi      # 0x53a5
leaq -0x2f0(%rbp), %rbx
movl $0x1f, %edx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x1fe5(%rip), %rsi      # 0x5367
leaq -0x2f0(%rbp), %rbx
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
xorl %r14d, %r14d
leaq -0x700(%rbp), %r15
leaq -0x90(%rbp), %r12
leaq 0x2006(%rip), %r13      # 0x53e3
xorl %ebx, %ebx
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x491e
movb %al, -0x90(%rbp)
movl $0x1, %edx
leaq -0x2f0(%rbp), %rdi
movq %r12, %rsi
callq 0x21d0
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21d0
incl %ebx
cmpl $0xf, %ebx
jne 0x33df
movq -0x2f0(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2f0(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
incl %r14d
cmpl $0xf, %r14d
jne 0x33dd
leaq 0x1c34(%rip), %rsi      # 0x5097
leaq -0x2f0(%rbp), %rbx
movl $0x2, %edx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x1ed9(%rip), %rsi      # 0x5386
leaq -0x2f0(%rbp), %rbx
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x1ece(%rip), %rsi      # 0x53c5
leaq -0x2f0(%rbp), %rbx
movl $0x1f, %edx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x1e26(%rip), %rsi      # 0x5367
leaq -0x2f0(%rbp), %rbx
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
xorl %r14d, %r14d
leaq -0x700(%rbp), %r15
leaq 0x1e4d(%rip), %r13      # 0x53e5
xorl %r12d, %r12d
movq %r15, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0x491e
movq %r13, %rsi
cmpb $0x5f, %al
je 0x35b7
leaq 0x1e31(%rip), %rsi      # 0x53e8
movl $0x2, %edx
movq %rbx, %rdi
callq 0x21d0
incl %r12d
cmpl $0xf, %r12d
jne 0x359b
movq -0x2f0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
incl %r14d
cmpl $0xf, %r14d
jne 0x3598
leaq 0x1a8f(%rip), %rsi      # 0x5097
leaq -0x2f0(%rbp), %rbx
movl $0x2, %edx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x1d99(%rip), %rsi      # 0x53eb
leaq -0x2f0(%rbp), %rbx
movl $0x3b, %edx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x1d8b(%rip), %rsi      # 0x5427
leaq -0x2f0(%rbp), %rbx
movl $0x3b, %edx
movq %rbx, %rdi
callq 0x21d0
movq -0x2f0(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq -0x2f0(%rbp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq %rax, %rcx
je 0x382c
xorl %r13d, %r13d
leaq -0x2f0(%rbp), %r14
leaq -0x700(%rbp), %r15
xorl %r12d, %r12d
movq (%rax,%r13), %rdx
cmpb $0x20, (%rdx)
je 0x3812
movl $0x5, %edx
movq %r14, %rdi
leaq 0x1be7(%rip), %rsi      # 0x5307
callq 0x21d0
movq %r15, %rdi
movl %r12d, %esi
callq 0x4170
movq %r14, %rdi
movl %eax, %esi
callq 0x2250
movq %rax, %rbx
movl $0xa, %edx
movq %rax, %rdi
leaq 0x1bc1(%rip), %rsi      # 0x530d
callq 0x21d0
movq %r15, %rdi
movl %r12d, %esi
callq 0x4182
movq %rbx, %rdi
movl %eax, %esi
callq 0x2250
movl $0x2, %edx
movq %r14, %rdi
leaq 0x1ba3(%rip), %rsi      # 0x5318
callq 0x21d0
leaq -0x90(%rbp), %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0x4938
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq %r14, %rdi
callq 0x21d0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x37b7
callq 0x2180
movl $0x2, %edx
movq %r14, %rdi
leaq 0x1b52(%rip), %rsi      # 0x5318
callq 0x21d0
movq -0x40(%rbp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq %r14, %rdi
callq 0x21d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
incq %r12
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
addq $0x20, %r13
cmpq %r12, %rdx
ja 0x3704
leaq -0x2f0(%rbp), %rdi
callq 0x21e0
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x384d
callq 0x2180
movq 0x3774(%rip), %rax      # 0x6fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x2e8(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x2f0(%rbp,%rcx)
callq 0x2150
leaq -0x1f8(%rbp), %rdi
callq 0x2080
leaq -0x700(%rbp), %rdi
callq 0x3fae
xorl %r12d, %r12d
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x38a4
callq 0x2180
leaq -0x40(%rbp), %rdi
callq 0x3be2
movl %r12d, %eax
addq $0x6d8, %rsp            # imm = 0x6D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x396f
jmp 0x3950
movq %rax, %rbx
jmp 0x3935
jmp 0x3949
jmp 0x3949
jmp 0x391d
jmp 0x3957
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x395a
callq 0x2180
jmp 0x395a
jmp 0x3950
movq %rax, %rbx
movq -0x2f0(%rbp), %rdi
leaq -0x2e0(%rbp), %rax
cmpq %rax, %rdi
je 0x397b
callq 0x2180
jmp 0x397b
jmp 0x3949
jmp 0x391d
jmp 0x3957
jmp 0x3950
movq %rax, %rbx
leaq -0x2e0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3935
callq 0x2180
leaq -0x700(%rbp), %rdi
callq 0x2040
jmp 0x3987
jmp 0x3957
jmp 0x3957
jmp 0x3957
movq %rax, %rbx
jmp 0x3987
jmp 0x3950
movq %rax, %rbx
jmp 0x397b
jmp 0x3957
movq %rax, %rbx
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x396f
callq 0x2180
leaq -0x2f0(%rbp), %rdi
callq 0x2200
leaq -0x700(%rbp), %rdi
callq 0x3fae
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3999
callq 0x2180
leaq -0x40(%rbp), %rdi
callq 0x3be2
movq %rbx, %rdi
callq 0x2260