/*-----------------------------------------------------------
 ** gaussian.cu -- The program is to solve a linear system Ax = b
 **   by using Gaussian Elimination. The algorithm on page 101
 **   ("Foundations of Parallel Programming") is used.  
 **   The sequential version is gaussian.c.  This parallel 
 **   implementation converts three independent for() loops 
 **   into three Fans.  Use the data file ge_3.dat to verify 
 **   the correction of the output. 
 **
 ** Written by Andreas Kura, 02/15/95
 ** Modified by Chong-wei Xu, 04/20/95
 ** Modified by Chris Gregg for CUDA, 07/20/2009
 **-----------------------------------------------------------
 */
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include "cuda.h"
#include <string.h>
#include <math.h>

#ifdef RD_WG_SIZE_0_0
        #define MAXBLOCKSIZE RD_WG_SIZE_0_0
#elif defined(RD_WG_SIZE_0)
        #define MAXBLOCKSIZE RD_WG_SIZE_0
#elif defined(RD_WG_SIZE)
        #define MAXBLOCKSIZE RD_WG_SIZE
#else
        #define MAXBLOCKSIZE 512
#endif

//2D defines. Go from specific to general                                                
#ifdef RD_WG_SIZE_1_0
        #define BLOCK_SIZE_XY RD_WG_SIZE_1_0
#elif defined(RD_WG_SIZE_1)
        #define BLOCK_SIZE_XY RD_WG_SIZE_1
#elif defined(RD_WG_SIZE)
        #define BLOCK_SIZE_XY RD_WG_SIZE
#else
        #define BLOCK_SIZE_XY 4
#endif

int Size;
float *a, *b, *finalVec;
float *m;

FILE *fp;

void InitProblemOnce(char *filename);
void InitPerRun();
void ForwardSub();
void BackSub();
__global__ void Fan1(float *m, float *a, int Size, int t);
__global__ void Fan2(float *m, float *a, float *b,int Size, int j1, int t);
void InitMat(float *ary, int nrow, int ncol);
void InitAry(float *ary, int ary_size);
void PrintMat(float *ary, int nrow, int ncolumn);
void PrintAry(float *ary, int ary_size);
void PrintDeviceProperties();
void checkCUDAError(const char *msg);

unsigned int totalKernelTime = 0;

// create both matrix and right hand side, Ke Wang 2013/08/12 11:51:06
void
create_matrix(float *m, int size){
  int i,j;
  float lamda = -0.01;
  float coe[2*size-1];
  float coe_i =0.0;

  for (i=0; i < size; i++)
    {
      coe_i = 10*exp(lamda*i); 
      j=size-1+i;     
      coe[j]=coe_i;
      j=size-1-i;     
      coe[j]=coe_i;
    }


  for (i=0; i < size; i++) {
      for (j=0; j < size; j++) {
	m[i*size+j]=coe[size-1-i+j];
      }
  }


}


int main(int argc, char *argv[])
{
  printf("WG size of kernel 1 = %d, WG size of kernel 2= %d X %d\n", MAXBLOCKSIZE, BLOCK_SIZE_XY, BLOCK_SIZE_XY);
    int verbose = 1;
    int i, j;
    char flag;
    if (argc < 2) {
        printf("Usage: gaussian -f filename / -s size [-q]\n\n");
        printf("-q (quiet) suppresses printing the matrix and result values.\n");
        printf("-f (filename) path of input file\n");
        printf("-s (size) size of matrix. Create matrix and rhs in this program \n");
        printf("The first line of the file contains the dimension of the matrix, n.");
        printf("The second line of the file is a newline.\n");
        printf("The next n lines contain n tab separated values for the matrix.");
        printf("The next line of the file is a newline.\n");
        printf("The next line of the file is a 1xn vector with tab separated values.\n");
        printf("The next line of the file is a newline. (optional)\n");
        printf("The final line of the file is the pre-computed solution. (optional)\n");
        printf("Example: matrix4.txt:\n");
        printf("4\n");
        printf("\n");
        printf("-0.6	-0.5	0.7	0.3\n");
        printf("-0.3	-0.9	0.3	0.7\n");
        printf("-0.4	-0.5	-0.3	-0.8\n");	
        printf("0.0	-0.1	0.2	0.9\n");
        printf("\n");
        printf("-0.85	-0.68	0.24	-0.53\n");	
        printf("\n");
        printf("0.7	0.0	-0.4	-0.5\n");
        exit(0);
    }
    
    //PrintDeviceProperties();
    //char filename[100];
    //sprintf(filename,"matrices/matrix%d.txt",size);

    for(i=1;i<argc;i++) {
      if (argv[i][0]=='-') {// flag
        flag = argv[i][1];
          switch (flag) {
            case 's': // platform
              i++;
              Size = atoi(argv[i]);
	      printf("Create matrix internally in parse, size = %d \n", Size);

	      a = (float *) malloc(Size * Size * sizeof(float));
	      create_matrix(a, Size);

	      b = (float *) malloc(Size * sizeof(float));
	      for (j =0; j< Size; j++)
	    	b[j]=1.0;

	      m = (float *) malloc(Size * Size * sizeof(float));
              break;
            case 'f': // platform
              i++;
	      printf("Read file from %s \n", argv[i]);
	      InitProblemOnce(argv[i]);
              break;
            case 'q': // quiet
	      verbose = 0;
              break;
	  }
      }
    }

    //InitProblemOnce(filename);
    InitPerRun();
    //begin timing
    struct timeval time_start;
    gettimeofday(&time_start, NULL);	
    
    // run kernels
    ForwardSub();
    
    //end timing
    struct timeval time_end;
    gettimeofday(&time_end, NULL);
    unsigned int time_total = (time_end.tv_sec * 1000000 + time_end.tv_usec) - (time_start.tv_sec * 1000000 + time_start.tv_usec);
    
    if (verbose) {
        printf("Matrix m is: \n");
        PrintMat(m, Size, Size);

        printf("Matrix a is: \n");
        PrintMat(a, Size, Size);

        printf("Array b is: \n");
        PrintAry(b, Size);
    }
    BackSub();
    if (verbose) {
        printf("The final solution is: \n");
        PrintAry(finalVec,Size);
    }
    printf("\nTime total (including memory transfers)\t%f sec\n", time_total * 1e-6);
    printf("Time for CUDA kernels:\t%f sec\n",totalKernelTime * 1e-6);
    
    /*printf("%d,%d\n",size,time_total);
    fprintf(stderr,"%d,%d\n",size,time_total);*/
    
    free(m);
    free(a);
    free(b);
}
/*------------------------------------------------------
 ** PrintDeviceProperties
 **-----------------------------------------------------
 */
void PrintDeviceProperties(){
	cudaDeviceProp deviceProp;  
	int nDevCount = 0;  
	
	cudaGetDeviceCount( &nDevCount );  
	printf( "Total Device found: %d", nDevCount );  
	for (int nDeviceIdx = 0; nDeviceIdx < nDevCount; ++nDeviceIdx )  
	{  
	    memset( &deviceProp, 0, sizeof(deviceProp));  
	    if( cudaSuccess == cudaGetDeviceProperties(&deviceProp, nDeviceIdx))  
	        {
				printf( "\nDevice Name \t\t - %s ", deviceProp.name );  
			    printf( "\n**************************************");  
			    printf( "\nTotal Global Memory\t\t\t - %lu KB", deviceProp.totalGlobalMem/1024 );  
			    printf( "\nShared memory available per block \t - %lu KB", deviceProp.sharedMemPerBlock/1024 );  
			    printf( "\nNumber of registers per thread block \t - %d", deviceProp.regsPerBlock );  
			    printf( "\nWarp size in threads \t\t\t - %d", deviceProp.warpSize );  
			    printf( "\nMemory Pitch \t\t\t\t - %zu bytes", deviceProp.memPitch );  
			    printf( "\nMaximum threads per block \t\t - %d", deviceProp.maxThreadsPerBlock );  
			    printf( "\nMaximum Thread Dimension (block) \t - %d %d %d", deviceProp.maxThreadsDim[0], deviceProp.maxThreadsDim[1], deviceProp.maxThreadsDim[2] );  
			    printf( "\nMaximum Thread Dimension (grid) \t - %d %d %d", deviceProp.maxGridSize[0], deviceProp.maxGridSize[1], deviceProp.maxGridSize[2] );  
			    printf( "\nTotal constant memory \t\t\t - %zu bytes", deviceProp.totalConstMem );  
			    printf( "\nCUDA ver \t\t\t\t - %d.%d", deviceProp.major, deviceProp.minor );  
			    printf( "\nClock rate \t\t\t\t - %d KHz", deviceProp.clockRate );  
			    printf( "\nTexture Alignment \t\t\t - %zu bytes", deviceProp.textureAlignment );  
			    printf( "\nDevice Overlap \t\t\t\t - %s", deviceProp. deviceOverlap?"Allowed":"Not Allowed" );  
			    printf( "\nNumber of Multi processors \t\t - %d\n\n", deviceProp.multiProcessorCount );  
			}  
	    else  
	        printf( "\n%s", cudaGetErrorString(cudaGetLastError()));  
	}  
}
 
 
/*------------------------------------------------------
 ** InitProblemOnce -- Initialize all of matrices and
 ** vectors by opening a data file specified by the user.
 **
 ** We used dynamic array *a, *b, and *m to allocate
 ** the memory storages.
 **------------------------------------------------------
 */
void InitProblemOnce(char *filename)
{
	//char *filename = argv[1];
	
	//printf("Enter the data file name: ");
	//scanf("%s", filename);
	//printf("The file name is: %s\n", filename);
	
	fp = fopen(filename, "r");
	
	fscanf(fp, "%d", &Size);	
	 
	a = (float *) malloc(Size * Size * sizeof(float));
	 
	InitMat(a, Size, Size);
	//printf("The input matrix a is:\n");
	//PrintMat(a, Size, Size);
	b = (float *) malloc(Size * sizeof(float));
	
	InitAry(b, Size);
	//printf("The input array b is:\n");
	//PrintAry(b, Size);
		
	 m = (float *) malloc(Size * Size * sizeof(float));
}

/*------------------------------------------------------
 ** InitPerRun() -- Initialize the contents of the
 ** multipier matrix **m
 **------------------------------------------------------
 */
void InitPerRun() 
{
	int i;
	for (i=0; i<Size*Size; i++)
			*(m+i) = 0.0;
}

/*-------------------------------------------------------
 ** Fan1() -- Calculate multiplier matrix
 ** Pay attention to the index.  Index i give the range
 ** which starts from 0 to range-1.  The real values of
 ** the index should be adjust and related with the value
 ** of t which is defined on the ForwardSub().
 **-------------------------------------------------------
 */
__global__ void Fan1(float *m_cuda, float *a_cuda, int Size, int t)
{   
	//if(threadIdx.x + blockIdx.x * blockDim.x >= Size-1-t) printf(".");
	//printf("blockIDx.x:%d,threadIdx.x:%d,Size:%d,t:%d,Size-1-t:%d\n",blockIdx.x,threadIdx.x,Size,t,Size-1-t);

	if(threadIdx.x + blockIdx.x * blockDim.x >= Size-1-t) return;
	*(m_cuda+Size*(blockDim.x*blockIdx.x+threadIdx.x+t+1)+t) = *(a_cuda+Size*(blockDim.x*blockIdx.x+threadIdx.x+t+1)+t) / *(a_cuda+Size*t+t);
}

/*-------------------------------------------------------
 ** Fan2() -- Modify the matrix A into LUD
 **-------------------------------------------------------
 */ 

__global__ void Fan2(float *m_cuda, float *a_cuda, float *b_cuda,int Size, int j1, int t)
{
	if(threadIdx.x + blockIdx.x * blockDim.x >= Size-1-t) return;
	if(threadIdx.y + blockIdx.y * blockDim.y >= Size-t) return;
	
	int xidx = blockIdx.x * blockDim.x + threadIdx.x;
	int yidx = blockIdx.y * blockDim.y + threadIdx.y;
	//printf("blockIdx.x:%d,threadIdx.x:%d,blockIdx.y:%d,threadIdx.y:%d,blockDim.x:%d,blockDim.y:%d\n",blockIdx.x,threadIdx.x,blockIdx.y,threadIdx.y,blockDim.x,blockDim.y);
	
	a_cuda[Size*(xidx+1+t)+(yidx+t)] -= m_cuda[Size*(xidx+1+t)+t] * a_cuda[Size*t+(yidx+t)];
	//a_cuda[xidx+1+t][yidx+t] -= m_cuda[xidx+1+t][t] * a_cuda[t][yidx+t];
	if(yidx == 0){
		//printf("blockIdx.x:%d,threadIdx.x:%d,blockIdx.y:%d,threadIdx.y:%d,blockDim.x:%d,blockDim.y:%d\n",blockIdx.x,threadIdx.x,blockIdx.y,threadIdx.y,blockDim.x,blockDim.y);
		//printf("xidx:%d,yidx:%d\n",xidx,yidx);
		b_cuda[xidx+1+t] -= m_cuda[Size*(xidx+1+t)+(yidx+t)] * b_cuda[t];
	}
}

/*------------------------------------------------------
 ** ForwardSub() -- Forward substitution of Gaussian
 ** elimination.
 **------------------------------------------------------
 */
void ForwardSub()
{
	int t;
    float *m_cuda,*a_cuda,*b_cuda;
	
	// allocate memory on GPU
	cudaMalloc((void **) &m_cuda, Size * Size * sizeof(float));
	 
	cudaMalloc((void **) &a_cuda, Size * Size * sizeof(float));
	
	cudaMalloc((void **) &b_cuda, Size * sizeof(float));	

	// copy memory to GPU
	cudaMemcpy(m_cuda, m, Size * Size * sizeof(float),cudaMemcpyHostToDevice );
	cudaMemcpy(a_cuda, a, Size * Size * sizeof(float),cudaMemcpyHostToDevice );
	cudaMemcpy(b_cuda, b, Size * sizeof(float),cudaMemcpyHostToDevice );
	
	int block_size,grid_size;
	
	block_size = MAXBLOCKSIZE;
	grid_size = (Size/block_size) + (!(Size%block_size)? 0:1);
	//printf("1d grid size: %d\n",grid_size);


	dim3 dimBlock(block_size);
	dim3 dimGrid(grid_size);
	//dim3 dimGrid( (N/dimBlock.x) + (!(N%dimBlock.x)?0:1) );
	
	int blockSize2d, gridSize2d;
	blockSize2d = BLOCK_SIZE_XY;
	gridSize2d = (Size/blockSize2d) + (!(Size%blockSize2d?0:1)); 
	
	dim3 dimBlockXY(blockSize2d,blockSize2d);
	dim3 dimGridXY(gridSize2d,gridSize2d);

    // begin timing kernels
    struct timeval time_start;
    gettimeofday(&time_start, NULL);
	for (t=0; t<(Size-1); t++) {
		Fan1<<<dimGrid,dimBlock>>>(m_cuda,a_cuda,Size,t);
		cudaThreadSynchronize();
		Fan2<<<dimGridXY,dimBlockXY>>>(m_cuda,a_cuda,b_cuda,Size,Size-t,t);
		cudaThreadSynchronize();
		checkCUDAError("Fan2");
	}
	// end timing kernels
	struct timeval time_end;
    gettimeofday(&time_end, NULL);
    totalKernelTime = (time_end.tv_sec * 1000000 + time_end.tv_usec) - (time_start.tv_sec * 1000000 + time_start.tv_usec);
	
	// copy memory back to CPU
	cudaMemcpy(m, m_cuda, Size * Size * sizeof(float),cudaMemcpyDeviceToHost );
	cudaMemcpy(a, a_cuda, Size * Size * sizeof(float),cudaMemcpyDeviceToHost );
	cudaMemcpy(b, b_cuda, Size * sizeof(float),cudaMemcpyDeviceToHost );
	cudaFree(m_cuda);
	cudaFree(a_cuda);
	cudaFree(b_cuda);
}

/*------------------------------------------------------
 ** BackSub() -- Backward substitution
 **------------------------------------------------------
 */

void BackSub()
{
	// create a new vector to hold the final answer
	finalVec = (float *) malloc(Size * sizeof(float));
	// solve "bottom up"
	int i,j;
	for(i=0;i<Size;i++){
		finalVec[Size-i-1]=b[Size-i-1];
		for(j=0;j<i;j++)
		{
			finalVec[Size-i-1]-=*(a+Size*(Size-i-1)+(Size-j-1)) * finalVec[Size-j-1];
		}
		finalVec[Size-i-1]=finalVec[Size-i-1]/ *(a+Size*(Size-i-1)+(Size-i-1));
	}
}

void InitMat(float *ary, int nrow, int ncol)
{
	int i, j;
	
	for (i=0; i<nrow; i++) {
		for (j=0; j<ncol; j++) {
			fscanf(fp, "%f",  ary+Size*i+j);
		}
	}  
}

/*------------------------------------------------------
 ** PrintMat() -- Print the contents of the matrix
 **------------------------------------------------------
 */
void PrintMat(float *ary, int nrow, int ncol)
{
	int i, j;
	
	for (i=0; i<nrow; i++) {
		for (j=0; j<ncol; j++) {
			printf("%8.2f ", *(ary+Size*i+j));
		}
		printf("\n");
	}
	printf("\n");
}

/*------------------------------------------------------
 ** InitAry() -- Initialize the array (vector) by reading
 ** data from the data file
 **------------------------------------------------------
 */
void InitAry(float *ary, int ary_size)
{
	int i;
	
	for (i=0; i<ary_size; i++) {
		fscanf(fp, "%f",  &ary[i]);
	}
}  

/*------------------------------------------------------
 ** PrintAry() -- Print the contents of the array (vector)
 **------------------------------------------------------
 */
void PrintAry(float *ary, int ary_size)
{
	int i;
	for (i=0; i<ary_size; i++) {
		printf("%.2f ", ary[i]);
	}
	printf("\n\n");
}
void checkCUDAError(const char *msg)
{
    cudaError_t err = cudaGetLastError();
    if( cudaSuccess != err) 
    {
        fprintf(stderr, "Cuda error: %s: %s.\n", msg, 
                                  cudaGetErrorString( err) );
        exit(EXIT_FAILURE);
    }                         
}


	.file	"tmpxft_0027f546_00000000-6_gaussian.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2041:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2041:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z13create_matrixPfi
	.type	_Z13create_matrixPfi, @function
_Z13create_matrixPfi:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	movq	%rdi, %r13
	pushq	%r12
	.cfi_offset 12, -48
	movl	%esi, %r12d
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leal	-1(%rsi,%rsi), %eax
	movq	%rsp, %rcx
	cltq
	leaq	15(,%rax,4), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L3:
	cmpq	%rcx, %rsp
	je	.L4
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L3
.L4:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L5
	orq	$0, -8(%rsp,%rax)
.L5:
	movslq	%r12d, %r15
	xorl	%r14d, %r14d
	salq	$2, %r15
	leaq	(%rsp,%r15), %rbx
.L6:
	cmpl	%r14d, %r12d
	jle	.L16
	cvtsi2ssl	%r14d, %xmm0
	mulss	.LC0(%rip), %xmm0
	call	expf@PLT
	mulss	.LC1(%rip), %xmm0
	imulq	$-4, %r14, %rax
	movss	%xmm0, -4(%rbx,%r14,4)
	incq	%r14
	movss	%xmm0, -4(%rbx,%rax)
	jmp	.L6
.L16:
	leal	-1(%r12), %ecx
	xorl	%r8d, %r8d
	leaq	4(,%rcx,4), %r9
.L8:
	subq	$4, %rbx
	cmpl	%r12d, %r8d
	jge	.L17
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%r9, %rcx
	incl	%r8d
	rep movsb
	addq	%r15, %r13
	jmp	.L8
.L17:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z13create_matrixPfi, .-_Z13create_matrixPfi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"Allowed"
.LC3:
	.string	"Not Allowed"
.LC4:
	.string	"Total Device found: %d"
.LC5:
	.string	"\nDevice Name \t\t - %s "
.LC6:
	.string	"\n**************************************"
.LC7:
	.string	"\nTotal Global Memory\t\t\t - %lu KB"
.LC8:
	.string	"\nShared memory available per block \t - %lu KB"
.LC9:
	.string	"\nNumber of registers per thread block \t - %d"
.LC10:
	.string	"\nWarp size in threads \t\t\t - %d"
.LC11:
	.string	"\nMemory Pitch \t\t\t\t - %zu bytes"
.LC12:
	.string	"\nMaximum threads per block \t\t - %d"
.LC13:
	.string	"\nMaximum Thread Dimension (block) \t - %d %d %d"
.LC14:
	.string	"\nMaximum Thread Dimension (grid) \t - %d %d %d"
.LC15:
	.string	"\nTotal constant memory \t\t\t - %zu bytes"
.LC16:
	.string	"\nCUDA ver \t\t\t\t - %d.%d"
.LC17:
	.string	"\nClock rate \t\t\t\t - %d KHz"
.LC18:
	.string	"\nTexture Alignment \t\t\t - %zu bytes"
.LC19:
	.string	"\nDevice Overlap \t\t\t\t - %s"
.LC20:
	.string	"\nNumber of Multi processors \t\t - %d\n\n"
.LC21:
	.string	"\n%s"
	.text
	.globl	_Z21PrintDevicePropertiesv
	.type	_Z21PrintDevicePropertiesv, @function
_Z21PrintDevicePropertiesv:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC21(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	subq	$1056, %rsp
	.cfi_def_cfa_offset 1088
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdi
	xorl	%eax, %eax
	movl	%eax, 12(%rsp)
	call	cudaGetDeviceCount@PLT
	movl	12(%rsp), %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
.L19:
	cmpl	%ebx, 12(%rsp)
	jle	.L27
	leaq	16(%rsp), %rbp
	xorl	%eax, %eax
	movl	$258, %ecx
	movl	%ebx, %esi
	movq	%rbp, %rdi
	rep stosl
	movq	%rbp, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	testl	%eax, %eax
	jne	.L20
	movq	%rbp, %rdx
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	304(%rsp), %rdx
	leaq	.LC7(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	shrq	$10, %rdx
	call	__printf_chk@PLT
	movq	312(%rsp), %rdx
	leaq	.LC8(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	shrq	$10, %rdx
	call	__printf_chk@PLT
	movl	320(%rsp), %edx
	leaq	.LC9(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	324(%rsp), %edx
	leaq	.LC10(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	328(%rsp), %rdx
	leaq	.LC11(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	336(%rsp), %edx
	leaq	.LC12(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	348(%rsp), %r8d
	xorl	%eax, %eax
	movl	344(%rsp), %ecx
	movl	340(%rsp), %edx
	leaq	.LC13(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	360(%rsp), %r8d
	xorl	%eax, %eax
	movl	356(%rsp), %ecx
	movl	352(%rsp), %edx
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	368(%rsp), %rdx
	leaq	.LC15(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	380(%rsp), %ecx
	movl	$2, %edi
	xorl	%eax, %eax
	movl	376(%rsp), %edx
	leaq	.LC16(%rip), %rsi
	call	__printf_chk@PLT
	movl	364(%rsp), %edx
	leaq	.LC17(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	384(%rsp), %rdx
	leaq	.LC18(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	cmpl	$0, 400(%rsp)
	leaq	.LC2(%rip), %rax
	leaq	.LC3(%rip), %rdx
	cmovne	%rax, %rdx
	leaq	.LC19(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	404(%rsp), %edx
	leaq	.LC20(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L22
.L20:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	movq	%r12, %rsi
	movl	$2, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L22:
	incl	%ebx
	jmp	.L19
.L27:
	movq	1048(%rsp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	addq	$1056, %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
.LFE2029:
	.size	_Z21PrintDevicePropertiesv, .-_Z21PrintDevicePropertiesv
	.globl	_Z10InitPerRunv
	.type	_Z10InitPerRunv, @function
_Z10InitPerRunv:
.LFB2031:
	.cfi_startproc
	endbr64
	movl	Size(%rip), %eax
	movq	m(%rip), %rcx
	imull	%eax, %eax
	movl	%eax, %edx
	xorl	%eax, %eax
.L29:
	cmpl	%eax, %edx
	jle	.L31
	movl	$0x00000000, (%rcx,%rax,4)
	incq	%rax
	jmp	.L29
.L31:
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z10InitPerRunv, .-_Z10InitPerRunv
	.globl	_Z7BackSubv
	.type	_Z7BackSubv, @function
_Z7BackSubv:
.LFB2033:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	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
	movslq	Size(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	0(,%rbp,4), %r13
	movq	%rbp, %rbx
	movq	%r13, %rdi
	call	malloc@PLT
	movq	a(%rip), %r9
	movq	b(%rip), %r10
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, finalVec(%rip)
	movl	%ebp, %eax
	leaq	-4(%r13), %r8
	negl	%eax
	cltq
	leaq	-4(,%rax,4), %r11
	leal	-1(%rbp), %eax
	imull	%ebp, %eax
	movslq	%eax, %rdx
	addq	%rbp, %rdx
	leaq	(%r9,%rdx,4), %r12
	leaq	(%rdi,%r13), %rdx
.L33:
	cmpl	%esi, %ebx
	jle	.L38
	movslq	%eax, %rcx
	imulq	$-4, %rsi, %r13
	movss	(%r10,%r8), %xmm0
	addq	%rbp, %rcx
	leaq	(%r9,%rcx,4), %r14
	xorl	%ecx, %ecx
.L34:
	movss	%xmm0, (%rdi,%r8)
	cmpq	%r13, %rcx
	je	.L39
	movss	-4(%r14,%rcx), %xmm1
	mulss	-4(%rdx,%rcx), %xmm1
	subq	$4, %rcx
	subss	%xmm1, %xmm0
	jmp	.L34
.L39:
	divss	-4(%r12), %xmm0
	incq	%rsi
	addq	%r11, %r12
	movss	%xmm0, (%rdi,%r8)
	subl	%ebx, %eax
	subq	$4, %r8
	jmp	.L33
.L38:
	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
.LFE2033:
	.size	_Z7BackSubv, .-_Z7BackSubv
	.section	.rodata.str1.1
.LC23:
	.string	"%f"
	.text
	.globl	_Z7InitMatPfii
	.type	_Z7InitMatPfii, @function
_Z7InitMatPfii:
.LFB2034:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC23(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 64
.L41:
	cmpl	%r14d, %ebx
	jge	.L46
	xorl	%r13d, %r13d
.L43:
	cmpl	%r13d, %ebp
	jle	.L47
	movl	Size(%rip), %eax
	movq	fp(%rip), %rdi
	movq	%r12, %rsi
	imull	%ebx, %eax
	cltq
	addq	%r13, %rax
	incq	%r13
	leaq	(%r15,%rax,4), %rdx
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	jmp	.L43
.L47:
	incl	%ebx
	jmp	.L41
.L46:
	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
.LFE2034:
	.size	_Z7InitMatPfii, .-_Z7InitMatPfii
	.section	.rodata.str1.1
.LC24:
	.string	"%8.2f "
.LC25:
	.string	"\n"
	.text
	.globl	_Z8PrintMatPfii
	.type	_Z8PrintMatPfii, @function
_Z8PrintMatPfii:
.LFB2035:
	.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
	leaq	.LC24(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 64
.L49:
	cmpl	%ebp, %ebx
	jge	.L54
	xorl	%r15d, %r15d
.L51:
	cmpl	%r15d, %r13d
	jle	.L55
	movl	Size(%rip), %eax
	movq	%r14, %rsi
	movl	$2, %edi
	imull	%ebx, %eax
	cltq
	addq	%r15, %rax
	incq	%r15
	cvtss2sd	(%r12,%rax,4), %xmm0
	movb	$1, %al
	call	__printf_chk@PLT
	jmp	.L51
.L55:
	leaq	.LC25(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incl	%ebx
	call	__printf_chk@PLT
	jmp	.L49
.L54:
	popq	%rdx
	.cfi_def_cfa_offset 56
	leaq	.LC25(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 48
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2035:
	.size	_Z8PrintMatPfii, .-_Z8PrintMatPfii
	.globl	_Z7InitAryPfi
	.type	_Z7InitAryPfi, @function
_Z7InitAryPfi:
.LFB2036:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC23(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 48
.L57:
	cmpl	%ebp, %r12d
	jge	.L60
	movq	fp(%rip), %rdi
	movq	%rbx, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	incl	%r12d
	addq	$4, %rbx
	call	__isoc23_fscanf@PLT
	jmp	.L57
.L60:
	popq	%rax
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2036:
	.size	_Z7InitAryPfi, .-_Z7InitAryPfi
	.section	.rodata.str1.1
.LC26:
	.string	"r"
.LC27:
	.string	"%d"
	.text
	.globl	_Z15InitProblemOncePc
	.type	_Z15InitProblemOncePc, @function
_Z15InitProblemOncePc:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC26(%rip), %rsi
	call	fopen@PLT
	leaq	Size(%rip), %rdx
	leaq	.LC27(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, fp(%rip)
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	movl	Size(%rip), %ebx
	movl	%ebx, %edi
	imull	%ebx, %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movl	%ebx, %edx
	movl	%ebx, %esi
	movq	%rax, %rdi
	movq	%rax, a(%rip)
	call	_Z7InitMatPfii
	movslq	Size(%rip), %rdi
	movq	%rdi, %rbx
	salq	$2, %rdi
	call	malloc@PLT
	movl	%ebx, %esi
	movq	%rax, %rdi
	movq	%rax, b(%rip)
	call	_Z7InitAryPfi
	movl	Size(%rip), %edi
	imull	%edi, %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	popq	%rbx
	.cfi_def_cfa_offset 8
	movq	%rax, m(%rip)
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z15InitProblemOncePc, .-_Z15InitProblemOncePc
	.section	.rodata.str1.1
.LC28:
	.string	"%.2f "
.LC29:
	.string	"\n\n"
	.text
	.globl	_Z8PrintAryPfi
	.type	_Z8PrintAryPfi, @function
_Z8PrintAryPfi:
.LFB2037:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC28(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 48
.L64:
	cmpl	%ebx, %ebp
	jle	.L67
	movq	%r13, %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%r12,%rbx,4), %xmm0
	call	__printf_chk@PLT
	incq	%rbx
	jmp	.L64
.L67:
	popq	%rdx
	.cfi_def_cfa_offset 40
	leaq	.LC29(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2037:
	.size	_Z8PrintAryPfi, .-_Z8PrintAryPfi
	.section	.rodata.str1.1
.LC30:
	.string	"Cuda error: %s: %s.\n"
	.text
	.globl	_Z14checkCUDAErrorPKc
	.type	_Z14checkCUDAErrorPKc, @function
_Z14checkCUDAErrorPKc:
.LFB2038:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	call	cudaGetLastError@PLT
	testl	%eax, %eax
	je	.L68
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movq	%rbx, %rcx
	leaq	.LC30(%rip), %rdx
	movq	%rax, %r8
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L68:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2038:
	.size	_Z14checkCUDAErrorPKc, .-_Z14checkCUDAErrorPKc
	.globl	_Z27__device_stub__Z4Fan1PfS_iiPfS_ii
	.type	_Z27__device_stub__Z4Fan1PfS_iiPfS_ii, @function
_Z27__device_stub__Z4Fan1PfS_iiPfS_ii:
.LFB2063:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L71
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z4Fan1PfS_ii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L71:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L73
	call	__stack_chk_fail@PLT
.L73:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2063:
	.size	_Z27__device_stub__Z4Fan1PfS_iiPfS_ii, .-_Z27__device_stub__Z4Fan1PfS_iiPfS_ii
	.globl	_Z4Fan1PfS_ii
	.type	_Z4Fan1PfS_ii, @function
_Z4Fan1PfS_ii:
.LFB2064:
	.cfi_startproc
	endbr64
	jmp	_Z27__device_stub__Z4Fan1PfS_iiPfS_ii
	.cfi_endproc
.LFE2064:
	.size	_Z4Fan1PfS_ii, .-_Z4Fan1PfS_ii
	.globl	_Z30__device_stub__Z4Fan2PfS_S_iiiPfS_S_iii
	.type	_Z30__device_stub__Z4Fan2PfS_S_iiiPfS_S_iii, @function
_Z30__device_stub__Z4Fan2PfS_S_iiiPfS_S_iii:
.LFB2065:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L76
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z4Fan2PfS_S_iii(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L76:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L78
	call	__stack_chk_fail@PLT
.L78:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2065:
	.size	_Z30__device_stub__Z4Fan2PfS_S_iiiPfS_S_iii, .-_Z30__device_stub__Z4Fan2PfS_S_iiiPfS_S_iii
	.globl	_Z4Fan2PfS_S_iii
	.type	_Z4Fan2PfS_S_iii, @function
_Z4Fan2PfS_S_iii:
.LFB2066:
	.cfi_startproc
	endbr64
	jmp	_Z30__device_stub__Z4Fan2PfS_S_iiiPfS_S_iii
	.cfi_endproc
.LFE2066:
	.size	_Z4Fan2PfS_S_iii, .-_Z4Fan2PfS_S_iii
	.section	.rodata.str1.1
.LC31:
	.string	"Fan2"
	.text
	.globl	_Z10ForwardSubv
	.type	_Z10ForwardSubv, @function
_Z10ForwardSubv:
.LFB2032:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC31(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$120, %rsp
	.cfi_def_cfa_offset 144
	movl	Size(%rip), %esi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movl	Size(%rip), %esi
	leaq	8(%rsp), %rdi
	imull	%esi, %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	Size(%rip), %rsi
	leaq	16(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movl	Size(%rip), %edx
	movq	(%rsp), %rdi
	movl	$1, %ecx
	movq	m(%rip), %rsi
	imull	%edx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	Size(%rip), %edx
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	movq	a(%rip), %rsi
	imull	%edx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	movslq	Size(%rip), %rdx
	movq	b(%rip), %rsi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	Size(%rip), %ecx
	movl	$8388609, %eax
	xorl	%esi, %esi
	salq	$9, %rax
	movl	$512, %edi
	movl	$1, 32(%rsp)
	testl	$511, %ecx
	movq	%rax, 24(%rsp)
	movl	%ecx, %eax
	setne	%sil
	cltd
	movl	$1, 56(%rsp)
	idivl	%edi
	movl	$1, 68(%rsp)
	movl	$4, %edi
	addl	%eax, %esi
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movabsq	$17179869188, %rax
	movl	%esi, 36(%rsp)
	xorl	%esi, %esi
	testb	$3, %cl
	movq	%rax, 48(%rsp)
	movl	%ecx, %eax
	setne	%sil
	xorl	%ebx, %ebx
	cltd
	idivl	%edi
	leaq	72(%rsp), %rdi
	addl	%esi, %eax
	xorl	%esi, %esi
	movl	%eax, 60(%rsp)
	movl	%eax, 64(%rsp)
	call	gettimeofday@PLT
.L82:
	movl	Size(%rip), %eax
	decl	%eax
	cmpl	%ebx, %eax
	jle	.L88
	movl	32(%rsp), %ecx
	movq	24(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	36(%rsp), %rdi
	movl	44(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L83
	movl	Size(%rip), %edx
	movq	8(%rsp), %rsi
	movl	%ebx, %ecx
	movq	(%rsp), %rdi
	call	_Z27__device_stub__Z4Fan1PfS_iiPfS_ii
.L83:
	call	cudaThreadSynchronize@PLT
	movl	56(%rsp), %ecx
	movl	68(%rsp), %esi
	xorl	%r9d, %r9d
	movq	48(%rsp), %rdx
	movq	60(%rsp), %rdi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L84
	movl	Size(%rip), %ecx
	movq	16(%rsp), %rdx
	movl	%ebx, %r9d
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	%ecx, %r8d
	subl	%ebx, %r8d
	call	_Z30__device_stub__Z4Fan2PfS_S_iiiPfS_S_iii
.L84:
	call	cudaThreadSynchronize@PLT
	movq	%rbp, %rdi
	incl	%ebx
	call	_Z14checkCUDAErrorPKc
	jmp	.L82
.L88:
	xorl	%esi, %esi
	leaq	88(%rsp), %rdi
	call	gettimeofday@PLT
	movq	(%rsp), %rsi
	imull	$1000000, 72(%rsp), %edx
	movl	$2, %ecx
	imull	$1000000, 88(%rsp), %eax
	subl	80(%rsp), %eax
	addl	96(%rsp), %eax
	movq	m(%rip), %rdi
	subl	%edx, %eax
	movl	Size(%rip), %edx
	movl	%eax, totalKernelTime(%rip)
	imull	%edx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	Size(%rip), %edx
	movq	8(%rsp), %rsi
	movl	$2, %ecx
	movq	a(%rip), %rdi
	imull	%edx, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rsi
	movl	$2, %ecx
	movslq	Size(%rip), %rdx
	movq	b(%rip), %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L86
	call	__stack_chk_fail@PLT
.L86:
	addq	$120, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2032:
	.size	_Z10ForwardSubv, .-_Z10ForwardSubv
	.section	.rodata.str1.1
.LC32:
	.string	"WG size of kernel 1 = %d, WG size of kernel 2= %d X %d\n"
.LC33:
	.string	"Usage: gaussian -f filename / -s size [-q]\n\n"
.LC34:
	.string	"-q (quiet) suppresses printing the matrix and result values.\n"
.LC35:
	.string	"-f (filename) path of input file\n"
.LC36:
	.string	"-s (size) size of matrix. Create matrix and rhs in this program \n"
.LC37:
	.string	"The first line of the file contains the dimension of the matrix, n."
.LC38:
	.string	"The second line of the file is a newline.\n"
.LC39:
	.string	"The next n lines contain n tab separated values for the matrix."
.LC40:
	.string	"The next line of the file is a newline.\n"
.LC41:
	.string	"The next line of the file is a 1xn vector with tab separated values.\n"
.LC42:
	.string	"The next line of the file is a newline. (optional)\n"
.LC43:
	.string	"The final line of the file is the pre-computed solution. (optional)\n"
.LC44:
	.string	"Example: matrix4.txt:\n"
.LC45:
	.string	"4\n"
.LC46:
	.string	"-0.6\t-0.5\t0.7\t0.3\n"
.LC47:
	.string	"-0.3\t-0.9\t0.3\t0.7\n"
.LC48:
	.string	"-0.4\t-0.5\t-0.3\t-0.8\n"
.LC49:
	.string	"0.0\t-0.1\t0.2\t0.9\n"
.LC50:
	.string	"-0.85\t-0.68\t0.24\t-0.53\n"
.LC51:
	.string	"0.7\t0.0\t-0.4\t-0.5\n"
.LC52:
	.string	"Create matrix internally in parse, size = %d \n"
.LC54:
	.string	"Read file from %s \n"
.LC55:
	.string	"Matrix m is: \n"
.LC56:
	.string	"Matrix a is: \n"
.LC57:
	.string	"Array b is: \n"
.LC58:
	.string	"The final solution is: \n"
.LC60:
	.string	"\nTime total (including memory transfers)\t%f sec\n"
.LC61:
	.string	"Time for CUDA kernels:\t%f sec\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$4, %r8d
	movl	$4, %ecx
	movl	$512, %edx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edi, %r13d
	movl	$2, %edi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	leaq	.LC32(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$1, %r13d
	jg	.L103
	leaq	.LC33(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC34(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC35(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC36(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC37(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC38(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC39(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC40(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC41(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC42(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC43(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC44(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC25(%rip), %rbx
	leaq	.LC45(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC46(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC47(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	movl	$2, %edi
	leaq	.LC48(%rip), %rsi
	call	__printf_chk@PLT
	leaq	.LC49(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC50(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$2, %edi
	leaq	.LC51(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%edi, %edi
	call	exit@PLT
.L103:
	movl	$1, %eax
	movl	$1, %ebp
.L90:
	movslq	%eax, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	(%r12,%rdx,8), %rdx
	cmpb	$45, (%rdx)
	jne	.L91
	movb	1(%rdx), %dl
	leal	1(%rax), %r14d
	cmpb	$113, %dl
	je	.L104
	cmpb	$115, %dl
	je	.L92
	cmpb	$102, %dl
	jne	.L91
	leaq	8(%r12,%rcx), %rbx
	leaq	.LC54(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	movq	(%rbx), %rdx
	call	__printf_chk@PLT
	movq	(%rbx), %rdi
	call	_Z15InitProblemOncePc
	jmp	.L107
.L92:
	movq	8(%r12,%rcx), %rdi
	call	atoi@PLT
	leaq	.LC52(%rip), %rsi
	movl	$2, %edi
	movl	%eax, %edx
	movl	%eax, Size(%rip)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	Size(%rip), %r15d
	movl	%r15d, %ebx
	imull	%r15d, %ebx
	movslq	%ebx, %rbx
	salq	$2, %rbx
	movq	%rbx, %rdi
	call	malloc@PLT
	movl	%r15d, %esi
	movq	%rax, %rdi
	movq	%rax, a(%rip)
	call	_Z13create_matrixPfi
	movslq	%r15d, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movss	.LC53(%rip), %xmm0
	xorl	%edx, %edx
	movq	%rax, b(%rip)
.L94:
	cmpl	%edx, %r15d
	jle	.L108
	movss	%xmm0, (%rax,%rdx,4)
	incq	%rdx
	jmp	.L94
.L108:
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rax, m(%rip)
.L107:
	movl	%r14d, %eax
	jmp	.L91
.L104:
	xorl	%ebp, %ebp
.L91:
	incl	%eax
	cmpl	%eax, %r13d
	jg	.L90
	call	_Z10InitPerRunv
	leaq	8(%rsp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	call	_Z10ForwardSubv
	leaq	24(%rsp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	imull	$1000000, 8(%rsp), %eax
	imull	$1000000, 24(%rsp), %ebx
	subl	16(%rsp), %ebx
	addl	32(%rsp), %ebx
	subl	%eax, %ebx
	testl	%ebp, %ebp
	jne	.L96
	call	_Z7BackSubv
	jmp	.L97
.L96:
	leaq	.LC55(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	Size(%rip), %esi
	movq	m(%rip), %rdi
	movl	%esi, %edx
	call	_Z8PrintMatPfii
	leaq	.LC56(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	Size(%rip), %esi
	movq	a(%rip), %rdi
	movl	%esi, %edx
	call	_Z8PrintMatPfii
	leaq	.LC57(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	Size(%rip), %esi
	movq	b(%rip), %rdi
	call	_Z8PrintAryPfi
	call	_Z7BackSubv
	leaq	.LC58(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	Size(%rip), %esi
	movq	finalVec(%rip), %rdi
	call	_Z8PrintAryPfi
.L97:
	cvtsi2sdq	%rbx, %xmm0
	leaq	.LC60(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	mulsd	.LC59(%rip), %xmm0
	call	__printf_chk@PLT
	movl	totalKernelTime(%rip), %eax
	movl	$2, %edi
	leaq	.LC61(%rip), %rsi
	cvtsi2sdq	%rax, %xmm0
	mulsd	.LC59(%rip), %xmm0
	movb	$1, %al
	call	__printf_chk@PLT
	movq	m(%rip), %rdi
	call	free@PLT
	movq	a(%rip), %rdi
	call	free@PLT
	movq	b(%rip), %rdi
	call	free@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L102
	call	__stack_chk_fail@PLT
.L102:
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	main, .-main
	.section	.rodata.str1.1
.LC62:
	.string	"_Z4Fan2PfS_S_iii"
.LC63:
	.string	"_Z4Fan1PfS_ii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2068:
	.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	.LC62(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z4Fan2PfS_S_iii(%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	.LC63(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z4Fan1PfS_ii(%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
.LFE2068:
	.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
	.globl	totalKernelTime
	.bss
	.align 4
	.type	totalKernelTime, @object
	.size	totalKernelTime, 4
totalKernelTime:
	.zero	4
	.globl	fp
	.align 8
	.type	fp, @object
	.size	fp, 8
fp:
	.zero	8
	.globl	m
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.globl	finalVec
	.align 8
	.type	finalVec, @object
	.size	finalVec, 8
finalVec:
	.zero	8
	.globl	b
	.align 8
	.type	b, @object
	.size	b, 8
b:
	.zero	8
	.globl	a
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.globl	Size
	.align 4
	.type	Size, @object
	.size	Size, 4
Size:
	.zero	4
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	-1138501878
	.align 4
.LC1:
	.long	1092616192
	.align 4
.LC53:
	.long	1065353216
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC59:
	.long	-1598689907
	.long	1051772663
	.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:

/*-----------------------------------------------------------
 ** gaussian.cu -- The program is to solve a linear system Ax = b
 **   by using Gaussian Elimination. The algorithm on page 101
 **   ("Foundations of Parallel Programming") is used.  
 **   The sequential version is gaussian.c.  This parallel 
 **   implementation converts three independent for() loops 
 **   into three Fans.  Use the data file ge_3.dat to verify 
 **   the correction of the output. 
 **
 ** Written by Andreas Kura, 02/15/95
 ** Modified by Chong-wei Xu, 04/20/95
 ** Modified by Chris Gregg for CUDA, 07/20/2009
 **-----------------------------------------------------------
 */
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include "hip/hip_runtime.h"
#include <string.h>
#include <math.h>

#ifdef RD_WG_SIZE_0_0
        #define MAXBLOCKSIZE RD_WG_SIZE_0_0
#elif defined(RD_WG_SIZE_0)
        #define MAXBLOCKSIZE RD_WG_SIZE_0
#elif defined(RD_WG_SIZE)
        #define MAXBLOCKSIZE RD_WG_SIZE
#else
        #define MAXBLOCKSIZE 512
#endif

//2D defines. Go from specific to general                                                
#ifdef RD_WG_SIZE_1_0
        #define BLOCK_SIZE_XY RD_WG_SIZE_1_0
#elif defined(RD_WG_SIZE_1)
        #define BLOCK_SIZE_XY RD_WG_SIZE_1
#elif defined(RD_WG_SIZE)
        #define BLOCK_SIZE_XY RD_WG_SIZE
#else
        #define BLOCK_SIZE_XY 4
#endif

int Size;
float *a, *b, *finalVec;
float *m;

FILE *fp;

void InitProblemOnce(char *filename);
void InitPerRun();
void ForwardSub();
void BackSub();
__global__ void Fan1(float *m, float *a, int Size, int t);
__global__ void Fan2(float *m, float *a, float *b,int Size, int j1, int t);
void InitMat(float *ary, int nrow, int ncol);
void InitAry(float *ary, int ary_size);
void PrintMat(float *ary, int nrow, int ncolumn);
void PrintAry(float *ary, int ary_size);
void PrintDeviceProperties();
void checkCUDAError(const char *msg);

unsigned int totalKernelTime = 0;

// create both matrix and right hand side, Ke Wang 2013/08/12 11:51:06
void
create_matrix(float *m, int size){
  int i,j;
  float lamda = -0.01;
  float coe[2*size-1];
  float coe_i =0.0;

  for (i=0; i < size; i++)
    {
      coe_i = 10*exp(lamda*i); 
      j=size-1+i;     
      coe[j]=coe_i;
      j=size-1-i;     
      coe[j]=coe_i;
    }


  for (i=0; i < size; i++) {
      for (j=0; j < size; j++) {
	m[i*size+j]=coe[size-1-i+j];
      }
  }


}


int main(int argc, char *argv[])
{
  printf("WG size of kernel 1 = %d, WG size of kernel 2= %d X %d\n", MAXBLOCKSIZE, BLOCK_SIZE_XY, BLOCK_SIZE_XY);
    int verbose = 1;
    int i, j;
    char flag;
    if (argc < 2) {
        printf("Usage: gaussian -f filename / -s size [-q]\n\n");
        printf("-q (quiet) suppresses printing the matrix and result values.\n");
        printf("-f (filename) path of input file\n");
        printf("-s (size) size of matrix. Create matrix and rhs in this program \n");
        printf("The first line of the file contains the dimension of the matrix, n.");
        printf("The second line of the file is a newline.\n");
        printf("The next n lines contain n tab separated values for the matrix.");
        printf("The next line of the file is a newline.\n");
        printf("The next line of the file is a 1xn vector with tab separated values.\n");
        printf("The next line of the file is a newline. (optional)\n");
        printf("The final line of the file is the pre-computed solution. (optional)\n");
        printf("Example: matrix4.txt:\n");
        printf("4\n");
        printf("\n");
        printf("-0.6	-0.5	0.7	0.3\n");
        printf("-0.3	-0.9	0.3	0.7\n");
        printf("-0.4	-0.5	-0.3	-0.8\n");	
        printf("0.0	-0.1	0.2	0.9\n");
        printf("\n");
        printf("-0.85	-0.68	0.24	-0.53\n");	
        printf("\n");
        printf("0.7	0.0	-0.4	-0.5\n");
        exit(0);
    }
    
    //PrintDeviceProperties();
    //char filename[100];
    //sprintf(filename,"matrices/matrix%d.txt",size);

    for(i=1;i<argc;i++) {
      if (argv[i][0]=='-') {// flag
        flag = argv[i][1];
          switch (flag) {
            case 's': // platform
              i++;
              Size = atoi(argv[i]);
	      printf("Create matrix internally in parse, size = %d \n", Size);

	      a = (float *) malloc(Size * Size * sizeof(float));
	      create_matrix(a, Size);

	      b = (float *) malloc(Size * sizeof(float));
	      for (j =0; j< Size; j++)
	    	b[j]=1.0;

	      m = (float *) malloc(Size * Size * sizeof(float));
              break;
            case 'f': // platform
              i++;
	      printf("Read file from %s \n", argv[i]);
	      InitProblemOnce(argv[i]);
              break;
            case 'q': // quiet
	      verbose = 0;
              break;
	  }
      }
    }

    //InitProblemOnce(filename);
    InitPerRun();
    //begin timing
    struct timeval time_start;
    gettimeofday(&time_start, NULL);	
    
    // run kernels
    ForwardSub();
    
    //end timing
    struct timeval time_end;
    gettimeofday(&time_end, NULL);
    unsigned int time_total = (time_end.tv_sec * 1000000 + time_end.tv_usec) - (time_start.tv_sec * 1000000 + time_start.tv_usec);
    
    if (verbose) {
        printf("Matrix m is: \n");
        PrintMat(m, Size, Size);

        printf("Matrix a is: \n");
        PrintMat(a, Size, Size);

        printf("Array b is: \n");
        PrintAry(b, Size);
    }
    BackSub();
    if (verbose) {
        printf("The final solution is: \n");
        PrintAry(finalVec,Size);
    }
    printf("\nTime total (including memory transfers)\t%f sec\n", time_total * 1e-6);
    printf("Time for CUDA kernels:\t%f sec\n",totalKernelTime * 1e-6);
    
    /*printf("%d,%d\n",size,time_total);
    fprintf(stderr,"%d,%d\n",size,time_total);*/
    
    free(m);
    free(a);
    free(b);
}
/*------------------------------------------------------
 ** PrintDeviceProperties
 **-----------------------------------------------------
 */
void PrintDeviceProperties(){
	hipDeviceProp_t deviceProp;  
	int nDevCount = 0;  
	
	hipGetDeviceCount( &nDevCount );  
	printf( "Total Device found: %d", nDevCount );  
	for (int nDeviceIdx = 0; nDeviceIdx < nDevCount; ++nDeviceIdx )  
	{  
	    memset( &deviceProp, 0, sizeof(deviceProp));  
	    if( hipSuccess == hipGetDeviceProperties(&deviceProp, nDeviceIdx))  
	        {
				printf( "\nDevice Name \t\t - %s ", deviceProp.name );  
			    printf( "\n**************************************");  
			    printf( "\nTotal Global Memory\t\t\t - %lu KB", deviceProp.totalGlobalMem/1024 );  
			    printf( "\nShared memory available per block \t - %lu KB", deviceProp.sharedMemPerBlock/1024 );  
			    printf( "\nNumber of registers per thread block \t - %d", deviceProp.regsPerBlock );  
			    printf( "\nWarp size in threads \t\t\t - %d", deviceProp.warpSize );  
			    printf( "\nMemory Pitch \t\t\t\t - %zu bytes", deviceProp.memPitch );  
			    printf( "\nMaximum threads per block \t\t - %d", deviceProp.maxThreadsPerBlock );  
			    printf( "\nMaximum Thread Dimension (block) \t - %d %d %d", deviceProp.maxThreadsDim[0], deviceProp.maxThreadsDim[1], deviceProp.maxThreadsDim[2] );  
			    printf( "\nMaximum Thread Dimension (grid) \t - %d %d %d", deviceProp.maxGridSize[0], deviceProp.maxGridSize[1], deviceProp.maxGridSize[2] );  
			    printf( "\nTotal constant memory \t\t\t - %zu bytes", deviceProp.totalConstMem );  
			    printf( "\nCUDA ver \t\t\t\t - %d.%d", deviceProp.major, deviceProp.minor );  
			    printf( "\nClock rate \t\t\t\t - %d KHz", deviceProp.clockRate );  
			    printf( "\nTexture Alignment \t\t\t - %zu bytes", deviceProp.textureAlignment );  
			    printf( "\nDevice Overlap \t\t\t\t - %s", deviceProp. deviceOverlap?"Allowed":"Not Allowed" );  
			    printf( "\nNumber of Multi processors \t\t - %d\n\n", deviceProp.multiProcessorCount );  
			}  
	    else  
	        printf( "\n%s", hipGetErrorString(hipGetLastError()));  
	}  
}
 
 
/*------------------------------------------------------
 ** InitProblemOnce -- Initialize all of matrices and
 ** vectors by opening a data file specified by the user.
 **
 ** We used dynamic array *a, *b, and *m to allocate
 ** the memory storages.
 **------------------------------------------------------
 */
void InitProblemOnce(char *filename)
{
	//char *filename = argv[1];
	
	//printf("Enter the data file name: ");
	//scanf("%s", filename);
	//printf("The file name is: %s\n", filename);
	
	fp = fopen(filename, "r");
	
	fscanf(fp, "%d", &Size);	
	 
	a = (float *) malloc(Size * Size * sizeof(float));
	 
	InitMat(a, Size, Size);
	//printf("The input matrix a is:\n");
	//PrintMat(a, Size, Size);
	b = (float *) malloc(Size * sizeof(float));
	
	InitAry(b, Size);
	//printf("The input array b is:\n");
	//PrintAry(b, Size);
		
	 m = (float *) malloc(Size * Size * sizeof(float));
}

/*------------------------------------------------------
 ** InitPerRun() -- Initialize the contents of the
 ** multipier matrix **m
 **------------------------------------------------------
 */
void InitPerRun() 
{
	int i;
	for (i=0; i<Size*Size; i++)
			*(m+i) = 0.0;
}

/*-------------------------------------------------------
 ** Fan1() -- Calculate multiplier matrix
 ** Pay attention to the index.  Index i give the range
 ** which starts from 0 to range-1.  The real values of
 ** the index should be adjust and related with the value
 ** of t which is defined on the ForwardSub().
 **-------------------------------------------------------
 */
__global__ void Fan1(float *m_cuda, float *a_cuda, int Size, int t)
{   
	//if(threadIdx.x + blockIdx.x * blockDim.x >= Size-1-t) printf(".");
	//printf("blockIDx.x:%d,threadIdx.x:%d,Size:%d,t:%d,Size-1-t:%d\n",blockIdx.x,threadIdx.x,Size,t,Size-1-t);

	if(threadIdx.x + blockIdx.x * blockDim.x >= Size-1-t) return;
	*(m_cuda+Size*(blockDim.x*blockIdx.x+threadIdx.x+t+1)+t) = *(a_cuda+Size*(blockDim.x*blockIdx.x+threadIdx.x+t+1)+t) / *(a_cuda+Size*t+t);
}

/*-------------------------------------------------------
 ** Fan2() -- Modify the matrix A into LUD
 **-------------------------------------------------------
 */ 

__global__ void Fan2(float *m_cuda, float *a_cuda, float *b_cuda,int Size, int j1, int t)
{
	if(threadIdx.x + blockIdx.x * blockDim.x >= Size-1-t) return;
	if(threadIdx.y + blockIdx.y * blockDim.y >= Size-t) return;
	
	int xidx = blockIdx.x * blockDim.x + threadIdx.x;
	int yidx = blockIdx.y * blockDim.y + threadIdx.y;
	//printf("blockIdx.x:%d,threadIdx.x:%d,blockIdx.y:%d,threadIdx.y:%d,blockDim.x:%d,blockDim.y:%d\n",blockIdx.x,threadIdx.x,blockIdx.y,threadIdx.y,blockDim.x,blockDim.y);
	
	a_cuda[Size*(xidx+1+t)+(yidx+t)] -= m_cuda[Size*(xidx+1+t)+t] * a_cuda[Size*t+(yidx+t)];
	//a_cuda[xidx+1+t][yidx+t] -= m_cuda[xidx+1+t][t] * a_cuda[t][yidx+t];
	if(yidx == 0){
		//printf("blockIdx.x:%d,threadIdx.x:%d,blockIdx.y:%d,threadIdx.y:%d,blockDim.x:%d,blockDim.y:%d\n",blockIdx.x,threadIdx.x,blockIdx.y,threadIdx.y,blockDim.x,blockDim.y);
		//printf("xidx:%d,yidx:%d\n",xidx,yidx);
		b_cuda[xidx+1+t] -= m_cuda[Size*(xidx+1+t)+(yidx+t)] * b_cuda[t];
	}
}

/*------------------------------------------------------
 ** ForwardSub() -- Forward substitution of Gaussian
 ** elimination.
 **------------------------------------------------------
 */
void ForwardSub()
{
	int t;
    float *m_cuda,*a_cuda,*b_cuda;
	
	// allocate memory on GPU
	hipMalloc((void **) &m_cuda, Size * Size * sizeof(float));
	 
	hipMalloc((void **) &a_cuda, Size * Size * sizeof(float));
	
	hipMalloc((void **) &b_cuda, Size * sizeof(float));	

	// copy memory to GPU
	hipMemcpy(m_cuda, m, Size * Size * sizeof(float),hipMemcpyHostToDevice );
	hipMemcpy(a_cuda, a, Size * Size * sizeof(float),hipMemcpyHostToDevice );
	hipMemcpy(b_cuda, b, Size * sizeof(float),hipMemcpyHostToDevice );
	
	int block_size,grid_size;
	
	block_size = MAXBLOCKSIZE;
	grid_size = (Size/block_size) + (!(Size%block_size)? 0:1);
	//printf("1d grid size: %d\n",grid_size);


	dim3 dimBlock(block_size);
	dim3 dimGrid(grid_size);
	//dim3 dimGrid( (N/dimBlock.x) + (!(N%dimBlock.x)?0:1) );
	
	int blockSize2d, gridSize2d;
	blockSize2d = BLOCK_SIZE_XY;
	gridSize2d = (Size/blockSize2d) + (!(Size%blockSize2d?0:1)); 
	
	dim3 dimBlockXY(blockSize2d,blockSize2d);
	dim3 dimGridXY(gridSize2d,gridSize2d);

    // begin timing kernels
    struct timeval time_start;
    gettimeofday(&time_start, NULL);
	for (t=0; t<(Size-1); t++) {
		Fan1<<<dimGrid,dimBlock>>>(m_cuda,a_cuda,Size,t);
		hipDeviceSynchronize();
		Fan2<<<dimGridXY,dimBlockXY>>>(m_cuda,a_cuda,b_cuda,Size,Size-t,t);
		hipDeviceSynchronize();
		checkCUDAError("Fan2");
	}
	// end timing kernels
	struct timeval time_end;
    gettimeofday(&time_end, NULL);
    totalKernelTime = (time_end.tv_sec * 1000000 + time_end.tv_usec) - (time_start.tv_sec * 1000000 + time_start.tv_usec);
	
	// copy memory back to CPU
	hipMemcpy(m, m_cuda, Size * Size * sizeof(float),hipMemcpyDeviceToHost );
	hipMemcpy(a, a_cuda, Size * Size * sizeof(float),hipMemcpyDeviceToHost );
	hipMemcpy(b, b_cuda, Size * sizeof(float),hipMemcpyDeviceToHost );
	hipFree(m_cuda);
	hipFree(a_cuda);
	hipFree(b_cuda);
}

/*------------------------------------------------------
 ** BackSub() -- Backward substitution
 **------------------------------------------------------
 */

void BackSub()
{
	// create a new vector to hold the final answer
	finalVec = (float *) malloc(Size * sizeof(float));
	// solve "bottom up"
	int i,j;
	for(i=0;i<Size;i++){
		finalVec[Size-i-1]=b[Size-i-1];
		for(j=0;j<i;j++)
		{
			finalVec[Size-i-1]-=*(a+Size*(Size-i-1)+(Size-j-1)) * finalVec[Size-j-1];
		}
		finalVec[Size-i-1]=finalVec[Size-i-1]/ *(a+Size*(Size-i-1)+(Size-i-1));
	}
}

void InitMat(float *ary, int nrow, int ncol)
{
	int i, j;
	
	for (i=0; i<nrow; i++) {
		for (j=0; j<ncol; j++) {
			fscanf(fp, "%f",  ary+Size*i+j);
		}
	}  
}

/*------------------------------------------------------
 ** PrintMat() -- Print the contents of the matrix
 **------------------------------------------------------
 */
void PrintMat(float *ary, int nrow, int ncol)
{
	int i, j;
	
	for (i=0; i<nrow; i++) {
		for (j=0; j<ncol; j++) {
			printf("%8.2f ", *(ary+Size*i+j));
		}
		printf("\n");
	}
	printf("\n");
}

/*------------------------------------------------------
 ** InitAry() -- Initialize the array (vector) by reading
 ** data from the data file
 **------------------------------------------------------
 */
void InitAry(float *ary, int ary_size)
{
	int i;
	
	for (i=0; i<ary_size; i++) {
		fscanf(fp, "%f",  &ary[i]);
	}
}  

/*------------------------------------------------------
 ** PrintAry() -- Print the contents of the array (vector)
 **------------------------------------------------------
 */
void PrintAry(float *ary, int ary_size)
{
	int i;
	for (i=0; i<ary_size; i++) {
		printf("%.2f ", ary[i]);
	}
	printf("\n\n");
}
void checkCUDAError(const char *msg)
{
    hipError_t err = hipGetLastError();
    if( hipSuccess != err) 
    {
        fprintf(stderr, "Cuda error: %s: %s.\n", msg, 
                                  hipGetErrorString( err) );
        exit(EXIT_FAILURE);
    }                         
}


	.text
	.file	"gaussian.hip"
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z13create_matrixPfi
.LCPI0_0:
	.long	0xbc23d70a                      # float -0.00999999977
.LCPI0_1:
	.long	0x41200000                      # float 10
	.text
	.globl	_Z13create_matrixPfi
	.type	_Z13create_matrixPfi,@function
_Z13create_matrixPfi:                   # @_Z13create_matrixPfi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        # kill: def $esi killed $esi def $rsi
	leal	-1(,%rsi,2), %eax
	leaq	15(,%rax,4), %rax
	andq	$-16, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
	movq	%rcx, %rsp
	testl	%esi, %esi
	jle	.LBB0_6
# %bb.1:                                # %.lr.ph
	movq	%rdi, -56(%rbp)                 # 8-byte Spill
	leal	-1(%rsi), %eax
	movq	%rsi, -64(%rbp)                 # 8-byte Spill
	movl	%esi, %r13d
	movq	%rcx, -48(%rbp)                 # 8-byte Spill
	leaq	(%rcx,%rax,4), %rbx
	xorl	%r14d, %r14d
	movq	%rbx, %r15
.LBB0_2:                                # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r14d, %xmm0
	mulss	.LCPI0_0(%rip), %xmm0
	callq	expf
	mulss	.LCPI0_1(%rip), %xmm0
	movss	%xmm0, (%r15)
	movss	%xmm0, (%rbx)
	incq	%r14
	addq	$4, %r15
	addq	$-4, %rbx
	cmpq	%r14, %r13
	jne	.LBB0_2
# %bb.3:                                # %.preheader30
	movq	-64(%rbp), %r14                 # 8-byte Reload
	testl	%r14d, %r14d
	movq	-56(%rbp), %r12                 # 8-byte Reload
	movq	-48(%rbp), %rcx                 # 8-byte Reload
	jle	.LBB0_6
# %bb.4:                                # %.preheader.lr.ph
	leaq	(,%r13,4), %r15
	xorl	%ebx, %ebx
.LBB0_5:                                # %._crit_edge
                                        # =>This Inner Loop Header: Depth=1
	decq	%r13
	movslq	%r13d, %rax
	leaq	(%rcx,%rax,4), %rsi
	movl	%ebx, %eax
	leaq	(%r12,%rax,4), %rdi
	movq	%r15, %rdx
	callq	memcpy@PLT
	movq	-48(%rbp), %rcx                 # 8-byte Reload
	addl	%r14d, %ebx
	testq	%r13, %r13
	jne	.LBB0_5
.LBB0_6:                                # %._crit_edge35
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.Lfunc_end0:
	.size	_Z13create_matrixPfi, .Lfunc_end0-_Z13create_matrixPfi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI1_0:
	.quad	0x3eb0c6f7a0b5ed8d              # double 9.9999999999999995E-7
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	.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	%rsi, %rbx
	movl	%edi, %ebp
	movl	$.L.str, %edi
	movl	$512, %esi                      # imm = 0x200
	movl	$4, %edx
	movl	$4, %ecx
	xorl	%eax, %eax
	callq	printf
	cmpl	$2, %ebp
	jl	.LBB1_19
# %bb.1:                                # %.preheader.preheader
	movl	$1, %r15d
	movl	$1, %r12d
.LBB1_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_8 Depth 2
	movslq	%r12d, %r14
	movq	(%rbx,%r14,8), %rax
	cmpb	$45, (%rax)
	jne	.LBB1_12
# %bb.3:                                #   in Loop: Header=BB1_2 Depth=1
	movzbl	1(%rax), %eax
	cmpl	$102, %eax
	je	.LBB1_10
# %bb.4:                                #   in Loop: Header=BB1_2 Depth=1
	cmpl	$113, %eax
	je	.LBB1_11
# %bb.5:                                #   in Loop: Header=BB1_2 Depth=1
	cmpl	$115, %eax
	jne	.LBB1_12
# %bb.6:                                #   in Loop: Header=BB1_2 Depth=1
	movq	8(%rbx,%r14,8), %rdi
	callq	atoi
	movl	%eax, Size(%rip)
	movl	$.L.str.21, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	printf
	movl	Size(%rip), %r14d
	movl	%r14d, %edi
	imull	%edi, %edi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, a(%rip)
	movq	%rax, %rdi
	movl	%r14d, %esi
	callq	_Z13create_matrixPfi
	movslq	Size(%rip), %r14
	leaq	(,%r14,4), %rdi
	callq	malloc
	movl	%r14d, %edi
	movq	%rax, b(%rip)
	testq	%r14, %r14
	jle	.LBB1_9
# %bb.7:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB1_2 Depth=1
	xorl	%ecx, %ecx
.LBB1_8:                                # %.lr.ph
                                        #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$1065353216, (%rax,%rcx,4)      # imm = 0x3F800000
	incq	%rcx
	cmpq	%rcx, %rdi
	jne	.LBB1_8
.LBB1_9:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	incl	%r12d
	imull	%edi, %edi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, m(%rip)
	jmp	.LBB1_12
.LBB1_11:                               #   in Loop: Header=BB1_2 Depth=1
	xorl	%r15d, %r15d
	jmp	.LBB1_12
.LBB1_10:                               #   in Loop: Header=BB1_2 Depth=1
	leal	1(%r14), %r12d
	movq	8(%rbx,%r14,8), %rsi
	movl	$.L.str.22, %edi
	xorl	%eax, %eax
	callq	printf
	movq	8(%rbx,%r14,8), %rdi
	callq	_Z15InitProblemOncePc
.LBB1_12:                               #   in Loop: Header=BB1_2 Depth=1
	incl	%r12d
	cmpl	%ebp, %r12d
	jl	.LBB1_2
# %bb.13:
	movl	Size(%rip), %edx
	testl	%edx, %edx
	je	.LBB1_15
# %bb.14:                               # %.lr.ph.i
	imull	%edx, %edx
	movq	m(%rip), %rdi
	cmpl	$1, %edx
	adcl	$0, %edx
	shlq	$2, %rdx
	xorl	%esi, %esi
	callq	memset@PLT
.LBB1_15:                               # %_Z10InitPerRunv.exit
	leaq	24(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	callq	_Z10ForwardSubv
	leaq	8(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r14), %r12
	movq	8(%r14), %r14
	movq	(%rbx), %r13
	movq	8(%rbx), %rbx
	testl	%r15d, %r15d
	je	.LBB1_17
# %bb.16:
	movl	$.Lstr, %edi
	callq	puts@PLT
	movq	m(%rip), %rdi
	movl	Size(%rip), %edx
	movl	%edx, %esi
	callq	_Z8PrintMatPfii
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movq	a(%rip), %rdi
	movl	Size(%rip), %edx
	movl	%edx, %esi
	callq	_Z8PrintMatPfii
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movq	b(%rip), %rdi
	movl	Size(%rip), %esi
	callq	_Z8PrintAryPfi
	callq	_Z7BackSubv
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movq	finalVec(%rip), %rdi
	movl	Size(%rip), %esi
	callq	_Z8PrintAryPfi
	jmp	.LBB1_18
.LBB1_17:                               # %.critedge
	callq	_Z7BackSubv
.LBB1_18:
	subl	%r13d, %r12d
	imull	$1000000, %r12d, %eax           # imm = 0xF4240
	subl	%ebx, %r14d
	addl	%eax, %r14d
	cvtsi2sd	%r14, %xmm0
	mulsd	.LCPI1_0(%rip), %xmm0
	movl	$.L.str.27, %edi
	movb	$1, %al
	callq	printf
	movl	totalKernelTime(%rip), %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	mulsd	.LCPI1_0(%rip), %xmm0
	movl	$.L.str.28, %edi
	movb	$1, %al
	callq	printf
	movq	m(%rip), %rdi
	callq	free
	movq	a(%rip), %rdi
	callq	free
	movq	b(%rip), %rdi
	callq	free
	xorl	%eax, %eax
	addq	$40, %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
.LBB1_19:
	.cfi_def_cfa_offset 96
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	movl	$.Lstr.5, %edi
	callq	puts@PLT
	movl	$.Lstr.6, %edi
	callq	puts@PLT
	movl	$.Lstr.7, %edi
	callq	puts@PLT
	movl	$.L.str.5, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.Lstr.8, %edi
	callq	puts@PLT
	movl	$.L.str.7, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.Lstr.9, %edi
	callq	puts@PLT
	movl	$.Lstr.10, %edi
	callq	puts@PLT
	movl	$.Lstr.11, %edi
	callq	puts@PLT
	movl	$.Lstr.12, %edi
	callq	puts@PLT
	movl	$.Lstr.13, %edi
	callq	puts@PLT
	movl	$.Lstr.14, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.15, %edi
	callq	puts@PLT
	movl	$.Lstr.16, %edi
	callq	puts@PLT
	movl	$.Lstr.17, %edi
	callq	puts@PLT
	movl	$.Lstr.18, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.19, %edi
	callq	puts@PLT
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.20, %edi
	callq	puts@PLT
	xorl	%edi, %edi
	callq	exit
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
                                        # -- End function
	.globl	_Z15InitProblemOncePc           # -- Begin function _Z15InitProblemOncePc
	.type	_Z15InitProblemOncePc,@function
_Z15InitProblemOncePc:                  # @_Z15InitProblemOncePc
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	$.L.str.49, %esi
	callq	fopen
	movq	%rax, fp(%rip)
	movl	$.L.str.50, %esi
	movl	$Size, %edx
	movq	%rax, %rdi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movl	Size(%rip), %ebx
	movl	%ebx, %edi
	imull	%edi, %edi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, a(%rip)
	movq	%rax, %rdi
	movl	%ebx, %esi
	movl	%ebx, %edx
	callq	_Z7InitMatPfii
	movslq	Size(%rip), %r14
	leaq	(,%r14,4), %rdi
	callq	malloc
	movq	%rax, b(%rip)
	testq	%r14, %r14
	jle	.LBB2_4
# %bb.1:                                # %.lr.ph.preheader.i
	movq	%rax, %rbx
	movl	%r14d, %r14d
.LBB2_2:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movq	fp(%rip), %rdi
	movl	$.L.str.52, %esi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	addq	$4, %rbx
	decq	%r14
	jne	.LBB2_2
# %bb.3:                                # %_Z7InitAryPfi.exit.loopexit
	movl	Size(%rip), %r14d
.LBB2_4:                                # %_Z7InitAryPfi.exit
	imull	%r14d, %r14d
	shlq	$2, %r14
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, m(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z15InitProblemOncePc, .Lfunc_end2-_Z15InitProblemOncePc
	.cfi_endproc
                                        # -- End function
	.globl	_Z10InitPerRunv                 # -- Begin function _Z10InitPerRunv
	.type	_Z10InitPerRunv,@function
_Z10InitPerRunv:                        # @_Z10InitPerRunv
	.cfi_startproc
# %bb.0:
	movl	Size(%rip), %edx
	testl	%edx, %edx
	je	.LBB3_1
# %bb.2:                                # %.lr.ph
	imull	%edx, %edx
	movq	m(%rip), %rdi
	cmpl	$1, %edx
	adcl	$0, %edx
	shlq	$2, %rdx
	xorl	%esi, %esi
	jmp	memset@PLT                      # TAILCALL
.LBB3_1:                                # %._crit_edge
	retq
.Lfunc_end3:
	.size	_Z10InitPerRunv, .Lfunc_end3-_Z10InitPerRunv
	.cfi_endproc
                                        # -- End function
	.globl	_Z10ForwardSubv                 # -- Begin function _Z10ForwardSubv
	.type	_Z10ForwardSubv,@function
_Z10ForwardSubv:                        # @_Z10ForwardSubv
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	.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	Size(%rip), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	leaq	8(%rsp), %r14
	movq	%r14, %rdi
	callq	hipMalloc
	movl	Size(%rip), %esi
	imull	%esi, %esi
	shlq	$2, %rsi
	movq	%rsp, %r15
	movq	%r15, %rdi
	callq	hipMalloc
	movslq	Size(%rip), %rsi
	shlq	$2, %rsi
	leaq	16(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipMalloc
	movq	(%r14), %rdi
	movq	m(%rip), %rsi
	movl	Size(%rip), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r15), %rdi
	movq	a(%rip), %rsi
	movl	Size(%rip), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rbx), %rdi
	movq	b(%rip), %rsi
	movslq	Size(%rip), %rdx
	shlq	$2, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	Size(%rip), %eax
	movl	$511, %ecx                      # imm = 0x1FF
	leal	(%rax,%rcx), %ebx
	leal	3(%rax), %r12d
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	cmovnsl	%eax, %r12d
	sarl	$9, %ebx
	andl	%eax, %ecx
	cmpl	$1, %ecx
	sbbl	$-1, %ebx
	sarl	$2, %r12d
	andl	$3, %eax
	cmpl	$1, %eax
	sbbl	$-1, %r12d
	xorl	%r13d, %r13d
	leaq	24(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	cmpl	$2, Size(%rip)
	jl	.LBB4_7
# %bb.1:                                # %.lr.ph.preheader
	movabsq	$4294967296, %r14               # imm = 0x100000000
	btsq	$32, %rbx
	leaq	1(%r14), %r15
	imulq	%r12, %r15
	addq	$512, %r14                      # imm = 0x200
	movabsq	$17179869188, %r12              # imm = 0x400000004
	xorl	%ebp, %ebp
.LBB4_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_4
# %bb.3:                                #   in Loop: Header=BB4_2 Depth=1
	movq	8(%rsp), %rdi
	movq	(%rsp), %rsi
	movl	Size(%rip), %edx
	movl	%ebp, %ecx
	callq	_Z19__device_stub__Fan1PfS_ii
.LBB4_4:                                #   in Loop: Header=BB4_2 Depth=1
	callq	hipDeviceSynchronize
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_6
# %bb.5:                                #   in Loop: Header=BB4_2 Depth=1
	movq	8(%rsp), %rdi
	movq	(%rsp), %rsi
	movq	16(%rsp), %rdx
	movl	Size(%rip), %ecx
	leal	(%rcx,%r13), %r8d
                                        # kill: def $ecx killed $ecx killed $rcx
	movl	%ebp, %r9d
	callq	_Z19__device_stub__Fan2PfS_S_iii
.LBB4_6:                                #   in Loop: Header=BB4_2 Depth=1
	callq	hipDeviceSynchronize
	movl	$.L.str.51, %edi
	callq	_Z14checkCUDAErrorPKc
	incl	%ebp
	movl	Size(%rip), %eax
	decl	%eax
	decl	%r13d
	cmpl	%eax, %ebp
	jl	.LBB4_2
.LBB4_7:                                # %._crit_edge
	leaq	40(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	(%rbx), %eax
	movl	8(%rbx), %ecx
	subl	24(%rsp), %eax
	subl	32(%rsp), %ecx
	imull	$1000000, %eax, %eax            # imm = 0xF4240
	addl	%eax, %ecx
	movl	%ecx, totalKernelTime(%rip)
	movq	m(%rip), %rdi
	movq	8(%rsp), %rsi
	movl	Size(%rip), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	a(%rip), %rdi
	movq	(%rsp), %rsi
	movl	Size(%rip), %edx
	imull	%edx, %edx
	shlq	$2, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	b(%rip), %rdi
	movq	16(%rsp), %rsi
	movslq	Size(%rip), %rdx
	shlq	$2, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	addq	$56, %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_end4:
	.size	_Z10ForwardSubv, .Lfunc_end4-_Z10ForwardSubv
	.cfi_endproc
                                        # -- End function
	.globl	_Z8PrintMatPfii                 # -- Begin function _Z8PrintMatPfii
	.type	_Z8PrintMatPfii,@function
_Z8PrintMatPfii:                        # @_Z8PrintMatPfii
	.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	%rdi, 16(%rsp)                  # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB5_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %ebp
	movl	%edx, %eax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	xorl	%r12d, %r12d
.LBB5_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB5_5
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB5_2 Depth=1
	movslq	%r12d, %r13
	movq	8(%rsp), %r15                   # 8-byte Reload
	movq	16(%rsp), %r14                  # 8-byte Reload
.LBB5_4:                                # %.lr.ph
                                        #   Parent Loop BB5_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movslq	Size(%rip), %rax
	imulq	%r13, %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%rax,4), %xmm0
	movl	$.L.str.53, %edi
	movb	$1, %al
	callq	printf
	addq	$4, %r14
	decq	%r15
	jne	.LBB5_4
.LBB5_5:                                # %._crit_edge
                                        #   in Loop: Header=BB5_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incl	%r12d
	cmpl	%ebp, %r12d
	jne	.LBB5_2
.LBB5_6:                                # %._crit_edge12
	movl	$10, %edi
	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
	jmp	putchar@PLT                     # TAILCALL
.Lfunc_end5:
	.size	_Z8PrintMatPfii, .Lfunc_end5-_Z8PrintMatPfii
	.cfi_endproc
                                        # -- End function
	.globl	_Z8PrintAryPfi                  # -- Begin function _Z8PrintAryPfi
	.type	_Z8PrintAryPfi,@function
_Z8PrintAryPfi:                         # @_Z8PrintAryPfi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB6_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.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 %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	xorl	%r15d, %r15d
.LBB6_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx,%r15,4), %xmm0
	movl	$.L.str.54, %edi
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB6_2
# %bb.3:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB6_4:                                # %._crit_edge
	movl	$.Lstr.21, %edi
	jmp	puts@PLT                        # TAILCALL
.Lfunc_end6:
	.size	_Z8PrintAryPfi, .Lfunc_end6-_Z8PrintAryPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z7BackSubv                     # -- Begin function _Z7BackSubv
	.type	_Z7BackSubv,@function
_Z7BackSubv:                            # @_Z7BackSubv
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.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 %r15, -16
	movslq	Size(%rip), %r14
	leaq	(,%r14,4), %rbx
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, finalVec(%rip)
	testq	%r14, %r14
	jle	.LBB7_6
# %bb.1:                                # %.lr.ph20
	movq	b(%rip), %rcx
	movq	a(%rip), %rdx
	movl	%r14d, %esi
	movq	%r14, %rdi
	imulq	%r14, %rdi
	leaq	(%rdx,%rdi,4), %rdi
	addq	$-4, %rdi
	negq	%rbx
	leaq	(%rax,%r14,4), %r8
	addq	$-4, %r8
	xorl	%r9d, %r9d
.LBB7_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_4 Depth 2
	movq	%r9, %r10
	notq	%r10
	addq	%r14, %r10
	movss	(%rcx,%r10,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rax,%r10,4)
	testq	%r9, %r9
	je	.LBB7_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB7_2 Depth=1
	xorl	%r11d, %r11d
.LBB7_4:                                #   Parent Loop BB7_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rdi,%r11,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	mulss	(%r8,%r11,4), %xmm1
	subss	%xmm1, %xmm0
	movss	%xmm0, (%rax,%r10,4)
	decq	%r11
	movq	%r9, %r15
	addq	%r11, %r15
	jne	.LBB7_4
.LBB7_5:                                # %._crit_edge
                                        #   in Loop: Header=BB7_2 Depth=1
	movq	%r10, %r11
	imulq	%r14, %r11
	leaq	(%rdx,%r11,4), %r11
	divss	(%r11,%r10,4), %xmm0
	movss	%xmm0, (%rax,%r10,4)
	incq	%r9
	addq	%rbx, %rdi
	cmpq	%rsi, %r9
	jne	.LBB7_2
.LBB7_6:                                # %._crit_edge21
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z7BackSubv, .Lfunc_end7-_Z7BackSubv
	.cfi_endproc
                                        # -- End function
	.globl	_Z21PrintDevicePropertiesv      # -- Begin function _Z21PrintDevicePropertiesv
	.type	_Z21PrintDevicePropertiesv,@function
_Z21PrintDevicePropertiesv:             # @_Z21PrintDevicePropertiesv
	.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
	subq	$1488, %rsp                     # imm = 0x5D0
	.cfi_def_cfa_offset 1520
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	leaq	12(%rsp), %rbx
	movl	$0, (%rbx)
	movq	%rbx, %rdi
	callq	hipGetDeviceCount
	movl	(%rbx), %esi
	movl	$.L.str.29, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, (%rbx)
	jle	.LBB8_6
# %bb.1:                                # %.lr.ph
	leaq	16(%rsp), %rbx
	movl	$.L.str.46, %r14d
	xorl	%ebp, %ebp
.LBB8_2:                                # =>This Inner Loop Header: Depth=1
	movl	$1472, %edx                     # imm = 0x5C0
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movq	%rbx, %rdi
	movl	%ebp, %esi
	callq	hipGetDevicePropertiesR0600
	testl	%eax, %eax
	je	.LBB8_3
# %bb.4:                                #   in Loop: Header=BB8_2 Depth=1
	callq	hipGetLastError
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.48, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB8_5
.LBB8_3:                                #   in Loop: Header=BB8_2 Depth=1
	movl	$.L.str.30, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.31, %edi
	xorl	%eax, %eax
	callq	printf
	movq	304(%rsp), %rsi
	shrq	$10, %rsi
	movl	$.L.str.32, %edi
	xorl	%eax, %eax
	callq	printf
	movq	312(%rsp), %rsi
	shrq	$10, %rsi
	movl	$.L.str.33, %edi
	xorl	%eax, %eax
	callq	printf
	movl	320(%rsp), %esi
	movl	$.L.str.34, %edi
	xorl	%eax, %eax
	callq	printf
	movl	324(%rsp), %esi
	movl	$.L.str.35, %edi
	xorl	%eax, %eax
	callq	printf
	movq	328(%rsp), %rsi
	movl	$.L.str.36, %edi
	xorl	%eax, %eax
	callq	printf
	movl	336(%rsp), %esi
	movl	$.L.str.37, %edi
	xorl	%eax, %eax
	callq	printf
	movl	340(%rsp), %esi
	movl	344(%rsp), %edx
	movl	348(%rsp), %ecx
	movl	$.L.str.38, %edi
	xorl	%eax, %eax
	callq	printf
	movl	352(%rsp), %esi
	movl	356(%rsp), %edx
	movl	360(%rsp), %ecx
	movl	$.L.str.39, %edi
	xorl	%eax, %eax
	callq	printf
	movq	368(%rsp), %rsi
	movl	$.L.str.40, %edi
	xorl	%eax, %eax
	callq	printf
	movl	376(%rsp), %esi
	movl	380(%rsp), %edx
	movl	$.L.str.41, %edi
	xorl	%eax, %eax
	callq	printf
	movl	364(%rsp), %esi
	movl	$.L.str.42, %edi
	xorl	%eax, %eax
	callq	printf
	movq	384(%rsp), %rsi
	movl	$.L.str.43, %edi
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 400(%rsp)
	movl	$.L.str.45, %esi
	cmoveq	%r14, %rsi
	movl	$.L.str.44, %edi
	xorl	%eax, %eax
	callq	printf
	movl	404(%rsp), %esi
	movl	$.L.str.47, %edi
	xorl	%eax, %eax
	callq	printf
.LBB8_5:                                #   in Loop: Header=BB8_2 Depth=1
	incl	%ebp
	cmpl	12(%rsp), %ebp
	jl	.LBB8_2
.LBB8_6:                                # %._crit_edge
	addq	$1488, %rsp                     # imm = 0x5D0
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_Z21PrintDevicePropertiesv, .Lfunc_end8-_Z21PrintDevicePropertiesv
	.cfi_endproc
                                        # -- End function
	.globl	_Z7InitMatPfii                  # -- Begin function _Z7InitMatPfii
	.type	_Z7InitMatPfii,@function
_Z7InitMatPfii:                         # @_Z7InitMatPfii
	.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	%rdi, 16(%rsp)                  # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB9_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %ebp
	movl	%edx, %eax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	xorl	%r12d, %r12d
.LBB9_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB9_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB9_5
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB9_2 Depth=1
	movslq	%r12d, %r13
	movq	8(%rsp), %r15                   # 8-byte Reload
	movq	16(%rsp), %r14                  # 8-byte Reload
.LBB9_4:                                # %.lr.ph
                                        #   Parent Loop BB9_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	fp(%rip), %rdi
	movslq	Size(%rip), %rax
	imulq	%r13, %rax
	leaq	(%r14,%rax,4), %rdx
	movl	$.L.str.52, %esi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	addq	$4, %r14
	decq	%r15
	jne	.LBB9_4
.LBB9_5:                                # %._crit_edge
                                        #   in Loop: Header=BB9_2 Depth=1
	incl	%r12d
	cmpl	%ebp, %r12d
	jne	.LBB9_2
.LBB9_6:                                # %._crit_edge11
	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	_Z7InitMatPfii, .Lfunc_end9-_Z7InitMatPfii
	.cfi_endproc
                                        # -- End function
	.globl	_Z7InitAryPfi                   # -- Begin function _Z7InitAryPfi
	.type	_Z7InitAryPfi,@function
_Z7InitAryPfi:                          # @_Z7InitAryPfi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB10_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
.LBB10_2:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	fp(%rip), %rdi
	movl	$.L.str.52, %esi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	addq	$4, %rbx
	decq	%r14
	jne	.LBB10_2
# %bb.3:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
.LBB10_4:                               # %._crit_edge
	retq
.Lfunc_end10:
	.size	_Z7InitAryPfi, .Lfunc_end10-_Z7InitAryPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z19__device_stub__Fan1PfS_ii   # -- Begin function _Z19__device_stub__Fan1PfS_ii
	.type	_Z19__device_stub__Fan1PfS_ii,@function
_Z19__device_stub__Fan1PfS_ii:          # @_Z19__device_stub__Fan1PfS_ii
	.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), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z4Fan1PfS_ii, %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	_Z19__device_stub__Fan1PfS_ii, .Lfunc_end11-_Z19__device_stub__Fan1PfS_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z19__device_stub__Fan2PfS_S_iii # -- Begin function _Z19__device_stub__Fan2PfS_S_iii
	.type	_Z19__device_stub__Fan2PfS_S_iii,@function
_Z19__device_stub__Fan2PfS_S_iii:       # @_Z19__device_stub__Fan2PfS_S_iii
	.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	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%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	$_Z4Fan2PfS_S_iii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	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_end12:
	.size	_Z19__device_stub__Fan2PfS_S_iii, .Lfunc_end12-_Z19__device_stub__Fan2PfS_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z14checkCUDAErrorPKc           # -- Begin function _Z14checkCUDAErrorPKc
	.type	_Z14checkCUDAErrorPKc,@function
_Z14checkCUDAErrorPKc:                  # @_Z14checkCUDAErrorPKc
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %rbx
	callq	hipGetLastError
	testl	%eax, %eax
	jne	.LBB13_2
# %bb.1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB13_2:
	.cfi_def_cfa_offset 32
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.56, %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	fprintf
	movl	$1, %edi
	callq	exit
.Lfunc_end13:
	.size	_Z14checkCUDAErrorPKc, .Lfunc_end13-_Z14checkCUDAErrorPKc
	.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	.LBB14_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB14_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z4Fan1PfS_ii, %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	$_Z4Fan2PfS_S_iii, %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_end14:
	.size	__hip_module_ctor, .Lfunc_end14-__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	.LBB15_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
.LBB15_2:
	retq
.Lfunc_end15:
	.size	__hip_module_dtor, .Lfunc_end15-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	Size,@object                    # @Size
	.bss
	.globl	Size
	.p2align	2, 0x0
Size:
	.long	0                               # 0x0
	.size	Size, 4

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

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

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

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

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

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"WG size of kernel 1 = %d, WG size of kernel 2= %d X %d\n"
	.size	.L.str, 56

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"The first line of the file contains the dimension of the matrix, n."
	.size	.L.str.5, 68

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"The next n lines contain n tab separated values for the matrix."
	.size	.L.str.7, 64

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"Create matrix internally in parse, size = %d \n"
	.size	.L.str.21, 47

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"Read file from %s \n"
	.size	.L.str.22, 20

	.type	.L.str.27,@object               # @.str.27
.L.str.27:
	.asciz	"\nTime total (including memory transfers)\t%f sec\n"
	.size	.L.str.27, 49

	.type	.L.str.28,@object               # @.str.28
.L.str.28:
	.asciz	"Time for CUDA kernels:\t%f sec\n"
	.size	.L.str.28, 31

	.type	.L.str.29,@object               # @.str.29
.L.str.29:
	.asciz	"Total Device found: %d"
	.size	.L.str.29, 23

	.type	.L.str.30,@object               # @.str.30
.L.str.30:
	.asciz	"\nDevice Name \t\t - %s "
	.size	.L.str.30, 22

	.type	.L.str.31,@object               # @.str.31
.L.str.31:
	.asciz	"\n**************************************"
	.size	.L.str.31, 40

	.type	.L.str.32,@object               # @.str.32
.L.str.32:
	.asciz	"\nTotal Global Memory\t\t\t - %lu KB"
	.size	.L.str.32, 33

	.type	.L.str.33,@object               # @.str.33
.L.str.33:
	.asciz	"\nShared memory available per block \t - %lu KB"
	.size	.L.str.33, 46

	.type	.L.str.34,@object               # @.str.34
.L.str.34:
	.asciz	"\nNumber of registers per thread block \t - %d"
	.size	.L.str.34, 45

	.type	.L.str.35,@object               # @.str.35
.L.str.35:
	.asciz	"\nWarp size in threads \t\t\t - %d"
	.size	.L.str.35, 31

	.type	.L.str.36,@object               # @.str.36
.L.str.36:
	.asciz	"\nMemory Pitch \t\t\t\t - %zu bytes"
	.size	.L.str.36, 31

	.type	.L.str.37,@object               # @.str.37
.L.str.37:
	.asciz	"\nMaximum threads per block \t\t - %d"
	.size	.L.str.37, 35

	.type	.L.str.38,@object               # @.str.38
.L.str.38:
	.asciz	"\nMaximum Thread Dimension (block) \t - %d %d %d"
	.size	.L.str.38, 47

	.type	.L.str.39,@object               # @.str.39
.L.str.39:
	.asciz	"\nMaximum Thread Dimension (grid) \t - %d %d %d"
	.size	.L.str.39, 46

	.type	.L.str.40,@object               # @.str.40
.L.str.40:
	.asciz	"\nTotal constant memory \t\t\t - %zu bytes"
	.size	.L.str.40, 39

	.type	.L.str.41,@object               # @.str.41
.L.str.41:
	.asciz	"\nCUDA ver \t\t\t\t - %d.%d"
	.size	.L.str.41, 23

	.type	.L.str.42,@object               # @.str.42
.L.str.42:
	.asciz	"\nClock rate \t\t\t\t - %d KHz"
	.size	.L.str.42, 26

	.type	.L.str.43,@object               # @.str.43
.L.str.43:
	.asciz	"\nTexture Alignment \t\t\t - %zu bytes"
	.size	.L.str.43, 35

	.type	.L.str.44,@object               # @.str.44
.L.str.44:
	.asciz	"\nDevice Overlap \t\t\t\t - %s"
	.size	.L.str.44, 26

	.type	.L.str.45,@object               # @.str.45
.L.str.45:
	.asciz	"Allowed"
	.size	.L.str.45, 8

	.type	.L.str.46,@object               # @.str.46
.L.str.46:
	.asciz	"Not Allowed"
	.size	.L.str.46, 12

	.type	.L.str.47,@object               # @.str.47
.L.str.47:
	.asciz	"\nNumber of Multi processors \t\t - %d\n\n"
	.size	.L.str.47, 38

	.type	.L.str.48,@object               # @.str.48
.L.str.48:
	.asciz	"\n%s"
	.size	.L.str.48, 4

	.type	.L.str.49,@object               # @.str.49
.L.str.49:
	.asciz	"r"
	.size	.L.str.49, 2

	.type	.L.str.50,@object               # @.str.50
.L.str.50:
	.asciz	"%d"
	.size	.L.str.50, 3

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

	.type	_Z4Fan2PfS_S_iii,@object        # @_Z4Fan2PfS_S_iii
	.globl	_Z4Fan2PfS_S_iii
	.p2align	3, 0x0
_Z4Fan2PfS_S_iii:
	.quad	_Z19__device_stub__Fan2PfS_S_iii
	.size	_Z4Fan2PfS_S_iii, 8

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

	.type	.L.str.52,@object               # @.str.52
.L.str.52:
	.asciz	"%f"
	.size	.L.str.52, 3

	.type	.L.str.53,@object               # @.str.53
.L.str.53:
	.asciz	"%8.2f "
	.size	.L.str.53, 7

	.type	.L.str.54,@object               # @.str.54
.L.str.54:
	.asciz	"%.2f "
	.size	.L.str.54, 6

	.type	.L.str.56,@object               # @.str.56
.L.str.56:
	.asciz	"Cuda error: %s: %s.\n"
	.size	.L.str.56, 21

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z4Fan1PfS_ii"
	.size	.L__unnamed_1, 14

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z4Fan2PfS_S_iii"
	.size	.L__unnamed_2, 17

	.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	"Matrix m is: "
	.size	.Lstr, 14

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Matrix a is: "
	.size	.Lstr.1, 14

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"Array b is: "
	.size	.Lstr.2, 13

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"The final solution is: "
	.size	.Lstr.3, 24

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"Usage: gaussian -f filename / -s size [-q]\n"
	.size	.Lstr.4, 44

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"-q (quiet) suppresses printing the matrix and result values."
	.size	.Lstr.5, 61

	.type	.Lstr.6,@object                 # @str.6
.Lstr.6:
	.asciz	"-f (filename) path of input file"
	.size	.Lstr.6, 33

	.type	.Lstr.7,@object                 # @str.7
.Lstr.7:
	.asciz	"-s (size) size of matrix. Create matrix and rhs in this program "
	.size	.Lstr.7, 65

	.type	.Lstr.8,@object                 # @str.8
.Lstr.8:
	.asciz	"The second line of the file is a newline."
	.size	.Lstr.8, 42

	.type	.Lstr.9,@object                 # @str.9
.Lstr.9:
	.asciz	"The next line of the file is a newline."
	.size	.Lstr.9, 40

	.type	.Lstr.10,@object                # @str.10
.Lstr.10:
	.asciz	"The next line of the file is a 1xn vector with tab separated values."
	.size	.Lstr.10, 69

	.type	.Lstr.11,@object                # @str.11
.Lstr.11:
	.asciz	"The next line of the file is a newline. (optional)"
	.size	.Lstr.11, 51

	.type	.Lstr.12,@object                # @str.12
.Lstr.12:
	.asciz	"The final line of the file is the pre-computed solution. (optional)"
	.size	.Lstr.12, 68

	.type	.Lstr.13,@object                # @str.13
.Lstr.13:
	.asciz	"Example: matrix4.txt:"
	.size	.Lstr.13, 22

	.type	.Lstr.14,@object                # @str.14
.Lstr.14:
	.asciz	"4"
	.size	.Lstr.14, 2

	.type	.Lstr.15,@object                # @str.15
.Lstr.15:
	.asciz	"-0.6\t-0.5\t0.7\t0.3"
	.size	.Lstr.15, 18

	.type	.Lstr.16,@object                # @str.16
.Lstr.16:
	.asciz	"-0.3\t-0.9\t0.3\t0.7"
	.size	.Lstr.16, 18

	.type	.Lstr.17,@object                # @str.17
.Lstr.17:
	.asciz	"-0.4\t-0.5\t-0.3\t-0.8"
	.size	.Lstr.17, 20

	.type	.Lstr.18,@object                # @str.18
.Lstr.18:
	.asciz	"0.0\t-0.1\t0.2\t0.9"
	.size	.Lstr.18, 17

	.type	.Lstr.19,@object                # @str.19
.Lstr.19:
	.asciz	"-0.85\t-0.68\t0.24\t-0.53"
	.size	.Lstr.19, 23

	.type	.Lstr.20,@object                # @str.20
.Lstr.20:
	.asciz	"0.7\t0.0\t-0.4\t-0.5"
	.size	.Lstr.20, 18

	.type	.Lstr.21,@object                # @str.21
.Lstr.21:
	.asciz	"\n"
	.size	.Lstr.21, 2

	.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 _Z19__device_stub__Fan1PfS_ii
	.addrsig_sym _Z19__device_stub__Fan2PfS_S_iii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym Size
	.addrsig_sym _Z4Fan1PfS_ii
	.addrsig_sym _Z4Fan2PfS_S_iii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z4Fan1PfS_ii           ; -- Begin function _Z4Fan1PfS_ii
	.globl	_Z4Fan1PfS_ii
	.p2align	8
	.type	_Z4Fan1PfS_ii,@function
_Z4Fan1PfS_ii:                          ; @_Z4Fan1PfS_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x24
	s_load_b64 s[2:3], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	s_not_b32 s4, s3
	s_add_i32 s4, s4, s2
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u32_e32 vcc_lo, s4, v1
	s_and_saveexec_b32 s4, vcc_lo
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_add3_u32 v0, s3, 1, v1
	v_mov_b32_e32 v1, 0
	s_ashr_i32 s1, s3, 31
	s_mov_b32 s0, s3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v0, v0, s2
	s_lshl_b64 s[0:1], s[0:1], 2
	s_mul_i32 s2, s3, s2
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	s_waitcnt lgkmcnt(0)
	s_add_u32 s8, s0, s6
	s_addc_u32 s9, s1, s7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s8, v0
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v1, vcc_lo
	s_ashr_i32 s3, s2, 31
	s_delay_alu instid0(SALU_CYCLE_1)
	s_lshl_b64 s[2:3], s[2:3], 2
	global_load_b32 v2, v[2:3], off
	s_add_u32 s2, s6, s2
	s_addc_u32 s3, s7, s3
	s_add_u32 s2, s2, s0
	s_addc_u32 s3, s3, s1
	s_add_u32 s0, s0, s4
	s_load_b32 s2, s[2:3], 0x0
	s_addc_u32 s1, s1, s5
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_div_scale_f32 v3, null, s2, s2, v2
	v_div_scale_f32 v6, vcc_lo, v2, s2, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v4, v3
	s_waitcnt_depctr 0xfff
	v_fma_f32 v5, -v3, v4, 1.0
	v_fmac_f32_e32 v4, v5, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v5, v6, v4
	v_fma_f32 v7, -v3, v5, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v5, v7, v4
	v_fma_f32 v3, -v3, v5, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_div_fmas_f32 v3, v3, v4, v5
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	v_div_fixup_f32 v2, v3, s2, v2
	global_store_b32 v[0:1], v2, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z4Fan1PfS_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.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	_Z4Fan1PfS_ii, .Lfunc_end0-_Z4Fan1PfS_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 332
; 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: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z4Fan2PfS_S_iii        ; -- Begin function _Z4Fan2PfS_S_iii
	.globl	_Z4Fan2PfS_S_iii
	.p2align	8
	.type	_Z4Fan2PfS_S_iii,@function
_Z4Fan2PfS_S_iii:                       ; @_Z4Fan2PfS_S_iii
; %bb.0:
	s_clause 0x2
	s_load_b32 s6, s[0:1], 0x34
	s_load_b32 s2, s[0:1], 0x20
	s_load_b32 s3, s[0:1], 0x18
	v_and_b32_e32 v1, 0x3ff, v0
	s_add_u32 s4, s0, 40
	s_addc_u32 s5, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s6, s6, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[3:4], null, s14, s6, v[1:2]
	s_not_b32 s6, s2
	s_add_i32 s6, s6, s3
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u32_e32 vcc_lo, s6, v3
	s_and_saveexec_b32 s6, vcc_lo
	s_cbranch_execz .LBB1_4
; %bb.1:
	s_load_b32 s4, s[4:5], 0xc
	v_bfe_u32 v0, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s4, s4, 16
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	s_sub_i32 s4, s3, s2
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u32_e32 vcc_lo, s4, v1
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_4
; %bb.2:
	v_add3_u32 v0, s2, 1, v3
	v_add_nc_u32_e32 v2, s2, v1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_lo_u32 v6, v0, s3
	v_mad_u64_u32 v[3:4], null, s2, s3, v[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v5, s2, v6
	v_ashrrev_i32_e32 v4, 31, v3
	v_add_nc_u32_e32 v7, v2, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_ashrrev_i32_e32 v6, 31, v5
	v_lshlrev_b64 v[9:10], 2, v[3:4]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_ashrrev_i32_e32 v8, 31, v7
	v_lshlrev_b64 v[4:5], 2, v[5:6]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_lshlrev_b64 v[2:3], 2, v[7:8]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v6, vcc_lo, s6, v9
	v_add_co_ci_u32_e32 v7, vcc_lo, s7, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_u32 v4, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v5, vcc_lo
	v_add_co_u32 v8, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v9, vcc_lo, s7, v3, vcc_lo
	global_load_b32 v4, v[4:5], off
	s_clause 0x1
	global_load_b32 v5, v[6:7], off
	global_load_b32 v6, v[8:9], off
	v_cmp_eq_u32_e32 vcc_lo, 0, v1
	s_waitcnt vmcnt(0)
	v_fma_f32 v4, -v4, v5, v6
	global_store_b32 v[8:9], v4, off
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_4
; %bb.3:
	s_load_b64 s[0:1], s[0:1], 0x10
	v_ashrrev_i32_e32 v1, 31, v0
	v_add_co_u32 v2, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	s_ashr_i32 s3, s2, 31
	v_mov_b32_e32 v4, 0
	s_lshl_b64 s[2:3], s[2:3], 2
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_add_u32 s0, s0, s2
	s_addc_u32 s1, s1, s3
	global_load_b32 v2, v[2:3], off
	s_clause 0x1
	global_load_b32 v3, v4, s[0:1]
	global_load_b32 v4, v[0:1], off
	s_waitcnt vmcnt(0)
	v_fma_f32 v2, -v2, v3, v4
	global_store_b32 v[0:1], v2, off
.LBB1_4:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z4Fan2PfS_S_iii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.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 11
		.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	_Z4Fan2PfS_S_iii, .Lfunc_end1-_Z4Fan2PfS_S_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 484
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; 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
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     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
    .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:           _Z4Fan1PfS_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z4Fan1PfS_ii.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:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z4Fan2PfS_S_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z4Fan2PfS_S_iii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
