#include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>

const int INF = 10000000;
const int V = 10010;
void input(char *inFileName);
void output(char *outFileName);

void block_FW();
int ceil(int a, int b);
void callP1(int r);
void callP2(int r, 
int *block_start_x, int *block_start_y, 
int *block_height, int *block_width);
__global__ void cal_Pone(int* Dist_ij);
__global__ void cal_Ptwo(int* Dist_ij, int* Dist_ik, int* Dist_kj);


int n, m, B;	// Number of vertices, edges
static int Dist[V][V];
//int* Dist;

int main(int argc, char* argv[])
{
	cudaSetDevice(0);
	input(argv[1]);
	B = atoi(argv[3]);
	if(B < 1)
		B = 1;
	else if(B > 32)
		B = 32;
	/*
	cudaDeviceProp prop;
    if(cudaGetDeviceProperties(&prop, 0) == cudaSuccess) 
	{
    	printf("cuda version = %d \n" , prop.major ) ;
		printf("maxThreadsPerBlock = %d \n" , prop.maxThreadsPerBlock ) ;
		printf("totalGlobalMem = %d \n" , prop.totalGlobalMem ) ;
		printf(" maxThreadsDim[3] = %d, %d, %d\n" , prop.maxThreadsDim[1], prop.maxThreadsDim[2] , prop.maxThreadsDim[3] ) ;
		printf(" maxGridSize[3] = %d, %d, %d\n" , prop.maxGridSize[1] , prop.maxGridSize[2] , prop.maxGridSize[3] ) ;
    }
	//cuda version: 2
	//maxThreadsPerBlock: 1024
	//totalGlobalMem: 2066153472
	//maxThreadsDim: 1024, 64, 65535
	//maxGridSize: 65535, 65535, 1301000
	//*/
	block_FW();
	
	
	output(argv[2]);
	

	return 0;
}

void input(char *inFileName)
{
	FILE *infile = fopen(inFileName, "r");
	fscanf(infile, "%d %d", &n, &m);
	
	

	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			if (i == j)	Dist[i][j] = 0;
			else		Dist[i][j] = INF;
		}
	}

	while (--m >= 0) {
		int a, b, v;
		fscanf(infile, "%d %d %d", &a, &b, &v);
		--a, --b;
		Dist[a][b] = v;
	}
}

void output(char *outFileName)
{
	FILE *outfile = fopen(outFileName, "w");
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			if (Dist[i][j] >= INF)	fprintf(outfile, "INF ");
			else					fprintf(outfile, "%d ", Dist[i][j]);
		}
		fprintf(outfile, "\n");
	}		
}

int ceil(int a, int b)
{
	return (a + b -1)/b;
}

void block_FW()
{
	int round = ceil(n, B);
	
	
	for (int r = 0; r < round; ++r) {
		/* Phase 1*/
		//printf("[%d]This is callP1\n", r);
		callP1(r);
		
		
		/* Phase 2*/
		//printf("This is Phase 2\n");
		int block_start_x[4] = {r,		r, 0,	r + 1};
		int block_start_y[4] = {0,	r + 1, r,		r};
		int block_height[4] = {1, 				1, r,	round - r - 1};
		int block_width[4] = {r,	round - r - 1, 1, 				1};
		callP2(r, block_start_x, block_start_y,
			block_height, block_width);
		/* hase 3*/
		//printf("This is Phase 3\n");
		int block_start_x2[4] = {0, 	0,	r + 1, r + 1};
		int block_start_y2[4] = {0,	r + 1,		0, r + 1};
		int block_height2[4] = {r, r,	round - r -1,	round - r -1};
		int block_width2[4] = {r,	round - r -1, r,	round - r -1};
		callP2(r, block_start_x2, block_start_y2,
			block_height2, block_width2);
		//printf("End one turn\n");
	}

}
void putInAij(int bias_y, int* Dist_ij){
		
	int i, j;
	bias_y *= B;
	//為何要重新歷過一遍?比原本的還慢!!
	//因要解決IO問題，不想直接IO全部
	//真的有比較差??不是被"資源利用率"騙到?(IO全部VS處理完再IO部分)

	int jlen = B;
	int itmp ;
	int jtmp ;
	// b+j > n
	if(bias_y + jlen > n)
		jlen = n - bias_y;
	// part 1: <, <
	for(i = 0; i < jlen; ++i){
		itmp = bias_y + i;
		for(j = 0; j < jlen; ++j){
			jtmp = bias_y + j;
			Dist_ij[i * B + j] = Dist[itmp][jtmp];
		}
	}
	itmp = (jlen -1) * B;
	// part 3: >, <=
	for(i = jlen; i < B; ++i)
		for(j = 0; j < jlen; ++j)
			Dist_ij[i * B + j] = Dist_ij[itmp + j];
	// part 2: >, >
	jtmp += jlen -1;//(jlen -1) *B + (jlen -1);
	for(i = jlen; i < B; ++i)
		for(j = jlen; j < B; ++j)
			Dist_ij[i * B + j] = Dist_ij[jtmp];
	// part 4: <=, >
	jtmp = (jlen -1);
	for(i = 0; i < jlen; ++i){
		itmp = i *B;
		for(j = jlen; j < B; ++j){
			Dist_ij[itmp + j] = Dist_ij[itmp + jtmp];
		}
	}
}
void putDistInArray_new(int round, int bias_x, int bias_y, 
	int block_height, int block_width,
	int* Dist_ij2, int* Dist_ik2, int* Dist_kj2){
		
	int itmp, jtmp, ktmp, i2, j, k;
	int kbias = round * B;
	int end_x = block_height * B;
	int end_y = block_width * B;
	bias_x *= B;
	bias_y *= B;
	//為何要重新歷過一遍?比原本的還慢!!
	//因要解決IO問題，不想直接IO全部
	//真的有比較差??不是被"資源利用率"騙到?(IO全部VS處理完再IO部分)
	int ilen = end_x;
	int jlen = end_y;
	int klen = B;
	// b+i2 > n
	if(bias_x + ilen > n)
		ilen = n - bias_x;
	// b+j > n
	if(bias_y + jlen > n)
		jlen = n - bias_y;
	// b+j > n
	if(kbias + klen > n)
		klen = n - kbias;
	
	// part 1: <, <, <
	for(i2 = 0; i2 < ilen; ++i2){
		itmp = bias_x + i2;
		for(j = 0; j < jlen; ++j){
			jtmp = bias_y + j;
			Dist_ij2[i2 * end_y + j] = Dist[itmp][jtmp];
		}
	}
	// part 5: <, <, <
	for(k = 0; k < klen; ++k){
		ktmp = k + kbias;
		for(j = 0; j < jlen; ++j){
			jtmp = bias_y + j;
			Dist_kj2[k * end_y + j] = Dist[ktmp][jtmp];
		}
		for(i2 = 0; i2 < ilen; ++i2){
			itmp = bias_x + i2;
			Dist_ik2[i2 * B + k] = Dist[itmp][ktmp];
		}
	}
	// part 5-2: <, X, > ||  X, <, >
	ktmp = klen - 1;
	jtmp = ktmp * end_y;
	for(k = klen; k < B; ++k){
		for(i2 = 0; i2 < ilen; ++i2){
			itmp = i2 * B;
			Dist_ik2[itmp+ k] = Dist_ik2[itmp + ktmp];
		}
		for(j = 0; j < jlen; ++j)
			Dist_kj2[k * end_y + j] = Dist_kj2[jtmp + j];
	}
	// part 3: >, <, X
	itmp = (ilen -1) *end_y;
	for(i2 = ilen; i2 < end_x; ++i2)
		for(j = 0; j < jlen; ++j)
			Dist_ij2[i2 * end_y + j] = Dist_ij2[itmp + j];
	// part 2: >, >, X
	itmp += jlen -1;//(ilen -1) * end_y + (jlen -1);
	for(i2 = ilen; i2 < end_x; ++i2)
		for(j = jlen; j < end_y; ++j)
			Dist_ij2[i2 * end_y + j] = Dist_ij2[itmp];
	
	// part 5-3: >, X, > || X, >, >
	itmp = (ilen -1) * B + (klen -1);
	jtmp += jlen -1;//(klen -1) * end_y + (jlen -1);
	for(k = klen; k < B; ++k){
		for(i2 = ilen; i2 < end_x; ++i2)
			Dist_ik2[i2 * B + k] = Dist_ik2[itmp];
		for(j = jlen; j < end_y; ++j)
			Dist_kj2[k * end_y + j] = Dist_kj2[jtmp];
	}
	// part 5-4: >, X, < || X, <, <
	itmp -= klen -1;//(ilen -1) * B ;
	jtmp = jlen -1;
	for(k = 0; k < klen; ++k){
		ktmp = k * end_y;
		for(i2 = ilen; i2 < end_x; ++i2)
			Dist_ik2[i2 * B + k] = Dist_ik2[itmp + k];
		for(j = jlen; j < end_y; ++j)
			Dist_kj2[ktmp + j] = Dist_kj2[ktmp + jtmp];
	}
	// part 4: <, >, X
	for(i2 = 0; i2 < ilen; ++i2){
		itmp = i2 * end_y;
		for(j = jlen; j < end_y; ++j)
			Dist_ij2[itmp + j] = Dist_ij2[itmp + jtmp];
	}
	
	
}

void putToDist(int round, int bias_x, int bias_y, 
	int block_height, int block_width,
	int* Dist_ij){
	
	int itmp, jtmp;
	int end_x = block_height * B;
	int end_y = block_width * B;
	int ilen = end_x;
	int jlen = end_y;
	bias_x *= B;
	bias_y *= B;
	if(end_x + bias_x > n)// if [ind_end+1] > n, change,if == ,no c
		ilen = n - bias_x;
	if(end_y + bias_y > n)
		jlen = n - bias_y;
	
	for(int i = 0; i < ilen; ++i){
		itmp = bias_x + i;
		for(int j = 0; j < jlen; ++j){
			jtmp = bias_y + j;
			Dist[itmp][jtmp] = Dist_ij[i * end_y + j];
		}
	}
}

void callP1(int r){
	
	int shm_size = sizeof(int) * B * B;
	dim3 blocksPerGrif1(1, 1);
	dim3 threadsPerBlock(B, B);
	
	int *Dist_ij;
	cudaError_t err = cudaMallocHost(&Dist_ij, shm_size );
	if (err != 0)	printf("malloc Dist_ij error\n");
	putInAij( r, Dist_ij);
	
	int *Dist_ijg;
	
	//step 1: declare
	cudaMalloc((void **)&Dist_ijg, shm_size);
	//step 2: copy
	cudaMemcpy(Dist_ijg, Dist_ij, shm_size, cudaMemcpyHostToDevice);
	
	cal_Pone<<< blocksPerGrif1 , threadsPerBlock , shm_size>>> 
		(Dist_ijg);
	//step 3: get return
	cudaMemcpy(Dist_ij, Dist_ijg, shm_size, cudaMemcpyDeviceToHost);
	//step 4: free gpu
	cudaFree(Dist_ijg);
	putToDist(r, r, r, 1, 1, Dist_ij);
	
	cudaFreeHost(Dist_ij);
	
}
void callP2(int r, 
int *block_start_x, int *block_start_y, 
int *block_height, int *block_width){
	
	int shm_size = sizeof(int) * B * B;
	dim3 threadsPerBlock(B, B);
	const int str_num = 4;
	cudaStream_t stream[str_num];
	for(int i = 0; i < str_num; i++)
		cudaStreamCreate(&stream[i]);
	int *Dist_all[str_num *6];// pointer array
	cudaError_t err;
	for(int i = 0; i < str_num; ++i){
		if( block_height[i] == 0 || block_width[i] == 0)
			continue;
		dim3 blocksPerGrif1( block_height[i], block_width[i]);
		int *Dist_ij2, *Dist_ik2, *Dist_kj2;
		
		err = cudaMallocHost(&Dist_ij2, shm_size * block_height[i] * block_width[i]);
		if (err != 0)	printf("malloc Dist_ij2 error\n");
		err = cudaMallocHost(&Dist_ik2, shm_size * block_height[i]);
		if (err != 0)	printf("malloc Dist_ik2 error\n");
		err = cudaMallocHost(&Dist_kj2, shm_size * block_width[i]);
		if (err != 0)	printf("malloc Dist_kj2 error\n");
		putDistInArray_new(r, block_start_x[i], block_start_y[i], 
			block_height[i], block_width[i], Dist_ij2, Dist_ik2, Dist_kj2);
		
		Dist_all[i *6] = Dist_ij2;
		Dist_all[i *6 +1] = Dist_ik2;
		Dist_all[i *6 +2] = Dist_kj2;
		int *Dist_ijg2, *Dist_ikg2, *Dist_kjg2;
		//step 1: declare
		cudaMalloc((void **)&Dist_ijg2, shm_size * block_height[i] * block_width[i]);
		cudaMalloc((void **)&Dist_ikg2, shm_size * block_height[i]);
		cudaMalloc((void **)&Dist_kjg2, shm_size * block_width[i]);
		Dist_all[i *6 +3] = Dist_ijg2;
		Dist_all[i *6 +4] = Dist_ikg2;
		Dist_all[i *6 +5] = Dist_kjg2;
		//step 2: copy
		cudaMemcpyAsync(Dist_ijg2, Dist_ij2, shm_size * block_height[i] * block_width[i], 
			cudaMemcpyHostToDevice, stream[i]);
		cudaMemcpyAsync(Dist_ikg2, Dist_ik2, shm_size * block_height[i], 
			cudaMemcpyHostToDevice, stream[i]);
		cudaMemcpyAsync(Dist_kjg2, Dist_kj2, shm_size * block_width[i], 
			cudaMemcpyHostToDevice, stream[i]);
	
		cal_Ptwo<<< blocksPerGrif1 , threadsPerBlock , shm_size, stream[i]>>> 
			(Dist_ijg2, Dist_ikg2, Dist_kjg2);
		//step 3: get return
		cudaMemcpyAsync(Dist_ij2, Dist_ijg2, shm_size * block_height[i] * block_width[i], 
			cudaMemcpyDeviceToHost, stream[i]);
	}
	//wait for stream
	for(int i = 0; i < str_num; i++){
		if( block_height[i] == 0 || block_width[i] == 0)
			continue;
		cudaStreamSynchronize(stream[i]);
		putToDist(r, block_start_x[i], block_start_y[i],
			block_height[i], block_width[i], Dist_all[i *6]);
		//step 4: free gpu
		cudaFree(Dist_all[i *6 +3]);
		cudaFree(Dist_all[i *6 +4]);
		cudaFree(Dist_all[i *6 +5]);
		cudaFreeHost(Dist_all[i *6]);
		cudaFreeHost(Dist_all[i *6 +1]);
		cudaFreeHost(Dist_all[i *6 +2]);
			
		cudaStreamDestroy(stream[i]);
		
	}
}

__global__ void cal_Pone(int* Dist_ij)
{
	int i = blockIdx.x * blockDim.x + threadIdx.x;
	int j = blockIdx.y * blockDim.y + threadIdx.y;
	extern __shared__ int DS[];
	int dsbias = threadIdx.x * blockDim.y + threadIdx.y;
	int offset_j = gridDim.y * blockDim.y;
	DS[dsbias] = Dist_ij[i * offset_j + j];//j range = blocksPerG.y
	__syncthreads();
	for (int k = 0; k < blockDim.x ; ++k) {//k range= B
		if (DS[i * blockDim.x + k] + DS[k * offset_j + j] < DS[dsbias])
			DS[dsbias] = DS[i * blockDim.x + k] + DS[k * offset_j + j];
		__syncthreads();
	}
	Dist_ij[i * offset_j + j] = DS[dsbias];// save value to shared memory
	__syncthreads();
	
}
__global__ void cal_Ptwo(int* Dist_ij, int* Dist_ik, int* Dist_kj)
{
	int i = blockIdx.x * blockDim.x + threadIdx.x;
	int j = blockIdx.y * blockDim.y + threadIdx.y;
	extern __shared__ int DS[];
	int dsbias = threadIdx.x * blockDim.y + threadIdx.y;
	int offset_j = gridDim.y * blockDim.y;
	DS[dsbias] = Dist_ij[i * offset_j + j];//j range = blocksPerG.y
	__syncthreads();
	for (int k = 0; k < blockDim.x ; ++k) {//k range= B
		if (Dist_ik[i * blockDim.x + k] + Dist_kj[k * offset_j + j] < DS[dsbias])
			DS[dsbias] = Dist_ik[i * blockDim.x + k] + Dist_kj[k * offset_j + j];
	}
	Dist_ij[i * offset_j + j] = DS[dsbias];// save value to shared memory
	__syncthreads();
}

/*
void cal(int B, int Round, 
	int block_start_x, int block_start_y, 
	int block_width, int block_height)
{
	int block_end_x = block_start_x + block_height;
	int block_end_y = block_start_y + block_width;

	for (int b_i =  block_start_x; b_i < block_end_x; ++b_i) {
		for (int b_j = block_start_y; b_j < block_end_y; ++b_j) {
			// To calculate B*B elements in the block (b_i, b_j)
			// For each block, it need to compute B times
			for (int k = Round * B; k < (Round +1) * B && k < n; ++k) {
				// To calculate original index of elements in the block (b_i, b_j)
				// For instance, original index of (0,0) in block (1,2) is (2,5) for V=6,B=2
				int block_internal_start_x 	= b_i * B;
				int block_internal_end_x 	= (b_i +1) * B;
				int block_internal_start_y = b_j * B; 
				int block_internal_end_y 	= (b_j +1) * B;

				if (block_internal_end_x > n)	block_internal_end_x = n;
				if (block_internal_end_y > n)	block_internal_end_y = n;

				for (int i = block_internal_start_x; i < block_internal_end_x; ++i) {
					for (int j = block_internal_start_y; j < block_internal_end_y; ++j) {
						if (Dist[i * n + k] + Dist[k * n + j] < Dist[i * n + j])
							Dist[i * n + j] = Dist[i * n + k] + Dist[k * n + j];
					}
				}
			}
		}
	}
}
*/


	.file	"tmpxft_00248064_00000000-6_HW4_105061516_cuda.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2039:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2039:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"r"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d"
	.text
	.globl	_Z5inputPc
	.type	_Z5inputPc, @function
_Z5inputPc:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	fopen@PLT
	leaq	m(%rip), %rcx
	leaq	n(%rip), %rdx
	movq	%rax, %rdi
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rbx
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	movl	n(%rip), %esi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	leaq	_ZL4Dist(%rip), %rcx
	movl	$10000000, %edi
	movq	%rcx, %r12
.L3:
	cmpl	%edx, %esi
	jle	.L14
	xorl	%eax, %eax
.L5:
	cmpl	%eax, %edx
	movl	%r8d, %r9d
	cmovne	%edi, %r9d
	movl	%r9d, (%rcx,%rax,4)
	incq	%rax
	cmpl	%eax, %esi
	jg	.L5
	incl	%edx
	addq	$40040, %rcx
	jmp	.L3
.L14:
	leaq	.LC2(%rip), %rbp
.L6:
	decl	m(%rip)
	js	.L15
	leaq	12(%rsp), %rdx
	leaq	16(%rsp), %rcx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	leaq	20(%rsp), %r8
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	12(%rsp), %eax
	movslq	%edx, %rdx
	decl	%eax
	cltq
	imulq	$10010, %rax, %rax
	addq	%rdx, %rax
	movl	20(%rsp), %edx
	movl	%edx, (%r12,%rax,4)
	jmp	.L6
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	addq	$32, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z5inputPc, .-_Z5inputPc
	.section	.rodata.str1.1
.LC3:
	.string	"w"
.LC4:
	.string	"INF "
.LC5:
	.string	"%d "
.LC6:
	.string	"\n"
	.text
	.globl	_Z6outputPc
	.type	_Z6outputPc, @function
_Z6outputPc:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC3(%rip), %rsi
	leaq	_ZL4Dist(%rip), %r15
	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
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	pushq	%rdx
	.cfi_def_cfa_offset 64
	call	fopen@PLT
	movq	%rax, %rbx
.L17:
	cmpl	%r12d, n(%rip)
	jle	.L16
	imulq	$40040, %r12, %r13
	xorl	%ebp, %ebp
	leaq	.LC5(%rip), %r14
	addq	%r15, %r13
.L22:
	cmpl	%ebp, n(%rip)
	jle	.L24
	movl	0(%r13,%rbp,4), %ecx
	cmpl	$9999999, %ecx
	jle	.L18
	leaq	.LC4(%rip), %rdx
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	jmp	.L19
.L18:
	movq	%r14, %rdx
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L19:
	incq	%rbp
	jmp	.L22
.L24:
	leaq	.LC6(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	incq	%r12
	movl	$2, %esi
	call	__fprintf_chk@PLT
	jmp	.L17
.L16:
	popq	%rax
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z6outputPc, .-_Z6outputPc
	.globl	_Z4ceilii
	.type	_Z4ceilii, @function
_Z4ceilii:
.LFB2030:
	.cfi_startproc
	endbr64
	leal	-1(%rsi,%rdi), %eax
	cltd
	idivl	%esi
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z4ceilii, .-_Z4ceilii
	.globl	_Z8putInAijiPi
	.type	_Z8putInAijiPi, @function
_Z8putInAijiPi:
.LFB2032:
	.cfi_startproc
	endbr64
	movl	B(%rip), %eax
	movl	n(%rip), %ecx
	movq	%rsi, %rdx
	imull	%eax, %edi
	leal	(%rax,%rdi), %esi
	cmpl	%ecx, %esi
	jle	.L27
	movl	%ecx, %eax
	subl	%edi, %eax
.L27:
	movslq	%edi, %rcx
	leaq	_ZL4Dist(%rip), %rsi
	xorl	%r9d, %r9d
	imulq	$40044, %rcx, %rcx
	leal	-1(%rax,%rdi), %r10d
	addq	%rsi, %rcx
.L28:
	cmpl	%eax, %r9d
	jge	.L44
	xorl	%esi, %esi
.L29:
	movl	B(%rip), %edi
	movl	(%rcx,%rsi,4), %r8d
	imull	%r9d, %edi
	addl	%esi, %edi
	incq	%rsi
	movslq	%edi, %rdi
	movl	%r8d, (%rdx,%rdi,4)
	cmpl	%esi, %eax
	jg	.L29
	movl	%r10d, %r8d
	incl	%r9d
	addq	$40040, %rcx
	jmp	.L28
.L44:
	movl	B(%rip), %ecx
	leal	-1(%rax), %edi
	movl	%eax, %r9d
	imull	%edi, %ecx
	movslq	%ecx, %rcx
	leaq	(%rdx,%rcx,4), %r10
.L30:
	cmpl	%r9d, B(%rip)
	jle	.L45
	xorl	%esi, %esi
.L32:
	movl	B(%rip), %ecx
	cmpl	%esi, %eax
	jle	.L46
	imull	%r9d, %ecx
	movl	(%r10,%rsi,4), %r11d
	addl	%esi, %ecx
	incq	%rsi
	movslq	%ecx, %rcx
	movl	%r11d, (%rdx,%rcx,4)
	jmp	.L32
.L46:
	incl	%r9d
	jmp	.L30
.L45:
	addl	%edi, %r8d
	movl	%eax, %esi
	movslq	%r8d, %r8
	leaq	(%rdx,%r8,4), %r9
.L33:
	cmpl	%esi, B(%rip)
	jle	.L47
	movl	%eax, %r8d
.L35:
	movl	B(%rip), %ecx
	cmpl	%r8d, %ecx
	jle	.L48
	imull	%esi, %ecx
	movl	(%r9), %r10d
	addl	%r8d, %ecx
	incl	%r8d
	movslq	%ecx, %rcx
	movl	%r10d, (%rdx,%rcx,4)
	jmp	.L35
.L48:
	incl	%esi
	jmp	.L33
.L47:
	xorl	%ecx, %ecx
.L36:
	cmpl	%eax, %ecx
	jge	.L49
	movl	B(%rip), %r8d
	imull	%ecx, %r8d
	leal	(%r8,%rdi), %esi
	movslq	%r8d, %r8
	movslq	%esi, %rsi
	leaq	(%rdx,%r8,4), %r8
	leaq	(%rdx,%rsi,4), %r9
	movslq	%eax, %rsi
.L37:
	cmpl	%esi, B(%rip)
	jle	.L50
	movl	(%r9), %r10d
	movl	%r10d, (%r8,%rsi,4)
	incq	%rsi
	jmp	.L37
.L50:
	incl	%ecx
	jmp	.L36
.L49:
	ret
	.cfi_endproc
.LFE2032:
	.size	_Z8putInAijiPi, .-_Z8putInAijiPi
	.globl	_Z18putDistInArray_newiiiiiPiS_S_
	.type	_Z18putDistInArray_newiiiiiPiS_S_, @function
_Z18putDistInArray_newiiiiiPiS_S_:
.LFB2033:
	.cfi_startproc
	endbr64
	movl	B(%rip), %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edx, %r11d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	imull	%eax, %ecx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	imull	%eax, %esi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	imull	%eax, %edi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%ecx, %r10d
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	n(%rip), %ebx
	imull	%eax, %r8d
	movslq	%esi, %rcx
	imull	%eax, %r11d
	movl	%r10d, %esi
	movslq	%edi, %rdx
	leal	(%r10,%rcx), %edi
	cmpl	%ebx, %edi
	jle	.L52
	movl	%ebx, %esi
	subl	%ecx, %esi
.L52:
	leal	(%r8,%r11), %ebp
	movl	%r8d, %edi
	cmpl	%ebp, %ebx
	jge	.L53
	movl	%ebx, %edi
	subl	%r11d, %edi
.L53:
	leal	(%rax,%rdx), %ebp
	cmpl	%ebp, %ebx
	jge	.L54
	movl	%ebx, %eax
	subl	%edx, %eax
.L54:
	imulq	$10010, %rcx, %rcx
	movslq	%r11d, %r11
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	leaq	_ZL4Dist(%rip), %rbp
	movq	%rcx, -16(%rsp)
	leaq	(%rcx,%r11), %rbx
	leaq	0(%rbp,%rbx,4), %r14
.L55:
	cmpl	%esi, %r12d
	jge	.L99
	movslq	%r13d, %rbx
	leaq	(%r9,%rbx,4), %r15
	xorl	%ebx, %ebx
.L56:
	cmpl	%ebx, %edi
	jle	.L100
	movl	(%r14,%rbx,4), %ecx
	movl	%ecx, (%r15,%rbx,4)
	incq	%rbx
	jmp	.L56
.L100:
	incl	%r12d
	addl	%r8d, %r13d
	addq	$40040, %r14
	jmp	.L55
.L99:
	movq	-16(%rsp), %rcx
	addq	%rdx, %rcx
	imulq	$10010, %rdx, %rdx
	leaq	0(%rbp,%rcx,4), %rbx
	xorl	%ecx, %ecx
	addq	%r11, %rdx
	leaq	0(%rbp,%rdx,4), %r12
	xorl	%ebp, %ebp
.L59:
	cmpl	%eax, %ecx
	jge	.L101
	movq	64(%rsp), %r15
	movslq	%ebp, %rdx
	leaq	(%r15,%rdx,4), %r11
	xorl	%edx, %edx
.L60:
	cmpl	%edx, %edi
	jle	.L102
	movl	(%r12,%rdx,4), %r13d
	movl	%r13d, (%r11,%rdx,4)
	incq	%rdx
	jmp	.L60
.L102:
	movq	%rbx, %r13
	xorl	%r11d, %r11d
.L62:
	cmpl	%esi, %r11d
	jge	.L103
	movl	0(%r13), %r14d
	movl	B(%rip), %edx
	addq	$40040, %r13
	movq	56(%rsp), %r15
	imull	%r11d, %edx
	incl	%r11d
	addl	%ecx, %edx
	movslq	%edx, %rdx
	movl	%r14d, (%r15,%rdx,4)
	jmp	.L62
.L103:
	incl	%ecx
	addq	$4, %rbx
	addl	%r8d, %ebp
	addq	$40040, %r12
	jmp	.L59
.L101:
	leal	-1(%rax), %ecx
	movl	%r8d, %ebx
	movl	%eax, %r11d
	imull	%ecx, %ebx
	movl	%ebx, -4(%rsp)
	movl	%eax, %ebx
	movslq	-4(%rsp), %rdx
	imull	%r8d, %ebx
	movl	%ebx, -16(%rsp)
	movq	64(%rsp), %rbx
	movl	-16(%rsp), %ebp
	leaq	(%rbx,%rdx,4), %r12
.L65:
	cmpl	%r11d, B(%rip)
	jle	.L104
	xorl	%ebx, %ebx
.L69:
	cmpl	%esi, %ebx
	jge	.L105
	movl	B(%rip), %edx
	movq	56(%rsp), %r15
	imull	%ebx, %edx
	incl	%ebx
	leal	(%rcx,%rdx), %r13d
	addl	%r11d, %edx
	movslq	%r13d, %r13
	movslq	%edx, %rdx
	movl	(%r15,%r13,4), %r13d
	movl	%r13d, (%r15,%rdx,4)
	jmp	.L69
.L105:
	movq	64(%rsp), %rbx
	movslq	%ebp, %rdx
	leaq	(%rbx,%rdx,4), %rbx
	xorl	%edx, %edx
.L67:
	cmpl	%edx, %edi
	jle	.L106
	movl	(%r12,%rdx,4), %r13d
	movl	%r13d, (%rbx,%rdx,4)
	incq	%rdx
	jmp	.L67
.L106:
	incl	%r11d
	addl	%r8d, %ebp
	jmp	.L65
.L104:
	leal	-1(%rsi), %r13d
	movl	%esi, %ebx
	movl	%esi, %r12d
	movl	%r13d, %r11d
	imull	%r8d, %ebx
	imull	%r8d, %r11d
	movl	%ebx, %ebp
	movl	%r11d, -8(%rsp)
	movslq	%r11d, %rdx
	leaq	(%r9,%rdx,4), %r15
.L70:
	cmpl	%r10d, %r12d
	jge	.L72
	movslq	%ebp, %rdx
	leaq	(%r9,%rdx,4), %r14
	xorl	%edx, %edx
.L73:
	cmpl	%edx, %edi
	jle	.L107
	movl	(%r15,%rdx,4), %r11d
	movl	%r11d, (%r14,%rdx,4)
	incq	%rdx
	jmp	.L73
.L107:
	incl	%r12d
	addl	%r8d, %ebp
	jmp	.L70
.L72:
	movl	-8(%rsp), %r11d
	leal	-1(%rdi), %edx
	movl	%esi, %ebp
	addl	%edx, %r11d
	movslq	%r11d, %r11
	leaq	(%r9,%r11,4), %r14
.L74:
	cmpl	%r10d, %ebp
	jge	.L76
	movslq	%ebx, %r12
	movslq	%edi, %r11
	leaq	(%r9,%r12,4), %r12
.L77:
	cmpl	%r11d, %r8d
	jle	.L108
	movl	(%r14), %r15d
	movl	%r15d, (%r12,%r11,4)
	incq	%r11
	jmp	.L77
.L108:
	incl	%ebp
	addl	%r8d, %ebx
	jmp	.L74
.L76:
	movl	B(%rip), %r11d
	movl	-4(%rsp), %ebx
	movq	64(%rsp), %r15
	imull	%r13d, %r11d
	addl	%edx, %ebx
	movslq	%ebx, %rbx
	leaq	(%r15,%rbx,4), %r12
	movq	56(%rsp), %rbx
	addl	%r11d, %ecx
	movl	%r11d, -8(%rsp)
	movslq	%ecx, %rcx
	leaq	(%rbx,%rcx,4), %r13
	movl	%eax, %ebx
.L78:
	cmpl	%ebx, B(%rip)
	jle	.L109
	movl	%esi, %ebp
.L82:
	cmpl	%r10d, %ebp
	jge	.L110
	movl	B(%rip), %ecx
	movl	0(%r13), %r14d
	movq	56(%rsp), %r15
	imull	%ebp, %ecx
	incl	%ebp
	addl	%ebx, %ecx
	movslq	%ecx, %rcx
	movl	%r14d, (%r15,%rcx,4)
	jmp	.L82
.L110:
	movslq	-16(%rsp), %rbp
	movq	64(%rsp), %r14
	movslq	%edi, %rcx
	leaq	(%r14,%rbp,4), %rbp
.L80:
	cmpl	%ecx, %r8d
	jle	.L111
	movl	(%r12), %r14d
	movl	%r14d, 0(%rbp,%rcx,4)
	incq	%rcx
	jmp	.L80
.L111:
	addl	%r8d, -16(%rsp)
	incl	%ebx
	jmp	.L78
.L109:
	movslq	%r8d, %rbp
	movq	64(%rsp), %r13
	movl	%edx, %r14d
	xorl	%ecx, %ecx
	salq	$2, %rbp
.L83:
	cmpl	%eax, %ecx
	jge	.L112
	movl	-8(%rsp), %ebx
	movq	56(%rsp), %r15
	movl	%esi, %r12d
	addl	%ecx, %ebx
	movslq	%ebx, %rbx
	leaq	(%r15,%rbx,4), %rbx
	movq	%rbx, -16(%rsp)
.L84:
	cmpl	%r10d, %r12d
	jge	.L113
	movl	B(%rip), %ebx
	movq	-16(%rsp), %r11
	movq	56(%rsp), %r15
	imull	%r12d, %ebx
	movl	(%r11), %r11d
	incl	%r12d
	addl	%ecx, %ebx
	movslq	%ebx, %rbx
	movl	%r11d, (%r15,%rbx,4)
	jmp	.L84
.L113:
	movq	64(%rsp), %r15
	movslq	%r14d, %rbx
	leaq	(%r15,%rbx,4), %r12
	movslq	%edi, %rbx
.L86:
	cmpl	%ebx, %r8d
	jle	.L114
	movl	(%r12), %r15d
	movl	%r15d, 0(%r13,%rbx,4)
	incq	%rbx
	jmp	.L86
.L114:
	incl	%ecx
	addl	%r8d, %r14d
	addq	%rbp, %r13
	jmp	.L83
.L112:
	movq	%r9, %r10
	xorl	%ecx, %ecx
.L89:
	cmpl	%esi, %ecx
	jge	.L115
	movslq	%edx, %rax
	leaq	(%r9,%rax,4), %r11
	movslq	%edi, %rax
.L90:
	cmpl	%eax, %r8d
	jle	.L116
	movl	(%r11), %ebx
	movl	%ebx, (%r10,%rax,4)
	incq	%rax
	jmp	.L90
.L116:
	incl	%ecx
	addl	%r8d, %edx
	addq	%rbp, %r10
	jmp	.L89
.L115:
	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
.LFE2033:
	.size	_Z18putDistInArray_newiiiiiPiS_S_, .-_Z18putDistInArray_newiiiiiPiS_S_
	.globl	_Z9putToDistiiiiiPi
	.type	_Z9putToDistiiiiiPi, @function
_Z9putToDistiiiiiPi:
.LFB2034:
	.cfi_startproc
	endbr64
	movl	B(%rip), %eax
	movl	%edx, %edi
	movl	%ecx, %edx
	movl	n(%rip), %ecx
	imull	%eax, %edx
	imull	%eax, %esi
	imull	%eax, %r8d
	imull	%edi, %eax
	leal	(%rdx,%rsi), %edi
	cmpl	%ecx, %edi
	jle	.L118
	movl	%ecx, %edx
	subl	%esi, %edx
.L118:
	leal	(%r8,%rax), %edi
	movl	%r8d, %r10d
	cmpl	%edi, %ecx
	jge	.L119
	subl	%eax, %ecx
	movl	%ecx, %r10d
.L119:
	movslq	%esi, %rsi
	cltq
	xorl	%ecx, %ecx
	imulq	$10010, %rsi, %rsi
	addq	%rax, %rsi
	leaq	_ZL4Dist(%rip), %rax
	leaq	(%rax,%rsi,4), %rdi
	xorl	%esi, %esi
.L126:
	cmpl	%ecx, %edx
	jle	.L130
	movslq	%esi, %rax
	leaq	(%r9,%rax,4), %r11
	xorl	%eax, %eax
	cmpl	%eax, %r10d
	jg	.L129
	incl	%ecx
	addl	%r8d, %esi
	addq	$40040, %rdi
	jmp	.L126
.L130:
	ret
.L129:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
.L122:
	movl	(%r11,%rax,4), %ebx
	movl	%ebx, (%rdi,%rax,4)
	incq	%rax
.L121:
	cmpl	%eax, %r10d
	jg	.L122
	incl	%ecx
	addl	%r8d, %esi
	addq	$40040, %rdi
	cmpl	%ecx, %edx
	jle	.L131
	movslq	%esi, %rax
	leaq	(%r9,%rax,4), %r11
	xorl	%eax, %eax
	jmp	.L121
.L131:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2034:
	.size	_Z9putToDistiiiiiPi, .-_Z9putToDistiiiiiPi
	.globl	_Z27__device_stub__Z8cal_PonePiPi
	.type	_Z27__device_stub__Z8cal_PonePiPi, @function
_Z27__device_stub__Z8cal_PonePiPi:
.LFB2061:
	.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	.L132
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z8cal_PonePi(%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
.L132:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L134
	call	__stack_chk_fail@PLT
.L134:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2061:
	.size	_Z27__device_stub__Z8cal_PonePiPi, .-_Z27__device_stub__Z8cal_PonePiPi
	.globl	_Z8cal_PonePi
	.type	_Z8cal_PonePi, @function
_Z8cal_PonePi:
.LFB2062:
	.cfi_startproc
	endbr64
	jmp	_Z27__device_stub__Z8cal_PonePiPi
	.cfi_endproc
.LFE2062:
	.size	_Z8cal_PonePi, .-_Z8cal_PonePi
	.section	.rodata.str1.1
.LC7:
	.string	"malloc Dist_ij error\n"
	.text
	.globl	_Z6callP1i
	.type	_Z6callP1i, @function
_Z6callP1i:
.LFB2035:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%edx, %edx
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	movl	B(%rip), %ebx
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rdi
	movabsq	$4294967297, %rax
	movl	$1, 24(%rsp)
	movl	%ebx, 28(%rsp)
	movl	%ebx, 32(%rsp)
	imull	%ebx, %ebx
	movq	%rax, 16(%rsp)
	movl	$1, 36(%rsp)
	sall	$2, %ebx
	movslq	%ebx, %rbx
	movq	%rbx, %rsi
	call	cudaHostAlloc@PLT
	testl	%eax, %eax
	je	.L138
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L138:
	movq	(%rsp), %rsi
	movl	%ebp, %edi
	call	_Z8putInAijiPi
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	movq	8(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	36(%rsp), %ecx
	movl	24(%rsp), %esi
	xorl	%r9d, %r9d
	movq	28(%rsp), %rdx
	movq	16(%rsp), %rdi
	movq	%rbx, %r8
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L139
	movq	8(%rsp), %rdi
	call	_Z27__device_stub__Z8cal_PonePiPi
.L139:
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$2, %ecx
	movq	%rbx, %rdx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	(%rsp), %r9
	movl	%ebp, %edi
	movl	$1, %ecx
	movl	$1, %r8d
	movl	%ebp, %edx
	movl	%ebp, %esi
	call	_Z9putToDistiiiiiPi
	movq	%r9, %rdi
	call	cudaFreeHost@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L140
	call	__stack_chk_fail@PLT
.L140:
	addq	$56, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2035:
	.size	_Z6callP1i, .-_Z6callP1i
	.globl	_Z31__device_stub__Z8cal_PtwoPiS_S_PiS_S_
	.type	_Z31__device_stub__Z8cal_PtwoPiS_S_PiS_S_, @function
_Z31__device_stub__Z8cal_PtwoPiS_S_PiS_S_:
.LFB2063:
	.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
	movq	%rdx, 8(%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	8(%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	.L145
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z8cal_PtwoPiS_S_(%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
.L145:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L147
	call	__stack_chk_fail@PLT
.L147:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2063:
	.size	_Z31__device_stub__Z8cal_PtwoPiS_S_PiS_S_, .-_Z31__device_stub__Z8cal_PtwoPiS_S_PiS_S_
	.globl	_Z8cal_PtwoPiS_S_
	.type	_Z8cal_PtwoPiS_S_, @function
_Z8cal_PtwoPiS_S_:
.LFB2064:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z8cal_PtwoPiS_S_PiS_S_
	.cfi_endproc
.LFE2064:
	.size	_Z8cal_PtwoPiS_S_, .-_Z8cal_PtwoPiS_S_
	.section	.rodata.str1.1
.LC8:
	.string	"malloc Dist_ij2 error\n"
.LC9:
	.string	"malloc Dist_ik2 error\n"
.LC10:
	.string	"malloc Dist_kj2 error\n"
	.text
	.globl	_Z6callP2iPiS_S_S_
	.type	_Z6callP2iPiS_S_S_, @function
_Z6callP2iPiS_S_S_:
.LFB2036:
	.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
	movq	%r8, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rcx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$360, %rsp
	.cfi_def_cfa_offset 416
	movq	%rsi, 16(%rsp)
	leaq	152(%rsp), %r14
	movq	%rdx, 24(%rsp)
	movl	%edi, 12(%rsp)
	leaq	120(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 344(%rsp)
	movl	B(%rip), %eax
	movl	$1, 104(%rsp)
	movl	%eax, %ebp
	movl	%eax, 96(%rsp)
	imull	%eax, %ebp
	movl	%eax, 100(%rsp)
	call	cudaStreamCreate@PLT
	leaq	128(%rsp), %rdi
	call	cudaStreamCreate@PLT
	leaq	136(%rsp), %rdi
	call	cudaStreamCreate@PLT
	sall	$2, %ebp
	leaq	144(%rsp), %rdi
	call	cudaStreamCreate@PLT
	movslq	%ebp, %rax
	movq	%r14, (%rsp)
	movq	%rax, 32(%rsp)
.L156:
	movl	(%r12,%rbx), %esi
	testl	%esi, %esi
	je	.L151
	movl	0(%r13,%rbx), %eax
	testl	%eax, %eax
	je	.L151
	movl	%esi, 108(%rsp)
	imull	%ebp, %esi
	xorl	%edx, %edx
	leaq	48(%rsp), %rdi
	movl	%eax, 112(%rsp)
	movl	$1, 116(%rsp)
	imull	%eax, %esi
	movslq	%esi, %rsi
	call	cudaHostAlloc@PLT
	testl	%eax, %eax
	je	.L152
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L152:
	movl	(%r12,%rbx), %esi
	xorl	%edx, %edx
	leaq	56(%rsp), %rdi
	imull	%ebp, %esi
	movslq	%esi, %rsi
	call	cudaHostAlloc@PLT
	testl	%eax, %eax
	je	.L153
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L153:
	movl	0(%r13,%rbx), %esi
	xorl	%edx, %edx
	leaq	64(%rsp), %rdi
	imull	%ebp, %esi
	movslq	%esi, %rsi
	call	cudaHostAlloc@PLT
	testl	%eax, %eax
	je	.L154
	leaq	.LC10(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L154:
	movq	64(%rsp), %r15
	movq	56(%rsp), %rax
	movq	16(%rsp), %rdi
	movq	24(%rsp), %rdx
	movq	48(%rsp), %r9
	movl	(%r12,%rbx), %ecx
	movl	(%rdi,%rbx), %esi
	movl	(%rdx,%rbx), %edx
	pushq	%r15
	.cfi_def_cfa_offset 424
	pushq	%rax
	.cfi_def_cfa_offset 432
	movl	0(%r13,%rbx), %r8d
	movl	28(%rsp), %edi
	movq	%rax, 56(%rsp)
	call	_Z18putDistInArray_newiiiiiPiS_S_
	movq	16(%rsp), %rax
	movl	(%r12,%rbx), %esi
	movq	%r9, (%rax)
	movq	%rax, %rcx
	movq	56(%rsp), %rax
	imull	%ebp, %esi
	imull	0(%r13,%rbx), %esi
	movq	%r15, 16(%rcx)
	movq	%rax, 8(%rcx)
	popq	%rax
	.cfi_def_cfa_offset 424
	popq	%rdx
	.cfi_def_cfa_offset 416
	movslq	%esi, %rsi
	leaq	72(%rsp), %rdi
	leaq	120(%rsp), %r15
	call	cudaMalloc@PLT
	movl	(%r12,%rbx), %esi
	leaq	80(%rsp), %rdi
	imull	%ebp, %esi
	movslq	%esi, %rsi
	call	cudaMalloc@PLT
	movl	0(%r13,%rbx), %esi
	leaq	88(%rsp), %rdi
	imull	%ebp, %esi
	movslq	%esi, %rsi
	call	cudaMalloc@PLT
	movq	72(%rsp), %rdi
	movq	(%rsp), %rax
	movq	(%rsp), %rcx
	movl	(%r12,%rbx), %edx
	movq	(%r15,%rbx,2), %r8
	movq	48(%rsp), %rsi
	movq	%rdi, 24(%rax)
	movq	80(%rsp), %rax
	imull	%ebp, %edx
	imull	0(%r13,%rbx), %edx
	movq	%rax, 32(%rcx)
	movq	88(%rsp), %rax
	movq	%rax, 40(%rcx)
	movslq	%edx, %rdx
	movl	$1, %ecx
	call	cudaMemcpyAsync@PLT
	movl	(%r12,%rbx), %edx
	movq	(%r15,%rbx,2), %r8
	movl	$1, %ecx
	movq	56(%rsp), %rsi
	movq	80(%rsp), %rdi
	imull	%ebp, %edx
	movslq	%edx, %rdx
	call	cudaMemcpyAsync@PLT
	movl	0(%r13,%rbx), %edx
	movq	(%r15,%rbx,2), %r8
	movl	$1, %ecx
	movq	64(%rsp), %rsi
	movq	88(%rsp), %rdi
	imull	%ebp, %edx
	movslq	%edx, %rdx
	call	cudaMemcpyAsync@PLT
	movl	104(%rsp), %ecx
	movq	(%r15,%rbx,2), %r9
	movq	32(%rsp), %r8
	movq	96(%rsp), %rdx
	movq	108(%rsp), %rdi
	movl	116(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L155
	movq	88(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z31__device_stub__Z8cal_PtwoPiS_S_PiS_S_
.L155:
	movl	(%r12,%rbx), %edx
	movq	(%r15,%rbx,2), %r8
	movl	$2, %ecx
	movq	72(%rsp), %rsi
	movq	48(%rsp), %rdi
	imull	%ebp, %edx
	imull	0(%r13,%rbx), %edx
	movslq	%edx, %rdx
	call	cudaMemcpyAsync@PLT
.L151:
	addq	$4, %rbx
	addq	$48, (%rsp)
	cmpq	$16, %rbx
	jne	.L156
	xorl	%ebx, %ebx
.L158:
	cmpl	$0, (%r12,%rbx)
	je	.L157
	cmpl	$0, 0(%r13,%rbx)
	je	.L157
	leaq	120(%rsp), %rbp
	movq	0(%rbp,%rbx,2), %rdi
	call	cudaStreamSynchronize@PLT
	movq	24(%rsp), %rax
	movq	(%r14), %r15
	movl	(%r12,%rbx), %ecx
	movl	0(%r13,%rbx), %r8d
	movl	(%rax,%rbx), %edx
	movq	16(%rsp), %rax
	movq	%r15, %r9
	movl	12(%rsp), %edi
	movl	(%rax,%rbx), %esi
	call	_Z9putToDistiiiiiPi
	movq	24(%r14), %rdi
	call	cudaFree@PLT
	movq	32(%r14), %rdi
	call	cudaFree@PLT
	movq	40(%r14), %rdi
	call	cudaFree@PLT
	movq	%r15, %rdi
	call	cudaFreeHost@PLT
	movq	8(%r14), %rdi
	call	cudaFreeHost@PLT
	movq	16(%r14), %rdi
	call	cudaFreeHost@PLT
	movq	0(%rbp,%rbx,2), %rdi
	call	cudaStreamDestroy@PLT
.L157:
	addq	$4, %rbx
	addq	$48, %r14
	cmpq	$16, %rbx
	jne	.L158
	movq	344(%rsp), %rax
	subq	%fs:40, %rax
	je	.L159
	call	__stack_chk_fail@PLT
.L159:
	addq	$360, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2036:
	.size	_Z6callP2iPiS_S_S_, .-_Z6callP2iPiS_S_S_
	.globl	_Z8block_FWv
	.type	_Z8block_FWv, @function
_Z8block_FWv:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movabsq	$4294967297, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	movl	B(%rip), %ecx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movl	n(%rip), %eax
	addl	%ecx, %eax
	decl	%eax
	cltd
	idivl	%ecx
	movl	%eax, %r12d
.L179:
	cmpl	%r12d, %ebx
	jge	.L183
	movl	%ebx, %edi
	leal	1(%rbx), %ebp
	movl	%r12d, %r13d
	call	_Z6callP1i
	xorl	%edx, %edx
	subl	%ebp, %r13d
	xorl	%eax, %eax
	movl	%ebx, %edi
	movl	%edx, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	24(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	56(%rsp), %r8
	movl	%eax, 16(%rsp)
	movl	%ebx, 8(%rsp)
	movl	%ebx, 12(%rsp)
	movl	%ebx, 32(%rsp)
	movl	%ebx, 36(%rsp)
	movl	%ebx, 48(%rsp)
	movl	%ebx, 56(%rsp)
	movl	%ebp, 20(%rsp)
	movl	%ebp, 28(%rsp)
	movq	%r14, 40(%rsp)
	movl	%r13d, 52(%rsp)
	movq	%r14, 64(%rsp)
	movl	%r13d, 60(%rsp)
	call	_Z6callP2iPiS_S_S_
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	xorl	%edi, %edi
	movq	%rsi, 88(%rsp)
	leaq	88(%rsp), %rdx
	leaq	72(%rsp), %rsi
	movq	%rcx, 72(%rsp)
	leaq	120(%rsp), %r8
	leaq	104(%rsp), %rcx
	movl	%edi, 96(%rsp)
	movl	%ebx, %edi
	movl	%ebx, 104(%rsp)
	movl	%ebx, 108(%rsp)
	movl	%ebx, 120(%rsp)
	movl	%ebx, 128(%rsp)
	movl	%ebp, %ebx
	movl	%ebp, 80(%rsp)
	movl	%ebp, 84(%rsp)
	movl	%ebp, 92(%rsp)
	movl	%ebp, 100(%rsp)
	movl	%r13d, 112(%rsp)
	movl	%r13d, 116(%rsp)
	movl	%r13d, 124(%rsp)
	movl	%r13d, 132(%rsp)
	call	_Z6callP2iPiS_S_S_
	jmp	.L179
.L183:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L181
	call	__stack_chk_fail@PLT
.L181:
	addq	$144, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z8block_FWv, .-_Z8block_FWv
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	xorl	%edi, %edi
	movq	%rsi, %rbx
	call	cudaSetDevice@PLT
	movq	8(%rbx), %rdi
	call	_Z5inputPc
	movq	24(%rbx), %rdi
	call	atoi@PLT
	movl	$32, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	$1, %edx
	testl	%eax, %eax
	cmovle	%edx, %eax
	movl	%eax, B(%rip)
	call	_Z8block_FWv
	movq	16(%rbx), %rdi
	call	_Z6outputPc
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	main, .-main
	.section	.rodata.str1.1
.LC11:
	.string	"_Z8cal_PtwoPiS_S_"
.LC12:
	.string	"_Z8cal_PonePi"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2066:
	.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	.LC11(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z8cal_PtwoPiS_S_(%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	.LC12(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z8cal_PonePi(%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
.LFE2066:
	.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
	.local	_ZL4Dist
	.comm	_ZL4Dist,400800400,32
	.globl	B
	.bss
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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 <stdio.h>
#include <stdlib.h>
#include <hip/hip_runtime.h>

const int INF = 10000000;
const int V = 10010;
void input(char *inFileName);
void output(char *outFileName);

void block_FW();
int ceil(int a, int b);
void callP1(int r);
void callP2(int r, 
int *block_start_x, int *block_start_y, 
int *block_height, int *block_width);
__global__ void cal_Pone(int* Dist_ij);
__global__ void cal_Ptwo(int* Dist_ij, int* Dist_ik, int* Dist_kj);


int n, m, B;	// Number of vertices, edges
static int Dist[V][V];
//int* Dist;

int main(int argc, char* argv[])
{
	hipSetDevice(0);
	input(argv[1]);
	B = atoi(argv[3]);
	if(B < 1)
		B = 1;
	else if(B > 32)
		B = 32;
	/*
	cudaDeviceProp prop;
    if(cudaGetDeviceProperties(&prop, 0) == cudaSuccess) 
	{
    	printf("cuda version = %d \n" , prop.major ) ;
		printf("maxThreadsPerBlock = %d \n" , prop.maxThreadsPerBlock ) ;
		printf("totalGlobalMem = %d \n" , prop.totalGlobalMem ) ;
		printf(" maxThreadsDim[3] = %d, %d, %d\n" , prop.maxThreadsDim[1], prop.maxThreadsDim[2] , prop.maxThreadsDim[3] ) ;
		printf(" maxGridSize[3] = %d, %d, %d\n" , prop.maxGridSize[1] , prop.maxGridSize[2] , prop.maxGridSize[3] ) ;
    }
	//cuda version: 2
	//maxThreadsPerBlock: 1024
	//totalGlobalMem: 2066153472
	//maxThreadsDim: 1024, 64, 65535
	//maxGridSize: 65535, 65535, 1301000
	//*/
	block_FW();
	
	
	output(argv[2]);
	

	return 0;
}

void input(char *inFileName)
{
	FILE *infile = fopen(inFileName, "r");
	fscanf(infile, "%d %d", &n, &m);
	
	

	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			if (i == j)	Dist[i][j] = 0;
			else		Dist[i][j] = INF;
		}
	}

	while (--m >= 0) {
		int a, b, v;
		fscanf(infile, "%d %d %d", &a, &b, &v);
		--a, --b;
		Dist[a][b] = v;
	}
}

void output(char *outFileName)
{
	FILE *outfile = fopen(outFileName, "w");
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			if (Dist[i][j] >= INF)	fprintf(outfile, "INF ");
			else					fprintf(outfile, "%d ", Dist[i][j]);
		}
		fprintf(outfile, "\n");
	}		
}

int ceil(int a, int b)
{
	return (a + b -1)/b;
}

void block_FW()
{
	int round = ceil(n, B);
	
	
	for (int r = 0; r < round; ++r) {
		/* Phase 1*/
		//printf("[%d]This is callP1\n", r);
		callP1(r);
		
		
		/* Phase 2*/
		//printf("This is Phase 2\n");
		int block_start_x[4] = {r,		r, 0,	r + 1};
		int block_start_y[4] = {0,	r + 1, r,		r};
		int block_height[4] = {1, 				1, r,	round - r - 1};
		int block_width[4] = {r,	round - r - 1, 1, 				1};
		callP2(r, block_start_x, block_start_y,
			block_height, block_width);
		/* hase 3*/
		//printf("This is Phase 3\n");
		int block_start_x2[4] = {0, 	0,	r + 1, r + 1};
		int block_start_y2[4] = {0,	r + 1,		0, r + 1};
		int block_height2[4] = {r, r,	round - r -1,	round - r -1};
		int block_width2[4] = {r,	round - r -1, r,	round - r -1};
		callP2(r, block_start_x2, block_start_y2,
			block_height2, block_width2);
		//printf("End one turn\n");
	}

}
void putInAij(int bias_y, int* Dist_ij){
		
	int i, j;
	bias_y *= B;
	//為何要重新歷過一遍?比原本的還慢!!
	//因要解決IO問題，不想直接IO全部
	//真的有比較差??不是被"資源利用率"騙到?(IO全部VS處理完再IO部分)

	int jlen = B;
	int itmp ;
	int jtmp ;
	// b+j > n
	if(bias_y + jlen > n)
		jlen = n - bias_y;
	// part 1: <, <
	for(i = 0; i < jlen; ++i){
		itmp = bias_y + i;
		for(j = 0; j < jlen; ++j){
			jtmp = bias_y + j;
			Dist_ij[i * B + j] = Dist[itmp][jtmp];
		}
	}
	itmp = (jlen -1) * B;
	// part 3: >, <=
	for(i = jlen; i < B; ++i)
		for(j = 0; j < jlen; ++j)
			Dist_ij[i * B + j] = Dist_ij[itmp + j];
	// part 2: >, >
	jtmp += jlen -1;//(jlen -1) *B + (jlen -1);
	for(i = jlen; i < B; ++i)
		for(j = jlen; j < B; ++j)
			Dist_ij[i * B + j] = Dist_ij[jtmp];
	// part 4: <=, >
	jtmp = (jlen -1);
	for(i = 0; i < jlen; ++i){
		itmp = i *B;
		for(j = jlen; j < B; ++j){
			Dist_ij[itmp + j] = Dist_ij[itmp + jtmp];
		}
	}
}
void putDistInArray_new(int round, int bias_x, int bias_y, 
	int block_height, int block_width,
	int* Dist_ij2, int* Dist_ik2, int* Dist_kj2){
		
	int itmp, jtmp, ktmp, i2, j, k;
	int kbias = round * B;
	int end_x = block_height * B;
	int end_y = block_width * B;
	bias_x *= B;
	bias_y *= B;
	//為何要重新歷過一遍?比原本的還慢!!
	//因要解決IO問題，不想直接IO全部
	//真的有比較差??不是被"資源利用率"騙到?(IO全部VS處理完再IO部分)
	int ilen = end_x;
	int jlen = end_y;
	int klen = B;
	// b+i2 > n
	if(bias_x + ilen > n)
		ilen = n - bias_x;
	// b+j > n
	if(bias_y + jlen > n)
		jlen = n - bias_y;
	// b+j > n
	if(kbias + klen > n)
		klen = n - kbias;
	
	// part 1: <, <, <
	for(i2 = 0; i2 < ilen; ++i2){
		itmp = bias_x + i2;
		for(j = 0; j < jlen; ++j){
			jtmp = bias_y + j;
			Dist_ij2[i2 * end_y + j] = Dist[itmp][jtmp];
		}
	}
	// part 5: <, <, <
	for(k = 0; k < klen; ++k){
		ktmp = k + kbias;
		for(j = 0; j < jlen; ++j){
			jtmp = bias_y + j;
			Dist_kj2[k * end_y + j] = Dist[ktmp][jtmp];
		}
		for(i2 = 0; i2 < ilen; ++i2){
			itmp = bias_x + i2;
			Dist_ik2[i2 * B + k] = Dist[itmp][ktmp];
		}
	}
	// part 5-2: <, X, > ||  X, <, >
	ktmp = klen - 1;
	jtmp = ktmp * end_y;
	for(k = klen; k < B; ++k){
		for(i2 = 0; i2 < ilen; ++i2){
			itmp = i2 * B;
			Dist_ik2[itmp+ k] = Dist_ik2[itmp + ktmp];
		}
		for(j = 0; j < jlen; ++j)
			Dist_kj2[k * end_y + j] = Dist_kj2[jtmp + j];
	}
	// part 3: >, <, X
	itmp = (ilen -1) *end_y;
	for(i2 = ilen; i2 < end_x; ++i2)
		for(j = 0; j < jlen; ++j)
			Dist_ij2[i2 * end_y + j] = Dist_ij2[itmp + j];
	// part 2: >, >, X
	itmp += jlen -1;//(ilen -1) * end_y + (jlen -1);
	for(i2 = ilen; i2 < end_x; ++i2)
		for(j = jlen; j < end_y; ++j)
			Dist_ij2[i2 * end_y + j] = Dist_ij2[itmp];
	
	// part 5-3: >, X, > || X, >, >
	itmp = (ilen -1) * B + (klen -1);
	jtmp += jlen -1;//(klen -1) * end_y + (jlen -1);
	for(k = klen; k < B; ++k){
		for(i2 = ilen; i2 < end_x; ++i2)
			Dist_ik2[i2 * B + k] = Dist_ik2[itmp];
		for(j = jlen; j < end_y; ++j)
			Dist_kj2[k * end_y + j] = Dist_kj2[jtmp];
	}
	// part 5-4: >, X, < || X, <, <
	itmp -= klen -1;//(ilen -1) * B ;
	jtmp = jlen -1;
	for(k = 0; k < klen; ++k){
		ktmp = k * end_y;
		for(i2 = ilen; i2 < end_x; ++i2)
			Dist_ik2[i2 * B + k] = Dist_ik2[itmp + k];
		for(j = jlen; j < end_y; ++j)
			Dist_kj2[ktmp + j] = Dist_kj2[ktmp + jtmp];
	}
	// part 4: <, >, X
	for(i2 = 0; i2 < ilen; ++i2){
		itmp = i2 * end_y;
		for(j = jlen; j < end_y; ++j)
			Dist_ij2[itmp + j] = Dist_ij2[itmp + jtmp];
	}
	
	
}

void putToDist(int round, int bias_x, int bias_y, 
	int block_height, int block_width,
	int* Dist_ij){
	
	int itmp, jtmp;
	int end_x = block_height * B;
	int end_y = block_width * B;
	int ilen = end_x;
	int jlen = end_y;
	bias_x *= B;
	bias_y *= B;
	if(end_x + bias_x > n)// if [ind_end+1] > n, change,if == ,no c
		ilen = n - bias_x;
	if(end_y + bias_y > n)
		jlen = n - bias_y;
	
	for(int i = 0; i < ilen; ++i){
		itmp = bias_x + i;
		for(int j = 0; j < jlen; ++j){
			jtmp = bias_y + j;
			Dist[itmp][jtmp] = Dist_ij[i * end_y + j];
		}
	}
}

void callP1(int r){
	
	int shm_size = sizeof(int) * B * B;
	dim3 blocksPerGrif1(1, 1);
	dim3 threadsPerBlock(B, B);
	
	int *Dist_ij;
	hipError_t err = hipHostMalloc(&Dist_ij, shm_size , hipHostMallocDefault);
	if (err != 0)	printf("malloc Dist_ij error\n");
	putInAij( r, Dist_ij);
	
	int *Dist_ijg;
	
	//step 1: declare
	hipMalloc((void **)&Dist_ijg, shm_size);
	//step 2: copy
	hipMemcpy(Dist_ijg, Dist_ij, shm_size, hipMemcpyHostToDevice);
	
	cal_Pone<<< blocksPerGrif1 , threadsPerBlock , shm_size>>> 
		(Dist_ijg);
	//step 3: get return
	hipMemcpy(Dist_ij, Dist_ijg, shm_size, hipMemcpyDeviceToHost);
	//step 4: free gpu
	hipFree(Dist_ijg);
	putToDist(r, r, r, 1, 1, Dist_ij);
	
	hipHostFree(Dist_ij);
	
}
void callP2(int r, 
int *block_start_x, int *block_start_y, 
int *block_height, int *block_width){
	
	int shm_size = sizeof(int) * B * B;
	dim3 threadsPerBlock(B, B);
	const int str_num = 4;
	hipStream_t stream[str_num];
	for(int i = 0; i < str_num; i++)
		hipStreamCreate(&stream[i]);
	int *Dist_all[str_num *6];// pointer array
	hipError_t err;
	for(int i = 0; i < str_num; ++i){
		if( block_height[i] == 0 || block_width[i] == 0)
			continue;
		dim3 blocksPerGrif1( block_height[i], block_width[i]);
		int *Dist_ij2, *Dist_ik2, *Dist_kj2;
		
		err = hipHostMalloc(&Dist_ij2, shm_size * block_height[i] * block_width[i], hipHostMallocDefault);
		if (err != 0)	printf("malloc Dist_ij2 error\n");
		err = hipHostMalloc(&Dist_ik2, shm_size * block_height[i], hipHostMallocDefault);
		if (err != 0)	printf("malloc Dist_ik2 error\n");
		err = hipHostMalloc(&Dist_kj2, shm_size * block_width[i], hipHostMallocDefault);
		if (err != 0)	printf("malloc Dist_kj2 error\n");
		putDistInArray_new(r, block_start_x[i], block_start_y[i], 
			block_height[i], block_width[i], Dist_ij2, Dist_ik2, Dist_kj2);
		
		Dist_all[i *6] = Dist_ij2;
		Dist_all[i *6 +1] = Dist_ik2;
		Dist_all[i *6 +2] = Dist_kj2;
		int *Dist_ijg2, *Dist_ikg2, *Dist_kjg2;
		//step 1: declare
		hipMalloc((void **)&Dist_ijg2, shm_size * block_height[i] * block_width[i]);
		hipMalloc((void **)&Dist_ikg2, shm_size * block_height[i]);
		hipMalloc((void **)&Dist_kjg2, shm_size * block_width[i]);
		Dist_all[i *6 +3] = Dist_ijg2;
		Dist_all[i *6 +4] = Dist_ikg2;
		Dist_all[i *6 +5] = Dist_kjg2;
		//step 2: copy
		hipMemcpyAsync(Dist_ijg2, Dist_ij2, shm_size * block_height[i] * block_width[i], 
			hipMemcpyHostToDevice, stream[i]);
		hipMemcpyAsync(Dist_ikg2, Dist_ik2, shm_size * block_height[i], 
			hipMemcpyHostToDevice, stream[i]);
		hipMemcpyAsync(Dist_kjg2, Dist_kj2, shm_size * block_width[i], 
			hipMemcpyHostToDevice, stream[i]);
	
		cal_Ptwo<<< blocksPerGrif1 , threadsPerBlock , shm_size, stream[i]>>> 
			(Dist_ijg2, Dist_ikg2, Dist_kjg2);
		//step 3: get return
		hipMemcpyAsync(Dist_ij2, Dist_ijg2, shm_size * block_height[i] * block_width[i], 
			hipMemcpyDeviceToHost, stream[i]);
	}
	//wait for stream
	for(int i = 0; i < str_num; i++){
		if( block_height[i] == 0 || block_width[i] == 0)
			continue;
		hipStreamSynchronize(stream[i]);
		putToDist(r, block_start_x[i], block_start_y[i],
			block_height[i], block_width[i], Dist_all[i *6]);
		//step 4: free gpu
		hipFree(Dist_all[i *6 +3]);
		hipFree(Dist_all[i *6 +4]);
		hipFree(Dist_all[i *6 +5]);
		hipHostFree(Dist_all[i *6]);
		hipHostFree(Dist_all[i *6 +1]);
		hipHostFree(Dist_all[i *6 +2]);
			
		hipStreamDestroy(stream[i]);
		
	}
}

__global__ void cal_Pone(int* Dist_ij)
{
	int i = blockIdx.x * blockDim.x + threadIdx.x;
	int j = blockIdx.y * blockDim.y + threadIdx.y;
	extern __shared__ int DS[];
	int dsbias = threadIdx.x * blockDim.y + threadIdx.y;
	int offset_j = gridDim.y * blockDim.y;
	DS[dsbias] = Dist_ij[i * offset_j + j];//j range = blocksPerG.y
	__syncthreads();
	for (int k = 0; k < blockDim.x ; ++k) {//k range= B
		if (DS[i * blockDim.x + k] + DS[k * offset_j + j] < DS[dsbias])
			DS[dsbias] = DS[i * blockDim.x + k] + DS[k * offset_j + j];
		__syncthreads();
	}
	Dist_ij[i * offset_j + j] = DS[dsbias];// save value to shared memory
	__syncthreads();
	
}
__global__ void cal_Ptwo(int* Dist_ij, int* Dist_ik, int* Dist_kj)
{
	int i = blockIdx.x * blockDim.x + threadIdx.x;
	int j = blockIdx.y * blockDim.y + threadIdx.y;
	extern __shared__ int DS[];
	int dsbias = threadIdx.x * blockDim.y + threadIdx.y;
	int offset_j = gridDim.y * blockDim.y;
	DS[dsbias] = Dist_ij[i * offset_j + j];//j range = blocksPerG.y
	__syncthreads();
	for (int k = 0; k < blockDim.x ; ++k) {//k range= B
		if (Dist_ik[i * blockDim.x + k] + Dist_kj[k * offset_j + j] < DS[dsbias])
			DS[dsbias] = Dist_ik[i * blockDim.x + k] + Dist_kj[k * offset_j + j];
	}
	Dist_ij[i * offset_j + j] = DS[dsbias];// save value to shared memory
	__syncthreads();
}

/*
void cal(int B, int Round, 
	int block_start_x, int block_start_y, 
	int block_width, int block_height)
{
	int block_end_x = block_start_x + block_height;
	int block_end_y = block_start_y + block_width;

	for (int b_i =  block_start_x; b_i < block_end_x; ++b_i) {
		for (int b_j = block_start_y; b_j < block_end_y; ++b_j) {
			// To calculate B*B elements in the block (b_i, b_j)
			// For each block, it need to compute B times
			for (int k = Round * B; k < (Round +1) * B && k < n; ++k) {
				// To calculate original index of elements in the block (b_i, b_j)
				// For instance, original index of (0,0) in block (1,2) is (2,5) for V=6,B=2
				int block_internal_start_x 	= b_i * B;
				int block_internal_end_x 	= (b_i +1) * B;
				int block_internal_start_y = b_j * B; 
				int block_internal_end_y 	= (b_j +1) * B;

				if (block_internal_end_x > n)	block_internal_end_x = n;
				if (block_internal_end_y > n)	block_internal_end_y = n;

				for (int i = block_internal_start_x; i < block_internal_end_x; ++i) {
					for (int j = block_internal_start_y; j < block_internal_end_y; ++j) {
						if (Dist[i * n + k] + Dist[k * n + j] < Dist[i * n + j])
							Dist[i * n + j] = Dist[i * n + k] + Dist[k * n + j];
					}
				}
			}
		}
	}
}
*/


	.text
	.file	"HW4_105061516_cuda.hip"
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rsi, %rbx
	xorl	%edi, %edi
	callq	hipSetDevice
	movq	8(%rbx), %rdi
	callq	_Z5inputPc
	movq	24(%rbx), %rdi
	callq	atoi
	movl	%eax, B(%rip)
	testl	%eax, %eax
	jle	.LBB0_1
# %bb.2:
	movl	$32, %ecx
	cmpl	$33, %eax
	jae	.LBB0_3
	jmp	.LBB0_4
.LBB0_1:
	movl	$1, %ecx
.LBB0_3:                                # %.sink.split
	movl	%ecx, B(%rip)
.LBB0_4:
	callq	_Z8block_FWv
	movq	16(%rbx), %rdi
	callq	_Z6outputPc
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	main, .Lfunc_end0-main
	.cfi_endproc
                                        # -- End function
	.globl	_Z5inputPc                      # -- Begin function _Z5inputPc
	.type	_Z5inputPc,@function
_Z5inputPc:                             # @_Z5inputPc
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$.L.str, %esi
	callq	fopen
	movq	%rax, %rbx
	xorl	%r14d, %r14d
	movl	$.L.str.1, %esi
	movl	$n, %edx
	movl	$m, %ecx
	movq	%rax, %rdi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.LBB1_5
# %bb.1:                                # %.preheader13.lr.ph
	movl	$_ZL4Dist, %ecx
	xorl	%edx, %edx
.LBB1_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_3 Depth 2
	xorl	%esi, %esi
.LBB1_3:                                #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpq	%rsi, %rdx
	movl	$10000000, %edi                 # imm = 0x989680
	cmovel	%r14d, %edi
	movl	%edi, (%rcx,%rsi,4)
	incq	%rsi
	cmpq	%rsi, %rax
	jne	.LBB1_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	incq	%rdx
	addq	$40040, %rcx                    # imm = 0x9C68
	cmpq	%rax, %rdx
	jne	.LBB1_2
.LBB1_5:                                # %.preheader
	movl	m(%rip), %eax
	leal	-1(%rax), %ecx
	movl	%ecx, m(%rip)
	testl	%eax, %eax
	jle	.LBB1_8
# %bb.6:
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r15
	leaq	12(%rsp), %r12
.LBB1_7:                                # %.lr.ph16
                                        # =>This Inner Loop Header: Depth=1
	movl	$.L.str.2, %esi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movq	%r15, %rcx
	movq	%r12, %r8
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movslq	20(%rsp), %rax
	imulq	$40040, %rax, %rax              # imm = 0x9C68
	movslq	16(%rsp), %rcx
	movl	12(%rsp), %edx
	movl	%edx, _ZL4Dist-40044(%rax,%rcx,4)
	movl	m(%rip), %eax
	leal	-1(%rax), %ecx
	movl	%ecx, m(%rip)
	testl	%eax, %eax
	jg	.LBB1_7
.LBB1_8:                                # %._crit_edge17
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z5inputPc, .Lfunc_end1-_Z5inputPc
	.cfi_endproc
                                        # -- End function
	.globl	_Z8block_FWv                    # -- Begin function _Z8block_FWv
	.type	_Z8block_FWv,@function
_Z8block_FWv:                           # @_Z8block_FWv
	.cfi_startproc
# %bb.0:
	movl	n(%rip), %eax
	movl	B(%rip), %ecx
	addl	%ecx, %eax
	decl	%eax
	cltd
	idivl	%ecx
	testl	%eax, %eax
	jle	.LBB2_4
# %bb.1:                                # %.lr.ph
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%eax, %ebx
	leal	-1(%rbx), %ebp
	xorl	%r14d, %r14d
	movabsq	$4294967297, %r15               # imm = 0x100000001
	xorl	%r13d, %r13d
.LBB2_2:                                # =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	callq	_Z6callP1i
	movl	%r13d, 64(%rsp)
	movl	%r13d, 68(%rsp)
	movl	%r14d, 72(%rsp)
	leal	1(%r13), %r12d
	movl	%r12d, 76(%rsp)
	movl	%r14d, 48(%rsp)
	movl	%r12d, 52(%rsp)
	movl	%r13d, 56(%rsp)
	movl	%r13d, 60(%rsp)
	movq	%r15, 112(%rsp)
	movl	%r13d, 120(%rsp)
	movl	%ebp, 124(%rsp)
	movl	%r13d, 96(%rsp)
	movl	%ebp, 100(%rsp)
	movq	%r15, 104(%rsp)
	movl	%r13d, %edi
	leaq	64(%rsp), %rsi
	leaq	48(%rsp), %rdx
	leaq	112(%rsp), %rcx
	leaq	96(%rsp), %r8
	callq	_Z6callP2iPiS_S_S_
	movq	$0, 80(%rsp)
	movl	%r12d, 88(%rsp)
	movl	%r12d, 92(%rsp)
	movl	%r14d, 32(%rsp)
	movl	%r12d, 36(%rsp)
	movl	%r14d, 40(%rsp)
	movl	%r12d, 44(%rsp)
	movl	%r13d, 16(%rsp)
	movl	%r13d, 20(%rsp)
	movl	%ebp, 24(%rsp)
	movl	%ebp, 28(%rsp)
	movl	%r13d, (%rsp)
	movl	%ebp, 4(%rsp)
	movl	%r13d, 8(%rsp)
	movl	%ebp, 12(%rsp)
	movl	%r13d, %edi
	leaq	80(%rsp), %rsi
	leaq	32(%rsp), %rdx
	leaq	16(%rsp), %rcx
	movq	%rsp, %r8
	callq	_Z6callP2iPiS_S_S_
	decl	%ebp
	movl	%r12d, %r13d
	cmpl	%ebx, %r12d
	jne	.LBB2_2
# %bb.3:
	addq	$136, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB2_4:                                # %._crit_edge
	retq
.Lfunc_end2:
	.size	_Z8block_FWv, .Lfunc_end2-_Z8block_FWv
	.cfi_endproc
                                        # -- End function
	.globl	_Z6outputPc                     # -- Begin function _Z6outputPc
	.type	_Z6outputPc,@function
_Z6outputPc:                            # @_Z6outputPc
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$.L.str.3, %esi
	callq	fopen
	movq	%rax, %rbx
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.LBB3_7
# %bb.1:                                # %.preheader.preheader
	movl	$_ZL4Dist, %r14d
	xorl	%r15d, %r15d
.LBB3_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
	testl	%eax, %eax
	jle	.LBB3_6
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB3_2 Depth=1
	xorl	%r12d, %r12d
.LBB3_4:                                # %.lr.ph
                                        #   Parent Loop BB3_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r14,%r12,4), %edx
	cmpl	$10000000, %edx                 # imm = 0x989680
	jl	.LBB3_8
# %bb.5:                                #   in Loop: Header=BB3_4 Depth=2
	movl	$.L.str.4, %edi
	movl	$4, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	fwrite@PLT
	jmp	.LBB3_9
.LBB3_8:                                #   in Loop: Header=BB3_4 Depth=2
	movl	$.L.str.5, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	fprintf
.LBB3_9:                                #   in Loop: Header=BB3_4 Depth=2
	incq	%r12
	movslq	n(%rip), %rax
	cmpq	%rax, %r12
	jl	.LBB3_4
.LBB3_6:                                # %._crit_edge
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	$10, %edi
	movq	%rbx, %rsi
	callq	fputc@PLT
	incq	%r15
	movslq	n(%rip), %rax
	addq	$40040, %r14                    # imm = 0x9C68
	cmpq	%rax, %r15
	jl	.LBB3_2
.LBB3_7:                                # %._crit_edge15
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z6outputPc, .Lfunc_end3-_Z6outputPc
	.cfi_endproc
                                        # -- End function
	.globl	_Z4ceilii                       # -- Begin function _Z4ceilii
	.type	_Z4ceilii,@function
_Z4ceilii:                              # @_Z4ceilii
	.cfi_startproc
# %bb.0:
                                        # kill: def $esi killed $esi def $rsi
                                        # kill: def $edi killed $edi def $rdi
	leal	(%rdi,%rsi), %eax
	decl	%eax
	cltd
	idivl	%esi
	retq
.Lfunc_end4:
	.size	_Z4ceilii, .Lfunc_end4-_Z4ceilii
	.cfi_endproc
                                        # -- End function
	.globl	_Z6callP1i                      # -- Begin function _Z6callP1i
	.type	_Z6callP1i,@function
_Z6callP1i:                             # @_Z6callP1i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	%edi, %ebx
	movl	B(%rip), %eax
	movq	%rax, %r15
	shlq	$32, %r15
	orq	%rax, %r15
                                        # kill: def $eax killed $eax killed $rax
	imull	%eax, %eax
	shll	$2, %eax
	movslq	%eax, %r14
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	testl	%eax, %eax
	je	.LBB5_2
# %bb.1:
	movl	$.Lstr, %edi
	callq	puts@PLT
.LBB5_2:
	movq	8(%rsp), %rsi
	movl	%ebx, %edi
	callq	_Z8putInAijiPi
	leaq	16(%rsp), %r12
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	(%r12), %rdi
	movq	8(%rsp), %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	movq	%r14, %r8
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_4
# %bb.3:
	movq	16(%rsp), %rdi
	callq	_Z23__device_stub__cal_PonePi
.LBB5_4:
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %r9
	movl	%ebx, %esi
	movl	%ebx, %edx
	movl	$1, %ecx
	movl	$1, %r8d
	callq	_Z9putToDistiiiiiPi
	movq	8(%rsp), %rdi
	callq	hipHostFree
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z6callP1i, .Lfunc_end5-_Z6callP1i
	.cfi_endproc
                                        # -- End function
	.globl	_Z6callP2iPiS_S_S_              # -- Begin function _Z6callP2iPiS_S_S_
	.type	_Z6callP2iPiS_S_S_,@function
_Z6callP2iPiS_S_S_:                     # @_Z6callP2iPiS_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$328, %rsp                      # imm = 0x148
	.cfi_def_cfa_offset 384
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r8, 8(%rsp)                    # 8-byte Spill
	movq	%rcx, %r14
	movq	%rdx, 88(%rsp)                  # 8-byte Spill
	movq	%rsi, 80(%rsp)                  # 8-byte Spill
	movl	%edi, 68(%rsp)                  # 4-byte Spill
	movl	B(%rip), %ebx
	leal	(,%rbx,4), %ebp
	movq	%rbx, %rax
	shlq	$32, %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	xorl	%r15d, %r15d
.LBB6_1:                                # =>This Inner Loop Header: Depth=1
	leaq	(%rsp,%r15), %rdi
	addq	$96, %rdi
	callq	hipStreamCreate
	addq	$8, %r15
	cmpq	$32, %r15
	jne	.LBB6_1
# %bb.2:
	imull	%ebx, %ebp
	orq	%rbx, 72(%rsp)                  # 8-byte Folded Spill
	movl	%ebp, 64(%rsp)                  # 4-byte Spill
	movslq	%ebp, %rbp
	leaq	168(%rsp), %r15
	xorl	%r12d, %r12d
.LBB6_3:                                # =>This Inner Loop Header: Depth=1
	movl	(%r14,%r12), %ebx
	testq	%rbx, %rbx
	je	.LBB6_14
# %bb.4:                                #   in Loop: Header=BB6_3 Depth=1
	movq	8(%rsp), %rax                   # 8-byte Reload
	movl	(%rax,%r12), %r13d
	testq	%r13, %r13
	je	.LBB6_14
# %bb.5:                                #   in Loop: Header=BB6_3 Depth=1
	movl	%ebx, %eax
	imull	64(%rsp), %eax                  # 4-byte Folded Reload
	imull	%r13d, %eax
	movslq	%eax, %rsi
	leaq	16(%rsp), %rdi
	xorl	%edx, %edx
	callq	hipHostMalloc
	testl	%eax, %eax
	je	.LBB6_7
# %bb.6:                                #   in Loop: Header=BB6_3 Depth=1
	movl	$.Lstr.1, %edi
	callq	puts@PLT
.LBB6_7:                                #   in Loop: Header=BB6_3 Depth=1
	movslq	(%r14,%r12), %rsi
	imulq	%rbp, %rsi
	leaq	56(%rsp), %rdi
	xorl	%edx, %edx
	callq	hipHostMalloc
	testl	%eax, %eax
	je	.LBB6_9
# %bb.8:                                #   in Loop: Header=BB6_3 Depth=1
	movl	$.Lstr.2, %edi
	callq	puts@PLT
.LBB6_9:                                #   in Loop: Header=BB6_3 Depth=1
	movq	8(%rsp), %rax                   # 8-byte Reload
	movslq	(%rax,%r12), %rsi
	imulq	%rbp, %rsi
	leaq	48(%rsp), %rdi
	xorl	%edx, %edx
	callq	hipHostMalloc
	testl	%eax, %eax
	je	.LBB6_11
# %bb.10:                               #   in Loop: Header=BB6_3 Depth=1
	movl	$.Lstr.3, %edi
	callq	puts@PLT
.LBB6_11:                               #   in Loop: Header=BB6_3 Depth=1
	shlq	$32, %r13
	orq	%rbx, %r13
	movq	80(%rsp), %rax                  # 8-byte Reload
	movl	(%rax,%r12), %esi
	movq	88(%rsp), %rax                  # 8-byte Reload
	movl	(%rax,%r12), %edx
	movl	(%r14,%r12), %ecx
	movq	8(%rsp), %rbx                   # 8-byte Reload
	movl	(%rbx,%r12), %r8d
	movq	16(%rsp), %r9
	movl	68(%rsp), %edi                  # 4-byte Reload
	pushq	48(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	64(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z18putDistInArray_newiiiiiPiS_S_
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movq	16(%rsp), %rax
	movq	%rax, -40(%r15)
	movq	56(%rsp), %rax
	movq	%rax, -32(%r15)
	movq	48(%rsp), %rax
	movq	%rax, -24(%r15)
	movslq	(%r14,%r12), %rax
	imulq	%rbp, %rax
	movslq	(%rbx,%r12), %rsi
	imulq	%rax, %rsi
	leaq	40(%rsp), %rdi
	callq	hipMalloc
	movslq	(%r14,%r12), %rsi
	imulq	%rbp, %rsi
	leaq	32(%rsp), %rdi
	callq	hipMalloc
	movslq	(%rbx,%r12), %rsi
	imulq	%rbp, %rsi
	leaq	24(%rsp), %rdi
	callq	hipMalloc
	movq	40(%rsp), %rdi
	movq	%rdi, -16(%r15)
	movq	32(%rsp), %rax
	movq	%rax, -8(%r15)
	movq	24(%rsp), %rax
	movq	%rax, (%r15)
	movq	16(%rsp), %rsi
	movslq	(%r14,%r12), %rax
	imulq	%rbp, %rax
	movslq	(%rbx,%r12), %rdx
	imulq	%rax, %rdx
	movq	96(%rsp,%r12,2), %r8
	movl	$1, %ecx
	callq	hipMemcpyAsync
	movq	32(%rsp), %rdi
	movq	56(%rsp), %rsi
	movslq	(%r14,%r12), %rdx
	imulq	%rbp, %rdx
	movq	96(%rsp,%r12,2), %r8
	movl	$1, %ecx
	callq	hipMemcpyAsync
	movq	24(%rsp), %rdi
	movq	48(%rsp), %rsi
	movslq	(%rbx,%r12), %rdx
	imulq	%rbp, %rdx
	movq	96(%rsp,%r12,2), %r8
	movl	$1, %ecx
	callq	hipMemcpyAsync
	movq	96(%rsp,%r12,2), %r9
	movq	%r13, %rdi
	movl	$1, %esi
	movq	72(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	movq	%rbp, %r8
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_13
# %bb.12:                               #   in Loop: Header=BB6_3 Depth=1
	movq	40(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
	callq	_Z23__device_stub__cal_PtwoPiS_S_
.LBB6_13:                               #   in Loop: Header=BB6_3 Depth=1
	movq	16(%rsp), %rdi
	movq	40(%rsp), %rsi
	movslq	(%r14,%r12), %rax
	imulq	%rbp, %rax
	movslq	(%rbx,%r12), %rdx
	imulq	%rax, %rdx
	movq	96(%rsp,%r12,2), %r8
	movl	$2, %ecx
	callq	hipMemcpyAsync
.LBB6_14:                               #   in Loop: Header=BB6_3 Depth=1
	addq	$48, %r15
	addq	$4, %r12
	cmpq	$16, %r12
	jne	.LBB6_3
# %bb.15:                               # %.preheader.preheader
	leaq	168(%rsp), %r15
	xorl	%r12d, %r12d
	movq	8(%rsp), %rbx                   # 8-byte Reload
.LBB6_16:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	cmpl	$0, (%r14,%r12)
	je	.LBB6_19
# %bb.17:                               #   in Loop: Header=BB6_16 Depth=1
	cmpl	$0, (%rbx,%r12)
	je	.LBB6_19
# %bb.18:                               #   in Loop: Header=BB6_16 Depth=1
	movq	96(%rsp,%r12,2), %rdi
	callq	hipStreamSynchronize
	movq	80(%rsp), %rax                  # 8-byte Reload
	movl	(%rax,%r12), %esi
	movq	88(%rsp), %rax                  # 8-byte Reload
	movl	(%rax,%r12), %edx
	movl	(%r14,%r12), %ecx
	movl	(%rbx,%r12), %r8d
	movq	-40(%r15), %r13
	movq	%r13, %r9
	callq	_Z9putToDistiiiiiPi
	movq	-16(%r15), %rdi
	callq	hipFree
	movq	-8(%r15), %rdi
	callq	hipFree
	movq	(%r15), %rdi
	callq	hipFree
	movq	%r13, %rdi
	callq	hipHostFree
	movq	-32(%r15), %rdi
	callq	hipHostFree
	movq	-24(%r15), %rdi
	callq	hipHostFree
	movq	96(%rsp,%r12,2), %rdi
	callq	hipStreamDestroy
.LBB6_19:                               #   in Loop: Header=BB6_16 Depth=1
	addq	$48, %r15
	addq	$4, %r12
	cmpq	$16, %r12
	jne	.LBB6_16
# %bb.20:
	addq	$328, %rsp                      # imm = 0x148
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_Z6callP2iPiS_S_S_, .Lfunc_end6-_Z6callP2iPiS_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z8putInAijiPi                  # -- Begin function _Z8putInAijiPi
	.type	_Z8putInAijiPi,@function
_Z8putInAijiPi:                         # @_Z8putInAijiPi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
                                        # kill: def $edi killed $edi def $rdi
	movl	B(%rip), %r8d
	imull	%r8d, %edi
	leal	(%rdi,%r8), %ecx
	movl	n(%rip), %edx
	movl	%edx, %eax
	subl	%edi, %eax
	cmpl	%edx, %ecx
	cmovlel	%r8d, %eax
	movl	%eax, %ecx
	testl	%eax, %eax
	jle	.LBB7_1
# %bb.2:                                # %.lr.ph73
	movslq	%edi, %rdx
	imulq	$40044, %rdx, %rdx              # imm = 0x9C6C
	leaq	_ZL4Dist(%rdx), %rdx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
.LBB7_3:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_4 Depth 2
	xorl	%r10d, %r10d
.LBB7_4:                                #   Parent Loop BB7_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rdx,%r10,4), %r11d
	movslq	B(%rip), %rbx
	imulq	%r8, %rbx
	addq	%rsi, %rbx
	movl	%r11d, (%rbx,%r10,4)
	incq	%r10
	cmpq	%rcx, %r10
	jb	.LBB7_4
# %bb.5:                                # %._crit_edge
                                        #   in Loop: Header=BB7_3 Depth=1
	incq	%r9
	addq	$4, %r8
	addq	$40040, %rdx                    # imm = 0x9C68
	cmpq	%rcx, %r9
	jb	.LBB7_3
# %bb.6:                                # %._crit_edge74.loopexit
	addl	%r10d, %edi
	decl	%edi
	movl	B(%rip), %r8d
	jmp	.LBB7_7
.LBB7_1:
                                        # implicit-def: $edi
.LBB7_7:                                # %._crit_edge74
	leal	-1(%rax), %edx
	cmpl	%r8d, %eax
	jge	.LBB7_14
# %bb.8:                                # %.preheader68.lr.ph
	movl	%r8d, %r9d
	imull	%edx, %r9d
	movslq	%r9d, %r9
	movl	%eax, %r10d
.LBB7_9:                                # %.preheader68
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_11 Depth 2
	testl	%eax, %eax
	jle	.LBB7_13
# %bb.10:                               # %.lr.ph77.preheader
                                        #   in Loop: Header=BB7_9 Depth=1
	movslq	%r10d, %r8
	movq	%rcx, %r11
	movq	%rsi, %rbx
.LBB7_11:                               # %.lr.ph77
                                        #   Parent Loop BB7_9 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%r9,4), %ebp
	movslq	B(%rip), %r14
	imulq	%r8, %r14
	movl	%ebp, (%rbx,%r14,4)
	addq	$4, %rbx
	decq	%r11
	jne	.LBB7_11
# %bb.12:                               # %._crit_edge78.loopexit
                                        #   in Loop: Header=BB7_9 Depth=1
	movl	B(%rip), %r8d
.LBB7_13:                               # %._crit_edge78
                                        #   in Loop: Header=BB7_9 Depth=1
	incl	%r10d
	cmpl	%r8d, %r10d
	jl	.LBB7_9
.LBB7_14:                               # %._crit_edge80
	cmpl	%r8d, %eax
	jge	.LBB7_20
# %bb.15:                               # %.preheader67.lr.ph
	addl	%edx, %edi
	movslq	%edi, %rdi
	movslq	%eax, %r9
	movl	%eax, %r10d
.LBB7_16:                               # %.preheader67
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_18 Depth 2
	cmpl	%r8d, %eax
	jge	.LBB7_19
# %bb.17:                               # %.lr.ph82.preheader
                                        #   in Loop: Header=BB7_16 Depth=1
	movl	(%rsi,%rdi,4), %r11d
	movq	%r9, %rbx
.LBB7_18:                               # %.lr.ph82
                                        #   Parent Loop BB7_16 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	imull	%r10d, %r8d
	movslq	%r8d, %r8
	addq	%rbx, %r8
	movl	%r11d, (%rsi,%r8,4)
	movl	B(%rip), %r8d
	incq	%rbx
	cmpl	%r8d, %ebx
	jl	.LBB7_18
.LBB7_19:                               # %._crit_edge83
                                        #   in Loop: Header=BB7_16 Depth=1
	incl	%r10d
	cmpl	%r8d, %r10d
	jl	.LBB7_16
.LBB7_20:                               # %.preheader
	testl	%eax, %eax
	jle	.LBB7_26
# %bb.21:                               # %.lr.ph90.preheader
	xorl	%edi, %edi
.LBB7_22:                               # %.lr.ph90
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_24 Depth 2
	cmpl	%r8d, %eax
	jge	.LBB7_25
# %bb.23:                               # %.lr.ph87
                                        #   in Loop: Header=BB7_22 Depth=1
	imull	%edi, %r8d
	leal	(%r8,%rdx), %r9d
	movslq	%r9d, %r9
	movl	(%rsi,%r9,4), %r9d
	movslq	%r8d, %r8
	leaq	(%rsi,%r8,4), %r10
	movq	%rcx, %r11
.LBB7_24:                               #   Parent Loop BB7_22 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r9d, (%r10,%r11,4)
	incq	%r11
	movslq	B(%rip), %r8
	cmpq	%r8, %r11
	jl	.LBB7_24
.LBB7_25:                               # %._crit_edge88
                                        #   in Loop: Header=BB7_22 Depth=1
	incl	%edi
	cmpl	%eax, %edi
	jne	.LBB7_22
.LBB7_26:                               # %._crit_edge91
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z8putInAijiPi, .Lfunc_end7-_Z8putInAijiPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z18putDistInArray_newiiiiiPiS_S_ # -- Begin function _Z18putDistInArray_newiiiiiPiS_S_
	.type	_Z18putDistInArray_newiiiiiPiS_S_,@function
_Z18putDistInArray_newiiiiiPiS_S_:      # @_Z18putDistInArray_newiiiiiPiS_S_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
                                        # kill: def $r8d killed $r8d def $r8
	movl	%ecx, %r15d
                                        # kill: def $edx killed $edx def $rdx
                                        # kill: def $esi killed $esi def $rsi
                                        # kill: def $edi killed $edi def $rdi
	movl	B(%rip), %eax
	imull	%eax, %edi
	imull	%eax, %r15d
	imull	%eax, %r8d
	imull	%eax, %esi
	imull	%eax, %edx
	leal	(%rsi,%r15), %ecx
	movl	n(%rip), %r11d
	movl	%r11d, %r10d
	movq	%rsi, 88(%rsp)                  # 8-byte Spill
	subl	%esi, %r10d
	cmpl	%r11d, %ecx
	cmovlel	%r15d, %r10d
	leal	(%rdx,%r8), %esi
	movl	%r11d, %ecx
	subl	%edx, %ecx
	movq	%rsi, 80(%rsp)                  # 8-byte Spill
	cmpl	%r11d, %esi
	movq	%r8, 16(%rsp)                   # 8-byte Spill
	cmovlel	%r8d, %ecx
	movq	%rcx, 8(%rsp)                   # 8-byte Spill
	movq	%r9, 48(%rsp)                   # 8-byte Spill
	leal	(%rdi,%rax), %ecx
	movl	%r11d, %r8d
	movq	%rdi, 40(%rsp)                  # 8-byte Spill
	subl	%edi, %r8d
	movl	%r11d, 64(%rsp)                 # 4-byte Spill
	cmpl	%r11d, %ecx
	cmovlel	%eax, %r8d
	movq	%r8, 32(%rsp)                   # 8-byte Spill
	movslq	%edx, %rcx
	movq	%rcx, %rax
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	notl	%eax
	movl	%eax, 60(%rsp)                  # 4-byte Spill
	movl	%r10d, %eax
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	movq	%r10, %r14
	testl	%r10d, %r10d
	jle	.LBB8_5
# %bb.1:                                # %.lr.ph218
	movq	24(%rsp), %rax                  # 8-byte Reload
	leaq	_ZL4Dist(,%rax,4), %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	movl	64(%rsp), %ecx                  # 4-byte Reload
	movq	80(%rsp), %rax                  # 8-byte Reload
	cmpl	%eax, %ecx
                                        # kill: def $eax killed $eax killed $rax def $rax
	cmovll	%ecx, %eax
	addl	60(%rsp), %eax                  # 4-byte Folded Reload
	leaq	4(,%rax,4), %rbp
	movl	88(%rsp), %ebx                  # 4-byte Reload
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
.LBB8_2:                                # =>This Inner Loop Header: Depth=1
	cmpl	$0, 8(%rsp)                     # 4-byte Folded Reload
	jle	.LBB8_4
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB8_2 Depth=1
	leal	(%rbx,%r12), %eax
	cltq
	imulq	$40040, %rax, %rsi              # imm = 0x9C68
	addq	72(%rsp), %rsi                  # 8-byte Folded Reload
	movslq	%r13d, %rax
	movq	48(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %rdi
	movq	%rbp, %rdx
	callq	memcpy@PLT
.LBB8_4:                                # %._crit_edge
                                        #   in Loop: Header=BB8_2 Depth=1
	incq	%r12
	addl	16(%rsp), %r13d                 # 4-byte Folded Reload
	cmpq	96(%rsp), %r12                  # 8-byte Folded Reload
	jb	.LBB8_2
.LBB8_5:                                # %.preheader214
	movq	168(%rsp), %rbp
	movq	160(%rsp), %r9
	movq	32(%rsp), %rax                  # 8-byte Reload
	movl	%eax, %ecx
	movq	%rcx, 72(%rsp)                  # 8-byte Spill
	testl	%eax, %eax
	jle	.LBB8_13
# %bb.6:                                # %.lr.ph226
	movq	24(%rsp), %rax                  # 8-byte Reload
	leaq	_ZL4Dist(,%rax,4), %rax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movl	64(%rsp), %eax                  # 4-byte Reload
	movq	80(%rsp), %rcx                  # 8-byte Reload
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	addl	60(%rsp), %ecx                  # 4-byte Folded Reload
	leaq	4(,%rcx,4), %rax
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movslq	88(%rsp), %rax                  # 4-byte Folded Reload
	movslq	%r14d, %r13
	movslq	40(%rsp), %rcx                  # 4-byte Folded Reload
	imulq	$40040, %rax, %rax              # imm = 0x9C68
	leaq	(%rax,%rcx,4), %rbx
	addq	$_ZL4Dist, %rbx
	xorl	%r12d, %r12d
.LBB8_7:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_11 Depth 2
	cmpl	$0, 8(%rsp)                     # 4-byte Folded Reload
	jle	.LBB8_9
# %bb.8:                                # %.lr.ph221
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	40(%rsp), %rax                  # 8-byte Reload
	addl	%r12d, %eax
	cltq
	imulq	$40040, %rax, %rsi              # imm = 0x9C68
	addq	24(%rsp), %rsi                  # 8-byte Folded Reload
	movq	16(%rsp), %rax                  # 8-byte Reload
                                        # kill: def $eax killed $eax killed $rax
	imull	%r12d, %eax
	cltq
	leaq	(,%rax,4), %rdi
	addq	%rbp, %rdi
	movq	64(%rsp), %rdx                  # 8-byte Reload
	callq	memcpy@PLT
	movq	160(%rsp), %r9
.LBB8_9:                                # %.preheader213
                                        #   in Loop: Header=BB8_7 Depth=1
	testl	%r14d, %r14d
	jle	.LBB8_12
# %bb.10:                               # %.lr.ph223
                                        #   in Loop: Header=BB8_7 Depth=1
	leaq	(%r9,%r12,4), %rax
	movq	%rbx, %rcx
	xorl	%edx, %edx
.LBB8_11:                               #   Parent Loop BB8_7 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rcx), %esi
	movslq	B(%rip), %rdi
	movslq	%edx, %r8
	imulq	%rdi, %r8
	movl	%esi, (%rax,%r8,4)
	incq	%rdx
	addq	$40040, %rcx                    # imm = 0x9C68
	cmpq	%r13, %rdx
	jl	.LBB8_11
.LBB8_12:                               # %._crit_edge224
                                        #   in Loop: Header=BB8_7 Depth=1
	incq	%r12
	addq	$4, %rbx
	cmpq	72(%rsp), %r12                  # 8-byte Folded Reload
	jb	.LBB8_7
.LBB8_13:                               # %._crit_edge227
	movq	32(%rsp), %rcx                  # 8-byte Reload
	leal	-1(%rcx), %edx
	movl	%edx, %esi
	movq	16(%rsp), %rax                  # 8-byte Reload
	imull	%eax, %esi
	movl	%esi, 24(%rsp)                  # 4-byte Spill
	cltq
	cmpl	B(%rip), %ecx
	movq	%r14, %r13
	jge	.LBB8_22
# %bb.14:                               # %.preheader212.lr.ph
	movslq	24(%rsp), %r8                   # 4-byte Folded Reload
	movslq	8(%rsp), %rsi                   # 4-byte Folded Reload
	movslq	32(%rsp), %rdi                  # 4-byte Folded Reload
	leaq	(,%r8,4), %r8
	addq	%rbp, %r8
	movq	%rax, %r9
	imulq	%rdi, %r9
	leaq	(,%r9,4), %r9
	addq	%rbp, %r9
	leaq	(,%rax,4), %r10
.LBB8_15:                               # %.preheader212
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_17 Depth 2
                                        #     Child Loop BB8_20 Depth 2
	testl	%r13d, %r13d
	movq	160(%rsp), %rcx
	jle	.LBB8_18
# %bb.16:                               # %.lr.ph229.preheader
                                        #   in Loop: Header=BB8_15 Depth=1
	leaq	(%rcx,%rdi,4), %r11
	xorl	%ebx, %ebx
.LBB8_17:                               # %.lr.ph229
                                        #   Parent Loop BB8_15 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movslq	B(%rip), %r12
	movslq	%ebx, %rbx
	imulq	%rbx, %r12
	leal	(%r12,%rdx), %r13d
	movslq	%r13d, %r13
	movl	(%rcx,%r13,4), %r13d
	movl	%r13d, (%r11,%r12,4)
	movq	%r14, %r13
	incl	%ebx
	cmpl	%r13d, %ebx
	jl	.LBB8_17
.LBB8_18:                               # %.preheader211
                                        #   in Loop: Header=BB8_15 Depth=1
	cmpl	$0, 8(%rsp)                     # 4-byte Folded Reload
	jle	.LBB8_21
# %bb.19:                               # %.lr.ph231
                                        #   in Loop: Header=BB8_15 Depth=1
	xorl	%r11d, %r11d
.LBB8_20:                               #   Parent Loop BB8_15 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r8,%r11,4), %ebx
	movl	%ebx, (%r9,%r11,4)
	incq	%r11
	cmpq	%rsi, %r11
	jl	.LBB8_20
.LBB8_21:                               # %._crit_edge232
                                        #   in Loop: Header=BB8_15 Depth=1
	incq	%rdi
	movslq	B(%rip), %r11
	addq	%r10, %r9
	cmpq	%r11, %rdi
	jl	.LBB8_15
.LBB8_22:                               # %._crit_edge234
	leal	-1(%r13), %ecx
	cmpl	%r15d, %r13d
	jge	.LBB8_23
# %bb.24:                               # %.preheader210.lr.ph
	movslq	%r13d, %rdi
	movl	%ecx, %r11d
	imull	16(%rsp), %r11d                 # 4-byte Folded Reload
	movslq	%r11d, %r8
	movslq	8(%rsp), %rsi                   # 4-byte Folded Reload
	movslq	%r15d, %r9
	movq	48(%rsp), %r10                  # 8-byte Reload
	leaq	(%r10,%r8,4), %rbx
	movq	%rax, %r8
	imulq	%rdi, %r8
	leaq	(%r10,%r8,4), %r12
	leaq	(,%rax,4), %r10
.LBB8_25:                               # %.preheader210
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_27 Depth 2
	cmpl	$0, 8(%rsp)                     # 4-byte Folded Reload
	jle	.LBB8_28
# %bb.26:                               # %.lr.ph236
                                        #   in Loop: Header=BB8_25 Depth=1
	xorl	%r13d, %r13d
.LBB8_27:                               #   Parent Loop BB8_25 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%r13,4), %r8d
	movl	%r8d, (%r12,%r13,4)
	incq	%r13
	cmpq	%rsi, %r13
	jl	.LBB8_27
.LBB8_28:                               # %._crit_edge237
                                        #   in Loop: Header=BB8_25 Depth=1
	incq	%rdi
	addq	%r10, %r12
	cmpq	%r9, %rdi
	jl	.LBB8_25
# %bb.29:                               # %._crit_edge239
	movq	8(%rsp), %rdi                   # 8-byte Reload
	decl	%edi
	movq	%r14, %r13
	cmpl	%r15d, %r13d
	jge	.LBB8_36
# %bb.30:                               # %.preheader209.lr.ph
	addl	%edi, %r11d
	movslq	%r11d, %r11
	movslq	%r13d, %rbx
	movq	%rax, %r8
	imulq	%rbx, %r8
	movq	48(%rsp), %r12                  # 8-byte Reload
	leaq	(%r12,%r8,4), %r12
.LBB8_31:                               # %.preheader209
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_33 Depth 2
	movq	8(%rsp), %r8                    # 8-byte Reload
	cmpl	16(%rsp), %r8d                  # 4-byte Folded Reload
	jge	.LBB8_34
# %bb.32:                               # %.lr.ph241
                                        #   in Loop: Header=BB8_31 Depth=1
	movq	48(%rsp), %r8                   # 8-byte Reload
	movl	(%r8,%r11,4), %r13d
	movq	%rsi, %r8
.LBB8_33:                               #   Parent Loop BB8_31 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r13d, (%r12,%r8,4)
	incq	%r8
	cmpq	%rax, %r8
	jl	.LBB8_33
.LBB8_34:                               # %._crit_edge242
                                        #   in Loop: Header=BB8_31 Depth=1
	incq	%rbx
	addq	%r10, %r12
	cmpq	%r9, %rbx
	jl	.LBB8_31
# %bb.35:
	movq	%r14, %r13
	jmp	.LBB8_36
.LBB8_23:                               # %._crit_edge239.thread
	movq	8(%rsp), %rsi                   # 8-byte Reload
	leal	-1(%rsi), %edi
.LBB8_36:                               # %._crit_edge244
	movl	B(%rip), %esi
	imull	%esi, %ecx
	movl	%ecx, 40(%rsp)                  # 4-byte Spill
	cmpl	%esi, 32(%rsp)                  # 4-byte Folded Reload
	jge	.LBB8_45
# %bb.37:                               # %.preheader208.lr.ph
	movslq	32(%rsp), %r8                   # 4-byte Folded Reload
	movl	24(%rsp), %ecx                  # 4-byte Reload
	addl	%edi, %ecx
	addl	40(%rsp), %edx                  # 4-byte Folded Reload
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	8(%rsp), %r9                    # 4-byte Folded Reload
	movq	%rax, %rsi
	imulq	%r8, %rsi
	leaq	(,%rsi,4), %r10
	addq	%rbp, %r10
	leaq	(,%rax,4), %r11
.LBB8_38:                               # %.preheader208
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_40 Depth 2
                                        #     Child Loop BB8_43 Depth 2
	cmpl	%r15d, %r13d
	jge	.LBB8_41
# %bb.39:                               # %.lr.ph246.preheader
                                        #   in Loop: Header=BB8_38 Depth=1
	movq	160(%rsp), %rsi
	movl	(%rsi,%rdx,4), %ebx
	leaq	(%rsi,%r8,4), %r12
	movl	%r14d, %r13d
.LBB8_40:                               # %.lr.ph246
                                        #   Parent Loop BB8_38 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movslq	B(%rip), %rsi
	movslq	%r13d, %r13
	imulq	%r13, %rsi
	movl	%ebx, (%r12,%rsi,4)
	incl	%r13d
	cmpl	%r15d, %r13d
	jl	.LBB8_40
.LBB8_41:                               # %.preheader207
                                        #   in Loop: Header=BB8_38 Depth=1
	movq	8(%rsp), %rsi                   # 8-byte Reload
	cmpl	16(%rsp), %esi                  # 4-byte Folded Reload
	jge	.LBB8_44
# %bb.42:                               # %.lr.ph248
                                        #   in Loop: Header=BB8_38 Depth=1
	movl	(%rbp,%rcx,4), %ebx
	movq	%r9, %r12
.LBB8_43:                               #   Parent Loop BB8_38 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%ebx, (%r10,%r12,4)
	incq	%r12
	cmpq	%rax, %r12
	jl	.LBB8_43
.LBB8_44:                               # %._crit_edge249
                                        #   in Loop: Header=BB8_38 Depth=1
	incq	%r8
	movslq	B(%rip), %rsi
	addq	%r11, %r10
	cmpq	%rsi, %r8
	movq	%r14, %r13
	jl	.LBB8_38
.LBB8_45:                               # %.preheader206
	movslq	%edi, %rcx
	cmpl	$0, 32(%rsp)                    # 4-byte Folded Reload
	movq	48(%rsp), %r14                  # 8-byte Reload
	jle	.LBB8_54
# %bb.46:                               # %.lr.ph258
	movslq	8(%rsp), %rdx                   # 4-byte Folded Reload
	movslq	40(%rsp), %rsi                  # 4-byte Folded Reload
	movq	160(%rsp), %rdi
	leaq	(%rdi,%rsi,4), %rsi
	leaq	(,%rcx,4), %rdi
	addq	%rbp, %rdi
	leaq	(,%rax,4), %r8
	xorl	%r9d, %r9d
.LBB8_47:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_49 Depth 2
                                        #     Child Loop BB8_52 Depth 2
	cmpl	%r15d, %r13d
	jge	.LBB8_50
# %bb.48:                               # %.lr.ph253
                                        #   in Loop: Header=BB8_47 Depth=1
	movl	(%rsi,%r9,4), %r10d
	movq	160(%rsp), %r11
	leaq	(%r11,%r9,4), %r11
	movl	%r13d, %ebx
.LBB8_49:                               #   Parent Loop BB8_47 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movslq	B(%rip), %r12
	movslq	%ebx, %rbx
	imulq	%rbx, %r12
	movl	%r10d, (%r11,%r12,4)
	incl	%ebx
	cmpl	%r15d, %ebx
	jl	.LBB8_49
.LBB8_50:                               # %.preheader205
                                        #   in Loop: Header=BB8_47 Depth=1
	movq	8(%rsp), %r10                   # 8-byte Reload
	cmpl	16(%rsp), %r10d                 # 4-byte Folded Reload
	jge	.LBB8_53
# %bb.51:                               # %.lr.ph255
                                        #   in Loop: Header=BB8_47 Depth=1
	movq	%r9, %r10
	imulq	%rax, %r10
	movl	(%rdi,%r10,4), %r10d
	movq	%rdx, %r11
.LBB8_52:                               #   Parent Loop BB8_47 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r10d, (%rbp,%r11,4)
	incq	%r11
	cmpq	%rax, %r11
	jl	.LBB8_52
.LBB8_53:                               # %._crit_edge256
                                        #   in Loop: Header=BB8_47 Depth=1
	incq	%r9
	addq	%r8, %rbp
	cmpq	72(%rsp), %r9                   # 8-byte Folded Reload
	jne	.LBB8_47
.LBB8_54:                               # %.preheader
	testl	%r13d, %r13d
	jle	.LBB8_60
# %bb.55:                               # %.lr.ph264
	movslq	8(%rsp), %rdx                   # 4-byte Folded Reload
	leaq	(%r14,%rcx,4), %rcx
	leaq	(,%rax,4), %rsi
	xorl	%edi, %edi
.LBB8_56:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_58 Depth 2
	movq	8(%rsp), %r8                    # 8-byte Reload
	cmpl	16(%rsp), %r8d                  # 4-byte Folded Reload
	jge	.LBB8_59
# %bb.57:                               # %.lr.ph261
                                        #   in Loop: Header=BB8_56 Depth=1
	movq	%rdi, %r8
	imulq	%rax, %r8
	movl	(%rcx,%r8,4), %r8d
	movq	%rdx, %r9
.LBB8_58:                               #   Parent Loop BB8_56 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r8d, (%r14,%r9,4)
	incq	%r9
	cmpq	%rax, %r9
	jl	.LBB8_58
.LBB8_59:                               # %._crit_edge262
                                        #   in Loop: Header=BB8_56 Depth=1
	incq	%rdi
	addq	%rsi, %r14
	cmpq	96(%rsp), %rdi                  # 8-byte Folded Reload
	jne	.LBB8_56
.LBB8_60:                               # %._crit_edge265
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_Z18putDistInArray_newiiiiiPiS_S_, .Lfunc_end8-_Z18putDistInArray_newiiiiiPiS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z9putToDistiiiiiPi             # -- Begin function _Z9putToDistiiiiiPi
	.type	_Z9putToDistiiiiiPi,@function
_Z9putToDistiiiiiPi:                    # @_Z9putToDistiiiiiPi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 16(%rsp)                   # 8-byte Spill
	movl	%r8d, %r14d
                                        # kill: def $ecx killed $ecx def $rcx
                                        # kill: def $edx killed $edx def $rdx
                                        # kill: def $esi killed $esi def $rsi
	movl	B(%rip), %r8d
	imull	%r8d, %ecx
	imull	%r8d, %esi
	leal	(%rcx,%rsi), %r9d
	movl	n(%rip), %edi
	movl	%edi, %eax
	subl	%esi, %eax
	cmpl	%edi, %r9d
	cmovlel	%ecx, %eax
	testl	%eax, %eax
	jle	.LBB9_5
# %bb.1:                                # %.lr.ph35
	imull	%r8d, %r14d
	imull	%r8d, %edx
	leal	(%r14,%rdx), %ecx
	movl	%edi, %ebp
	subl	%edx, %ebp
	cmpl	%edi, %ecx
	cmovlel	%r14d, %ebp
	movslq	%edx, %rdx
	cmovgl	%edi, %ecx
	leaq	_ZL4Dist(,%rdx,4), %rdi
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	notl	%edx
	addl	%ecx, %edx
	leaq	4(,%rdx,4), %rcx
	movq	%rcx, (%rsp)                    # 8-byte Spill
	movl	%eax, %r13d
	movl	%esi, %ebx
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
.LBB9_2:                                # =>This Inner Loop Header: Depth=1
	testl	%ebp, %ebp
	jle	.LBB9_4
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB9_2 Depth=1
	movslq	%r12d, %rax
	movq	16(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %rsi
	leal	(%rbx,%r15), %eax
	cltq
	imulq	$40040, %rax, %rdi              # imm = 0x9C68
	addq	8(%rsp), %rdi                   # 8-byte Folded Reload
	movq	(%rsp), %rdx                    # 8-byte Reload
	callq	memcpy@PLT
.LBB9_4:                                # %._crit_edge
                                        #   in Loop: Header=BB9_2 Depth=1
	incq	%r15
	addl	%r14d, %r12d
	cmpq	%r13, %r15
	jb	.LBB9_2
.LBB9_5:                                # %._crit_edge36
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_Z9putToDistiiiiiPi, .Lfunc_end9-_Z9putToDistiiiiiPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z23__device_stub__cal_PonePi   # -- Begin function _Z23__device_stub__cal_PonePi
	.type	_Z23__device_stub__cal_PonePi,@function
_Z23__device_stub__cal_PonePi:          # @_Z23__device_stub__cal_PonePi
	.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	$_Z8cal_PonePi, %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_end10:
	.size	_Z23__device_stub__cal_PonePi, .Lfunc_end10-_Z23__device_stub__cal_PonePi
	.cfi_endproc
                                        # -- End function
	.globl	_Z23__device_stub__cal_PtwoPiS_S_ # -- Begin function _Z23__device_stub__cal_PtwoPiS_S_
	.type	_Z23__device_stub__cal_PtwoPiS_S_,@function
_Z23__device_stub__cal_PtwoPiS_S_:      # @_Z23__device_stub__cal_PtwoPiS_S_
	.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	24(%rsp), %rsi
	movq	%rdx, (%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	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	$_Z8cal_PtwoPiS_S_, %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_end11:
	.size	_Z23__device_stub__cal_PtwoPiS_S_, .Lfunc_end11-_Z23__device_stub__cal_PtwoPiS_S_
	.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	.LBB12_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB12_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8cal_PonePi, %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	$_Z8cal_PtwoPiS_S_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %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_end12:
	.size	__hip_module_ctor, .Lfunc_end12-__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	.LBB13_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
.LBB13_2:
	retq
.Lfunc_end13:
	.size	__hip_module_dtor, .Lfunc_end13-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	n,@object                       # @n
	.bss
	.globl	n
	.p2align	2, 0x0
n:
	.long	0                               # 0x0
	.size	n, 4

	.type	m,@object                       # @m
	.globl	m
	.p2align	2, 0x0
m:
	.long	0                               # 0x0
	.size	m, 4

	.type	B,@object                       # @B
	.globl	B
	.p2align	2, 0x0
B:
	.long	0                               # 0x0
	.size	B, 4

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

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"%d %d"
	.size	.L.str.1, 6

	.type	_ZL4Dist,@object                # @_ZL4Dist
	.local	_ZL4Dist
	.comm	_ZL4Dist,400800400,16
	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%d %d %d"
	.size	.L.str.2, 9

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"w"
	.size	.L.str.3, 2

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"INF "
	.size	.L.str.4, 5

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%d "
	.size	.L.str.5, 4

	.type	_Z8cal_PonePi,@object           # @_Z8cal_PonePi
	.section	.rodata,"a",@progbits
	.globl	_Z8cal_PonePi
	.p2align	3, 0x0
_Z8cal_PonePi:
	.quad	_Z23__device_stub__cal_PonePi
	.size	_Z8cal_PonePi, 8

	.type	_Z8cal_PtwoPiS_S_,@object       # @_Z8cal_PtwoPiS_S_
	.globl	_Z8cal_PtwoPiS_S_
	.p2align	3, 0x0
_Z8cal_PtwoPiS_S_:
	.quad	_Z23__device_stub__cal_PtwoPiS_S_
	.size	_Z8cal_PtwoPiS_S_, 8

	.type	.L__unnamed_1,@object           # @0
	.section	.rodata.str1.1,"aMS",@progbits,1
.L__unnamed_1:
	.asciz	"_Z8cal_PonePi"
	.size	.L__unnamed_1, 14

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z8cal_PtwoPiS_S_"
	.size	.L__unnamed_2, 18

	.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	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"malloc Dist_ij error"
	.size	.Lstr, 21

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"malloc Dist_ij2 error"
	.size	.Lstr.1, 22

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"malloc Dist_ik2 error"
	.size	.Lstr.2, 22

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"malloc Dist_kj2 error"
	.size	.Lstr.3, 22

	.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 _Z23__device_stub__cal_PonePi
	.addrsig_sym _Z23__device_stub__cal_PtwoPiS_S_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym n
	.addrsig_sym m
	.addrsig_sym _Z8cal_PonePi
	.addrsig_sym _Z8cal_PtwoPiS_S_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z8cal_PonePi           ; -- Begin function _Z8cal_PonePi
	.globl	_Z8cal_PonePi
	.p2align	8
	.type	_Z8cal_PonePi,@function
_Z8cal_PonePi:                          ; @_Z8cal_PonePi
; %bb.0:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x14
	s_load_b32 s6, s[0:1], 0xc
	v_and_b32_e32 v5, 0x3ff, v0
	v_bfe_u32 v6, v0, 10, 10
	s_load_b64 s[4:5], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s3, 0xffff
	s_lshr_b32 s7, s3, 16
	v_mad_u64_u32 v[2:3], null, s14, s2, v[5:6]
	v_mad_u64_u32 v[3:4], null, s15, s7, v[6:7]
	s_mul_i32 s0, s6, s7
	v_cmp_eq_u16_e64 s1, s3, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[0:1], null, s0, v2, v[3:4]
	v_mad_u32_u24 v4, v5, s7, v6
	v_lshl_add_u32 v4, v4, 2, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	s_and_b32 vcc_lo, exec_lo, s1
	global_load_b32 v7, v[0:1], off
	s_waitcnt vmcnt(0)
	ds_store_b32 v4, v7
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_vccnz .LBB0_5
; %bb.1:                                ; %.lr.ph
	v_mul_lo_u32 v5, v2, s2
	v_lshl_add_u32 v2, v3, 2, 0
	s_lshl_b32 s0, s0, 2
	s_delay_alu instid0(VALU_DEP_2)
	v_lshl_add_u32 v3, v5, 2, 0
.LBB0_2:                                ; =>This Inner Loop Header: Depth=1
	ds_load_b32 v5, v3
	ds_load_b32 v6, v2
	ds_load_b32 v7, v4
	s_mov_b32 s1, exec_lo
	s_waitcnt lgkmcnt(1)
	v_add_nc_u32_e32 v5, v6, v5
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_lt_i32_e64 v5, v7
	s_cbranch_execz .LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ds_store_b32 v4, v5
.LBB0_4:                                ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	v_add_nc_u32_e32 v2, s0, v2
	v_add_nc_u32_e32 v3, 4, v3
	s_add_i32 s2, s2, -1
	s_waitcnt lgkmcnt(0)
	s_cmp_eq_u32 s2, 0
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc0 .LBB0_2
.LBB0_5:                                ; %._crit_edge
	ds_load_b32 v2, v4
	s_waitcnt lgkmcnt(0)
	global_store_b32 v[0:1], v2, off
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8cal_PonePi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 264
		.amdhsa_user_sgpr_count 14
		.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 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 8
		.amdhsa_next_free_sgpr 16
		.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	_Z8cal_PonePi, .Lfunc_end0-_Z8cal_PonePi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 368
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z8cal_PtwoPiS_S_       ; -- Begin function _Z8cal_PtwoPiS_S_
	.globl	_Z8cal_PtwoPiS_S_
	.p2align	8
	.type	_Z8cal_PtwoPiS_S_,@function
_Z8cal_PtwoPiS_S_:                      ; @_Z8cal_PtwoPiS_S_
; %bb.0:
	s_clause 0x1
	s_load_b32 s8, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x1c
	v_and_b32_e32 v6, 0x3ff, v0
	v_bfe_u32 v7, v0, 10, 10
	s_load_b128 s[4:7], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s9, s8, 16
	s_and_b32 s2, s8, 0xffff
	v_mad_u64_u32 v[0:1], null, s15, s9, v[7:8]
	v_mad_u64_u32 v[4:5], null, s14, s2, v[6:7]
	s_mul_i32 s3, s3, s9
	v_mad_u32_u24 v5, v6, s9, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshl_add_u32 v7, v5, 2, 0
	v_mad_u64_u32 v[1:2], null, s3, v4, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	v_cmp_eq_u16_e64 s4, s8, 0
	global_load_b32 v1, v[2:3], off
	s_and_b32 vcc_lo, exec_lo, s4
	s_waitcnt vmcnt(0)
	ds_store_b32 v7, v1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	ds_load_b32 v6, v7
	s_cbranch_vccnz .LBB1_5
; %bb.1:                                ; %.lr.ph
	s_load_b64 s[0:1], s[0:1], 0x10
	v_mul_lo_u32 v4, v4, s2
	v_mov_b32_e32 v5, 0
.LBB1_2:                                ; =>This Inner Loop Header: Depth=1
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[8:9], 2, v[4:5]
	s_mov_b32 s4, exec_lo
	v_lshlrev_b64 v[10:11], 2, v[0:1]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v8, vcc_lo, s6, v8
	v_add_co_ci_u32_e32 v9, vcc_lo, s7, v9, vcc_lo
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v10, vcc_lo, s0, v10
	v_add_co_ci_u32_e32 v11, vcc_lo, s1, v11, vcc_lo
	global_load_b32 v1, v[8:9], off
	global_load_b32 v8, v[10:11], off
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v1, v8, v1
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_lt_i32_e64 v1, v6
	s_cbranch_execz .LBB1_4
; %bb.3:                                ;   in Loop: Header=BB1_2 Depth=1
	v_mov_b32_e32 v6, v1
	ds_store_b32 v7, v1
.LBB1_4:                                ;   in Loop: Header=BB1_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
	v_add_nc_u32_e32 v0, s3, v0
	v_add_nc_u32_e32 v4, 1, v4
	s_add_i32 s2, s2, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s2, 0
	s_cbranch_scc0 .LBB1_2
.LBB1_5:                                ; %Flow51
	s_waitcnt lgkmcnt(0)
	global_store_b32 v[2:3], v6, off
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8cal_PtwoPiS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 14
		.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 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 12
		.amdhsa_next_free_sgpr 16
		.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	_Z8cal_PtwoPiS_S_, .Lfunc_end1-_Z8cal_PtwoPiS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 396
; NumSgprs: 18
; NumVgprs: 12
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 12
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; 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
      - .offset:         8
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         12
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         20
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         22
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         24
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         26
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         28
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         30
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         48
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         72
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         128
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 264
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8cal_PonePi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z8cal_PonePi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .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
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         144
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8cal_PtwoPiS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z8cal_PtwoPiS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     12
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
