// File: /workspace/github_cpp_makefile_star2_O1/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 0x9c0f
movq 0x58(%rbx), %r14
jmp 0x9c18
cmpl $0x2, %ebp
jne 0x9c18
movq 0x68(%rbx), %r14
leaq 0x9673(%rip), %rsi      # 0x13292
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9d13
leaq 0x9661(%rip), %rsi      # 0x13297
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9d24
leaq 0x9673(%rip), %rsi      # 0x132c0
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9d32
leaq 0x9640(%rip), %rsi      # 0x132a4
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9d53
leaq 0x9622(%rip), %rsi      # 0x1329d
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9d50
leaq 0x961c(%rip), %rsi      # 0x132ae
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9f03
leaq 0x960a(%rip), %rsi      # 0x132b3
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9d73
leaq 0x95fb(%rip), %rsi      # 0x132bb
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9db5
leaq 0x95f8(%rip), %rsi      # 0x132cf
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
je 0x9eb0
leaq 0x95d7(%rip), %rsi      # 0x132c5
movq %r12, %rdi
callq 0x50b0
testl %eax, %eax
jne 0x9d3e
movq %rbx, %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x935a
negl %r15d
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *0x20(%rax)
jmp 0x9d3e
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *0x20(%rax)
jmp 0x9d3e
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 0x99e9(%rip), %rdx      # 0x1376c
leaq 0x68(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
callq 0x65a0
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 0x9e00
movq 0x78(%rsp), %rsi
jmp 0x9df8
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x99a7(%rip), %rdx      # 0x1376c
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
callq 0x65a0
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 0x9e00
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x52c0
movq (%r14), %rax
movq %r14, %rdi
callq *0x68(%rax)
cmpl $0x3, %eax
jl 0x9d3e
cmpl $0x1, %ebp
jne 0x9e4f
leaq 0x58(%rbx), %rcx
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r14, %rsi
callq 0xa2b6
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x60(%rbx), %rdi
movups %xmm0, 0x58(%rbx)
jmp 0x9e8e
cmpl $0x2, %ebp
jne 0x9d3e
leaq 0x68(%rbx), %rcx
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r14, %rsi
callq 0xa2b6
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x70(%rbx), %rdi
movups %xmm0, 0x68(%rbx)
testq %rdi, %rdi
je 0x9e98
callq 0x63c0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x9d3e
callq 0x63c0
jmp 0x9d3e
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x98ac(%rip), %rdx      # 0x1376c
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x65a0
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 0x9d3e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0x9d3e
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movq %rbx, %rdi
movl %eax, %esi
movl %ebp, %edx
callq 0x9758
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xa039
movq 0x38(%rsp), %rsi
jmp 0x9f5e
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xa039
movq 0x58(%rsp), %rsi
jmp 0x9f5e
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0xa039
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x52c0
jmp 0xa039
movq %rax, %r14
cmpl $0x1, %edx
jne 0xa039
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x9758
jmp 0xa031
movq %rax, %r14
cmpl $0x2, %edx
jne 0x9fa8
movq %r14, %rdi
callq 0x5110
movq %rbx, %rdi
callq 0x969a
cmpl $0x1, %edx
jne 0xa039
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x9758
jmp 0xa031
jmp 0xa031
movq %rax, %r14
cmpl $0x2, %edx
jne 0x9fe1
movq %r14, %rdi
callq 0x5110
movq %rbx, %rdi
callq 0x969a
cmpl $0x1, %edx
jne 0xa039
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x9758
jmp 0xa031
jmp 0xa031
movq %rax, %r14
cmpl $0x2, %edx
jne 0xa016
movq %r14, %rdi
callq 0x5110
movq %rbx, %rdi
callq 0x969a
cmpl $0x1, %edx
jne 0xa039
movq %r14, %rdi
callq 0x5110
movl (%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x9758
jmp 0xa031
movq %rax, %r14
callq 0x5430
movq %r14, %rdi
callq 0x5480
nop