// File: cb92[P]Battleship/Game.cpp
// Function: Game::startGame()
void Game::startGame()
{
	std::string nameTemp;
	int autoTemp;

	//set player numbers
	p1.setPlayerNum(1);
	p2.setPlayerNum(2);

	//get player names
	std::cout<<"What is player 1's name (<=32 chars)?\n";
	p1.setName(getString(32));
	std::cout<<"Welcome, "<<p1.getName()<<"!"<<std::endl;

	std::cout<<"What is player 2's name (<=32 chars)?\n";
	p2.setName(getString(32));
	std::cout<<"Welcome, "<<p2.getName()<<"!"<<std::endl;

	//get automatic statuses
	std::cout<<"What type of player is "<<p1.getName()
					<<"? (enter 0 for non-auto, 1 for auto)\n";
	p1.setAuto(getInt(0,1));

	std::cout<<"What type of player is "<<p2.getName()
					<<"? (enter 0 for non-auto, 1 for auto)\n";
	p2.setAuto(getInt(0,1));


	//initialize both boards, according to whether the players are automatic
	if (p1.isPlayerAutomatic())
		initializeBoardAuto(p1Board, false);
	else
	{
		std::cout<<p1.getName()<<", how would you like your board to be set?"
						<<" (enter 0 for non-auto, 1 for auto)\n";
		autoTemp=getInt(0,1);
		if (autoTemp)
			initializeBoardAuto(p1Board, true);
		else initializeBoard(p1Board);

	}

	// if both players are non-auto, clear screen appropriately between fills
	if (!p2.isPlayerAutomatic() && !p1.isPlayerAutomatic())
	{
		switchPlayers(p1.getName(), p2.getName());
	}

	if (p2.isPlayerAutomatic())
		initializeBoardAuto(p2Board, false);
	else
	{
		
		std::cout<<p2.getName()<<", how would you like your board to be set?"
						<<" (enter 0 for non-auto, 1 for auto)\n";
		autoTemp=getInt(0,1);
		if (autoTemp)
			initializeBoardAuto(p2Board, true);
		else initializeBoard(p2Board);

	}
	if (!p2.isPlayerAutomatic() && !p1.isPlayerAutomatic())
	{
		std::cout<<std::string(100,'\n');
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1b0(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2270
movq -0x1b0(%rbp), %rdi
movl $0x1, %esi
callq 0x7ac0
jmp 0x3a26
movq -0x1b0(%rbp), %rdi
addq $0xa8, %rdi
movl $0x2, %esi
callq 0x7ac0
jmp 0x3a40
movq 0x9581(%rip), %rdi      # 0xcfc8
leaq 0x567e(%rip), %rsi      # 0x90cc
callq 0x2180
jmp 0x3a55
movq -0x1b0(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x60(%rbp), %rdi
movl $0x20, %esi
callq 0x7e20
jmp 0x3a73
movq -0x1b8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x7a80
jmp 0x3a85
leaq -0x60(%rbp), %rdi
callq 0x20e0
movq 0x9533(%rip), %rdi      # 0xcfc8
leaq 0x5657(%rip), %rsi      # 0x90f3
callq 0x2180
movq %rax, -0x1c0(%rbp)
jmp 0x3aaa
movq -0x1b0(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x7a10
jmp 0x3abc
movq -0x1c0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x2150
movq %rax, -0x1c8(%rbp)
jmp 0x3ad5
movq -0x1c8(%rbp), %rdi
leaq 0x55b8(%rip), %rsi      # 0x909b
callq 0x2180
movq %rax, -0x1d0(%rbp)
jmp 0x3af1
movq -0x1d0(%rbp), %rdi
movq 0x94b9(%rip), %rsi      # 0xcfb8
callq 0x21b0
jmp 0x3b06
leaq -0x80(%rbp), %rdi
callq 0x20e0
movq 0x94b2(%rip), %rdi      # 0xcfc8
leaq 0x55e0(%rip), %rsi      # 0x90fd
callq 0x2180
jmp 0x3b24
movq -0x1b0(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x1d8(%rbp)
leaq -0xa0(%rbp), %rdi
movl $0x20, %esi
callq 0x7e20
jmp 0x3b4b
movq -0x1d8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x7a80
jmp 0x3b60
leaq -0xa0(%rbp), %rdi
callq 0x20e0
movq 0x9455(%rip), %rdi      # 0xcfc8
leaq 0x5579(%rip), %rsi      # 0x90f3
callq 0x2180
movq %rax, -0x1e0(%rbp)
jmp 0x3b88
movq -0x1b0(%rbp), %rsi
addq $0xa8, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x7a10
jmp 0x3ba4
movq -0x1e0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x2150
movq %rax, -0x1e8(%rbp)
jmp 0x3bc0
movq -0x1e8(%rbp), %rdi
leaq 0x54cd(%rip), %rsi      # 0x909b
callq 0x2180
movq %rax, -0x1f0(%rbp)
jmp 0x3bdc
movq -0x1f0(%rbp), %rdi
movq 0x93ce(%rip), %rsi      # 0xcfb8
callq 0x21b0
jmp 0x3bf1
leaq -0xc0(%rbp), %rdi
callq 0x20e0
movq 0x93c4(%rip), %rdi      # 0xcfc8
leaq 0x5519(%rip), %rsi      # 0x9124
callq 0x2180
movq %rax, -0x1f8(%rbp)
jmp 0x3c19
movq -0x1b0(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x7a10
jmp 0x3c2e
movq -0x1f8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x2150
movq %rax, -0x200(%rbp)
jmp 0x3c4a
movq -0x200(%rbp), %rdi
leaq 0x54e4(%rip), %rsi      # 0x913c
callq 0x2180
jmp 0x3c5f
leaq -0xe0(%rbp), %rdi
callq 0x20e0
movq -0x1b0(%rbp), %rax
movq %rax, -0x210(%rbp)
xorl %edi, %edi
movl $0x1, %esi
callq 0x7bd0
movl %eax, -0x204(%rbp)
jmp 0x3c8d
movq -0x210(%rbp), %rdi
movl -0x204(%rbp), %eax
testl %eax, %eax
setne %al
movzbl %al, %esi
callq 0x7aa0
jmp 0x3ca9
movq 0x9318(%rip), %rdi      # 0xcfc8
leaq 0x546d(%rip), %rsi      # 0x9124
callq 0x2180
movq %rax, -0x218(%rbp)
jmp 0x3cc5
movq -0x1b0(%rbp), %rsi
addq $0xa8, %rsi
leaq -0x100(%rbp), %rdi
callq 0x7a10
jmp 0x3ce1
movq -0x218(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x2150
movq %rax, -0x220(%rbp)
jmp 0x3cfd
movq -0x220(%rbp), %rdi
leaq 0x5431(%rip), %rsi      # 0x913c
callq 0x2180
jmp 0x3d12
leaq -0x100(%rbp), %rdi
callq 0x20e0
movq -0x1b0(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x230(%rbp)
xorl %edi, %edi
movl $0x1, %esi
callq 0x7bd0
movl %eax, -0x224(%rbp)
jmp 0x3d46
movq -0x230(%rbp), %rdi
movl -0x224(%rbp), %eax
testl %eax, %eax
setne %al
movzbl %al, %esi
callq 0x7aa0
jmp 0x3d62
movq -0x1b0(%rbp), %rdi
callq 0x7a40
movb %al, -0x231(%rbp)
jmp 0x3d76
movb -0x231(%rbp), %al
testb $0x1, %al
jne 0x3d85
jmp 0x3e5a
movq -0x1b0(%rbp), %rdi
movq %rdi, %rsi
addq $0x28, %rsi
xorl %edx, %edx
callq 0x4810
jmp 0x3d9c
jmp 0x3f3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4256
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x20e0
jmp 0x4256
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x20e0
jmp 0x4256
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x20e0
jmp 0x4256
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x20e0
jmp 0x4256
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x20e0
jmp 0x4256
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x20e0
jmp 0x4256
movq -0x1b0(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x7a10
jmp 0x3e6f
movq 0x9152(%rip), %rdi      # 0xcfc8
leaq -0x120(%rbp), %rsi
callq 0x2150
movq %rax, -0x240(%rbp)
jmp 0x3e8b
movq -0x240(%rbp), %rdi
leaq 0x52c9(%rip), %rsi      # 0x9162
callq 0x2180
movq %rax, -0x248(%rbp)
jmp 0x3ea7
movq -0x248(%rbp), %rdi
leaq 0x5288(%rip), %rsi      # 0x913d
callq 0x2180
jmp 0x3ebc
leaq -0x120(%rbp), %rdi
callq 0x20e0
xorl %edi, %edi
movl $0x1, %esi
callq 0x7bd0
movl %eax, -0x24c(%rbp)
jmp 0x3edc
movl -0x24c(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x3f24
movq -0x1b0(%rbp), %rdi
movq %rdi, %rsi
addq $0x28, %rsi
movl $0x1, %edx
callq 0x4810
jmp 0x3f05
jmp 0x3f3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x20e0
jmp 0x4256
movq -0x1b0(%rbp), %rdi
movq %rdi, %rsi
addq $0x28, %rsi
callq 0x48d0
jmp 0x3f39
jmp 0x3f3b
jmp 0x3f3d
movq -0x1b0(%rbp), %rdi
addq $0xa8, %rdi
callq 0x7a40
movb %al, -0x24d(%rbp)
jmp 0x3f58
movb -0x24d(%rbp), %al
testb $0x1, %al
jne 0x402a
jmp 0x3f68
movq -0x1b0(%rbp), %rdi
callq 0x7a40
movb %al, -0x24e(%rbp)
jmp 0x3f7c
movb -0x24e(%rbp), %al
testb $0x1, %al
jne 0x402a
jmp 0x3f8c
movq -0x1b0(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x7a10
jmp 0x3fa1
movq -0x1b0(%rbp), %rsi
addq $0xa8, %rsi
leaq -0x160(%rbp), %rdi
callq 0x7a10
jmp 0x3fbd
movq -0x1b0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
leaq -0x160(%rbp), %rdx
callq 0x4660
jmp 0x3fd9
leaq -0x160(%rbp), %rdi
callq 0x20e0
leaq -0x140(%rbp), %rdi
callq 0x20e0
jmp 0x402a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4019
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x20e0
leaq -0x140(%rbp), %rdi
callq 0x20e0
jmp 0x4256
movq -0x1b0(%rbp), %rdi
addq $0xa8, %rdi
callq 0x7a40
movb %al, -0x24f(%rbp)
jmp 0x4045
movb -0x24f(%rbp), %al
testb $0x1, %al
jne 0x4051
jmp 0x4070
movq -0x1b0(%rbp), %rdi
movq %rdi, %rsi
addq $0xd0, %rsi
xorl %edx, %edx
callq 0x4810
jmp 0x406b
jmp 0x4160
movq -0x1b0(%rbp), %rsi
addq $0xa8, %rsi
leaq -0x180(%rbp), %rdi
callq 0x7a10
jmp 0x408c
movq 0x8f35(%rip), %rdi      # 0xcfc8
leaq -0x180(%rbp), %rsi
callq 0x2150
movq %rax, -0x258(%rbp)
jmp 0x40a8
movq -0x258(%rbp), %rdi
leaq 0x50ac(%rip), %rsi      # 0x9162
callq 0x2180
movq %rax, -0x260(%rbp)
jmp 0x40c4
movq -0x260(%rbp), %rdi
leaq 0x506b(%rip), %rsi      # 0x913d
callq 0x2180
jmp 0x40d9
leaq -0x180(%rbp), %rdi
callq 0x20e0
xorl %edi, %edi
movl $0x1, %esi
callq 0x7bd0
movl %eax, -0x264(%rbp)
jmp 0x40f9
movl -0x264(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x4144
movq -0x1b0(%rbp), %rdi
movq %rdi, %rsi
addq $0xd0, %rsi
movl $0x1, %edx
callq 0x4810
jmp 0x4125
jmp 0x415e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x20e0
jmp 0x4256
movq -0x1b0(%rbp), %rdi
movq %rdi, %rsi
addq $0xd0, %rsi
callq 0x48d0
jmp 0x415c
jmp 0x415e
jmp 0x4160
movq -0x1b0(%rbp), %rdi
addq $0xa8, %rdi
callq 0x7a40
movb %al, -0x265(%rbp)
jmp 0x417b
movb -0x265(%rbp), %al
testb $0x1, %al
jne 0x4244
jmp 0x418b
movq -0x1b0(%rbp), %rdi
callq 0x7a40
movb %al, -0x266(%rbp)
jmp 0x419f
movb -0x266(%rbp), %al
testb $0x1, %al
jne 0x4244
jmp 0x41af
leaq -0x1a1(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x22e0
movq -0x270(%rbp), %rcx
leaq -0x1a0(%rbp), %rdi
movl $0x64, %esi
movl $0xa, %edx
callq 0x4ce0
jmp 0x41e1
movq 0x8de0(%rip), %rdi      # 0xcfc8
leaq -0x1a0(%rbp), %rsi
callq 0x2150
jmp 0x41f6
leaq -0x1a0(%rbp), %rdi
callq 0x20e0
leaq -0x1a1(%rbp), %rdi
callq 0x21d0
jmp 0x4244
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4236
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20e0
leaq -0x1a1(%rbp), %rdi
callq 0x21d0
jmp 0x4256
leaq -0x28(%rbp), %rdi
callq 0x20e0
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x20e0
movq -0x38(%rbp), %rdi
callq 0x22d0
nopl (%rax,%rax)