#include <stdio.h>
#include <sys/time.h>
#include <time.h>


#define GO_EMPTY 0
#define GO_BLACK 1
#define GO_WHITE 2
#define GO_BORDER 3

 
const int boardSize = 21; 
const int totalSize = boardSize * boardSize;


struct BoardPoint{
  int color;
  int groupID;
  int libertyNumber;
  bool isBlackLegal;
  bool isWhiteLegal;
};

struct DebugFlag{
  int counter;
  int changeFlag;
  int targetGroupID[4];
  int libertyCount;
};
 
__global__
void initBoard(BoardPoint *boardDevice){
 
  int index = threadIdx.y * boardSize + threadIdx.x;

  if (threadIdx.x == 0 || threadIdx.x == boardSize-1 || threadIdx.y == 0 || threadIdx.y == boardSize-1){
    boardDevice[index].color = 3;
  } else {
    boardDevice[index].color = 0;
  }

  //boardDevice[index].groupID = totalSize; // all the initial group ID was set to none group id.

}

__device__

inline void updateLiberty(BoardPoint *boardDevice, int index, int *globalLiberty){
   if (boardDevice[index].color == GO_EMPTY){

    atomicAdd(&globalLiberty[boardDevice[index-1].groupID], 1);
  
    if (boardDevice[index+boardSize].groupID != boardDevice[index-1].groupID){
      atomicAdd(&globalLiberty[boardDevice[index+boardSize].groupID], 1);
    } 

    if (boardDevice[index+1].groupID != boardDevice[index-1].groupID &&
        boardDevice[index+1].groupID != boardDevice[index+boardSize].groupID){
      atomicAdd(&globalLiberty[boardDevice[index+1].groupID], 1);
    } 

    if (boardDevice[index-boardSize].groupID != boardDevice[index-1].groupID &&
        boardDevice[index-boardSize].groupID != boardDevice[index+1].groupID &&
        boardDevice[index-boardSize].groupID != boardDevice[index+boardSize].groupID){
      atomicAdd(&globalLiberty[boardDevice[index-boardSize].groupID], 1);
    } 

  }
}

__global__
void playBoard(BoardPoint *boardDevice, DebugFlag *debugFlagDevice, int row, int col, int color){
  int index = threadIdx.y*boardSize + threadIdx.x;
  int playPoint = row*boardSize + col;

  __shared__ int globalLiberty[totalSize]; // shared array to count the liberty of each group.
  __shared__ int targetGroupID[4] ;
  __shared__ bool hasStoneRemoved;


  if (threadIdx.y == 0 || threadIdx.y == boardSize || threadIdx.x == 0 || threadIdx.x == boardSize){
    globalLiberty[0] = 0;
    return;
  }


  if (index == playPoint){
      boardDevice[index].color = color;
      boardDevice[index].groupID = index;

      if (boardDevice[index+1].color == color){
        targetGroupID[0] = boardDevice[index+1].groupID;
      }else{
        targetGroupID[0] = -1;
      }

      if (boardDevice[index-1].color == color){
        targetGroupID[1] = boardDevice[index-1].groupID;
      }else{
        targetGroupID[1] = -1;
      }
      
      if (boardDevice[index+boardSize].color == color){
        targetGroupID[2] = boardDevice[index+boardSize].groupID;
      }else{
        targetGroupID[2] = -1;
      }

      if (boardDevice[index-boardSize].color == color){
        targetGroupID[3] = boardDevice[index-boardSize].groupID;
      }else{
        targetGroupID[3] = -1;
      }

  }

  __syncthreads();

  //@todo , check whether this fence is necessory.
  __threadfence_block();


  if (boardDevice[index].groupID == targetGroupID[0] ||
      boardDevice[index].groupID == targetGroupID[1] ||
      boardDevice[index].groupID == targetGroupID[2] ||
      boardDevice[index].groupID == targetGroupID[3] ){
    boardDevice[index].groupID = playPoint;
  }

  globalLiberty[index] = 0;
  hasStoneRemoved = false;

  __syncthreads();
  __threadfence_block();

  updateLiberty(boardDevice, index, globalLiberty);

  __syncthreads();
  __threadfence_block();

  int libertyNumber = globalLiberty[boardDevice[index].groupID];
  if ( libertyNumber == 0 ){
    boardDevice[index].color = GO_EMPTY;
    boardDevice[index].groupID = 0;
    boardDevice[index].libertyNumber = 0;
    hasStoneRemoved = true;
  } else {
    boardDevice[index].libertyNumber = libertyNumber;
  }

  __syncthreads();
  __threadfence_block();

  if (hasStoneRemoved){
  
    globalLiberty[index] = 0;
  
    __syncthreads();
    __threadfence_block();
  
    updateLiberty(boardDevice, index, globalLiberty);
  
    __syncthreads();
    __threadfence_block();
  
    libertyNumber = globalLiberty[boardDevice[index].groupID];
    boardDevice[index].libertyNumber = libertyNumber;
  }

//
//
//
//  if (boardDevice[index].pointGroup != NULL){
//    debugFlagDevice[index].changeFlag = boardDevice[index].pointGroup.numberOfLiberty; 
//    
//  }
//
//
//    debugFlagDevice[index].counter++;
//  }
//  

}

__device__
inline int inverseColor(int color){
  if (color == GO_BLACK){
    return GO_WHITE;
  }else if(color == GO_WHITE){
    return GO_BLACK;
  }
  return GO_EMPTY;
}

__global__
void updateLegleMove(BoardPoint *boardDevice, DebugFlag *debugFlagDevice, int color){
  int index = threadIdx.y*boardSize + threadIdx.x;

  if (boardDevice[index].color == GO_EMPTY){
    int totalLiberty = 0;
    
    if (boardDevice[index - 1].color == color){
      totalLiberty = totalLiberty + boardDevice[index - 1].libertyNumber - 1;
    }else if(boardDevice[index - 1].color == GO_EMPTY){
      totalLiberty++;
    }

    if (boardDevice[index + 1].color == color){
      totalLiberty = totalLiberty + boardDevice[index + 1].libertyNumber - 1;
    }else if(boardDevice[index + 1].color == GO_EMPTY){
      totalLiberty++;
    }

    if (boardDevice[index - boardSize].color == color){
      totalLiberty = totalLiberty + boardDevice[index - boardSize].libertyNumber - 1;
    }else if(boardDevice[index - boardSize].color == GO_EMPTY){
      totalLiberty++;
    }

    if (boardDevice[index + boardSize].color == color){
      totalLiberty = totalLiberty + boardDevice[index + boardSize].libertyNumber - 1;
    }else if(boardDevice[index + boardSize].color == GO_EMPTY){
      totalLiberty++;
    }

    debugFlagDevice[index].libertyCount = totalLiberty;

    if (totalLiberty > 0){
      if (color == GO_BLACK){
        boardDevice[index].isBlackLegal = true;
      }else if (color == GO_WHITE){
        boardDevice[index].isWhiteLegal = true;
      }
    }else{
      if (color == GO_BLACK){
        boardDevice[index].isBlackLegal = false;
      }else if (color == GO_WHITE){
        boardDevice[index].isWhiteLegal = false;
      }
 
    }
    
  } else {
      if (color == GO_BLACK){
        boardDevice[index].isBlackLegal = false;
      }else if (color == GO_WHITE){
        boardDevice[index].isWhiteLegal = false;
      }
  }
     
}
 
int main()
{
  BoardPoint boardHost[totalSize];
  BoardPoint *boardDevice;
  DebugFlag debugFlagHost[totalSize];
  DebugFlag *debugFlagDevice;

  const int valueSizeDevice = totalSize*sizeof(BoardPoint);
  const int debugFlagSize = totalSize*sizeof(DebugFlag);

  cudaMalloc( (void**)&boardDevice, valueSizeDevice );
  cudaMalloc( (void**)&debugFlagDevice, debugFlagSize );

  
  struct timeval start_tv;
  gettimeofday(&start_tv,NULL);
  
  
  dim3 threadShape( boardSize, boardSize );
  int numberOfBlock = 1;

  initBoard<<<numberOfBlock, threadShape>>>(boardDevice);
  
//  for (int i=0; i<19; i++){
//    playBoard<<<numberOfBlock, threadShape>>>(boardDevice, globalFlag, i, i, 2);
//  }

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 11, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 12, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 11, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 12, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 10, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 9, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 11, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 14, 10, 2);

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 1, 1, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 2, 1, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 1, 2, 1);

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 5, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 5, 11, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 5, 12, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 6, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 7, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 8, 10, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 8, 9, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 8, 11, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 9, 10, 2);

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 19, 19, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 18, 19, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 19, 18, 1);

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 4, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 5, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 6, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 11, 4, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 12, 4, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 4, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 3, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 5, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 14, 4, 2);

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 17, 16, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 17, 17, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 15, 12, 1);

  //updateLegleMove<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, GO_BLACK);
  //updateLegleMove<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, GO_WHITE);

  cudaDeviceSynchronize();

  cudaMemcpy( boardHost, boardDevice, valueSizeDevice, cudaMemcpyDeviceToHost );
  cudaMemcpy( debugFlagHost, debugFlagDevice, debugFlagSize, cudaMemcpyDeviceToHost );


  cudaFree( boardDevice );
  cudaFree( debugFlagDevice );
  
  cudaDeviceSynchronize();

  struct timeval end_tv;
  gettimeofday(&end_tv,NULL);
 
  for (int i=boardSize-1; i>=0; i--){
    for (int j=0; j<boardSize; j++){
      int index = i*boardSize + j;
      if (boardHost[index].color == 0){
        printf(".");
      }else if (boardHost[index].color == GO_BLACK){
        printf("o");
      }else if (boardHost[index].color == GO_WHITE){
        printf("x");
      }else if (boardHost[index].color == GO_BORDER){
        printf("H");
      }
    }
    printf("\n");
   
  }

//  for (int i=boardSize-1; i>=0; i--){
//    for (int j=0; j<boardSize; j++){
//      int index = i*boardSize + j;
////      if (boardHost[index].color == GO_BLACK || boardHost[index].color == GO_WHITE){
//        printf("%d, %d | ", boardHost[index].groupID, boardHost[index].libertyNumber);
////      } else if (boardHost[index].color == GO_EMPTY) {
////        printf("   ,   | ");
////      }
//    }
//    printf("\n");
//   
//  }

  for (int i=boardSize-1; i>=0; i--){
    for (int j=0; j<boardSize; j++){
      int index = i*boardSize + j;
      if (boardHost[index].color == GO_BORDER){
        printf("H");
      }else{
        if (boardHost[index].isBlackLegal){
          printf("o");
        }else {
          printf(".");
        }
      }
    }

    printf("        ");

    for (int j=0; j<boardSize; j++){
      int index = i*boardSize + j;
      if (boardHost[index].color == GO_BORDER){
        printf("H");
      }else{
        if (boardHost[index].isWhiteLegal){
          printf("x");
        }else {
          printf(".");
        }
      }
    }
    
    printf("\n");
   
  }



//  for (int i=boardSize-1; i>=0; i--){
//    for (int j=0; j<boardSize; j++){
//      int index = i*boardSize + j;
//      printf("%d | ", debugFlagHost[index].libertyCount);
//      }
//    printf("\n");
//   
//  }


  printf("\n");

  if(end_tv.tv_usec >= start_tv.tv_usec){
    printf("time %lu:%lu\n",end_tv.tv_sec - start_tv.tv_sec,  end_tv.tv_usec - start_tv.tv_usec);
  }else{
    printf("time %lu:%lu\n",end_tv.tv_sec - start_tv.tv_sec - 1,  1000000 - start_tv.tv_usec + end_tv.tv_usec);
  }

  
  return EXIT_SUCCESS;
  
}

	.file	"tmpxft_00286b93_00000000-6_go_main.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2032:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2032:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z39__device_stub__Z9initBoardP10BoardPointP10BoardPoint
	.type	_Z39__device_stub__Z9initBoardP10BoardPointP10BoardPoint, @function
_Z39__device_stub__Z9initBoardP10BoardPointP10BoardPoint:
.LFB2054:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	44(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z9initBoardP10BoardPoint(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L2:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2054:
	.size	_Z39__device_stub__Z9initBoardP10BoardPointP10BoardPoint, .-_Z39__device_stub__Z9initBoardP10BoardPointP10BoardPoint
	.globl	_Z9initBoardP10BoardPoint
	.type	_Z9initBoardP10BoardPoint, @function
_Z9initBoardP10BoardPoint:
.LFB2055:
	.cfi_startproc
	endbr64
	jmp	_Z39__device_stub__Z9initBoardP10BoardPointP10BoardPoint
	.cfi_endproc
.LFE2055:
	.size	_Z9initBoardP10BoardPoint, .-_Z9initBoardP10BoardPoint
	.globl	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
	.type	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii, @function
_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii:
.LFB2056:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z9playBoardP10BoardPointP9DebugFlagiii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L8:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2056:
	.size	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii, .-_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
	.globl	_Z9playBoardP10BoardPointP9DebugFlagiii
	.type	_Z9playBoardP10BoardPointP9DebugFlagiii, @function
_Z9playBoardP10BoardPointP9DebugFlagiii:
.LFB2057:
	.cfi_startproc
	endbr64
	jmp	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
	.cfi_endproc
.LFE2057:
	.size	_Z9playBoardP10BoardPointP9DebugFlagiii, .-_Z9playBoardP10BoardPointP9DebugFlagiii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"."
.LC1:
	.string	"o"
.LC2:
	.string	"x"
.LC3:
	.string	"H"
.LC4:
	.string	"\n"
.LC5:
	.string	"        "
.LC6:
	.string	"time %lu:%lu\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	leaq	-16384(%rsp), %r11
	.cfi_def_cfa 11, 16440
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3112, %rsp
	.cfi_def_cfa_offset 19552
	movl	$7056, %esi
	movq	%fs:40, %rax
	movq	%rax, 19480(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rdi
	call	cudaMalloc@PLT
	leaq	8(%rsp), %rdi
	movl	$12348, %esi
	call	cudaMalloc@PLT
	xorl	%esi, %esi
	leaq	32(%rsp), %rdi
	call	gettimeofday@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$90194313237, %rdx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 28(%rsp)
	movq	%rdx, 20(%rsp)
	movq	%rdi, 48(%rsp)
	movl	$1, 56(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L14
	movq	(%rsp), %rdi
	call	_Z39__device_stub__Z9initBoardP10BoardPointP10BoardPoint
.L14:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L15
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$10, %ecx
	movl	$10, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L15:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$11, %ecx
	movl	$10, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L16:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L17
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$12, %ecx
	movl	$10, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L17:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$10, %ecx
	movl	$11, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L18:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L19
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$10, %ecx
	movl	$12, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L19:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L20
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1, %r8d
	movl	$10, %ecx
	movl	$13, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L20:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L21
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$9, %ecx
	movl	$13, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L21:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L22
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$11, %ecx
	movl	$13, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L22:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L23
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$10, %ecx
	movl	$14, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L23:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L24
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$1, %ecx
	movl	$1, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L24:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L25
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1, %r8d
	movl	$1, %ecx
	movl	$2, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L25:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1, %r8d
	movl	$2, %ecx
	movl	$1, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L26:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L27
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$10, %ecx
	movl	$5, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L27:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L28
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$11, %ecx
	movl	$5, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L28:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L29
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$12, %ecx
	movl	$5, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L29:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$10, %ecx
	movl	$6, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L30:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L31
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$10, %ecx
	movl	$7, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L31:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L32
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1, %r8d
	movl	$10, %ecx
	movl	$8, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L32:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L33
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$9, %ecx
	movl	$8, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L33:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L34
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$11, %ecx
	movl	$8, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L34:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L35
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$10, %ecx
	movl	$9, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L35:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L36
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$19, %ecx
	movl	$19, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L36:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L37
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1, %r8d
	movl	$19, %ecx
	movl	$18, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L37:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L38
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1, %r8d
	movl	$18, %ecx
	movl	$19, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L38:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L39
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$4, %ecx
	movl	$10, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L39:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L40
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$5, %ecx
	movl	$10, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L40:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L41
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$6, %ecx
	movl	$10, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L41:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L42
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$4, %ecx
	movl	$11, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L42:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L43
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$4, %ecx
	movl	$12, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L43:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L44
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1, %r8d
	movl	$4, %ecx
	movl	$13, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L44:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L45
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$3, %ecx
	movl	$13, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L45:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L46
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$5, %ecx
	movl	$13, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L46:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L47
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$4, %ecx
	movl	$14, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L47:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L48
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %r8d
	movl	$16, %ecx
	movl	$17, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L48:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L49
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1, %r8d
	movl	$17, %ecx
	movl	$17, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L49:
	movl	28(%rsp), %ecx
	movq	20(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 56(%rsp)
	movq	%rdi, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L50
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$1, %r8d
	movl	$12, %ecx
	movl	$15, %edx
	call	_Z53__device_stub__Z9playBoardP10BoardPointP9DebugFlagiiiP10BoardPointP9DebugFlagiii
.L50:
	call	cudaDeviceSynchronize@PLT
	movq	(%rsp), %rsi
	leaq	64(%rsp), %rdi
	movl	$2, %ecx
	movl	$7056, %edx
	leaq	6784(%rsp), %rbx
	movl	$420, %r14d
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rsi
	movq	%rbx, %r13
	movl	$2, %ecx
	movl	$12348, %edx
	leaq	7132(%rsp), %rdi
	leaq	.LC3(%rip), %r15
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	call	cudaDeviceSynchronize@PLT
	leaq	48(%rsp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
.L51:
	movq	%r13, %r12
	movl	$21, %ebp
.L56:
	movl	(%r12), %eax
	leaq	.LC0(%rip), %rsi
	movl	$2, %edi
	testl	%eax, %eax
	je	.L75
	leaq	.LC1(%rip), %rsi
	cmpl	$1, %eax
	je	.L76
	leaq	.LC2(%rip), %rsi
	cmpl	$2, %eax
	je	.L76
	cmpl	$3, %eax
	jne	.L53
	movq	%r15, %rsi
.L76:
	movl	$2, %edi
	xorl	%eax, %eax
.L75:
	call	__printf_chk@PLT
.L53:
	addq	$16, %r12
	decl	%ebp
	jne	.L56
	leaq	.LC4(%rip), %r12
	movl	$2, %edi
	xorl	%eax, %eax
	subl	$21, %r14d
	movq	%r12, %rsi
	subq	$336, %r13
	call	__printf_chk@PLT
	cmpl	$-21, %r14d
	jne	.L51
	movl	$420, %r13d
	leaq	.LC0(%rip), %r14
.L57:
	movq	%rbx, %rbp
	movl	$21, %r15d
.L61:
	cmpl	$3, 0(%rbp)
	leaq	.LC3(%rip), %rsi
	je	.L77
	cmpb	$0, 12(%rbp)
	leaq	.LC1(%rip), %rsi
	jne	.L77
	movq	%r14, %rsi
.L77:
	movl	$2, %edi
	xorl	%eax, %eax
	addq	$16, %rbp
	call	__printf_chk@PLT
	decl	%r15d
	jne	.L61
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	movq	%rbx, %rbp
	xorl	%r15d, %r15d
	movl	$2, %edi
	call	__printf_chk@PLT
.L65:
	cmpl	$3, 0(%rbp)
	leaq	.LC3(%rip), %rsi
	je	.L78
	cmpb	$0, 13(%rbp)
	leaq	.LC2(%rip), %rsi
	jne	.L78
	movq	%r14, %rsi
.L78:
	movl	$2, %edi
	xorl	%eax, %eax
	incl	%r15d
	addq	$16, %rbp
	call	__printf_chk@PLT
	cmpl	$21, %r15d
	jne	.L65
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	subl	$21, %r13d
	call	__printf_chk@PLT
	subq	$336, %rbx
	cmpl	$-21, %r13d
	jne	.L57
	movq	%r12, %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	56(%rsp), %rcx
	movq	40(%rsp), %rax
	leaq	.LC6(%rip), %rsi
	movq	48(%rsp), %rdx
	cmpq	%rax, %rcx
	jl	.L67
	subq	%rax, %rcx
	subq	32(%rsp), %rdx
	jmp	.L79
.L67:
	subq	%rax, %rcx
	subq	32(%rsp), %rdx
	addq	$1000000, %rcx
	decq	%rdx
.L79:
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	19480(%rsp), %rax
	subq	%fs:40, %rax
	je	.L69
	call	__stack_chk_fail@PLT
.L69:
	addq	$19496, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.LFE2029:
	.size	main, .-main
	.text
	.globl	_Z58__device_stub__Z15updateLegleMoveP10BoardPointP9DebugFlagiP10BoardPointP9DebugFlagi
	.type	_Z58__device_stub__Z15updateLegleMoveP10BoardPointP9DebugFlagiP10BoardPointP9DebugFlagi, @function
_Z58__device_stub__Z15updateLegleMoveP10BoardPointP9DebugFlagiP10BoardPointP9DebugFlagi:
.LFB2058:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L80
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z15updateLegleMoveP10BoardPointP9DebugFlagi(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L80:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L82
	call	__stack_chk_fail@PLT
.L82:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2058:
	.size	_Z58__device_stub__Z15updateLegleMoveP10BoardPointP9DebugFlagiP10BoardPointP9DebugFlagi, .-_Z58__device_stub__Z15updateLegleMoveP10BoardPointP9DebugFlagiP10BoardPointP9DebugFlagi
	.globl	_Z15updateLegleMoveP10BoardPointP9DebugFlagi
	.type	_Z15updateLegleMoveP10BoardPointP9DebugFlagi, @function
_Z15updateLegleMoveP10BoardPointP9DebugFlagi:
.LFB2059:
	.cfi_startproc
	endbr64
	jmp	_Z58__device_stub__Z15updateLegleMoveP10BoardPointP9DebugFlagiP10BoardPointP9DebugFlagi
	.cfi_endproc
.LFE2059:
	.size	_Z15updateLegleMoveP10BoardPointP9DebugFlagi, .-_Z15updateLegleMoveP10BoardPointP9DebugFlagi
	.section	.rodata.str1.1
.LC7:
	.string	"_Z15updateLegleMoveP10BoardPointP9DebugFlagi"
.LC8:
	.string	"_Z9playBoardP10BoardPointP9DebugFlagiii"
.LC9:
	.string	"_Z9initBoardP10BoardPoint"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2061:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC7(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z15updateLegleMoveP10BoardPointP9DebugFlagi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC8(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z9playBoardP10BoardPointP9DebugFlagiii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC9(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z9initBoardP10BoardPoint(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2061:
	.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
	.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:


#include <hip/hip_runtime.h>
#include <stdio.h>
#include <sys/time.h>
#include <time.h>


#define GO_EMPTY 0
#define GO_BLACK 1
#define GO_WHITE 2
#define GO_BORDER 3

 
const int boardSize = 21; 
const int totalSize = boardSize * boardSize;


struct BoardPoint{
  int color;
  int groupID;
  int libertyNumber;
  bool isBlackLegal;
  bool isWhiteLegal;
};

struct DebugFlag{
  int counter;
  int changeFlag;
  int targetGroupID[4];
  int libertyCount;
};
 
__global__
void initBoard(BoardPoint *boardDevice){
 
  int index = threadIdx.y * boardSize + threadIdx.x;

  if (threadIdx.x == 0 || threadIdx.x == boardSize-1 || threadIdx.y == 0 || threadIdx.y == boardSize-1){
    boardDevice[index].color = 3;
  } else {
    boardDevice[index].color = 0;
  }

  //boardDevice[index].groupID = totalSize; // all the initial group ID was set to none group id.

}

__device__

inline void updateLiberty(BoardPoint *boardDevice, int index, int *globalLiberty){
   if (boardDevice[index].color == GO_EMPTY){

    atomicAdd(&globalLiberty[boardDevice[index-1].groupID], 1);
  
    if (boardDevice[index+boardSize].groupID != boardDevice[index-1].groupID){
      atomicAdd(&globalLiberty[boardDevice[index+boardSize].groupID], 1);
    } 

    if (boardDevice[index+1].groupID != boardDevice[index-1].groupID &&
        boardDevice[index+1].groupID != boardDevice[index+boardSize].groupID){
      atomicAdd(&globalLiberty[boardDevice[index+1].groupID], 1);
    } 

    if (boardDevice[index-boardSize].groupID != boardDevice[index-1].groupID &&
        boardDevice[index-boardSize].groupID != boardDevice[index+1].groupID &&
        boardDevice[index-boardSize].groupID != boardDevice[index+boardSize].groupID){
      atomicAdd(&globalLiberty[boardDevice[index-boardSize].groupID], 1);
    } 

  }
}

__global__
void playBoard(BoardPoint *boardDevice, DebugFlag *debugFlagDevice, int row, int col, int color){
  int index = threadIdx.y*boardSize + threadIdx.x;
  int playPoint = row*boardSize + col;

  __shared__ int globalLiberty[totalSize]; // shared array to count the liberty of each group.
  __shared__ int targetGroupID[4] ;
  __shared__ bool hasStoneRemoved;


  if (threadIdx.y == 0 || threadIdx.y == boardSize || threadIdx.x == 0 || threadIdx.x == boardSize){
    globalLiberty[0] = 0;
    return;
  }


  if (index == playPoint){
      boardDevice[index].color = color;
      boardDevice[index].groupID = index;

      if (boardDevice[index+1].color == color){
        targetGroupID[0] = boardDevice[index+1].groupID;
      }else{
        targetGroupID[0] = -1;
      }

      if (boardDevice[index-1].color == color){
        targetGroupID[1] = boardDevice[index-1].groupID;
      }else{
        targetGroupID[1] = -1;
      }
      
      if (boardDevice[index+boardSize].color == color){
        targetGroupID[2] = boardDevice[index+boardSize].groupID;
      }else{
        targetGroupID[2] = -1;
      }

      if (boardDevice[index-boardSize].color == color){
        targetGroupID[3] = boardDevice[index-boardSize].groupID;
      }else{
        targetGroupID[3] = -1;
      }

  }

  __syncthreads();

  //@todo , check whether this fence is necessory.
  __threadfence_block();


  if (boardDevice[index].groupID == targetGroupID[0] ||
      boardDevice[index].groupID == targetGroupID[1] ||
      boardDevice[index].groupID == targetGroupID[2] ||
      boardDevice[index].groupID == targetGroupID[3] ){
    boardDevice[index].groupID = playPoint;
  }

  globalLiberty[index] = 0;
  hasStoneRemoved = false;

  __syncthreads();
  __threadfence_block();

  updateLiberty(boardDevice, index, globalLiberty);

  __syncthreads();
  __threadfence_block();

  int libertyNumber = globalLiberty[boardDevice[index].groupID];
  if ( libertyNumber == 0 ){
    boardDevice[index].color = GO_EMPTY;
    boardDevice[index].groupID = 0;
    boardDevice[index].libertyNumber = 0;
    hasStoneRemoved = true;
  } else {
    boardDevice[index].libertyNumber = libertyNumber;
  }

  __syncthreads();
  __threadfence_block();

  if (hasStoneRemoved){
  
    globalLiberty[index] = 0;
  
    __syncthreads();
    __threadfence_block();
  
    updateLiberty(boardDevice, index, globalLiberty);
  
    __syncthreads();
    __threadfence_block();
  
    libertyNumber = globalLiberty[boardDevice[index].groupID];
    boardDevice[index].libertyNumber = libertyNumber;
  }

//
//
//
//  if (boardDevice[index].pointGroup != NULL){
//    debugFlagDevice[index].changeFlag = boardDevice[index].pointGroup.numberOfLiberty; 
//    
//  }
//
//
//    debugFlagDevice[index].counter++;
//  }
//  

}

__device__
inline int inverseColor(int color){
  if (color == GO_BLACK){
    return GO_WHITE;
  }else if(color == GO_WHITE){
    return GO_BLACK;
  }
  return GO_EMPTY;
}

__global__
void updateLegleMove(BoardPoint *boardDevice, DebugFlag *debugFlagDevice, int color){
  int index = threadIdx.y*boardSize + threadIdx.x;

  if (boardDevice[index].color == GO_EMPTY){
    int totalLiberty = 0;
    
    if (boardDevice[index - 1].color == color){
      totalLiberty = totalLiberty + boardDevice[index - 1].libertyNumber - 1;
    }else if(boardDevice[index - 1].color == GO_EMPTY){
      totalLiberty++;
    }

    if (boardDevice[index + 1].color == color){
      totalLiberty = totalLiberty + boardDevice[index + 1].libertyNumber - 1;
    }else if(boardDevice[index + 1].color == GO_EMPTY){
      totalLiberty++;
    }

    if (boardDevice[index - boardSize].color == color){
      totalLiberty = totalLiberty + boardDevice[index - boardSize].libertyNumber - 1;
    }else if(boardDevice[index - boardSize].color == GO_EMPTY){
      totalLiberty++;
    }

    if (boardDevice[index + boardSize].color == color){
      totalLiberty = totalLiberty + boardDevice[index + boardSize].libertyNumber - 1;
    }else if(boardDevice[index + boardSize].color == GO_EMPTY){
      totalLiberty++;
    }

    debugFlagDevice[index].libertyCount = totalLiberty;

    if (totalLiberty > 0){
      if (color == GO_BLACK){
        boardDevice[index].isBlackLegal = true;
      }else if (color == GO_WHITE){
        boardDevice[index].isWhiteLegal = true;
      }
    }else{
      if (color == GO_BLACK){
        boardDevice[index].isBlackLegal = false;
      }else if (color == GO_WHITE){
        boardDevice[index].isWhiteLegal = false;
      }
 
    }
    
  } else {
      if (color == GO_BLACK){
        boardDevice[index].isBlackLegal = false;
      }else if (color == GO_WHITE){
        boardDevice[index].isWhiteLegal = false;
      }
  }
     
}
 
int main()
{
  BoardPoint boardHost[totalSize];
  BoardPoint *boardDevice;
  DebugFlag debugFlagHost[totalSize];
  DebugFlag *debugFlagDevice;

  const int valueSizeDevice = totalSize*sizeof(BoardPoint);
  const int debugFlagSize = totalSize*sizeof(DebugFlag);

  hipMalloc( (void**)&boardDevice, valueSizeDevice );
  hipMalloc( (void**)&debugFlagDevice, debugFlagSize );

  
  struct timeval start_tv;
  gettimeofday(&start_tv,NULL);
  
  
  dim3 threadShape( boardSize, boardSize );
  int numberOfBlock = 1;

  initBoard<<<numberOfBlock, threadShape>>>(boardDevice);
  
//  for (int i=0; i<19; i++){
//    playBoard<<<numberOfBlock, threadShape>>>(boardDevice, globalFlag, i, i, 2);
//  }

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 11, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 12, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 11, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 12, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 10, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 9, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 11, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 14, 10, 2);

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 1, 1, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 2, 1, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 1, 2, 1);

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 5, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 5, 11, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 5, 12, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 6, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 7, 10, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 8, 10, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 8, 9, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 8, 11, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 9, 10, 2);

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 19, 19, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 18, 19, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 19, 18, 1);

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 4, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 5, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 10, 6, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 11, 4, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 12, 4, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 4, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 3, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 13, 5, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 14, 4, 2);

  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 17, 16, 2);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 17, 17, 1);
  playBoard<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, 15, 12, 1);

  //updateLegleMove<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, GO_BLACK);
  //updateLegleMove<<<numberOfBlock, threadShape>>>(boardDevice, debugFlagDevice, GO_WHITE);

  hipDeviceSynchronize();

  hipMemcpy( boardHost, boardDevice, valueSizeDevice, hipMemcpyDeviceToHost );
  hipMemcpy( debugFlagHost, debugFlagDevice, debugFlagSize, hipMemcpyDeviceToHost );


  hipFree( boardDevice );
  hipFree( debugFlagDevice );
  
  hipDeviceSynchronize();

  struct timeval end_tv;
  gettimeofday(&end_tv,NULL);
 
  for (int i=boardSize-1; i>=0; i--){
    for (int j=0; j<boardSize; j++){
      int index = i*boardSize + j;
      if (boardHost[index].color == 0){
        printf(".");
      }else if (boardHost[index].color == GO_BLACK){
        printf("o");
      }else if (boardHost[index].color == GO_WHITE){
        printf("x");
      }else if (boardHost[index].color == GO_BORDER){
        printf("H");
      }
    }
    printf("\n");
   
  }

//  for (int i=boardSize-1; i>=0; i--){
//    for (int j=0; j<boardSize; j++){
//      int index = i*boardSize + j;
////      if (boardHost[index].color == GO_BLACK || boardHost[index].color == GO_WHITE){
//        printf("%d, %d | ", boardHost[index].groupID, boardHost[index].libertyNumber);
////      } else if (boardHost[index].color == GO_EMPTY) {
////        printf("   ,   | ");
////      }
//    }
//    printf("\n");
//   
//  }

  for (int i=boardSize-1; i>=0; i--){
    for (int j=0; j<boardSize; j++){
      int index = i*boardSize + j;
      if (boardHost[index].color == GO_BORDER){
        printf("H");
      }else{
        if (boardHost[index].isBlackLegal){
          printf("o");
        }else {
          printf(".");
        }
      }
    }

    printf("        ");

    for (int j=0; j<boardSize; j++){
      int index = i*boardSize + j;
      if (boardHost[index].color == GO_BORDER){
        printf("H");
      }else{
        if (boardHost[index].isWhiteLegal){
          printf("x");
        }else {
          printf(".");
        }
      }
    }
    
    printf("\n");
   
  }



//  for (int i=boardSize-1; i>=0; i--){
//    for (int j=0; j<boardSize; j++){
//      int index = i*boardSize + j;
//      printf("%d | ", debugFlagHost[index].libertyCount);
//      }
//    printf("\n");
//   
//  }


  printf("\n");

  if(end_tv.tv_usec >= start_tv.tv_usec){
    printf("time %lu:%lu\n",end_tv.tv_sec - start_tv.tv_sec,  end_tv.tv_usec - start_tv.tv_usec);
  }else{
    printf("time %lu:%lu\n",end_tv.tv_sec - start_tv.tv_sec - 1,  1000000 - start_tv.tv_usec + end_tv.tv_usec);
  }

  
  return EXIT_SUCCESS;
  
}

	.text
	.file	"go_main.hip"
	.globl	_Z24__device_stub__initBoardP10BoardPoint # -- Begin function _Z24__device_stub__initBoardP10BoardPoint
	.type	_Z24__device_stub__initBoardP10BoardPoint,@function
_Z24__device_stub__initBoardP10BoardPoint: # @_Z24__device_stub__initBoardP10BoardPoint
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	movq	%rsp, %rbx
	movq	%rax, (%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9initBoardP10BoardPoint, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$80, %rsp
	.cfi_adjust_cfa_offset -80
	popq	%rbx
	.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
	retq
.Lfunc_end0:
	.size	_Z24__device_stub__initBoardP10BoardPoint, .Lfunc_end0-_Z24__device_stub__initBoardP10BoardPoint
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii # -- Begin function _Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
	.type	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii,@function
_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii: # @_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	4(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9playBoardP10BoardPointP9DebugFlagiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.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
	retq
.Lfunc_end1:
	.size	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii, .Lfunc_end1-_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z30__device_stub__updateLegleMoveP10BoardPointP9DebugFlagi # -- Begin function _Z30__device_stub__updateLegleMoveP10BoardPointP9DebugFlagi
	.type	_Z30__device_stub__updateLegleMoveP10BoardPointP9DebugFlagi,@function
_Z30__device_stub__updateLegleMoveP10BoardPointP9DebugFlagi: # @_Z30__device_stub__updateLegleMoveP10BoardPointP9DebugFlagi
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z15updateLegleMoveP10BoardPointP9DebugFlagi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.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
	retq
.Lfunc_end2:
	.size	_Z30__device_stub__updateLegleMoveP10BoardPointP9DebugFlagi, .Lfunc_end2-_Z30__device_stub__updateLegleMoveP10BoardPointP9DebugFlagi
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$19456, %rsp                    # imm = 0x4C00
	.cfi_def_cfa_offset 19504
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movabsq	$90194313237, %rbx              # imm = 0x1500000015
	movabsq	$4294967297, %r14               # imm = 0x100000001
	movq	%rsp, %rdi
	movl	$7056, %esi                     # imm = 0x1B90
	callq	hipMalloc
	leaq	8(%rsp), %rdi
	movl	$12348, %esi                    # imm = 0x303C
	callq	hipMalloc
	leaq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_2
# %bb.1:
	movq	(%rsp), %rdi
	callq	_Z24__device_stub__initBoardP10BoardPoint
.LBB3_2:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_4
# %bb.3:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$10, %edx
	movl	$10, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_4:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_6
# %bb.5:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$10, %edx
	movl	$11, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_6:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_8
# %bb.7:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$10, %edx
	movl	$12, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_8:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_10
# %bb.9:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$11, %edx
	movl	$10, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_10:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_12
# %bb.11:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$12, %edx
	movl	$10, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_12:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_14
# %bb.13:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$13, %edx
	movl	$10, %ecx
	movl	$1, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_14:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_16
# %bb.15:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$13, %edx
	movl	$9, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_16:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_18
# %bb.17:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$13, %edx
	movl	$11, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_18:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_20
# %bb.19:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$14, %edx
	movl	$10, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_20:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_22
# %bb.21:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$1, %edx
	movl	$1, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_22:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_24
# %bb.23:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$2, %edx
	movl	$1, %ecx
	movl	$1, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_24:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_26
# %bb.25:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$1, %edx
	movl	$2, %ecx
	movl	$1, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_26:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_28
# %bb.27:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$5, %edx
	movl	$10, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_28:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_30
# %bb.29:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$5, %edx
	movl	$11, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_30:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_32
# %bb.31:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$5, %edx
	movl	$12, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_32:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_34
# %bb.33:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$6, %edx
	movl	$10, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_34:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_36
# %bb.35:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$7, %edx
	movl	$10, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_36:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_38
# %bb.37:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$8, %edx
	movl	$10, %ecx
	movl	$1, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_38:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_40
# %bb.39:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$8, %edx
	movl	$9, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_40:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_42
# %bb.41:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$8, %edx
	movl	$11, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_42:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_44
# %bb.43:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$9, %edx
	movl	$10, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_44:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_46
# %bb.45:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$19, %edx
	movl	$19, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_46:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_48
# %bb.47:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$18, %edx
	movl	$19, %ecx
	movl	$1, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_48:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_50
# %bb.49:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$19, %edx
	movl	$18, %ecx
	movl	$1, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_50:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_52
# %bb.51:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$10, %edx
	movl	$4, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_52:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_54
# %bb.53:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$10, %edx
	movl	$5, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_54:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_56
# %bb.55:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$10, %edx
	movl	$6, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_56:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_58
# %bb.57:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$11, %edx
	movl	$4, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_58:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_60
# %bb.59:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$12, %edx
	movl	$4, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_60:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_62
# %bb.61:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$13, %edx
	movl	$4, %ecx
	movl	$1, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_62:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_64
# %bb.63:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$13, %edx
	movl	$3, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_64:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_66
# %bb.65:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$13, %edx
	movl	$5, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_66:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_68
# %bb.67:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$14, %edx
	movl	$4, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_68:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_70
# %bb.69:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$17, %edx
	movl	$16, %ecx
	movl	$2, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_70:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_72
# %bb.71:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$17, %edx
	movl	$17, %ecx
	movl	$1, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_72:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_74
# %bb.73:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$15, %edx
	movl	$12, %ecx
	movl	$1, %r8d
	callq	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
.LBB3_74:
	callq	hipDeviceSynchronize
	movq	(%rsp), %rsi
	leaq	48(%rsp), %rdi
	movl	$7056, %edx                     # imm = 0x1B90
	movl	$2, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rsi
	leaq	7104(%rsp), %rdi
	movl	$12348, %edx                    # imm = 0x303C
	movl	$2, %ecx
	callq	hipMemcpy
	movq	(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	callq	hipDeviceSynchronize
	leaq	16(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	$20, %ebx
	leaq	6768(%rsp), %r14
.LBB3_75:                               # %.preheader523
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_76 Depth 2
	xorl	%r15d, %r15d
.LBB3_76:                               #   Parent Loop BB3_75 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r14,%r15), %eax
	cmpq	$3, %rax
	ja	.LBB3_78
# %bb.77:                               # %switch.lookup
                                        #   in Loop: Header=BB3_76 Depth=2
	movl	.Lswitch.table.main(,%rax,4), %edi
	callq	putchar@PLT
.LBB3_78:                               #   in Loop: Header=BB3_76 Depth=2
	addq	$16, %r15
	cmpq	$336, %r15                      # imm = 0x150
	jne	.LBB3_76
# %bb.79:                               #   in Loop: Header=BB3_75 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	addq	$-336, %r14                     # imm = 0xFEB0
	subq	$1, %rbx
	jae	.LBB3_75
# %bb.80:                               # %.preheader.preheader
	leaq	6780(%rsp), %rbx
	movl	$20, %r14d
	leaq	6781(%rsp), %r15
	movq	$-336, %r12                     # imm = 0xFEB0
.LBB3_81:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_82 Depth 2
                                        #     Child Loop BB3_87 Depth 2
	xorl	%r13d, %r13d
.LBB3_82:                               #   Parent Loop BB3_81 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$72, %edi
	cmpl	$3, -12(%rbx,%r13)
	je	.LBB3_85
# %bb.83:                               #   in Loop: Header=BB3_82 Depth=2
	cmpb	$0, (%rbx,%r13)
	movl	$46, %edi
	je	.LBB3_85
# %bb.84:                               #   in Loop: Header=BB3_82 Depth=2
	movl	$111, %edi
.LBB3_85:                               #   in Loop: Header=BB3_82 Depth=2
	callq	putchar@PLT
	addq	$16, %r13
	cmpq	$336, %r13                      # imm = 0x150
	jne	.LBB3_82
# %bb.86:                               #   in Loop: Header=BB3_81 Depth=1
	movl	$.L.str.5, %edi
	xorl	%eax, %eax
	callq	printf
	xorl	%r13d, %r13d
.LBB3_87:                               #   Parent Loop BB3_81 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$72, %edi
	cmpl	$3, -13(%r15,%r13)
	je	.LBB3_90
# %bb.88:                               #   in Loop: Header=BB3_87 Depth=2
	cmpb	$0, (%r15,%r13)
	movl	$46, %edi
	je	.LBB3_90
# %bb.89:                               #   in Loop: Header=BB3_87 Depth=2
	movl	$120, %edi
.LBB3_90:                               #   in Loop: Header=BB3_87 Depth=2
	callq	putchar@PLT
	addq	$16, %r13
	cmpq	$336, %r13                      # imm = 0x150
	jne	.LBB3_87
# %bb.91:                               #   in Loop: Header=BB3_81 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	addq	%r12, %rbx
	addq	%r12, %r15
	subq	$1, %r14
	jae	.LBB3_81
# %bb.92:
	movl	$10, %edi
	callq	putchar@PLT
	movq	24(%rsp), %rax
	movq	32(%rsp), %rsi
	movq	40(%rsp), %rcx
	leaq	1000000(%rax), %rdx
	movq	%rsi, %rdi
	negq	%rdi
	cmpq	%rcx, %rax
	notq	%rsi
	cmovgeq	%rax, %rdx
	cmovgeq	%rdi, %rsi
	addq	16(%rsp), %rsi
	subq	%rcx, %rdx
	movl	$.L.str.6, %edi
	xorl	%eax, %eax
	callq	printf
	xorl	%eax, %eax
	addq	$19456, %rsp                    # imm = 0x4C00
	.cfi_def_cfa_offset 48
	popq	%rbx
	.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
	retq
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9initBoardP10BoardPoint, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9playBoardP10BoardPointP9DebugFlagiii, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z15updateLegleMoveP10BoardPointP9DebugFlagi, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB5_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z9initBoardP10BoardPoint,@object # @_Z9initBoardP10BoardPoint
	.section	.rodata,"a",@progbits
	.globl	_Z9initBoardP10BoardPoint
	.p2align	3, 0x0
_Z9initBoardP10BoardPoint:
	.quad	_Z24__device_stub__initBoardP10BoardPoint
	.size	_Z9initBoardP10BoardPoint, 8

	.type	_Z9playBoardP10BoardPointP9DebugFlagiii,@object # @_Z9playBoardP10BoardPointP9DebugFlagiii
	.globl	_Z9playBoardP10BoardPointP9DebugFlagiii
	.p2align	3, 0x0
_Z9playBoardP10BoardPointP9DebugFlagiii:
	.quad	_Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
	.size	_Z9playBoardP10BoardPointP9DebugFlagiii, 8

	.type	_Z15updateLegleMoveP10BoardPointP9DebugFlagi,@object # @_Z15updateLegleMoveP10BoardPointP9DebugFlagi
	.globl	_Z15updateLegleMoveP10BoardPointP9DebugFlagi
	.p2align	3, 0x0
_Z15updateLegleMoveP10BoardPointP9DebugFlagi:
	.quad	_Z30__device_stub__updateLegleMoveP10BoardPointP9DebugFlagi
	.size	_Z15updateLegleMoveP10BoardPointP9DebugFlagi, 8

	.type	.L.str.5,@object                # @.str.5
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.5:
	.asciz	"        "
	.size	.L.str.5, 9

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"time %lu:%lu\n"
	.size	.L.str.6, 14

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z9initBoardP10BoardPoint"
	.size	.L__unnamed_1, 26

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z9playBoardP10BoardPointP9DebugFlagiii"
	.size	.L__unnamed_2, 40

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z15updateLegleMoveP10BoardPointP9DebugFlagi"
	.size	.L__unnamed_3, 45

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lswitch.table.main,@object     # @switch.table.main
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	2, 0x0
.Lswitch.table.main:
	.long	46                              # 0x2e
	.long	111                             # 0x6f
	.long	120                             # 0x78
	.long	72                              # 0x48
	.size	.Lswitch.table.main, 16

	.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 _Z24__device_stub__initBoardP10BoardPoint
	.addrsig_sym _Z24__device_stub__playBoardP10BoardPointP9DebugFlagiii
	.addrsig_sym _Z30__device_stub__updateLegleMoveP10BoardPointP9DebugFlagi
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z9initBoardP10BoardPoint
	.addrsig_sym _Z9playBoardP10BoardPointP9DebugFlagiii
	.addrsig_sym _Z15updateLegleMoveP10BoardPointP9DebugFlagi
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z9initBoardP10BoardPoint ; -- Begin function _Z9initBoardP10BoardPoint
	.globl	_Z9initBoardP10BoardPoint
	.p2align	8
	.type	_Z9initBoardP10BoardPoint,@function
_Z9initBoardP10BoardPoint:              ; @_Z9initBoardP10BoardPoint
; %bb.0:
	v_and_b32_e32 v1, 0x3ff, v0
	s_mov_b32 s2, 0
	s_mov_b32 s3, exec_lo
                                        ; implicit-def: $sgpr4
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_lt_i32_e32 19, v1
	s_xor_b32 s3, exec_lo, s3
; %bb.1:                                ; %LeafBlock7
	v_cmp_ne_u32_e32 vcc_lo, 20, v1
	s_mov_b32 s4, 3
	s_and_b32 s2, vcc_lo, exec_lo
; %bb.2:                                ; %Flow
	s_or_saveexec_b32 s3, s3
	v_mov_b32_e32 v2, s4
	s_xor_b32 exec_lo, exec_lo, s3
; %bb.3:                                ; %LeafBlock
	v_cmp_ne_u32_e32 vcc_lo, 0, v1
	v_mov_b32_e32 v2, 3
	s_and_not1_b32 s2, s2, exec_lo
	s_and_b32 s4, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s2, s2, s4
; %bb.4:                                ; %Flow9
	s_or_b32 exec_lo, exec_lo, s3
	v_bfe_u32 v0, v0, 10, 10
	s_and_saveexec_b32 s3, s2
; %bb.5:
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	v_cmp_eq_u32_e64 s2, 20, v0
	s_or_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	v_cndmask_b32_e64 v2, 0, 3, s2
; %bb.6:
	s_or_b32 exec_lo, exec_lo, s3
	s_load_b64 s[0:1], s[0:1], 0x0
	v_mul_u32_u24_e32 v0, 21, v0
	s_delay_alu instid0(VALU_DEP_1)
	v_add_lshl_u32 v0, v0, v1, 4
	s_waitcnt lgkmcnt(0)
	global_store_b32 v0, v2, s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9initBoardP10BoardPoint
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 8
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 3
		.amdhsa_next_free_sgpr 5
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z9initBoardP10BoardPoint, .Lfunc_end0-_Z9initBoardP10BoardPoint
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 176
; NumSgprs: 7
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 7
; NumVGPRsForWavesPerEU: 3
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z9playBoardP10BoardPointP9DebugFlagiii ; -- Begin function _Z9playBoardP10BoardPointP9DebugFlagiii
	.globl	_Z9playBoardP10BoardPointP9DebugFlagiii
	.p2align	8
	.type	_Z9playBoardP10BoardPointP9DebugFlagiii,@function
_Z9playBoardP10BoardPointP9DebugFlagiii: ; @_Z9playBoardP10BoardPointP9DebugFlagiii
; %bb.0:
	v_bfe_u32 v1, v0, 10, 10
	s_mov_b32 s4, 0
	s_mov_b32 s3, 0
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_lt_i32_e32 20, v1
	s_xor_b32 s2, exec_lo, s2
; %bb.1:                                ; %LeafBlock99
	v_cmp_ne_u32_e32 vcc_lo, 21, v1
	s_mov_b32 s3, exec_lo
	s_and_b32 s4, vcc_lo, exec_lo
; %bb.2:                                ; %Flow112
	s_and_not1_saveexec_b32 s5, s2
; %bb.3:                                ; %LeafBlock
	v_cmp_eq_u32_e32 vcc_lo, 0, v1
	v_cmp_ne_u32_e64 s2, 0, v1
	s_and_not1_b32 s3, s3, exec_lo
	s_and_not1_b32 s4, s4, exec_lo
	s_and_b32 s6, vcc_lo, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 s2, s2, exec_lo
	s_or_b32 s3, s3, s6
	s_or_b32 s4, s4, s2
; %bb.4:                                ; %Flow113
	s_or_b32 exec_lo, exec_lo, s5
	s_and_saveexec_b32 s10, s4
	s_cbranch_execz .LBB1_42
; %bb.5:                                ; %NodeBlock105
	v_and_b32_e32 v0, 0x3ff, v0
	s_mov_b32 s4, 0
	s_mov_b32 s11, 0
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_lt_i32_e32 20, v0
	s_xor_b32 s2, exec_lo, s2
; %bb.6:                                ; %LeafBlock103
	v_cmp_ne_u32_e32 vcc_lo, 21, v0
	s_mov_b32 s11, exec_lo
	s_and_b32 s4, vcc_lo, exec_lo
; %bb.7:                                ; %Flow115
	s_and_not1_saveexec_b32 s5, s2
; %bb.8:                                ; %LeafBlock101
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	v_cmp_ne_u32_e64 s2, 0, v0
	s_and_not1_b32 s6, s11, exec_lo
	s_and_not1_b32 s4, s4, exec_lo
	s_and_b32 s7, vcc_lo, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 s2, s2, exec_lo
	s_or_b32 s11, s6, s7
	s_or_b32 s4, s4, s2
; %bb.9:                                ; %Flow116
	s_or_b32 exec_lo, exec_lo, s5
	s_and_saveexec_b32 s12, s4
	s_cbranch_execz .LBB1_41
; %bb.10:
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x10
	s_load_b64 s[8:9], s[0:1], 0x0
	v_mad_u32_u24 v4, v1, 21, v0
	s_mov_b32 s0, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_lshlrev_b32_e32 v5, 4, v4
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s4, s4, 21
	s_add_i32 s4, s4, s5
	s_delay_alu instid0(SALU_CYCLE_1)
	v_cmpx_eq_u32_e64 s4, v4
	s_cbranch_execz .LBB1_20
; %bb.11:
	global_load_b32 v6, v5, s[8:9] offset:16
	v_add_co_u32 v0, s1, s8, v5
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v1, null, s9, 0, s1
	v_dual_mov_b32 v3, s6 :: v_dual_mov_b32 v2, -1
	v_mov_b32_e32 v7, -1
	s_mov_b32 s1, exec_lo
	global_store_b64 v5, v[3:4], s[8:9]
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e64 s6, v6
	s_cbranch_execz .LBB1_13
; %bb.12:
	global_load_b32 v7, v[0:1], off offset:20
.LBB1_13:
	s_or_b32 exec_lo, exec_lo, s1
	global_load_b32 v3, v[0:1], off offset:-16
	v_mov_b32_e32 v6, 0
	s_mov_b32 s1, exec_lo
	s_waitcnt vmcnt(1)
	ds_store_b32 v6, v7 offset:1776
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e64 s6, v3
	s_cbranch_execz .LBB1_15
; %bb.14:
	global_load_b32 v2, v[0:1], off offset:-12
.LBB1_15:
	s_or_b32 exec_lo, exec_lo, s1
	global_load_b32 v7, v[0:1], off offset:336
	v_mov_b32_e32 v3, -1
	s_waitcnt vmcnt(1)
	ds_store_b32 v6, v2 offset:1792
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, s6, v7
	v_mov_b32_e32 v7, -1
	s_and_saveexec_b32 s1, vcc_lo
	s_cbranch_execz .LBB1_17
; %bb.16:
	global_load_b32 v7, v[0:1], off offset:340
.LBB1_17:
	s_or_b32 exec_lo, exec_lo, s1
	global_load_b32 v6, v[0:1], off offset:-336
	v_mov_b32_e32 v2, 0
	s_mov_b32 s1, exec_lo
	s_waitcnt vmcnt(1)
	ds_store_b32 v2, v7 offset:1768
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e64 s6, v6
	s_cbranch_execz .LBB1_19
; %bb.18:
	global_load_b32 v3, v[0:1], off offset:-332
.LBB1_19:                               ; %._crit_edge.sink.split
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt vmcnt(0)
	ds_store_b32 v2, v3 offset:1808
.LBB1_20:                               ; %Flow111
	s_or_b32 exec_lo, exec_lo, s0
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	buffer_gl0_inv
	global_load_b32 v9, v5, s[8:9] offset:4
	v_add_nc_u32_e64 v2, 0x400, 0
	ds_load_2addr_b32 v[0:1], v2 offset0:186 offset1:188
	ds_load_2addr_b32 v[7:8], v2 offset0:192 offset1:196
	v_add_co_u32 v2, s1, s8, v5
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, s9, 0, s1
	v_mov_b32_e32 v6, 0
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_cmp_eq_u32_e32 vcc_lo, v9, v1
	s_waitcnt lgkmcnt(0)
	v_cmp_eq_u32_e64 s0, v9, v7
	v_cmp_eq_u32_e64 s1, v9, v0
	v_cmp_eq_u32_e64 s2, v9, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(SALU_CYCLE_1)
	s_or_b32 s0, vcc_lo, s0
	v_add_co_u32 v0, vcc_lo, v2, 4
	v_add_co_ci_u32_e32 v1, vcc_lo, 0, v3, vcc_lo
	s_or_b32 s0, s0, s1
	s_or_b32 s1, s0, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB1_22
; %bb.21:
	v_mov_b32_e32 v7, s4
	global_store_b32 v[0:1], v7, off
.LBB1_22:
	s_or_b32 exec_lo, exec_lo, s0
	v_lshlrev_b32_e32 v4, 2, v4
	s_mov_b32 s2, exec_lo
	ds_store_b32 v4, v6
	ds_store_b8 v6, v6 offset:1764
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	buffer_gl0_inv
	global_load_b32 v6, v5, s[8:9]
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e32 0, v6
	s_cbranch_execz .LBB1_29
; %bb.23:
	global_load_b32 v6, v[2:3], off offset:-12
	s_mov_b32 s0, exec_lo
	s_waitcnt vmcnt(0)
	v_dual_mov_b32 v8, 1 :: v_dual_lshlrev_b32 v7, 2, v6
	ds_add_u32 v7, v8
	global_load_b32 v7, v[2:3], off offset:340
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e64 v7, v6
	s_cbranch_execz .LBB1_25
; %bb.24:
	v_lshlrev_b32_e32 v9, 2, v7
	ds_add_u32 v9, v8
.LBB1_25:
	s_or_b32 exec_lo, exec_lo, s0
	global_load_b32 v8, v[2:3], off offset:20
	s_waitcnt vmcnt(0)
	v_cmp_ne_u32_e32 vcc_lo, v8, v6
	v_cmp_ne_u32_e64 s0, v8, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, vcc_lo, s0
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB1_27
; %bb.26:
	v_dual_mov_b32 v10, 1 :: v_dual_lshlrev_b32 v9, 2, v8
	ds_add_u32 v9, v10
.LBB1_27:
	s_or_b32 exec_lo, exec_lo, s0
	global_load_b32 v9, v[2:3], off offset:-332
	s_waitcnt vmcnt(0)
	v_cmp_ne_u32_e32 vcc_lo, v9, v6
	v_cmp_ne_u32_e64 s0, v9, v8
	v_cmp_ne_u32_e64 s1, v9, v7
	s_delay_alu instid0(VALU_DEP_2)
	s_and_b32 s0, vcc_lo, s0
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, s1, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 exec_lo, exec_lo, s0
	s_cbranch_execz .LBB1_29
; %bb.28:
	v_dual_mov_b32 v7, 1 :: v_dual_lshlrev_b32 v6, 2, v9
	ds_add_u32 v6, v7
.LBB1_29:                               ; %Flow110
	s_or_b32 exec_lo, exec_lo, s2
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	buffer_gl0_inv
	global_load_b32 v6, v[0:1], off
	s_mov_b32 s0, exec_lo
	s_waitcnt vmcnt(0)
	v_lshlrev_b32_e32 v6, 2, v6
	ds_load_b32 v6, v6
	s_waitcnt lgkmcnt(0)
	v_cmpx_eq_u32_e32 0, v6
	s_cbranch_execz .LBB1_31
; %bb.30:
	v_mov_b32_e32 v7, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_mov_b32 v9, 1 :: v_dual_mov_b32 v8, v7
	ds_store_b8 v7, v9 offset:1764
	global_store_b64 v[2:3], v[7:8], off
.LBB1_31:
	s_or_b32 exec_lo, exec_lo, s0
	v_mov_b32_e32 v7, 0
	global_store_b32 v5, v6, s[8:9] offset:8
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	buffer_gl0_inv
	ds_load_u8 v5, v7 offset:1764
	s_waitcnt lgkmcnt(0)
	v_cmp_eq_u16_e32 vcc_lo, 0, v5
	s_cbranch_vccnz .LBB1_40
; %bb.32:
	ds_store_b32 v4, v7
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	buffer_gl0_inv
	global_load_b32 v6, v[2:3], off
	v_add_co_u32 v4, vcc_lo, v2, 8
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v3, vcc_lo
	s_mov_b32 s2, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e32 0, v6
	s_cbranch_execz .LBB1_39
; %bb.33:
	global_load_b32 v6, v[2:3], off offset:-12
	s_mov_b32 s0, exec_lo
	s_waitcnt vmcnt(0)
	v_dual_mov_b32 v8, 1 :: v_dual_lshlrev_b32 v7, 2, v6
	ds_add_u32 v7, v8
	global_load_b32 v7, v[2:3], off offset:340
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e64 v7, v6
	s_cbranch_execz .LBB1_35
; %bb.34:
	v_lshlrev_b32_e32 v9, 2, v7
	ds_add_u32 v9, v8
.LBB1_35:
	s_or_b32 exec_lo, exec_lo, s0
	global_load_b32 v8, v[2:3], off offset:20
	s_waitcnt vmcnt(0)
	v_cmp_ne_u32_e32 vcc_lo, v8, v6
	v_cmp_ne_u32_e64 s0, v8, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, vcc_lo, s0
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB1_37
; %bb.36:
	v_dual_mov_b32 v10, 1 :: v_dual_lshlrev_b32 v9, 2, v8
	ds_add_u32 v9, v10
.LBB1_37:
	s_or_b32 exec_lo, exec_lo, s0
	global_load_b32 v2, v[2:3], off offset:-332
	s_waitcnt vmcnt(0)
	v_cmp_ne_u32_e32 vcc_lo, v2, v6
	v_cmp_ne_u32_e64 s0, v2, v8
	v_cmp_ne_u32_e64 s1, v2, v7
	s_delay_alu instid0(VALU_DEP_2)
	s_and_b32 s0, vcc_lo, s0
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, s1, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 exec_lo, exec_lo, s0
	s_cbranch_execz .LBB1_39
; %bb.38:
	v_dual_mov_b32 v3, 1 :: v_dual_lshlrev_b32 v2, 2, v2
	ds_add_u32 v2, v3
.LBB1_39:                               ; %Flow107
	s_or_b32 exec_lo, exec_lo, s2
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	buffer_gl0_inv
	global_load_b32 v0, v[0:1], off
	s_waitcnt vmcnt(0)
	v_lshlrev_b32_e32 v0, 2, v0
	ds_load_b32 v0, v0
	s_waitcnt lgkmcnt(0)
	global_store_b32 v[4:5], v0, off
.LBB1_40:                               ; %Flow108
	s_and_not1_b32 s11, s11, exec_lo
.LBB1_41:                               ; %Flow117
	s_or_b32 exec_lo, exec_lo, s12
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s0, s3, exec_lo
	s_and_b32 s1, s11, exec_lo
	s_or_b32 s3, s0, s1
.LBB1_42:                               ; %Flow114
	s_or_b32 exec_lo, exec_lo, s10
	s_and_saveexec_b32 s0, s3
	s_cbranch_execz .LBB1_44
; %bb.43:
	v_mov_b32_e32 v0, 0
	ds_store_b32 v0, v0
.LBB1_44:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9playBoardP10BoardPointP9DebugFlagiii
		.amdhsa_group_segment_fixed_size 1812
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 28
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 11
		.amdhsa_next_free_sgpr 13
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z9playBoardP10BoardPointP9DebugFlagiii, .Lfunc_end1-_Z9playBoardP10BoardPointP9DebugFlagiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1556
; NumSgprs: 15
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 1812 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 15
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z15updateLegleMoveP10BoardPointP9DebugFlagi ; -- Begin function _Z15updateLegleMoveP10BoardPointP9DebugFlagi
	.globl	_Z15updateLegleMoveP10BoardPointP9DebugFlagi
	.p2align	8
	.type	_Z15updateLegleMoveP10BoardPointP9DebugFlagi,@function
_Z15updateLegleMoveP10BoardPointP9DebugFlagi: ; @_Z15updateLegleMoveP10BoardPointP9DebugFlagi
; %bb.0:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v0, v0, 10, 10
	s_load_b32 s0, s[0:1], 0x10
	s_mov_b32 s1, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u32_u24 v3, v0, 21, v1
	v_lshlrev_b32_e32 v2, 4, v3
	s_waitcnt lgkmcnt(0)
	global_load_b32 v0, v2, s[4:5]
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e32 0, v0
	s_xor_b32 s1, exec_lo, s1
	s_cbranch_execz .LBB2_8
; %bb.1:                                ; %NodeBlock90
	s_cmp_lt_i32 s0, 2
	s_mov_b32 s2, -1
	s_cbranch_scc1 .LBB2_5
; %bb.2:                                ; %LeafBlock88
	s_cmp_eq_u32 s0, 2
	s_cbranch_scc0 .LBB2_4
; %bb.3:
	v_mov_b32_e32 v0, 0
	global_store_b8 v2, v0, s[4:5] offset:13
.LBB2_4:                                ; %Flow
	s_mov_b32 s2, 0
.LBB2_5:                                ; %Flow93
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s2
                                        ; implicit-def: $vgpr3
	s_cbranch_vccnz .LBB2_8
; %bb.6:                                ; %LeafBlock86
	s_cmp_lg_u32 s0, 1
                                        ; implicit-def: $vgpr3
	s_cbranch_scc1 .LBB2_8
; %bb.7:
	v_mov_b32_e32 v0, 0
                                        ; implicit-def: $vgpr3
	global_store_b8 v2, v0, s[4:5] offset:12
                                        ; implicit-def: $vgpr2
.LBB2_8:                                ; %Flow109
	s_and_not1_saveexec_b32 s1, s1
	s_cbranch_execz .LBB2_41
; %bb.9:
	v_add_co_u32 v0, s1, s4, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v1, null, s5, 0, s1
	s_mov_b32 s1, exec_lo
                                        ; implicit-def: $vgpr4
	global_load_b32 v5, v[0:1], off offset:-16
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e64 s0, v5
	s_xor_b32 s1, exec_lo, s1
; %bb.10:
	v_cmp_eq_u32_e32 vcc_lo, 0, v5
	v_cndmask_b32_e64 v4, 0, 1, vcc_lo
; %bb.11:                               ; %Flow108
	s_and_not1_saveexec_b32 s1, s1
	s_cbranch_execz .LBB2_13
; %bb.12:
	global_load_b32 v4, v[0:1], off offset:-8
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v4, -1, v4
.LBB2_13:
	s_or_b32 exec_lo, exec_lo, s1
	global_load_b32 v6, v[0:1], off offset:16
	s_mov_b32 s1, exec_lo
                                        ; implicit-def: $vgpr5
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e64 s0, v6
	s_xor_b32 s1, exec_lo, s1
; %bb.14:
	v_cmp_eq_u32_e32 vcc_lo, 0, v6
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v4, vcc_lo
                                        ; implicit-def: $vgpr4
; %bb.15:                               ; %Flow107
	s_and_not1_saveexec_b32 s1, s1
	s_cbranch_execz .LBB2_17
; %bb.16:
	global_load_b32 v5, v[0:1], off offset:24
	s_waitcnt vmcnt(0)
	v_add3_u32 v5, v4, v5, -1
.LBB2_17:
	s_or_b32 exec_lo, exec_lo, s1
	global_load_b32 v6, v[0:1], off offset:-336
	s_mov_b32 s1, exec_lo
                                        ; implicit-def: $vgpr4
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e64 s0, v6
	s_xor_b32 s1, exec_lo, s1
; %bb.18:
	v_cmp_eq_u32_e32 vcc_lo, 0, v6
	v_add_co_ci_u32_e32 v4, vcc_lo, 0, v5, vcc_lo
                                        ; implicit-def: $vgpr5
; %bb.19:                               ; %Flow106
	s_and_not1_saveexec_b32 s1, s1
	s_cbranch_execz .LBB2_21
; %bb.20:
	global_load_b32 v4, v[0:1], off offset:-328
	s_waitcnt vmcnt(0)
	v_add3_u32 v4, v5, v4, -1
.LBB2_21:
	s_or_b32 exec_lo, exec_lo, s1
	global_load_b32 v6, v[0:1], off offset:336
	s_mov_b32 s1, exec_lo
                                        ; implicit-def: $vgpr5
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e64 s0, v6
	s_xor_b32 s1, exec_lo, s1
; %bb.22:
	v_cmp_eq_u32_e32 vcc_lo, 0, v6
                                        ; implicit-def: $vgpr0_vgpr1
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v4, vcc_lo
                                        ; implicit-def: $vgpr4
; %bb.23:                               ; %Flow105
	s_and_not1_saveexec_b32 s1, s1
	s_cbranch_execz .LBB2_25
; %bb.24:
	global_load_b32 v0, v[0:1], off offset:344
	s_waitcnt vmcnt(0)
	v_add3_u32 v5, v4, v0, -1
.LBB2_25:
	s_or_b32 exec_lo, exec_lo, s1
	v_mad_u64_u32 v[0:1], null, v3, 28, s[6:7]
	s_mov_b32 s1, exec_lo
	global_store_b32 v[0:1], v5, off offset:24
	v_cmpx_gt_i32_e32 1, v5
	s_xor_b32 s1, exec_lo, s1
	s_cbranch_execz .LBB2_33
; %bb.26:                               ; %NodeBlock84
	s_cmp_lt_i32 s0, 2
	s_mov_b32 s2, -1
	s_cbranch_scc1 .LBB2_30
; %bb.27:                               ; %LeafBlock82
	s_cmp_eq_u32 s0, 2
	s_cbranch_scc0 .LBB2_29
; %bb.28:
	v_mov_b32_e32 v0, 0
	global_store_b8 v2, v0, s[4:5] offset:13
.LBB2_29:                               ; %Flow95
	s_mov_b32 s2, 0
.LBB2_30:                               ; %Flow97
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s2
	s_cbranch_vccnz .LBB2_33
; %bb.31:                               ; %LeafBlock80
	s_cmp_lg_u32 s0, 1
	s_cbranch_scc1 .LBB2_33
; %bb.32:
	v_mov_b32_e32 v0, 0
	global_store_b8 v2, v0, s[4:5] offset:12
                                        ; implicit-def: $vgpr2
.LBB2_33:                               ; %Flow103
	s_and_not1_saveexec_b32 s1, s1
	s_cbranch_execz .LBB2_41
; %bb.34:                               ; %NodeBlock
	s_cmp_lt_i32 s0, 2
	s_mov_b32 s1, -1
	s_cbranch_scc1 .LBB2_38
; %bb.35:                               ; %LeafBlock78
	s_cmp_eq_u32 s0, 2
	s_cbranch_scc0 .LBB2_37
; %bb.36:
	v_mov_b32_e32 v0, 1
	global_store_b8 v2, v0, s[4:5] offset:13
.LBB2_37:                               ; %Flow99
	s_mov_b32 s1, 0
.LBB2_38:                               ; %Flow101
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s1
	s_cbranch_vccnz .LBB2_41
; %bb.39:                               ; %LeafBlock
	s_cmp_lg_u32 s0, 1
	s_cbranch_scc1 .LBB2_41
; %bb.40:
	v_mov_b32_e32 v0, 1
	global_store_b8 v2, v0, s[4:5] offset:12
.LBB2_41:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z15updateLegleMoveP10BoardPointP9DebugFlagi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 20
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 7
		.amdhsa_next_free_sgpr 8
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z15updateLegleMoveP10BoardPointP9DebugFlagi, .Lfunc_end2-_Z15updateLegleMoveP10BoardPointP9DebugFlagi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 636
; NumSgprs: 10
; NumVgprs: 7
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 10
; NumVGPRsForWavesPerEU: 7
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.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_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 8
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9initBoardP10BoardPoint
    .private_segment_fixed_size: 0
    .sgpr_count:     7
    .sgpr_spill_count: 0
    .symbol:         _Z9initBoardP10BoardPoint.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     3
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 1812
    .kernarg_segment_align: 8
    .kernarg_segment_size: 28
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9playBoardP10BoardPointP9DebugFlagiii
    .private_segment_fixed_size: 0
    .sgpr_count:     15
    .sgpr_spill_count: 0
    .symbol:         _Z9playBoardP10BoardPointP9DebugFlagiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 20
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z15updateLegleMoveP10BoardPointP9DebugFlagi
    .private_segment_fixed_size: 0
    .sgpr_count:     10
    .sgpr_spill_count: 0
    .symbol:         _Z15updateLegleMoveP10BoardPointP9DebugFlagi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     7
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
