// File: angelapwen[P]text-based-game/game.cpp
// Function: Game::startGame()
void Game::startGame() {
	welcomeMenu();

	characterChoice(); // Choose appropriate character
	satchelChoice(); // Construct appropriate satchel

	string weapon; // Weapon picked up every round
	bool exit = false; // Set bool flag to false until player chosoes to exit

	cout <<
	     "********************************************************************************"
	     << endl;
	// If character is Miss Scarlet, add revolver to Satchel
	if (character == 's') {
		cout << "Hello, Miss Scarlet.";
		satchel->addWeapon("revolver");
	}

	// If character is Colonel Mustard, increment Satchel capacity
	else if (character == 'm') {
		cout << "Hello, Colonel Mustard." << endl;
		satchel->addCapacity();
	}

	// If character is Mrs. White, turn switch on corner access
	else if (character == 'w') {
		cout << "Hello, Mrs. White." << endl;
		cout << "Mr. Boddy wouldn't report his own maid to the police for being"
			 " on his Estate." << endl;
	}

	// If character is Mr. Green, display room with escape door
	else if (character == 'g') {
		cout << "Hello, Mr. Green." << endl;
		cout << "Thank you for your generous donation to Hydra." << endl;
		cout << "The room you must commit the murder in is the " << murderRoom
		     << "." << endl;
	}

	// If character is Mrs. Peacock, multiply the number of total moves
	else if (character == 'p') {
		cout << "Hello, Mrs. Peacock." << endl;
		maxMoves *= 1.25;
		cout << "Your new number of maximum moves in the estate is " <<
		     maxMoves << "." << endl;
	}

	else {
		cout << "Welcome, Professor Plum." << endl;
		current->setCornerAccess('y');
		cout << "You will be able to access the corner passageways throughout "
		        "the game." << endl;
	}

	cout << "The Boddy Estate butler greets you at the entrance." << endl;
	cout << "\nPress enter to begin searching the Estate for weapons." << endl;
	getchar();

	// Repeat these steps while the murder has not been committed, the user
	// has not elected to exit, step count is below max, and random
	// discovery event has not occurred
	while (moves < maxMoves && !murder && !exit && !discovery) {
		// Increment and print the step number
		moves++;

		cout <<
		     "********************************************************************************"
		     << endl;
		cout << "You are on Move #" << moves << "." << endl;

		// Move player to correct place and print board
		updateMap();
		map->printBoard();
		map->printKey();

		// Check if player has enough weapons and is in the appropriate room
		if ((satchel->getNumUniqueWeapons()) > 3 &&
		    current->getName() == murderRoom) {
			current->roomWelcome();
			commitMurder();
		}

		// If murder has not been committed, move forward with room action
		if (!murder) {
			current->roomWelcome();

			// Chance 1 in 9 that character drops their satchel
			int emptyChance = (rand() % 9) + 1;
			switch (emptyChance) {
				case 1: {
					satchel->clearContents();
					break;
				}
				default:
					break;
			}

			// Store the weapon picked up (if any) from action method
			weapon = current->action();

			// Add weapon (if applicable) to satchel
			if (weapon != "none") {
				satchel->addWeapon(weapon);
			}

			// Check again if player has enough weapons and is in the correct room
			if ((satchel->getNumUniqueWeapons()) > 3 && current->getName() ==
			                                            murderRoom) {
				commitMurder();
			}
		}

		// If murder has not been committed at this stage, chance in 1 of 30
		// that player is discovered by Boddy before moving.
		if (!murder) {
			int discoveryChance = (rand() % 30) + 1;

			switch (discoveryChance) {
				case 1: {
					// Turn discovery on if character is not Mrs. White
					if (character != 'w') {
						discovery = true;
					}
					break;
				}
				default:
					break;
			}

			// If discovery did not occur, move character to next room
			if (!discovery) {
				cout << "\nIt is time to move to another room." << endl;

				// If character is Plum, set corner access on
				if (character == 'o') {
					current->setCornerAccess('y');
				}
					// Else if character is not Mrs. White but has wrench, set corner
					// access on
				else if (satchel->getWrench()) {
					cout
							<< "\nHello from Hydra. We noticed that you have a wrench in";
					cout << " your satchel. While you\nhave a wrench, you may access "
							   "the secret corner passageways in the Boddy Estate."
							<< endl << endl;
					current->setCornerAccess('y');
				}
					// Else turn corner access off
				else {
					current->setCornerAccess('n');
				}

				// Display options for the user to move and get user choice
				char move = current->makeMove();

				// Depending on char returned, point current to new room or exit
				switch (move) {
					case 't':
						current = current->getTop();
						break;
					case 'b':
						current = current->getBottom();
						break;
					case 'l':
						current = current->getLeft();
						break;
					case 'r':
						current = current->getRight();
						break;
					case 'c':
						current = current->getCorner();
						break;
					case 'e':
						exit = true;
						break;
					default:
						break;
				}
			}
		}
	}

	cout <<
	     "\n********************************************************************************"
	     << endl;

	// If murder has been committed, display congratulations
	if (murder) {
		cout << "Congratulations, professor! You have completed your mission in "
			  << moves << " moves." << endl;
		cout << "We have activated a secret escape in the " << murderRoom <<
					"." << endl;
		cout << "Open the door and step in to your freedom." << endl;
		cout << "\n\nYour next mission will be:" << endl;
		cout << "DEFEND YOUR INNOCENCE. FRAME ANOTHER GUEST FOR MR. BODDY'S "
		        "MURDER." << endl;
		cout << "The others will be here soon..." << endl;
		cout << "\n\nRemember: Cut off a limb, and two more shall take its "
		        "place." << endl;
	}

	// Else if user reached max number of moves, display exit message
	else if (moves >= maxMoves) {
		cout << "Unfortunately, you exceeded the total number of moves to "
		        "complete your mission." << endl;
		cout << "We have removed you from Mr. Boddy's estate." << endl;
		cout << "\nNot everyone is meant for the greatness of HYDRA." << endl;
		cout << "The Hydra selection process is a dangerous one." << endl;
		cout << "Those who do not successfully complete it are liabilities to "
		        "our organization." << endl;
		cout << "Perhaps you may serve Hydra in your next life." << endl;
		cout << "\n\n\nDo you have any last words before we begin?" << endl;
	}

	// Else player has been discovered, display exit message
	else if (discovery) {
		cout << "Before you decide on your next move, Mr. Boddy walks into the " <<
		     current->getName() << "." << endl;
		cout << "You have been discovered after " << moves << " move(s)!!" <<
		     endl;
		cout << "\nMR. BODDY: \"You aren't supposed to be in here.\"" << endl;
		cout << "MR. BODDY: \"Are you trying to steal my things??\"" << endl;
		cout << "MR. BODDY: \"I expected better from you. I'd better call the "
		        "police. \"" << endl;
		cout << "\nThe police have escorted you from Mr. Boddy's estate." << endl;
		cout << "They do not find any evidence of stolen items on you and you "
			 "are released." << endl;
		cout << "\nYou have failed to complete your mission." << endl;
		cout << "Not everyone is meant for the greatness of HYDRA." << endl;
		cout << "The HYDRA selection process is a dangerous one." << endl;
		cout << "Those who do not successfully complete it are liabilities to "
		        "our organization." << endl;
		cout << "Perhaps you may serve Hydra in your next life." << endl;
		cout << "\n\n\nDo you have any last words before we begin?" << endl;
	}

	// Else if user has elected to exit, display exit message
	else {
		cout << "You have chosen to use the Emergency Exit after " << moves <<
		     " move(s)." << endl;
		cout << "You decided to leave your mission incomplete." << endl;
		cout << "\nNot everyone is meant for the greatness of HYDRA." << endl;
		cout << "The HYDRA selection process is a dangerous one." << endl;
		cout << "Those who do not successfully complete it are liabilities to "
		        "our organization." << endl;
		cout << "Perhaps you may serve Hydra in your next life." << endl;
		cout << "\n\n\nDo you have any last words before we begin?" << endl;
	}
	cout <<
	     "********************************************************************************"
	     << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3e0, %rsp            # imm = 0x3E0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x6ea0
movq -0x130(%rbp), %rdi
callq 0x7290
movq -0x130(%rbp), %rdi
callq 0x77a0
leaq -0x28(%rbp), %rdi
callq 0x32f0
movb $0x0, -0x29(%rbp)
movq 0x15575(%rip), %rdi     # 0x1afd0
leaq 0xd088(%rip), %rsi      # 0x12aea
callq 0x3200
movq %rax, -0x128(%rbp)
jmp 0x5a70
movq -0x128(%rbp), %rdi
movq 0x15542(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5a85
movq -0x130(%rbp), %rax
movsbl 0x8a(%rax), %eax
cmpl $0x73, %eax
jne 0x5b5a
movq 0x1552d(%rip), %rdi     # 0x1afd0
leaq 0xcd4f(%rip), %rsi      # 0x127f9
callq 0x3200
jmp 0x5ab1
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x140(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x3380
movq -0x138(%rbp), %rdx
leaq 0xca6b(%rip), %rsi      # 0x1254c
leaq -0x60(%rbp), %rdi
callq 0x8ea0
jmp 0x5aec
movq -0x140(%rbp), %rdi
movq (%rdi), %rax
movq (%rax), %rax
leaq -0x60(%rbp), %rsi
callq *%rax
jmp 0x5b01
leaq -0x60(%rbp), %rdi
callq 0x3130
leaq -0x61(%rbp), %rdi
callq 0x3250
jmp 0x5e72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6e8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5b4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3130
leaq -0x61(%rbp), %rdi
callq 0x3250
jmp 0x6e8e
movq -0x130(%rbp), %rax
movsbl 0x8a(%rax), %eax
cmpl $0x6d, %eax
jne 0x5bb5
movq 0x1545c(%rip), %rdi     # 0x1afd0
leaq 0xcc93(%rip), %rsi      # 0x1280e
callq 0x3200
movq %rax, -0x148(%rbp)
jmp 0x5b89
movq -0x148(%rbp), %rdi
movq 0x15429(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5b9e
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xd490
jmp 0x5bb0
jmp 0x5e70
movq -0x130(%rbp), %rax
movsbl 0x8a(%rax), %eax
cmpl $0x77, %eax
jne 0x5c2f
movq 0x15401(%rip), %rdi     # 0x1afd0
leaq 0xcc50(%rip), %rsi      # 0x12826
callq 0x3200
movq %rax, -0x150(%rbp)
jmp 0x5be4
movq -0x150(%rbp), %rdi
movq 0x153ce(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5bf9
movq 0x153d0(%rip), %rdi     # 0x1afd0
leaq 0xcc32(%rip), %rsi      # 0x12839
callq 0x3200
movq %rax, -0x158(%rbp)
jmp 0x5c15
movq -0x158(%rbp), %rdi
movq 0x1539d(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5c2a
jmp 0x5e6e
movq -0x130(%rbp), %rax
movsbl 0x8a(%rax), %eax
cmpl $0x67, %eax
jne 0x5d1a
movq 0x15383(%rip), %rdi     # 0x1afd0
leaq 0xcc33(%rip), %rsi      # 0x12887
callq 0x3200
movq %rax, -0x160(%rbp)
jmp 0x5c62
movq -0x160(%rbp), %rdi
movq 0x15350(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5c77
movq 0x15352(%rip), %rdi     # 0x1afd0
leaq 0xcc14(%rip), %rsi      # 0x12899
callq 0x3200
movq %rax, -0x168(%rbp)
jmp 0x5c93
movq -0x168(%rbp), %rdi
movq 0x1531f(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5ca8
movq 0x15321(%rip), %rdi     # 0x1afd0
leaq 0xcc12(%rip), %rsi      # 0x128c8
callq 0x3200
movq %rax, -0x170(%rbp)
jmp 0x5cc4
movq -0x170(%rbp), %rdi
movq -0x130(%rbp), %rsi
addq $0x68, %rsi
callq 0x31d0
movq %rax, -0x178(%rbp)
jmp 0x5ce4
movq -0x178(%rbp), %rdi
leaq 0xd35a(%rip), %rsi      # 0x1304c
callq 0x3200
movq %rax, -0x180(%rbp)
jmp 0x5d00
movq -0x180(%rbp), %rdi
movq 0x152b2(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5d15
jmp 0x5e6c
movq -0x130(%rbp), %rax
movsbl 0x8a(%rax), %eax
cmpl $0x70, %eax
jne 0x5def
movq 0x15298(%rip), %rdi     # 0x1afd0
leaq 0xcbb8(%rip), %rsi      # 0x128f7
callq 0x3200
movq %rax, -0x188(%rbp)
jmp 0x5d4d
movq -0x188(%rbp), %rdi
movq 0x15265(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5d62
movq -0x130(%rbp), %rax
cvtsi2sdl 0x14(%rax), %xmm0
movsd 0xc992(%rip), %xmm1     # 0x12708
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0x14(%rax)
movq 0x15248(%rip), %rdi     # 0x1afd0
leaq 0xcb7d(%rip), %rsi      # 0x1290c
callq 0x3200
movq %rax, -0x190(%rbp)
jmp 0x5d9d
movq -0x190(%rbp), %rdi
movq -0x130(%rbp), %rax
movl 0x14(%rax), %esi
callq 0x3360
movq %rax, -0x198(%rbp)
jmp 0x5dbc
movq -0x198(%rbp), %rdi
leaq 0xd282(%rip), %rsi      # 0x1304c
callq 0x3200
movq %rax, -0x1a0(%rbp)
jmp 0x5dd8
movq -0x1a0(%rbp), %rdi
movq 0x151da(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5ded
jmp 0x5e6a
movq 0x151da(%rip), %rdi     # 0x1afd0
leaq 0xcb42(%rip), %rsi      # 0x1293f
callq 0x3200
movq %rax, -0x1a8(%rbp)
jmp 0x5e0b
movq -0x1a8(%rbp), %rdi
movq 0x151a7(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5e20
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x79, %esi
callq 0xd9e0
jmp 0x5e37
movq 0x15192(%rip), %rdi     # 0x1afd0
leaq 0xcb13(%rip), %rsi      # 0x12958
callq 0x3200
movq %rax, -0x1b0(%rbp)
jmp 0x5e53
movq -0x1b0(%rbp), %rdi
movq 0x1515f(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5e68
jmp 0x5e6a
jmp 0x5e6c
jmp 0x5e6e
jmp 0x5e70
jmp 0x5e72
movq 0x15157(%rip), %rdi     # 0x1afd0
leaq 0xcb1f(%rip), %rsi      # 0x1299f
callq 0x3200
movq %rax, -0x1b8(%rbp)
jmp 0x5e8e
movq -0x1b8(%rbp), %rdi
movq 0x15124(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5ea3
movq 0x15126(%rip), %rdi     # 0x1afd0
leaq 0xcb22(%rip), %rsi      # 0x129d3
callq 0x3200
movq %rax, -0x1c0(%rbp)
jmp 0x5ebf
movq -0x1c0(%rbp), %rdi
movq 0x150f3(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5ed4
callq 0x3300
jmp 0x5edb
jmp 0x5edd
movq -0x130(%rbp), %rdx
movl 0x10(%rdx), %ecx
xorl %eax, %eax
cmpl 0x14(%rdx), %ecx
movb %al, -0x1c1(%rbp)
jge 0x5f2f
movq -0x130(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x88(%rcx)
movb %al, -0x1c1(%rbp)
jne 0x5f2f
xorl %eax, %eax
testb $0x1, -0x29(%rbp)
movb %al, -0x1c1(%rbp)
jne 0x5f2f
movq -0x130(%rbp), %rax
movb 0x89(%rax), %al
xorb $-0x1, %al
movb %al, -0x1c1(%rbp)
movb -0x1c1(%rbp), %al
testb $0x1, %al
jne 0x5f3e
jmp 0x65e1
movq -0x130(%rbp), %rax
movl 0x10(%rax), %ecx
incl %ecx
movl %ecx, 0x10(%rax)
movq 0x1507c(%rip), %rdi     # 0x1afd0
leaq 0xcb8f(%rip), %rsi      # 0x12aea
callq 0x3200
movq %rax, -0x1d0(%rbp)
jmp 0x5f69
movq -0x1d0(%rbp), %rdi
movq 0x15049(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5f7e
movq 0x1504b(%rip), %rdi     # 0x1afd0
leaq 0xca7f(%rip), %rsi      # 0x12a0b
callq 0x3200
movq %rax, -0x1d8(%rbp)
jmp 0x5f9a
movq -0x1d8(%rbp), %rdi
movq -0x130(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x3360
movq %rax, -0x1e0(%rbp)
jmp 0x5fb9
movq -0x1e0(%rbp), %rdi
leaq 0xd085(%rip), %rsi      # 0x1304c
callq 0x3200
movq %rax, -0x1e8(%rbp)
jmp 0x5fd5
movq -0x1e8(%rbp), %rdi
movq 0x14fdd(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x5fea
movq -0x130(%rbp), %rdi
callq 0x7c20
jmp 0x5ff8
movq -0x130(%rbp), %rax
movq (%rax), %rdi
callq 0xa630
jmp 0x6009
movq -0x130(%rbp), %rax
movq (%rax), %rdi
callq 0xa6d0
jmp 0x601a
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movb $0x0, -0x89(%rbp)
callq *%rax
movl %eax, -0x1ec(%rbp)
jmp 0x603d
movl -0x1ec(%rbp), %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
movb %al, -0x1ed(%rbp)
jle 0x608d
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x88(%rbp), %rdi
callq 0xd9b0
jmp 0x6069
movq -0x130(%rbp), %rsi
movb $0x1, -0x89(%rbp)
addq $0x68, %rsi
leaq -0x88(%rbp), %rdi
callq 0x8f50
movb %al, -0x1ed(%rbp)
movb -0x1ed(%rbp), %al
movb %al, -0x1ee(%rbp)
testb $0x1, -0x89(%rbp)
jne 0x60a4
jmp 0x60b0
leaq -0x88(%rbp), %rdi
callq 0x3130
movb -0x1ee(%rbp), %al
testb $0x1, %al
jne 0x60bc
jmp 0x60de
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xd950
jmp 0x60ce
movq -0x130(%rbp), %rdi
callq 0x80f0
jmp 0x60dc
jmp 0x60de
movq -0x130(%rbp), %rax
testb $0x1, 0x88(%rax)
jne 0x62e6
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xd950
jmp 0x6104
callq 0x3080
movl %eax, %ecx
movslq %ecx, %rax
imulq $0x38e38e39, %rax, %rdx # imm = 0x38E38E39
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x21, %rdx
addl %eax, %edx
movl %edx, %eax
leal (%rax,%rax,8), %edx
movl %ecx, %eax
negl %edx
movl %edx, %ecx
leal 0x1(%rax,%rcx), %eax
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %eax
subl $0x1, %eax
jne 0x615c
jmp 0x6144
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
jmp 0x615a
jmp 0x615e
jmp 0x615e
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0xb0(%rbp), %rdi
callq *%rax
jmp 0x617a
leaq -0x28(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
leaq -0xb0(%rbp), %rsi
movq %rsi, -0x200(%rbp)
callq 0x3290
movq -0x200(%rbp), %rdi
callq 0x3130
movq -0x1f8(%rbp), %rdi
leaq 0xc86b(%rip), %rsi      # 0x12a1d
callq 0x8fe0
movb %al, -0x1ef(%rbp)
jmp 0x61bf
movb -0x1ef(%rbp), %al
testb $0x1, %al
jne 0x61cb
jmp 0x6232
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x208(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x30d0
jmp 0x61ef
movq -0x208(%rbp), %rdi
movq (%rdi), %rax
movq (%rax), %rax
leaq -0xd0(%rbp), %rsi
callq *%rax
jmp 0x6207
leaq -0xd0(%rbp), %rdi
callq 0x3130
jmp 0x6232
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x3130
jmp 0x6e8e
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movb $0x0, -0xf1(%rbp)
callq *%rax
movl %eax, -0x20c(%rbp)
jmp 0x6255
movl -0x20c(%rbp), %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
movb %al, -0x20d(%rbp)
jle 0x62a5
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0xf0(%rbp), %rdi
callq 0xd9b0
jmp 0x6281
movq -0x130(%rbp), %rsi
movb $0x1, -0xf1(%rbp)
addq $0x68, %rsi
leaq -0xf0(%rbp), %rdi
callq 0x8f50
movb %al, -0x20d(%rbp)
movb -0x20d(%rbp), %al
movb %al, -0x20e(%rbp)
testb $0x1, -0xf1(%rbp)
jne 0x62bc
jmp 0x62c8
leaq -0xf0(%rbp), %rdi
callq 0x3130
movb -0x20e(%rbp), %al
testb $0x1, %al
jne 0x62d4
jmp 0x62e4
movq -0x130(%rbp), %rdi
callq 0x80f0
jmp 0x62e2
jmp 0x62e4
jmp 0x62e6
movq -0x130(%rbp), %rax
testb $0x1, 0x88(%rax)
jne 0x65dc
callq 0x3080
movl %eax, %edx
movslq %edx, %rax
imulq $-0x77777777, %rax, %rax # imm = 0x88888889
shrq $0x20, %rax
addl %edx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
sarl $0x4, %eax
addl %ecx, %eax
movl %eax, %ecx
shll $0x5, %ecx
addl %eax, %eax
subl %ecx, %eax
movl %eax, %ecx
movl %edx, %eax
leal 0x1(%rax,%rcx), %eax
movl %eax, -0xf8(%rbp)
movl -0xf8(%rbp), %eax
subl $0x1, %eax
jne 0x6362
jmp 0x633f
movq -0x130(%rbp), %rax
movsbl 0x8a(%rax), %eax
cmpl $0x77, %eax
je 0x6360
movq -0x130(%rbp), %rax
movb $0x1, 0x89(%rax)
jmp 0x6364
jmp 0x6364
movq -0x130(%rbp), %rax
testb $0x1, 0x89(%rax)
jne 0x65da
movq 0x14c51(%rip), %rdi     # 0x1afd0
leaq 0xc69c(%rip), %rsi      # 0x12a22
callq 0x3200
movq %rax, -0x218(%rbp)
jmp 0x6394
movq -0x218(%rbp), %rdi
movq 0x14c1e(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x63a9
movq -0x130(%rbp), %rax
movsbl 0x8a(%rax), %eax
cmpl $0x6f, %eax
jne 0x63d8
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x79, %esi
callq 0xd9e0
jmp 0x63d3
jmp 0x6492
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xd470
movb %al, -0x219(%rbp)
jmp 0x63f0
movb -0x219(%rbp), %al
testb $0x1, %al
jne 0x63fc
jmp 0x6477
movq 0x14bcd(%rip), %rdi     # 0x1afd0
leaq 0xc63d(%rip), %rsi      # 0x12a47
callq 0x3200
jmp 0x6411
movq 0x14bb8(%rip), %rdi     # 0x1afd0
leaq 0xc660(%rip), %rsi      # 0x12a7f
callq 0x3200
movq %rax, -0x228(%rbp)
jmp 0x642d
movq -0x228(%rbp), %rdi
movq 0x14b85(%rip), %rsi     # 0x1afc0
callq 0x3230
movq %rax, -0x230(%rbp)
jmp 0x6449
movq -0x230(%rbp), %rdi
movq 0x14b69(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x645e
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x79, %esi
callq 0xd9e0
jmp 0x6475
jmp 0x6490
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x6e, %esi
callq 0xd9e0
jmp 0x648e
jmp 0x6490
jmp 0x6492
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xda20
movb %al, -0x231(%rbp)
jmp 0x64aa
movb -0x231(%rbp), %al
movb %al, -0xf9(%rbp)
movsbl -0xf9(%rbp), %eax
addl $-0x62, %eax
movl %eax, %ecx
movq %rcx, -0x240(%rbp)
subl $0x12, %eax
ja 0x65d6
movq -0x240(%rbp), %rax
leaq 0xc1c0(%rip), %rcx      # 0x126a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xe1e0
movq %rax, -0x248(%rbp)
jmp 0x6502
movq -0x130(%rbp), %rax
movq -0x248(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x65d8
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xe200
movq %rax, -0x250(%rbp)
jmp 0x6532
movq -0x130(%rbp), %rax
movq -0x250(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x65d8
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xe220
movq %rax, -0x258(%rbp)
jmp 0x6562
movq -0x130(%rbp), %rax
movq -0x258(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x65d8
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xe240
movq %rax, -0x260(%rbp)
jmp 0x658f
movq -0x130(%rbp), %rax
movq -0x260(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x65d8
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xe260
movq %rax, -0x268(%rbp)
jmp 0x65bc
movq -0x130(%rbp), %rax
movq -0x268(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x65d8
movb $0x1, -0x29(%rbp)
jmp 0x65d8
jmp 0x65d8
jmp 0x65da
jmp 0x65dc
jmp 0x5edd
movq 0x149e8(%rip), %rdi     # 0x1afd0
leaq 0xc4fa(%rip), %rsi      # 0x12ae9
callq 0x3200
movq %rax, -0x270(%rbp)
jmp 0x65fd
movq -0x270(%rbp), %rdi
movq 0x149b5(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6612
movq -0x130(%rbp), %rax
testb $0x1, 0x88(%rax)
je 0x67f9
movq 0x149a3(%rip), %rdi     # 0x1afd0
leaq 0xc507(%rip), %rsi      # 0x12b3b
callq 0x3200
movq %rax, -0x278(%rbp)
jmp 0x6642
movq -0x278(%rbp), %rdi
movq -0x130(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x3360
movq %rax, -0x280(%rbp)
jmp 0x6661
movq -0x280(%rbp), %rdi
leaq 0xc50c(%rip), %rsi      # 0x12b7b
callq 0x3200
movq %rax, -0x288(%rbp)
jmp 0x667d
movq -0x288(%rbp), %rdi
movq 0x14935(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6692
movq 0x14937(%rip), %rdi     # 0x1afd0
leaq 0xc4e3(%rip), %rsi      # 0x12b83
callq 0x3200
movq %rax, -0x290(%rbp)
jmp 0x66ae
movq -0x290(%rbp), %rdi
movq -0x130(%rbp), %rsi
addq $0x68, %rsi
callq 0x31d0
movq %rax, -0x298(%rbp)
jmp 0x66ce
movq -0x298(%rbp), %rdi
leaq 0xc970(%rip), %rsi      # 0x1304c
callq 0x3200
movq %rax, -0x2a0(%rbp)
jmp 0x66ea
movq -0x2a0(%rbp), %rdi
movq 0x148c8(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x66ff
movq 0x148ca(%rip), %rdi     # 0x1afd0
leaq 0xc4a0(%rip), %rsi      # 0x12bad
callq 0x3200
movq %rax, -0x2a8(%rbp)
jmp 0x671b
movq -0x2a8(%rbp), %rdi
movq 0x14897(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6730
movq 0x14899(%rip), %rdi     # 0x1afd0
leaq 0xc49a(%rip), %rsi      # 0x12bd8
callq 0x3200
movq %rax, -0x2b0(%rbp)
jmp 0x674c
movq -0x2b0(%rbp), %rdi
movq 0x14866(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6761
movq 0x14868(%rip), %rdi     # 0x1afd0
leaq 0xc486(%rip), %rsi      # 0x12bf5
callq 0x3200
movq %rax, -0x2b8(%rbp)
jmp 0x677d
movq -0x2b8(%rbp), %rdi
movq 0x14835(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6792
movq 0x14837(%rip), %rdi     # 0x1afd0
leaq 0xc498(%rip), %rsi      # 0x12c38
callq 0x3200
movq %rax, -0x2c0(%rbp)
jmp 0x67ae
movq -0x2c0(%rbp), %rdi
movq 0x14804(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x67c3
movq 0x14806(%rip), %rdi     # 0x1afd0
leaq 0xc487(%rip), %rsi      # 0x12c58
callq 0x3200
movq %rax, -0x2c8(%rbp)
jmp 0x67df
movq -0x2c8(%rbp), %rdi
movq 0x147d3(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x67f4
jmp 0x6e4b
movq -0x130(%rbp), %rcx
movl 0x10(%rcx), %eax
cmpl 0x14(%rcx), %eax
jl 0x6968
movq 0x147bd(%rip), %rdi     # 0x1afd0
leaq 0xc47d(%rip), %rsi      # 0x12c97
callq 0x3200
movq %rax, -0x2d0(%rbp)
jmp 0x6828
movq -0x2d0(%rbp), %rdi
movq 0x1478a(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x683d
movq 0x1478c(%rip), %rdi     # 0x1afd0
leaq 0xc49c(%rip), %rsi      # 0x12ce7
callq 0x3200
movq %rax, -0x2d8(%rbp)
jmp 0x6859
movq -0x2d8(%rbp), %rdi
movq 0x14759(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x686e
movq 0x1475b(%rip), %rdi     # 0x1afd0
leaq 0xc498(%rip), %rsi      # 0x12d14
callq 0x3200
movq %rax, -0x2e0(%rbp)
jmp 0x688a
movq -0x2e0(%rbp), %rdi
movq 0x14728(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x689f
movq 0x1472a(%rip), %rdi     # 0x1afd0
leaq 0xc49a(%rip), %rsi      # 0x12d47
callq 0x3200
movq %rax, -0x2e8(%rbp)
jmp 0x68bb
movq -0x2e8(%rbp), %rdi
movq 0x146f7(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x68d0
movq 0x146f9(%rip), %rdi     # 0x1afd0
leaq 0xc499(%rip), %rsi      # 0x12d77
callq 0x3200
movq %rax, -0x2f0(%rbp)
jmp 0x68ec
movq -0x2f0(%rbp), %rdi
movq 0x146c6(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6901
movq 0x146c8(%rip), %rdi     # 0x1afd0
leaq 0xc4b7(%rip), %rsi      # 0x12dc6
callq 0x3200
movq %rax, -0x2f8(%rbp)
jmp 0x691d
movq -0x2f8(%rbp), %rdi
movq 0x14695(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6932
movq 0x14697(%rip), %rdi     # 0x1afd0
leaq 0xc4b5(%rip), %rsi      # 0x12df5
callq 0x3200
movq %rax, -0x300(%rbp)
jmp 0x694e
movq -0x300(%rbp), %rdi
movq 0x14664(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6963
jmp 0x6e49
movq -0x130(%rbp), %rax
testb $0x1, 0x89(%rax)
je 0x6cb3
movq 0x1464d(%rip), %rdi     # 0x1afd0
leaq 0xc49a(%rip), %rsi      # 0x12e24
callq 0x3200
movq %rax, -0x308(%rbp)
jmp 0x6998
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x120(%rbp), %rdi
callq 0xd9b0
jmp 0x69b1
movq -0x308(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x31d0
movq %rax, -0x310(%rbp)
jmp 0x69cd
movq -0x310(%rbp), %rdi
leaq 0xc671(%rip), %rsi      # 0x1304c
callq 0x3200
movq %rax, -0x318(%rbp)
jmp 0x69e9
movq -0x318(%rbp), %rdi
movq 0x145c9(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x69fe
leaq -0x120(%rbp), %rdi
callq 0x3130
movq 0x145bf(%rip), %rdi     # 0x1afd0
leaq 0xc44b(%rip), %rsi      # 0x12e63
callq 0x3200
movq %rax, -0x320(%rbp)
jmp 0x6a26
movq -0x320(%rbp), %rdi
movq -0x130(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x3360
movq %rax, -0x328(%rbp)
jmp 0x6a45
movq -0x328(%rbp), %rdi
leaq 0xc430(%rip), %rsi      # 0x12e83
callq 0x3200
movq %rax, -0x330(%rbp)
jmp 0x6a61
movq -0x330(%rbp), %rdi
movq 0x14551(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6a76
movq 0x14553(%rip), %rdi     # 0x1afd0
leaq 0xc40a(%rip), %rsi      # 0x12e8e
callq 0x3200
movq %rax, -0x338(%rbp)
jmp 0x6a92
movq -0x338(%rbp), %rdi
movq 0x14520(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6aa7
movq 0x14522(%rip), %rdi     # 0x1afd0
leaq 0xc40a(%rip), %rsi      # 0x12ebf
callq 0x3200
movq %rax, -0x340(%rbp)
jmp 0x6ac3
movq -0x340(%rbp), %rdi
movq 0x144ef(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6ad8
movq 0x144f1(%rip), %rdi     # 0x1afd0
leaq 0xc40a(%rip), %rsi      # 0x12ef0
callq 0x3200
movq %rax, -0x348(%rbp)
jmp 0x6af4
movq -0x348(%rbp), %rdi
movq 0x144be(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6b09
movq 0x144c0(%rip), %rdi     # 0x1afd0
leaq 0xc41f(%rip), %rsi      # 0x12f36
callq 0x3200
movq %rax, -0x350(%rbp)
jmp 0x6b25
movq -0x350(%rbp), %rdi
movq 0x1448d(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6b3a
movq 0x1448f(%rip), %rdi     # 0x1afd0
leaq 0xc425(%rip), %rsi      # 0x12f6d
callq 0x3200
movq %rax, -0x358(%rbp)
jmp 0x6b56
movq -0x358(%rbp), %rdi
movq 0x1445c(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6b6b
movq 0x1445e(%rip), %rdi     # 0x1afd0
leaq 0xc43f(%rip), %rsi      # 0x12fb8
callq 0x3200
movq %rax, -0x360(%rbp)
jmp 0x6b87
movq -0x360(%rbp), %rdi
movq 0x1442b(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6b9c
movq 0x1442d(%rip), %rdi     # 0x1afd0
leaq 0xc16b(%rip), %rsi      # 0x12d15
callq 0x3200
movq %rax, -0x368(%rbp)
jmp 0x6bb8
movq -0x368(%rbp), %rdi
movq 0x143fa(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6bcd
movq 0x143fc(%rip), %rdi     # 0x1afd0
leaq 0xc408(%rip), %rsi      # 0x12fe3
callq 0x3200
movq %rax, -0x370(%rbp)
jmp 0x6be9
movq -0x370(%rbp), %rdi
movq 0x143c9(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6bfe
movq 0x143cb(%rip), %rdi     # 0x1afd0
leaq 0xc16b(%rip), %rsi      # 0x12d77
callq 0x3200
movq %rax, -0x378(%rbp)
jmp 0x6c1a
movq -0x378(%rbp), %rdi
movq 0x14398(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6c2f
movq 0x1439a(%rip), %rdi     # 0x1afd0
leaq 0xc189(%rip), %rsi      # 0x12dc6
callq 0x3200
movq %rax, -0x380(%rbp)
jmp 0x6c4b
movq -0x380(%rbp), %rdi
movq 0x14367(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6c60
movq 0x14369(%rip), %rdi     # 0x1afd0
leaq 0xc187(%rip), %rsi      # 0x12df5
callq 0x3200
movq %rax, -0x388(%rbp)
jmp 0x6c7c
movq -0x388(%rbp), %rdi
movq 0x14336(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6c91
jmp 0x6e47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x3130
jmp 0x6e8e
movq 0x14316(%rip), %rdi     # 0x1afd0
leaq 0xc352(%rip), %rsi      # 0x13013
callq 0x3200
movq %rax, -0x390(%rbp)
jmp 0x6ccf
movq -0x390(%rbp), %rdi
movq -0x130(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x3360
movq %rax, -0x398(%rbp)
jmp 0x6cee
movq -0x398(%rbp), %rdi
leaq 0xc348(%rip), %rsi      # 0x13044
callq 0x3200
movq %rax, -0x3a0(%rbp)
jmp 0x6d0a
movq -0x3a0(%rbp), %rdi
movq 0x142a8(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6d1f
movq 0x142aa(%rip), %rdi     # 0x1afd0
leaq 0xc321(%rip), %rsi      # 0x1304e
callq 0x3200
movq %rax, -0x3a8(%rbp)
jmp 0x6d3b
movq -0x3a8(%rbp), %rdi
movq 0x14277(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6d50
movq 0x14279(%rip), %rdi     # 0x1afd0
leaq 0xbfb6(%rip), %rsi      # 0x12d14
callq 0x3200
movq %rax, -0x3b0(%rbp)
jmp 0x6d6c
movq -0x3b0(%rbp), %rdi
movq 0x14246(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6d81
movq 0x14248(%rip), %rdi     # 0x1afd0
leaq 0xc254(%rip), %rsi      # 0x12fe3
callq 0x3200
movq %rax, -0x3b8(%rbp)
jmp 0x6d9d
movq -0x3b8(%rbp), %rdi
movq 0x14215(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6db2
movq 0x14217(%rip), %rdi     # 0x1afd0
leaq 0xbfb7(%rip), %rsi      # 0x12d77
callq 0x3200
movq %rax, -0x3c0(%rbp)
jmp 0x6dce
movq -0x3c0(%rbp), %rdi
movq 0x141e4(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6de3
movq 0x141e6(%rip), %rdi     # 0x1afd0
leaq 0xbfd5(%rip), %rsi      # 0x12dc6
callq 0x3200
movq %rax, -0x3c8(%rbp)
jmp 0x6dff
movq -0x3c8(%rbp), %rdi
movq 0x141b3(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6e14
movq 0x141b5(%rip), %rdi     # 0x1afd0
leaq 0xbfd3(%rip), %rsi      # 0x12df5
callq 0x3200
movq %rax, -0x3d0(%rbp)
jmp 0x6e30
movq -0x3d0(%rbp), %rdi
movq 0x14182(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6e45
jmp 0x6e47
jmp 0x6e49
jmp 0x6e4b
movq 0x1417e(%rip), %rdi     # 0x1afd0
leaq 0xbc91(%rip), %rsi      # 0x12aea
callq 0x3200
movq %rax, -0x3d8(%rbp)
jmp 0x6e67
movq -0x3d8(%rbp), %rdi
movq 0x1414b(%rip), %rsi     # 0x1afc0
callq 0x3230
jmp 0x6e7c
leaq -0x28(%rbp), %rdi
callq 0x3130
addq $0x3e0, %rsp            # imm = 0x3E0
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x3130
movq -0x38(%rbp), %rdi
callq 0x3370