#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#define checkCudaError(o, l) _checkCudaError(o, l, __func__)
#define SHARED_MEMORY_BANKS 32
#define LOG_MEM_BANKS 5
#define CONFLICT_FREE_OFFSET(n) ((n) >> LOG_MEM_BANKS)
#include<limits.h>

long long int THREADS_PER_BLOCK = 512;		// This is the numver of threads per block used, and 512 gave the best results
long long int ELEMENTS_PER_BLOCK = THREADS_PER_BLOCK * 2;	// As each threads takes care of two elements so number of elements is twice of threads

float sequential_scan(long long int* output, long long int* input, long long int length,long long int operation);
float scan(long long int *output, long long int *input, long long int length,long long int operation);
void scanMultiBlock(long long int *output, long long int *input, long long int length,long long int operation,long long int identity);
void scanSingleBlock(long long int *device_output, long long int *device_input, long long int length, long long int operation,long long int identity);
void scanBlockSizedArray(long long int *output, long long int *input, long long int length, long long int operation,long long int identity);
void check(long long int* CPU_Vector,long long int* GPU_Vector, long long int start, long long int end);

__global__ void prescan_SingleBlock(long long int *output, long long int *input, long long int n, long long int nextPowerOfTwo, long long int operation, long long int identity);
__global__ void prescan_MultiBlock(long long int *output, long long int *input, long long int n, long long int* sums, long long int operation,long long int identity);
__global__ void add_two(long long int *output, long long int length, long long int *n1);
__global__ void add_three(long long int *output, long long int length, long long int *n1, long long int *n2);
__global__ void max_two(long long int *output, long long int length, long long int *n1);
__global__ void max_three(long long int *output, long long int length, long long int *n1, long long int *n2);
__global__ void min_two(long long int *output, long long int length, long long int *n1);
__global__ void min_three(long long int *output, long long int length, long long int *n1, long long int *n2);
__global__ void exc_to_inc(long long output, long long input,long long int operations);

void _checkCudaError(const char *message, cudaError_t err, const char *caller);
void printResult(const char* prefix, long long int result, float milliseconds);
void printArrayInFile (const char* prefix ,long long int Output[], long long int start, long long int end);



void Scan(long long int N, long long int Option, long long int operation, long long int printing) {
	
	time_t t;
	srand((unsigned)time(&t));
	long long int *in =(long long int *) malloc (sizeof(long long int) * (N+1));	//input array
	long long int *mod_input =(long long int *) malloc (sizeof(long long int) * (N+1));// modified input array incase of Subtraction being the operation
	
	
	if(Option == 1 )		// IF THE ARRAY NEEDS TO BE RANDOMLY GENERATED
	{

		printf("Generating Random Numbers...\n");
		in[0] = rand()%1000000;
		mod_input[0] = in[0];
		
		for (long long int i = 1; i < N; i++) 
		{
			in[i] = rand() % 1000000;
			mod_input[i] = -in[i];	
		}
		if(operation==4)
		{
			in[N] = LONG_LONG_MAX;
		}
		else if (operation==3)
		{
			in[N] = LONG_LONG_MIN;
		}
		else
		{
			in[N] = 0;
			mod_input[N] = 0;	
		
		}

		printf("Finished Generating Random Numbers...\n\n");
	}
	else					// IF THE ARRAY IS FED AS INPUT TO THE PROGRAM
	{
		printf("Please type the desired %lld values of the vector each seperated by an ENTER KEY or WHITESPACE\n",N);
		scanf("%lld",&in[0]);
		mod_input[0] = in[0];
		for (long long int i = 1; i < N; i++) 
		{
			scanf("%lld",&in[i]);
			mod_input[i] = -in[i];
		}
		if(operation==4)
		{
			in[N] = LONG_LONG_MAX;
		}
		else if (operation==3)
		{
			in[N] = LONG_LONG_MIN;
		}
		else
		{
			in[N] = 0;
			mod_input[N] = 0;	
		
		}
		printf("Finished Taking Input...\n\n");
	
	}

	
	
	
	if(printing)		//PRINTING THE OUTPUT ARRAY TO output.txt
	{	
		printf("Printing the Input Vector...\n");
		FILE* fp = fopen("output.txt", "w");		
		printArrayInFile("Original Array",in, 0 , N);
		fclose(fp);
		printf("Finished Printing the Input Vector \n");
	}

	long long int *output_CPU = (long long int *) malloc (sizeof(long long int) * (N+1));
	printf("Doing the sequential Exclusive scan...\n");
	float time_host = sequential_scan(output_CPU, in, (N+1), operation);
	printf("Finished the sequential Exclusive scan...\n\n");
	
	//Printing The Result and Time
	printResult("Host Time  ", output_CPU[N], time_host);
	if(printing)		//PRINTING THE OUTPUT ARRAY TO output.txt
	{	
		printf("Printing the Scanned Vector formed by the CPU...\n");
		printArrayInFile ("HOST RESULT", output_CPU, 1, N+1);
		printf("Finished Printing the Scanned Vector formed by the CPU\n\n");
		
	}
	
	
	// Parallel scan on GPU
	printf("Doing the Parallel Exclusive scan...\n");
	long long int *output_GPU = (long long int *) malloc (sizeof(long long int) * N);
	printf("Finished the Parallel Exclusive scan...\n");
	
	if(operation == 2)		// Special consideration for subtraction because the operation is not associative
	{

		float time_gpu = scan(output_GPU, mod_input, N+1, operation);
		printResult("GPU time ", output_GPU[N], time_gpu);
	}
	else				// for all the other operationators
	{
		float time_gpu = scan(output_GPU, in, N + 1, operation);
		printResult("GPU time ", output_GPU[N], time_gpu);
	}
	if(printing)
	{
		printf("Printing the Scanned Vector formed by the GPU...\n");
		printArrayInFile ("GPU RESULT", output_GPU,1, N + 1);
		printf("Finished Printing the Scanned Vector formed by the GPU\n\n");
		printf("Please look at the output.txt to see the scanned vectors and input vector\n");
	}

	// For checking correctness of solution
	check(output_CPU,output_GPU,1,N + 1);

	//clean up of all memory used up
	free(in);
	free(mod_input);
	//free(output_CPU);
	free(output_GPU);
	}

int main(){
	long long int N=0, options=0, operation=0;
	char printing = 0;
	
	printf("Please input a proper size of the array or vector\n");
	scanf("%lld",&N);
	if(N <= 0)
	{
		printf("Please input a proper number which is greater than zero for the size\n");
		printf("The application would terminate now\n");
		return 0;
	}

	printf("Please select one of the given options \n");
	printf("\t1)Randomize the Elements input array of size %lld\n", N);
	printf("\t2)Proived the Elements of input array of size %lld\n", N);
	printf("Type 1 or 2 depending upon the option you want to select\n");
	scanf("%lld", &options);
	printf("\n");
	if(options!=1&&options!=2)
	{
		printf("Please type either 1 or 2 only next time for selecting the Options\n");
		printf("The application would terminate now\n");
		return 0;
	}

	printf("Please select one of the given operations\n");
	printf("1)Addition\t2)Subtraction\t3)Maximum\t4)Minimum\n");
	printf("Type 1,2,3 or 4 depending upon the operation you want to select\n");
	scanf("%lld", &operation);
	printf("\n");
	if(operation!=1 && operation!=2 && operation!=3 && operation!=4)
	{
		printf("Please type either 1,2,3 OR 4 only next time for selecting the Operator\n");
		printf("The application would terminate now\n");
		return 0;
	}
	getchar();	// to eat the enter key;
	
	printf("Do you wish to print the input and scanned vector in an output.txt file?\n");
	printf("Type y for Yes or n for No\n");
	scanf("%c", &printing);
	printf("\n");

	if(printing!='y'&& printing!='n')
	{
		printf("Please type either character 'y' OR 'n' only next time for choosing to print or not the vectors\n");
		printf("The application would terminate now\n");
		return 0;
	}

	if(printing=='y')
	{
		Scan(N,options,operation,1);
	}
	else
	{
		Scan(N,options,operation,0);
	}
	
	return 0;}

float sequential_scan(long long int* output, long long int* input, long long int length, long long int operation) {
	struct timeval start, end;
    gettimeofday(&start, NULL);
	switch(operation)
	{
		case 1:
		{
			output[0] = 0; // since this is an exclusive scan
			output[1] = input[0]; 
			for (long long int j = 2; j < length; ++j)
			{
				output[j] = input[j - 1] + output[j - 1];
			}
		break;
		}
		case 2:
		{
			output[0] = 0; // since this is an exclusive scan
			output[1] = input[0]; 
			for (long long int j = 2; j < length; ++j)
			{
				output[j] = output[j - 1] - input[j - 1];
			}
		break;
		}
		case 3:
		{
			output[0] = LONG_LONG_MIN;
			output[1] = input[0];
			for (long long int j = 2; j < length; ++j)
			{
				if(input[j-1] > output[j - 1])
					output[j] = input[j-1];
				else
					output[j] = output[j-1];
			}
		break;
		}
		case 4:
		{
			
			output[0] = LONG_LONG_MAX;	//since in exclusive scan the first element is the identity of the operator, in this case the max 								//number possible
			output[1] = input[0];
			for (long long int j = 2; j < length; ++j)
			{
				if(input[j-1] < output[j - 1])
					output[j] = input[j-1];
				else
					output[j] = output[j-1];
			}
		break;
		}
	}
	 
    gettimeofday(&end, NULL);
	float seconds = (end.tv_sec  - start.tv_sec);
    float micros = ((seconds * 1000000)+ (end.tv_usec - start.tv_usec));
	return (float)(micros/1000);}

float scan(long long int *output, long long int *input, long long int length,long long int operation) {
	
	long long int *device_input,*device_output;
	long long int arraySize = length * sizeof(long long int);

	cudaMalloc((void **)&device_output, arraySize);
	cudaMalloc((void **)&device_input, arraySize);
	cudaMemcpy(device_output, output, arraySize, cudaMemcpyHostToDevice);
	cudaMemcpy(device_input, input, arraySize, cudaMemcpyHostToDevice);

	cudaEvent_t initial, final;
	cudaEventCreate(&initial);
	cudaEventCreate(&final);
	// starting the timer given in CUDA Library
	cudaEventRecord(initial);
	long long int identity = 0;
	if(operation==4)
	{
		identity = LONG_LONG_MAX;
	}
	else if (operation==3)
	{
			identity = LONG_LONG_MIN;
	}
	if (length <= ELEMENTS_PER_BLOCK) 
	{
		/*float elapsed = */ scanSingleBlock(device_output, device_input, length, operation, identity);
		//printf("The parallelizable part took %lf ms of time", elapsed);//needed for finding parallelizable part
	}
	else 
	{
		/*float elpased  = */scanMultiBlock(device_output, device_input, length, operation , identity);
		//printf("The parallelizable part took %lf ms of time", elapsed);	//needed for finding parallelizable part
	}

	// end timer
	cudaEventRecord(final);
	cudaEventSynchronize(final);
	float elapsedTime = 0;
	cudaEventElapsedTime(&elapsedTime, initial, final);

	cudaMemcpy(output, device_output, arraySize, cudaMemcpyDeviceToHost);

	//clean up
	cudaFree(device_input);
	cudaFree(device_output);
	cudaEventDestroy(final);
	cudaEventDestroy(initial);
	

	return elapsedTime;}

/*float*/  //needed return type for finding parallelizable part
void scanMultiBlock(long long int *device_output, long long int *device_input, long long int length,long long int operation, long long int identity) {
	long long int reminder = length % (ELEMENTS_PER_BLOCK);
	
	//float temp_time =0, elapsed_time = 0; //needed for finding parallelizable part
	if (reminder != 0) 
	{
		// perform a large scan on a compatible multiple of elements
		long long int blockMultiple = length - reminder;
		/*elapsed_time += */scanBlockSizedArray(device_output, device_input, blockMultiple,  operation, identity); // needed varaible for finding parallelizable part

		// scan the remaining elements and add the (inclusive) last element of the large scan to this
		long long int *startOfOutputArray = &(device_output[blockMultiple]);
		long long int *startOfInputArray = &(device_input[blockMultiple]);
		/*elapsed_time +=*/ scanSingleBlock(startOfOutputArray, startOfInputArray, reminder,  operation, identity);// needed varaible for finding parallelizable part
		/*
		// needed for finding parallelizable part 
		cudaEvent_t initial, final;
		cudaEventCreate(&initial);
		cudaEventCreate(&final);
		// starting the timer given in CUDA Library
		cudaEventRecord(initial);
		*/
		switch(operation)
		{
			case 1:
			{
				add_three<<<1, reminder>>>(startOfOutputArray, reminder, &(device_input[blockMultiple - 1]), &(device_output[blockMultiple - 1]));
				break;
			}
			case 2:
			{
				add_three<<<1, reminder>>>(startOfOutputArray, reminder, &(device_input[blockMultiple - 1]), &(device_output[blockMultiple - 1]));
				break;
			}
			case 3:
			{
				max_three<<<1, reminder>>>(startOfOutputArray, reminder, &(device_input[blockMultiple - 1]), &(device_output[blockMultiple - 1]));
				break;
			}
			
			case 4:
			{
				min_three<<<1, reminder>>>(startOfOutputArray, reminder, &(device_input[blockMultiple - 1]), &(device_output[blockMultiple - 1]));
				break;
			}
		}
		/*
		Needed for finding parallelizable part
		cudaEventRecord(final);
		cudaEventSynchronize(final);
		cudaEventElapsedTime(&temp_time, initial, final);
		elapsed_time += temp_time
		cudaFree(device_input);
		cudaFree(device_output);
		cudaEventDestroy(final);
		cudaEventDestroy(initial);
		return elapsed_time;
		*/

	}
	else 
	{
		// Both the comments are needed for finding parallelizable part 
		/*float elapsed_time = */ scanBlockSizedArray(device_output, device_input, length,  operation, identity);	
		/*return elapsed_time;*/
	}
}

/*float*/
void scanSingleBlock(long long int *device_output, long long int *device_input, long long int length,long long int operation, long long int identity) {

		long long int nextPowerOfTwo = 1;
		while (nextPowerOfTwo < length) 
		{
			nextPowerOfTwo *= 2;
		}
		/*
		Needed for finding parallelizable part
		float elapsed_time = 0;
		cudaEvent_t initial, final;
		cudaEventCreate(&initial);
		cudaEventCreate(&final);
		// starting the timer given in CUDA Library
		cudaEventRecord(initial);
		*/
		prescan_SingleBlock<<<1, (length + 1) / 2, 2 * nextPowerOfTwo * sizeof(long long int)>>>(device_output, device_input, length, nextPowerOfTwo, operation, identity);	
		/*
		Needed for finding parallelizable part
		
		cudaEventRecord(final);
		cudaEventSynchronize(final);
		cudaEventElapsedTime(&elapsed_time, initial, final);
		cudaFree(device_input);
		cudaFree(device_output);
		cudaEventDestroy(final);
		cudaEventDestroy(initial);
		return elapsed_time;
		*/
}

/*float*/
void scanBlockSizedArray(long long int *device_output, long long int *device_input, long long int length, long long int operation, long long int identity) {
	long long int num_blocks = length / ELEMENTS_PER_BLOCK;
	long long int sharedMemBlockSize = ELEMENTS_PER_BLOCK * sizeof(long long int);

	long long int *device_blocks, *device_inputcr;
	cudaMalloc((void **)&device_blocks, num_blocks * sizeof(long long int));
	cudaMalloc((void **)&device_inputcr, num_blocks * sizeof(long long int));
	/*
	Needed for finding parallelizable part	
	float elapsed_time = 0, temp_time;
	cudaEvent_t initial, final;
	cudaEventCreate(&initial);
	cudaEventCreate(&final);
	// starting the timer given in CUDA Library
	cudaEventRecord(initial);
	*/
	prescan_MultiBlock<<<num_blocks, THREADS_PER_BLOCK, 2*sharedMemBlockSize>>>(device_output, device_input, ELEMENTS_PER_BLOCK, device_blocks, operation, identity);
	/*
	Needed for finding parallelizable part

	cudaEventRecord(final);
	cudaEventSynchronize(final);
	cudaEventElapsedTime(&elapsed_time, initial, final);
	cudaFree(device_input);
	cudaFree(device_output);
	cudaEventDestroy(final);
	cudaEventDestroy(initial);
	*/
	if ((num_blocks + 1) / 2 < THREADS_PER_BLOCK) 
	{
		//Needed for finding parallelizable part
		/*elapsed_time+=*/scanSingleBlock(device_inputcr, device_blocks, num_blocks,  operation, identity);
	}
	else 
	{
		// Needed for finding parallelizable part
		/*elapsed_time+= */scanMultiBlock(device_inputcr, device_blocks, num_blocks,  operation, identity);
	}
	/*
	Needed for finding parallelizable part
	cudaEventCreate(&initial);
	cudaEventCreate(&final);
	// starting the timer given in CUDA Library
	cudaEventRecord(initial);
	*/
	switch(operation)
		{
			case 1:
			{
				add_two<<<num_blocks, ELEMENTS_PER_BLOCK>>>(device_output, ELEMENTS_PER_BLOCK, device_inputcr);
				break;
			}
			case 2:
			{
				add_two<<<num_blocks, ELEMENTS_PER_BLOCK>>>(device_output, ELEMENTS_PER_BLOCK, device_inputcr);
				break;
			}
			case 3:
			{
				max_two<<<num_blocks, ELEMENTS_PER_BLOCK>>>(device_output, ELEMENTS_PER_BLOCK, device_inputcr);
				break;
			}
			
			case 4:
			{
				min_two<<<num_blocks, ELEMENTS_PER_BLOCK>>>(device_output, ELEMENTS_PER_BLOCK, device_inputcr);
				break;
			}
		}
	/*
	Needed for finding parallelizable part
	
	cudaEventRecord(final);
	cudaEventSynchronize(final);
	cudaEventElapsedTime(&temp_time, initial, final);
	cudaFree(device_input);
	cudaFree(device_output);
	cudaEventDestroy(final);
	cudaEventDestroy(initial);
	elapsed_time +=  temp_time
	cudaFree(device_inputcr);
	cudaFree(device_blocks);
	return elapsed_time;
	*/
	}

__global__ void prescan_SingleBlock(long long int *output, long long int *input, long long int n, long long int nextPowerOfTwo, long long int operation, long long int identity)
{
	extern __shared__ long long int temp[];
	long long int threadID = threadIdx.x;
	long long int offset = 1;

	long long int index1 = threadID;
	long long int index2 = threadID + (n / 2);
	long long int bankOffsetB = CONFLICT_FREE_OFFSET(index2);
	long long int bankOffsetA = CONFLICT_FREE_OFFSET(index1);

	if (threadID >= n) {
		temp[index1 + bankOffsetA] = 0;
		temp[index2 + bankOffsetB] = 0;
	}

	else 
	{
			temp[index1 + bankOffsetA] = input[index1];
			temp[index2 + bankOffsetB] = input[index2];
	}


	for (long long int d = nextPowerOfTwo/2; d > 0; d= d/2) // Do the reduction by building a operation(like sum) tree in place
	{
		__syncthreads();
		
		if (threadID < d)
		{
			long long int index1 = offset * (2 * threadID + 1) - 1;
			long long int index2 = offset * (2 * threadID + 2) - 1;
			index1 += CONFLICT_FREE_OFFSET(index1);
			index2 += CONFLICT_FREE_OFFSET(index2);
			switch(operation)
			{
				case 1:
				{
					temp[index2] += temp[index1];
					break;
				}
			
				case 2:
				{
					temp[index2] += temp[index1];
					break;
				}
				case 3:
				{
					if(temp[index2] < temp[index1])
						temp[index2] = temp[index1];
					break;
				}
				case 4:
				{
					if(temp[index2] > temp[index1])
						temp[index2] = temp[index1];
					break;
				}}
		}
		offset *= 2;
	}
	__syncthreads();
	
	if (threadID == 0) 
	{		/*
			//FOR DEBUGGIN PURPOSE PLEASE IGNORE
			printf("%s\n", "TEMP");
			for(long long int i=0; i < n; i++)
			{
				printf("%lld ",temp[i]);
			}
			printf("\n");
			*/
		if(operation!=4)
		{
				temp[nextPowerOfTwo - 1 + CONFLICT_FREE_OFFSET(nextPowerOfTwo - 1)] = 0; // clear the last element for exclusive scan
		}
		else
		{
				temp[nextPowerOfTwo - 1 + CONFLICT_FREE_OFFSET(nextPowerOfTwo - 1)] = identity; // clear the last element for exclusive scan
		}
	}

	for (long long int d = 1; d < nextPowerOfTwo; d *= 2) // traverse down tree & build scan
	{
		offset = offset/2;
		__syncthreads();
		if (threadID < d)
		{
			long long int index1 = offset * (2 * threadID + 1) - 1;
			long long int index2 = offset * (2 * threadID + 2) - 1;
			index1 += CONFLICT_FREE_OFFSET(index1);
			index2 += CONFLICT_FREE_OFFSET(index2);

			long long int t = temp[index1];
			temp[index1] = temp[index2];
			switch(operation)
			{
				case 1:
				{
					temp[index2] += t;
					break;
				}
				case 2:
				{
					temp[index2] += t;
					break;
				}
				case 3:
				{
					if(temp[index2] < t)
						temp[index2] = t;
					break;
				}
				case 4:
				{
					if(temp[index2] > t)
						temp[index2] = t;
					break;
				}}
		}
	}
	__syncthreads();

	if (threadID < n) 
	{
		output[index1] = temp[index1 + bankOffsetA];
		output[index2] = temp[index2 + bankOffsetB];
	}}

__global__ void prescan_MultiBlock(long long int *output, long long int *input, long long int n, long long int *sums,long long int operation,long long int identity) {
	extern __shared__ long long int temp[];

	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * n;

	long long int index1 = threadID;
	long long int index2 = threadID + (n / 2);
	long long int bankOffsetA = CONFLICT_FREE_OFFSET(index1);
	long long int bankOffsetB = CONFLICT_FREE_OFFSET(index2);
	temp[index1 + bankOffsetA] = input[blockOffset + index1];
	temp[index2 + bankOffsetB] = input[blockOffset + index2];

	long long int offset = 1;
	for (long long int d = n >> 1; d > 0; d >>= 1) // build sum in place up the tree
	{
		__syncthreads();
		if (threadID < d)
		{
			long long int index1 = offset * (2 * threadID + 1) - 1;
			long long int index2 = offset * (2 * threadID + 2) - 1;
			index1 += CONFLICT_FREE_OFFSET(index1);
			index2 += CONFLICT_FREE_OFFSET(index2);
			switch(operation)
			{
				case 1:
				{
					temp[index2] += temp[index1];
					break;
				}
				case 2:
				{
					temp[index2] += temp[index1];
					break;
				}
				case 3:
				{
					if(temp[index2] < temp[index1])
						temp[index2] = temp[index1];
					break;
				}
				case 4:
				{
					if(temp[index2] > temp[index1])
						temp[index2] = temp[index1];
				}
			}
		}
		offset *= 2;
	}
	__syncthreads();


	if (threadID == 0) 
	{
		sums[blockID] = temp[n - 1 + CONFLICT_FREE_OFFSET(n - 1)];
		if(operation!=4)
		{
			temp[n - 1 + CONFLICT_FREE_OFFSET(n - 1)] = 0;
		}
		else
		{
			temp[n - 1 + CONFLICT_FREE_OFFSET(n - 1)] = identity;
		}
	}

	for (long long int d = 1; d < n; d *= 2) // traverse down tree & build scan
	{
		offset >>= 1;
		__syncthreads();
		if (threadID < d)
		{
			long long int index1 = offset * (2 * threadID + 1) - 1;
			long long int index2 = offset * (2 * threadID + 2) - 1;
			index1 += CONFLICT_FREE_OFFSET(index1);
			index2 += CONFLICT_FREE_OFFSET(index2);

			long long int t = temp[index1];
			temp[index1] = temp[index2];
			switch(operation)
			{
				case 1:
				{
					temp[index2] += t;
					break;
				}
				case 2:
				{
					temp[index2] += t;
					break;
				}
				case 3:
				{
					if(temp[index2] < t)
						temp[index2] = t;
					break;
				}
				case 4:
				{
					if(temp[index2] > t)
						temp[index2] = t;
					break;
				}
			}
		}
	}
	__syncthreads();

	output[blockOffset + index1] = temp[index1 + bankOffsetA];
	output[blockOffset + index2] = temp[index2 + bankOffsetB];
}


//functions to add two or three numbers in given arrays
__global__ void add_two(long long int *output, long long int length, long long int *n) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;

	output[blockOffset + threadID] += n[blockID];}
__global__ void add_three(long long int *output, long long int length, long long int *n1, long long int *n2) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;

	output[blockOffset + threadID] += n1[blockID] + n2[blockID];}

//functions to find maximum of two or three numbers in given arrays
__global__ void max_two(long long int *output, long long int length, long long int *n) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;
	if(output[blockOffset + threadID] < n[blockID])
	{
			output[blockOffset + threadID] = n[blockID];
	}}
__global__ void max_three(long long int *output, long long int length, long long int *n1, long long int *n2) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;
	if(n1[blockID] > n2[blockID])
	{
		if(n1[blockID] > output[blockOffset + threadID])
		{
			output[blockOffset + threadID] = n1[blockID];
		}
	}
	else
	{
		if(n2[blockID] > output[blockOffset + threadID])
		{
			output[blockOffset + threadID] = n2[blockID];
		}
	}}

//functions to find minimum of two or three numbers in given arrays
__global__ void min_two(long long int *output, long long int length, long long int *n) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;

	if(output[blockOffset + threadID] > n[blockID])
	{
			output[blockOffset + threadID] = n[blockID];
	}}
__global__ void min_three(long long int *output, long long int length, long long int *n1, long long int *n2) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;

	if(n1[blockID] < n2[blockID])
	{
		if(n1[blockID] < output[blockOffset + threadID])
		{
			output[blockOffset + threadID] = n1[blockID];
		}
	}
	else
	{
		if(n2[blockID] < output[blockOffset + threadID])
		{
			output[blockOffset + threadID] = n2[blockID];
		}
	}}

void _checkCudaError(const char *message, cudaError_t err, const char *caller) {
	if (err != cudaSuccess) {
		fprintf(stderr, "Error in: %s\n", caller);
		fprintf(stderr, "%s\n", message);
		fprintf(stderr, ": %s\n", cudaGetErrorString(err));
		exit(0);}}

void printResult(const char* Heading, long long int result, float milliseconds) {
	printf("%s\n", Heading);
	printf("Final Reduction is %lld and it was done in %lf ms\n", result, milliseconds);}

void printArrayInFile (const char* Header ,long long int Output[], long long int start, long long int end){
	FILE* fp = fopen("output.txt", "a");
	fprintf(fp, "%s\n", Header);
	for(long long int i=start; i < end; i++)
	{
		fprintf(fp, "%lld ",Output[i]);
	}
	fprintf(fp, "\n");
	fclose(fp);}

void check(long long int* CPU_Vector,long long int* GPU_Vector, long long int start, long long int end)
{
	for(int i=start; i < end; i++)
	{
		if(CPU_Vector[i]!=GPU_Vector[i])
		{
			printf("Outputs don't match\n");
			return;
		}
	}
	printf("Outputs do match, The implementation is successful\n");}

	.file	"tmpxft_00237c58_00000000-6_scan_CUDA.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2040:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2040:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z15sequential_scanPxS_xx
	.type	_Z15sequential_scanPxS_xx, @function
_Z15sequential_scanPxS_xx:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rsi, %r12
	xorl	%esi, %esi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdi, %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	gettimeofday@PLT
	cmpq	$3, %rbp
	je	.L3
	jg	.L4
	cmpq	$1, %rbp
	je	.L5
	cmpq	$2, %rbp
	jne	.L7
	xorl	%eax, %eax
	movq	%rax, (%rbx)
	movq	(%r12), %rax
	movq	%rax, 8(%rbx)
	jmp	.L11
.L4:
	cmpq	$4, %rbp
	jne	.L7
	movabsq	$9223372036854775807, %rax
	movq	%rax, (%rbx)
	movq	(%r12), %rax
	movq	%rax, 8(%rbx)
	movl	$2, %eax
	jmp	.L16
.L5:
	xorl	%edx, %edx
	movq	%rdx, (%rbx)
	movq	(%r12), %rax
	movq	%rax, 8(%rbx)
	movl	$2, %eax
.L9:
	cmpq	%r13, %rax
	jge	.L7
	movq	-8(%rbx,%rax,8), %rdx
	addq	-8(%r12,%rax,8), %rdx
	movq	%rdx, (%rbx,%rax,8)
	incq	%rax
	jmp	.L9
.L11:
	cmpq	%r13, %rbp
	jge	.L7
	movq	-8(%rbx,%rbp,8), %rax
	subq	-8(%r12,%rbp,8), %rax
	movq	%rax, (%rbx,%rbp,8)
	incq	%rbp
	jmp	.L11
.L3:
	movl	$1, %eax
	salq	$63, %rax
	movq	%rax, (%rbx)
	movq	(%r12), %rax
	movq	%rax, 8(%rbx)
	movl	$2, %eax
.L14:
	cmpq	%r13, %rax
	jge	.L7
	movq	-8(%r12,%rax,8), %rdx
	movq	-8(%rbx,%rax,8), %rcx
	cmpq	%rcx, %rdx
	cmovl	%rcx, %rdx
	movq	%rdx, (%rbx,%rax,8)
	incq	%rax
	jmp	.L14
.L16:
	cmpq	%r13, %rax
	jge	.L7
	movq	-8(%r12,%rax,8), %rdx
	movq	-8(%rbx,%rax,8), %rcx
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	movq	%rdx, (%rbx,%rax,8)
	incq	%rax
	jmp	.L16
.L7:
	leaq	24(%rsp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movq	24(%rsp), %rax
	subq	8(%rsp), %rax
	cvtsi2ssq	%rax, %xmm0
	movq	32(%rsp), %rax
	mulss	.LC0(%rip), %xmm0
	subq	16(%rsp), %rax
	cvtsi2ssq	%rax, %xmm1
	addss	%xmm1, %xmm0
	divss	.LC1(%rip), %xmm0
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$56, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z15sequential_scanPxS_xx, .-_Z15sequential_scanPxS_xx
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"Error in: %s\n"
.LC3:
	.string	"%s\n"
.LC4:
	.string	": %s\n"
	.text
	.globl	_Z15_checkCudaErrorPKc9cudaErrorS0_
	.type	_Z15_checkCudaErrorPKc9cudaErrorS0_, @function
_Z15_checkCudaErrorPKc9cudaErrorS0_:
.LFB2034:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	je	.L21
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	movq	%rdx, %rcx
	leaq	.LC2(%rip), %rdx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%esi, %ebx
	movl	$2, %esi
	pushq	%rax
	.cfi_def_cfa_offset 32
	movq	stderr(%rip), %rdi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	%rbp, %rcx
	movl	$2, %esi
	xorl	%eax, %eax
	movq	stderr(%rip), %rdi
	leaq	.LC3(%rip), %rdx
	call	__fprintf_chk@PLT
	movl	%ebx, %edi
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC4(%rip), %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	xorl	%edi, %edi
	call	exit@PLT
.L21:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE2034:
	.size	_Z15_checkCudaErrorPKc9cudaErrorS0_, .-_Z15_checkCudaErrorPKc9cudaErrorS0_
	.section	.rodata.str1.1
.LC5:
	.string	"Final Reduction is %lld and it was done in %lf ms\n"
	.text
	.globl	_Z11printResultPKcxf
	.type	_Z11printResultPKcxf, @function
_Z11printResultPKcxf:
.LFB2035:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rdx
	movq	%rsi, %rbx
	movl	$2, %edi
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movss	%xmm0, 12(%rsp)
	call	__printf_chk@PLT
	movss	12(%rsp), %xmm0
	movq	%rbx, %rdx
	movb	$1, %al
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	popq	%rbx
	.cfi_def_cfa_offset 8
	cvtss2sd	%xmm0, %xmm0
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2035:
	.size	_Z11printResultPKcxf, .-_Z11printResultPKcxf
	.section	.rodata.str1.1
.LC6:
	.string	"a"
.LC7:
	.string	"output.txt"
.LC8:
	.string	"%lld "
.LC9:
	.string	"\n"
	.text
	.globl	_Z16printArrayInFilePKcPxxx
	.type	_Z16printArrayInFilePKcPxxx, @function
_Z16printArrayInFilePKcPxxx:
.LFB2036:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r14
	leaq	.LC7(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	leaq	.LC6(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rcx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	fopen@PLT
	movq	%r14, %rcx
	movl	$2, %esi
	leaq	.LC3(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	leaq	.LC8(%rip), %r14
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L29:
	cmpq	%r12, %rbp
	jge	.L32
	movq	0(%r13,%rbp,8), %rcx
	movq	%r14, %rdx
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	incq	%rbp
	call	__fprintf_chk@PLT
	jmp	.L29
.L32:
	movq	%rbx, %rdi
	leaq	.LC9(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	fclose@PLT
	.cfi_endproc
.LFE2036:
	.size	_Z16printArrayInFilePKcPxxx, .-_Z16printArrayInFilePKcPxxx
	.section	.rodata.str1.1
.LC10:
	.string	"Outputs don't match\n"
.LC11:
	.string	"Outputs do match, The implementation is successful\n"
	.text
	.globl	_Z5checkPxS_xx
	.type	_Z5checkPxS_xx, @function
_Z5checkPxS_xx:
.LFB2037:
	.cfi_startproc
	endbr64
	movslq	%edx, %rdx
.L34:
	cmpq	%rdx, %rcx
	jle	.L38
	movq	(%rdi,%rdx,8), %rax
	incq	%rdx
	cmpq	-8(%rsi,%rdx,8), %rax
	je	.L34
	leaq	.LC10(%rip), %rsi
	jmp	.L37
.L38:
	leaq	.LC11(%rip), %rsi
.L37:
	movl	$2, %edi
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2037:
	.size	_Z5checkPxS_xx, .-_Z5checkPxS_xx
	.globl	_Z45__device_stub__Z19prescan_SingleBlockPxS_xxxxPxS_xxxx
	.type	_Z45__device_stub__Z19prescan_SingleBlockPxS_xxxxPxS_xxxx, @function
_Z45__device_stub__Z19prescan_SingleBlockPxS_xxxxPxS_xxxx:
.LFB2062:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	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	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	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	_Z19prescan_SingleBlockPxS_xxxx(%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
.LFE2062:
	.size	_Z45__device_stub__Z19prescan_SingleBlockPxS_xxxxPxS_xxxx, .-_Z45__device_stub__Z19prescan_SingleBlockPxS_xxxxPxS_xxxx
	.globl	_Z19prescan_SingleBlockPxS_xxxx
	.type	_Z19prescan_SingleBlockPxS_xxxx, @function
_Z19prescan_SingleBlockPxS_xxxx:
.LFB2063:
	.cfi_startproc
	endbr64
	jmp	_Z45__device_stub__Z19prescan_SingleBlockPxS_xxxxPxS_xxxx
	.cfi_endproc
.LFE2063:
	.size	_Z19prescan_SingleBlockPxS_xxxx, .-_Z19prescan_SingleBlockPxS_xxxx
	.globl	_Z15scanSingleBlockPxS_xxx
	.type	_Z15scanSingleBlockPxS_xxx, @function
_Z15scanSingleBlockPxS_xxx:
.LFB2032:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%r8, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rcx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$1, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
.L45:
	cmpq	%rbp, %rbx
	jge	.L49
	addq	%rbx, %rbx
	jmp	.L45
.L49:
	leaq	1(%rbp), %rax
	movl	$2, %ecx
	movq	%rbx, %r8
	xorl	%r9d, %r9d
	cqto
	salq	$4, %r8
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	idivq	%rcx
	movq	%rdi, 24(%rsp)
	movl	28(%rsp), %ecx
	movl	%eax, 20(%rsp)
	movq	20(%rsp), %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L44
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r15, %r9
	movq	%r14, %r8
	movq	%rbx, %rcx
	movq	%rbp, %rdx
	popq	%rbx
	.cfi_def_cfa_offset 48
	movq	%r13, %rsi
	popq	%rbp
	.cfi_def_cfa_offset 40
	movq	%r12, %rdi
	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	_Z45__device_stub__Z19prescan_SingleBlockPxS_xxxxPxS_xxxx
.L44:
	.cfi_restore_state
	addq	$40, %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
.LFE2032:
	.size	_Z15scanSingleBlockPxS_xxx, .-_Z15scanSingleBlockPxS_xxx
	.globl	_Z45__device_stub__Z18prescan_MultiBlockPxS_xS_xxPxS_xS_xx
	.type	_Z45__device_stub__Z18prescan_MultiBlockPxS_xS_xxPxS_xS_xx, @function
_Z45__device_stub__Z18prescan_MultiBlockPxS_xS_xxPxS_xS_xx:
.LFB2064:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	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	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	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	.L50
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z18prescan_MultiBlockPxS_xS_xx(%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
.L50:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L52
	call	__stack_chk_fail@PLT
.L52:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2064:
	.size	_Z45__device_stub__Z18prescan_MultiBlockPxS_xS_xxPxS_xS_xx, .-_Z45__device_stub__Z18prescan_MultiBlockPxS_xS_xxPxS_xS_xx
	.globl	_Z18prescan_MultiBlockPxS_xS_xx
	.type	_Z18prescan_MultiBlockPxS_xS_xx, @function
_Z18prescan_MultiBlockPxS_xS_xx:
.LFB2065:
	.cfi_startproc
	endbr64
	jmp	_Z45__device_stub__Z18prescan_MultiBlockPxS_xS_xxPxS_xS_xx
	.cfi_endproc
.LFE2065:
	.size	_Z18prescan_MultiBlockPxS_xS_xx, .-_Z18prescan_MultiBlockPxS_xS_xx
	.globl	_Z29__device_stub__Z7add_twoPxxS_PxxS_
	.type	_Z29__device_stub__Z7add_twoPxxS_PxxS_, @function
_Z29__device_stub__Z7add_twoPxxS_PxxS_:
.LFB2066:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L55
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z7add_twoPxxS_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L55:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L57
	call	__stack_chk_fail@PLT
.L57:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2066:
	.size	_Z29__device_stub__Z7add_twoPxxS_PxxS_, .-_Z29__device_stub__Z7add_twoPxxS_PxxS_
	.globl	_Z7add_twoPxxS_
	.type	_Z7add_twoPxxS_, @function
_Z7add_twoPxxS_:
.LFB2067:
	.cfi_startproc
	endbr64
	jmp	_Z29__device_stub__Z7add_twoPxxS_PxxS_
	.cfi_endproc
.LFE2067:
	.size	_Z7add_twoPxxS_, .-_Z7add_twoPxxS_
	.globl	_Z33__device_stub__Z9add_threePxxS_S_PxxS_S_
	.type	_Z33__device_stub__Z9add_threePxxS_S_PxxS_S_, @function
_Z33__device_stub__Z9add_threePxxS_S_PxxS_S_:
.LFB2068:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L60
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z9add_threePxxS_S_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L60:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L62
	call	__stack_chk_fail@PLT
.L62:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2068:
	.size	_Z33__device_stub__Z9add_threePxxS_S_PxxS_S_, .-_Z33__device_stub__Z9add_threePxxS_S_PxxS_S_
	.globl	_Z9add_threePxxS_S_
	.type	_Z9add_threePxxS_S_, @function
_Z9add_threePxxS_S_:
.LFB2069:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z9add_threePxxS_S_PxxS_S_
	.cfi_endproc
.LFE2069:
	.size	_Z9add_threePxxS_S_, .-_Z9add_threePxxS_S_
	.globl	_Z29__device_stub__Z7max_twoPxxS_PxxS_
	.type	_Z29__device_stub__Z7max_twoPxxS_PxxS_, @function
_Z29__device_stub__Z7max_twoPxxS_PxxS_:
.LFB2070:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L65
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z7max_twoPxxS_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L65:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L67
	call	__stack_chk_fail@PLT
.L67:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2070:
	.size	_Z29__device_stub__Z7max_twoPxxS_PxxS_, .-_Z29__device_stub__Z7max_twoPxxS_PxxS_
	.globl	_Z7max_twoPxxS_
	.type	_Z7max_twoPxxS_, @function
_Z7max_twoPxxS_:
.LFB2071:
	.cfi_startproc
	endbr64
	jmp	_Z29__device_stub__Z7max_twoPxxS_PxxS_
	.cfi_endproc
.LFE2071:
	.size	_Z7max_twoPxxS_, .-_Z7max_twoPxxS_
	.globl	_Z33__device_stub__Z9max_threePxxS_S_PxxS_S_
	.type	_Z33__device_stub__Z9max_threePxxS_S_PxxS_S_, @function
_Z33__device_stub__Z9max_threePxxS_S_PxxS_S_:
.LFB2072:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L70
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z9max_threePxxS_S_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L70:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L72
	call	__stack_chk_fail@PLT
.L72:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2072:
	.size	_Z33__device_stub__Z9max_threePxxS_S_PxxS_S_, .-_Z33__device_stub__Z9max_threePxxS_S_PxxS_S_
	.globl	_Z9max_threePxxS_S_
	.type	_Z9max_threePxxS_S_, @function
_Z9max_threePxxS_S_:
.LFB2073:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z9max_threePxxS_S_PxxS_S_
	.cfi_endproc
.LFE2073:
	.size	_Z9max_threePxxS_S_, .-_Z9max_threePxxS_S_
	.globl	_Z29__device_stub__Z7min_twoPxxS_PxxS_
	.type	_Z29__device_stub__Z7min_twoPxxS_PxxS_, @function
_Z29__device_stub__Z7min_twoPxxS_PxxS_:
.LFB2074:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L75
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z7min_twoPxxS_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L75:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L77
	call	__stack_chk_fail@PLT
.L77:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2074:
	.size	_Z29__device_stub__Z7min_twoPxxS_PxxS_, .-_Z29__device_stub__Z7min_twoPxxS_PxxS_
	.globl	_Z7min_twoPxxS_
	.type	_Z7min_twoPxxS_, @function
_Z7min_twoPxxS_:
.LFB2075:
	.cfi_startproc
	endbr64
	jmp	_Z29__device_stub__Z7min_twoPxxS_PxxS_
	.cfi_endproc
.LFE2075:
	.size	_Z7min_twoPxxS_, .-_Z7min_twoPxxS_
	.globl	_Z33__device_stub__Z9min_threePxxS_S_PxxS_S_
	.type	_Z33__device_stub__Z9min_threePxxS_S_PxxS_S_, @function
_Z33__device_stub__Z9min_threePxxS_S_PxxS_S_:
.LFB2076:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L80
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z9min_threePxxS_S_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L80:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L82
	call	__stack_chk_fail@PLT
.L82:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2076:
	.size	_Z33__device_stub__Z9min_threePxxS_S_PxxS_S_, .-_Z33__device_stub__Z9min_threePxxS_S_PxxS_S_
	.globl	_Z9min_threePxxS_S_
	.type	_Z9min_threePxxS_S_, @function
_Z9min_threePxxS_S_:
.LFB2077:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z9min_threePxxS_S_PxxS_S_
	.cfi_endproc
.LFE2077:
	.size	_Z9min_threePxxS_S_, .-_Z9min_threePxxS_S_
	.globl	_Z14scanMultiBlockPxS_xxx
	.type	_Z14scanMultiBlockPxS_xxx, @function
_Z14scanMultiBlockPxS_xxx:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdx, %rax
	movq	%rcx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rsi, %r14
	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
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdx, %rbx
	cqto
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	idivq	ELEMENTS_PER_BLOCK(%rip)
	testq	%rdx, %rdx
	je	.L86
	subq	%rdx, %rbx
	movq	%rdx, %r12
	movq	%r8, 8(%rsp)
	movq	%rbx, %rdx
	salq	$3, %rbx
	call	_Z19scanBlockSizedArrayPxS_xxx
	leaq	0(%rbp,%rbx), %r13
	movq	%r15, %rcx
	movq	%r12, %rdx
	movq	8(%rsp), %r8
	leaq	(%r14,%rbx), %rsi
	movq	%r13, %rdi
	call	_Z15scanSingleBlockPxS_xxx
	cmpq	$3, %r15
	je	.L87
	jg	.L88
	cmpq	$1, %r15
	je	.L90
	cmpq	$2, %r15
	je	.L90
	jmp	.L85
.L88:
	cmpq	$4, %r15
	je	.L92
	jmp	.L85
.L90:
	movl	%r12d, 36(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 32(%rsp)
	movq	%rdi, 40(%rsp)
	movl	44(%rsp), %ecx
	movq	36(%rsp), %rdx
	movq	%rdi, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L85
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	subq	$8, %rbx
	movq	%r12, %rsi
	movq	%r13, %rdi
	leaq	0(%rbp,%rbx), %rcx
	leaq	(%r14,%rbx), %rdx
	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	_Z33__device_stub__Z9add_threePxxS_S_PxxS_S_
.L87:
	.cfi_restore_state
	movl	%r12d, 36(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 32(%rsp)
	movq	%rdi, 40(%rsp)
	movl	44(%rsp), %ecx
	movq	36(%rsp), %rdx
	movq	%rdi, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L85
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	subq	$8, %rbx
	movq	%r12, %rsi
	movq	%r13, %rdi
	leaq	0(%rbp,%rbx), %rcx
	leaq	(%r14,%rbx), %rdx
	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	_Z33__device_stub__Z9max_threePxxS_S_PxxS_S_
.L92:
	.cfi_restore_state
	movl	%r12d, 36(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 32(%rsp)
	movq	%rdi, 40(%rsp)
	movl	44(%rsp), %ecx
	movq	36(%rsp), %rdx
	movq	%rdi, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L85
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	subq	$8, %rbx
	movq	%r12, %rsi
	movq	%r13, %rdi
	leaq	0(%rbp,%rbx), %rcx
	leaq	(%r14,%rbx), %rdx
	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	_Z33__device_stub__Z9min_threePxxS_S_PxxS_S_
.L86:
	.cfi_restore_state
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%rbx, %rdx
	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	_Z19scanBlockSizedArrayPxS_xxx
.L85:
	.cfi_restore_state
	addq	$56, %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
.LFE2031:
	.size	_Z14scanMultiBlockPxS_xxx, .-_Z14scanMultiBlockPxS_xxx
	.globl	_Z4scanPxS_xx
	.type	_Z4scanPxS_xx, @function
_Z4scanPxS_xx:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rsi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	0(,%rdx,8), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rsi
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdx, %rbx
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	call	cudaMalloc@PLT
	leaq	8(%rsp), %rdi
	movq	%r12, %rsi
	call	cudaMalloc@PLT
	movq	16(%rsp), %rdi
	movq	%r12, %rdx
	movq	%r13, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdi
	movq	%r12, %rdx
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	leaq	24(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	32(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	24(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movabsq	$9223372036854775807, %r8
	cmpq	$4, %rbp
	je	.L101
	xorl	%r8d, %r8d
	cmpq	$3, %rbp
	sete	%r8b
	salq	$63, %r8
.L101:
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rdi
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	cmpq	%rbx, ELEMENTS_PER_BLOCK(%rip)
	jl	.L102
	call	_Z15scanSingleBlockPxS_xxx
	jmp	.L103
.L102:
	call	_Z14scanMultiBlockPxS_xxx
.L103:
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	32(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	leaq	4(%rsp), %rdi
	movl	$0x00000000, 4(%rsp)
	call	cudaEventElapsedTime@PLT
	movq	16(%rsp), %rsi
	movq	%r12, %rdx
	movq	%r13, %rdi
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movq	24(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movss	4(%rsp), %xmm0
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L104
	call	__stack_chk_fail@PLT
.L104:
	addq	$48, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z4scanPxS_xx, .-_Z4scanPxS_xx
	.section	.rodata.str1.1
.LC13:
	.string	"Generating Random Numbers...\n"
.LC14:
	.string	"Finished Generating Random Numbers...\n\n"
.LC15:
	.string	"Please type the desired %lld values of the vector each seperated by an ENTER KEY or WHITESPACE\n"
.LC16:
	.string	"%lld"
.LC17:
	.string	"Finished Taking Input...\n\n"
.LC18:
	.string	"Printing the Input Vector...\n"
.LC19:
	.string	"w"
.LC20:
	.string	"Original Array"
.LC21:
	.string	"Finished Printing the Input Vector \n"
.LC22:
	.string	"Doing the sequential Exclusive scan...\n"
.LC23:
	.string	"Finished the sequential Exclusive scan...\n\n"
.LC24:
	.string	"Host Time  "
.LC25:
	.string	"Printing the Scanned Vector formed by the CPU...\n"
.LC26:
	.string	"HOST RESULT"
.LC27:
	.string	"Finished Printing the Scanned Vector formed by the CPU\n\n"
.LC28:
	.string	"Doing the Parallel Exclusive scan...\n"
.LC29:
	.string	"Finished the Parallel Exclusive scan...\n"
.LC30:
	.string	"GPU time "
.LC31:
	.string	"Printing the Scanned Vector formed by the GPU...\n"
.LC32:
	.string	"GPU RESULT"
.LC33:
	.string	"Finished Printing the Scanned Vector formed by the GPU\n\n"
.LC34:
	.string	"Please look at the output.txt to see the scanned vectors and input vector\n"
	.text
	.globl	_Z4Scanxxxx
	.type	_Z4Scanxxxx, @function
_Z4Scanxxxx:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rcx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	leaq	1(%r14), %rax
	leaq	0(,%rax,8), %rbp
	movq	%rax, 16(%rsp)
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, %rbx
	call	malloc@PLT
	movq	%rax, %r12
	cmpq	$1, %r13
	jne	.L110
	leaq	.LC13(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	call	rand@PLT
	movl	$1000000, %ecx
	cltd
	idivl	%ecx
	movslq	%edx, %rdx
	movq	%rdx, (%rbx)
	movq	%rdx, (%r12)
.L111:
	cmpq	%r14, %r13
	jge	.L143
	call	rand@PLT
	movl	$1000000, %ecx
	cltd
	idivl	%ecx
	movslq	%edx, %rdx
	movq	%rdx, (%rbx,%r13,8)
	negq	%rdx
	movq	%rdx, (%r12,%r13,8)
	incq	%r13
	jmp	.L111
.L143:
	cmpq	$4, 8(%rsp)
	leaq	-8(%rbx,%rbp), %rax
	movabsq	$9223372036854775807, %rcx
	je	.L139
	cmpq	$3, 8(%rsp)
	jne	.L115
	movl	$1, %ecx
	salq	$63, %rcx
.L139:
	movq	%rcx, (%rax)
	jmp	.L114
.L115:
	xorl	%ecx, %ecx
	movq	%rcx, (%rax)
	movq	%rcx, -8(%r12,%rbp)
.L114:
	leaq	.LC14(%rip), %rsi
	jmp	.L141
.L110:
	movq	%r14, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	movl	$1, %r13d
	leaq	.LC15(%rip), %rsi
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	leaq	.LC16(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movq	(%rbx), %rax
	leaq	8(%rbx), %rcx
	movq	%rax, (%r12)
.L117:
	cmpq	%r14, %r13
	jge	.L144
	movq	%rcx, %rsi
	leaq	.LC16(%rip), %rdi
	xorl	%eax, %eax
	movq	%rcx, 24(%rsp)
	call	__isoc23_scanf@PLT
	movq	24(%rsp), %rcx
	movq	(%rcx), %rax
	addq	$8, %rcx
	negq	%rax
	movq	%rax, (%r12,%r13,8)
	incq	%r13
	jmp	.L117
.L144:
	cmpq	$4, 8(%rsp)
	leaq	-8(%rbx,%rbp), %rax
	movabsq	$9223372036854775807, %rcx
	je	.L140
	cmpq	$3, 8(%rsp)
	jne	.L121
	movl	$1, %ecx
	salq	$63, %rcx
.L140:
	movq	%rcx, (%rax)
	jmp	.L120
.L121:
	xorl	%edx, %edx
	movq	%rdx, (%rax)
	movq	%rdx, -8(%r12,%rbp)
.L120:
	leaq	.LC17(%rip), %rsi
.L141:
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	testq	%r15, %r15
	je	.L122
	leaq	.LC18(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC19(%rip), %rsi
	leaq	.LC7(%rip), %rdi
	call	fopen@PLT
	movq	%rbx, %rsi
	movq	%r14, %rcx
	xorl	%edx, %edx
	movq	%rax, %r13
	leaq	.LC20(%rip), %rdi
	call	_Z16printArrayInFilePKcPxxx
	movq	%r13, %rdi
	call	fclose@PLT
	leaq	.LC21(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L122:
	movq	%rbp, %rdi
	leaq	-8(%rbp), %r14
	call	malloc@PLT
	leaq	.LC22(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %r13
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rcx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	movq	16(%rsp), %rdx
	call	_Z15sequential_scanPxS_xx
	leaq	.LC23(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	movss	%xmm0, 24(%rsp)
	call	__printf_chk@PLT
	movq	-8(%r13,%rbp), %rsi
	movss	24(%rsp), %xmm0
	leaq	.LC24(%rip), %rdi
	call	_Z11printResultPKcxf
	testq	%r15, %r15
	je	.L123
	leaq	.LC25(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%rsp), %rcx
	movq	%r13, %rsi
	leaq	.LC26(%rip), %rdi
	movl	$1, %edx
	call	_Z16printArrayInFilePKcPxxx
	leaq	.LC27(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L123:
	leaq	.LC28(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r14, %rdi
	call	malloc@PLT
	leaq	.LC29(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %r14
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpq	$2, 8(%rsp)
	jne	.L124
	movq	16(%rsp), %rdx
	movl	$2, %ecx
	movq	%r12, %rsi
	jmp	.L142
.L124:
	movq	8(%rsp), %rcx
	movq	16(%rsp), %rdx
	movq	%rbx, %rsi
.L142:
	movq	%r14, %rdi
	call	_Z4scanPxS_xx
	movq	-8(%r14,%rbp), %rsi
	leaq	.LC30(%rip), %rdi
	call	_Z11printResultPKcxf
	testq	%r15, %r15
	je	.L126
	leaq	.LC31(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%rsp), %rcx
	movq	%r14, %rsi
	movl	$1, %edx
	leaq	.LC32(%rip), %rdi
	call	_Z16printArrayInFilePKcPxxx
	leaq	.LC33(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC34(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L126:
	movq	16(%rsp), %rcx
	movl	$1, %edx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	_Z5checkPxS_xx
	movq	%rbx, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L127
	call	__stack_chk_fail@PLT
.L127:
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	movq	%r14, %rdi
	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	free@PLT
	.cfi_endproc
.LFE2027:
	.size	_Z4Scanxxxx, .-_Z4Scanxxxx
	.section	.rodata.str1.1
.LC35:
	.string	"Please input a proper size of the array or vector\n"
.LC36:
	.string	"Please input a proper number which is greater than zero for the size\n"
.LC37:
	.string	"The application would terminate now\n"
.LC38:
	.string	"Please select one of the given options \n"
.LC39:
	.string	"\t1)Randomize the Elements input array of size %lld\n"
.LC40:
	.string	"\t2)Proived the Elements of input array of size %lld\n"
.LC41:
	.string	"Type 1 or 2 depending upon the option you want to select\n"
.LC42:
	.string	"Please type either 1 or 2 only next time for selecting the Options\n"
.LC43:
	.string	"Please select one of the given operations\n"
.LC44:
	.string	"1)Addition\t2)Subtraction\t3)Maximum\t4)Minimum\n"
.LC45:
	.string	"Type 1,2,3 or 4 depending upon the operation you want to select\n"
.LC46:
	.string	"Please type either 1,2,3 OR 4 only next time for selecting the Operator\n"
.LC47:
	.string	"Do you wish to print the input and scanned vector in an output.txt file?\n"
.LC48:
	.string	"Type y for Yes or n for No\n"
.LC49:
	.string	"%c"
.LC50:
	.string	"Please type either character 'y' OR 'n' only next time for choosing to print or not the vectors\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%edx, %edx
	leaq	.LC35(%rip), %rsi
	movl	$2, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC16(%rip), %rbp
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rdx, 16(%rsp)
	movq	%rdx, 24(%rsp)
	movq	%rdx, 32(%rsp)
	movb	$0, 15(%rsp)
	call	__printf_chk@PLT
	leaq	16(%rsp), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc23_scanf@PLT
	cmpq	$0, 16(%rsp)
	leaq	.LC36(%rip), %rsi
	jle	.L154
	leaq	.LC38(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	16(%rsp), %rdx
	leaq	.LC39(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	leaq	.LC9(%rip), %rbx
	call	__printf_chk@PLT
	movq	16(%rsp), %rdx
	leaq	.LC40(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC41(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	24(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	leaq	.LC42(%rip), %rsi
	decq	%rax
	cmpq	$1, %rax
	ja	.L154
	leaq	.LC43(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC44(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC45(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	32(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	32(%rsp), %rax
	leaq	.LC46(%rip), %rsi
	decq	%rax
	cmpq	$3, %rax
	ja	.L154
	call	getchar@PLT
	leaq	.LC47(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC48(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	15(%rsp), %rsi
	leaq	.LC49(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movq	%rbx, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movb	15(%rsp), %al
	cmpb	$121, %al
	je	.L150
	xorl	%ecx, %ecx
	cmpb	$110, %al
	je	.L155
	leaq	.LC50(%rip), %rsi
.L154:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC37(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L147
.L150:
	movl	$1, %ecx
.L155:
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	call	_Z4Scanxxxx
.L147:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L152
	call	__stack_chk_fail@PLT
.L152:
	addq	$56, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	main, .-main
	.text
	.globl	_Z19scanBlockSizedArrayPxS_xxx
	.type	_Z19scanBlockSizedArrayPxS_xxx, @function
_Z19scanBlockSizedArrayPxS_xxx:
.LFB2033:
	.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	%rsi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r8, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	ELEMENTS_PER_BLOCK(%rip), %r15
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rdx, %rax
	leaq	16(%rsp), %rdi
	cqto
	idivq	%r15
	salq	$4, %r15
	leaq	0(,%rax,8), %rsi
	movq	%rax, %rbx
	movq	%rsi, 8(%rsp)
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	leaq	24(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%ebx, 32(%rsp)
	xorl	%r9d, %r9d
	movq	%r15, %r8
	movq	THREADS_PER_BLOCK(%rip), %rax
	movl	%eax, 44(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movl	52(%rsp), %ecx
	movq	%rax, 36(%rsp)
	movq	44(%rsp), %rdx
	movq	32(%rsp), %rdi
	movl	40(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L157
	movq	16(%rsp), %rcx
	movq	%r13, %r9
	movq	%rbp, %r8
	movq	%r14, %rsi
	movq	ELEMENTS_PER_BLOCK(%rip), %rdx
	movq	%r12, %rdi
	call	_Z45__device_stub__Z18prescan_MultiBlockPxS_xS_xxPxS_xS_xx
.L157:
	leaq	1(%rbx), %rax
	movl	$2, %ecx
	movq	16(%rsp), %rsi
	movq	%r13, %r8
	cqto
	movq	24(%rsp), %rdi
	idivq	%rcx
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	cmpq	THREADS_PER_BLOCK(%rip), %rax
	jge	.L158
	call	_Z15scanSingleBlockPxS_xxx
	jmp	.L159
.L158:
	call	_Z14scanMultiBlockPxS_xxx
.L159:
	cmpq	$3, %rbp
	je	.L160
	jg	.L161
	cmpq	$1, %rbp
	je	.L163
	cmpq	$2, %rbp
	je	.L163
	jmp	.L156
.L161:
	cmpq	$4, %rbp
	je	.L165
	jmp	.L156
.L163:
	movq	ELEMENTS_PER_BLOCK(%rip), %rax
	movl	%ebx, 32(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%eax, 44(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movl	52(%rsp), %ecx
	movq	%rax, 36(%rsp)
	movq	44(%rsp), %rdx
	movq	32(%rsp), %rdi
	movl	40(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L156
	movq	24(%rsp), %rdx
	movq	ELEMENTS_PER_BLOCK(%rip), %rsi
	movq	%r12, %rdi
	call	_Z29__device_stub__Z7add_twoPxxS_PxxS_
	jmp	.L156
.L160:
	movq	ELEMENTS_PER_BLOCK(%rip), %rax
	movl	%ebx, 32(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%eax, 44(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movl	52(%rsp), %ecx
	movq	%rax, 36(%rsp)
	movq	44(%rsp), %rdx
	movq	32(%rsp), %rdi
	movl	40(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L156
	movq	24(%rsp), %rdx
	movq	ELEMENTS_PER_BLOCK(%rip), %rsi
	movq	%r12, %rdi
	call	_Z29__device_stub__Z7max_twoPxxS_PxxS_
	jmp	.L156
.L165:
	movq	ELEMENTS_PER_BLOCK(%rip), %rax
	movl	%ebx, 32(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%eax, 44(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movl	52(%rsp), %ecx
	movq	%rax, 36(%rsp)
	movq	44(%rsp), %rdx
	movq	32(%rsp), %rdi
	movl	40(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L156
	movq	24(%rsp), %rdx
	movq	ELEMENTS_PER_BLOCK(%rip), %rsi
	movq	%r12, %rdi
	call	_Z29__device_stub__Z7min_twoPxxS_PxxS_
.L156:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L170
	call	__stack_chk_fail@PLT
.L170:
	addq	$72, %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
.LFE2033:
	.size	_Z19scanBlockSizedArrayPxS_xxx, .-_Z19scanBlockSizedArrayPxS_xxx
	.section	.rodata.str1.1
.LC51:
	.string	"_Z9min_threePxxS_S_"
.LC52:
	.string	"_Z7min_twoPxxS_"
.LC53:
	.string	"_Z9max_threePxxS_S_"
.LC54:
	.string	"_Z7max_twoPxxS_"
.LC55:
	.string	"_Z9add_threePxxS_S_"
.LC56:
	.string	"_Z7add_twoPxxS_"
.LC57:
	.string	"_Z18prescan_MultiBlockPxS_xS_xx"
.LC58:
	.string	"_Z19prescan_SingleBlockPxS_xxxx"
	.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	.LC51(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z9min_threePxxS_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC52(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z7min_twoPxxS_(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC53(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z9max_threePxxS_S_(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC54(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z7max_twoPxxS_(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC55(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z9add_threePxxS_S_(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC56(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z7add_twoPxxS_(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC57(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z18prescan_MultiBlockPxS_xS_xx(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC58(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z19prescan_SingleBlockPxS_xxxx(%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	.text.startup
	.type	_GLOBAL__sub_I_THREADS_PER_BLOCK, @function
_GLOBAL__sub_I_THREADS_PER_BLOCK:
.LFB2196:
	.cfi_startproc
	endbr64
	movq	THREADS_PER_BLOCK(%rip), %rax
	addq	%rax, %rax
	movq	%rax, ELEMENTS_PER_BLOCK(%rip)
	ret
	.cfi_endproc
.LFE2196:
	.size	_GLOBAL__sub_I_THREADS_PER_BLOCK, .-_GLOBAL__sub_I_THREADS_PER_BLOCK
	.section	.init_array
	.align 8
	.quad	_GLOBAL__sub_I_THREADS_PER_BLOCK
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	ELEMENTS_PER_BLOCK
	.bss
	.align 8
	.type	ELEMENTS_PER_BLOCK, @object
	.size	ELEMENTS_PER_BLOCK, 8
ELEMENTS_PER_BLOCK:
	.zero	8
	.globl	THREADS_PER_BLOCK
	.data
	.align 8
	.type	THREADS_PER_BLOCK, @object
	.size	THREADS_PER_BLOCK, 8
THREADS_PER_BLOCK:
	.quad	512
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	1232348160
	.align 4
.LC1:
	.long	1148846080
	.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 <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include "hip/hip_runtime.h"

#define checkCudaError(o, l) _checkCudaError(o, l, __func__)
#define SHARED_MEMORY_BANKS 32
#define LOG_MEM_BANKS 5
#define CONFLICT_FREE_OFFSET(n) ((n) >> LOG_MEM_BANKS)
#include<limits.h>

long long int THREADS_PER_BLOCK = 512;		// This is the numver of threads per block used, and 512 gave the best results
long long int ELEMENTS_PER_BLOCK = THREADS_PER_BLOCK * 2;	// As each threads takes care of two elements so number of elements is twice of threads

float sequential_scan(long long int* output, long long int* input, long long int length,long long int operation);
float scan(long long int *output, long long int *input, long long int length,long long int operation);
void scanMultiBlock(long long int *output, long long int *input, long long int length,long long int operation,long long int identity);
void scanSingleBlock(long long int *device_output, long long int *device_input, long long int length, long long int operation,long long int identity);
void scanBlockSizedArray(long long int *output, long long int *input, long long int length, long long int operation,long long int identity);
void check(long long int* CPU_Vector,long long int* GPU_Vector, long long int start, long long int end);

__global__ void prescan_SingleBlock(long long int *output, long long int *input, long long int n, long long int nextPowerOfTwo, long long int operation, long long int identity);
__global__ void prescan_MultiBlock(long long int *output, long long int *input, long long int n, long long int* sums, long long int operation,long long int identity);
__global__ void add_two(long long int *output, long long int length, long long int *n1);
__global__ void add_three(long long int *output, long long int length, long long int *n1, long long int *n2);
__global__ void max_two(long long int *output, long long int length, long long int *n1);
__global__ void max_three(long long int *output, long long int length, long long int *n1, long long int *n2);
__global__ void min_two(long long int *output, long long int length, long long int *n1);
__global__ void min_three(long long int *output, long long int length, long long int *n1, long long int *n2);
__global__ void exc_to_inc(long long output, long long input,long long int operations);

void _checkCudaError(const char *message, hipError_t err, const char *caller);
void printResult(const char* prefix, long long int result, float milliseconds);
void printArrayInFile (const char* prefix ,long long int Output[], long long int start, long long int end);



void Scan(long long int N, long long int Option, long long int operation, long long int printing) {
	
	time_t t;
	srand((unsigned)time(&t));
	long long int *in =(long long int *) malloc (sizeof(long long int) * (N+1));	//input array
	long long int *mod_input =(long long int *) malloc (sizeof(long long int) * (N+1));// modified input array incase of Subtraction being the operation
	
	
	if(Option == 1 )		// IF THE ARRAY NEEDS TO BE RANDOMLY GENERATED
	{

		printf("Generating Random Numbers...\n");
		in[0] = rand()%1000000;
		mod_input[0] = in[0];
		
		for (long long int i = 1; i < N; i++) 
		{
			in[i] = rand() % 1000000;
			mod_input[i] = -in[i];	
		}
		if(operation==4)
		{
			in[N] = LONG_LONG_MAX;
		}
		else if (operation==3)
		{
			in[N] = LONG_LONG_MIN;
		}
		else
		{
			in[N] = 0;
			mod_input[N] = 0;	
		
		}

		printf("Finished Generating Random Numbers...\n\n");
	}
	else					// IF THE ARRAY IS FED AS INPUT TO THE PROGRAM
	{
		printf("Please type the desired %lld values of the vector each seperated by an ENTER KEY or WHITESPACE\n",N);
		scanf("%lld",&in[0]);
		mod_input[0] = in[0];
		for (long long int i = 1; i < N; i++) 
		{
			scanf("%lld",&in[i]);
			mod_input[i] = -in[i];
		}
		if(operation==4)
		{
			in[N] = LONG_LONG_MAX;
		}
		else if (operation==3)
		{
			in[N] = LONG_LONG_MIN;
		}
		else
		{
			in[N] = 0;
			mod_input[N] = 0;	
		
		}
		printf("Finished Taking Input...\n\n");
	
	}

	
	
	
	if(printing)		//PRINTING THE OUTPUT ARRAY TO output.txt
	{	
		printf("Printing the Input Vector...\n");
		FILE* fp = fopen("output.txt", "w");		
		printArrayInFile("Original Array",in, 0 , N);
		fclose(fp);
		printf("Finished Printing the Input Vector \n");
	}

	long long int *output_CPU = (long long int *) malloc (sizeof(long long int) * (N+1));
	printf("Doing the sequential Exclusive scan...\n");
	float time_host = sequential_scan(output_CPU, in, (N+1), operation);
	printf("Finished the sequential Exclusive scan...\n\n");
	
	//Printing The Result and Time
	printResult("Host Time  ", output_CPU[N], time_host);
	if(printing)		//PRINTING THE OUTPUT ARRAY TO output.txt
	{	
		printf("Printing the Scanned Vector formed by the CPU...\n");
		printArrayInFile ("HOST RESULT", output_CPU, 1, N+1);
		printf("Finished Printing the Scanned Vector formed by the CPU\n\n");
		
	}
	
	
	// Parallel scan on GPU
	printf("Doing the Parallel Exclusive scan...\n");
	long long int *output_GPU = (long long int *) malloc (sizeof(long long int) * N);
	printf("Finished the Parallel Exclusive scan...\n");
	
	if(operation == 2)		// Special consideration for subtraction because the operation is not associative
	{

		float time_gpu = scan(output_GPU, mod_input, N+1, operation);
		printResult("GPU time ", output_GPU[N], time_gpu);
	}
	else				// for all the other operationators
	{
		float time_gpu = scan(output_GPU, in, N + 1, operation);
		printResult("GPU time ", output_GPU[N], time_gpu);
	}
	if(printing)
	{
		printf("Printing the Scanned Vector formed by the GPU...\n");
		printArrayInFile ("GPU RESULT", output_GPU,1, N + 1);
		printf("Finished Printing the Scanned Vector formed by the GPU\n\n");
		printf("Please look at the output.txt to see the scanned vectors and input vector\n");
	}

	// For checking correctness of solution
	check(output_CPU,output_GPU,1,N + 1);

	//clean up of all memory used up
	free(in);
	free(mod_input);
	//free(output_CPU);
	free(output_GPU);
	}

int main(){
	long long int N=0, options=0, operation=0;
	char printing = 0;
	
	printf("Please input a proper size of the array or vector\n");
	scanf("%lld",&N);
	if(N <= 0)
	{
		printf("Please input a proper number which is greater than zero for the size\n");
		printf("The application would terminate now\n");
		return 0;
	}

	printf("Please select one of the given options \n");
	printf("\t1)Randomize the Elements input array of size %lld\n", N);
	printf("\t2)Proived the Elements of input array of size %lld\n", N);
	printf("Type 1 or 2 depending upon the option you want to select\n");
	scanf("%lld", &options);
	printf("\n");
	if(options!=1&&options!=2)
	{
		printf("Please type either 1 or 2 only next time for selecting the Options\n");
		printf("The application would terminate now\n");
		return 0;
	}

	printf("Please select one of the given operations\n");
	printf("1)Addition\t2)Subtraction\t3)Maximum\t4)Minimum\n");
	printf("Type 1,2,3 or 4 depending upon the operation you want to select\n");
	scanf("%lld", &operation);
	printf("\n");
	if(operation!=1 && operation!=2 && operation!=3 && operation!=4)
	{
		printf("Please type either 1,2,3 OR 4 only next time for selecting the Operator\n");
		printf("The application would terminate now\n");
		return 0;
	}
	getchar();	// to eat the enter key;
	
	printf("Do you wish to print the input and scanned vector in an output.txt file?\n");
	printf("Type y for Yes or n for No\n");
	scanf("%c", &printing);
	printf("\n");

	if(printing!='y'&& printing!='n')
	{
		printf("Please type either character 'y' OR 'n' only next time for choosing to print or not the vectors\n");
		printf("The application would terminate now\n");
		return 0;
	}

	if(printing=='y')
	{
		Scan(N,options,operation,1);
	}
	else
	{
		Scan(N,options,operation,0);
	}
	
	return 0;}

float sequential_scan(long long int* output, long long int* input, long long int length, long long int operation) {
	struct timeval start, end;
    gettimeofday(&start, NULL);
	switch(operation)
	{
		case 1:
		{
			output[0] = 0; // since this is an exclusive scan
			output[1] = input[0]; 
			for (long long int j = 2; j < length; ++j)
			{
				output[j] = input[j - 1] + output[j - 1];
			}
		break;
		}
		case 2:
		{
			output[0] = 0; // since this is an exclusive scan
			output[1] = input[0]; 
			for (long long int j = 2; j < length; ++j)
			{
				output[j] = output[j - 1] - input[j - 1];
			}
		break;
		}
		case 3:
		{
			output[0] = LONG_LONG_MIN;
			output[1] = input[0];
			for (long long int j = 2; j < length; ++j)
			{
				if(input[j-1] > output[j - 1])
					output[j] = input[j-1];
				else
					output[j] = output[j-1];
			}
		break;
		}
		case 4:
		{
			
			output[0] = LONG_LONG_MAX;	//since in exclusive scan the first element is the identity of the operator, in this case the max 								//number possible
			output[1] = input[0];
			for (long long int j = 2; j < length; ++j)
			{
				if(input[j-1] < output[j - 1])
					output[j] = input[j-1];
				else
					output[j] = output[j-1];
			}
		break;
		}
	}
	 
    gettimeofday(&end, NULL);
	float seconds = (end.tv_sec  - start.tv_sec);
    float micros = ((seconds * 1000000)+ (end.tv_usec - start.tv_usec));
	return (float)(micros/1000);}

float scan(long long int *output, long long int *input, long long int length,long long int operation) {
	
	long long int *device_input,*device_output;
	long long int arraySize = length * sizeof(long long int);

	hipMalloc((void **)&device_output, arraySize);
	hipMalloc((void **)&device_input, arraySize);
	hipMemcpy(device_output, output, arraySize, hipMemcpyHostToDevice);
	hipMemcpy(device_input, input, arraySize, hipMemcpyHostToDevice);

	hipEvent_t initial, final;
	hipEventCreate(&initial);
	hipEventCreate(&final);
	// starting the timer given in CUDA Library
	hipEventRecord(initial);
	long long int identity = 0;
	if(operation==4)
	{
		identity = LONG_LONG_MAX;
	}
	else if (operation==3)
	{
			identity = LONG_LONG_MIN;
	}
	if (length <= ELEMENTS_PER_BLOCK) 
	{
		/*float elapsed = */ scanSingleBlock(device_output, device_input, length, operation, identity);
		//printf("The parallelizable part took %lf ms of time", elapsed);//needed for finding parallelizable part
	}
	else 
	{
		/*float elpased  = */scanMultiBlock(device_output, device_input, length, operation , identity);
		//printf("The parallelizable part took %lf ms of time", elapsed);	//needed for finding parallelizable part
	}

	// end timer
	hipEventRecord(final);
	hipEventSynchronize(final);
	float elapsedTime = 0;
	hipEventElapsedTime(&elapsedTime, initial, final);

	hipMemcpy(output, device_output, arraySize, hipMemcpyDeviceToHost);

	//clean up
	hipFree(device_input);
	hipFree(device_output);
	hipEventDestroy(final);
	hipEventDestroy(initial);
	

	return elapsedTime;}

/*float*/  //needed return type for finding parallelizable part
void scanMultiBlock(long long int *device_output, long long int *device_input, long long int length,long long int operation, long long int identity) {
	long long int reminder = length % (ELEMENTS_PER_BLOCK);
	
	//float temp_time =0, elapsed_time = 0; //needed for finding parallelizable part
	if (reminder != 0) 
	{
		// perform a large scan on a compatible multiple of elements
		long long int blockMultiple = length - reminder;
		/*elapsed_time += */scanBlockSizedArray(device_output, device_input, blockMultiple,  operation, identity); // needed varaible for finding parallelizable part

		// scan the remaining elements and add the (inclusive) last element of the large scan to this
		long long int *startOfOutputArray = &(device_output[blockMultiple]);
		long long int *startOfInputArray = &(device_input[blockMultiple]);
		/*elapsed_time +=*/ scanSingleBlock(startOfOutputArray, startOfInputArray, reminder,  operation, identity);// needed varaible for finding parallelizable part
		/*
		// needed for finding parallelizable part 
		cudaEvent_t initial, final;
		cudaEventCreate(&initial);
		cudaEventCreate(&final);
		// starting the timer given in CUDA Library
		cudaEventRecord(initial);
		*/
		switch(operation)
		{
			case 1:
			{
				add_three<<<1, reminder>>>(startOfOutputArray, reminder, &(device_input[blockMultiple - 1]), &(device_output[blockMultiple - 1]));
				break;
			}
			case 2:
			{
				add_three<<<1, reminder>>>(startOfOutputArray, reminder, &(device_input[blockMultiple - 1]), &(device_output[blockMultiple - 1]));
				break;
			}
			case 3:
			{
				max_three<<<1, reminder>>>(startOfOutputArray, reminder, &(device_input[blockMultiple - 1]), &(device_output[blockMultiple - 1]));
				break;
			}
			
			case 4:
			{
				min_three<<<1, reminder>>>(startOfOutputArray, reminder, &(device_input[blockMultiple - 1]), &(device_output[blockMultiple - 1]));
				break;
			}
		}
		/*
		Needed for finding parallelizable part
		cudaEventRecord(final);
		cudaEventSynchronize(final);
		cudaEventElapsedTime(&temp_time, initial, final);
		elapsed_time += temp_time
		cudaFree(device_input);
		cudaFree(device_output);
		cudaEventDestroy(final);
		cudaEventDestroy(initial);
		return elapsed_time;
		*/

	}
	else 
	{
		// Both the comments are needed for finding parallelizable part 
		/*float elapsed_time = */ scanBlockSizedArray(device_output, device_input, length,  operation, identity);	
		/*return elapsed_time;*/
	}
}

/*float*/
void scanSingleBlock(long long int *device_output, long long int *device_input, long long int length,long long int operation, long long int identity) {

		long long int nextPowerOfTwo = 1;
		while (nextPowerOfTwo < length) 
		{
			nextPowerOfTwo *= 2;
		}
		/*
		Needed for finding parallelizable part
		float elapsed_time = 0;
		cudaEvent_t initial, final;
		cudaEventCreate(&initial);
		cudaEventCreate(&final);
		// starting the timer given in CUDA Library
		cudaEventRecord(initial);
		*/
		prescan_SingleBlock<<<1, (length + 1) / 2, 2 * nextPowerOfTwo * sizeof(long long int)>>>(device_output, device_input, length, nextPowerOfTwo, operation, identity);	
		/*
		Needed for finding parallelizable part
		
		cudaEventRecord(final);
		cudaEventSynchronize(final);
		cudaEventElapsedTime(&elapsed_time, initial, final);
		cudaFree(device_input);
		cudaFree(device_output);
		cudaEventDestroy(final);
		cudaEventDestroy(initial);
		return elapsed_time;
		*/
}

/*float*/
void scanBlockSizedArray(long long int *device_output, long long int *device_input, long long int length, long long int operation, long long int identity) {
	long long int num_blocks = length / ELEMENTS_PER_BLOCK;
	long long int sharedMemBlockSize = ELEMENTS_PER_BLOCK * sizeof(long long int);

	long long int *device_blocks, *device_inputcr;
	hipMalloc((void **)&device_blocks, num_blocks * sizeof(long long int));
	hipMalloc((void **)&device_inputcr, num_blocks * sizeof(long long int));
	/*
	Needed for finding parallelizable part	
	float elapsed_time = 0, temp_time;
	cudaEvent_t initial, final;
	cudaEventCreate(&initial);
	cudaEventCreate(&final);
	// starting the timer given in CUDA Library
	cudaEventRecord(initial);
	*/
	prescan_MultiBlock<<<num_blocks, THREADS_PER_BLOCK, 2*sharedMemBlockSize>>>(device_output, device_input, ELEMENTS_PER_BLOCK, device_blocks, operation, identity);
	/*
	Needed for finding parallelizable part

	cudaEventRecord(final);
	cudaEventSynchronize(final);
	cudaEventElapsedTime(&elapsed_time, initial, final);
	cudaFree(device_input);
	cudaFree(device_output);
	cudaEventDestroy(final);
	cudaEventDestroy(initial);
	*/
	if ((num_blocks + 1) / 2 < THREADS_PER_BLOCK) 
	{
		//Needed for finding parallelizable part
		/*elapsed_time+=*/scanSingleBlock(device_inputcr, device_blocks, num_blocks,  operation, identity);
	}
	else 
	{
		// Needed for finding parallelizable part
		/*elapsed_time+= */scanMultiBlock(device_inputcr, device_blocks, num_blocks,  operation, identity);
	}
	/*
	Needed for finding parallelizable part
	cudaEventCreate(&initial);
	cudaEventCreate(&final);
	// starting the timer given in CUDA Library
	cudaEventRecord(initial);
	*/
	switch(operation)
		{
			case 1:
			{
				add_two<<<num_blocks, ELEMENTS_PER_BLOCK>>>(device_output, ELEMENTS_PER_BLOCK, device_inputcr);
				break;
			}
			case 2:
			{
				add_two<<<num_blocks, ELEMENTS_PER_BLOCK>>>(device_output, ELEMENTS_PER_BLOCK, device_inputcr);
				break;
			}
			case 3:
			{
				max_two<<<num_blocks, ELEMENTS_PER_BLOCK>>>(device_output, ELEMENTS_PER_BLOCK, device_inputcr);
				break;
			}
			
			case 4:
			{
				min_two<<<num_blocks, ELEMENTS_PER_BLOCK>>>(device_output, ELEMENTS_PER_BLOCK, device_inputcr);
				break;
			}
		}
	/*
	Needed for finding parallelizable part
	
	cudaEventRecord(final);
	cudaEventSynchronize(final);
	cudaEventElapsedTime(&temp_time, initial, final);
	cudaFree(device_input);
	cudaFree(device_output);
	cudaEventDestroy(final);
	cudaEventDestroy(initial);
	elapsed_time +=  temp_time
	cudaFree(device_inputcr);
	cudaFree(device_blocks);
	return elapsed_time;
	*/
	}

__global__ void prescan_SingleBlock(long long int *output, long long int *input, long long int n, long long int nextPowerOfTwo, long long int operation, long long int identity)
{
	extern __shared__ long long int temp[];
	long long int threadID = threadIdx.x;
	long long int offset = 1;

	long long int index1 = threadID;
	long long int index2 = threadID + (n / 2);
	long long int bankOffsetB = CONFLICT_FREE_OFFSET(index2);
	long long int bankOffsetA = CONFLICT_FREE_OFFSET(index1);

	if (threadID >= n) {
		temp[index1 + bankOffsetA] = 0;
		temp[index2 + bankOffsetB] = 0;
	}

	else 
	{
			temp[index1 + bankOffsetA] = input[index1];
			temp[index2 + bankOffsetB] = input[index2];
	}


	for (long long int d = nextPowerOfTwo/2; d > 0; d= d/2) // Do the reduction by building a operation(like sum) tree in place
	{
		__syncthreads();
		
		if (threadID < d)
		{
			long long int index1 = offset * (2 * threadID + 1) - 1;
			long long int index2 = offset * (2 * threadID + 2) - 1;
			index1 += CONFLICT_FREE_OFFSET(index1);
			index2 += CONFLICT_FREE_OFFSET(index2);
			switch(operation)
			{
				case 1:
				{
					temp[index2] += temp[index1];
					break;
				}
			
				case 2:
				{
					temp[index2] += temp[index1];
					break;
				}
				case 3:
				{
					if(temp[index2] < temp[index1])
						temp[index2] = temp[index1];
					break;
				}
				case 4:
				{
					if(temp[index2] > temp[index1])
						temp[index2] = temp[index1];
					break;
				}}
		}
		offset *= 2;
	}
	__syncthreads();
	
	if (threadID == 0) 
	{		/*
			//FOR DEBUGGIN PURPOSE PLEASE IGNORE
			printf("%s\n", "TEMP");
			for(long long int i=0; i < n; i++)
			{
				printf("%lld ",temp[i]);
			}
			printf("\n");
			*/
		if(operation!=4)
		{
				temp[nextPowerOfTwo - 1 + CONFLICT_FREE_OFFSET(nextPowerOfTwo - 1)] = 0; // clear the last element for exclusive scan
		}
		else
		{
				temp[nextPowerOfTwo - 1 + CONFLICT_FREE_OFFSET(nextPowerOfTwo - 1)] = identity; // clear the last element for exclusive scan
		}
	}

	for (long long int d = 1; d < nextPowerOfTwo; d *= 2) // traverse down tree & build scan
	{
		offset = offset/2;
		__syncthreads();
		if (threadID < d)
		{
			long long int index1 = offset * (2 * threadID + 1) - 1;
			long long int index2 = offset * (2 * threadID + 2) - 1;
			index1 += CONFLICT_FREE_OFFSET(index1);
			index2 += CONFLICT_FREE_OFFSET(index2);

			long long int t = temp[index1];
			temp[index1] = temp[index2];
			switch(operation)
			{
				case 1:
				{
					temp[index2] += t;
					break;
				}
				case 2:
				{
					temp[index2] += t;
					break;
				}
				case 3:
				{
					if(temp[index2] < t)
						temp[index2] = t;
					break;
				}
				case 4:
				{
					if(temp[index2] > t)
						temp[index2] = t;
					break;
				}}
		}
	}
	__syncthreads();

	if (threadID < n) 
	{
		output[index1] = temp[index1 + bankOffsetA];
		output[index2] = temp[index2 + bankOffsetB];
	}}

__global__ void prescan_MultiBlock(long long int *output, long long int *input, long long int n, long long int *sums,long long int operation,long long int identity) {
	extern __shared__ long long int temp[];

	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * n;

	long long int index1 = threadID;
	long long int index2 = threadID + (n / 2);
	long long int bankOffsetA = CONFLICT_FREE_OFFSET(index1);
	long long int bankOffsetB = CONFLICT_FREE_OFFSET(index2);
	temp[index1 + bankOffsetA] = input[blockOffset + index1];
	temp[index2 + bankOffsetB] = input[blockOffset + index2];

	long long int offset = 1;
	for (long long int d = n >> 1; d > 0; d >>= 1) // build sum in place up the tree
	{
		__syncthreads();
		if (threadID < d)
		{
			long long int index1 = offset * (2 * threadID + 1) - 1;
			long long int index2 = offset * (2 * threadID + 2) - 1;
			index1 += CONFLICT_FREE_OFFSET(index1);
			index2 += CONFLICT_FREE_OFFSET(index2);
			switch(operation)
			{
				case 1:
				{
					temp[index2] += temp[index1];
					break;
				}
				case 2:
				{
					temp[index2] += temp[index1];
					break;
				}
				case 3:
				{
					if(temp[index2] < temp[index1])
						temp[index2] = temp[index1];
					break;
				}
				case 4:
				{
					if(temp[index2] > temp[index1])
						temp[index2] = temp[index1];
				}
			}
		}
		offset *= 2;
	}
	__syncthreads();


	if (threadID == 0) 
	{
		sums[blockID] = temp[n - 1 + CONFLICT_FREE_OFFSET(n - 1)];
		if(operation!=4)
		{
			temp[n - 1 + CONFLICT_FREE_OFFSET(n - 1)] = 0;
		}
		else
		{
			temp[n - 1 + CONFLICT_FREE_OFFSET(n - 1)] = identity;
		}
	}

	for (long long int d = 1; d < n; d *= 2) // traverse down tree & build scan
	{
		offset >>= 1;
		__syncthreads();
		if (threadID < d)
		{
			long long int index1 = offset * (2 * threadID + 1) - 1;
			long long int index2 = offset * (2 * threadID + 2) - 1;
			index1 += CONFLICT_FREE_OFFSET(index1);
			index2 += CONFLICT_FREE_OFFSET(index2);

			long long int t = temp[index1];
			temp[index1] = temp[index2];
			switch(operation)
			{
				case 1:
				{
					temp[index2] += t;
					break;
				}
				case 2:
				{
					temp[index2] += t;
					break;
				}
				case 3:
				{
					if(temp[index2] < t)
						temp[index2] = t;
					break;
				}
				case 4:
				{
					if(temp[index2] > t)
						temp[index2] = t;
					break;
				}
			}
		}
	}
	__syncthreads();

	output[blockOffset + index1] = temp[index1 + bankOffsetA];
	output[blockOffset + index2] = temp[index2 + bankOffsetB];
}


//functions to add two or three numbers in given arrays
__global__ void add_two(long long int *output, long long int length, long long int *n) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;

	output[blockOffset + threadID] += n[blockID];}
__global__ void add_three(long long int *output, long long int length, long long int *n1, long long int *n2) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;

	output[blockOffset + threadID] += n1[blockID] + n2[blockID];}

//functions to find maximum of two or three numbers in given arrays
__global__ void max_two(long long int *output, long long int length, long long int *n) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;
	if(output[blockOffset + threadID] < n[blockID])
	{
			output[blockOffset + threadID] = n[blockID];
	}}
__global__ void max_three(long long int *output, long long int length, long long int *n1, long long int *n2) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;
	if(n1[blockID] > n2[blockID])
	{
		if(n1[blockID] > output[blockOffset + threadID])
		{
			output[blockOffset + threadID] = n1[blockID];
		}
	}
	else
	{
		if(n2[blockID] > output[blockOffset + threadID])
		{
			output[blockOffset + threadID] = n2[blockID];
		}
	}}

//functions to find minimum of two or three numbers in given arrays
__global__ void min_two(long long int *output, long long int length, long long int *n) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;

	if(output[blockOffset + threadID] > n[blockID])
	{
			output[blockOffset + threadID] = n[blockID];
	}}
__global__ void min_three(long long int *output, long long int length, long long int *n1, long long int *n2) {
	long long int blockID = blockIdx.x;
	long long int threadID = threadIdx.x;
	long long int blockOffset = blockID * length;

	if(n1[blockID] < n2[blockID])
	{
		if(n1[blockID] < output[blockOffset + threadID])
		{
			output[blockOffset + threadID] = n1[blockID];
		}
	}
	else
	{
		if(n2[blockID] < output[blockOffset + threadID])
		{
			output[blockOffset + threadID] = n2[blockID];
		}
	}}

void _checkCudaError(const char *message, hipError_t err, const char *caller) {
	if (err != hipSuccess) {
		fprintf(stderr, "Error in: %s\n", caller);
		fprintf(stderr, "%s\n", message);
		fprintf(stderr, ": %s\n", hipGetErrorString(err));
		exit(0);}}

void printResult(const char* Heading, long long int result, float milliseconds) {
	printf("%s\n", Heading);
	printf("Final Reduction is %lld and it was done in %lf ms\n", result, milliseconds);}

void printArrayInFile (const char* Header ,long long int Output[], long long int start, long long int end){
	FILE* fp = fopen("output.txt", "a");
	fprintf(fp, "%s\n", Header);
	for(long long int i=start; i < end; i++)
	{
		fprintf(fp, "%lld ",Output[i]);
	}
	fprintf(fp, "\n");
	fclose(fp);}

void check(long long int* CPU_Vector,long long int* GPU_Vector, long long int start, long long int end)
{
	for(int i=start; i < end; i++)
	{
		if(CPU_Vector[i]!=GPU_Vector[i])
		{
			printf("Outputs don't match\n");
			return;
		}
	}
	printf("Outputs do match, The implementation is successful\n");}

	.text
	.file	"scan_CUDA.hip"
	.globl	_Z4Scanxxxx                     # -- Begin function _Z4Scanxxxx
	.type	_Z4Scanxxxx,@function
_Z4Scanxxxx:                            # @_Z4Scanxxxx
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	movq	%rdx, 8(%rsp)                   # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	leaq	32(%rsp), %rdi
	callq	time
	movl	%eax, %edi
	callq	srand
	leaq	8(,%rbx,8), %rbp
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, %r14
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, %r13
	cmpq	$1, %r12
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	jne	.LBB0_7
# %bb.1:
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	callq	rand
	cltq
	imulq	$1125899907, %rax, %rcx         # imm = 0x431BDE83
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$50, %rcx
	addl	%edx, %ecx
	imull	$1000000, %ecx, %ecx            # imm = 0xF4240
	subl	%ecx, %eax
	cltq
	movq	%rax, (%r14)
	movq	%rax, (%r13)
	cmpq	$2, %rbx
	jl	.LBB0_4
# %bb.2:                                # %.lr.ph110.preheader
	movl	$1, %r15d
.LBB0_3:                                # %.lr.ph110
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$1125899907, %rax, %rcx         # imm = 0x431BDE83
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$50, %rcx
	addl	%edx, %ecx
	imull	$1000000, %ecx, %ecx            # imm = 0xF4240
	subl	%ecx, %eax
	cltq
	movq	%rax, (%r14,%r15,8)
	negq	%rax
	movq	%rax, (%r13,%r15,8)
	incq	%r15
	cmpq	%r15, %rbx
	jne	.LBB0_3
.LBB0_4:                                # %._crit_edge111
	movq	8(%rsp), %r12                   # 8-byte Reload
	cmpq	$3, %r12
	je	.LBB0_13
# %bb.5:                                # %._crit_edge111
	cmpq	$4, %r12
	jne	.LBB0_18
# %bb.6:
	movabsq	$9223372036854775807, %rax      # imm = 0x7FFFFFFFFFFFFFFF
	jmp	.LBB0_14
.LBB0_7:
	movl	$.L.str.2, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.3, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movq	(%r14), %rax
	movq	%rax, (%r13)
	cmpq	$2, %rbx
	jl	.LBB0_10
# %bb.8:                                # %.lr.ph.preheader
	leaq	-1(%rbx), %r13
	movq	16(%rsp), %r15                  # 8-byte Reload
	addq	$8, %r15
	movq	%r14, %r12
	addq	$8, %r12
.LBB0_9:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	$.L.str.3, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movq	(%r12), %rax
	xorl	%ecx, %ecx
	subq	%rax, %rcx
	movq	%rcx, (%r15)
	addq	$8, %r15
	addq	$8, %r12
	decq	%r13
	jne	.LBB0_9
.LBB0_10:                               # %._crit_edge
	movq	8(%rsp), %r12                   # 8-byte Reload
	cmpq	$3, %r12
	je	.LBB0_16
# %bb.11:                               # %._crit_edge
	cmpq	$4, %r12
	jne	.LBB0_19
# %bb.12:
	movabsq	$9223372036854775807, %rax      # imm = 0x7FFFFFFFFFFFFFFF
	jmp	.LBB0_17
.LBB0_13:
	movabsq	$9223372036854775807, %rax      # imm = 0x7FFFFFFFFFFFFFFF
	incq	%rax
.LBB0_14:
	movq	%rax, (%r14,%rbx,8)
	jmp	.LBB0_15
.LBB0_16:
	movabsq	$9223372036854775807, %rax      # imm = 0x7FFFFFFFFFFFFFFF
	incq	%rax
.LBB0_17:
	movq	%rax, (%r14,%rbx,8)
	jmp	.LBB0_20
.LBB0_18:
	xorl	%eax, %eax
	movq	%rax, (%r14,%rbx,8)
	movq	%rax, (%r13,%rbx,8)
.LBB0_15:
	movl	$.Lstr.2, %edi
	jmp	.LBB0_21
.LBB0_19:
	xorl	%eax, %eax
	movq	%rax, (%r14,%rbx,8)
	movq	16(%rsp), %rcx                  # 8-byte Reload
	movq	%rax, (%rcx,%rbx,8)
.LBB0_20:
	movl	$.Lstr, %edi
.LBB0_21:
	leaq	1(%rbx), %r15
	callq	puts@PLT
	cmpq	$0, 24(%rsp)                    # 8-byte Folded Reload
	movq	%r15, 8(%rsp)                   # 8-byte Spill
	je	.LBB0_23
# %bb.22:
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movl	$.L.str.6, %edi
	movl	$.L.str.7, %esi
	callq	fopen
	movq	%rax, %r13
	movl	$.L.str.8, %edi
	movq	%r14, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rcx
	callq	_Z16printArrayInFilePKcPxxx
	movq	%r13, %rdi
	movq	8(%rsp), %r15                   # 8-byte Reload
	callq	fclose
	movl	$.Lstr.4, %edi
	callq	puts@PLT
.LBB0_23:
	movq	%rbp, %rdi
	callq	malloc
	movq	%rax, %rbp
	movl	$.Lstr.5, %edi
	callq	puts@PLT
	movq	%rbp, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%r12, %rcx
	callq	_Z15sequential_scanPxS_xx
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
	movl	$.Lstr.6, %edi
	callq	puts@PLT
	movq	(%rbp,%rbx,8), %r13
	movl	$.L.str.12, %edi
	callq	puts@PLT
	xorps	%xmm0, %xmm0
	cvtss2sd	4(%rsp), %xmm0                  # 4-byte Folded Reload
	movl	$.L.str.43, %edi
	movq	%r13, %rsi
	movb	$1, %al
	callq	printf
	cmpq	$0, 24(%rsp)                    # 8-byte Folded Reload
	je	.LBB0_25
# %bb.24:
	movl	$.Lstr.7, %edi
	callq	puts@PLT
	movl	$.L.str.14, %edi
	movl	$1, %edx
	movq	%rbp, %rsi
	movq	%r15, %rcx
	callq	_Z16printArrayInFilePKcPxxx
	movl	$.Lstr.8, %edi
	callq	puts@PLT
.LBB0_25:
	movl	$.Lstr.9, %edi
	callq	puts@PLT
	leaq	(,%rbx,8), %rdi
	callq	malloc
	movq	%rax, %r13
	movl	$.Lstr.10, %edi
	callq	puts@PLT
	cmpq	$2, %r12
	jne	.LBB0_27
# %bb.26:
	movl	$2, %ecx
	movq	%r13, %rdi
	movq	16(%rsp), %rsi                  # 8-byte Reload
	movq	8(%rsp), %rdx                   # 8-byte Reload
	jmp	.LBB0_28
.LBB0_27:
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	8(%rsp), %rdx                   # 8-byte Reload
	movq	%r12, %rcx
.LBB0_28:
	callq	_Z4scanPxS_xx
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
	movq	(%r13,%rbx,8), %r12
	movl	$.L.str.18, %edi
	callq	puts@PLT
	xorps	%xmm0, %xmm0
	cvtss2sd	4(%rsp), %xmm0                  # 4-byte Folded Reload
	movl	$.L.str.43, %edi
	movq	%r12, %rsi
	movb	$1, %al
	callq	printf
	cmpq	$0, 24(%rsp)                    # 8-byte Folded Reload
	je	.LBB0_30
# %bb.29:
	movl	$.Lstr.11, %edi
	callq	puts@PLT
	movl	$.L.str.20, %edi
	movl	$1, %edx
	movq	%r13, %rsi
	movq	8(%rsp), %rcx                   # 8-byte Reload
	callq	_Z16printArrayInFilePKcPxxx
	movl	$.Lstr.12, %edi
	callq	puts@PLT
	movl	$.Lstr.13, %edi
	callq	puts@PLT
.LBB0_30:
	movl	$.Lstr.15, %edi
	testq	%rbx, %rbx
	jle	.LBB0_35
# %bb.31:                               # %.lr.ph.i.preheader
	xorl	%eax, %eax
.LBB0_32:                               # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movq	8(%rbp,%rax,8), %rcx
	cmpq	8(%r13,%rax,8), %rcx
	jne	.LBB0_34
# %bb.33:                               #   in Loop: Header=BB0_32 Depth=1
	incq	%rax
	cmpq	%rax, %rbx
	jne	.LBB0_32
	jmp	.LBB0_35
.LBB0_34:
	movl	$.Lstr.14, %edi
.LBB0_35:                               # %_Z5checkPxS_xx.exit
	callq	puts@PLT
	movq	%r14, %rdi
	callq	free
	movq	16(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	%r13, %rdi
	callq	free
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z4Scanxxxx, .Lfunc_end0-_Z4Scanxxxx
	.cfi_endproc
                                        # -- End function
	.globl	_Z16printArrayInFilePKcPxxx     # -- Begin function _Z16printArrayInFilePKcPxxx
	.type	_Z16printArrayInFilePKcPxxx,@function
_Z16printArrayInFilePKcPxxx:            # @_Z16printArrayInFilePKcPxxx
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	movl	$.L.str.6, %edi
	movl	$.L.str.44, %esi
	callq	fopen
	movq	%rax, %r12
	movl	$.L.str.41, %esi
	movq	%rax, %rdi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	fprintf
	cmpq	%rbx, %r14
	jge	.LBB1_2
.LBB1_1:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	(%r15,%r14,8), %rdx
	movl	$.L.str.45, %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	fprintf
	incq	%r14
	cmpq	%r14, %rbx
	jne	.LBB1_1
.LBB1_2:                                # %._crit_edge
	movl	$10, %edi
	movq	%r12, %rsi
	callq	fputc@PLT
	movq	%r12, %rdi
	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
	jmp	fclose                          # TAILCALL
.Lfunc_end1:
	.size	_Z16printArrayInFilePKcPxxx, .Lfunc_end1-_Z16printArrayInFilePKcPxxx
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z15sequential_scanPxS_xx
.LCPI2_0:
	.long	0x49742400                      # float 1.0E+6
.LCPI2_1:
	.long	0x447a0000                      # float 1000
	.text
	.globl	_Z15sequential_scanPxS_xx
	.type	_Z15sequential_scanPxS_xx,@function
_Z15sequential_scanPxS_xx:              # @_Z15sequential_scanPxS_xx
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	decq	%r12
	cmpq	$3, %r12
	ja	.LBB2_14
# %bb.1:
	jmpq	*.LJTI2_0(,%r12,8)
.LBB2_2:
	movq	$0, (%r15)
	movq	(%r14), %rax
	movq	%rax, 8(%r15)
	cmpq	$3, %rbx
	jl	.LBB2_14
# %bb.3:                                # %.lr.ph78.preheader
	addq	$-2, %rbx
	xorl	%ecx, %ecx
.LBB2_4:                                # %.lr.ph78
                                        # =>This Inner Loop Header: Depth=1
	addq	8(%r14,%rcx,8), %rax
	movq	%rax, 16(%r15,%rcx,8)
	incq	%rcx
	cmpq	%rcx, %rbx
	jne	.LBB2_4
	jmp	.LBB2_14
.LBB2_8:
	movabsq	$9223372036854775807, %rax      # imm = 0x7FFFFFFFFFFFFFFF
	incq	%rax
	movq	%rax, (%r15)
	movq	(%r14), %rax
	movq	%rax, 8(%r15)
	cmpq	$3, %rbx
	jl	.LBB2_14
# %bb.9:                                # %.lr.ph74.preheader
	addq	$-2, %rbx
	xorl	%ecx, %ecx
.LBB2_10:                               # %.lr.ph74
                                        # =>This Inner Loop Header: Depth=1
	movq	8(%r14,%rcx,8), %rdx
	cmpq	%rax, %rdx
	cmovgq	%rdx, %rax
	movq	%rax, 16(%r15,%rcx,8)
	incq	%rcx
	cmpq	%rcx, %rbx
	jne	.LBB2_10
	jmp	.LBB2_14
.LBB2_11:
	movabsq	$9223372036854775807, %rax      # imm = 0x7FFFFFFFFFFFFFFF
	movq	%rax, (%r15)
	movq	(%r14), %rax
	movq	%rax, 8(%r15)
	cmpq	$3, %rbx
	jl	.LBB2_14
# %bb.12:                               # %.lr.ph.preheader
	addq	$-2, %rbx
	xorl	%ecx, %ecx
.LBB2_13:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	8(%r14,%rcx,8), %rdx
	cmpq	%rax, %rdx
	cmovlq	%rdx, %rax
	movq	%rax, 16(%r15,%rcx,8)
	incq	%rcx
	cmpq	%rcx, %rbx
	jne	.LBB2_13
	jmp	.LBB2_14
.LBB2_5:
	movq	$0, (%r15)
	movq	(%r14), %rax
	movq	%rax, 8(%r15)
	cmpq	$3, %rbx
	jl	.LBB2_14
# %bb.6:                                # %.lr.ph76.preheader
	addq	$-2, %rbx
	xorl	%ecx, %ecx
.LBB2_7:                                # %.lr.ph76
                                        # =>This Inner Loop Header: Depth=1
	subq	8(%r14,%rcx,8), %rax
	movq	%rax, 16(%r15,%rcx,8)
	incq	%rcx
	cmpq	%rcx, %rbx
	jne	.LBB2_7
.LBB2_14:                               # %.loopexit
	leaq	24(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	subq	8(%rsp), %rax
	movq	8(%rbx), %rcx
	cvtsi2ss	%rax, %xmm1
	mulss	.LCPI2_0(%rip), %xmm1
	subq	16(%rsp), %rcx
	cvtsi2ss	%rcx, %xmm0
	addss	%xmm1, %xmm0
	divss	.LCPI2_1(%rip), %xmm0
	addq	$40, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z15sequential_scanPxS_xx, .Lfunc_end2-_Z15sequential_scanPxS_xx
	.cfi_endproc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.LJTI2_0:
	.quad	.LBB2_2
	.quad	.LBB2_5
	.quad	.LBB2_8
	.quad	.LBB2_11
                                        # -- End function
	.text
	.globl	_Z11printResultPKcxf            # -- Begin function _Z11printResultPKcxf
	.type	_Z11printResultPKcxf,@function
_Z11printResultPKcxf:                   # @_Z11printResultPKcxf
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -16
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movq	%rsi, %rbx
	callq	puts@PLT
	xorps	%xmm0, %xmm0
	cvtss2sd	12(%rsp), %xmm0                 # 4-byte Folded Reload
	movl	$.L.str.43, %edi
	movq	%rbx, %rsi
	movb	$1, %al
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.Lfunc_end3:
	.size	_Z11printResultPKcxf, .Lfunc_end3-_Z11printResultPKcxf
	.cfi_endproc
                                        # -- End function
	.globl	_Z4scanPxS_xx                   # -- Begin function _Z4scanPxS_xx
	.type	_Z4scanPxS_xx,@function
_Z4scanPxS_xx:                          # @_Z4scanPxS_xx
	.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	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, 24(%rsp)                  # 8-byte Spill
	movq	%rdi, %r13
	leaq	(,%rdx,8), %rbx
	leaq	16(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	leaq	40(%rsp), %r14
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	movq	(%rbp), %rdi
	movq	%r13, 32(%rsp)                  # 8-byte Spill
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r14), %rdi
	movq	%r14, %r13
	movq	24(%rsp), %rsi                  # 8-byte Reload
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	8(%rsp), %r14
	movq	%r14, %rdi
	callq	hipEventCreate
	movq	%rsp, %rdi
	callq	hipEventCreate
	movq	(%r14), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	hipEventRecord
	movabsq	$9223372036854775807, %rax      # imm = 0x7FFFFFFFFFFFFFFF
	leaq	1(%rax), %r8
	cmpq	$3, %r15
	cmovneq	%r14, %r8
	cmpq	$4, %r15
	cmoveq	%rax, %r8
	movq	(%rbp), %rdi
	movq	(%r13), %rsi
	cmpq	%r12, ELEMENTS_PER_BLOCK(%rip)
	jge	.LBB4_1
# %bb.2:
	movq	%r12, %rdx
	movq	%r15, %rcx
	callq	_Z14scanMultiBlockPxS_xxx
	jmp	.LBB4_3
.LBB4_1:
	movq	%r12, %rdx
	movq	%r15, %rcx
	callq	_Z15scanSingleBlockPxS_xxx
.LBB4_3:
	movq	(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%rsp), %rdi
	callq	hipEventSynchronize
	leaq	52(%rsp), %r15
	movl	$0, (%r15)
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
	movq	%r15, %rdi
	callq	hipEventElapsedTime
	movq	16(%rsp), %rsi
	movq	32(%rsp), %rdi                  # 8-byte Reload
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	(%rsp), %rdi
	callq	hipEventDestroy
	movq	8(%rsp), %rdi
	callq	hipEventDestroy
	movss	(%r15), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z4scanPxS_xx, .Lfunc_end4-_Z4scanPxS_xx
	.cfi_endproc
                                        # -- End function
	.globl	_Z5checkPxS_xx                  # -- Begin function _Z5checkPxS_xx
	.type	_Z5checkPxS_xx,@function
_Z5checkPxS_xx:                         # @_Z5checkPxS_xx
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rax
	movslq	%edx, %rdx
	movl	$.Lstr.15, %edi
	cmpq	%rcx, %rdx
	jge	puts@PLT                        # TAILCALL
	jmp	.LBB5_2
.LBB5_1:                                #   in Loop: Header=BB5_2 Depth=1
	incq	%rdx
	cmpq	%rcx, %rdx
	jge	puts@PLT                        # TAILCALL
.LBB5_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rax,%rdx,8), %r8
	cmpq	(%rsi,%rdx,8), %r8
	je	.LBB5_1
# %bb.3:
	movl	$.Lstr.14, %edi
	jmp	puts@PLT                        # TAILCALL
.Lfunc_end5:
	.size	_Z5checkPxS_xx, .Lfunc_end5-_Z5checkPxS_xx
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	xorl	%r14d, %r14d
	leaq	16(%rsp), %rbx
	movq	%r14, (%rbx)
	movq	%r14, 32(%rsp)
	movq	%r14, 24(%rsp)
	movb	$0, 15(%rsp)
	movl	$.Lstr.16, %edi
	callq	puts@PLT
	movl	$.L.str.3, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	cmpq	%r14, (%rbx)
	jle	.LBB6_1
# %bb.3:
	movl	$.Lstr.17, %edi
	callq	puts@PLT
	movq	16(%rsp), %rsi
	movl	$.L.str.27, %edi
	xorl	%eax, %eax
	callq	printf
	movq	16(%rsp), %rsi
	movl	$.L.str.28, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.Lstr.18, %edi
	callq	puts@PLT
	leaq	32(%rsp), %rbx
	movl	$.L.str.3, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	$10, %edi
	callq	putchar@PLT
	movq	(%rbx), %rax
	addq	$-3, %rax
	cmpq	$-3, %rax
	ja	.LBB6_5
# %bb.4:
	movl	$.Lstr.28, %edi
	jmp	.LBB6_2
.LBB6_1:
	movl	$.Lstr.30, %edi
	jmp	.LBB6_2
.LBB6_5:
	movl	$.Lstr.19, %edi
	callq	puts@PLT
	movl	$.Lstr.20, %edi
	callq	puts@PLT
	movl	$.Lstr.21, %edi
	callq	puts@PLT
	leaq	24(%rsp), %rbx
	movl	$.L.str.3, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	$10, %edi
	callq	putchar@PLT
	movq	(%rbx), %rax
	addq	$-5, %rax
	cmpq	$-5, %rax
	ja	.LBB6_7
# %bb.6:
	movl	$.Lstr.26, %edi
	jmp	.LBB6_2
.LBB6_7:
	callq	getchar
	movl	$.Lstr.22, %edi
	callq	puts@PLT
	movl	$.Lstr.23, %edi
	callq	puts@PLT
	leaq	15(%rsp), %rbx
	movl	$.L.str.38, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	$10, %edi
	callq	putchar@PLT
	movzbl	(%rbx), %eax
	cmpl	$110, %eax
	je	.LBB6_11
# %bb.8:
	cmpl	$121, %eax
	jne	.LBB6_9
# %bb.10:
	movq	16(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
	movl	$1, %ecx
	jmp	.LBB6_12
.LBB6_11:
	movq	16(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
	xorl	%ecx, %ecx
.LBB6_12:
	callq	_Z4Scanxxxx
	jmp	.LBB6_13
.LBB6_9:
	movl	$.Lstr.24, %edi
.LBB6_2:
	callq	puts@PLT
	movl	$.Lstr.31, %edi
	callq	puts@PLT
.LBB6_13:
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	main, .Lfunc_end6-main
	.cfi_endproc
                                        # -- End function
	.globl	_Z15scanSingleBlockPxS_xxx      # -- Begin function _Z15scanSingleBlockPxS_xxx
	.type	_Z15scanSingleBlockPxS_xxx,@function
_Z15scanSingleBlockPxS_xxx:             # @_Z15scanSingleBlockPxS_xxx
	.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
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r8, %rbx
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	movl	$1, %eax
.LBB7_1:                                # =>This Inner Loop Header: Depth=1
	movq	%rax, %rbp
	addq	%rax, %rax
	cmpq	%r15, %rbp
	jl	.LBB7_1
# %bb.2:
	leaq	1(%r15), %rax
	shrq	$63, %rax
	addq	%r15, %rax
	incq	%rax
	shrq	%rax
	movq	%rbp, %r8
	shlq	$4, %r8
	movl	%eax, %edx
	btsq	$32, %rdx
	movabsq	$4294967296, %rdi               # imm = 0x100000000
	orq	$1, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	je	.LBB7_4
# %bb.3:
	addq	$8, %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
.LBB7_4:
	.cfi_def_cfa_offset 64
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	%rbp, %rcx
	movq	%r14, %r8
	movq	%rbx, %r9
	addq	$8, %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	_Z34__device_stub__prescan_SingleBlockPxS_xxxx # TAILCALL
.Lfunc_end7:
	.size	_Z15scanSingleBlockPxS_xxx, .Lfunc_end7-_Z15scanSingleBlockPxS_xxx
	.cfi_endproc
                                        # -- End function
	.globl	_Z14scanMultiBlockPxS_xxx       # -- Begin function _Z14scanMultiBlockPxS_xxx
	.type	_Z14scanMultiBlockPxS_xxx,@function
_Z14scanMultiBlockPxS_xxx:              # @_Z14scanMultiBlockPxS_xxx
	.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
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r8, %r13
	movq	%rcx, %rbp
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	%rdx, %rax
	cqto
	idivq	ELEMENTS_PER_BLOCK(%rip)
	testq	%rdx, %rdx
	je	.LBB8_9
# %bb.1:
	movq	%rdx, %r14
	subq	%rdx, %rbx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movq	%rbp, %rcx
	movq	%r13, %r8
	callq	_Z19scanBlockSizedArrayPxS_xxx
	leaq	(%r15,%rbx,8), %rdi
	leaq	(%r12,%rbx,8), %rsi
	movq	%rdi, (%rsp)                    # 8-byte Spill
	movq	%r14, %rdx
	movq	%rbp, %rcx
	movq	%r13, %r8
	callq	_Z15scanSingleBlockPxS_xxx
	decq	%rbp
	cmpq	$3, %rbp
	ja	.LBB8_4
# %bb.2:
	jmpq	*.LJTI8_0(,%rbp,8)
.LBB8_3:
	movl	%r14d, %edx
	btsq	$32, %rdx
	movabsq	$4294967296, %rdi               # imm = 0x100000000
	orq	$1, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB8_4
# %bb.10:
	leaq	(%r12,%rbx,8), %rdx
	addq	$-8, %rdx
	leaq	(%r15,%rbx,8), %rcx
	addq	$-8, %rcx
	movq	(%rsp), %rdi                    # 8-byte Reload
	movq	%r14, %rsi
	addq	$8, %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	_Z24__device_stub__add_threePxxS_S_ # TAILCALL
.LBB8_9:
	.cfi_def_cfa_offset 64
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movq	%rbp, %rcx
	movq	%r13, %r8
	addq	$8, %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	_Z19scanBlockSizedArrayPxS_xxx  # TAILCALL
.LBB8_5:
	.cfi_def_cfa_offset 64
	movl	%r14d, %edx
	btsq	$32, %rdx
	movabsq	$4294967296, %rdi               # imm = 0x100000000
	orq	$1, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB8_4
# %bb.6:
	leaq	(%r12,%rbx,8), %rdx
	addq	$-8, %rdx
	leaq	(%r15,%rbx,8), %rcx
	addq	$-8, %rcx
	movq	(%rsp), %rdi                    # 8-byte Reload
	movq	%r14, %rsi
	addq	$8, %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	_Z24__device_stub__max_threePxxS_S_ # TAILCALL
.LBB8_7:
	.cfi_def_cfa_offset 64
	movl	%r14d, %edx
	btsq	$32, %rdx
	movabsq	$4294967296, %rdi               # imm = 0x100000000
	orq	$1, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	je	.LBB8_8
.LBB8_4:
	addq	$8, %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
.LBB8_8:
	.cfi_def_cfa_offset 64
	leaq	(%r12,%rbx,8), %rdx
	addq	$-8, %rdx
	leaq	(%r15,%rbx,8), %rcx
	addq	$-8, %rcx
	movq	(%rsp), %rdi                    # 8-byte Reload
	movq	%r14, %rsi
	addq	$8, %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	_Z24__device_stub__min_threePxxS_S_ # TAILCALL
.Lfunc_end8:
	.size	_Z14scanMultiBlockPxS_xxx, .Lfunc_end8-_Z14scanMultiBlockPxS_xxx
	.cfi_endproc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.LJTI8_0:
	.quad	.LBB8_3
	.quad	.LBB8_3
	.quad	.LBB8_5
	.quad	.LBB8_7
                                        # -- End function
	.text
	.globl	_Z19scanBlockSizedArrayPxS_xxx  # -- Begin function _Z19scanBlockSizedArrayPxS_xxx
	.type	_Z19scanBlockSizedArrayPxS_xxx,@function
_Z19scanBlockSizedArrayPxS_xxx:         # @_Z19scanBlockSizedArrayPxS_xxx
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r8, %r12
	movq	%rcx, %r15
	movq	%rdx, %rax
	movq	%rsi, %rbp
	movq	%rdi, (%rsp)                    # 8-byte Spill
	movq	ELEMENTS_PER_BLOCK(%rip), %rbx
	cqto
	idivq	%rbx
	movq	%rax, %r13
	leaq	(,%rax,8), %r14
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movl	THREADS_PER_BLOCK(%rip), %edx
	shlq	$4, %rbx
	movl	%r13d, %r14d
	btsq	$32, %r14
	btsq	$32, %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	movq	%rbx, %r8
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB9_2
# %bb.1:
	movq	ELEMENTS_PER_BLOCK(%rip), %rdx
	movq	16(%rsp), %rcx
	movq	(%rsp), %rdi                    # 8-byte Reload
	movq	%rbp, %rsi
	movq	%r15, %r8
	movq	%r12, %r9
	callq	_Z33__device_stub__prescan_MultiBlockPxS_xS_xx
.LBB9_2:
	leaq	1(%r13), %rax
	shrq	$63, %rax
	addq	%r13, %rax
	incq	%rax
	sarq	%rax
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
	cmpq	THREADS_PER_BLOCK(%rip), %rax
	jge	.LBB9_4
# %bb.3:
	movq	%r13, %rdx
	movq	%r15, %rcx
	movq	%r12, %r8
	callq	_Z15scanSingleBlockPxS_xxx
	jmp	.LBB9_5
.LBB9_4:
	movq	%r13, %rdx
	movq	%r15, %rcx
	movq	%r12, %r8
	callq	_Z14scanMultiBlockPxS_xxx
.LBB9_5:
	decq	%r15
	cmpq	$3, %r15
	ja	.LBB9_13
# %bb.6:
	movabsq	$4294967296, %rax               # imm = 0x100000000
	jmpq	*.LJTI9_0(,%r15,8)
.LBB9_7:
	movl	ELEMENTS_PER_BLOCK(%rip), %edx
	orq	%rax, %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB9_13
# %bb.8:
	movq	ELEMENTS_PER_BLOCK(%rip), %rsi
	movq	8(%rsp), %rdx
	movq	(%rsp), %rdi                    # 8-byte Reload
	callq	_Z22__device_stub__add_twoPxxS_
	jmp	.LBB9_13
.LBB9_9:
	movl	ELEMENTS_PER_BLOCK(%rip), %edx
	orq	%rax, %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB9_13
# %bb.10:
	movq	ELEMENTS_PER_BLOCK(%rip), %rsi
	movq	8(%rsp), %rdx
	movq	(%rsp), %rdi                    # 8-byte Reload
	callq	_Z22__device_stub__max_twoPxxS_
	jmp	.LBB9_13
.LBB9_11:
	movl	ELEMENTS_PER_BLOCK(%rip), %edx
	orq	%rax, %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB9_13
# %bb.12:
	movq	ELEMENTS_PER_BLOCK(%rip), %rsi
	movq	8(%rsp), %rdx
	movq	(%rsp), %rdi                    # 8-byte Reload
	callq	_Z22__device_stub__min_twoPxxS_
.LBB9_13:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_Z19scanBlockSizedArrayPxS_xxx, .Lfunc_end9-_Z19scanBlockSizedArrayPxS_xxx
	.cfi_endproc
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
.LJTI9_0:
	.quad	.LBB9_7
	.quad	.LBB9_7
	.quad	.LBB9_9
	.quad	.LBB9_11
                                        # -- End function
	.text
	.globl	_Z24__device_stub__add_threePxxS_S_ # -- Begin function _Z24__device_stub__add_threePxxS_S_
	.type	_Z24__device_stub__add_threePxxS_S_,@function
_Z24__device_stub__add_threePxxS_S_:    # @_Z24__device_stub__add_threePxxS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z9add_threePxxS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end10:
	.size	_Z24__device_stub__add_threePxxS_S_, .Lfunc_end10-_Z24__device_stub__add_threePxxS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__max_threePxxS_S_ # -- Begin function _Z24__device_stub__max_threePxxS_S_
	.type	_Z24__device_stub__max_threePxxS_S_,@function
_Z24__device_stub__max_threePxxS_S_:    # @_Z24__device_stub__max_threePxxS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z9max_threePxxS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_Z24__device_stub__max_threePxxS_S_, .Lfunc_end11-_Z24__device_stub__max_threePxxS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__min_threePxxS_S_ # -- Begin function _Z24__device_stub__min_threePxxS_S_
	.type	_Z24__device_stub__min_threePxxS_S_,@function
_Z24__device_stub__min_threePxxS_S_:    # @_Z24__device_stub__min_threePxxS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z9min_threePxxS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end12:
	.size	_Z24__device_stub__min_threePxxS_S_, .Lfunc_end12-_Z24__device_stub__min_threePxxS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z34__device_stub__prescan_SingleBlockPxS_xxxx # -- Begin function _Z34__device_stub__prescan_SingleBlockPxS_xxxx
	.type	_Z34__device_stub__prescan_SingleBlockPxS_xxxx,@function
_Z34__device_stub__prescan_SingleBlockPxS_xxxx: # @_Z34__device_stub__prescan_SingleBlockPxS_xxxx
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%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	8(%rsp), %r12
	movq	%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	$_Z19prescan_SingleBlockPxS_xxxx, %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_end13:
	.size	_Z34__device_stub__prescan_SingleBlockPxS_xxxx, .Lfunc_end13-_Z34__device_stub__prescan_SingleBlockPxS_xxxx
	.cfi_endproc
                                        # -- End function
	.globl	_Z33__device_stub__prescan_MultiBlockPxS_xS_xx # -- Begin function _Z33__device_stub__prescan_MultiBlockPxS_xS_xx
	.type	_Z33__device_stub__prescan_MultiBlockPxS_xS_xx,@function
_Z33__device_stub__prescan_MultiBlockPxS_xS_xx: # @_Z33__device_stub__prescan_MultiBlockPxS_xS_xx
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%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	8(%rsp), %r12
	movq	%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	$_Z18prescan_MultiBlockPxS_xS_xx, %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_end14:
	.size	_Z33__device_stub__prescan_MultiBlockPxS_xS_xx, .Lfunc_end14-_Z33__device_stub__prescan_MultiBlockPxS_xS_xx
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__add_twoPxxS_ # -- Begin function _Z22__device_stub__add_twoPxxS_
	.type	_Z22__device_stub__add_twoPxxS_,@function
_Z22__device_stub__add_twoPxxS_:        # @_Z22__device_stub__add_twoPxxS_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7add_twoPxxS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end15:
	.size	_Z22__device_stub__add_twoPxxS_, .Lfunc_end15-_Z22__device_stub__add_twoPxxS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__max_twoPxxS_ # -- Begin function _Z22__device_stub__max_twoPxxS_
	.type	_Z22__device_stub__max_twoPxxS_,@function
_Z22__device_stub__max_twoPxxS_:        # @_Z22__device_stub__max_twoPxxS_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7max_twoPxxS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end16:
	.size	_Z22__device_stub__max_twoPxxS_, .Lfunc_end16-_Z22__device_stub__max_twoPxxS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__min_twoPxxS_ # -- Begin function _Z22__device_stub__min_twoPxxS_
	.type	_Z22__device_stub__min_twoPxxS_,@function
_Z22__device_stub__min_twoPxxS_:        # @_Z22__device_stub__min_twoPxxS_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7min_twoPxxS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end17:
	.size	_Z22__device_stub__min_twoPxxS_, .Lfunc_end17-_Z22__device_stub__min_twoPxxS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z15_checkCudaErrorPKc10hipError_tS0_ # -- Begin function _Z15_checkCudaErrorPKc10hipError_tS0_
	.type	_Z15_checkCudaErrorPKc10hipError_tS0_,@function
_Z15_checkCudaErrorPKc10hipError_tS0_:  # @_Z15_checkCudaErrorPKc10hipError_tS0_
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jne	.LBB18_2
# %bb.1:
	retq
.LBB18_2:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	stderr(%rip), %rdi
	movl	$.L.str.40, %esi
	xorl	%eax, %eax
	callq	fprintf
	movq	stderr(%rip), %rdi
	movl	$.L.str.41, %esi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	fprintf
	movq	stderr(%rip), %r14
	movl	%ebx, %edi
	callq	hipGetErrorString
	movl	$.L.str.42, %esi
	movq	%r14, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	fprintf
	xorl	%edi, %edi
	callq	exit
.Lfunc_end18:
	.size	_Z15_checkCudaErrorPKc10hipError_tS0_, .Lfunc_end18-_Z15_checkCudaErrorPKc10hipError_tS0_
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB19_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB19_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z19prescan_SingleBlockPxS_xxxx, %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	$_Z18prescan_MultiBlockPxS_xS_xx, %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	$_Z7add_twoPxxS_, %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	$_Z9add_threePxxS_S_, %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	$_Z7max_twoPxxS_, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9max_threePxxS_S_, %esi
	movl	$.L__unnamed_6, %edx
	movl	$.L__unnamed_6, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7min_twoPxxS_, %esi
	movl	$.L__unnamed_7, %edx
	movl	$.L__unnamed_7, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9min_threePxxS_S_, %esi
	movl	$.L__unnamed_8, %edx
	movl	$.L__unnamed_8, %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_end19:
	.size	__hip_module_ctor, .Lfunc_end19-__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	.LBB20_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
.LBB20_2:
	retq
.Lfunc_end20:
	.size	__hip_module_dtor, .Lfunc_end20-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	THREADS_PER_BLOCK,@object       # @THREADS_PER_BLOCK
	.data
	.globl	THREADS_PER_BLOCK
	.p2align	3, 0x0
THREADS_PER_BLOCK:
	.quad	512                             # 0x200
	.size	THREADS_PER_BLOCK, 8

	.type	ELEMENTS_PER_BLOCK,@object      # @ELEMENTS_PER_BLOCK
	.globl	ELEMENTS_PER_BLOCK
	.p2align	3, 0x0
ELEMENTS_PER_BLOCK:
	.quad	1024                            # 0x400
	.size	ELEMENTS_PER_BLOCK, 8

	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"Please type the desired %lld values of the vector each seperated by an ENTER KEY or WHITESPACE\n"
	.size	.L.str.2, 96

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"%lld"
	.size	.L.str.3, 5

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"output.txt"
	.size	.L.str.6, 11

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

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Original Array"
	.size	.L.str.8, 15

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Host Time  "
	.size	.L.str.12, 12

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"HOST RESULT"
	.size	.L.str.14, 12

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"GPU time "
	.size	.L.str.18, 10

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"GPU RESULT"
	.size	.L.str.20, 11

	.type	.L.str.27,@object               # @.str.27
.L.str.27:
	.asciz	"\t1)Randomize the Elements input array of size %lld\n"
	.size	.L.str.27, 52

	.type	.L.str.28,@object               # @.str.28
.L.str.28:
	.asciz	"\t2)Proived the Elements of input array of size %lld\n"
	.size	.L.str.28, 53

	.type	.L.str.38,@object               # @.str.38
.L.str.38:
	.asciz	"%c"
	.size	.L.str.38, 3

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

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

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

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

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

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

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

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

	.type	.L.str.40,@object               # @.str.40
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.40:
	.asciz	"Error in: %s\n"
	.size	.L.str.40, 14

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

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

	.type	.L.str.43,@object               # @.str.43
.L.str.43:
	.asciz	"Final Reduction is %lld and it was done in %lf ms\n"
	.size	.L.str.43, 51

	.type	.L.str.44,@object               # @.str.44
.L.str.44:
	.asciz	"a"
	.size	.L.str.44, 2

	.type	.L.str.45,@object               # @.str.45
.L.str.45:
	.asciz	"%lld "
	.size	.L.str.45, 6

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z19prescan_SingleBlockPxS_xxxx"
	.size	.L__unnamed_1, 32

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z18prescan_MultiBlockPxS_xS_xx"
	.size	.L__unnamed_2, 32

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z7add_twoPxxS_"
	.size	.L__unnamed_3, 16

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z9add_threePxxS_S_"
	.size	.L__unnamed_4, 20

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z7max_twoPxxS_"
	.size	.L__unnamed_5, 16

	.type	.L__unnamed_6,@object           # @5
.L__unnamed_6:
	.asciz	"_Z9max_threePxxS_S_"
	.size	.L__unnamed_6, 20

	.type	.L__unnamed_7,@object           # @6
.L__unnamed_7:
	.asciz	"_Z7min_twoPxxS_"
	.size	.L__unnamed_7, 16

	.type	.L__unnamed_8,@object           # @7
.L__unnamed_8:
	.asciz	"_Z9min_threePxxS_S_"
	.size	.L__unnamed_8, 20

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

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Finished Taking Input...\n"
	.size	.Lstr, 26

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Generating Random Numbers..."
	.size	.Lstr.1, 29

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"Finished Generating Random Numbers...\n"
	.size	.Lstr.2, 39

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Printing the Input Vector..."
	.size	.Lstr.3, 29

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"Finished Printing the Input Vector "
	.size	.Lstr.4, 36

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"Doing the sequential Exclusive scan..."
	.size	.Lstr.5, 39

	.type	.Lstr.6,@object                 # @str.6
.Lstr.6:
	.asciz	"Finished the sequential Exclusive scan...\n"
	.size	.Lstr.6, 43

	.type	.Lstr.7,@object                 # @str.7
.Lstr.7:
	.asciz	"Printing the Scanned Vector formed by the CPU..."
	.size	.Lstr.7, 49

	.type	.Lstr.8,@object                 # @str.8
.Lstr.8:
	.asciz	"Finished Printing the Scanned Vector formed by the CPU\n"
	.size	.Lstr.8, 56

	.type	.Lstr.9,@object                 # @str.9
.Lstr.9:
	.asciz	"Doing the Parallel Exclusive scan..."
	.size	.Lstr.9, 37

	.type	.Lstr.10,@object                # @str.10
.Lstr.10:
	.asciz	"Finished the Parallel Exclusive scan..."
	.size	.Lstr.10, 40

	.type	.Lstr.11,@object                # @str.11
.Lstr.11:
	.asciz	"Printing the Scanned Vector formed by the GPU..."
	.size	.Lstr.11, 49

	.type	.Lstr.12,@object                # @str.12
.Lstr.12:
	.asciz	"Finished Printing the Scanned Vector formed by the GPU\n"
	.size	.Lstr.12, 56

	.type	.Lstr.13,@object                # @str.13
.Lstr.13:
	.asciz	"Please look at the output.txt to see the scanned vectors and input vector"
	.size	.Lstr.13, 74

	.type	.Lstr.14,@object                # @str.14
.Lstr.14:
	.asciz	"Outputs don't match"
	.size	.Lstr.14, 20

	.type	.Lstr.15,@object                # @str.15
.Lstr.15:
	.asciz	"Outputs do match, The implementation is successful"
	.size	.Lstr.15, 51

	.type	.Lstr.16,@object                # @str.16
.Lstr.16:
	.asciz	"Please input a proper size of the array or vector"
	.size	.Lstr.16, 50

	.type	.Lstr.17,@object                # @str.17
.Lstr.17:
	.asciz	"Please select one of the given options "
	.size	.Lstr.17, 40

	.type	.Lstr.18,@object                # @str.18
.Lstr.18:
	.asciz	"Type 1 or 2 depending upon the option you want to select"
	.size	.Lstr.18, 57

	.type	.Lstr.19,@object                # @str.19
.Lstr.19:
	.asciz	"Please select one of the given operations"
	.size	.Lstr.19, 42

	.type	.Lstr.20,@object                # @str.20
.Lstr.20:
	.asciz	"1)Addition\t2)Subtraction\t3)Maximum\t4)Minimum"
	.size	.Lstr.20, 45

	.type	.Lstr.21,@object                # @str.21
.Lstr.21:
	.asciz	"Type 1,2,3 or 4 depending upon the operation you want to select"
	.size	.Lstr.21, 64

	.type	.Lstr.22,@object                # @str.22
.Lstr.22:
	.asciz	"Do you wish to print the input and scanned vector in an output.txt file?"
	.size	.Lstr.22, 73

	.type	.Lstr.23,@object                # @str.23
.Lstr.23:
	.asciz	"Type y for Yes or n for No"
	.size	.Lstr.23, 27

	.type	.Lstr.24,@object                # @str.24
.Lstr.24:
	.asciz	"Please type either character 'y' OR 'n' only next time for choosing to print or not the vectors"
	.size	.Lstr.24, 96

	.type	.Lstr.26,@object                # @str.26
.Lstr.26:
	.asciz	"Please type either 1,2,3 OR 4 only next time for selecting the Operator"
	.size	.Lstr.26, 72

	.type	.Lstr.28,@object                # @str.28
.Lstr.28:
	.asciz	"Please type either 1 or 2 only next time for selecting the Options"
	.size	.Lstr.28, 67

	.type	.Lstr.30,@object                # @str.30
.Lstr.30:
	.asciz	"Please input a proper number which is greater than zero for the size"
	.size	.Lstr.30, 69

	.type	.Lstr.31,@object                # @str.31
.Lstr.31:
	.asciz	"The application would terminate now"
	.size	.Lstr.31, 36

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z24__device_stub__add_threePxxS_S_
	.addrsig_sym _Z24__device_stub__max_threePxxS_S_
	.addrsig_sym _Z24__device_stub__min_threePxxS_S_
	.addrsig_sym _Z34__device_stub__prescan_SingleBlockPxS_xxxx
	.addrsig_sym _Z33__device_stub__prescan_MultiBlockPxS_xS_xx
	.addrsig_sym _Z22__device_stub__add_twoPxxS_
	.addrsig_sym _Z22__device_stub__max_twoPxxS_
	.addrsig_sym _Z22__device_stub__min_twoPxxS_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z9add_threePxxS_S_
	.addrsig_sym _Z9max_threePxxS_S_
	.addrsig_sym _Z9min_threePxxS_S_
	.addrsig_sym _Z19prescan_SingleBlockPxS_xxxx
	.addrsig_sym _Z18prescan_MultiBlockPxS_xS_xx
	.addrsig_sym _Z7add_twoPxxS_
	.addrsig_sym _Z7max_twoPxxS_
	.addrsig_sym _Z7min_twoPxxS_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z19prescan_SingleBlockPxS_xxxx ; -- Begin function _Z19prescan_SingleBlockPxS_xxxx
	.globl	_Z19prescan_SingleBlockPxS_xxxx
	.p2align	8
	.type	_Z19prescan_SingleBlockPxS_xxxx,@function
_Z19prescan_SingleBlockPxS_xxxx:        ; @_Z19prescan_SingleBlockPxS_xxxx
; %bb.0:
	s_clause 0x1
	s_load_b256 s[4:11], s[0:1], 0x0
	s_load_b128 s[12:15], s[0:1], 0x20
	v_mov_b32_e32 v1, 0
	v_lshrrev_b32_e32 v8, 5, v0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_cmp_gt_i64_e64 s0, s[8:9], v[0:1]
	v_cmp_le_i64_e32 vcc_lo, s[8:9], v[0:1]
	s_lshr_b32 s1, s9, 31
	s_add_u32 s2, s8, s1
	s_addc_u32 s3, s9, 0
                                        ; implicit-def: $sgpr8_sgpr9
	s_and_saveexec_b32 s1, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s1, exec_lo, s1
	s_cbranch_execz .LBB0_2
; %bb.1:
	v_dual_mov_b32 v2, v1 :: v_dual_add_nc_u32 v3, v0, v8
	s_mov_b64 s[8:9], 0
	s_delay_alu instid0(VALU_DEP_1)
	v_lshl_add_u32 v4, v3, 3, 0
	v_mov_b32_e32 v3, v1
	ds_store_b64 v4, v[2:3]
.LBB0_2:                                ; %Flow174
	s_or_saveexec_b32 s1, s1
	v_dual_mov_b32 v2, s8 :: v_dual_mov_b32 v3, s9
	v_lshlrev_b32_e32 v9, 3, v0
	s_ashr_i64 s[2:3], s[2:3], 1
	s_xor_b32 exec_lo, exec_lo, s1
	s_cbranch_execz .LBB0_4
; %bb.3:
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v2, s8, s6, v9
	v_add_co_ci_u32_e64 v3, null, s7, 0, s8
	s_lshl_b64 s[8:9], s[2:3], 3
	v_add_nc_u32_e32 v6, v0, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v2, vcc_lo, v2, s8
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_lshl_add_u32 v6, v6, 3, 0
	s_clause 0x1
	global_load_b64 v[4:5], v9, s[6:7]
	global_load_b64 v[2:3], v[2:3], off
	s_waitcnt vmcnt(1)
	ds_store_b64 v6, v[4:5]
.LBB0_4:
	s_or_b32 exec_lo, exec_lo, s1
	v_add_co_u32 v4, s1, s2, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_add_co_ci_u32_e64 v5, null, s3, 0, s1
	v_cmp_lt_i64_e64 s8, s[10:11], 2
	v_cmp_gt_i64_e64 s1, s[10:11], 1
	v_lshl_or_b32 v11, v0, 1, 1
	v_alignbit_b32 v5, v5, v4, 5
	s_mov_b64 s[6:7], 1
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s8
	v_add_nc_u32_e32 v4, v5, v4
	s_delay_alu instid0(VALU_DEP_1)
	v_lshl_add_u32 v10, v4, 3, 0
	s_waitcnt vmcnt(0)
	ds_store_b64 v10, v[2:3]
	s_cbranch_vccnz .LBB0_27
; %bb.5:                                ; %.lr.ph
	s_mov_b64 s[16:17], s[10:11]
.LBB0_6:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_lshr_b64 s[8:9], s[16:17], 1
	s_mov_b32 s18, exec_lo
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_cmpx_gt_u64_e64 s[8:9], v[0:1]
	s_cbranch_execz .LBB0_25
; %bb.7:                                ; %NodeBlock138
                                        ;   in Loop: Header=BB0_6 Depth=1
	v_mad_u64_u32 v[2:3], null, s6, v11, -1
	v_cmp_lt_i64_e64 s19, s[12:13], 3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[4:5], null, s7, v11, v[3:4]
	v_mov_b32_e32 v3, v4
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, v2, s6
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v3, vcc_lo
	v_ashrrev_i64 v[6:7], 5, v[2:3]
	s_and_b32 vcc_lo, exec_lo, s19
	s_mov_b32 s19, -1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_ashrrev_i64 v[12:13], 5, v[4:5]
	v_add_co_u32 v5, null, v6, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_u32 v4, null, v12, v4
	s_cbranch_vccnz .LBB0_19
; %bb.8:                                ; %NodeBlock136
                                        ;   in Loop: Header=BB0_6 Depth=1
	v_cmp_lt_i64_e64 s19, s[12:13], 4
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s19
	s_mov_b32 s19, -1
	s_cbranch_vccnz .LBB0_14
; %bb.9:                                ; %LeafBlock134
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_cmp_eq_u64 s[12:13], 4
	s_cbranch_scc0 .LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	v_lshl_add_u32 v6, v4, 3, 0
	v_lshl_add_u32 v2, v5, 3, 0
	s_mov_b32 s19, exec_lo
	ds_load_b64 v[12:13], v6
	ds_load_b64 v[2:3], v2
	s_waitcnt lgkmcnt(0)
	v_cmpx_gt_i64_e64 v[12:13], v[2:3]
	s_cbranch_execz .LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	ds_store_b64 v6, v[2:3]
.LBB0_12:                               ; %Flow161
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_or_b32 exec_lo, exec_lo, s19
.LBB0_13:                               ; %Flow162
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_mov_b32 s19, 0
.LBB0_14:                               ; %Flow164
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s19
	s_cbranch_vccnz .LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	v_lshl_add_u32 v6, v4, 3, 0
	v_lshl_add_u32 v2, v5, 3, 0
	s_mov_b32 s19, exec_lo
	ds_load_b64 v[12:13], v6
	ds_load_b64 v[2:3], v2
	s_waitcnt lgkmcnt(0)
	v_cmpx_lt_i64_e64 v[12:13], v[2:3]
	s_cbranch_execz .LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_6 Depth=1
	ds_store_b64 v6, v[2:3]
.LBB0_17:                               ; %Flow163
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_or_b32 exec_lo, exec_lo, s19
.LBB0_18:                               ; %Flow165
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_mov_b32 s19, 0
.LBB0_19:                               ; %Flow169
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s19
	s_cbranch_vccnz .LBB0_25
; %bb.20:                               ; %NodeBlock
                                        ;   in Loop: Header=BB0_6 Depth=1
	v_cmp_gt_i64_e64 s19, s[12:13], 1
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s19
	s_mov_b32 s19, -1
	s_cbranch_vccz .LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_6 Depth=1
	v_lshl_add_u32 v2, v5, 3, 0
	v_lshl_add_u32 v12, v4, 3, 0
	s_mov_b32 s19, 0
	ds_load_b64 v[2:3], v2
	ds_load_b64 v[6:7], v12
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, v6, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, v7, v3, vcc_lo
	ds_store_b64 v12, v[2:3]
.LBB0_22:                               ; %Flow167
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s19
	s_cbranch_vccnz .LBB0_25
; %bb.23:                               ; %LeafBlock
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_cmp_lg_u64 s[12:13], 1
	s_cbranch_scc1 .LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_6 Depth=1
	v_lshl_add_u32 v2, v5, 3, 0
	v_lshl_add_u32 v6, v4, 3, 0
	ds_load_b64 v[2:3], v2
	ds_load_b64 v[4:5], v6
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, v4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, v5, v3, vcc_lo
	ds_store_b64 v6, v[2:3]
.LBB0_25:                               ; %Flow171
                                        ;   in Loop: Header=BB0_6 Depth=1
	s_or_b32 exec_lo, exec_lo, s18
	v_cmp_lt_u64_e64 s16, s[16:17], 4
	s_lshl_b64 s[6:7], s[6:7], 1
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s16
	s_cbranch_vccnz .LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_6 Depth=1
	s_mov_b64 s[16:17], s[8:9]
	s_branch .LBB0_6
.LBB0_27:                               ; %Flow173
	s_mov_b32 s8, exec_lo
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB0_29
; %bb.28:                               ; %.sink.split
	s_add_u32 s9, s10, -1
	s_addc_u32 s16, s11, -1
	s_cmp_eq_u64 s[12:13], 4
	v_alignbit_b32 v2, s16, s9, 5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v2, s9, v2
	s_cselect_b32 s9, s14, 0
	s_cselect_b32 s14, s15, 0
	v_dual_mov_b32 v2, s9 :: v_dual_lshlrev_b32 v3, 3, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_mov_b32 v3, s14 :: v_dual_add_nc_u32 v4, 0, v3
	ds_store_b64 v4, v[2:3]
.LBB0_29:
	s_or_b32 exec_lo, exec_lo, s8
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s1
	s_cbranch_vccnz .LBB0_53
; %bb.30:                               ; %.lr.ph108
	s_mov_b64 s[8:9], 1
.LBB0_31:                               ; =>This Inner Loop Header: Depth=1
	s_lshr_b32 s1, s7, 31
	s_waitcnt lgkmcnt(0)
	s_add_u32 s6, s6, s1
	s_addc_u32 s7, s7, 0
	s_mov_b32 s1, exec_lo
	s_ashr_i64 s[6:7], s[6:7], 1
	s_barrier
	buffer_gl0_inv
	v_cmpx_gt_u64_e64 s[8:9], v[0:1]
	s_cbranch_execz .LBB0_52
; %bb.32:                               ;   in Loop: Header=BB0_31 Depth=1
	v_mad_u64_u32 v[2:3], null, s6, v11, -1
	v_cmp_lt_i64_e64 s14, s[12:13], 3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[4:5], null, s7, v11, v[3:4]
	v_mov_b32_e32 v3, v4
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, v2, s6
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v3, vcc_lo
	s_and_b32 vcc_lo, exec_lo, s14
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_alignbit_b32 v5, v5, v4, 5
	v_add_nc_u32_e32 v4, v5, v4
	v_alignbit_b32 v3, v3, v2, 5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshl_add_u32 v12, v4, 3, 0
	v_add_nc_u32_e32 v2, v3, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_lshl_add_u32 v6, v2, 3, 0
	ds_load_b64 v[2:3], v12
	ds_load_b64 v[4:5], v6
	s_waitcnt lgkmcnt(1)
	ds_store_b64 v6, v[2:3]
	s_cbranch_vccnz .LBB0_37
; %bb.33:                               ; %NodeBlock146
                                        ;   in Loop: Header=BB0_31 Depth=1
	v_cmp_gt_i64_e64 s14, s[12:13], 3
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s14
	s_cbranch_vccz .LBB0_38
; %bb.34:                               ; %LeafBlock144
                                        ;   in Loop: Header=BB0_31 Depth=1
	s_mov_b32 s15, 0
	s_cmp_eq_u64 s[12:13], 4
	s_mov_b32 s14, 0
	s_cbranch_scc0 .LBB0_36
; %bb.35:                               ;   in Loop: Header=BB0_31 Depth=1
	s_waitcnt lgkmcnt(1)
	v_cmp_gt_i64_e32 vcc_lo, v[2:3], v[4:5]
	s_and_b32 s14, vcc_lo, exec_lo
.LBB0_36:                               ; %Flow151
                                        ;   in Loop: Header=BB0_31 Depth=1
	s_waitcnt lgkmcnt(1)
	v_dual_mov_b32 v7, v5 :: v_dual_mov_b32 v6, v4
	s_branch .LBB0_39
.LBB0_37:                               ;   in Loop: Header=BB0_31 Depth=1
	s_mov_b32 s15, -1
	s_mov_b32 s14, 0
                                        ; implicit-def: $vgpr6_vgpr7
	s_branch .LBB0_42
.LBB0_38:                               ;   in Loop: Header=BB0_31 Depth=1
	s_mov_b32 s15, -1
	s_mov_b32 s14, 0
                                        ; implicit-def: $vgpr6_vgpr7
.LBB0_39:                               ; %Flow150
                                        ;   in Loop: Header=BB0_31 Depth=1
	s_and_b32 vcc_lo, exec_lo, s15
	s_cbranch_vccz .LBB0_41
; %bb.40:                               ;   in Loop: Header=BB0_31 Depth=1
	s_waitcnt lgkmcnt(1)
	v_cmp_lt_i64_e32 vcc_lo, v[2:3], v[4:5]
	v_dual_mov_b32 v7, v5 :: v_dual_mov_b32 v6, v4
	s_and_not1_b32 s14, s14, exec_lo
	s_and_b32 s15, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s14, s14, s15
.LBB0_41:                               ; %Flow152
                                        ;   in Loop: Header=BB0_31 Depth=1
	s_mov_b32 s15, 0
.LBB0_42:                               ; %Flow
                                        ;   in Loop: Header=BB0_31 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 vcc_lo, exec_lo, s15
	s_cbranch_vccz .LBB0_50
; %bb.43:                               ; %NodeBlock142
                                        ;   in Loop: Header=BB0_31 Depth=1
	v_cmp_gt_i64_e64 s15, s[12:13], 1
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s15
	s_cbranch_vccz .LBB0_45
; %bb.44:                               ;   in Loop: Header=BB0_31 Depth=1
	s_waitcnt lgkmcnt(1)
	v_add_co_u32 v6, vcc_lo, v2, v4
	v_add_co_ci_u32_e32 v7, vcc_lo, v3, v5, vcc_lo
	s_mov_b32 s15, 0
	s_or_b32 s14, s14, exec_lo
	s_branch .LBB0_46
.LBB0_45:                               ;   in Loop: Header=BB0_31 Depth=1
	s_mov_b32 s15, -1
                                        ; implicit-def: $vgpr6_vgpr7
.LBB0_46:                               ; %Flow154
                                        ;   in Loop: Header=BB0_31 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s15
	s_cbranch_vccnz .LBB0_50
; %bb.47:                               ; %LeafBlock140
                                        ;   in Loop: Header=BB0_31 Depth=1
	s_cmp_eq_u64 s[12:13], 1
	s_cbranch_scc0 .LBB0_49
; %bb.48:                               ;   in Loop: Header=BB0_31 Depth=1
	s_waitcnt lgkmcnt(1)
	v_add_co_u32 v6, vcc_lo, v2, v4
	v_add_co_ci_u32_e32 v7, vcc_lo, v3, v5, vcc_lo
	s_or_b32 s14, s14, exec_lo
	s_branch .LBB0_50
.LBB0_49:                               ;   in Loop: Header=BB0_31 Depth=1
                                        ; implicit-def: $vgpr6_vgpr7
.LBB0_50:                               ; %Flow153
                                        ;   in Loop: Header=BB0_31 Depth=1
	s_and_b32 exec_lo, exec_lo, s14
	s_cbranch_execz .LBB0_52
; %bb.51:                               ; %.sink.split115
                                        ;   in Loop: Header=BB0_31 Depth=1
	ds_store_b64 v12, v[6:7]
.LBB0_52:                               ; %Flow158
                                        ;   in Loop: Header=BB0_31 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_lshl_b64 s[8:9], s[8:9], 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_i64_e64 s1, s[8:9], s[10:11]
	s_and_b32 vcc_lo, exec_lo, s1
	s_cbranch_vccz .LBB0_31
.LBB0_53:                               ; %._crit_edge109
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB0_55
; %bb.54:
	v_add_nc_u32_e32 v0, v0, v8
	v_add_co_u32 v4, s0, s4, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v5, null, s5, 0, s0
	v_lshl_add_u32 v0, v0, 3, 0
	s_lshl_b64 s[0:1], s[2:3], 3
	ds_load_b64 v[0:1], v0
	ds_load_b64 v[2:3], v10
	v_add_co_u32 v4, vcc_lo, v4, s0
	v_add_co_ci_u32_e32 v5, vcc_lo, s1, v5, vcc_lo
	s_waitcnt lgkmcnt(1)
	global_store_b64 v9, v[0:1], s[4:5]
	s_waitcnt lgkmcnt(0)
	global_store_b64 v[4:5], v[2:3], off
.LBB0_55:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19prescan_SingleBlockPxS_xxxx
		.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 14
		.amdhsa_next_free_sgpr 20
		.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	_Z19prescan_SingleBlockPxS_xxxx, .Lfunc_end0-_Z19prescan_SingleBlockPxS_xxxx
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1556
; NumSgprs: 22
; NumVgprs: 14
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 14
; 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	_Z18prescan_MultiBlockPxS_xS_xx ; -- Begin function _Z18prescan_MultiBlockPxS_xS_xx
	.globl	_Z18prescan_MultiBlockPxS_xS_xx
	.p2align	8
	.type	_Z18prescan_MultiBlockPxS_xS_xx,@function
_Z18prescan_MultiBlockPxS_xS_xx:        ; @_Z18prescan_MultiBlockPxS_xS_xx
; %bb.0:
	s_load_b256 s[4:11], s[0:1], 0x0
	v_lshrrev_b32_e32 v12, 5, v0
	v_mov_b32_e32 v1, 0
	s_mov_b32 s12, s15
	v_lshl_or_b32 v14, v0, 1, 1
	s_mov_b32 s13, 0
	v_add_nc_u32_e32 v12, v12, v0
	s_delay_alu instid0(VALU_DEP_1)
	v_lshl_add_u32 v13, v12, 3, 0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s2, s9, 31
	v_mad_u64_u32 v[2:3], null, s12, s8, v[0:1]
	s_add_u32 s2, s8, s2
	s_addc_u32 s3, s9, 0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_ashr_i64 s[2:3], s[2:3], 1
	v_add_co_u32 v6, s2, s2, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e64 v7, null, s3, 0, s2
	s_mul_i32 s2, s15, s9
	s_ashr_i64 s[14:15], s[8:9], 1
	v_add_nc_u32_e32 v3, s2, v3
	v_mad_u64_u32 v[4:5], null, s12, s8, v[6:7]
	v_alignbit_b32 v7, v7, v6, 5
	v_cmp_lt_i64_e64 s16, s[14:15], 1
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[2:3], 3, v[2:3]
	v_add_nc_u32_e32 v6, v7, v6
	v_add_nc_u32_e32 v5, s2, v5
	s_load_b128 s[0:3], s[0:1], 0x20
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v8, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v9, vcc_lo, s7, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[4:5], 3, v[4:5]
	v_lshl_add_u32 v12, v6, 3, 0
	v_add_co_u32 v10, vcc_lo, s6, v4
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v11, vcc_lo, s7, v5, vcc_lo
	s_clause 0x1
	global_load_b64 v[8:9], v[8:9], off
	global_load_b64 v[10:11], v[10:11], off
	s_mov_b64 s[6:7], 1
	s_and_b32 vcc_lo, exec_lo, s16
	s_waitcnt vmcnt(1)
	ds_store_b64 v13, v[8:9]
	s_waitcnt vmcnt(0)
	ds_store_b64 v12, v[10:11]
	s_cbranch_vccnz .LBB1_21
.LBB1_1:                                ; =>This Inner Loop Header: Depth=1
	s_mov_b32 s16, exec_lo
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_cmpx_gt_i64_e64 s[14:15], v[0:1]
	s_cbranch_execz .LBB1_20
; %bb.2:                                ; %NodeBlock136
                                        ;   in Loop: Header=BB1_1 Depth=1
	v_mad_u64_u32 v[6:7], null, s6, v14, -1
	v_cmp_lt_i64_e64 s17, s[0:1], 3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[8:9], null, s7, v14, v[7:8]
	v_mov_b32_e32 v7, v8
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v8, vcc_lo, v6, s6
	v_add_co_ci_u32_e32 v9, vcc_lo, s7, v7, vcc_lo
	v_ashrrev_i64 v[10:11], 5, v[6:7]
	s_and_b32 vcc_lo, exec_lo, s17
	s_mov_b32 s17, -1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_ashrrev_i64 v[15:16], 5, v[8:9]
	v_add_co_u32 v9, null, v10, v6
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_u32 v8, null, v15, v8
	s_cbranch_vccnz .LBB1_14
; %bb.3:                                ; %NodeBlock134
                                        ;   in Loop: Header=BB1_1 Depth=1
	v_cmp_lt_i64_e64 s17, s[0:1], 4
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s17
	s_mov_b32 s17, -1
	s_cbranch_vccnz .LBB1_9
; %bb.4:                                ; %LeafBlock132
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_cmp_eq_u64 s[0:1], 4
	s_cbranch_scc0 .LBB1_8
; %bb.5:                                ;   in Loop: Header=BB1_1 Depth=1
	v_lshl_add_u32 v10, v8, 3, 0
	v_lshl_add_u32 v6, v9, 3, 0
	s_mov_b32 s17, exec_lo
	ds_load_b64 v[15:16], v10
	ds_load_b64 v[6:7], v6
	s_waitcnt lgkmcnt(0)
	v_cmpx_gt_i64_e64 v[15:16], v[6:7]
	s_cbranch_execz .LBB1_7
; %bb.6:                                ;   in Loop: Header=BB1_1 Depth=1
	ds_store_b64 v10, v[6:7]
.LBB1_7:                                ; %Flow159
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s17
.LBB1_8:                                ; %Flow160
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_mov_b32 s17, 0
.LBB1_9:                                ; %Flow162
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s17
	s_cbranch_vccnz .LBB1_13
; %bb.10:                               ;   in Loop: Header=BB1_1 Depth=1
	v_lshl_add_u32 v10, v8, 3, 0
	v_lshl_add_u32 v6, v9, 3, 0
	s_mov_b32 s17, exec_lo
	ds_load_b64 v[15:16], v10
	ds_load_b64 v[6:7], v6
	s_waitcnt lgkmcnt(0)
	v_cmpx_lt_i64_e64 v[15:16], v[6:7]
	s_cbranch_execz .LBB1_12
; %bb.11:                               ;   in Loop: Header=BB1_1 Depth=1
	ds_store_b64 v10, v[6:7]
.LBB1_12:                               ; %Flow161
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s17
.LBB1_13:                               ; %Flow163
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_mov_b32 s17, 0
.LBB1_14:                               ; %Flow167
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s17
	s_cbranch_vccnz .LBB1_20
; %bb.15:                               ; %NodeBlock
                                        ;   in Loop: Header=BB1_1 Depth=1
	v_cmp_gt_i64_e64 s17, s[0:1], 1
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s17
	s_mov_b32 s17, -1
	s_cbranch_vccz .LBB1_17
; %bb.16:                               ;   in Loop: Header=BB1_1 Depth=1
	v_lshl_add_u32 v6, v9, 3, 0
	v_lshl_add_u32 v15, v8, 3, 0
	s_mov_b32 s17, 0
	ds_load_b64 v[6:7], v6
	ds_load_b64 v[10:11], v15
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v6, vcc_lo, v10, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, v11, v7, vcc_lo
	ds_store_b64 v15, v[6:7]
.LBB1_17:                               ; %Flow165
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s17
	s_cbranch_vccnz .LBB1_20
; %bb.18:                               ; %LeafBlock
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_cmp_lg_u64 s[0:1], 1
	s_cbranch_scc1 .LBB1_20
; %bb.19:                               ;   in Loop: Header=BB1_1 Depth=1
	v_lshl_add_u32 v6, v9, 3, 0
	v_lshl_add_u32 v10, v8, 3, 0
	ds_load_b64 v[6:7], v6
	ds_load_b64 v[8:9], v10
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v6, vcc_lo, v8, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, v9, v7, vcc_lo
	ds_store_b64 v10, v[6:7]
.LBB1_20:                               ; %Flow169
                                        ;   in Loop: Header=BB1_1 Depth=1
	s_or_b32 exec_lo, exec_lo, s16
	v_cmp_lt_u64_e64 s16, s[14:15], 2
	s_lshl_b64 s[6:7], s[6:7], 1
	s_lshr_b64 s[14:15], s[14:15], 1
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s16
	s_cbranch_vccz .LBB1_1
.LBB1_21:                               ; %Flow171
	s_mov_b32 s14, exec_lo
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB1_23
; %bb.22:                               ; %.sink.split
	s_add_u32 s15, s8, -1
	s_addc_u32 s16, s9, -1
	s_lshl_b64 s[12:13], s[12:13], 3
	v_alignbit_b32 v6, s16, s15, 5
	s_add_u32 s10, s10, s12
	s_addc_u32 s11, s11, s13
	s_cmp_eq_u64 s[0:1], 4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_dual_mov_b32 v11, 0 :: v_dual_add_nc_u32 v6, s15, v6
	s_cselect_b32 s3, s3, 0
	s_cselect_b32 s2, s2, 0
	v_dual_mov_b32 v9, s3 :: v_dual_mov_b32 v8, s2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b32_e32 v6, 3, v6
	v_add_nc_u32_e32 v10, 0, v6
	ds_load_b64 v[6:7], v10
	ds_store_b64 v10, v[8:9]
	s_waitcnt lgkmcnt(1)
	global_store_b64 v11, v[6:7], s[10:11]
.LBB1_23:
	s_or_b32 exec_lo, exec_lo, s14
	v_cmp_lt_i64_e64 s2, s[8:9], 2
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s2
	s_cbranch_vccnz .LBB1_47
; %bb.24:                               ; %.lr.ph110
	s_mov_b64 s[2:3], 1
.LBB1_25:                               ; =>This Inner Loop Header: Depth=1
	s_lshr_b64 s[6:7], s[6:7], 1
	s_mov_b32 s10, exec_lo
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	v_cmpx_gt_u64_e64 s[2:3], v[0:1]
	s_cbranch_execz .LBB1_46
; %bb.26:                               ;   in Loop: Header=BB1_25 Depth=1
	v_mad_u64_u32 v[6:7], null, s6, v14, -1
	v_cmp_lt_i64_e64 s11, s[0:1], 3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[8:9], null, s7, v14, v[7:8]
	v_mov_b32_e32 v7, v8
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v8, vcc_lo, v6, s6
	v_add_co_ci_u32_e32 v9, vcc_lo, s7, v7, vcc_lo
	s_and_b32 vcc_lo, exec_lo, s11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_alignbit_b32 v9, v9, v8, 5
	v_add_nc_u32_e32 v8, v9, v8
	v_alignbit_b32 v7, v7, v6, 5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshl_add_u32 v15, v8, 3, 0
	v_add_nc_u32_e32 v6, v7, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_lshl_add_u32 v10, v6, 3, 0
	ds_load_b64 v[6:7], v15
	ds_load_b64 v[8:9], v10
	s_waitcnt lgkmcnt(1)
	ds_store_b64 v10, v[6:7]
	s_cbranch_vccnz .LBB1_31
; %bb.27:                               ; %NodeBlock144
                                        ;   in Loop: Header=BB1_25 Depth=1
	v_cmp_gt_i64_e64 s11, s[0:1], 3
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s11
	s_cbranch_vccz .LBB1_32
; %bb.28:                               ; %LeafBlock142
                                        ;   in Loop: Header=BB1_25 Depth=1
	s_mov_b32 s12, 0
	s_cmp_eq_u64 s[0:1], 4
	s_mov_b32 s11, 0
	s_cbranch_scc0 .LBB1_30
; %bb.29:                               ;   in Loop: Header=BB1_25 Depth=1
	s_waitcnt lgkmcnt(1)
	v_cmp_gt_i64_e32 vcc_lo, v[6:7], v[8:9]
	s_and_b32 s11, vcc_lo, exec_lo
.LBB1_30:                               ; %Flow149
                                        ;   in Loop: Header=BB1_25 Depth=1
	s_waitcnt lgkmcnt(1)
	v_dual_mov_b32 v11, v9 :: v_dual_mov_b32 v10, v8
	s_branch .LBB1_33
.LBB1_31:                               ;   in Loop: Header=BB1_25 Depth=1
	s_mov_b32 s12, -1
	s_mov_b32 s11, 0
                                        ; implicit-def: $vgpr10_vgpr11
	s_branch .LBB1_36
.LBB1_32:                               ;   in Loop: Header=BB1_25 Depth=1
	s_mov_b32 s12, -1
	s_mov_b32 s11, 0
                                        ; implicit-def: $vgpr10_vgpr11
.LBB1_33:                               ; %Flow148
                                        ;   in Loop: Header=BB1_25 Depth=1
	s_and_b32 vcc_lo, exec_lo, s12
	s_cbranch_vccz .LBB1_35
; %bb.34:                               ;   in Loop: Header=BB1_25 Depth=1
	s_waitcnt lgkmcnt(1)
	v_cmp_lt_i64_e32 vcc_lo, v[6:7], v[8:9]
	v_dual_mov_b32 v11, v9 :: v_dual_mov_b32 v10, v8
	s_and_not1_b32 s11, s11, exec_lo
	s_and_b32 s12, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s11, s11, s12
.LBB1_35:                               ; %Flow150
                                        ;   in Loop: Header=BB1_25 Depth=1
	s_mov_b32 s12, 0
.LBB1_36:                               ; %Flow
                                        ;   in Loop: Header=BB1_25 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 vcc_lo, exec_lo, s12
	s_cbranch_vccz .LBB1_44
; %bb.37:                               ; %NodeBlock140
                                        ;   in Loop: Header=BB1_25 Depth=1
	v_cmp_gt_i64_e64 s12, s[0:1], 1
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s12
	s_cbranch_vccz .LBB1_39
; %bb.38:                               ;   in Loop: Header=BB1_25 Depth=1
	s_waitcnt lgkmcnt(1)
	v_add_co_u32 v10, vcc_lo, v6, v8
	v_add_co_ci_u32_e32 v11, vcc_lo, v7, v9, vcc_lo
	s_mov_b32 s12, 0
	s_or_b32 s11, s11, exec_lo
	s_branch .LBB1_40
.LBB1_39:                               ;   in Loop: Header=BB1_25 Depth=1
	s_mov_b32 s12, -1
                                        ; implicit-def: $vgpr10_vgpr11
.LBB1_40:                               ; %Flow152
                                        ;   in Loop: Header=BB1_25 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s12
	s_cbranch_vccnz .LBB1_44
; %bb.41:                               ; %LeafBlock138
                                        ;   in Loop: Header=BB1_25 Depth=1
	s_cmp_eq_u64 s[0:1], 1
	s_cbranch_scc0 .LBB1_43
; %bb.42:                               ;   in Loop: Header=BB1_25 Depth=1
	s_waitcnt lgkmcnt(1)
	v_add_co_u32 v10, vcc_lo, v6, v8
	v_add_co_ci_u32_e32 v11, vcc_lo, v7, v9, vcc_lo
	s_or_b32 s11, s11, exec_lo
	s_branch .LBB1_44
.LBB1_43:                               ;   in Loop: Header=BB1_25 Depth=1
                                        ; implicit-def: $vgpr10_vgpr11
.LBB1_44:                               ; %Flow151
                                        ;   in Loop: Header=BB1_25 Depth=1
	s_and_b32 exec_lo, exec_lo, s11
	s_cbranch_execz .LBB1_46
; %bb.45:                               ; %.sink.split113
                                        ;   in Loop: Header=BB1_25 Depth=1
	ds_store_b64 v15, v[10:11]
.LBB1_46:                               ; %Flow156
                                        ;   in Loop: Header=BB1_25 Depth=1
	s_or_b32 exec_lo, exec_lo, s10
	s_lshl_b64 s[2:3], s[2:3], 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_i64_e64 s10, s[2:3], s[8:9]
	s_and_b32 vcc_lo, exec_lo, s10
	s_cbranch_vccz .LBB1_25
.LBB1_47:                               ; %._crit_edge111
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	ds_load_b64 v[0:1], v13
	ds_load_b64 v[6:7], v12
	v_add_co_u32 v2, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	v_add_co_u32 v4, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v5, vcc_lo
	s_waitcnt lgkmcnt(1)
	global_store_b64 v[2:3], v[0:1], off
	s_waitcnt lgkmcnt(0)
	global_store_b64 v[4:5], v[6:7], off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z18prescan_MultiBlockPxS_xS_xx
		.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 17
		.amdhsa_next_free_sgpr 18
		.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	_Z18prescan_MultiBlockPxS_xS_xx, .Lfunc_end1-_Z18prescan_MultiBlockPxS_xS_xx
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1492
; NumSgprs: 20
; NumVgprs: 17
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 20
; NumVGPRsForWavesPerEU: 17
; 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	_Z7add_twoPxxS_         ; -- Begin function _Z7add_twoPxxS_
	.globl	_Z7add_twoPxxS_
	.p2align	8
	.type	_Z7add_twoPxxS_,@function
_Z7add_twoPxxS_:                        ; @_Z7add_twoPxxS_
; %bb.0:
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	s_mov_b32 s2, s15
	s_mov_b32 s3, 0
	v_lshlrev_b32_e32 v2, 3, v0
	s_lshl_b64 s[8:9], s[2:3], 3
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s3, s15, s7
	s_mul_hi_u32 s7, s15, s6
	s_mul_i32 s2, s15, s6
	s_add_i32 s3, s7, s3
	s_add_u32 s0, s0, s8
	s_addc_u32 s1, s1, s9
	s_lshl_b64 s[2:3], s[2:3], 3
	s_load_b64 s[0:1], s[0:1], 0x0
	s_add_u32 s2, s4, s2
	s_addc_u32 s3, s5, s3
	global_load_b64 v[0:1], v2, s[2:3]
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, v0, s0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b64 v2, v[0:1], s[2:3]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7add_twoPxxS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 24
		.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 3
		.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	_Z7add_twoPxxS_, .Lfunc_end2-_Z7add_twoPxxS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 128
; NumSgprs: 18
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 3
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z9add_threePxxS_S_     ; -- Begin function _Z9add_threePxxS_S_
	.globl	_Z9add_threePxxS_S_
	.p2align	8
	.type	_Z9add_threePxxS_S_,@function
_Z9add_threePxxS_S_:                    ; @_Z9add_threePxxS_S_
; %bb.0:
	s_load_b256 s[0:7], s[0:1], 0x0
	s_mov_b32 s8, s15
	s_mov_b32 s9, 0
	v_lshlrev_b32_e32 v2, 3, v0
	s_lshl_b64 s[10:11], s[8:9], 3
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s3, s15, s3
	s_mul_hi_u32 s12, s15, s2
	s_mul_i32 s2, s15, s2
	s_add_i32 s3, s12, s3
	s_add_u32 s4, s4, s10
	s_addc_u32 s5, s5, s11
	s_add_u32 s6, s6, s10
	s_addc_u32 s7, s7, s11
	s_load_b64 s[4:5], s[4:5], 0x0
	s_load_b64 s[6:7], s[6:7], 0x0
	s_waitcnt lgkmcnt(0)
	s_add_u32 s4, s6, s4
	s_addc_u32 s5, s7, s5
	s_lshl_b64 s[2:3], s[2:3], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s0, s2
	s_addc_u32 s1, s1, s3
	global_load_b64 v[0:1], v2, s[0:1]
	s_waitcnt vmcnt(0)
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	global_store_b64 v2, v[0:1], s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9add_threePxxS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.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 3
		.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_end3:
	.size	_Z9add_threePxxS_S_, .Lfunc_end3-_Z9add_threePxxS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 148
; NumSgprs: 18
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 3
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z7max_twoPxxS_         ; -- Begin function _Z7max_twoPxxS_
	.globl	_Z7max_twoPxxS_
	.p2align	8
	.type	_Z7max_twoPxxS_,@function
_Z7max_twoPxxS_:                        ; @_Z7max_twoPxxS_
; %bb.0:
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[8:9], s[0:1], 0x10
	v_lshlrev_b32_e32 v0, 3, v0
	s_mov_b32 s2, s15
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s1, s15, s7
	s_mul_hi_u32 s3, s15, s6
	s_mul_i32 s0, s15, s6
	s_add_i32 s1, s3, s1
	s_mov_b32 s3, 0
	s_lshl_b64 s[0:1], s[0:1], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s4, s0
	s_addc_u32 s1, s5, s1
	s_lshl_b64 s[2:3], s[2:3], 3
	global_load_b64 v[1:2], v0, s[0:1]
	s_add_u32 s2, s8, s2
	s_addc_u32 s3, s9, s3
	s_mov_b32 s4, exec_lo
	s_load_b64 s[2:3], s[2:3], 0x0
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_cmpx_gt_i64_e64 s[2:3], v[1:2]
	s_cbranch_execz .LBB4_2
; %bb.1:
	v_add_co_u32 v0, s0, s0, v0
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v1, null, s1, 0, s0
	v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
	global_store_b64 v[0:1], v[2:3], off
.LBB4_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7max_twoPxxS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 24
		.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 4
		.amdhsa_next_free_sgpr 16
		.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_end4:
	.size	_Z7max_twoPxxS_, .Lfunc_end4-_Z7max_twoPxxS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 164
; NumSgprs: 16
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 16
; NumVGPRsForWavesPerEU: 4
; 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	_Z9max_threePxxS_S_     ; -- Begin function _Z9max_threePxxS_S_
	.globl	_Z9max_threePxxS_S_
	.p2align	8
	.type	_Z9max_threePxxS_S_,@function
_Z9max_threePxxS_S_:                    ; @_Z9max_threePxxS_S_
; %bb.0:
	s_load_b256 s[4:11], s[0:1], 0x0
	s_mov_b32 s2, s15
	s_mov_b32 s3, 0
	v_lshlrev_b32_e32 v2, 3, v0
	s_lshl_b64 s[0:1], s[2:3], 3
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s7, s15, s7
	s_mul_hi_u32 s12, s15, s6
	s_mul_i32 s6, s15, s6
	s_add_i32 s7, s12, s7
	s_add_u32 s8, s8, s0
	s_addc_u32 s9, s9, s1
	s_add_u32 s10, s10, s0
	s_addc_u32 s11, s11, s1
	s_lshl_b64 s[0:1], s[6:7], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s4, s0
	s_addc_u32 s1, s5, s1
	global_load_b64 v[0:1], v2, s[0:1]
	s_load_b64 s[6:7], s[8:9], 0x0
	s_load_b64 s[4:5], s[10:11], 0x0
	s_waitcnt lgkmcnt(0)
	v_cmp_le_i64_e64 s2, s[6:7], s[4:5]
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s2
	s_cbranch_vccz .LBB5_2
; %bb.1:
	s_waitcnt vmcnt(0)
	v_cmp_gt_i64_e32 vcc_lo, s[4:5], v[0:1]
	s_mov_b32 s2, 0
	s_and_b32 s3, vcc_lo, exec_lo
	s_branch .LBB5_3
.LBB5_2:
	s_mov_b32 s2, -1
                                        ; implicit-def: $sgpr4_sgpr5
.LBB5_3:                                ; %Flow
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s2
	s_cbranch_vccnz .LBB5_5
; %bb.4:
	s_waitcnt vmcnt(0)
	v_cmp_gt_i64_e32 vcc_lo, s[6:7], v[0:1]
	s_and_not1_b32 s2, s3, exec_lo
	s_mov_b64 s[4:5], s[6:7]
	s_and_b32 s3, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s3, s2, s3
.LBB5_5:                                ; %Flow40
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s2, s3
	s_cbranch_execz .LBB5_7
; %bb.6:                                ; %.sink.split
	s_waitcnt vmcnt(0)
	v_add_co_u32 v0, s0, s0, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v1, null, s1, 0, s0
	v_dual_mov_b32 v2, s4 :: v_dual_mov_b32 v3, s5
	global_store_b64 v[0:1], v[2:3], off
.LBB5_7:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9max_threePxxS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.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 4
		.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_end5:
	.size	_Z9max_threePxxS_S_, .Lfunc_end5-_Z9max_threePxxS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 252
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; 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	_Z7min_twoPxxS_         ; -- Begin function _Z7min_twoPxxS_
	.globl	_Z7min_twoPxxS_
	.p2align	8
	.type	_Z7min_twoPxxS_,@function
_Z7min_twoPxxS_:                        ; @_Z7min_twoPxxS_
; %bb.0:
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[8:9], s[0:1], 0x10
	v_lshlrev_b32_e32 v0, 3, v0
	s_mov_b32 s2, s15
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s1, s15, s7
	s_mul_hi_u32 s3, s15, s6
	s_mul_i32 s0, s15, s6
	s_add_i32 s1, s3, s1
	s_mov_b32 s3, 0
	s_lshl_b64 s[0:1], s[0:1], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s4, s0
	s_addc_u32 s1, s5, s1
	s_lshl_b64 s[2:3], s[2:3], 3
	global_load_b64 v[1:2], v0, s[0:1]
	s_add_u32 s2, s8, s2
	s_addc_u32 s3, s9, s3
	s_mov_b32 s4, exec_lo
	s_load_b64 s[2:3], s[2:3], 0x0
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_cmpx_lt_i64_e64 s[2:3], v[1:2]
	s_cbranch_execz .LBB6_2
; %bb.1:
	v_add_co_u32 v0, s0, s0, v0
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v1, null, s1, 0, s0
	v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
	global_store_b64 v[0:1], v[2:3], off
.LBB6_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7min_twoPxxS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 24
		.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 4
		.amdhsa_next_free_sgpr 16
		.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_end6:
	.size	_Z7min_twoPxxS_, .Lfunc_end6-_Z7min_twoPxxS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 164
; NumSgprs: 16
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 16
; NumVGPRsForWavesPerEU: 4
; 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	_Z9min_threePxxS_S_     ; -- Begin function _Z9min_threePxxS_S_
	.globl	_Z9min_threePxxS_S_
	.p2align	8
	.type	_Z9min_threePxxS_S_,@function
_Z9min_threePxxS_S_:                    ; @_Z9min_threePxxS_S_
; %bb.0:
	s_load_b256 s[4:11], s[0:1], 0x0
	s_mov_b32 s2, s15
	s_mov_b32 s3, 0
	v_lshlrev_b32_e32 v2, 3, v0
	s_lshl_b64 s[0:1], s[2:3], 3
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s7, s15, s7
	s_mul_hi_u32 s12, s15, s6
	s_mul_i32 s6, s15, s6
	s_add_i32 s7, s12, s7
	s_add_u32 s8, s8, s0
	s_addc_u32 s9, s9, s1
	s_add_u32 s10, s10, s0
	s_addc_u32 s11, s11, s1
	s_lshl_b64 s[0:1], s[6:7], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s4, s0
	s_addc_u32 s1, s5, s1
	global_load_b64 v[0:1], v2, s[0:1]
	s_load_b64 s[6:7], s[8:9], 0x0
	s_load_b64 s[4:5], s[10:11], 0x0
	s_waitcnt lgkmcnt(0)
	v_cmp_ge_i64_e64 s2, s[6:7], s[4:5]
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s2
	s_cbranch_vccz .LBB7_2
; %bb.1:
	s_waitcnt vmcnt(0)
	v_cmp_lt_i64_e32 vcc_lo, s[4:5], v[0:1]
	s_mov_b32 s2, 0
	s_and_b32 s3, vcc_lo, exec_lo
	s_branch .LBB7_3
.LBB7_2:
	s_mov_b32 s2, -1
                                        ; implicit-def: $sgpr4_sgpr5
.LBB7_3:                                ; %Flow
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s2
	s_cbranch_vccnz .LBB7_5
; %bb.4:
	s_waitcnt vmcnt(0)
	v_cmp_lt_i64_e32 vcc_lo, s[6:7], v[0:1]
	s_and_not1_b32 s2, s3, exec_lo
	s_mov_b64 s[4:5], s[6:7]
	s_and_b32 s3, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s3, s2, s3
.LBB7_5:                                ; %Flow40
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s2, s3
	s_cbranch_execz .LBB7_7
; %bb.6:                                ; %.sink.split
	s_waitcnt vmcnt(0)
	v_add_co_u32 v0, s0, s0, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v1, null, s1, 0, s0
	v_dual_mov_b32 v2, s4 :: v_dual_mov_b32 v3, s5
	global_store_b64 v[0:1], v[2:3], off
.LBB7_7:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9min_threePxxS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.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 4
		.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_end7:
	.size	_Z9min_threePxxS_S_, .Lfunc_end7-_Z9min_threePxxS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 252
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; 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
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .offset:         24
        .size:           8
        .value_kind:     by_value
      - .offset:         32
        .size:           8
        .value_kind:     by_value
      - .offset:         40
        .size:           8
        .value_kind:     by_value
    .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:           _Z19prescan_SingleBlockPxS_xxxx
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z19prescan_SingleBlockPxS_xxxx.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     14
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           8
        .value_kind:     by_value
      - .offset:         40
        .size:           8
        .value_kind:     by_value
    .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:           _Z18prescan_MultiBlockPxS_xS_xx
    .private_segment_fixed_size: 0
    .sgpr_count:     20
    .sgpr_spill_count: 0
    .symbol:         _Z18prescan_MultiBlockPxS_xS_xx.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     17
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 24
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z7add_twoPxxS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z7add_twoPxxS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     3
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9add_threePxxS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9add_threePxxS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     3
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 24
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z7max_twoPxxS_
    .private_segment_fixed_size: 0
    .sgpr_count:     16
    .sgpr_spill_count: 0
    .symbol:         _Z7max_twoPxxS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9max_threePxxS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9max_threePxxS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 24
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z7min_twoPxxS_
    .private_segment_fixed_size: 0
    .sgpr_count:     16
    .sgpr_spill_count: 0
    .symbol:         _Z7min_twoPxxS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9min_threePxxS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9min_threePxxS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
