#include "VerifyMove.cuh"

int getCheck(Piece** board, int kingRow, int kingCol, int color){

	// Loops through the rows
	for(int direction=-1; direction<=1; direction+=2){
		for(int row=kingRow; row<DIM && row>=0; row+=direction){
			if(board[row][kingCol].piece.color==color){
				break;
			}

			else if(board[row][kingCol].piece.isRook || 
				board[row][kingCol].piece.isQueen || 
				(board[row][kingCol].piece.isKing && 
					abs(row-kingRow)==1)){
				return 1;
			}
		}
	}

	// Loops through the cols
	for(int direction=-1; direction<=1; direction+=2){
		for(int col=kingCol; col<DIM && col>=0; col+=direction){
			if(board[kingRow][col].piece.color==color){
				break;
			}

			else if(board[kingRow][col].piece.isRook ||
				board[kingRow][col].piece.isQueen || 
				(board[kingRow][col].piece.isKing && 
					abs(col-kingCol)==1)){
				return 1;
			}
		}
	}

	// Loops through the diagonals
	for(int rowDirection=-1; rowDirection<=1; rowDirection+=2){
		for(int colDirection=-1; colDirection<=1; colDirection+=2){
			for(int row=kingRow, col=kingCol; 
				row>=0 && row<DIM && col>=0 && col<DIM;
				row+=rowDirection, col+=colDirection){

				if(board[row][col].piece.color==color){
					break;
				}

				else if(board[row][col].piece.isBishop || 
					board[row][col].piece.isQueen ||
					(board[row][col].piece.isKing && 
						abs(row-kingRow)==1 && 
						abs(col-kingCol)==1)){

					return 1;
				}
			}
		}
	}

	// Loops through the knights
	for(int row=max(0, kingRow-2); row<=min(DIM-1, kingRow+2); row++){
		for(int col=max(0, kingCol-2); col<=min(DIM-1, kingCol+2); col++){
			if(row==kingRow || col==kingCol || 
				abs(row-kingRow)==abs(col-kingCol)){
				continue;
			}

			else if(board[row][col].piece.isKnight){
				return 1;
			}
		}
	}

	return 0;
}

/**
  *	Gets the change in row
  *	Parameter oldRow: the row to move from
  *	Parameter newRow: the row to move to
  *	Returns: the change in row
  */

int getDeltaRow(int oldRow, int newRow){
	return newRow-oldRow;
}

/**
  *	Gets the change in col
  *	Parameter oldCol: the col to move from
  *	Parameter newCol: the col to move to
  *	Returns: the change in col
  */

int getDeltaCol(int oldCol, int newCol){
	return newCol-oldCol;
}


/**
  *	Checks to make sure the pawn move was valid
  *	Parameter board: the board to check the move from
  *	Parameter oldRow: the row that the pawn moves from
  *	Parameter oldCol: the col that the pawn moves from
  *	Parameter newRow: the row that the pawn moves to
  *	Parameter newCol: the col that the pawn moves to
  *	Parameter color: the color of the pawn to move
  *	Returns: whether or not the move was valid
  */

int isValidPawnMove(Piece** board, int oldRow, int oldCol, int newRow, 
		int newCol, int color){
	
	int deltaRow=getDeltaRow(oldRow, newRow);
	int deltaCol=getDeltaCol(oldCol, newCol);
	int colorFactor=pow(-1, color);

	// Double square advance
	if(deltaRow==2*colorFactor && 
			deltaCol==0 &&
			board[oldRow][oldCol].piece.isFirstMove==1){
		
		return canMoveFromTo(board, oldRow, oldCol, newRow, newCol, 
				color, 0, 0);
	}

	// Single square advance
	else if(deltaRow==1*colorFactor && deltaCol==0){
		return canMoveFromTo(board, oldRow, oldCol, newRow, newCol, 
				color, 0, 0);
	}

	// Take
	else if(deltaRow==1*colorFactor && abs(deltaCol)==1 && 
			hasEnemy(board, newRow, newCol, color)){
		//printf("%d \n", board[newRow][newCol].numberConversion);
		return canMoveFromTo(board, oldRow, oldCol, newRow, newCol, 
				color, 1, 0);
	}

	// Invalid move
	else{
		return 0;
	}
}

/**
  *	Checks to make sure the rook move was valid
  *	Parameter board: the board to check the move on
  *	Parameter oldRow: the row that the rook moves from
  *	Parameter oldCol: the col that the rook moves from
  *	Parameter newRow: the row that the rook moves to
  *	Parameter newCol: the col that the rook moves to
  *	Parameter color: the color of the rook to move
  *	Returns: whether or not the move was valid
  */

int isValidRookMove(Piece** board, int oldRow, int oldCol, int newRow, 
		int newCol, int color){
	
	int deltaRow=getDeltaRow(oldRow, newRow);
	int deltaCol=getDeltaCol(oldCol, newCol);
	
	// If it matches the parrern for a rook's move
	if((deltaRow!=0 && deltaCol==0) || 
			(deltaRow==0 && deltaCol!=0)){
		return canMoveFromTo(board, oldRow, oldCol, newRow, newCol, 
				color, 1, 0);
	}

	// Invalid move pattern
	else{
		return 0;
	}
}

/**
  *	Checks to make sure that the knight move was valid
  *	Parameter board: the board to check the move on
  *	Parameter oldRow: the row that the knight moves from
  *	Parameter oldCol: the col that the knight moves from
  *	Parameter newRow: the row that the knight moves from
  *	Parameter newCol: the col that the knight moves from
  *	Parameter color: the color of the knight to move
  *	Returns: whether or not the knight move was valid
  */

int isValidKnightMove(Piece** board, int oldRow, int oldCol, int newRow, 
		int newCol, int color){

	int deltaRow=getDeltaRow(oldRow, newRow);
	int deltaCol=getDeltaCol(oldCol, newCol);

	// If it matches the pattern for a knight's move
	if((abs(deltaRow)==1 && abs(deltaCol)==2) || 
			(abs(deltaRow)==2 && abs(deltaCol)==1)){
		return canMoveFromTo(board, oldRow, oldCol, newRow, newCol, 
				color, 1, 0);
	}

	// Invalid move pattern
	else{
		return 0;
	}
}

/**
  *	Checks to make sure that the bishop's move was valid
  *	Parameter board: the board to check the move on
  *	Parameter oldRow: the row that the bishop moves from
  *	Parameter oldCol: the col that the bishop moves from
  *	Parameter newRow: the row that the bishop moves to
  *	Parameter newCol: the col that the bishop moves to
  *	Parameter color: the color of the bishop to move
  *	Returns: whether or not the bishop's move was valid
  */

int isValidBishopMove(Piece** board, int oldRow, int oldCol, int newRow, 
		int newCol, int color){

	int deltaRow=getDeltaRow(oldRow, newRow);
	int deltaCol=getDeltaCol(oldCol, newCol);

	// If it matches the pattern for a bishop's move
	if(abs(deltaRow)==abs(deltaCol)){
		return canMoveFromTo(board, oldRow, oldCol, newRow, newCol, 
				color, 1, 0);
	}

	// Invalid move pattern
	else{
		return 0;
	}
}

/**
  *	Checks to make sure that the queen's move was valid
  *	Parameter board: the board to check the move on
  *	Parameter oldRow: the row that the queen moves from
  *	Parameter oldCol: the col that the queen moves from
  *	Parameter newRow: the row that the queen moves to
  *	Parameter newCol: the col that the queen moves to
  *	Parameter color: the color of the queen to move
  *	Returns: whether or not the queen's move was valid
  */

int isValidQueenMove(Piece** board, int oldRow, int oldCol, int newRow, 
		int newCol, int color){
	return isValidRookMove(board, oldRow, oldCol, newRow, newCol, color) ||
		isValidBishopMove(board, oldRow, oldCol, newRow, newCol, 
				color);
}

/**
  *	Checks to make sure that the king's move was valid
  *	Parameter board: the board to check the move on
  *	Parameter oldRow: the row that the king moves from
  *	Parameter oldCol: the col that the king moves from
  *	Parameter newRow: the row that the king moves to
  *	Parameter newCol: the col that the king moves to
  *	Parameter color: the color of the king to move
  *	Returns: whether or not the king's move was valid
  */

int isValidKingMove(Piece** board, int oldRow, int oldCol, int newRow, 
		int newCol, int color){

	int deltaRow=getDeltaRow(oldRow, newRow);
	int deltaCol=getDeltaCol(oldCol, newCol);

	// If it matches the pattern for a king's move
	if((abs(deltaRow)==1 && abs(deltaCol)<=1) || 
			(abs(deltaRow) <=1 && abs(deltaCol)==1)){
		return canMoveFromTo(board, oldRow, oldCol, newRow, newCol, 
				color, 1, 0);
	}

	// If it matches the pattern for a castle
	else if(oldRow==newRow &&
		abs(deltaCol)==2 &&
		board[oldRow][oldCol].piece.isFirstMove &&
		canMoveFromTo(board, oldRow, oldCol, newRow, newCol, color, 
			0, 0) &&
		((deltaCol<0 && board[oldRow][0].piece.isRook && 
			board[oldRow][0].piece.isFirstMove && 
			canMoveFromTo(board, oldRow, 0, newRow, 3, color, 
				0, 0)) ||
		(deltaCol>0 && board[oldRow][7].piece.isRook && 
			board[oldRow][7].piece.isFirstMove && 
			canMoveFromTo(board, oldRow, 7, newRow, 5, color, 
				0, 0)))){

		//Checks for a check between the two (inclusive)
		for(int col=oldCol; col!=newCol+(deltaCol/abs(deltaCol)); col+=(deltaCol/abs(deltaCol))){
			if(getCheck(board, oldRow, col, color)){
				return 0;
			}
		}

		return 1;
	}

	// Invalid move pattern
	else{
		return 0;
	}
}

#include "ChessBoard.cuh"

/**
  *	Checks to see if a move is valid
  *	Parameter board: the board to check the move on
  *	Parameter oldRow: the row that the piece moves from
  *	Parameter oldCol: the col that the piece moves from
  *	Parameter newRow: the row that the piece moves to
  *	Parameter newCol: the col that the piece moves to
  *	Parameter color: the color of the person that's moving
  *	Returns: whether or not the move is valid
  */

int isValidMove(Piece** board, int oldRow, int oldCol, int newRow, int newCol, 
		int color){

	/*printf("OldRow %d, OldCol %d NewRow %d, NewCol %d; ", oldRow, oldCol, newRow, newCol);
	if(verifyBounds(oldRow, oldCol)){
		printf("Valid old bounds ");
		if(verifyBounds(newRow, newCol)){
			printf("Valid new bounds ");
			if(isOccupied(board, oldRow, oldCol)){
				printf("Occupied start position ");
				if(board[oldRow][oldCol].piece.color==color){
					printf("Valid color move ");
					if(!hasObstructions(board, oldRow, oldCol, newRow, newCol)){
						printf("No obstructions. Passed to inside\n");
					}
					else{
						printf("Obstructions found \n");
					}
				}
				else{
					printf("Invalid color move \n");
				}
			}
			else{
				printf("Occupied end position /n");
			}
		}
		else{
			printf("Non-valid new bounds /n");
		}
	}
	else{
		printf("Non-valid old bounds /n");
	}*/

	// Checks if there is a piece at oldRow oldCol that can be moved
	if(verifyBounds(oldRow, oldCol) && verifyBounds(newRow, newCol) && 
			(oldRow!=newRow || oldCol!=newCol) &&
			isOccupied(board, oldRow, oldCol) && 
			board[oldRow][oldCol].piece.color==color){
		
		//printf("Inside\n");

		// Checks each of the pieces
		if(board[oldRow][oldCol].piece.isPawn){
			/*if(newRow==6 && oldCol==newCol){
				printChessBoard(board);
				printf("PAWN oldRow=%d, oldCol=%d, newRow=%d, newCol=%d\n", oldRow, oldCol, newRow, newCol);
			}*/
			return isValidPawnMove(board, oldRow, oldCol, newRow, 
					newCol, color);
		}
		else if(board[oldRow][oldCol].piece.isRook){
			//printf("ROOK\n");
			return isValidRookMove(board, oldRow, oldCol, newRow, 
					newCol, color);
		}
		else if(board[oldRow][oldCol].piece.isKnight){
			//printf("KNIGHT\n");
			return isValidKnightMove(board, oldRow, oldCol, 
					newRow, newCol, color);
		}
		else if(board[oldRow][oldCol].piece.isBishop){
			//printf("BISHOP\n");
			return isValidBishopMove(board, oldRow, oldCol, 
					newRow, newCol, color);
		}
		else if(board[oldRow][oldCol].piece.isQueen){
			//printf("QUEEN\n");
			return isValidQueenMove(board, oldRow, oldCol, 
					newRow, newCol, color);
		}
		else if(board[oldRow][oldCol].piece.isKing){
			//printf("KING\n");
			return isValidKingMove(board, oldRow, oldCol, newRow, 
					newCol, color);
		}
		else{
			printf("");
		}
	}

	return 0;
}

/**
  *	Verifies the bounds of the new position to make sure it is in the board
  *	Parameter row: the row to check the bounds of
  *	Parameter col: the column to check the bounds of
  *	Returns: whether or now newRow and newCol are in the bounds of the board
  */

int verifyBounds(int row, int col){
	return row>=0 && row<DIM && col>=0 && col<DIM;
}

/**
  *	Checks whether or not the square is occupied
  *	Parameter board: the board to check for the occupied square in
  *	Parameter row: the row to check if it is occupied
  *	Parameter col: the col to check if it is occupied
  *	Returns: whether or not the square is occupied
  */

int isOccupied(Piece** board, int row, int col){
	return board[row][col].numberConversion!=0;
}

/**
  *	Checks whether or not the square has an enemy
  *	Parameter board: the board to check for the enemy
  *	Parameter row: the row to check for an enemy
  *	Parameter col: the column to check for an enemy
  *	Parameter color: the color of the side looking for an enemy
  *	Returns: whether or not there is an enemy in row, col
  */

int hasEnemy(Piece** board, int row, int col, int color){
	return board[row][col].numberConversion != 0 && 
		board[row][col].piece.color!=color;
}

/**
  *	Checks if there are obstructions between the start and end
  *	positions
  *	Parameter board: the board to check for obstructions
  *	Parameter oldRow: the row that the piece moves from
  *	Parameter oldCol: the col that the piece moves from
  *	Parameter newRow: the row that the piece moves to
  *	Parameter newCol: the col that the piece moves to
  *	Returns: whether or not there are obstructions between the
  *	start and end positions
  */

int hasObstructions(Piece** board, int oldRow, int oldCol, 
		int newRow, int newCol){
	
	int deltaRow=pow(-1, newRow<oldRow);
	int deltaCol=pow(-1, newCol<oldCol);
	
	// If it moves along the col
	if(oldRow==newRow){
		for(int col=oldCol+deltaCol; col!=newCol; col+=deltaCol){
			if(board[oldRow][col].numberConversion!=0){
				return 1;
			}
		}
	}

	// If it moves along the row
	else if(oldCol==newCol){
		for(int row=oldRow+deltaRow; row!=newRow; row+=deltaRow){
			if(board[row][oldCol].numberConversion!=0){
				return 1;
			}
		}
	}

	// A diagonal
	else if(abs(oldRow-newRow)==abs(oldCol-newCol)){
		for(int row=oldRow+deltaRow, col=oldCol+deltaCol; 
			row!=newRow || col!=newCol; 
			row+=deltaRow, col+=deltaCol){
			if(board[row][col].numberConversion!=0){
				return 1;
			}
		}
	}

	return 0;
}

/**
  *	Checks whether or not the piece can move between the two
  *	locations
  *	Parameter board: the board to check
  *	Parameter oldRow: the old row to check
  *	Parameter oldCol: the old col to check
  *	Parameter newRow: the new row to check
  *	Parameter newCol: the new col to check
  *	Return: whether or not the move can be made
  */

int canMoveFromTo(Piece** board, int oldRow, int oldCol, int newRow, 
		int newCol, int color, int canTake, int canJump){

	return verifyBounds(oldRow, oldCol) && 
		verifyBounds(newRow, newCol) &&
		((canTake && hasEnemy(board, newRow, newCol, color)) ||
		!isOccupied(board, newRow, newCol)) &&
		(canJump || !hasObstructions(board, oldRow, oldCol, 
					     newRow, newCol));
}



	.file	"tmpxft_0021a1f8_00000000-6_VerifyMove.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2044:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2044:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z8getCheckPP1piii
	.type	_Z8getCheckPP1piii, @function
_Z8getCheckPP1piii:
.LFB2027:
	.cfi_startproc
	endbr64
	movslq	%edx, %r8
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%ecx, %r9d
	orq	$-1, %r11
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	salq	$2, %r8
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%esi, %rbx
.L3:
	movq	%rbx, %rcx
.L9:
	movl	%ecx, %r10d
	cmpl	$7, %ecx
	ja	.L4
	movq	(%rdi,%rcx,8), %rax
	addq	%r8, %rax
	movb	(%rax), %al
	movl	%eax, %ebp
	andl	$1, %ebp
	cmpl	%r9d, %ebp
	je	.L4
	testb	$72, %al
	jne	.L31
	testb	%al, %al
	jns	.L6
	subl	%esi, %r10d
	movl	%r10d, %eax
	negl	%eax
	cmovs	%r10d, %eax
	cmpl	$1, %eax
	je	.L2
.L6:
	addq	%r11, %rcx
	jmp	.L9
.L4:
	addq	$2, %r11
	cmpq	$3, %r11
	jne	.L3
	leaq	(%rdi,%rbx,8), %r12
	movq	$-4, %rbp
	orl	$-1, %r11d
.L13:
	movq	%r8, %r10
	xorl	%ecx, %ecx
.L15:
	leal	(%rcx,%rdx), %eax
	cmpl	$7, %eax
	ja	.L10
	movq	(%r12), %rax
	addq	%r10, %rax
	movb	(%rax), %al
	movl	%eax, %r13d
	andl	$1, %r13d
	cmpl	%r9d, %r13d
	je	.L10
	testb	$72, %al
	jne	.L31
	testb	%al, %al
	jns	.L11
	movl	%ecx, %eax
	negl	%eax
	cmovs	%ecx, %eax
	cmpl	$1, %eax
	je	.L2
.L11:
	addl	%r11d, %ecx
	addq	%rbp, %r10
	jmp	.L15
.L10:
	addq	$8, %rbp
	decl	%r11d
	jne	.L29
	orq	$-1, %r11
	jmp	.L14
.L29:
	movl	$1, %r11d
	jmp	.L13
.L14:
	movq	$-4, %r12
	orl	$-1, %ebp
.L22:
	movq	%r8, %r13
	movq	%rbx, %r10
	xorl	%ecx, %ecx
.L20:
	leal	(%rcx,%rdx), %eax
	movl	%r10d, %r14d
	orl	%r10d, %eax
	cmpl	$7, %eax
	ja	.L16
	movq	(%rdi,%r10,8), %rax
	addq	%r13, %rax
	movb	(%rax), %al
	movl	%eax, %r15d
	andl	$1, %r15d
	cmpl	%r9d, %r15d
	je	.L16
	testb	$96, %al
	jne	.L31
	testb	%al, %al
	jns	.L17
	subl	%esi, %r14d
	movl	%r14d, %eax
	negl	%eax
	cmovs	%r14d, %eax
	decl	%eax
	jne	.L17
	movl	%ecx, %eax
	negl	%eax
	cmovs	%ecx, %eax
	cmpl	$1, %eax
	je	.L2
.L17:
	addq	%r11, %r10
	addl	%ebp, %ecx
	addq	%r12, %r13
	jmp	.L20
.L16:
	addq	$8, %r12
	decl	%ebp
	je	.L19
	movl	$1, %ebp
	jmp	.L22
.L19:
	addq	$2, %r11
	cmpq	$3, %r11
	jne	.L14
	leal	-2(%rsi), %eax
	xorl	%ecx, %ecx
	leal	-2(%rdx), %r9d
	testl	%eax, %eax
	cmovs	%ecx, %eax
	testl	%r9d, %r9d
	cmovs	%ecx, %r9d
	cltq
	movslq	%r9d, %r10
	salq	$2, %r10
.L23:
	leal	2(%rsi), %ecx
	movl	$7, %r8d
	movl	%eax, %ebp
	cmpl	%r8d, %ecx
	cmovg	%r8d, %ecx
	cmpl	%eax, %ecx
	jl	.L44
	movl	%eax, %r8d
	movq	%r10, %r11
	movl	%r9d, %ecx
	subl	%esi, %r8d
	movl	%r8d, %ebx
	negl	%ebx
	cmovs	%r8d, %ebx
.L26:
	leal	2(%rdx), %r8d
	movl	$7, %r12d
	cmpl	%r12d, %r8d
	cmovg	%r12d, %r8d
	cmpl	%r8d, %ecx
	jg	.L45
	cmpl	%ebp, %esi
	je	.L24
	cmpl	%edx, %ecx
	je	.L24
	movl	%ecx, %r12d
	subl	%edx, %r12d
	movl	%r12d, %r8d
	negl	%r8d
	cmovs	%r12d, %r8d
	cmpl	%r8d, %ebx
	je	.L24
	movq	(%rdi,%rax,8), %r8
	testb	$16, (%r8,%r11)
	jne	.L31
.L24:
	incl	%ecx
	addq	$4, %r11
	jmp	.L26
.L45:
	incq	%rax
	jmp	.L23
.L44:
	xorl	%eax, %eax
	jmp	.L2
.L31:
	movl	$1, %eax
.L2:
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z8getCheckPP1piii, .-_Z8getCheckPP1piii
	.globl	_Z11getDeltaRowii
	.type	_Z11getDeltaRowii, @function
_Z11getDeltaRowii:
.LFB2028:
	.cfi_startproc
	endbr64
	movl	%esi, %eax
	subl	%edi, %eax
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z11getDeltaRowii, .-_Z11getDeltaRowii
	.globl	_Z11getDeltaColii
	.type	_Z11getDeltaColii, @function
_Z11getDeltaColii:
.LFB2188:
	.cfi_startproc
	endbr64
	movl	%esi, %eax
	subl	%edi, %eax
	ret
	.cfi_endproc
.LFE2188:
	.size	_Z11getDeltaColii, .-_Z11getDeltaColii
	.globl	_Z12verifyBoundsii
	.type	_Z12verifyBoundsii, @function
_Z12verifyBoundsii:
.LFB2037:
	.cfi_startproc
	endbr64
	orl	%esi, %edi
	xorl	%eax, %eax
	cmpl	$7, %edi
	setbe	%al
	ret
	.cfi_endproc
.LFE2037:
	.size	_Z12verifyBoundsii, .-_Z12verifyBoundsii
	.globl	_Z10isOccupiedPP1pii
	.type	_Z10isOccupiedPP1pii, @function
_Z10isOccupiedPP1pii:
.LFB2038:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	movslq	%edx, %rdx
	movq	(%rdi,%rsi,8), %rax
	cmpl	$0, (%rax,%rdx,4)
	setne	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE2038:
	.size	_Z10isOccupiedPP1pii, .-_Z10isOccupiedPP1pii
	.globl	_Z8hasEnemyPP1piii
	.type	_Z8hasEnemyPP1piii, @function
_Z8hasEnemyPP1piii:
.LFB2039:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	movslq	%edx, %rdx
	movq	(%rdi,%rsi,8), %rax
	leaq	(%rax,%rdx,4), %rdx
	xorl	%eax, %eax
	cmpl	$0, (%rdx)
	je	.L51
	movb	(%rdx), %al
	andl	$1, %eax
	cmpl	%ecx, %eax
	setne	%al
.L51:
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE2039:
	.size	_Z8hasEnemyPP1piii, .-_Z8hasEnemyPP1piii
	.globl	_Z15hasObstructionsPP1piiii
	.type	_Z15hasObstructionsPP1piiii, @function
_Z15hasObstructionsPP1piiii:
.LFB2040:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movslq	%ecx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movslq	%r8d, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edx, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	cmpl	%esi, %r13d
	movsd	.LC0(%rip), %xmm0
	setl	%al
	cvtsi2sdl	%eax, %xmm1
	call	pow@PLT
	xorl	%eax, %eax
	cmpl	%ebx, %r12d
	setl	%al
	movsd	%xmm0, 8(%rsp)
	movsd	.LC0(%rip), %xmm0
	cvtsi2sdl	%eax, %xmm1
	call	pow@PLT
	cmpl	%r14d, %r13d
	movsd	8(%rsp), %xmm2
	cvttsd2sil	%xmm0, %ecx
	jne	.L54
	addl	%ecx, %ebx
	movslq	%ecx, %rdx
	leaq	0(%rbp,%r13,8), %rsi
	movslq	%ebx, %rax
	salq	$2, %rdx
	salq	$2, %rax
.L55:
	cmpl	%r12d, %ebx
	je	.L69
	movq	(%rsi), %rdi
	movl	(%rdi,%rax), %edi
	addq	%rdx, %rax
	testl	%edi, %edi
	jne	.L66
	addl	%ecx, %ebx
	jmp	.L55
.L54:
	cvttsd2sil	%xmm2, %edx
	cmpl	%ebx, %r12d
	jne	.L58
	movslq	%edx, %rax
	addl	%r14d, %edx
	salq	$2, %r12
	movslq	%edx, %rdx
.L59:
	cmpl	%edx, %r13d
	je	.L69
	movq	0(%rbp,%rdx,8), %rcx
	addq	%rax, %rdx
	cmpl	$0, (%rcx,%r12)
	je	.L59
	jmp	.L66
.L58:
	movl	%r14d, %eax
	subl	%r13d, %eax
	movl	%eax, %edi
	negl	%edi
	cmovs	%eax, %edi
	movl	%ebx, %eax
	subl	%r12d, %eax
	movl	%eax, %esi
	negl	%esi
	cmovs	%eax, %esi
	xorl	%eax, %eax
	cmpl	%esi, %edi
	jne	.L53
	addl	%ecx, %ebx
	leal	(%r14,%rdx), %eax
	movslq	%edx, %rdi
	movslq	%ecx, %rsi
	movslq	%ebx, %rdx
	cltq
	salq	$2, %rsi
	salq	$2, %rdx
.L61:
	cmpl	%eax, %r13d
	je	.L70
.L62:
	movq	0(%rbp,%rax,8), %r8
	addq	%rdi, %rax
	movl	(%r8,%rdx), %r8d
	addq	%rsi, %rdx
	testl	%r8d, %r8d
	jne	.L66
	addl	%ecx, %ebx
	jmp	.L61
.L70:
	cmpl	%r12d, %ebx
	jne	.L62
.L69:
	xorl	%eax, %eax
	jmp	.L53
.L66:
	movl	$1, %eax
.L53:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2040:
	.size	_Z15hasObstructionsPP1piiii, .-_Z15hasObstructionsPP1piiii
	.globl	_Z13canMoveFromToPP1piiiiiii
	.type	_Z13canMoveFromToPP1piiiiiii, @function
_Z13canMoveFromToPP1piiiiiii:
.LFB2041:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %r11
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%esi, %ebx
	movl	%edx, %esi
	xorl	%edx, %edx
	pushq	%r10
	.cfi_def_cfa_offset 32
	movl	%ebx, %edi
	call	_Z12verifyBoundsii
	testl	%eax, %eax
	je	.L72
	movl	%r8d, %esi
	movl	%ecx, %edi
	movl	%ecx, %r10d
	call	_Z12verifyBoundsii
	testl	%eax, %eax
	je	.L72
	cmpl	$0, 32(%rsp)
	je	.L73
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movl	%r10d, %esi
	movq	%r11, %rdi
	call	_Z8hasEnemyPP1piii
	testl	%eax, %eax
	jne	.L74
.L73:
	movl	%r8d, %edx
	movl	%r10d, %esi
	movq	%r11, %rdi
	call	_Z10isOccupiedPP1pii
	xorl	%edx, %edx
	testl	%eax, %eax
	jne	.L72
.L74:
	cmpl	$0, 40(%rsp)
	movb	$1, %dl
	jne	.L72
	movl	%ebp, %edx
	movl	%r10d, %ecx
	movl	%ebx, %esi
	movq	%r11, %rdi
	call	_Z15hasObstructionsPP1piiii
	testl	%eax, %eax
	sete	%dl
.L72:
	movzbl	%dl, %eax
	popq	%rdx
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2041:
	.size	_Z13canMoveFromToPP1piiiiiii, .-_Z13canMoveFromToPP1piiiiiii
	.globl	_Z15isValidPawnMovePP1piiiii
	.type	_Z15isValidPawnMovePP1piiiii, @function
_Z15isValidPawnMovePP1piiiii:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	cvtsi2sdl	%r9d, %xmm1
	movl	%ecx, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%r8d, %r14d
	subl	%esi, %r15d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	subl	%edx, %r14d
	movl	%ecx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movsd	.LC0(%rip), %xmm0
	movl	%r8d, 12(%rsp)
	movl	%r9d, 8(%rsp)
	call	pow@PLT
	testl	%r14d, %r14d
	movl	8(%rsp), %r9d
	movl	12(%rsp), %r8d
	cvttsd2sil	%xmm0, %edx
	sete	%sil
	leal	(%rdx,%rdx), %eax
	cmpl	%r15d, %eax
	jne	.L86
	testb	%sil, %sil
	je	.L86
	movslq	%ebp, %rcx
	movslq	%r12d, %rax
	movq	(%rbx,%rcx,8), %rcx
	testb	$2, (%rcx,%rax,4)
	je	.L86
.L88:
	pushq	$0
	.cfi_remember_state
	.cfi_def_cfa_offset 88
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	%ebp, %esi
	pushq	$0
	.cfi_def_cfa_offset 96
	movq	%rbx, %rdi
	jmp	.L109
.L86:
	.cfi_restore_state
	cmpl	%edx, %r15d
	jne	.L92
	testb	%sil, %sil
	jne	.L88
.L92:
	xorl	%eax, %eax
	cmpl	%edx, %r15d
	jne	.L85
	movl	%r14d, %edx
	negl	%edx
	cmovs	%r14d, %edx
	decl	%edx
	jne	.L85
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movl	%r13d, %esi
	movq	%rbx, %rdi
	call	_Z8hasEnemyPP1piii
	testl	%eax, %eax
	je	.L85
	pushq	$0
	.cfi_def_cfa_offset 88
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	%ebp, %esi
	pushq	$1
	.cfi_def_cfa_offset 96
.L109:
	call	_Z13canMoveFromToPP1piiiiiii
	popq	%rdx
	.cfi_def_cfa_offset 88
	popq	%rcx
	.cfi_def_cfa_offset 80
.L85:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z15isValidPawnMovePP1piiiii, .-_Z15isValidPawnMovePP1piiiii
	.globl	_Z17isValidKnightMovePP1piiiii
	.type	_Z17isValidKnightMovePP1piiiii, @function
_Z17isValidKnightMovePP1piiiii:
.LFB2032:
	.cfi_startproc
	endbr64
	movl	%ecx, %eax
	movl	%edx, %r11d
	movl	%r8d, %edx
	subl	%esi, %eax
	subl	%r11d, %edx
	movl	%eax, %r10d
	negl	%r10d
	cmovs	%eax, %r10d
	cmpl	$1, %r10d
	jne	.L111
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	cmpl	$2, %eax
	je	.L112
	xorl	%eax, %eax
	ret
.L111:
	xorl	%eax, %eax
	cmpl	$2, %r10d
	jne	.L120
	movl	%edx, %eax
	negl	%eax
	cmovns	%eax, %edx
	xorl	%eax, %eax
	decl	%edx
	jne	.L120
.L112:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	%r11d, %edx
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	call	_Z13canMoveFromToPP1piiiiiii
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
.L120:
	ret
	.cfi_endproc
.LFE2032:
	.size	_Z17isValidKnightMovePP1piiiii, .-_Z17isValidKnightMovePP1piiiii
	.globl	_Z15isValidKingMovePP1piiiii
	.type	_Z15isValidKingMovePP1piiiii, @function
_Z15isValidKingMovePP1piiiii:
.LFB2035:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%ecx, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	subl	%esi, %eax
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%r8d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%r8d, %ebx
	subl	%edx, %ebx
	movl	%eax, %edx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	negl	%edx
	cmovs	%eax, %edx
	movl	%r9d, 12(%rsp)
	decl	%edx
	jne	.L123
	leal	1(%rbx), %eax
	cmpl	$2, %eax
	jbe	.L124
	jmp	.L125
.L123:
	incl	%eax
	cmpl	$2, %eax
	ja	.L125
	movl	%ebx, %eax
	negl	%eax
	cmovs	%ebx, %eax
	decl	%eax
	jne	.L125
.L124:
	pushq	$0
	.cfi_def_cfa_offset 88
	movl	%r13d, %r8d
	movl	%r12d, %edx
	movl	%ebp, %esi
	pushq	$1
	.cfi_def_cfa_offset 96
	movl	28(%rsp), %r9d
	movq	%r14, %rdi
	call	_Z13canMoveFromToPP1piiiiiii
	popq	%r8
	.cfi_def_cfa_offset 88
	popq	%r9
	.cfi_def_cfa_offset 80
	jmp	.L122
.L125:
	cmpl	%ecx, %ebp
	je	.L127
.L128:
	xorl	%eax, %eax
	jmp	.L122
.L127:
	movl	%ebx, %eax
	negl	%eax
	cmovs	%ebx, %eax
	cmpl	$2, %eax
	jne	.L128
	movslq	%ebp, %rax
	movq	(%r14,%rax,8), %r15
	movslq	%r12d, %rax
	testb	$2, (%r15,%rax,4)
	je	.L128
	pushq	$0
	.cfi_def_cfa_offset 88
	movl	%ebp, %esi
	movq	%r14, %rdi
	movl	%r13d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 96
	movl	28(%rsp), %r9d
	movl	%ebp, %ecx
	movl	%r12d, %edx
	call	_Z13canMoveFromToPP1piiiiiii
	popq	%rsi
	.cfi_def_cfa_offset 88
	popq	%rdi
	.cfi_def_cfa_offset 80
	testl	%eax, %eax
	je	.L128
	testl	%ebx, %ebx
	jns	.L129
	movb	(%r15), %al
	notl	%eax
	testb	$10, %al
	jne	.L128
	pushq	$0
	.cfi_def_cfa_offset 88
	movl	$3, %r8d
	movl	%ebp, %ecx
	xorl	%edx, %edx
	pushq	$0
	.cfi_def_cfa_offset 96
	movl	28(%rsp), %r9d
.L143:
	movl	%ebp, %esi
	movq	%r14, %rdi
	call	_Z13canMoveFromToPP1piiiiiii
	popq	%rdx
	.cfi_def_cfa_offset 88
	popq	%rcx
	.cfi_def_cfa_offset 80
	testl	%eax, %eax
	je	.L128
	sarl	$31, %ebx
	orl	$1, %ebx
	addl	%ebx, %r13d
	jmp	.L130
.L129:
	movb	28(%r15), %al
	notl	%eax
	testb	$10, %al
	jne	.L128
	pushq	$0
	.cfi_remember_state
	.cfi_def_cfa_offset 88
	movl	$5, %r8d
	movl	%ebp, %ecx
	movl	$7, %edx
	pushq	$0
	.cfi_def_cfa_offset 96
	movl	28(%rsp), %r9d
	jmp	.L143
.L132:
	.cfi_restore_state
	movl	12(%rsp), %ecx
	movl	%r12d, %edx
	movl	%ebp, %esi
	movq	%r14, %rdi
	call	_Z8getCheckPP1piii
	testl	%eax, %eax
	jne	.L128
	addl	%ebx, %r12d
.L130:
	cmpl	%r12d, %r13d
	jne	.L132
	movl	$1, %eax
.L122:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2035:
	.size	_Z15isValidKingMovePP1piiiii, .-_Z15isValidKingMovePP1piiiii
	.globl	_Z15isValidRookMovePP1piiiii
	.type	_Z15isValidRookMovePP1piiiii, @function
_Z15isValidRookMovePP1piiiii:
.LFB2031:
	.cfi_startproc
	endbr64
	cmpl	%ecx, %esi
	setne	%r11b
	cmpl	%r8d, %edx
	setne	%r10b
	cmpb	%r10b, %r11b
	je	.L147
	pushq	%rax
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	call	_Z13canMoveFromToPP1piiiiiii
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
.L147:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z15isValidRookMovePP1piiiii, .-_Z15isValidRookMovePP1piiiii
	.globl	_Z17isValidBishopMovePP1piiiii
	.type	_Z17isValidBishopMovePP1piiiii, @function
_Z17isValidBishopMovePP1piiiii:
.LFB2033:
	.cfi_startproc
	endbr64
	movl	%ecx, %eax
	subl	%esi, %eax
	movl	%eax, %r11d
	negl	%r11d
	cmovs	%eax, %r11d
	movl	%r8d, %eax
	subl	%edx, %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovs	%eax, %r10d
	cmpl	%r10d, %r11d
	jne	.L155
	pushq	%rax
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	call	_Z13canMoveFromToPP1piiiiiii
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
.L155:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE2033:
	.size	_Z17isValidBishopMovePP1piiiii, .-_Z17isValidBishopMovePP1piiiii
	.globl	_Z16isValidQueenMovePP1piiiii
	.type	_Z16isValidQueenMovePP1piiiii, @function
_Z16isValidQueenMovePP1piiiii:
.LFB2034:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%edx, %r12d
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movl	%r9d, 28(%rsp)
	movl	%r8d, 24(%rsp)
	movl	%ecx, 20(%rsp)
	movl	%esi, 16(%rsp)
	movq	%rdi, 8(%rsp)
	call	_Z15isValidRookMovePP1piiiii
	movq	8(%rsp), %rdi
	movl	16(%rsp), %esi
	movl	%eax, %edx
	movl	20(%rsp), %ecx
	movl	24(%rsp), %r8d
	movb	$1, %al
	testl	%edx, %edx
	movl	28(%rsp), %r9d
	jne	.L161
	movl	%r12d, %edx
	call	_Z17isValidBishopMovePP1piiiii
	testl	%eax, %eax
	setne	%al
.L161:
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movzbl	%al, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2034:
	.size	_Z16isValidQueenMovePP1piiiii, .-_Z16isValidQueenMovePP1piiiii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	""
	.text
	.globl	_Z11isValidMovePP1piiiii
	.type	_Z11isValidMovePP1piiiii, @function
_Z11isValidMovePP1piiiii:
.LFB2036:
	.cfi_startproc
	endbr64
	movl	%esi, %r10d
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movq	%rdi, %r11
	movl	%edx, %esi
	movl	%r10d, %edi
	call	_Z12verifyBoundsii
	testl	%eax, %eax
	je	.L168
	movl	%r8d, %esi
	movl	%ecx, %edi
	call	_Z12verifyBoundsii
	testl	%eax, %eax
	je	.L168
	cmpl	%ecx, %r10d
	jne	.L176
	cmpl	%r8d, %edx
	je	.L168
.L176:
	movl	%r10d, %esi
	movq	%r11, %rdi
	movl	%edx, 12(%rsp)
	call	_Z10isOccupiedPP1pii
	testl	%eax, %eax
	je	.L168
	movslq	%r10d, %rsi
	movslq	12(%rsp), %rax
	movq	(%r11,%rsi,8), %rsi
	movq	%rax, %rdx
	movb	(%rsi,%rax,4), %al
	movl	%eax, %esi
	andl	$1, %esi
	cmpl	%r9d, %esi
	jne	.L168
	testb	$4, %al
	je	.L170
	movl	%r10d, %esi
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	_Z15isValidPawnMovePP1piiiii
.L170:
	.cfi_restore_state
	testb	$8, %al
	je	.L171
	movl	%r10d, %esi
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	_Z15isValidRookMovePP1piiiii
.L171:
	.cfi_restore_state
	testb	$16, %al
	je	.L172
	movl	%r10d, %esi
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	_Z17isValidKnightMovePP1piiiii
.L172:
	.cfi_restore_state
	testb	$32, %al
	je	.L173
	movl	%r10d, %esi
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	_Z17isValidBishopMovePP1piiiii
.L173:
	.cfi_restore_state
	testb	$64, %al
	je	.L174
	movl	%r10d, %esi
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	_Z16isValidQueenMovePP1piiiii
.L174:
	.cfi_restore_state
	testb	%al, %al
	jns	.L175
	movl	%r10d, %esi
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	_Z15isValidKingMovePP1piiiii
.L175:
	.cfi_restore_state
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L168:
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2036:
	.size	_Z11isValidMovePP1piiiii, .-_Z11isValidMovePP1piiiii
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2067:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2067:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	-1074790400
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#ifndef VERIFYMOVE
#define VERIFYMOVE

#include <math.h>
#include <stdio.h>

#include "ChessBoard.cuh"

int canMoveFromTo(Piece** board, int oldRow, int oldCol, int newRow, 
		int newCol, int color, int canTake, int canJump);

int isValidMove(Piece** board, int oldRow, int oldCol, int newRow, int newCol, 
		int color);

int verifyBounds(int row, int col);

int isOccupied(Piece** board, int row, int col);

int hasEnemy(Piece** board, int row, int col, int color);

int hasObstructions(Piece** board, int oldRow, int oldCol, int newRow, 
	int newCol);

#endif

	.text
	.file	"VerifyMove.hip"
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
