// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
cmpl $0x1, %ecx
jne 0x9362
movq 0x58(%rbx), %r14
jmp 0x936b
cmpl $0x2, %ebp
jne 0x936b
movq 0x68(%rbx), %r14
leaq 0x7f0d(%rip), %rsi      # 0x1127f
movq %r12, %rdi
callq 0x5d3d
testb %al, %al
je 0x938f
negl %r15d
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *0x20(%rax)
jmp 0x93cf
leaq 0x7eee(%rip), %rsi      # 0x11284
movq %r12, %rdi
callq 0x5d3d
testb %al, %al
je 0x93b0
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *0x20(%rax)
jmp 0x93cf
leaq 0x7ef6(%rip), %rsi      # 0x112ad
movq %r12, %rdi
callq 0x5d3d
testb %al, %al
je 0x93dc
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *0x28(%rax)
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7eae(%rip), %rsi      # 0x11291
movq %r12, %rdi
callq 0x5d3d
testb %al, %al
jne 0x9405
leaq 0x7e94(%rip), %rsi      # 0x1128a
movq %r12, %rdi
callq 0x5d3d
testb %al, %al
je 0x9420
negl %r15d
movq (%r14), %rax
movq 0x18(%rax), %rax
movq %r14, %rdi
movl %r15d, %esi
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
leaq 0x7e74(%rip), %rsi      # 0x1129b
movq %r12, %rdi
callq 0x5d3d
testb %al, %al
jne 0x9585
leaq 0x7e62(%rip), %rsi      # 0x112a0
movq %r12, %rdi
callq 0x5d3d
testb %al, %al
je 0x9478
leaq 0x831f(%rip), %rsi      # 0x11770
leaq 0x50(%rsp), %rdi
movq %rsp, %rdx
callq 0x5d02
movq (%r14), %rax
leaq 0x50(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq *0x38(%rax)
leaq 0x50(%rsp), %rdi
jmp 0x94ba
leaq 0x7e29(%rip), %rsi      # 0x112a8
movq %r12, %rdi
callq 0x5d3d
testb %al, %al
je 0x94dc
leaq 0x82de(%rip), %rsi      # 0x11770
leaq 0x30(%rsp), %rdi
movq %rsp, %rdx
callq 0x5d02
negl %r15d
movq (%r14), %rax
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq *0x38(%rax)
leaq 0x30(%rsp), %rdi
callq 0x5140
movq (%r14), %rax
movq %r14, %rdi
callq *0x68(%rax)
cmpl $0x3, %eax
jl 0x93cf
cmpl $0x1, %ebp
jne 0x9525
addq $0x58, %rbx
jmp 0x9532
leaq 0x7dd9(%rip), %rsi      # 0x112bc
movq %r12, %rdi
callq 0x5d3d
testb %al, %al
je 0x955a
leaq 0x827a(%rip), %rsi      # 0x11770
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x5d02
movq (%r14), %rax
pushq $0x1
popq %rdx
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
xorl %esi, %esi
callq *0x38(%rax)
leaq 0x10(%rsp), %rdi
callq 0x5140
jmp 0x93cf
cmpl $0x2, %ebp
jne 0x93cf
addq $0x68, %rbx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x974e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9c06
leaq 0x8(%rsp), %rdi
callq 0x5e60
jmp 0x93cf
leaq 0x7d51(%rip), %rsi      # 0x112b2
movq %r12, %rdi
callq 0x5d3d
testb %al, %al
je 0x93cf
movq %rbx, %rdi
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8d9a
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movq %rbx, %rdi
movl %eax, %esi
movl %ebp, %edx
callq 0x9014
movq %rax, %r14
leaq 0x10(%rsp), %rdi
jmp 0x95ba
jmp 0x95c4
movq %rax, %r14
leaq 0x30(%rsp), %rdi
jmp 0x95ba
jmp 0x95c4
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x5140
jmp 0x969a
movq %rax, %r14
jmp 0x969a
movq %rax, %r14
cmpl $0x1, %edx
jne 0x969a
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x9014
jmp 0x9692
movq %rax, %r14
cmpl $0x2, %edx
jne 0x9609
movq %r14, %rdi
callq 0x5110
movq %rbx, %rdi
callq 0x8f8a
cmpl $0x1, %edx
jne 0x969a
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x9014
jmp 0x9692
jmp 0x9692
movq %rax, %r14
cmpl $0x2, %edx
jne 0x9642
movq %r14, %rdi
callq 0x5110
movq %rbx, %rdi
callq 0x8f8a
cmpl $0x1, %edx
jne 0x969a
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x9014
jmp 0x9692
jmp 0x9692
movq %rax, %r14
cmpl $0x2, %edx
jne 0x9677
movq %r14, %rdi
callq 0x5110
movq %rbx, %rdi
callq 0x8f8a
cmpl $0x1, %edx
jne 0x969a
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x9014
jmp 0x9692
movq %rax, %r14
callq 0x5410
movq %r14, %rdi
callq 0x5450