#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <float.h>
#include <math.h>
#include <assert.h>
#include <time.h>
#include <sys/time.h>

inline cudaError_t _checkError(cudaError_t result)
{
  if (result != cudaSuccess) {
    fprintf(stderr, "CUDA Runtime Error: %s\n", 
            cudaGetErrorString(result));
    assert(result == cudaSuccess);
  }
  return result;
}

void read_matrix(int **r_ptr, int** c_ind,float** v, char*fname,int* r_count,int* v_count){	
	
	//*************************************************************
        //READ AND CONVERT COO MATRIX TO CSR MATRIX
        //*************************************************************

	FILE * file;
    	if ((file = fopen(fname, "r+")) == NULL)
	{
	    printf("ERROR: file open failed\n");
	    return;
	}
	
	int column_count,row_count,values_count;
	fscanf(file, "%d %d %d\n",&row_count,&column_count,&values_count);
	*r_count = row_count;
	*v_count = values_count;
	int i;
	int *row_ptr =(int*) malloc((row_count+1) * sizeof(int));
	int *col_ind =(int*) malloc(values_count * sizeof(int));
	for(i=0; i<values_count; i++){
		col_ind[i] = -1;
	}
	float *values =(float*) malloc(values_count * sizeof(float));
	int row,column;
	float value;

	//*************************************************************
        //GENERATING THE ROW VECTOR FOR CSR
       	//*************************************************************

	while (1) {
		int ret = fscanf(file, "%d %d %f\n",&row,&column,&value);
		column --;
		row --;
		if(ret == 3){
			row_ptr[row]++;
		} else if(ret == EOF) {
		   	break;
		} else {
		    	printf("No match.\n");
		}
	}
    	rewind(file);
	//printf("The row count: %d\n",row_count);
    	int index = 0;
    	int val = 0;
	for(i = 0; i<row_count;i++){
		val = row_ptr[i];
		//printf("The value is : %d\n",val);
		row_ptr[i] = index;
		index += val;
		//printf("row_ptr[%d] = %d\n",i, row_ptr[i]);
	}
	row_ptr[row_count] = values_count;
	fscanf(file, "%d %d %d\n",&row_count,&column_count,&values_count);
	i = 0;
	while (1) {
		int ret = fscanf(file, "%d %d %f\n",&row,&column,&value);
		column --;
		row --;
		if(ret == 3){
			while(col_ind[i+row_ptr[row]] != -1){ i++;}
			col_ind[i+row_ptr[row]] = column;
			values[i+row_ptr[row]] = value;
			i=0;
		} else if(ret == EOF) {
		   	break;
		} else {
		    	printf("No match.\n");
		}
	}
    	fclose(file);
    	*r_ptr = row_ptr;
    	*c_ind = col_ind;
    	*v = values;
}

void cpu_multiply(const int num_rows,const int *ptr, const int *indices, const float *data, const float *x, float* y){
	float dot;
	int row_start, row_end;
	for (int i=0; i<num_rows; i++){
		dot = 0;
                /*printf("CPU Matrix\n");
                for(int l = 0; l<num_rows;l++){
                        if(l+1 <= num_rows){
                                for(int k = ptr[l]; k < ptr[l+1];k++){
                                        printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                                }
                        }
                }*/
                row_start = ptr[i];
                row_end = ptr[i + 1];
                //printf("row_start: %d\t row end: %d\n",row_start, row_end);
                for(int j = row_start; j < row_end; j++){
                        //printf("data[%d] = %10f * indices[%d] = %d x[indices[%d]]= %10f\n", i, data[i], i, indices[i]+1, i,  x[indices[i]]);
                        dot+= data[j] * x[indices[j]];
                }
		y[i] += dot;
	}
}

__global__ void vector_multiply_unopti(const int num_rows,const int *ptr,const int *indices,const float *data,const float *x, float* y){
	int row = blockIdx.x * blockDim.x + threadIdx.x;
	/*printf("Kernel Matrix\n");
        for(int i = 0; i<num_rows;i++){
        	if(i+1 <= num_rows){
        		for(int k = ptr[i]; k < ptr[i+1];k++){
                		printf("%d %d %.10f\n",i+1,indices[k]+1,data[k]);
                	}
        	}	
        }*/
	//printf("In Kernel:\n",row);
	int i;
	int row_start, row_end;
	float dot;
	if(row < num_rows){
		//printf("row=%d\n",row);
		dot = 0;
		/*printf("Kernel Matrix\n");
        	for(int l = 0; l<num_rows;l++){
                	if(l+1 <= num_rows){
                        	for(int k = ptr[l]; k < ptr[l+1];k++){
                                	printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                        	}
                	}
        	}*/
		row_start = ptr[row];
		row_end = ptr[row + 1];
		//printf("row_start: %d\t row end: %d\n",row_start, row_end);
		for(i = row_start; i < row_end; i++){
			//printf("data[%d] = %10f * indices[%d] = %d x[indices[%d]]= %10f\n", i, data[i], i, indices[i]+1, i,  x[indices[i]]);
			dot+= data[i] * x[indices[i]];
		}
	}
	y[row] += dot;
}

__global__ void vector_multiply_unroll(const int num_rows,const int *ptr,const int *indices,const float *data,const float *x, float* y){
        int row;// = blockIdx.x * blockDim.x + threadIdx.x;
        //printf("In Kernel:\n",row);
        int i;
        int row_start, row_end;
        float dot;
	#pragma unroll
        for (row = blockIdx.x * blockDim.x + threadIdx.x; row < num_rows; row += blockDim.x * gridDim.x)
        {
                dot = 0;
                /*printf("Kernel Matrix\n");
                for(int l = 0; l<num_rows;l++){
                        if(l+1 <= num_rows){
                                for(int k = ptr[l]; k < ptr[l+1];k++){
                                        printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                                }
                        }
                }*/
                row_start = ptr[row];
                row_end = ptr[row + 1];
                #pragma unroll
                for(i = row_start; i < row_end; i++){
                        dot+= data[i] * x[indices[i]];
                }
        }

}

//TODO: Fix this implementation
__global__ void vector_multiply_shared(const int num_rows,const int *ptr,const int *indices,const float *data,const float *x, float* y){
        __shared__ float s[256];
	int row = blockIdx.x * blockDim.x + threadIdx.x;
	//printf("In Kernel:\n",row);

	s[row]=0.0;
	/*for(int l=0; l<num_rows; l++){
		s[l] = 0.0;
	}*/
        //printf("No error:\n",row);
        int i;
        int row_start, row_end;
        //float dot;
        if(row < num_rows){
                //dot = 0;
		s[row] = 0.0;
                /*printf("Kernel Matrix\n");
                for(int l = 0; l<num_rows;l++){
                        if(l+1 <= num_rows){
                                for(int k = ptr[l]; k < ptr[l+1];k++){
                                        printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                                }
                        }
                }*/
                row_start = ptr[row];
                row_end = ptr[row + 1];
                #pragma unroll
                for(i = row_start; i < row_end; i++){
                        s[row]+= data[i] * x[indices[i]];
                }
        }
        //s[row] += dot;
	__syncthreads();
	y[row] = s[row];
}

__global__ void vector_multiply_stride(const int num_rows,const int *ptr,const int *indices,const float *data,const float *x, float* y){
        int row;// = blockIdx.x * blockDim.x + threadIdx.x;
        //printf("In Kernel:\n",row);
        int i;
        int row_start, row_end;
        float dot;
	for (row = blockIdx.x * blockDim.x + threadIdx.x; row < num_rows; row += blockDim.x * gridDim.x) 
      	{
        	dot = 0;
                /*printf("Kernel Matrix\n");
                for(int l = 0; l<num_rows;l++){
                        if(l+1 <= num_rows){
                                for(int k = ptr[l]; k < ptr[l+1];k++){
                                        printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                                }
                        }
                }*/
                row_start = ptr[row];
                row_end = ptr[row + 1];
                for(i = row_start; i < row_end; i++){
                        dot+= data[i] * x[indices[i]];
                }
      	}
        y[row] += dot;
}

//TODO: Fix the prefetch method

__global__ void vector_multiply_stride_prefetch(const int num_rows,const int *ptr,const int *indices,const float *data,const float *x, float* y){
        int row;// = blockIdx.x * blockDim.x + threadIdx.x;
        //printf("In Kernel:\n",row);
        int i;
        int row_start, row_end;
        float dot;
	#pragma unroll
        for (row = blockIdx.x * blockDim.x + threadIdx.x; row < num_rows; row += blockDim.x * gridDim.x)
        {
                dot = 0;
		//__prefetch_global_l1(row_start);
                /*printf("Kernel Matrix\n");
                for(int l = 0; l<num_rows;l++){
                        if(l+1 <= num_rows){
                                for(int k = ptr[l]; k < ptr[l+1];k++){
                                        printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                                }
                        }
                }*/
                row_start = ptr[row];
                row_end = ptr[row + 1];
                #pragma unroll
                for(i = row_start; i < row_end; i++){
                        dot+= data[i] * x[indices[i]];
                }
        }
        y[row] += dot;
}

int main (int argc, char* argv[]){

	//*************************************************************
	//Argument List: vector_to_multiply, repetitions_for_the code, 
	//		 verbose, filename_matrixi, 
	//		 optimizations_to_apply
	//*************************************************************

	//*************************************************************
	//HOST CODE
	//*************************************************************
	
	if ( argc != 6){
		printf( "Incorrect usage");
	}
	else{
		int* row_ptr;
		int* col_ind;
		float* values;
		int r_count, v_count, i, k, j;
		int num = atoi(argv[1]);
		int repetitions = atoi(argv[2]);
		int mode = atoi(argv[3]);
		char* fname = argv[4];
		int opti = atoi(argv[5]);
	
		//*************************************************************
		//READING THE GIVEN COORDINATE FORM MATRIX AND CONVERTING IT TO 
		//COMPRESSED SPARSE ROW MATRIX
		//*************************************************************
	
		read_matrix(&row_ptr, &col_ind, &values, fname, &r_count, &v_count);
		float* x =(float*) malloc(r_count* sizeof(float));
		float* y =(float*) calloc(r_count, sizeof(float));
		float* cy =(float*) calloc(r_count, sizeof(float));
		for(i = 0; i<r_count;i++){
		    	x[i]= (float)num;
		}

		if(mode == 1){

			//*************************************************************
			//PRINT OUT THE GIVEN COORDINATE MATRIX STORED IN THE FORM OF
			//CSR MATRIX
			//*************************************************************

			fprintf(stdout,"PERFORMING SPMV ON MATRIX: \n");
			for(i = 0; i<r_count;i++){
		    		if(i+1 <= r_count){
		    			for(k = row_ptr[i]; k < row_ptr[i+1];k++){
		    				fprintf(stdout,"%d %d %.10f\n",i+1,col_ind[k]+1,values[k]);
		    			}
		    		}	
		    	}

	  	}
		//TODO: Timer for CPU run
		//*************************************************************
                //RUNNING ON CPU
                //*************************************************************
		/*struct timeval cstart, cend;
    		long mtime, secs, usecs;*/ 
		float cdot;	
		//gettimeofday(&cstart, NULL);
		for(k = 0; k<repetitions; k++){
			//cpu_multiply(r_count, row_ptr, col_ind, values, x, y);
        		for (i=0; i<r_count; i++){
                		cdot = 0;
                		for(j = row_ptr[i]; j < row_ptr[i+1]; j++){
                        		cdot+= values[j] * x[col_ind[j]];
                		}
                	cy[i] += cdot;
        		}
		}
		/*gettimeofday(&cend, NULL);
		secs  = cend.tv_sec  - cstart.tv_sec;
    		usecs = cend.tv_usec - cstart.tv_usec;
    		mtime = ((secs) * 1000 + usecs/1000.0) + 0.5;
    		printf("Elapsed time: %ld millisecs\n", mtime);*/

		//*************************************************************
                //COMPLETED RUNNING ON CPU
                //*************************************************************

		//*************************************************************
		//SETTING UP GPU RUN
		//*************************************************************

		int *d_row_ptr, *d_col_ind;
		float *d_values, *d_x, *d_y;

		cudaEvent_t start,stop,st,sp;
                cudaEventCreate(&start);
                cudaEventCreate(&stop);
		cudaEventCreate(&st);
                cudaEventCreate(&sp);
		float milliseconds = 0;
		//float timing = 0;
		//int bytes = r_count * sizeof(float);

		switch(opti){
			case 1:

				//*************************************************************
                		//RUNNING KERNEL WITH NO OPTIMIZATIONS MONOLITHIC
                		//*************************************************************

				cudaMalloc(&d_row_ptr, r_count*sizeof(int));
                		cudaMalloc(&d_col_ind, v_count*sizeof(int));
                		cudaMalloc(&d_values, v_count*sizeof(int));
                		cudaMalloc(&d_x, r_count*sizeof(float));
                		cudaMalloc(&d_y, r_count*sizeof(float));

				cudaMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), cudaMemcpyHostToDevice);
                		cudaMemcpy(d_col_ind, col_ind, v_count*sizeof(int), cudaMemcpyHostToDevice);
                		cudaMemcpy(d_values, values, v_count*sizeof(int), cudaMemcpyHostToDevice);

				cudaEventRecord(start);
               	 		for(k = 0; k<repetitions; k++){
                        		//printf("Calling Kernel\n");
                        		cudaMemcpy(d_x, x, r_count*sizeof(float), cudaMemcpyHostToDevice);
                        		cudaMemcpy(d_y, y, r_count*sizeof(float), cudaMemcpyHostToDevice);

                        
                        		float blocksize = 64;
                        		float blocknum = ceil(r_count/blocksize); 
                        		//printf("blocknum: %f\n",blocknum);
                        		//blocknum = 1.0;
                        		//printf("blocknum: %f\n",blocknum);
                        		vector_multiply_unopti<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                        		cudaMemcpy(y, d_y, r_count*sizeof(float), cudaMemcpyDeviceToHost);
                        		for(i = 0; i<r_count;i++){
                                		x[i] = y[i];
                                		y[i]= 0.0;
                        		}
                		}

                		cudaEventRecord(stop);
                		cudaEventSynchronize(stop);

                		milliseconds = 0;
                		cudaEventElapsedTime(&milliseconds, start, stop);

				break;
			case 2:

                                //*************************************************************
                                //RUNNING KERNEL WITH NO OPTIMIZATIONS STRIDE
                                //*************************************************************

                                cudaMalloc(&d_row_ptr, r_count*sizeof(int));
                                cudaMalloc(&d_col_ind, v_count*sizeof(int));
                                cudaMalloc(&d_values, v_count*sizeof(int));
                                cudaMalloc(&d_x, r_count*sizeof(float));
                                cudaMalloc(&d_y, r_count*sizeof(float));

                                cudaMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_col_ind, col_ind, v_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_values, values, v_count*sizeof(int), cudaMemcpyHostToDevice);

                                cudaEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
                                        cudaMemcpy(d_x, x, r_count*sizeof(float), cudaMemcpyHostToDevice);
                                        cudaMemcpy(d_y, y, r_count*sizeof(float), cudaMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_stride<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                                        cudaMemcpy(y, d_y, r_count*sizeof(float), cudaMemcpyDeviceToHost);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                cudaEventRecord(stop);
                                cudaEventSynchronize(stop);

                                milliseconds = 0;
                                cudaEventElapsedTime(&milliseconds, start, stop);

                                break;
			case 3:
				//*************************************************************
                                //RUNNING KERNEL WITH LOOP UNROLLING
                                //*************************************************************

                                cudaMalloc(&d_row_ptr, r_count*sizeof(int));
                                cudaMalloc(&d_col_ind, v_count*sizeof(int));
                                cudaMalloc(&d_values, v_count*sizeof(int));
                                cudaMalloc(&d_x, r_count*sizeof(float));
                                cudaMalloc(&d_y, r_count*sizeof(float));

                                cudaMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_col_ind, col_ind, v_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_values, values, v_count*sizeof(int), cudaMemcpyHostToDevice);

                                cudaEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
                                        cudaMemcpy(d_x, x, r_count*sizeof(float), cudaMemcpyHostToDevice);
                                        cudaMemcpy(d_y, y, r_count*sizeof(float), cudaMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_unroll<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                                        cudaMemcpy(y, d_y, r_count*sizeof(float), cudaMemcpyDeviceToHost);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                cudaEventRecord(stop);
                                cudaEventSynchronize(stop);

                                milliseconds = 0;
                                cudaEventElapsedTime(&milliseconds, start, stop);
				break;
			case 4:
				//*************************************************************
                                //RUNNING KERNEL WITH DATA TRANSFER OPTIMIZATIONS
                                //*************************************************************
				
				//int bytes = r_count * sizeof(float);

                          	cudaMallocHost(&d_row_ptr, r_count*sizeof(int));
                		cudaMallocHost(&d_col_ind, v_count*sizeof(int));
                		cudaMallocHost(&d_values, v_count*sizeof(int));
                		cudaMallocHost(&d_x, r_count*sizeof(float));
                		cudaMallocHost(&d_y, r_count*sizeof(float));   
                            
                                cudaMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), cudaMemcpyHostToDevice);

                                cudaMemcpy(d_col_ind, col_ind, v_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_values, values, v_count*sizeof(int), cudaMemcpyHostToDevice);

                                cudaEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
					//cudaEventRecord(st);
                                        cudaMemcpy(d_x, x, r_count*sizeof(float), cudaMemcpyHostToDevice);
					//cudaEventRecord(sp);
					//cudaEventSynchronize(sp);
					//cudaEventElapsedTime(&timing, st, sp);
					
					//printf("Host to Device bandwidth (GB/s): %f\n", bytes * 1e-6 / timing);

                                        cudaMemcpy(d_y, y, r_count*sizeof(float), cudaMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_unopti<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
					//cudaEventRecord(st);
                                        cudaMemcpy(y, d_y, r_count*sizeof(float), cudaMemcpyDeviceToHost);
					//cudaEventRecord(sp);
					//cudaEventSynchronize(sp);
					//cudaEventElapsedTime(&timing, st, sp);

                                        //printf("Device to Host bandwidth (GB/s): %f\n", bytes * 1e-6 / timing);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                cudaEventRecord(stop);
                                cudaEventSynchronize(stop);

                                milliseconds = 0;
                                cudaEventElapsedTime(&milliseconds, start, stop);
				
				cudaEventDestroy(st);
                		cudaEventDestroy(sp);

				break;
			case 5:
				//*************************************************************
                                //RUNNING KERNEL WITH DATA TRANSFER OPTIMIZATIONS AND 
				//LOOP UNROLLING
                                //*************************************************************

                                cudaMallocHost(&d_row_ptr, r_count*sizeof(int));
                                cudaMallocHost(&d_col_ind, v_count*sizeof(int));
                                cudaMallocHost(&d_values, v_count*sizeof(int));
                                cudaMallocHost(&d_x, r_count*sizeof(float));
                                cudaMallocHost(&d_y, r_count*sizeof(float));

                                cudaMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_col_ind, col_ind, v_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_values, values, v_count*sizeof(int), cudaMemcpyHostToDevice);

                                cudaEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
                                        cudaMemcpy(d_x, x, r_count*sizeof(float), cudaMemcpyHostToDevice);
                                        cudaMemcpy(d_y, y, r_count*sizeof(float), cudaMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_unroll<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                                        cudaMemcpy(y, d_y, r_count*sizeof(float), cudaMemcpyDeviceToHost);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                cudaEventRecord(stop);
                                cudaEventSynchronize(stop);

                                milliseconds = 0;
                                cudaEventElapsedTime(&milliseconds, start, stop);

				break;
			case 6:
                                //*************************************************************
                                //RUNNING KERNEL WITH DATA TRANSFER OPTIMIZATIONS,
                                //LOOP UNROLLING AND USING SHARED MEMORY
                                //*************************************************************

                                cudaMallocHost(&d_row_ptr, r_count*sizeof(int));
                                cudaMallocHost(&d_col_ind, v_count*sizeof(int));
                                cudaMallocHost(&d_values, v_count*sizeof(int));
                                cudaMallocHost(&d_x, r_count*sizeof(float));
                                cudaMallocHost(&d_y, r_count*sizeof(float));

                                cudaMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_col_ind, col_ind, v_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_values, values, v_count*sizeof(int), cudaMemcpyHostToDevice);

                                cudaEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
                                        cudaMemcpy(d_x, x, r_count*sizeof(float), cudaMemcpyHostToDevice);
                                        cudaMemcpy(d_y, y, r_count*sizeof(float), cudaMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_shared<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                                        cudaMemcpy(y, d_y, r_count*sizeof(float), cudaMemcpyDeviceToHost);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                cudaEventRecord(stop);
                                cudaEventSynchronize(stop);

                                milliseconds = 0;
                                cudaEventElapsedTime(&milliseconds, start, stop);

                                break;
			default:
				//*************************************************************
                                //RUNNING KERNEL WITH NO OPTIMIZATIONS IN DEFAULT CASE
                                //*************************************************************

                                cudaMalloc(&d_row_ptr, r_count*sizeof(int));
                                cudaMalloc(&d_col_ind, v_count*sizeof(int));
                                cudaMalloc(&d_values, v_count*sizeof(int));
                                cudaMalloc(&d_x, r_count*sizeof(float));
                                cudaMalloc(&d_y, r_count*sizeof(float));

                                cudaMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_col_ind, col_ind, v_count*sizeof(int), cudaMemcpyHostToDevice);
                                cudaMemcpy(d_values, values, v_count*sizeof(int), cudaMemcpyHostToDevice);

                                cudaEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
                                        cudaMemcpy(d_x, x, r_count*sizeof(float), cudaMemcpyHostToDevice);
                                        cudaMemcpy(d_y, y, r_count*sizeof(float), cudaMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_unopti<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                                        cudaMemcpy(y, d_y, r_count*sizeof(float), cudaMemcpyDeviceToHost);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                cudaEventRecord(stop);
                                cudaEventSynchronize(stop);

                                milliseconds = 0;
                                cudaEventElapsedTime(&milliseconds, start, stop);
				
		}

		/*cudaMalloc(&d_row_ptr, r_count*sizeof(int));
		cudaMalloc(&d_col_ind, v_count*sizeof(int));
		cudaMalloc(&d_values, v_count*sizeof(int));
		cudaMalloc(&d_x, r_count*sizeof(float));
		cudaMalloc(&d_y, r_count*sizeof(float));*/
		
		/*cudaMallocHost(&d_row_ptr, r_count*sizeof(int));
                cudaMallocHost(&d_col_ind, v_count*sizeof(int));
                cudaMallocHost(&d_values, v_count*sizeof(int));
                cudaMallocHost(&d_x, r_count*sizeof(float));
                cudaMallocHost(&d_y, r_count*sizeof(float));

		cudaMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), cudaMemcpyHostToDevice);
		cudaMemcpy(d_col_ind, col_ind, v_count*sizeof(int), cudaMemcpyHostToDevice);
		cudaMemcpy(d_values, values, v_count*sizeof(int), cudaMemcpyHostToDevice);
		cudaEvent_t start,stop;
		cudaEventCreate(&start);
		cudaEventCreate(&stop);	  	
	  	
		cudaEventRecord(start);
	  	for(k = 0; k<repetitions; k++){
			printf("Calling Kernel\n");
			cudaMemcpy(d_x, x, r_count*sizeof(float), cudaMemcpyHostToDevice);
			cudaMemcpy(d_y, y, r_count*sizeof(float), cudaMemcpyHostToDevice);
		
			// kernel call
			float blocksize = 64;
			float blocknum = ceil(r_count/blocksize); //number of threads fixed and equal to row count
			//printf("blocknum: %f\n",blocknum);
			//blocknum = 1.0;
			//printf("blocknum: %f\n",blocknum);
			//vector_multiply_unopti<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
			vector_multiply_unroll<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
			cudaMemcpy(y, d_y, r_count*sizeof(float), cudaMemcpyDeviceToHost);
			for(i = 0; i<r_count;i++){
				x[i] = y[i];
			    	y[i]= 0.0;
			}
		}
		cudaEventRecord(stop);
		cudaEventSynchronize(stop);
		float milliseconds = 0;
		cudaEventElapsedTime(&milliseconds, start, stop);*/

		//*************************************************************
                //GPU RUN COMPLETED
                //*************************************************************

		//*************************************************************
                //PRINTING RESULTANT MATRIX.
		//ONLY NON ZERO ELEMENTS ARE DISPLAYED.
                //*************************************************************

		int count = 0;
		if(mode == 1){
			
			fprintf(stdout,"Calculated Vector Matrix\n");
		    	for(i = 0; i<r_count;i++){
		    		if(x[i] != 0){
		    		fprintf(stdout,"%.10f\n",x[i]);
		    		count++;
		    		}
		    	}
		    	fprintf(stdout,"count = %d\n", count);

		}
		fprintf(stdout,"time = %f\n", milliseconds);
		//fprintf(stdout,"CPU time = %f\n",cpu_time_used);
		
		//*************************************************************
                //FREE MEMORY
                //*************************************************************
		cudaFree(d_row_ptr);
		cudaFree(d_col_ind);
		cudaFree(d_values);
		cudaFree(d_x);
		cudaFree(d_y);
		cudaEventDestroy(start);
        	cudaEventDestroy(stop);
	}
}

	.file	"tmpxft_002da397_00000000-6_spmv.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2046:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2046:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0, @function
_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0:
.LFB2200:
	.cfi_startproc
	xorl	%edx, %edx
	jmp	cudaHostAlloc@PLT
	.cfi_endproc
.LFE2200:
	.size	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0, .-_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	.type	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0, @function
_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0:
.LFB2201:
	.cfi_startproc
	jmp	cudaMalloc@PLT
	.cfi_endproc
.LFE2201:
	.size	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0, .-_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"r+"
.LC1:
	.string	"ERROR: file open failed\n"
.LC2:
	.string	"%d %d %d\n"
.LC3:
	.string	"%d %d %f\n"
.LC4:
	.string	"No match.\n"
	.text
	.globl	_Z11read_matrixPPiS0_PPfPcS_S_
	.type	_Z11read_matrixPPiS0_PPfPcS_S_, @function
_Z11read_matrixPPiS0_PPfPcS_S_:
.LFB2041:
	.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
	movq	%rdi, %r14
	movq	%rcx, %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r8, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r9, %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%rsi, 32(%rsp)
	leaq	.LC0(%rip), %rsi
	movq	%rdx, 40(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	fopen@PLT
	testq	%rax, %rax
	jne	.L5
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$88, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	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
	jmp	__printf_chk@PLT
.L5:
	.cfi_restore_state
	movq	%rax, %rbp
	leaq	56(%rsp), %r15
	leaq	48(%rsp), %rax
	movq	%rax, %rcx
	leaq	52(%rsp), %rdx
	movq	%r15, %r8
	movq	%rax, 8(%rsp)
	leaq	.LC2(%rip), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	movl	52(%rsp), %edi
	movl	56(%rsp), %r13d
	movl	%edi, (%r12)
	incl	%edi
	movl	%r13d, (%rbx)
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movslq	%r13d, %rdi
	salq	$2, %rdi
	movq	%rax, %rbx
	movq	%rdi, 16(%rsp)
	call	malloc@PLT
	movq	16(%rsp), %rdi
	movq	%rax, %r12
	xorl	%eax, %eax
.L7:
	cmpl	%eax, %r13d
	jle	.L25
	movl	$-1, (%r12,%rax,4)
	incq	%rax
	jmp	.L7
.L25:
	call	malloc@PLT
	movq	%rax, %r13
.L9:
	leaq	68(%rsp), %rax
	leaq	60(%rsp), %rdx
	movq	%rbp, %rdi
	movq	%rax, 16(%rsp)
	leaq	64(%rsp), %rax
	movq	16(%rsp), %r8
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rcx
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	movl	60(%rsp), %ecx
	decl	64(%rsp)
	leal	-1(%rcx), %edx
	movl	%edx, 60(%rsp)
	cmpl	$3, %eax
	jne	.L10
	movslq	%edx, %rax
	incl	(%rbx,%rax,4)
	jmp	.L9
.L10:
	incl	%eax
	je	.L12
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L9
.L12:
	movq	%rbp, %rdi
	call	rewind@PLT
	movslq	52(%rsp), %rdx
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.L13:
	cmpl	%eax, %edx
	jle	.L26
	movl	(%rbx,%rax,4), %esi
	movl	%ecx, (%rbx,%rax,4)
	incq	%rax
	addl	%esi, %ecx
	jmp	.L13
.L26:
	movl	56(%rsp), %eax
	movq	8(%rsp), %rcx
	movq	%r15, %r8
	movq	%rbp, %rdi
	leaq	.LC2(%rip), %rsi
	leaq	.LC3(%rip), %r15
	movl	%eax, (%rbx,%rdx,4)
	leaq	52(%rsp), %rdx
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
.L15:
	movq	24(%rsp), %rcx
	movq	16(%rsp), %r8
	movq	%r15, %rsi
	movq	%rbp, %rdi
	leaq	60(%rsp), %rdx
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	movl	64(%rsp), %ecx
	movl	60(%rsp), %esi
	decl	%ecx
	leal	-1(%rsi), %edx
	movl	%ecx, 64(%rsp)
	movl	%edx, 60(%rsp)
	cmpl	$3, %eax
	jne	.L16
	movslq	%edx, %rdx
	movslq	(%rbx,%rdx,4), %rax
	salq	$2, %rax
.L17:
	movq	%rax, %rdx
	addq	$4, %rax
	cmpl	$-1, -4(%r12,%rax)
	jne	.L17
	movss	68(%rsp), %xmm0
	movl	%ecx, (%r12,%rdx)
	movss	%xmm0, 0(%r13,%rdx)
	jmp	.L15
.L16:
	incl	%eax
	je	.L19
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L19:
	movq	%rbp, %rdi
	call	fclose@PLT
	movq	32(%rsp), %rax
	movq	%rbx, (%r14)
	movq	%r12, (%rax)
	movq	40(%rsp), %rax
	movq	%r13, (%rax)
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
.L23:
	call	__stack_chk_fail@PLT
.L20:
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2041:
	.size	_Z11read_matrixPPiS0_PPfPcS_S_, .-_Z11read_matrixPPiS0_PPfPcS_S_
	.globl	_Z12cpu_multiplyiPKiS0_PKfS2_Pf
	.type	_Z12cpu_multiplyiPKiS0_PKfS2_Pf, @function
_Z12cpu_multiplyiPKiS0_PKfS2_Pf:
.LFB2042:
	.cfi_startproc
	endbr64
	movq	%rdx, %r10
	xorl	%eax, %eax
.L33:
	cmpl	%eax, %edi
	jle	.L37
	movl	4(%rsi,%rax,4), %r11d
	movslq	(%rsi,%rax,4), %rdx
	xorps	%xmm0, %xmm0
	cmpl	%edx, %r11d
	jg	.L36
	addss	(%r9,%rax,4), %xmm0
	movss	%xmm0, (%r9,%rax,4)
	incq	%rax
	jmp	.L33
.L37:
	ret
.L36:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
.L30:
	movslq	(%r10,%rdx,4), %rbx
	movss	(%r8,%rbx,4), %xmm1
	mulss	(%rcx,%rdx,4), %xmm1
	incq	%rdx
	addss	%xmm1, %xmm0
.L29:
	cmpl	%edx, %r11d
	jg	.L30
	addss	(%r9,%rax,4), %xmm0
	movss	%xmm0, (%r9,%rax,4)
	incq	%rax
	cmpl	%eax, %edi
	jle	.L38
	movl	4(%rsi,%rax,4), %r11d
	movslq	(%rsi,%rax,4), %rdx
	xorps	%xmm0, %xmm0
	jmp	.L29
.L38:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2042:
	.size	_Z12cpu_multiplyiPKiS0_PKfS2_Pf, .-_Z12cpu_multiplyiPKiS0_PKfS2_Pf
	.globl	_Z55__device_stub__Z22vector_multiply_unoptiiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.type	_Z55__device_stub__Z22vector_multiply_unoptiiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf, @function
_Z55__device_stub__Z22vector_multiply_unoptiiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf:
.LFB2068:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movl	%edi, 44(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	44(%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	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%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	.L39
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf(%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
.L39:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2068:
	.size	_Z55__device_stub__Z22vector_multiply_unoptiiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf, .-_Z55__device_stub__Z22vector_multiply_unoptiiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.globl	_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf
	.type	_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf, @function
_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf:
.LFB2069:
	.cfi_startproc
	endbr64
	jmp	_Z55__device_stub__Z22vector_multiply_unoptiiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.cfi_endproc
.LFE2069:
	.size	_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf, .-_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf
	.globl	_Z55__device_stub__Z22vector_multiply_unrolliPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.type	_Z55__device_stub__Z22vector_multiply_unrolliPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf, @function
_Z55__device_stub__Z22vector_multiply_unrolliPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf:
.LFB2070:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movl	%edi, 44(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	44(%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	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%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	.L44
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf(%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
.L44:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2070:
	.size	_Z55__device_stub__Z22vector_multiply_unrolliPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf, .-_Z55__device_stub__Z22vector_multiply_unrolliPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.globl	_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf
	.type	_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf, @function
_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf:
.LFB2071:
	.cfi_startproc
	endbr64
	jmp	_Z55__device_stub__Z22vector_multiply_unrolliPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.cfi_endproc
.LFE2071:
	.size	_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf, .-_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf
	.globl	_Z55__device_stub__Z22vector_multiply_sharediPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.type	_Z55__device_stub__Z22vector_multiply_sharediPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf, @function
_Z55__device_stub__Z22vector_multiply_sharediPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf:
.LFB2072:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movl	%edi, 44(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	44(%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	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%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	.L49
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z22vector_multiply_sharediPKiS0_PKfS2_Pf(%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
.L49:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L51
	call	__stack_chk_fail@PLT
.L51:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2072:
	.size	_Z55__device_stub__Z22vector_multiply_sharediPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf, .-_Z55__device_stub__Z22vector_multiply_sharediPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.globl	_Z22vector_multiply_sharediPKiS0_PKfS2_Pf
	.type	_Z22vector_multiply_sharediPKiS0_PKfS2_Pf, @function
_Z22vector_multiply_sharediPKiS0_PKfS2_Pf:
.LFB2073:
	.cfi_startproc
	endbr64
	jmp	_Z55__device_stub__Z22vector_multiply_sharediPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.cfi_endproc
.LFE2073:
	.size	_Z22vector_multiply_sharediPKiS0_PKfS2_Pf, .-_Z22vector_multiply_sharediPKiS0_PKfS2_Pf
	.globl	_Z55__device_stub__Z22vector_multiply_strideiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.type	_Z55__device_stub__Z22vector_multiply_strideiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf, @function
_Z55__device_stub__Z22vector_multiply_strideiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf:
.LFB2074:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movl	%edi, 44(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	44(%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	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%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	.L54
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z22vector_multiply_strideiPKiS0_PKfS2_Pf(%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
.L54:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L56
	call	__stack_chk_fail@PLT
.L56:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2074:
	.size	_Z55__device_stub__Z22vector_multiply_strideiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf, .-_Z55__device_stub__Z22vector_multiply_strideiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.globl	_Z22vector_multiply_strideiPKiS0_PKfS2_Pf
	.type	_Z22vector_multiply_strideiPKiS0_PKfS2_Pf, @function
_Z22vector_multiply_strideiPKiS0_PKfS2_Pf:
.LFB2075:
	.cfi_startproc
	endbr64
	jmp	_Z55__device_stub__Z22vector_multiply_strideiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.cfi_endproc
.LFE2075:
	.size	_Z22vector_multiply_strideiPKiS0_PKfS2_Pf, .-_Z22vector_multiply_strideiPKiS0_PKfS2_Pf
	.section	.rodata.str1.1
.LC6:
	.string	"Incorrect usage"
.LC7:
	.string	"PERFORMING SPMV ON MATRIX: \n"
.LC8:
	.string	"%d %d %.10f\n"
.LC10:
	.string	"Calculated Vector Matrix\n"
.LC11:
	.string	"%.10f\n"
.LC12:
	.string	"count = %d\n"
.LC13:
	.string	"time = %f\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2043:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$200, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	cmpl	$6, %edi
	je	.L60
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L61
.L60:
	movq	8(%rsi), %rdi
	movq	%rsi, %rbx
	call	atoi@PLT
	movq	16(%rbx), %rdi
	movl	%eax, %r14d
	call	atoi@PLT
	movq	24(%rbx), %rdi
	movl	%eax, %r15d
	call	atoi@PLT
	movq	32(%rbx), %rbp
	movq	40(%rbx), %rdi
	movl	%eax, 40(%rsp)
	call	atoi@PLT
	movq	%rbp, %rcx
	leaq	80(%rsp), %rdx
	leaq	56(%rsp), %r9
	leaq	52(%rsp), %r8
	leaq	72(%rsp), %rsi
	movl	%eax, 44(%rsp)
	leaq	64(%rsp), %rdi
	call	_Z11read_matrixPPiS0_PPfPcS_S_
	movslq	52(%rsp), %rbp
	leaq	0(,%rbp,4), %rax
	movq	%rbp, %r12
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movq	%rbp, %rdi
	movl	$4, %esi
	movq	%rax, %r13
	call	calloc@PLT
	movq	%rbp, %rdi
	movl	$4, %esi
	movq	%rax, %rbx
	call	calloc@PLT
	movq	%rax, %rbp
	xorl	%eax, %eax
.L62:
	cmpl	%eax, %r12d
	jle	.L129
	cvtsi2ssl	%r14d, %xmm0
	movss	%xmm0, 0(%r13,%rax,4)
	incq	%rax
	jmp	.L62
.L129:
	cmpl	$1, 40(%rsp)
	je	.L64
.L70:
	movq	80(%rsp), %rax
	movq	64(%rsp), %r14
	xorl	%ecx, %ecx
	movq	%rax, 24(%rsp)
	movq	72(%rsp), %rax
	movq	%rax, 32(%rsp)
	jmp	.L65
.L64:
	movq	stdout(%rip), %rdi
	leaq	.LC7(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	call	__fprintf_chk@PLT
.L66:
	movq	64(%rsp), %rax
	cmpl	%r14d, %r12d
	jle	.L70
	movl	(%rax,%r14,4), %r9d
	leaq	4(%rax,%r14,4), %r11
	movslq	%r9d, %rax
	leaq	0(,%rax,4), %r10
.L67:
	movq	80(%rsp), %rdx
	movq	72(%rsp), %rax
	leal	1(%r14), %ecx
	cmpl	%r9d, (%r11)
	jle	.L130
	movl	(%rax,%r10), %eax
	cvtss2sd	(%rdx,%r10), %xmm0
	movl	$2, %esi
	movq	stdout(%rip), %rdi
	leaq	.LC8(%rip), %rdx
	movl	%r9d, 32(%rsp)
	leal	1(%rax), %r8d
	movb	$1, %al
	movq	%r11, 24(%rsp)
	movq	%r10, 16(%rsp)
	call	__fprintf_chk@PLT
	movl	32(%rsp), %r9d
	movq	16(%rsp), %r10
	movq	24(%rsp), %r11
	incl	%r9d
	addq	$4, %r10
	jmp	.L67
.L130:
	incq	%r14
	jmp	.L66
.L132:
	incl	%ecx
.L65:
	cmpl	%r15d, %ecx
	jge	.L131
	xorl	%eax, %eax
.L74:
	cmpl	%eax, %r12d
	jle	.L132
	movl	4(%r14,%rax,4), %esi
	movslq	(%r14,%rax,4), %rdx
	xorps	%xmm0, %xmm0
.L71:
	cmpl	%edx, %esi
	jle	.L133
	movq	32(%rsp), %rdi
	movslq	(%rdi,%rdx,4), %rdi
	movss	0(%r13,%rdi,4), %xmm1
	movq	24(%rsp), %rdi
	mulss	(%rdi,%rdx,4), %xmm1
	incq	%rdx
	addss	%xmm1, %xmm0
	jmp	.L71
.L133:
	addss	0(%rbp,%rax,4), %xmm0
	movss	%xmm0, 0(%rbp,%rax,4)
	incq	%rax
	jmp	.L74
.L131:
	leaq	128(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	136(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	144(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	152(%rsp), %rdi
	call	cudaEventCreate@PLT
	movslq	56(%rsp), %rbp
	leaq	88(%rsp), %rdi
	movl	$0x00000000, 60(%rsp)
	leaq	0(,%rbp,4), %rax
	leaq	96(%rsp), %rbp
	movq	%rax, 16(%rsp)
	movl	44(%rsp), %eax
	decl	%eax
	cmpl	$5, %eax
	ja	.L75
	leaq	.L77(%rip), %rdx
	movq	8(%rsp), %rsi
	movslq	(%rdx,%rax,4), %rax
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L77:
	.long	.L82-.L77
	.long	.L81-.L77
	.long	.L80-.L77
	.long	.L79-.L77
	.long	.L78-.L77
	.long	.L76-.L77
	.section	.text.startup
.L82:
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%ebp, %ebp
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	16(%rsp), %rsi
	leaq	104(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rsi
	leaq	112(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rsi
	leaq	120(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rdx
	movq	88(%rsp), %rdi
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$1, %ecx
	movq	104(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	128(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
.L83:
	cmpl	%r15d, %ebp
	jge	.L128
	movq	8(%rsp), %rdx
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	cvtsi2ssl	%r12d, %xmm0
	mulss	.LC9(%rip), %xmm0
	call	ceilf@PLT
	movl	$67108865, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2siq	%xmm0, %rax
	salq	$6, %rdx
	movl	$1, %ecx
	movl	$1, 180(%rsp)
	movq	%rdx, 172(%rsp)
	movl	%eax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 164(%rsp)
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L84
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movl	%r12d, %edi
	movq	104(%rsp), %rcx
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	call	_Z55__device_stub__Z22vector_multiply_unoptiiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
.L84:
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	xorl	%eax, %eax
.L85:
	cmpl	%eax, %r12d
	jle	.L134
	movss	(%rbx,%rax,4), %xmm0
	movl	$0x00000000, (%rbx,%rax,4)
	movss	%xmm0, 0(%r13,%rax,4)
	incq	%rax
	jmp	.L85
.L134:
	incl	%ebp
	jmp	.L83
.L81:
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%ebp, %ebp
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	16(%rsp), %rsi
	leaq	104(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rsi
	leaq	112(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rsi
	leaq	120(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rdx
	movq	88(%rsp), %rdi
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$1, %ecx
	movq	104(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	128(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
.L89:
	cmpl	%r15d, %ebp
	jge	.L128
	movq	8(%rsp), %rdx
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	cvtsi2ssl	%r12d, %xmm0
	mulss	.LC9(%rip), %xmm0
	call	ceilf@PLT
	movl	$67108865, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2siq	%xmm0, %rax
	salq	$6, %rdx
	movl	$1, %ecx
	movl	$1, 180(%rsp)
	movq	%rdx, 172(%rsp)
	movl	%eax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 164(%rsp)
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L90
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movl	%r12d, %edi
	movq	104(%rsp), %rcx
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	call	_Z55__device_stub__Z22vector_multiply_strideiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
.L90:
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	xorl	%eax, %eax
.L91:
	cmpl	%eax, %r12d
	jle	.L135
	movss	(%rbx,%rax,4), %xmm0
	movl	$0x00000000, (%rbx,%rax,4)
	movss	%xmm0, 0(%r13,%rax,4)
	incq	%rax
	jmp	.L91
.L135:
	incl	%ebp
	jmp	.L89
.L80:
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%ebp, %ebp
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	16(%rsp), %rsi
	leaq	104(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rsi
	leaq	112(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rsi
	leaq	120(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rdx
	movq	88(%rsp), %rdi
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$1, %ecx
	movq	104(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	128(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
.L94:
	cmpl	%r15d, %ebp
	jge	.L128
	movq	8(%rsp), %rdx
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	cvtsi2ssl	%r12d, %xmm0
	mulss	.LC9(%rip), %xmm0
	call	ceilf@PLT
	movl	$67108865, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2siq	%xmm0, %rax
	salq	$6, %rdx
	movl	$1, %ecx
	movl	$1, 180(%rsp)
	movq	%rdx, 172(%rsp)
	movl	%eax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 164(%rsp)
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L95
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movl	%r12d, %edi
	movq	104(%rsp), %rcx
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	call	_Z55__device_stub__Z22vector_multiply_unrolliPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
.L95:
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	xorl	%eax, %eax
.L96:
	cmpl	%eax, %r12d
	jle	.L136
	movss	(%rbx,%rax,4), %xmm0
	movl	$0x00000000, (%rbx,%rax,4)
	movss	%xmm0, 0(%r13,%rax,4)
	incq	%rax
	jmp	.L96
.L136:
	incl	%ebp
	jmp	.L94
.L79:
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%ebp, %ebp
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	16(%rsp), %rsi
	leaq	104(%rsp), %rdi
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	8(%rsp), %rsi
	leaq	112(%rsp), %rdi
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	8(%rsp), %rsi
	leaq	120(%rsp), %rdi
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	8(%rsp), %rdx
	movq	88(%rsp), %rdi
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$1, %ecx
	movq	104(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	128(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
.L99:
	cmpl	%r15d, %ebp
	jge	.L137
	movq	8(%rsp), %rdx
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	cvtsi2ssl	%r12d, %xmm0
	mulss	.LC9(%rip), %xmm0
	call	ceilf@PLT
	movl	$67108865, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2siq	%xmm0, %rax
	salq	$6, %rdx
	movl	$1, %ecx
	movl	$1, 180(%rsp)
	movq	%rdx, 172(%rsp)
	movl	%eax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 164(%rsp)
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L100
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movl	%r12d, %edi
	movq	104(%rsp), %rcx
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	call	_Z55__device_stub__Z22vector_multiply_unoptiiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
.L100:
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	xorl	%eax, %eax
.L101:
	cmpl	%eax, %r12d
	jle	.L138
	movss	(%rbx,%rax,4), %xmm0
	movl	$0x00000000, (%rbx,%rax,4)
	movss	%xmm0, 0(%r13,%rax,4)
	incq	%rax
	jmp	.L101
.L138:
	incl	%ebp
	jmp	.L99
.L137:
	movq	136(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	136(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	136(%rsp), %rdx
	movq	128(%rsp), %rsi
	leaq	60(%rsp), %rdi
	movl	$0x00000000, 60(%rsp)
	call	cudaEventElapsedTime@PLT
	movq	144(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movq	152(%rsp), %rdi
	call	cudaEventDestroy@PLT
	jmp	.L88
.L78:
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%ebp, %ebp
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	16(%rsp), %rsi
	leaq	104(%rsp), %rdi
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	8(%rsp), %rsi
	leaq	112(%rsp), %rdi
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	8(%rsp), %rsi
	leaq	120(%rsp), %rdi
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	8(%rsp), %rdx
	movq	88(%rsp), %rdi
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$1, %ecx
	movq	104(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	128(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
.L104:
	cmpl	%r15d, %ebp
	jge	.L128
	movq	8(%rsp), %rdx
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	cvtsi2ssl	%r12d, %xmm0
	mulss	.LC9(%rip), %xmm0
	call	ceilf@PLT
	movl	$67108865, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2siq	%xmm0, %rax
	salq	$6, %rdx
	movl	$1, %ecx
	movl	$1, 180(%rsp)
	movq	%rdx, 172(%rsp)
	movl	%eax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 164(%rsp)
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L105
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movl	%r12d, %edi
	movq	104(%rsp), %rcx
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	call	_Z55__device_stub__Z22vector_multiply_unrolliPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
.L105:
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	xorl	%eax, %eax
.L106:
	cmpl	%eax, %r12d
	jle	.L139
	movss	(%rbx,%rax,4), %xmm0
	movl	$0x00000000, (%rbx,%rax,4)
	movss	%xmm0, 0(%r13,%rax,4)
	incq	%rax
	jmp	.L106
.L139:
	incl	%ebp
	jmp	.L104
.L76:
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%ebp, %ebp
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	16(%rsp), %rsi
	leaq	104(%rsp), %rdi
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	8(%rsp), %rsi
	leaq	112(%rsp), %rdi
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	8(%rsp), %rsi
	leaq	120(%rsp), %rdi
	call	_Z14cudaMallocHostIiE9cudaErrorPPT_mj.constprop.0.isra.0
	movq	8(%rsp), %rdx
	movq	88(%rsp), %rdi
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$1, %ecx
	movq	104(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	128(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
.L109:
	cmpl	%r15d, %ebp
	jge	.L128
	movq	8(%rsp), %rdx
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	cvtsi2ssl	%r12d, %xmm0
	mulss	.LC9(%rip), %xmm0
	call	ceilf@PLT
	movl	$67108865, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2siq	%xmm0, %rax
	salq	$6, %rdx
	movl	$1, %ecx
	movl	$1, 180(%rsp)
	movq	%rdx, 172(%rsp)
	movl	%eax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 164(%rsp)
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L110
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movl	%r12d, %edi
	movq	104(%rsp), %rcx
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	call	_Z55__device_stub__Z22vector_multiply_sharediPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
.L110:
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	xorl	%eax, %eax
.L111:
	cmpl	%eax, %r12d
	jle	.L140
	movss	(%rbx,%rax,4), %xmm0
	movl	$0x00000000, (%rbx,%rax,4)
	movss	%xmm0, 0(%r13,%rax,4)
	incq	%rax
	jmp	.L111
.L140:
	incl	%ebp
	jmp	.L109
.L75:
	movq	8(%rsp), %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%ebp, %ebp
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	16(%rsp), %rsi
	leaq	104(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rsi
	leaq	112(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rsi
	leaq	120(%rsp), %rdi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	8(%rsp), %rdx
	movq	88(%rsp), %rdi
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$1, %ecx
	movq	104(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	128(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
.L114:
	cmpl	%r15d, %ebp
	jge	.L128
	movq	8(%rsp), %rdx
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	cvtsi2ssl	%r12d, %xmm0
	mulss	.LC9(%rip), %xmm0
	call	ceilf@PLT
	movl	$67108865, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2siq	%xmm0, %rax
	salq	$6, %rdx
	movl	$1, %ecx
	movl	$1, 180(%rsp)
	movq	%rdx, 172(%rsp)
	movl	%eax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 164(%rsp)
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L115
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movl	%r12d, %edi
	movq	104(%rsp), %rcx
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	call	_Z55__device_stub__Z22vector_multiply_unoptiiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
.L115:
	movq	8(%rsp), %rdx
	movq	120(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	xorl	%eax, %eax
.L116:
	cmpl	%eax, %r12d
	jle	.L141
	movss	(%rbx,%rax,4), %xmm0
	movl	$0x00000000, (%rbx,%rax,4)
	movss	%xmm0, 0(%r13,%rax,4)
	incq	%rax
	jmp	.L116
.L141:
	incl	%ebp
	jmp	.L114
.L128:
	movq	136(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	136(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	136(%rsp), %rdx
	movq	128(%rsp), %rsi
	leaq	60(%rsp), %rdi
	movl	$0x00000000, 60(%rsp)
	call	cudaEventElapsedTime@PLT
.L88:
	cmpl	$1, 40(%rsp)
	jne	.L119
	movq	stdout(%rip), %rdi
	movl	$2, %esi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	leaq	.LC10(%rip), %rdx
	xorl	%r14d, %r14d
	leaq	.LC11(%rip), %rbp
	call	__fprintf_chk@PLT
.L120:
	movq	stdout(%rip), %rdi
	cmpl	%ebx, %r12d
	jle	.L142
	movss	0(%r13,%rbx,4), %xmm0
	xorps	%xmm1, %xmm1
	ucomiss	%xmm1, %xmm0
	jp	.L126
	je	.L121
.L126:
	movq	%rbp, %rdx
	movl	$2, %esi
	movb	$1, %al
	cvtss2sd	%xmm0, %xmm0
	call	__fprintf_chk@PLT
	incl	%r14d
.L121:
	incq	%rbx
	jmp	.L120
.L142:
	movl	%r14d, %ecx
	leaq	.LC12(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L119:
	movq	stdout(%rip), %rdi
	leaq	.LC13(%rip), %rdx
	movl	$2, %esi
	movb	$1, %al
	cvtss2sd	60(%rsp), %xmm0
	call	__fprintf_chk@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	96(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	128(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movq	136(%rsp), %rdi
	call	cudaEventDestroy@PLT
.L61:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L124
	call	__stack_chk_fail@PLT
.L124:
	addq	$200, %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
.LFE2043:
	.size	main, .-main
	.text
	.globl	_Z64__device_stub__Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.type	_Z64__device_stub__Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf, @function
_Z64__device_stub__Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf:
.LFB2076:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movl	%edi, 44(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	44(%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	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%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	.L143
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf(%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
.L143:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L145
	call	__stack_chk_fail@PLT
.L145:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2076:
	.size	_Z64__device_stub__Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf, .-_Z64__device_stub__Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.globl	_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
	.type	_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf, @function
_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf:
.LFB2077:
	.cfi_startproc
	endbr64
	jmp	_Z64__device_stub__Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_PfiPKiS0_PKfS2_Pf
	.cfi_endproc
.LFE2077:
	.size	_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf, .-_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
	.section	.rodata.str1.1
.LC14:
	.string	"_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf"
.LC15:
	.string	"_Z22vector_multiply_strideiPKiS0_PKfS2_Pf"
.LC16:
	.string	"_Z22vector_multiply_sharediPKiS0_PKfS2_Pf"
.LC17:
	.string	"_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf"
.LC18:
	.string	"_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2079:
	.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	.LC14(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf(%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	.LC15(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z22vector_multiply_strideiPKiS0_PKfS2_Pf(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC16(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z22vector_multiply_sharediPKiS0_PKfS2_Pf(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC17(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC18(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf(%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
.LFE2079:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC9:
	.long	1015021568
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <float.h>
#include <math.h>
#include <assert.h>
#include <time.h>
#include <sys/time.h>

inline hipError_t _checkError(hipError_t result)
{
  if (result != hipSuccess) {
    fprintf(stderr, "CUDA Runtime Error: %s\n", 
            hipGetErrorString(result));
    assert(result == hipSuccess);
  }
  return result;
}

void read_matrix(int **r_ptr, int** c_ind,float** v, char*fname,int* r_count,int* v_count){	
	
	//*************************************************************
        //READ AND CONVERT COO MATRIX TO CSR MATRIX
        //*************************************************************

	FILE * file;
    	if ((file = fopen(fname, "r+")) == NULL)
	{
	    printf("ERROR: file open failed\n");
	    return;
	}
	
	int column_count,row_count,values_count;
	fscanf(file, "%d %d %d\n",&row_count,&column_count,&values_count);
	*r_count = row_count;
	*v_count = values_count;
	int i;
	int *row_ptr =(int*) malloc((row_count+1) * sizeof(int));
	int *col_ind =(int*) malloc(values_count * sizeof(int));
	for(i=0; i<values_count; i++){
		col_ind[i] = -1;
	}
	float *values =(float*) malloc(values_count * sizeof(float));
	int row,column;
	float value;

	//*************************************************************
        //GENERATING THE ROW VECTOR FOR CSR
       	//*************************************************************

	while (1) {
		int ret = fscanf(file, "%d %d %f\n",&row,&column,&value);
		column --;
		row --;
		if(ret == 3){
			row_ptr[row]++;
		} else if(ret == EOF) {
		   	break;
		} else {
		    	printf("No match.\n");
		}
	}
    	rewind(file);
	//printf("The row count: %d\n",row_count);
    	int index = 0;
    	int val = 0;
	for(i = 0; i<row_count;i++){
		val = row_ptr[i];
		//printf("The value is : %d\n",val);
		row_ptr[i] = index;
		index += val;
		//printf("row_ptr[%d] = %d\n",i, row_ptr[i]);
	}
	row_ptr[row_count] = values_count;
	fscanf(file, "%d %d %d\n",&row_count,&column_count,&values_count);
	i = 0;
	while (1) {
		int ret = fscanf(file, "%d %d %f\n",&row,&column,&value);
		column --;
		row --;
		if(ret == 3){
			while(col_ind[i+row_ptr[row]] != -1){ i++;}
			col_ind[i+row_ptr[row]] = column;
			values[i+row_ptr[row]] = value;
			i=0;
		} else if(ret == EOF) {
		   	break;
		} else {
		    	printf("No match.\n");
		}
	}
    	fclose(file);
    	*r_ptr = row_ptr;
    	*c_ind = col_ind;
    	*v = values;
}

void cpu_multiply(const int num_rows,const int *ptr, const int *indices, const float *data, const float *x, float* y){
	float dot;
	int row_start, row_end;
	for (int i=0; i<num_rows; i++){
		dot = 0;
                /*printf("CPU Matrix\n");
                for(int l = 0; l<num_rows;l++){
                        if(l+1 <= num_rows){
                                for(int k = ptr[l]; k < ptr[l+1];k++){
                                        printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                                }
                        }
                }*/
                row_start = ptr[i];
                row_end = ptr[i + 1];
                //printf("row_start: %d\t row end: %d\n",row_start, row_end);
                for(int j = row_start; j < row_end; j++){
                        //printf("data[%d] = %10f * indices[%d] = %d x[indices[%d]]= %10f\n", i, data[i], i, indices[i]+1, i,  x[indices[i]]);
                        dot+= data[j] * x[indices[j]];
                }
		y[i] += dot;
	}
}

__global__ void vector_multiply_unopti(const int num_rows,const int *ptr,const int *indices,const float *data,const float *x, float* y){
	int row = blockIdx.x * blockDim.x + threadIdx.x;
	/*printf("Kernel Matrix\n");
        for(int i = 0; i<num_rows;i++){
        	if(i+1 <= num_rows){
        		for(int k = ptr[i]; k < ptr[i+1];k++){
                		printf("%d %d %.10f\n",i+1,indices[k]+1,data[k]);
                	}
        	}	
        }*/
	//printf("In Kernel:\n",row);
	int i;
	int row_start, row_end;
	float dot;
	if(row < num_rows){
		//printf("row=%d\n",row);
		dot = 0;
		/*printf("Kernel Matrix\n");
        	for(int l = 0; l<num_rows;l++){
                	if(l+1 <= num_rows){
                        	for(int k = ptr[l]; k < ptr[l+1];k++){
                                	printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                        	}
                	}
        	}*/
		row_start = ptr[row];
		row_end = ptr[row + 1];
		//printf("row_start: %d\t row end: %d\n",row_start, row_end);
		for(i = row_start; i < row_end; i++){
			//printf("data[%d] = %10f * indices[%d] = %d x[indices[%d]]= %10f\n", i, data[i], i, indices[i]+1, i,  x[indices[i]]);
			dot+= data[i] * x[indices[i]];
		}
	}
	y[row] += dot;
}

__global__ void vector_multiply_unroll(const int num_rows,const int *ptr,const int *indices,const float *data,const float *x, float* y){
        int row;// = blockIdx.x * blockDim.x + threadIdx.x;
        //printf("In Kernel:\n",row);
        int i;
        int row_start, row_end;
        float dot;
	#pragma unroll
        for (row = blockIdx.x * blockDim.x + threadIdx.x; row < num_rows; row += blockDim.x * gridDim.x)
        {
                dot = 0;
                /*printf("Kernel Matrix\n");
                for(int l = 0; l<num_rows;l++){
                        if(l+1 <= num_rows){
                                for(int k = ptr[l]; k < ptr[l+1];k++){
                                        printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                                }
                        }
                }*/
                row_start = ptr[row];
                row_end = ptr[row + 1];
                #pragma unroll
                for(i = row_start; i < row_end; i++){
                        dot+= data[i] * x[indices[i]];
                }
        }

}

//TODO: Fix this implementation
__global__ void vector_multiply_shared(const int num_rows,const int *ptr,const int *indices,const float *data,const float *x, float* y){
        __shared__ float s[256];
	int row = blockIdx.x * blockDim.x + threadIdx.x;
	//printf("In Kernel:\n",row);

	s[row]=0.0;
	/*for(int l=0; l<num_rows; l++){
		s[l] = 0.0;
	}*/
        //printf("No error:\n",row);
        int i;
        int row_start, row_end;
        //float dot;
        if(row < num_rows){
                //dot = 0;
		s[row] = 0.0;
                /*printf("Kernel Matrix\n");
                for(int l = 0; l<num_rows;l++){
                        if(l+1 <= num_rows){
                                for(int k = ptr[l]; k < ptr[l+1];k++){
                                        printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                                }
                        }
                }*/
                row_start = ptr[row];
                row_end = ptr[row + 1];
                #pragma unroll
                for(i = row_start; i < row_end; i++){
                        s[row]+= data[i] * x[indices[i]];
                }
        }
        //s[row] += dot;
	__syncthreads();
	y[row] = s[row];
}

__global__ void vector_multiply_stride(const int num_rows,const int *ptr,const int *indices,const float *data,const float *x, float* y){
        int row;// = blockIdx.x * blockDim.x + threadIdx.x;
        //printf("In Kernel:\n",row);
        int i;
        int row_start, row_end;
        float dot;
	for (row = blockIdx.x * blockDim.x + threadIdx.x; row < num_rows; row += blockDim.x * gridDim.x) 
      	{
        	dot = 0;
                /*printf("Kernel Matrix\n");
                for(int l = 0; l<num_rows;l++){
                        if(l+1 <= num_rows){
                                for(int k = ptr[l]; k < ptr[l+1];k++){
                                        printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                                }
                        }
                }*/
                row_start = ptr[row];
                row_end = ptr[row + 1];
                for(i = row_start; i < row_end; i++){
                        dot+= data[i] * x[indices[i]];
                }
      	}
        y[row] += dot;
}

//TODO: Fix the prefetch method

__global__ void vector_multiply_stride_prefetch(const int num_rows,const int *ptr,const int *indices,const float *data,const float *x, float* y){
        int row;// = blockIdx.x * blockDim.x + threadIdx.x;
        //printf("In Kernel:\n",row);
        int i;
        int row_start, row_end;
        float dot;
	#pragma unroll
        for (row = blockIdx.x * blockDim.x + threadIdx.x; row < num_rows; row += blockDim.x * gridDim.x)
        {
                dot = 0;
		//__prefetch_global_l1(row_start);
                /*printf("Kernel Matrix\n");
                for(int l = 0; l<num_rows;l++){
                        if(l+1 <= num_rows){
                                for(int k = ptr[l]; k < ptr[l+1];k++){
                                        printf("%d %d %.10f\n",l+1,indices[k]+1,data[k]);
                                }
                        }
                }*/
                row_start = ptr[row];
                row_end = ptr[row + 1];
                #pragma unroll
                for(i = row_start; i < row_end; i++){
                        dot+= data[i] * x[indices[i]];
                }
        }
        y[row] += dot;
}

int main (int argc, char* argv[]){

	//*************************************************************
	//Argument List: vector_to_multiply, repetitions_for_the code, 
	//		 verbose, filename_matrixi, 
	//		 optimizations_to_apply
	//*************************************************************

	//*************************************************************
	//HOST CODE
	//*************************************************************
	
	if ( argc != 6){
		printf( "Incorrect usage");
	}
	else{
		int* row_ptr;
		int* col_ind;
		float* values;
		int r_count, v_count, i, k, j;
		int num = atoi(argv[1]);
		int repetitions = atoi(argv[2]);
		int mode = atoi(argv[3]);
		char* fname = argv[4];
		int opti = atoi(argv[5]);
	
		//*************************************************************
		//READING THE GIVEN COORDINATE FORM MATRIX AND CONVERTING IT TO 
		//COMPRESSED SPARSE ROW MATRIX
		//*************************************************************
	
		read_matrix(&row_ptr, &col_ind, &values, fname, &r_count, &v_count);
		float* x =(float*) malloc(r_count* sizeof(float));
		float* y =(float*) calloc(r_count, sizeof(float));
		float* cy =(float*) calloc(r_count, sizeof(float));
		for(i = 0; i<r_count;i++){
		    	x[i]= (float)num;
		}

		if(mode == 1){

			//*************************************************************
			//PRINT OUT THE GIVEN COORDINATE MATRIX STORED IN THE FORM OF
			//CSR MATRIX
			//*************************************************************

			fprintf(stdout,"PERFORMING SPMV ON MATRIX: \n");
			for(i = 0; i<r_count;i++){
		    		if(i+1 <= r_count){
		    			for(k = row_ptr[i]; k < row_ptr[i+1];k++){
		    				fprintf(stdout,"%d %d %.10f\n",i+1,col_ind[k]+1,values[k]);
		    			}
		    		}	
		    	}

	  	}
		//TODO: Timer for CPU run
		//*************************************************************
                //RUNNING ON CPU
                //*************************************************************
		/*struct timeval cstart, cend;
    		long mtime, secs, usecs;*/ 
		float cdot;	
		//gettimeofday(&cstart, NULL);
		for(k = 0; k<repetitions; k++){
			//cpu_multiply(r_count, row_ptr, col_ind, values, x, y);
        		for (i=0; i<r_count; i++){
                		cdot = 0;
                		for(j = row_ptr[i]; j < row_ptr[i+1]; j++){
                        		cdot+= values[j] * x[col_ind[j]];
                		}
                	cy[i] += cdot;
        		}
		}
		/*gettimeofday(&cend, NULL);
		secs  = cend.tv_sec  - cstart.tv_sec;
    		usecs = cend.tv_usec - cstart.tv_usec;
    		mtime = ((secs) * 1000 + usecs/1000.0) + 0.5;
    		printf("Elapsed time: %ld millisecs\n", mtime);*/

		//*************************************************************
                //COMPLETED RUNNING ON CPU
                //*************************************************************

		//*************************************************************
		//SETTING UP GPU RUN
		//*************************************************************

		int *d_row_ptr, *d_col_ind;
		float *d_values, *d_x, *d_y;

		hipEvent_t start,stop,st,sp;
                hipEventCreate(&start);
                hipEventCreate(&stop);
		hipEventCreate(&st);
                hipEventCreate(&sp);
		float milliseconds = 0;
		//float timing = 0;
		//int bytes = r_count * sizeof(float);

		switch(opti){
			case 1:

				//*************************************************************
                		//RUNNING KERNEL WITH NO OPTIMIZATIONS MONOLITHIC
                		//*************************************************************

				hipMalloc(&d_row_ptr, r_count*sizeof(int));
                		hipMalloc(&d_col_ind, v_count*sizeof(int));
                		hipMalloc(&d_values, v_count*sizeof(int));
                		hipMalloc(&d_x, r_count*sizeof(float));
                		hipMalloc(&d_y, r_count*sizeof(float));

				hipMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), hipMemcpyHostToDevice);
                		hipMemcpy(d_col_ind, col_ind, v_count*sizeof(int), hipMemcpyHostToDevice);
                		hipMemcpy(d_values, values, v_count*sizeof(int), hipMemcpyHostToDevice);

				hipEventRecord(start);
               	 		for(k = 0; k<repetitions; k++){
                        		//printf("Calling Kernel\n");
                        		hipMemcpy(d_x, x, r_count*sizeof(float), hipMemcpyHostToDevice);
                        		hipMemcpy(d_y, y, r_count*sizeof(float), hipMemcpyHostToDevice);

                        
                        		float blocksize = 64;
                        		float blocknum = ceil(r_count/blocksize); 
                        		//printf("blocknum: %f\n",blocknum);
                        		//blocknum = 1.0;
                        		//printf("blocknum: %f\n",blocknum);
                        		vector_multiply_unopti<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                        		hipMemcpy(y, d_y, r_count*sizeof(float), hipMemcpyDeviceToHost);
                        		for(i = 0; i<r_count;i++){
                                		x[i] = y[i];
                                		y[i]= 0.0;
                        		}
                		}

                		hipEventRecord(stop);
                		hipEventSynchronize(stop);

                		milliseconds = 0;
                		hipEventElapsedTime(&milliseconds, start, stop);

				break;
			case 2:

                                //*************************************************************
                                //RUNNING KERNEL WITH NO OPTIMIZATIONS STRIDE
                                //*************************************************************

                                hipMalloc(&d_row_ptr, r_count*sizeof(int));
                                hipMalloc(&d_col_ind, v_count*sizeof(int));
                                hipMalloc(&d_values, v_count*sizeof(int));
                                hipMalloc(&d_x, r_count*sizeof(float));
                                hipMalloc(&d_y, r_count*sizeof(float));

                                hipMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_col_ind, col_ind, v_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_values, values, v_count*sizeof(int), hipMemcpyHostToDevice);

                                hipEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
                                        hipMemcpy(d_x, x, r_count*sizeof(float), hipMemcpyHostToDevice);
                                        hipMemcpy(d_y, y, r_count*sizeof(float), hipMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_stride<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                                        hipMemcpy(y, d_y, r_count*sizeof(float), hipMemcpyDeviceToHost);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                hipEventRecord(stop);
                                hipEventSynchronize(stop);

                                milliseconds = 0;
                                hipEventElapsedTime(&milliseconds, start, stop);

                                break;
			case 3:
				//*************************************************************
                                //RUNNING KERNEL WITH LOOP UNROLLING
                                //*************************************************************

                                hipMalloc(&d_row_ptr, r_count*sizeof(int));
                                hipMalloc(&d_col_ind, v_count*sizeof(int));
                                hipMalloc(&d_values, v_count*sizeof(int));
                                hipMalloc(&d_x, r_count*sizeof(float));
                                hipMalloc(&d_y, r_count*sizeof(float));

                                hipMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_col_ind, col_ind, v_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_values, values, v_count*sizeof(int), hipMemcpyHostToDevice);

                                hipEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
                                        hipMemcpy(d_x, x, r_count*sizeof(float), hipMemcpyHostToDevice);
                                        hipMemcpy(d_y, y, r_count*sizeof(float), hipMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_unroll<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                                        hipMemcpy(y, d_y, r_count*sizeof(float), hipMemcpyDeviceToHost);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                hipEventRecord(stop);
                                hipEventSynchronize(stop);

                                milliseconds = 0;
                                hipEventElapsedTime(&milliseconds, start, stop);
				break;
			case 4:
				//*************************************************************
                                //RUNNING KERNEL WITH DATA TRANSFER OPTIMIZATIONS
                                //*************************************************************
				
				//int bytes = r_count * sizeof(float);

                          	hipHostMalloc(&d_row_ptr, r_count*sizeof(int), hipHostMallocDefault);
                		hipHostMalloc(&d_col_ind, v_count*sizeof(int), hipHostMallocDefault);
                		hipHostMalloc(&d_values, v_count*sizeof(int), hipHostMallocDefault);
                		hipHostMalloc(&d_x, r_count*sizeof(float), hipHostMallocDefault);
                		hipHostMalloc(&d_y, r_count*sizeof(float), hipHostMallocDefault);   
                            
                                hipMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), hipMemcpyHostToDevice);

                                hipMemcpy(d_col_ind, col_ind, v_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_values, values, v_count*sizeof(int), hipMemcpyHostToDevice);

                                hipEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
					//cudaEventRecord(st);
                                        hipMemcpy(d_x, x, r_count*sizeof(float), hipMemcpyHostToDevice);
					//cudaEventRecord(sp);
					//cudaEventSynchronize(sp);
					//cudaEventElapsedTime(&timing, st, sp);
					
					//printf("Host to Device bandwidth (GB/s): %f\n", bytes * 1e-6 / timing);

                                        hipMemcpy(d_y, y, r_count*sizeof(float), hipMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_unopti<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
					//cudaEventRecord(st);
                                        hipMemcpy(y, d_y, r_count*sizeof(float), hipMemcpyDeviceToHost);
					//cudaEventRecord(sp);
					//cudaEventSynchronize(sp);
					//cudaEventElapsedTime(&timing, st, sp);

                                        //printf("Device to Host bandwidth (GB/s): %f\n", bytes * 1e-6 / timing);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                hipEventRecord(stop);
                                hipEventSynchronize(stop);

                                milliseconds = 0;
                                hipEventElapsedTime(&milliseconds, start, stop);
				
				hipEventDestroy(st);
                		hipEventDestroy(sp);

				break;
			case 5:
				//*************************************************************
                                //RUNNING KERNEL WITH DATA TRANSFER OPTIMIZATIONS AND 
				//LOOP UNROLLING
                                //*************************************************************

                                hipHostMalloc(&d_row_ptr, r_count*sizeof(int), hipHostMallocDefault);
                                hipHostMalloc(&d_col_ind, v_count*sizeof(int), hipHostMallocDefault);
                                hipHostMalloc(&d_values, v_count*sizeof(int), hipHostMallocDefault);
                                hipHostMalloc(&d_x, r_count*sizeof(float), hipHostMallocDefault);
                                hipHostMalloc(&d_y, r_count*sizeof(float), hipHostMallocDefault);

                                hipMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_col_ind, col_ind, v_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_values, values, v_count*sizeof(int), hipMemcpyHostToDevice);

                                hipEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
                                        hipMemcpy(d_x, x, r_count*sizeof(float), hipMemcpyHostToDevice);
                                        hipMemcpy(d_y, y, r_count*sizeof(float), hipMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_unroll<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                                        hipMemcpy(y, d_y, r_count*sizeof(float), hipMemcpyDeviceToHost);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                hipEventRecord(stop);
                                hipEventSynchronize(stop);

                                milliseconds = 0;
                                hipEventElapsedTime(&milliseconds, start, stop);

				break;
			case 6:
                                //*************************************************************
                                //RUNNING KERNEL WITH DATA TRANSFER OPTIMIZATIONS,
                                //LOOP UNROLLING AND USING SHARED MEMORY
                                //*************************************************************

                                hipHostMalloc(&d_row_ptr, r_count*sizeof(int), hipHostMallocDefault);
                                hipHostMalloc(&d_col_ind, v_count*sizeof(int), hipHostMallocDefault);
                                hipHostMalloc(&d_values, v_count*sizeof(int), hipHostMallocDefault);
                                hipHostMalloc(&d_x, r_count*sizeof(float), hipHostMallocDefault);
                                hipHostMalloc(&d_y, r_count*sizeof(float), hipHostMallocDefault);

                                hipMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_col_ind, col_ind, v_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_values, values, v_count*sizeof(int), hipMemcpyHostToDevice);

                                hipEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
                                        hipMemcpy(d_x, x, r_count*sizeof(float), hipMemcpyHostToDevice);
                                        hipMemcpy(d_y, y, r_count*sizeof(float), hipMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_shared<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                                        hipMemcpy(y, d_y, r_count*sizeof(float), hipMemcpyDeviceToHost);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                hipEventRecord(stop);
                                hipEventSynchronize(stop);

                                milliseconds = 0;
                                hipEventElapsedTime(&milliseconds, start, stop);

                                break;
			default:
				//*************************************************************
                                //RUNNING KERNEL WITH NO OPTIMIZATIONS IN DEFAULT CASE
                                //*************************************************************

                                hipMalloc(&d_row_ptr, r_count*sizeof(int));
                                hipMalloc(&d_col_ind, v_count*sizeof(int));
                                hipMalloc(&d_values, v_count*sizeof(int));
                                hipMalloc(&d_x, r_count*sizeof(float));
                                hipMalloc(&d_y, r_count*sizeof(float));

                                hipMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_col_ind, col_ind, v_count*sizeof(int), hipMemcpyHostToDevice);
                                hipMemcpy(d_values, values, v_count*sizeof(int), hipMemcpyHostToDevice);

                                hipEventRecord(start);
                                for(k = 0; k<repetitions; k++){
                                        //printf("Calling Kernel\n");
                                        hipMemcpy(d_x, x, r_count*sizeof(float), hipMemcpyHostToDevice);
                                        hipMemcpy(d_y, y, r_count*sizeof(float), hipMemcpyHostToDevice);


                                        float blocksize = 64;
                                        float blocknum = ceil(r_count/blocksize);
                                        //printf("blocknum: %f\n",blocknum);
                                        //blocknum = 1.0;
                                        //printf("blocknum: %f\n",blocknum);
                                        vector_multiply_unopti<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
                                        hipMemcpy(y, d_y, r_count*sizeof(float), hipMemcpyDeviceToHost);
                                        for(i = 0; i<r_count;i++){
                                                x[i] = y[i];
                                                y[i]= 0.0;
                                        }
                                }

                                hipEventRecord(stop);
                                hipEventSynchronize(stop);

                                milliseconds = 0;
                                hipEventElapsedTime(&milliseconds, start, stop);
				
		}

		/*cudaMalloc(&d_row_ptr, r_count*sizeof(int));
		cudaMalloc(&d_col_ind, v_count*sizeof(int));
		cudaMalloc(&d_values, v_count*sizeof(int));
		cudaMalloc(&d_x, r_count*sizeof(float));
		cudaMalloc(&d_y, r_count*sizeof(float));*/
		
		/*cudaMallocHost(&d_row_ptr, r_count*sizeof(int));
                cudaMallocHost(&d_col_ind, v_count*sizeof(int));
                cudaMallocHost(&d_values, v_count*sizeof(int));
                cudaMallocHost(&d_x, r_count*sizeof(float));
                cudaMallocHost(&d_y, r_count*sizeof(float));

		cudaMemcpy(d_row_ptr, row_ptr, r_count*sizeof(int), cudaMemcpyHostToDevice);
		cudaMemcpy(d_col_ind, col_ind, v_count*sizeof(int), cudaMemcpyHostToDevice);
		cudaMemcpy(d_values, values, v_count*sizeof(int), cudaMemcpyHostToDevice);
		cudaEvent_t start,stop;
		cudaEventCreate(&start);
		cudaEventCreate(&stop);	  	
	  	
		cudaEventRecord(start);
	  	for(k = 0; k<repetitions; k++){
			printf("Calling Kernel\n");
			cudaMemcpy(d_x, x, r_count*sizeof(float), cudaMemcpyHostToDevice);
			cudaMemcpy(d_y, y, r_count*sizeof(float), cudaMemcpyHostToDevice);
		
			// kernel call
			float blocksize = 64;
			float blocknum = ceil(r_count/blocksize); //number of threads fixed and equal to row count
			//printf("blocknum: %f\n",blocknum);
			//blocknum = 1.0;
			//printf("blocknum: %f\n",blocknum);
			//vector_multiply_unopti<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
			vector_multiply_unroll<<<blocknum, blocksize>>>(r_count, d_row_ptr, d_col_ind, d_values, d_x, d_y);
			cudaMemcpy(y, d_y, r_count*sizeof(float), cudaMemcpyDeviceToHost);
			for(i = 0; i<r_count;i++){
				x[i] = y[i];
			    	y[i]= 0.0;
			}
		}
		cudaEventRecord(stop);
		cudaEventSynchronize(stop);
		float milliseconds = 0;
		cudaEventElapsedTime(&milliseconds, start, stop);*/

		//*************************************************************
                //GPU RUN COMPLETED
                //*************************************************************

		//*************************************************************
                //PRINTING RESULTANT MATRIX.
		//ONLY NON ZERO ELEMENTS ARE DISPLAYED.
                //*************************************************************

		int count = 0;
		if(mode == 1){
			
			fprintf(stdout,"Calculated Vector Matrix\n");
		    	for(i = 0; i<r_count;i++){
		    		if(x[i] != 0){
		    		fprintf(stdout,"%.10f\n",x[i]);
		    		count++;
		    		}
		    	}
		    	fprintf(stdout,"count = %d\n", count);

		}
		fprintf(stdout,"time = %f\n", milliseconds);
		//fprintf(stdout,"CPU time = %f\n",cpu_time_used);
		
		//*************************************************************
                //FREE MEMORY
                //*************************************************************
		hipFree(d_row_ptr);
		hipFree(d_col_ind);
		hipFree(d_values);
		hipFree(d_x);
		hipFree(d_y);
		hipEventDestroy(start);
        	hipEventDestroy(stop);
	}
}

	.text
	.file	"spmv.hip"
	.globl	_Z11read_matrixPPiS0_PPfPcS_S_  # -- Begin function _Z11read_matrixPPiS0_PPfPcS_S_
	.type	_Z11read_matrixPPiS0_PPfPcS_S_,@function
_Z11read_matrixPPiS0_PPfPcS_S_:         # @_Z11read_matrixPPiS0_PPfPcS_S_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$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
	movq	%r9, %rbx
	movq	%r8, %r14
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %rbp
	movl	$.L.str, %esi
	movq	%rcx, %rdi
	callq	fopen
	testq	%rax, %rax
	je	.LBB0_18
# %bb.1:
	movq	%rax, %r12
	movq	%rbp, 32(%rsp)                  # 8-byte Spill
	movq	%r13, 40(%rsp)                  # 8-byte Spill
	movq	%r15, 48(%rsp)                  # 8-byte Spill
	leaq	12(%rsp), %r15
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %r13
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	movq	%r15, %rdx
	movq	%r13, %r8
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movslq	(%r15), %rax
	movl	%eax, (%r14)
	movslq	(%r13), %r14
	movl	%r14d, (%rbx)
	leaq	4(,%rax,4), %rdi
	callq	malloc
	movq	%rax, %r13
	leaq	(,%r14,4), %rbx
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %rbp
	testq	%r14, %r14
	jle	.LBB0_3
# %bb.2:                                # %.lr.ph.preheader
	movl	%r14d, %edx
	shlq	$2, %rdx
	movq	%rbp, %rdi
	movl	$255, %esi
	callq	memset@PLT
.LBB0_3:                                # %._crit_edge
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	%rsp, %rbx
	leaq	4(%rsp), %r14
	leaq	8(%rsp), %r15
.LBB0_4:                                # =>This Inner Loop Header: Depth=1
	movl	$.L.str.3, %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	movq	%r15, %r8
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	decl	4(%rsp)
	movslq	(%rsp), %rcx
	leal	-1(%rcx), %edx
	movl	%edx, (%rsp)
	cmpl	$3, %eax
	je	.LBB0_19
# %bb.5:                                #   in Loop: Header=BB0_4 Depth=1
	cmpl	$-1, %eax
	je	.LBB0_7
# %bb.6:                                #   in Loop: Header=BB0_4 Depth=1
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	jmp	.LBB0_4
.LBB0_19:                               #   in Loop: Header=BB0_4 Depth=1
	incl	-4(%r13,%rcx,4)
	jmp	.LBB0_4
.LBB0_7:
	movq	%r12, %rdi
	callq	rewind
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.LBB0_10
# %bb.8:                                # %.lr.ph68.preheader
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.LBB0_9:                                # %.lr.ph68
                                        # =>This Inner Loop Header: Depth=1
	movl	(%r13,%rcx,4), %esi
	addl	%edx, %esi
	movl	%edx, (%r13,%rcx,4)
	incq	%rcx
	movl	%esi, %edx
	cmpq	%rcx, %rax
	jne	.LBB0_9
.LBB0_10:                               # %._crit_edge69
	leaq	16(%rsp), %r8
	movl	(%r8), %ecx
	cltq
	movl	%ecx, (%r13,%rax,4)
	leaq	12(%rsp), %rdx
	leaq	20(%rsp), %rcx
	movl	$.L.str.2, %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movq	%rsp, %r14
	leaq	4(%rsp), %r15
	leaq	8(%rsp), %rbx
.LBB0_11:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_15 Depth 2
	movl	$.L.str.3, %esi
	movq	%r12, %rdi
	movq	%r14, %rdx
	movq	%r15, %rcx
	movq	%rbx, %r8
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movl	4(%rsp), %ecx
	decl	%ecx
	movl	%ecx, 4(%rsp)
	movslq	(%rsp), %rdx
	leal	-1(%rdx), %esi
	movl	%esi, (%rsp)
	cmpl	$3, %eax
	je	.LBB0_14
# %bb.12:                               #   in Loop: Header=BB0_11 Depth=1
	cmpl	$-1, %eax
	je	.LBB0_17
# %bb.13:                               #   in Loop: Header=BB0_11 Depth=1
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	jmp	.LBB0_11
.LBB0_14:                               # %.preheader
                                        #   in Loop: Header=BB0_11 Depth=1
	movslq	-4(%r13,%rdx,4), %rax
	shlq	$2, %rax
.LBB0_15:                               #   Parent Loop BB0_11 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpl	$-1, (%rbp,%rax)
	leaq	4(%rax), %rax
	jne	.LBB0_15
# %bb.16:                               #   in Loop: Header=BB0_11 Depth=1
	movl	%ecx, -4(%rbp,%rax)
	movss	8(%rsp), %xmm0                  # xmm0 = mem[0],zero,zero,zero
	movq	24(%rsp), %rcx                  # 8-byte Reload
	movss	%xmm0, -4(%rcx,%rax)
	jmp	.LBB0_11
.LBB0_17:
	movq	%r12, %rdi
	callq	fclose
	movq	32(%rsp), %rax                  # 8-byte Reload
	movq	%r13, (%rax)
	movq	40(%rsp), %rax                  # 8-byte Reload
	movq	%rbp, (%rax)
	movq	48(%rsp), %rax                  # 8-byte Reload
	movq	24(%rsp), %rcx                  # 8-byte Reload
	movq	%rcx, (%rax)
	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
.LBB0_18:
	.cfi_def_cfa_offset 112
	movl	$.Lstr.2, %edi
	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
	jmp	puts@PLT                        # TAILCALL
.Lfunc_end0:
	.size	_Z11read_matrixPPiS0_PPfPcS_S_, .Lfunc_end0-_Z11read_matrixPPiS0_PPfPcS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z12cpu_multiplyiPKiS0_PKfS2_Pf # -- Begin function _Z12cpu_multiplyiPKiS0_PKfS2_Pf
	.type	_Z12cpu_multiplyiPKiS0_PKfS2_Pf,@function
_Z12cpu_multiplyiPKiS0_PKfS2_Pf:        # @_Z12cpu_multiplyiPKiS0_PKfS2_Pf
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jle	.LBB1_7
# %bb.1:                                # %.lr.ph25.preheader
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	%edi, %eax
	movl	(%rsi), %ebx
	xorl	%edi, %edi
.LBB1_2:                                # %.lr.ph25
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_4 Depth 2
	movl	4(%rsi,%rdi,4), %r10d
	xorps	%xmm0, %xmm0
	cmpl	%r10d, %ebx
	jge	.LBB1_5
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB1_2 Depth=1
	movslq	%r10d, %r11
	movslq	%ebx, %rbx
.LBB1_4:                                # %.lr.ph
                                        #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rcx,%rbx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movslq	(%rdx,%rbx,4), %r14
	mulss	(%r8,%r14,4), %xmm1
	addss	%xmm1, %xmm0
	incq	%rbx
	cmpq	%rbx, %r11
	jne	.LBB1_4
.LBB1_5:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	addss	(%r9,%rdi,4), %xmm0
	movss	%xmm0, (%r9,%rdi,4)
	leaq	1(%rdi), %r11
	movl	%r10d, %ebx
	movq	%r11, %rdi
	cmpq	%rax, %r11
	jne	.LBB1_2
# %bb.6:
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
.LBB1_7:                                # %._crit_edge26
	retq
.Lfunc_end1:
	.size	_Z12cpu_multiplyiPKiS0_PKfS2_Pf, .Lfunc_end1-_Z12cpu_multiplyiPKiS0_PKfS2_Pf
	.cfi_endproc
                                        # -- End function
	.globl	_Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf # -- Begin function _Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf
	.type	_Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf,@function
_Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf: # @_Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf
	.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	4(%rsp), %rax
	movl	%edi, (%rax)
	leaq	56(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	32(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	24(%rsp), %r8
	movq	%r9, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf, %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_end2:
	.size	_Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf, .Lfunc_end2-_Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf
	.cfi_endproc
                                        # -- End function
	.globl	_Z37__device_stub__vector_multiply_unrolliPKiS0_PKfS2_Pf # -- Begin function _Z37__device_stub__vector_multiply_unrolliPKiS0_PKfS2_Pf
	.type	_Z37__device_stub__vector_multiply_unrolliPKiS0_PKfS2_Pf,@function
_Z37__device_stub__vector_multiply_unrolliPKiS0_PKfS2_Pf: # @_Z37__device_stub__vector_multiply_unrolliPKiS0_PKfS2_Pf
	.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	4(%rsp), %rax
	movl	%edi, (%rax)
	leaq	56(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	32(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	24(%rsp), %r8
	movq	%r9, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf, %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_end3:
	.size	_Z37__device_stub__vector_multiply_unrolliPKiS0_PKfS2_Pf, .Lfunc_end3-_Z37__device_stub__vector_multiply_unrolliPKiS0_PKfS2_Pf
	.cfi_endproc
                                        # -- End function
	.globl	_Z37__device_stub__vector_multiply_sharediPKiS0_PKfS2_Pf # -- Begin function _Z37__device_stub__vector_multiply_sharediPKiS0_PKfS2_Pf
	.type	_Z37__device_stub__vector_multiply_sharediPKiS0_PKfS2_Pf,@function
_Z37__device_stub__vector_multiply_sharediPKiS0_PKfS2_Pf: # @_Z37__device_stub__vector_multiply_sharediPKiS0_PKfS2_Pf
	.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	4(%rsp), %rax
	movl	%edi, (%rax)
	leaq	56(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	32(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	24(%rsp), %r8
	movq	%r9, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z22vector_multiply_sharediPKiS0_PKfS2_Pf, %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_end4:
	.size	_Z37__device_stub__vector_multiply_sharediPKiS0_PKfS2_Pf, .Lfunc_end4-_Z37__device_stub__vector_multiply_sharediPKiS0_PKfS2_Pf
	.cfi_endproc
                                        # -- End function
	.globl	_Z37__device_stub__vector_multiply_strideiPKiS0_PKfS2_Pf # -- Begin function _Z37__device_stub__vector_multiply_strideiPKiS0_PKfS2_Pf
	.type	_Z37__device_stub__vector_multiply_strideiPKiS0_PKfS2_Pf,@function
_Z37__device_stub__vector_multiply_strideiPKiS0_PKfS2_Pf: # @_Z37__device_stub__vector_multiply_strideiPKiS0_PKfS2_Pf
	.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	4(%rsp), %rax
	movl	%edi, (%rax)
	leaq	56(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	32(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	24(%rsp), %r8
	movq	%r9, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z22vector_multiply_strideiPKiS0_PKfS2_Pf, %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_end5:
	.size	_Z37__device_stub__vector_multiply_strideiPKiS0_PKfS2_Pf, .Lfunc_end5-_Z37__device_stub__vector_multiply_strideiPKiS0_PKfS2_Pf
	.cfi_endproc
                                        # -- End function
	.globl	_Z46__device_stub__vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf # -- Begin function _Z46__device_stub__vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
	.type	_Z46__device_stub__vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf,@function
_Z46__device_stub__vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf: # @_Z46__device_stub__vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
	.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	4(%rsp), %rax
	movl	%edi, (%rax)
	leaq	56(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	32(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	24(%rsp), %r8
	movq	%r9, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf, %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_end6:
	.size	_Z46__device_stub__vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf, .Lfunc_end6-_Z46__device_stub__vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI7_0:
	.long	0x3c800000                      # float 0.015625
.LCPI7_1:
	.long	0x00000000                      # float 0
	.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	$168, %rsp
	.cfi_def_cfa_offset 224
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	cmpl	$6, %edi
	jne	.LBB7_1
# %bb.2:
	movq	%rsi, %rbx
	movq	8(%rsi), %rdi
	callq	atoi
	movl	%eax, 48(%rsp)                  # 4-byte Spill
	movq	16(%rbx), %rdi
	callq	atoi
	movl	%eax, %r12d
	movq	24(%rbx), %rdi
	callq	atoi
	movl	%eax, %r13d
	movq	32(%rbx), %r14
	movq	40(%rbx), %rdi
	callq	atoi
                                        # kill: def $eax killed $eax def $rax
	movq	%rax, 136(%rsp)                 # 8-byte Spill
	leaq	120(%rsp), %rdi
	leaq	112(%rsp), %rsi
	leaq	104(%rsp), %rdx
	leaq	164(%rsp), %rbx
	leaq	92(%rsp), %r9
	movq	%r14, %rcx
	movq	%rbx, %r8
	callq	_Z11read_matrixPPiS0_PPfPcS_S_
	movslq	(%rbx), %rbp
	leaq	(,%rbp,4), %rdi
	movq	%rdi, 96(%rsp)                  # 8-byte Spill
	callq	malloc
	movq	%rax, %rbx
	movl	$4, %esi
	movq	%rbp, %rdi
	callq	calloc
	movq	%rax, 128(%rsp)                 # 8-byte Spill
	movl	$4, %esi
	movq	%rbp, %rdi
	callq	calloc
	movq	%rax, %r14
	movl	%ebp, %r15d
	testq	%rbp, %rbp
	jle	.LBB7_18
# %bb.3:                                # %.lr.ph
	cvtsi2ssl	48(%rsp), %xmm0         # 4-byte Folded Reload
	xorl	%eax, %eax
.LBB7_4:                                # =>This Inner Loop Header: Depth=1
	movss	%xmm0, (%rbx,%rax,4)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB7_4
# %bb.5:                                # %._crit_edge
	cmpl	$1, %r13d
	jne	.LBB7_6
# %bb.20:
	movq	stdout(%rip), %rcx
	movl	$.L.str.6, %edi
	movl	$28, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	testl	%r15d, %r15d
	jle	.LBB7_21
# %bb.24:                               # %.lr.ph265
	movl	%r12d, 44(%rsp)                 # 4-byte Spill
	movq	%r15, 48(%rsp)                  # 8-byte Spill
	movq	120(%rsp), %rbp
	movq	112(%rsp), %r12
	movq	104(%rsp), %r15
	movl	(%rbp), %eax
	xorl	%r13d, %r13d
	movq	%r14, 72(%rsp)                  # 8-byte Spill
.LBB7_25:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_27 Depth 2
	movl	4(%rbp,%r13,4), %ecx
	incq	%r13
	cmpl	%ecx, %eax
	jge	.LBB7_22
# %bb.26:                               # %.lr.ph262.preheader
                                        #   in Loop: Header=BB7_25 Depth=1
	movslq	%eax, %r14
.LBB7_27:                               # %.lr.ph262
                                        #   Parent Loop BB7_25 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	stdout(%rip), %rdi
	movl	(%r12,%r14,4), %ecx
	incl	%ecx
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r15,%r14,4), %xmm0
	movl	$.L.str.7, %esi
	movl	%r13d, %edx
	movb	$1, %al
	callq	fprintf
	incq	%r14
	movslq	(%rbp,%r13,4), %rcx
	cmpq	%rcx, %r14
	jl	.LBB7_27
# %bb.28:                               #   in Loop: Header=BB7_25 Depth=1
	movq	72(%rsp), %r14                  # 8-byte Reload
.LBB7_22:                               # %.loopexit
                                        #   in Loop: Header=BB7_25 Depth=1
	movl	%ecx, %eax
	cmpq	48(%rsp), %r13                  # 8-byte Folded Reload
	jne	.LBB7_25
# %bb.23:
	movb	$1, %bpl
	movq	48(%rsp), %r15                  # 8-byte Reload
	movl	44(%rsp), %r12d                 # 4-byte Reload
	jmp	.LBB7_7
.LBB7_1:
	movl	$.L.str.5, %edi
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB7_96
.LBB7_18:                               # %._crit_edge.thread
	cmpl	$1, %r13d
	jne	.LBB7_6
# %bb.19:                               # %.thread
	movq	stdout(%rip), %rcx
	movl	$.L.str.6, %edi
	movl	$28, %esi
	movl	$1, %edx
	callq	fwrite@PLT
.LBB7_21:
	movb	$1, %bpl
	jmp	.LBB7_7
.LBB7_6:
	xorl	%ebp, %ebp
.LBB7_7:                                # %.loopexit258
	testl	%r12d, %r12d
	jle	.LBB7_16
# %bb.8:                                # %.preheader.lr.ph
	movq	120(%rsp), %rax
	movq	104(%rsp), %rcx
	xorl	%edx, %edx
	movq	112(%rsp), %rsi
.LBB7_9:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_11 Depth 2
                                        #       Child Loop BB7_13 Depth 3
	testl	%r15d, %r15d
	jle	.LBB7_15
# %bb.10:                               # %.lr.ph273.preheader
                                        #   in Loop: Header=BB7_9 Depth=1
	movl	(%rax), %r10d
	xorl	%edi, %edi
.LBB7_11:                               # %.lr.ph273
                                        #   Parent Loop BB7_9 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB7_13 Depth 3
	movl	4(%rax,%rdi,4), %r8d
	xorps	%xmm0, %xmm0
	cmpl	%r8d, %r10d
	jge	.LBB7_14
# %bb.12:                               # %.lr.ph269.preheader
                                        #   in Loop: Header=BB7_11 Depth=2
	movslq	%r8d, %r9
	movslq	%r10d, %r10
.LBB7_13:                               # %.lr.ph269
                                        #   Parent Loop BB7_9 Depth=1
                                        #     Parent Loop BB7_11 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%rcx,%r10,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movslq	(%rsi,%r10,4), %r11
	mulss	(%rbx,%r11,4), %xmm1
	addss	%xmm1, %xmm0
	incq	%r10
	cmpq	%r10, %r9
	jne	.LBB7_13
.LBB7_14:                               # %._crit_edge270
                                        #   in Loop: Header=BB7_11 Depth=2
	addss	(%r14,%rdi,4), %xmm0
	movss	%xmm0, (%r14,%rdi,4)
	leaq	1(%rdi), %r9
	movl	%r8d, %r10d
	movq	%r9, %rdi
	cmpq	%r15, %r9
	jne	.LBB7_11
.LBB7_15:                               # %._crit_edge274
                                        #   in Loop: Header=BB7_9 Depth=1
	incl	%edx
	cmpl	%r12d, %edx
	jne	.LBB7_9
.LBB7_16:                               # %._crit_edge276
	movl	%ebp, 44(%rsp)                  # 4-byte Spill
	leaq	80(%rsp), %rdi
	callq	hipEventCreate
	leaq	8(%rsp), %rdi
	callq	hipEventCreate
	leaq	152(%rsp), %rdi
	callq	hipEventCreate
	leaq	144(%rsp), %rdi
	callq	hipEventCreate
	movl	$0, 68(%rsp)
	movq	136(%rsp), %rax                 # 8-byte Reload
	decl	%eax
	cmpl	$5, %eax
	ja	.LBB7_78
# %bb.17:                               # %._crit_edge276
	movq	96(%rsp), %r14                  # 8-byte Reload
	jmpq	*.LJTI7_0(,%rax,8)
.LBB7_29:
	leaq	56(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movslq	92(%rsp), %r13
	shlq	$2, %r13
	leaq	32(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	%rsp, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	(%rbp), %rdi
	movq	120(%rsp), %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	movq	112(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %rax
	movq	(%rax), %rdi
	movq	104(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	80(%rsp), %rdi
	xorl	%ebp, %ebp
	xorl	%esi, %esi
	callq	hipEventRecord
	testl	%r12d, %r12d
	jle	.LBB7_86
# %bb.30:                               # %.lr.ph323
	cvtsi2ss	%r15d, %xmm0
	movabsq	$4294967296, %r14               # imm = 0x100000000
	mulss	.LCPI7_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rax
	movl	%eax, %eax
	btsq	$32, %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	addq	$64, %r14
	movq	%r14, 48(%rsp)                  # 8-byte Spill
	movq	96(%rsp), %r14                  # 8-byte Reload
	movq	128(%rsp), %r13                 # 8-byte Reload
.LBB7_31:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_35 Depth 2
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rsp), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_33
# %bb.32:                               #   in Loop: Header=BB7_31 Depth=1
	movq	56(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rcx
	movq	16(%rsp), %r8
	movq	(%rsp), %r9
	movl	%r15d, %edi
	callq	_Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf
.LBB7_33:                               #   in Loop: Header=BB7_31 Depth=1
	movq	(%rsp), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r15d, %r15d
	jle	.LBB7_36
# %bb.34:                               # %.lr.ph319.preheader
                                        #   in Loop: Header=BB7_31 Depth=1
	xorl	%eax, %eax
.LBB7_35:                               # %.lr.ph319
                                        #   Parent Loop BB7_31 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r13,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rbx,%rax,4)
	movl	$0, (%r13,%rax,4)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB7_35
.LBB7_36:                               # %._crit_edge320
                                        #   in Loop: Header=BB7_31 Depth=1
	incl	%ebp
	cmpl	%r12d, %ebp
	jne	.LBB7_31
	jmp	.LBB7_86
.LBB7_62:
	leaq	56(%rsp), %rdi
	xorl	%ebp, %ebp
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	movslq	92(%rsp), %r13
	shlq	$2, %r13
	leaq	32(%rsp), %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	movq	%rsp, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	56(%rsp), %rax
	movq	(%rax), %rdi
	movq	120(%rsp), %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	movq	112(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %rax
	movq	(%rax), %rdi
	movq	104(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	80(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	testl	%r12d, %r12d
	jle	.LBB7_86
# %bb.63:                               # %.lr.ph291
	cvtsi2ss	%r15d, %xmm0
	movabsq	$4294967296, %r14               # imm = 0x100000000
	mulss	.LCPI7_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rax
	movl	%eax, %eax
	btsq	$32, %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	addq	$64, %r14
	movq	%r14, 48(%rsp)                  # 8-byte Spill
	movq	96(%rsp), %r14                  # 8-byte Reload
	movq	128(%rsp), %r13                 # 8-byte Reload
.LBB7_64:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_68 Depth 2
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rsp), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_66
# %bb.65:                               #   in Loop: Header=BB7_64 Depth=1
	movq	56(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rcx
	movq	16(%rsp), %r8
	movq	(%rsp), %r9
	movl	%r15d, %edi
	callq	_Z37__device_stub__vector_multiply_unrolliPKiS0_PKfS2_Pf
.LBB7_66:                               #   in Loop: Header=BB7_64 Depth=1
	movq	(%rsp), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r15d, %r15d
	jle	.LBB7_69
# %bb.67:                               # %.lr.ph287.preheader
                                        #   in Loop: Header=BB7_64 Depth=1
	xorl	%eax, %eax
.LBB7_68:                               # %.lr.ph287
                                        #   Parent Loop BB7_64 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r13,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rbx,%rax,4)
	movl	$0, (%r13,%rax,4)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB7_68
.LBB7_69:                               # %._crit_edge288
                                        #   in Loop: Header=BB7_64 Depth=1
	incl	%ebp
	cmpl	%r12d, %ebp
	jne	.LBB7_64
	jmp	.LBB7_86
.LBB7_45:
	leaq	56(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movslq	92(%rsp), %r13
	shlq	$2, %r13
	leaq	32(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	%rsp, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	(%rbp), %rdi
	movq	120(%rsp), %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	movq	112(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %rax
	movq	(%rax), %rdi
	movq	104(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	80(%rsp), %rdi
	xorl	%ebp, %ebp
	xorl	%esi, %esi
	callq	hipEventRecord
	testl	%r12d, %r12d
	jle	.LBB7_86
# %bb.46:                               # %.lr.ph307
	cvtsi2ss	%r15d, %xmm0
	movabsq	$4294967296, %r14               # imm = 0x100000000
	mulss	.LCPI7_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rax
	movl	%eax, %eax
	btsq	$32, %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	addq	$64, %r14
	movq	%r14, 48(%rsp)                  # 8-byte Spill
	movq	96(%rsp), %r14                  # 8-byte Reload
	movq	128(%rsp), %r13                 # 8-byte Reload
.LBB7_47:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_51 Depth 2
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rsp), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_49
# %bb.48:                               #   in Loop: Header=BB7_47 Depth=1
	movq	56(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rcx
	movq	16(%rsp), %r8
	movq	(%rsp), %r9
	movl	%r15d, %edi
	callq	_Z37__device_stub__vector_multiply_unrolliPKiS0_PKfS2_Pf
.LBB7_49:                               #   in Loop: Header=BB7_47 Depth=1
	movq	(%rsp), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r15d, %r15d
	jle	.LBB7_52
# %bb.50:                               # %.lr.ph303.preheader
                                        #   in Loop: Header=BB7_47 Depth=1
	xorl	%eax, %eax
.LBB7_51:                               # %.lr.ph303
                                        #   Parent Loop BB7_47 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r13,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rbx,%rax,4)
	movl	$0, (%r13,%rax,4)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB7_51
.LBB7_52:                               # %._crit_edge304
                                        #   in Loop: Header=BB7_47 Depth=1
	incl	%ebp
	cmpl	%r12d, %ebp
	jne	.LBB7_47
	jmp	.LBB7_86
.LBB7_53:
	leaq	56(%rsp), %rdi
	xorl	%ebp, %ebp
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	movslq	92(%rsp), %r13
	shlq	$2, %r13
	leaq	32(%rsp), %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	movq	%rsp, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	56(%rsp), %rax
	movq	(%rax), %rdi
	movq	120(%rsp), %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	movq	112(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %rax
	movq	(%rax), %rdi
	movq	104(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	80(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	testl	%r12d, %r12d
	jle	.LBB7_61
# %bb.54:                               # %.lr.ph299
	cvtsi2ss	%r15d, %xmm0
	movabsq	$4294967296, %r14               # imm = 0x100000000
	mulss	.LCPI7_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rax
	movl	%eax, %eax
	btsq	$32, %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	addq	$64, %r14
	movq	%r14, 48(%rsp)                  # 8-byte Spill
	movq	96(%rsp), %r14                  # 8-byte Reload
	movq	128(%rsp), %r13                 # 8-byte Reload
.LBB7_55:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_59 Depth 2
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rsp), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_57
# %bb.56:                               #   in Loop: Header=BB7_55 Depth=1
	movq	56(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rcx
	movq	16(%rsp), %r8
	movq	(%rsp), %r9
	movl	%r15d, %edi
	callq	_Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf
.LBB7_57:                               #   in Loop: Header=BB7_55 Depth=1
	movq	(%rsp), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r15d, %r15d
	jle	.LBB7_60
# %bb.58:                               # %.lr.ph295.preheader
                                        #   in Loop: Header=BB7_55 Depth=1
	xorl	%eax, %eax
.LBB7_59:                               # %.lr.ph295
                                        #   Parent Loop BB7_55 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r13,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rbx,%rax,4)
	movl	$0, (%r13,%rax,4)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB7_59
.LBB7_60:                               # %._crit_edge296
                                        #   in Loop: Header=BB7_55 Depth=1
	incl	%ebp
	cmpl	%r12d, %ebp
	jne	.LBB7_55
.LBB7_61:                               # %._crit_edge300
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	leaq	68(%rsp), %rdi
	movl	$0, (%rdi)
	movq	80(%rsp), %rsi
	movq	8(%rsp), %rdx
	callq	hipEventElapsedTime
	movq	152(%rsp), %rdi
	callq	hipEventDestroy
	movq	144(%rsp), %rdi
	callq	hipEventDestroy
	jmp	.LBB7_87
.LBB7_37:
	leaq	56(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movslq	92(%rsp), %r13
	shlq	$2, %r13
	leaq	32(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	%rsp, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	(%rbp), %rdi
	movq	120(%rsp), %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	movq	112(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %rax
	movq	(%rax), %rdi
	movq	104(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	80(%rsp), %rdi
	xorl	%ebp, %ebp
	xorl	%esi, %esi
	callq	hipEventRecord
	testl	%r12d, %r12d
	jle	.LBB7_86
# %bb.38:                               # %.lr.ph315
	cvtsi2ss	%r15d, %xmm0
	movabsq	$4294967296, %r14               # imm = 0x100000000
	mulss	.LCPI7_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rax
	movl	%eax, %eax
	btsq	$32, %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	addq	$64, %r14
	movq	%r14, 48(%rsp)                  # 8-byte Spill
	movq	96(%rsp), %r14                  # 8-byte Reload
	movq	128(%rsp), %r13                 # 8-byte Reload
.LBB7_39:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_43 Depth 2
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rsp), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_41
# %bb.40:                               #   in Loop: Header=BB7_39 Depth=1
	movq	56(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rcx
	movq	16(%rsp), %r8
	movq	(%rsp), %r9
	movl	%r15d, %edi
	callq	_Z37__device_stub__vector_multiply_strideiPKiS0_PKfS2_Pf
.LBB7_41:                               #   in Loop: Header=BB7_39 Depth=1
	movq	(%rsp), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r15d, %r15d
	jle	.LBB7_44
# %bb.42:                               # %.lr.ph311.preheader
                                        #   in Loop: Header=BB7_39 Depth=1
	xorl	%eax, %eax
.LBB7_43:                               # %.lr.ph311
                                        #   Parent Loop BB7_39 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r13,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rbx,%rax,4)
	movl	$0, (%r13,%rax,4)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB7_43
.LBB7_44:                               # %._crit_edge312
                                        #   in Loop: Header=BB7_39 Depth=1
	incl	%ebp
	cmpl	%r12d, %ebp
	jne	.LBB7_39
	jmp	.LBB7_86
.LBB7_70:
	leaq	56(%rsp), %rdi
	xorl	%ebp, %ebp
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	movslq	92(%rsp), %r13
	shlq	$2, %r13
	leaq	32(%rsp), %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	movq	%rsp, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	56(%rsp), %rax
	movq	(%rax), %rdi
	movq	120(%rsp), %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	movq	112(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %rax
	movq	(%rax), %rdi
	movq	104(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	80(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	testl	%r12d, %r12d
	jle	.LBB7_86
# %bb.71:                               # %.lr.ph283
	cvtsi2ss	%r15d, %xmm0
	movabsq	$4294967296, %r14               # imm = 0x100000000
	mulss	.LCPI7_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rax
	movl	%eax, %eax
	btsq	$32, %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	addq	$64, %r14
	movq	%r14, 48(%rsp)                  # 8-byte Spill
	movq	96(%rsp), %r14                  # 8-byte Reload
	movq	128(%rsp), %r13                 # 8-byte Reload
.LBB7_72:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_76 Depth 2
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rsp), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_74
# %bb.73:                               #   in Loop: Header=BB7_72 Depth=1
	movq	56(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rcx
	movq	16(%rsp), %r8
	movq	(%rsp), %r9
	movl	%r15d, %edi
	callq	_Z37__device_stub__vector_multiply_sharediPKiS0_PKfS2_Pf
.LBB7_74:                               #   in Loop: Header=BB7_72 Depth=1
	movq	(%rsp), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r15d, %r15d
	jle	.LBB7_77
# %bb.75:                               # %.lr.ph279.preheader
                                        #   in Loop: Header=BB7_72 Depth=1
	xorl	%eax, %eax
.LBB7_76:                               # %.lr.ph279
                                        #   Parent Loop BB7_72 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r13,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rbx,%rax,4)
	movl	$0, (%r13,%rax,4)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB7_76
.LBB7_77:                               # %._crit_edge280
                                        #   in Loop: Header=BB7_72 Depth=1
	incl	%ebp
	cmpl	%r12d, %ebp
	jne	.LBB7_72
	jmp	.LBB7_86
.LBB7_78:
	leaq	56(%rsp), %rbp
	movq	%rbp, %rdi
	movq	96(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rsi
	callq	hipMalloc
	movslq	92(%rsp), %r13
	shlq	$2, %r13
	leaq	32(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	%rsp, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	(%rbp), %rdi
	movq	120(%rsp), %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	movq	112(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %rax
	movq	(%rax), %rdi
	movq	104(%rsp), %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	80(%rsp), %rdi
	xorl	%ebp, %ebp
	xorl	%esi, %esi
	callq	hipEventRecord
	testl	%r12d, %r12d
	jle	.LBB7_86
# %bb.79:                               # %.lr.ph331
	cvtsi2ss	%r15d, %xmm0
	movabsq	$4294967296, %r14               # imm = 0x100000000
	mulss	.LCPI7_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rax
	movl	%eax, %eax
	btsq	$32, %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	addq	$64, %r14
	movq	%r14, 48(%rsp)                  # 8-byte Spill
	movq	96(%rsp), %r14                  # 8-byte Reload
	movq	128(%rsp), %r13                 # 8-byte Reload
.LBB7_80:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_84 Depth 2
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rsp), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_82
# %bb.81:                               #   in Loop: Header=BB7_80 Depth=1
	movq	56(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rcx
	movq	16(%rsp), %r8
	movq	(%rsp), %r9
	movl	%r15d, %edi
	callq	_Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf
.LBB7_82:                               #   in Loop: Header=BB7_80 Depth=1
	movq	(%rsp), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r15d, %r15d
	jle	.LBB7_85
# %bb.83:                               # %.lr.ph327.preheader
                                        #   in Loop: Header=BB7_80 Depth=1
	xorl	%eax, %eax
.LBB7_84:                               # %.lr.ph327
                                        #   Parent Loop BB7_80 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r13,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rbx,%rax,4)
	movl	$0, (%r13,%rax,4)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB7_84
.LBB7_85:                               # %._crit_edge328
                                        #   in Loop: Header=BB7_80 Depth=1
	incl	%ebp
	cmpl	%r12d, %ebp
	jne	.LBB7_80
.LBB7_86:                               # %._crit_edge332
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	leaq	68(%rsp), %rdi
	movl	$0, (%rdi)
	movq	80(%rsp), %rsi
	movq	8(%rsp), %rdx
	callq	hipEventElapsedTime
.LBB7_87:
	movl	44(%rsp), %eax                  # 4-byte Reload
	testb	%al, %al
	je	.LBB7_95
# %bb.88:
	movq	stdout(%rip), %rcx
	movl	$.L.str.8, %edi
	movl	$25, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	testl	%r15d, %r15d
	jle	.LBB7_89
# %bb.90:                               # %.lr.ph336.preheader
	xorl	%r14d, %r14d
	xorl	%ebp, %ebp
.LBB7_91:                               # %.lr.ph336
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rbx,%r14,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	ucomiss	.LCPI7_1(%rip), %xmm0
	jne	.LBB7_92
	jnp	.LBB7_93
.LBB7_92:                               #   in Loop: Header=BB7_91 Depth=1
	movq	stdout(%rip), %rdi
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.9, %esi
	movb	$1, %al
	callq	fprintf
	incl	%ebp
.LBB7_93:                               #   in Loop: Header=BB7_91 Depth=1
	incq	%r14
	cmpq	%r14, %r15
	jne	.LBB7_91
	jmp	.LBB7_94
.LBB7_89:
	xorl	%ebp, %ebp
.LBB7_94:                               # %._crit_edge337
	movq	stdout(%rip), %rdi
	movl	$.L.str.10, %esi
	movl	%ebp, %edx
	xorl	%eax, %eax
	callq	fprintf
.LBB7_95:
	movq	stdout(%rip), %rdi
	xorps	%xmm0, %xmm0
	cvtss2sd	68(%rsp), %xmm0
	movl	$.L.str.11, %esi
	movb	$1, %al
	callq	fprintf
	movq	56(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	(%rsp), %rdi
	callq	hipFree
	movq	80(%rsp), %rdi
	callq	hipEventDestroy
	movq	8(%rsp), %rdi
	callq	hipEventDestroy
.LBB7_96:
	xorl	%eax, %eax
	addq	$168, %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_end7:
	.size	main, .Lfunc_end7-main
	.cfi_endproc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.LJTI7_0:
	.quad	.LBB7_29
	.quad	.LBB7_37
	.quad	.LBB7_45
	.quad	.LBB7_53
	.quad	.LBB7_62
	.quad	.LBB7_70
                                        # -- End function
	.text
	.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	.LBB8_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB8_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf, %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	$_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z22vector_multiply_sharediPKiS0_PKfS2_Pf, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z22vector_multiply_strideiPKiS0_PKfS2_Pf, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %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_end8:
	.size	__hip_module_ctor, .Lfunc_end8-__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	.LBB9_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
.LBB9_2:
	retq
.Lfunc_end9:
	.size	__hip_module_dtor, .Lfunc_end9-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"r+"
	.size	.L.str, 3

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%d %d %d\n"
	.size	.L.str.2, 10

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"%d %d %f\n"
	.size	.L.str.3, 10

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

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

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

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

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

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

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"PERFORMING SPMV ON MATRIX: \n"
	.size	.L.str.6, 29

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"%d %d %.10f\n"
	.size	.L.str.7, 13

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Calculated Vector Matrix\n"
	.size	.L.str.8, 26

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"%.10f\n"
	.size	.L.str.9, 7

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"count = %d\n"
	.size	.L.str.10, 12

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"time = %f\n"
	.size	.L.str.11, 11

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf"
	.size	.L__unnamed_1, 42

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf"
	.size	.L__unnamed_2, 42

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z22vector_multiply_sharediPKiS0_PKfS2_Pf"
	.size	.L__unnamed_3, 42

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z22vector_multiply_strideiPKiS0_PKfS2_Pf"
	.size	.L__unnamed_4, 42

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf"
	.size	.L__unnamed_5, 51

	.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.1,@object                 # @str.1
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr.1:
	.asciz	"No match."
	.size	.Lstr.1, 10

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"ERROR: file open failed"
	.size	.Lstr.2, 24

	.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 _Z37__device_stub__vector_multiply_unoptiiPKiS0_PKfS2_Pf
	.addrsig_sym _Z37__device_stub__vector_multiply_unrolliPKiS0_PKfS2_Pf
	.addrsig_sym _Z37__device_stub__vector_multiply_sharediPKiS0_PKfS2_Pf
	.addrsig_sym _Z37__device_stub__vector_multiply_strideiPKiS0_PKfS2_Pf
	.addrsig_sym _Z46__device_stub__vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf
	.addrsig_sym _Z22vector_multiply_unrolliPKiS0_PKfS2_Pf
	.addrsig_sym _Z22vector_multiply_sharediPKiS0_PKfS2_Pf
	.addrsig_sym _Z22vector_multiply_strideiPKiS0_PKfS2_Pf
	.addrsig_sym _Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf ; -- Begin function _Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf
	.globl	_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf
	.p2align	8
	.type	_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf,@function
_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf: ; @_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf
; %bb.0:
	s_clause 0x3
	s_load_b32 s10, s[0:1], 0x3c
	s_load_b32 s11, s[0:1], 0x0
	s_load_b64 s[8:9], s[0:1], 0x28
	s_load_b256 s[0:7], s[0:1], 0x8
                                        ; implicit-def: $vgpr8
	s_waitcnt lgkmcnt(0)
	s_and_b32 s10, s10, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s15, s10, v[0:1]
	s_mov_b32 s10, exec_lo
	v_ashrrev_i32_e32 v3, 31, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[2:3]
	v_cmpx_gt_i32_e64 s11, v2
	s_cbranch_execz .LBB0_6
; %bb.1:
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v2, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v1, vcc_lo
	v_mov_b32_e32 v8, 0
	s_mov_b32 s1, exec_lo
	global_load_b64 v[2:3], v[2:3], off
	s_waitcnt vmcnt(0)
	v_cmpx_lt_i32_e64 v2, v3
	s_cbranch_execz .LBB0_5
; %bb.2:                                ; %.lr.ph.preheader
	v_ashrrev_i32_e32 v5, 31, v2
	v_mov_b32_e32 v4, v2
	v_mov_b32_e32 v8, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[6:7], 2, v[4:5]
	v_add_co_u32 v4, vcc_lo, s4, v6
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v7, vcc_lo
	v_add_co_u32 v6, vcc_lo, s2, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s3, v7, vcc_lo
	s_mov_b32 s2, 0
.LBB0_3:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b32 v9, v[6:7], off
	v_add_nc_u32_e32 v2, 1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_i32_e64 s0, v2, v3
	s_or_b32 s2, s0, s2
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v10, 31, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[9:10], 2, v[9:10]
	v_add_co_u32 v9, vcc_lo, s6, v9
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v10, vcc_lo, s7, v10, vcc_lo
	global_load_b32 v11, v[4:5], off
	global_load_b32 v9, v[9:10], off
	v_add_co_u32 v4, vcc_lo, v4, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	v_add_co_u32 v6, vcc_lo, v6, 4
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v8, v11, v9
	s_and_not1_b32 exec_lo, exec_lo, s2
	s_cbranch_execnz .LBB0_3
; %bb.4:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s2
.LBB0_5:                                ; %Flow47
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s1
.LBB0_6:                                ; %.loopexit
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_or_b32 exec_lo, exec_lo, s10
	v_add_co_u32 v0, vcc_lo, s8, v0
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v1, vcc_lo
	global_load_b32 v2, v[0:1], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v2, v8, v2
	global_store_b32 v[0:1], v2, off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 12
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf, .Lfunc_end0-_Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 388
; NumSgprs: 18
; NumVgprs: 12
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 12
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf ; -- Begin function _Z22vector_multiply_unrolliPKiS0_PKfS2_Pf
	.globl	_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf
	.p2align	8
	.type	_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf,@function
_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf: ; @_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf
; %bb.0:                                ; %._crit_edge
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z22vector_multiply_unrolliPKiS0_PKfS2_Pf
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 48
		.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 1
		.amdhsa_next_free_sgpr 1
		.amdhsa_reserve_vcc 0
		.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	_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf, .Lfunc_end1-_Z22vector_multiply_unrolliPKiS0_PKfS2_Pf
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4
; NumSgprs: 0
; NumVgprs: 0
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 1
; NumVGPRsForWavesPerEU: 1
; 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	_Z22vector_multiply_sharediPKiS0_PKfS2_Pf ; -- Begin function _Z22vector_multiply_sharediPKiS0_PKfS2_Pf
	.globl	_Z22vector_multiply_sharediPKiS0_PKfS2_Pf
	.p2align	8
	.type	_Z22vector_multiply_sharediPKiS0_PKfS2_Pf,@function
_Z22vector_multiply_sharediPKiS0_PKfS2_Pf: ; @_Z22vector_multiply_sharediPKiS0_PKfS2_Pf
; %bb.0:
	s_clause 0x3
	s_load_b32 s10, s[0:1], 0x3c
	s_load_b32 s11, s[0:1], 0x0
	s_load_b64 s[8:9], s[0:1], 0x28
	s_load_b256 s[0:7], s[0:1], 0x8
	v_mov_b32_e32 v4, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s10, s10, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s15, s10, v[0:1]
	s_mov_b32 s10, exec_lo
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b32_e32 v8, 2, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_lshlrev_b64 v[0:1], 2, v[2:3]
	ds_store_b32 v8, v4
	v_cmpx_gt_i32_e64 s11, v2
	s_cbranch_execz .LBB2_5
; %bb.1:
	v_add_co_u32 v2, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v1, vcc_lo
	global_load_b64 v[2:3], v[2:3], off
	s_waitcnt vmcnt(0)
	v_cmp_lt_i32_e32 vcc_lo, v2, v3
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB2_5
; %bb.2:                                ; %.lr.ph.preheader
	v_ashrrev_i32_e32 v5, 31, v2
	v_dual_mov_b32 v4, v2 :: v_dual_mov_b32 v9, 0
	s_mov_b32 s1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[6:7], 2, v[4:5]
	v_add_co_u32 v4, vcc_lo, s4, v6
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v7, vcc_lo
	v_add_co_u32 v6, vcc_lo, s2, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s3, v7, vcc_lo
.LBB2_3:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b32 v10, v[6:7], off
	v_add_nc_u32_e32 v2, 1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_i32_e64 s0, v2, v3
	s_or_b32 s1, s0, s1
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v11, 31, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[10:11], 2, v[10:11]
	v_add_co_u32 v10, vcc_lo, s6, v10
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v11, vcc_lo, s7, v11, vcc_lo
	global_load_b32 v12, v[4:5], off
	global_load_b32 v10, v[10:11], off
	v_add_co_u32 v4, vcc_lo, v4, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	v_add_co_u32 v6, vcc_lo, v6, 4
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v9, v12, v10
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB2_3
; %bb.4:                                ; %..loopexit_crit_edge
	s_or_b32 exec_lo, exec_lo, s1
	ds_store_b32 v8, v9
.LBB2_5:                                ; %.loopexit
	s_or_b32 exec_lo, exec_lo, s10
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	ds_load_b32 v2, v8
	v_add_co_u32 v0, vcc_lo, s8, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v1, vcc_lo
	s_waitcnt lgkmcnt(0)
	global_store_b32 v[0:1], v2, off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z22vector_multiply_sharediPKiS0_PKfS2_Pf
		.amdhsa_group_segment_fixed_size 1024
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 13
		.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_end2:
	.size	_Z22vector_multiply_sharediPKiS0_PKfS2_Pf, .Lfunc_end2-_Z22vector_multiply_sharediPKiS0_PKfS2_Pf
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 396
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 1024 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z22vector_multiply_strideiPKiS0_PKfS2_Pf ; -- Begin function _Z22vector_multiply_strideiPKiS0_PKfS2_Pf
	.globl	_Z22vector_multiply_strideiPKiS0_PKfS2_Pf
	.p2align	8
	.type	_Z22vector_multiply_strideiPKiS0_PKfS2_Pf,@function
_Z22vector_multiply_strideiPKiS0_PKfS2_Pf: ; @_Z22vector_multiply_strideiPKiS0_PKfS2_Pf
; %bb.0:
	s_clause 0x3
	s_load_b32 s13, s[0:1], 0x3c
	s_load_b32 s12, s[0:1], 0x0
	s_load_b64 s[2:3], s[0:1], 0x28
	s_load_b256 s[4:11], s[0:1], 0x8
	s_add_u32 s0, s0, 48
	s_addc_u32 s1, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s14, s13, 0xffff
	s_mov_b32 s13, exec_lo
	v_mad_u64_u32 v[1:2], null, s15, s14, v[0:1]
                                        ; implicit-def: $vgpr0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s12, v1
	s_cbranch_execz .LBB3_8
; %bb.1:                                ; %.lr.ph30
	s_load_b32 s0, s[0:1], 0x0
	s_mov_b32 s1, 0
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s14, s0, s14
.LBB3_2:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB3_4 Depth 2
	v_ashrrev_i32_e32 v2, 31, v1
	v_mov_b32_e32 v0, 0
	s_mov_b32 s15, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	v_add_co_u32 v2, vcc_lo, s4, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	global_load_b64 v[2:3], v[2:3], off
	s_waitcnt vmcnt(0)
	v_cmpx_lt_i32_e64 v2, v3
	s_cbranch_execz .LBB3_6
; %bb.3:                                ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB3_2 Depth=1
	v_ashrrev_i32_e32 v5, 31, v2
	v_mov_b32_e32 v4, v2
	v_mov_b32_e32 v0, 0
	s_mov_b32 s16, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[6:7], 2, v[4:5]
	v_add_co_u32 v4, vcc_lo, s8, v6
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v5, vcc_lo, s9, v7, vcc_lo
	v_add_co_u32 v6, vcc_lo, s6, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s7, v7, vcc_lo
.LBB3_4:                                ; %.lr.ph
                                        ;   Parent Loop BB3_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_b32 v8, v[6:7], off
	v_add_nc_u32_e32 v2, 1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_i32_e64 s0, v2, v3
	s_or_b32 s16, s0, s16
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v9, 31, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[8:9], 2, v[8:9]
	v_add_co_u32 v8, vcc_lo, s10, v8
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v9, vcc_lo, s11, v9, vcc_lo
	global_load_b32 v10, v[4:5], off
	global_load_b32 v8, v[8:9], off
	v_add_co_u32 v4, vcc_lo, v4, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	v_add_co_u32 v6, vcc_lo, v6, 4
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v0, v10, v8
	s_and_not1_b32 exec_lo, exec_lo, s16
	s_cbranch_execnz .LBB3_4
; %bb.5:                                ; %Flow
                                        ;   in Loop: Header=BB3_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s16
.LBB3_6:                                ; %Flow60
                                        ;   in Loop: Header=BB3_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s15
	v_add_nc_u32_e32 v1, s14, v1
	v_cmp_le_i32_e32 vcc_lo, s12, v1
	s_or_b32 s1, vcc_lo, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB3_2
; %bb.7:                                ; %Flow61
	s_or_b32 exec_lo, exec_lo, s1
.LBB3_8:                                ; %Flow62
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s13
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, s2, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s3, v2, vcc_lo
	global_load_b32 v3, v[1:2], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v0, v0, v3
	global_store_b32 v[1:2], v0, off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z22vector_multiply_strideiPKiS0_PKfS2_Pf
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 11
		.amdhsa_next_free_sgpr 17
		.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_end3:
	.size	_Z22vector_multiply_strideiPKiS0_PKfS2_Pf, .Lfunc_end3-_Z22vector_multiply_strideiPKiS0_PKfS2_Pf
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 456
; NumSgprs: 19
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 19
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf ; -- Begin function _Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
	.globl	_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
	.p2align	8
	.type	_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf,@function
_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf: ; @_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
; %bb.0:
	s_clause 0x3
	s_load_b32 s13, s[0:1], 0x3c
	s_load_b32 s12, s[0:1], 0x0
	s_load_b64 s[2:3], s[0:1], 0x28
	s_load_b256 s[4:11], s[0:1], 0x8
	s_add_u32 s0, s0, 48
	s_addc_u32 s1, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s14, s13, 0xffff
	s_mov_b32 s13, exec_lo
	v_mad_u64_u32 v[1:2], null, s15, s14, v[0:1]
                                        ; implicit-def: $vgpr0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s12, v1
	s_cbranch_execz .LBB4_8
; %bb.1:                                ; %.lr.ph30
	s_load_b32 s0, s[0:1], 0x0
	s_mov_b32 s1, 0
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s14, s0, s14
.LBB4_2:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB4_4 Depth 2
	v_ashrrev_i32_e32 v2, 31, v1
	v_mov_b32_e32 v0, 0
	s_mov_b32 s15, exec_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	v_add_co_u32 v2, vcc_lo, s4, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	global_load_b64 v[2:3], v[2:3], off
	s_waitcnt vmcnt(0)
	v_cmpx_lt_i32_e64 v2, v3
	s_cbranch_execz .LBB4_6
; %bb.3:                                ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB4_2 Depth=1
	v_ashrrev_i32_e32 v5, 31, v2
	v_mov_b32_e32 v4, v2
	v_mov_b32_e32 v0, 0
	s_mov_b32 s16, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[6:7], 2, v[4:5]
	v_add_co_u32 v4, vcc_lo, s8, v6
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v5, vcc_lo, s9, v7, vcc_lo
	v_add_co_u32 v6, vcc_lo, s6, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s7, v7, vcc_lo
.LBB4_4:                                ; %.lr.ph
                                        ;   Parent Loop BB4_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_b32 v8, v[6:7], off
	v_add_nc_u32_e32 v2, 1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_i32_e64 s0, v2, v3
	s_or_b32 s16, s0, s16
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v9, 31, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[8:9], 2, v[8:9]
	v_add_co_u32 v8, vcc_lo, s10, v8
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v9, vcc_lo, s11, v9, vcc_lo
	global_load_b32 v10, v[4:5], off
	global_load_b32 v8, v[8:9], off
	v_add_co_u32 v4, vcc_lo, v4, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	v_add_co_u32 v6, vcc_lo, v6, 4
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v0, v10, v8
	s_and_not1_b32 exec_lo, exec_lo, s16
	s_cbranch_execnz .LBB4_4
; %bb.5:                                ; %Flow
                                        ;   in Loop: Header=BB4_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s16
.LBB4_6:                                ; %Flow60
                                        ;   in Loop: Header=BB4_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s15
	v_add_nc_u32_e32 v1, s14, v1
	v_cmp_le_i32_e32 vcc_lo, s12, v1
	s_or_b32 s1, vcc_lo, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB4_2
; %bb.7:                                ; %Flow61
	s_or_b32 exec_lo, exec_lo, s1
.LBB4_8:                                ; %Flow62
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s13
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, s2, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s3, v2, vcc_lo
	global_load_b32 v3, v[1:2], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v0, v0, v3
	global_store_b32 v[1:2], v0, off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 11
		.amdhsa_next_free_sgpr 17
		.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_end4:
	.size	_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf, .Lfunc_end4-_Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 456
; NumSgprs: 19
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 19
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.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:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z22vector_multiply_unoptiiPKiS0_PKfS2_Pf.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     12
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 48
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z22vector_multiply_unrolliPKiS0_PKfS2_Pf
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z22vector_multiply_unrolliPKiS0_PKfS2_Pf.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     0
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 1024
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z22vector_multiply_sharediPKiS0_PKfS2_Pf
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z22vector_multiply_sharediPKiS0_PKfS2_Pf.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z22vector_multiply_strideiPKiS0_PKfS2_Pf
    .private_segment_fixed_size: 0
    .sgpr_count:     19
    .sgpr_spill_count: 0
    .symbol:         _Z22vector_multiply_strideiPKiS0_PKfS2_Pf.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf
    .private_segment_fixed_size: 0
    .sgpr_count:     19
    .sgpr_spill_count: 0
    .symbol:         _Z31vector_multiply_stride_prefetchiPKiS0_PKfS2_Pf.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
