// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
cmpl $0x1, %ecx
jne 0x9cc1
movq 0x58(%rbx), %r14
jmp 0x9cca
cmpl $0x2, %ebp
jne 0x9cca
movq 0x68(%rbx), %r14
leaq 0x95c1(%rip), %rsi      # 0x13292
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9dc5
leaq 0x95af(%rip), %rsi      # 0x13297
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9dd6
leaq 0x95c1(%rip), %rsi      # 0x132c0
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9de4
leaq 0x958e(%rip), %rsi      # 0x132a4
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9e05
leaq 0x9570(%rip), %rsi      # 0x1329d
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9e02
leaq 0x956a(%rip), %rsi      # 0x132ae
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9fb9
leaq 0x9558(%rip), %rsi      # 0x132b3
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9e25
leaq 0x9549(%rip), %rsi      # 0x132bb
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9e67
leaq 0x9546(%rip), %rsi      # 0x132cf
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9f66
leaq 0x9525(%rip), %rsi      # 0x132c5
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
jne 0x9df0
movq %rbx, %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x940a
negl %r15d
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *0x20(%rax)
jmp 0x9df0
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *0x20(%rax)
jmp 0x9df0
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *0x28(%rax)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
negl %r15d
movq (%r14), %rax
movq 0x18(%rax), %rax
movq %r14, %rdi
movl %r15d, %esi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
leaq 0x78(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x997f(%rip), %rdx      # 0x137b4
leaq 0x68(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
callq 0x65c6
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
movq %r12, %rcx
callq *0x38(%rax)
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x9eb2
movq 0x78(%rsp), %rsi
jmp 0x9eaa
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x993d(%rip), %rdx      # 0x137b4
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
callq 0x65c6
negl %r15d
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
movq %r12, %rcx
callq *0x38(%rax)
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x9eb2
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x52c0
movq (%r14), %rax
movq %r14, %rdi
callq *0x68(%rax)
cmpl $0x3, %eax
jl 0x9df0
cmpl $0x1, %ebp
jne 0x9f01
leaq 0x58(%rbx), %rcx
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r14, %rsi
callq 0xa35e
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x60(%rbx), %rdi
movups %xmm0, 0x58(%rbx)
jmp 0x9f40
cmpl $0x2, %ebp
jne 0x9df0
leaq 0x68(%rbx), %rcx
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r14, %rsi
callq 0xa35e
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x70(%rbx), %rdi
movups %xmm0, 0x68(%rbx)
testq %rdi, %rdi
je 0x9df0
callq 0x63de
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x9df0
callq 0x63de
jmp 0x9df0
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x983e(%rip), %rdx      # 0x137b4
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x65c6
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq *0x38(%rax)
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x9df0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0x9df0
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movq %rbx, %rdi
movl %eax, %esi
movl %ebp, %edx
callq 0x980a
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xa0ef
movq 0x38(%rsp), %rsi
jmp 0xa014
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xa0ef
movq 0x58(%rsp), %rsi
jmp 0xa014
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0xa0ef
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0xa0ef
movq %rax, %r14
cmpl $0x1, %edx
jne 0xa0ef
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x980a
jmp 0xa0e7
movq %rax, %r14
cmpl $0x2, %edx
jne 0xa05e
movq %r14, %rdi
callq 0x5110
movq %rbx, %rdi
callq 0x974c
cmpl $0x1, %edx
jne 0xa0ef
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x980a
jmp 0xa0e7
jmp 0xa0e7
movq %rax, %r14
cmpl $0x2, %edx
jne 0xa097
movq %r14, %rdi
callq 0x5110
movq %rbx, %rdi
callq 0x974c
cmpl $0x1, %edx
jne 0xa0ef
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x980a
jmp 0xa0e7
jmp 0xa0e7
movq %rax, %r14
cmpl $0x2, %edx
jne 0xa0cc
movq %r14, %rdi
callq 0x5110
movq %rbx, %rdi
callq 0x974c
cmpl $0x1, %edx
jne 0xa0ef
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x980a
jmp 0xa0e7
movq %rax, %r14
callq 0x5430
movq %r14, %rdi
callq 0x5480
nop