// File: /workspace/github_cpp_makefile_star2_O1/Naomi1745698[P]BigPrac/test.cpp
// Function: test::mapTesting()
void test::mapTesting(){
	space spaceMap(15, playerShip);
	//Starting positon.
	playerShip->setCoordinate(0,0);
	std::cout << "Starting location" << std::endl;
	std::cout << "Row coordinate " << playerShip->getRowCoordinate() << std::endl;
	std::cout << "Col coordinate " << playerShip->getColumnCoordinate() << std::endl << std::endl;
	int initalRow = playerShip->getRowCoordinate();	//Set reference point to determine direction 
	int initalColumn = playerShip->getColumnCoordinate();
	PASS = 0;
 	for(int i = 0; i<4;i++){		//Go into a direction of sqaure to test all movements.
		switch (i) {
			case 0: 
				spaceMap.moveUp();
				std::cout << "MoveUp" << std::endl;
				std::cout << "Row coordinate " << playerShip->getRowCoordinate() << std::endl;
				std::cout << "Col coordinate " << playerShip->getColumnCoordinate() << std::endl << std::endl;
				if(initalColumn+1 == playerShip->getRowCoordinate()){
					PASS++;
				}else{ 	
					std::cout << "ERROR moveUp" << std::endl;
					PASS--;
				}
				break;
			case 3: 
				spaceMap.moveLeft();
				std::cout << "Moveleft" << std::endl;
				std::cout << "Row coordinate " << playerShip->getRowCoordinate() << std::endl;
				std::cout << "Col coordinate " << playerShip->getColumnCoordinate() << std::endl << std::endl;
				if(initalRow == playerShip->getRowCoordinate()){
					PASS++;
				}else{
					std::cout << "ERROR moveLeft" << std::endl;
					PASS--;
				}
				break;
			case 1: 
				spaceMap.moveRight();
				std::cout << "MoveRight" << std::endl;
				std::cout << "Row coordinate " << playerShip->getRowCoordinate() << std::endl;
				std::cout << "Col coordinate " << playerShip->getColumnCoordinate() << std::endl << std::endl;
				if(initalRow+1 == playerShip->getRowCoordinate()){
					PASS++;
				}else{
					std::cout << "ERROR moveRight" << std::endl;
					PASS--;
				}
				break;
			case 2: 
				spaceMap.moveDown();
				std::cout << "MoveDown" << std::endl;
				std::cout << "Row coordinate " << playerShip->getRowCoordinate() << std::endl;
				std::cout << "Col coordinate " << playerShip->getColumnCoordinate() << std::endl << std::endl;
				if(initalColumn == playerShip->getRowCoordinate()){
					PASS++;
				}else{
					std::cout << "ERROR moveDown" << std::endl;
					PASS--;
				}
				break;
			default:

				break;
		}
};

	if(PASS == 4){
		std::cout << "<------------------MOVEMENT CONDITIONS PASSED--------------->" << std::endl;
	};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq 0x20(%rdi), %rdx
leaq 0x20(%rsp), %rdi
movl $0xf, %esi
callq 0x3974
movq 0x20(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3028
movq 0x67f2(%rip), %r14      # 0xcfd8
leaq 0x306c(%rip), %rsi      # 0x9859
movl $0x11, %edx
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq 0x67c0(%rip), %rdi      # 0xcfd8
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq 0x67ac(%rip), %rdi      # 0xcfd8
leaq 0x3038(%rip), %rsi      # 0x986b
movl $0xf, %edx
callq 0x21e0
movq 0x20(%rbx), %rdi
callq 0x304e
movq 0x678b(%rip), %rdi      # 0xcfd8
movl %eax, %esi
callq 0x2290
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq 0x6753(%rip), %rdi      # 0xcfd8
leaq 0x2fef(%rip), %rsi      # 0x987b
movl $0xf, %edx
callq 0x21e0
movq 0x20(%rbx), %rdi
callq 0x3060
movq 0x6732(%rip), %r14      # 0xcfd8
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r15, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r15, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq 0x20(%rbx), %rdi
callq 0x304e
movq %rax, 0x10(%rsp)
movq 0x20(%rbx), %rdi
callq 0x3060
movl %eax, %ecx
movl $0x0, 0x74(%rbx)
movq 0x10(%rsp), %rax
incl %eax
movl %eax, 0xc(%rsp)
movq %rcx, 0x18(%rsp)
leal 0x1(%rcx), %eax
movl %eax, 0x8(%rsp)
xorl %r13d, %r13d
leaq 0x2ecb(%rip), %rbp      # 0x9810
leaq 0x2f2f(%rip), %r15      # 0x987b
cmpl $0x3, %r13d
ja 0x6e6f
movl %r13d, %eax
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
leaq 0x20(%rsp), %rdi
callq 0x50be
movl $0x6, %edx
movq %r14, %rdi
leaq 0x2f0f(%rip), %rsi      # 0x988b
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movl $0xf, %edx
movq %r14, %rdi
leaq 0x2eb4(%rip), %rsi      # 0x986b
callq 0x21e0
movq 0x20(%rbx), %rdi
callq 0x304e
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movl $0xf, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x20(%rbx), %rdi
callq 0x3060
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq 0x20(%rbx), %rdi
callq 0x304e
movl $0xc, %edx
movl $0x1, %r12d
leaq 0x2e07(%rip), %rsi      # 0x9892
cmpl %eax, 0x8(%rsp)
jne 0x6e36
jmp 0x6e6b
leaq 0x20(%rsp), %rdi
callq 0x5256
movl $0x8, %edx
movq %r14, %rdi
leaq 0x2e1e(%rip), %rsi      # 0x98d1
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movl $0xf, %edx
movq %r14, %rdi
leaq 0x2d7d(%rip), %rsi      # 0x986b
callq 0x21e0
movq 0x20(%rbx), %rdi
callq 0x304e
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movl $0xf, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x20(%rbx), %rdi
callq 0x3060
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq 0x20(%rbx), %rdi
callq 0x304e
movl $0xe, %edx
movl $0x1, %r12d
leaq 0x2d18(%rip), %rsi      # 0x98da
cmpl %eax, 0x18(%rsp)
jne 0x6e36
jmp 0x6e6b
leaq 0x20(%rsp), %rdi
callq 0x53e6
movl $0x8, %edx
movq %r14, %rdi
leaq 0x2cb5(%rip), %rsi      # 0x989f
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movl $0xf, %edx
movq %r14, %rdi
leaq 0x2c46(%rip), %rsi      # 0x986b
callq 0x21e0
movq 0x20(%rbx), %rdi
callq 0x304e
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movl $0xf, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x20(%rbx), %rdi
callq 0x3060
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq 0x20(%rbx), %rdi
callq 0x304e
movl $0xe, %edx
movl $0x1, %r12d
leaq 0x2baf(%rip), %rsi      # 0x98a8
cmpl %eax, 0x10(%rsp)
jne 0x6e36
jmp 0x6e6b
leaq 0x20(%rsp), %rdi
callq 0x5576
movl $0x9, %edx
movq %r14, %rdi
leaq 0x2b96(%rip), %rsi      # 0x98b7
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movl $0xf, %edx
movq %r14, %rdi
leaq 0x2b0f(%rip), %rsi      # 0x986b
callq 0x21e0
movq 0x20(%rbx), %rdi
callq 0x304e
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movl $0xf, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x20(%rbx), %rdi
callq 0x3060
movq %r14, %rdi
movl %eax, %esi
callq 0x2290
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r12, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x20d0
movq 0x20(%rbx), %rdi
callq 0x304e
movl $0xf, %edx
movl $0x1, %r12d
leaq 0x2a91(%rip), %rsi      # 0x98c1
cmpl %eax, 0xc(%rsp)
je 0x6e6b
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r14, %rdi
callq 0x2050
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0x20d0
addl %r12d, 0x74(%rbx)
incl %r13d
cmpl $0x4, %r13d
jne 0x694c
cmpl $0x4, 0x74(%rbx)
jne 0x6ec8
movq 0x614f(%rip), %rbx      # 0xcfd8
leaq 0x2a59(%rip), %rsi      # 0x98e9
movl $0x3d, %edx
movq %rbx, %rdi
callq 0x21e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq 0x611d(%rip), %rdi      # 0xcfd8
callq 0x2050
movq %rax, %rdi
callq 0x20d0
leaq 0x20(%rsp), %rdi
callq 0x643c
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6ee7
jmp 0x6ee7
jmp 0x6ee7
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x643c
movq %rbx, %rdi
callq 0x22a0