// File: EstherJin[P]TetrisRemake/game.cc
// Function: Game::processCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int)
void Game::processCommand(string command, int repeat, int board) {
	Board *tmp;
	Board *tmp2;
	if (board == 1) {
		tmp = brd1.get();
		tmp2 = brd2.get();
	}
	else if (board == 2) {
		tmp = brd2.get();
		tmp2 = brd1.get();
	}
	if (command == "left") {
		try {
			tmp->moveBlock(repeat * -1);
		}
		catch (char const*gameOver) {
			processWinner();
		}
		catch (int linesCleared) {
			processDropCmd(linesCleared, board);
		}
	}
	else if (command == "right") {
		try {
			tmp->moveBlock(repeat);
		}
		catch (char const*gameOver) {
			processWinner();
		}
		catch (int linesCleared) {
			processDropCmd(linesCleared, board);
		}
	}
	else if (command == "down")
		try {
			tmp->downBlock(repeat);
		}
		catch (char const*gameOver) {
			processWinner();
		}
		catch (int linesCleared) {
			processDropCmd(linesCleared, board);
		}
	else if (command == "clockwise")
		tmp->turnBlock(repeat);
	else if (command == "counterclockwise")
		tmp->turnBlock(repeat * -1);
	else if (command == "drop") {
		try {
			int linesCleared = tmp->dropBlock();
			processDropCmd(linesCleared, board);
		}
		catch (int linesCleared) {
			processDropCmd(linesCleared, board);
		}
	}
	else if (command == "levelup") {
		tmp->changeLevel(repeat, false, "");
		if (tmp->getLevel() >= 3) {
			if (board == 1) brd1 = make_shared<Heavy> (brd1);
			else if (board == 2) brd2 = make_shared<Heavy> (brd2);
		}
	}
	else if (command == "leveldown") {
		tmp->changeLevel(repeat * -1, false, "");
		if (tmp->getLevel() >= 3) {
			if (board == 1) brd1 = make_shared<Heavy> (brd1);
			else if (board == 2) brd2 = make_shared<Heavy> (brd2);
		}
	}
	else if (command == "random")
		tmp->changeLevel(0, true, "");
	else if (command == "restart")
		restart();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rsi, -0x130(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x128(%rbp)
cmpl $0x1, -0x18(%rbp)
jne 0x15d0b
movq -0x128(%rbp), %rdi
addq $0x58, %rdi
callq 0x12f70
movq -0x128(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x68, %rdi
callq 0x12f70
movq %rax, -0x28(%rbp)
jmp 0x15d3b
cmpl $0x2, -0x18(%rbp)
jne 0x15d39
movq -0x128(%rbp), %rdi
addq $0x68, %rdi
callq 0x12f70
movq -0x128(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x58, %rdi
callq 0x12f70
movq %rax, -0x28(%rbp)
jmp 0x15d3b
movq -0x130(%rbp), %rdi
leaq 0x174ab(%rip), %rsi     # 0x2d1f4
callq 0x7460
testb $0x1, %al
jne 0x15d57
jmp 0x15e18
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %esi
negl %esi
movq (%rdi), %rax
movq 0x20(%rax), %rax
callq *%rax
jmp 0x15d6b
jmp 0x15dab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x134(%rbp)
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x15db0
movq -0x30(%rbp), %rdi
callq 0x6130
movq -0x128(%rbp), %rdi
movq %rax, -0x40(%rbp)
callq 0x15550
jmp 0x15da6
callq 0x6580
jmp 0x164aa
movl -0x134(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x164b3
movq -0x30(%rbp), %rdi
callq 0x6130
movq -0x128(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x15670
jmp 0x15de5
callq 0x6580
jmp 0x15dab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x6580
jmp 0x164b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x6580
jmp 0x164b3
movq -0x130(%rbp), %rdi
leaq 0x173d3(%rip), %rsi     # 0x2d1f9
callq 0x7460
testb $0x1, %al
jne 0x15e34
jmp 0x15ef3
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %esi
movq (%rdi), %rax
movq 0x20(%rax), %rax
callq *%rax
jmp 0x15e46
jmp 0x15e86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x138(%rbp)
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x15e8b
movq -0x30(%rbp), %rdi
callq 0x6130
movq -0x128(%rbp), %rdi
movq %rax, -0x50(%rbp)
callq 0x15550
jmp 0x15e81
callq 0x6580
jmp 0x164a8
movl -0x138(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x164b3
movq -0x30(%rbp), %rdi
callq 0x6130
movq -0x128(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x15670
jmp 0x15ec0
callq 0x6580
jmp 0x15e86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x6580
jmp 0x164b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x6580
jmp 0x164b3
movq -0x130(%rbp), %rdi
leaq 0x17321(%rip), %rsi     # 0x2d222
callq 0x7460
testb $0x1, %al
jne 0x15f0f
jmp 0x15fce
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %esi
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
jmp 0x15f21
jmp 0x15f61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x13c(%rbp)
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x15f66
movq -0x30(%rbp), %rdi
callq 0x6130
movq -0x128(%rbp), %rdi
movq %rax, -0x60(%rbp)
callq 0x15550
jmp 0x15f5c
callq 0x6580
jmp 0x164a6
movl -0x13c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x164b3
movq -0x30(%rbp), %rdi
callq 0x6130
movq -0x128(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x15670
jmp 0x15f9b
callq 0x6580
jmp 0x15f61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x6580
jmp 0x164b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x6580
jmp 0x164b3
movq -0x130(%rbp), %rdi
leaq 0x1722a(%rip), %rsi     # 0x2d206
callq 0x7460
testb $0x1, %al
jne 0x15fe7
jmp 0x15ff9
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %esi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x164a4
movq -0x130(%rbp), %rdi
leaq 0x171f8(%rip), %rsi     # 0x2d1ff
callq 0x7460
testb $0x1, %al
jne 0x16012
jmp 0x16025
movq -0x20(%rbp), %rdi
imull $-0x1, -0x14(%rbp), %esi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x164a2
movq -0x130(%rbp), %rdi
leaq 0x171dd(%rip), %rsi     # 0x2d210
callq 0x7460
testb $0x1, %al
jne 0x16041
jmp 0x160d3
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
movq 0x30(%rax), %rax
callq *%rax
movl %eax, -0x140(%rbp)
jmp 0x16056
movq -0x128(%rbp), %rdi
movl -0x140(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x15670
jmp 0x16073
jmp 0x160b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x164b3
movq -0x30(%rbp), %rdi
callq 0x6130
movq -0x128(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x15670
jmp 0x160b3
callq 0x6580
jmp 0x164a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x6580
jmp 0x164b3
movq -0x130(%rbp), %rdi
leaq 0x17134(%rip), %rsi     # 0x2d215
callq 0x7460
testb $0x1, %al
jne 0x160ef
jmp 0x16240
movq -0x20(%rbp), %rax
movq %rax, -0x158(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x14c(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x65d0
movq -0x148(%rbp), %rdx
leaq 0x175c8(%rip), %rsi     # 0x2d6ec
leaq -0x88(%rbp), %rdi
callq 0x73b0
jmp 0x16132
movl -0x14c(%rbp), %esi
movq -0x158(%rbp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
xorl %edx, %edx
leaq -0x88(%rbp), %rcx
callq *%rax
jmp 0x16153
leaq -0x88(%rbp), %rdi
callq 0x6230
leaq -0x89(%rbp), %rdi
callq 0x63e0
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
cmpl $0x3, %eax
jl 0x1623b
cmpl $0x1, -0x18(%rbp)
jne 0x161f7
movq -0x128(%rbp), %rsi
addq $0x58, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x166b0
movq -0x128(%rbp), %rdi
addq $0x58, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x16720
leaq -0xa0(%rbp), %rdi
callq 0x16750
jmp 0x16239
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x161e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x6230
leaq -0x89(%rbp), %rdi
callq 0x63e0
jmp 0x164b3
cmpl $0x2, -0x18(%rbp)
jne 0x16237
movq -0x128(%rbp), %rsi
addq $0x68, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x166b0
movq -0x128(%rbp), %rdi
addq $0x68, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x16720
leaq -0xb0(%rbp), %rdi
callq 0x16750
jmp 0x16239
jmp 0x1623b
jmp 0x1649e
movq -0x130(%rbp), %rdi
leaq 0x16fcf(%rip), %rsi     # 0x2d21d
callq 0x7460
testb $0x1, %al
jne 0x1625c
jmp 0x163af
movq -0x20(%rbp), %rax
movq %rax, -0x170(%rbp)
movl -0x14(%rbp), %eax
negl %eax
movl %eax, -0x164(%rbp)
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x65d0
movq -0x160(%rbp), %rdx
leaq 0x17459(%rip), %rsi     # 0x2d6ec
leaq -0xd0(%rbp), %rdi
callq 0x73b0
jmp 0x162a1
movl -0x164(%rbp), %esi
movq -0x170(%rbp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
xorl %edx, %edx
leaq -0xd0(%rbp), %rcx
callq *%rax
jmp 0x162c2
leaq -0xd0(%rbp), %rdi
callq 0x6230
leaq -0xd1(%rbp), %rdi
callq 0x63e0
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
cmpl $0x3, %eax
jl 0x163aa
cmpl $0x1, -0x18(%rbp)
jne 0x16366
movq -0x128(%rbp), %rsi
addq $0x58, %rsi
leaq -0xe8(%rbp), %rdi
callq 0x166b0
movq -0x128(%rbp), %rdi
addq $0x58, %rdi
leaq -0xe8(%rbp), %rsi
callq 0x16720
leaq -0xe8(%rbp), %rdi
callq 0x16750
jmp 0x163a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x16355
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x6230
leaq -0xd1(%rbp), %rdi
callq 0x63e0
jmp 0x164b3
cmpl $0x2, -0x18(%rbp)
jne 0x163a6
movq -0x128(%rbp), %rsi
addq $0x68, %rsi
leaq -0xf8(%rbp), %rdi
callq 0x166b0
movq -0x128(%rbp), %rdi
addq $0x68, %rdi
leaq -0xf8(%rbp), %rsi
callq 0x16720
leaq -0xf8(%rbp), %rdi
callq 0x16750
jmp 0x163a8
jmp 0x163aa
jmp 0x1649c
movq -0x130(%rbp), %rdi
leaq 0x16e74(%rip), %rsi     # 0x2d231
callq 0x7460
testb $0x1, %al
jne 0x163cb
jmp 0x16473
movq -0x20(%rbp), %rax
movq %rax, -0x180(%rbp)
leaq -0x119(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x65d0
movq -0x178(%rbp), %rdx
leaq 0x172f5(%rip), %rsi     # 0x2d6ec
leaq -0x118(%rbp), %rdi
callq 0x73b0
jmp 0x16405
movq -0x180(%rbp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
xorl %esi, %esi
movl $0x1, %edx
leaq -0x118(%rbp), %rcx
callq *%rax
jmp 0x16425
leaq -0x118(%rbp), %rdi
callq 0x6230
leaq -0x119(%rbp), %rdi
callq 0x63e0
jmp 0x1649a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x16465
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x6230
leaq -0x119(%rbp), %rdi
callq 0x63e0
jmp 0x164b3
movq -0x130(%rbp), %rdi
leaq 0x16da6(%rip), %rsi     # 0x2d227
callq 0x7460
testb $0x1, %al
jne 0x1648c
jmp 0x16498
movq -0x128(%rbp), %rdi
callq 0x152b0
jmp 0x1649a
jmp 0x1649c
jmp 0x1649e
jmp 0x164a0
jmp 0x164a2
jmp 0x164a4
jmp 0x164a6
jmp 0x164a8
jmp 0x164aa
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x65c0
nopl (%rax)