#include <stdio.h>
#include <assert.h>
#include <cuda.h>
#include <cuda_runtime_api.h>

extern "C" {
	__device__ size_t getIndex(const size_t x,const size_t y,const size_t n) {
		size_t k = ( n * ( n - 1 ) / 2 ) - ( ( n - x ) * ( n - x - 1 ) / 2 ) + y - x - 1;
		return k;
	}
	__device__ void getPos(const size_t k,const size_t n,size_t* x, size_t* y) {
		size_t i = n - 2 - floor(sqrtf(-8*k + 4*n*(n-1)-7)/2.0 - 0.5);
		size_t j = k + i + 1 - n*(n-1)/2 + (n-i)*((n-i)-1)/2;
		*x = i;
		*y = j;
	}

	__global__ void makePresumSingle(const float* input,const size_t cols,const size_t rows,float* sum,float* s23) {
		size_t row = blockIdx.x*blockDim.x+threadIdx.x;
		if(row<rows) {
			size_t base=row*cols;
			float csum=0.0;
			float csum2=0.0;
			for (size_t i=0;i<cols;i++) {
				float x=input[base+i];
				csum += x;
				csum2 += x*x;
			}
			float cs23=(csum2*cols) - (csum*csum);
			sum[row] = csum;
			s23[row] = cs23;
		}
	}

	__global__ void makeCorrelation2(const float* input,const size_t cols,const size_t rows,float* sum,float* s23,float* output) {
		size_t i = blockIdx.x*blockDim.x+threadIdx.x;
		size_t j = blockIdx.y*blockDim.y+threadIdx.y;

		extern __shared__ float cache[];
		if(
			(i<rows) &&
			(j<rows) &&
			(j>i)
			) {
			size_t basei=i*cols;
			size_t basej=j*cols;
			if(threadIdx.x==0) {
				for(size_t k=0;k<cols;k++) {
					cache[k+(threadIdx.y+blockDim.x)*cols]=input[basej+k];
				}
			}
			if(threadIdx.y==0) {
				for(size_t k=0;k<cols;k++) {
					cache[k+(threadIdx.x)*cols]=input[basei+k];
				}
			}
			/*
			for(size_t k=0;k<cols;k++) {
				cache[k+threadIdx.x*cols]=input[basei+k];
				cache[k+(threadIdx.y+8)*cols]=input[basej+k];
			}
			*/
			__syncthreads();
			float sumXY = 0.0;
			for(size_t k=0;k<cols;k++) {
				float a=cache[k+threadIdx.x*cols];
				float b=cache[k+(threadIdx.y+blockDim.x)*cols];
				sumXY += a*b;
			}
			float sumX = sum[i];
			float sumY = sum[j];
			float s1= (sumXY*cols) - (sumX*sumY) ;
			float s2=s23[i];
			float s3=s23[j];
			float s4= sqrtf(s2*s3);
			float correlation=s1/s4;
			size_t k=getIndex(i,j,rows);
			output[k]=correlation;
		}
	}

	__global__ void makeCorrelation(const float* input,const size_t cols,const size_t rows,float* sum,float* s23,float* output) {
		size_t i = blockIdx.x*blockDim.x+threadIdx.x;
		size_t j = blockIdx.y*blockDim.y+threadIdx.y;
		if(
			(i<rows) &&
			(j<rows) &&
			(j>i)
			) {
			size_t basei=i*cols;
			size_t basej=j*cols;
			float sumXY = 0.0;
			for(size_t k=0;k<cols;k++) {
				float a=input[basei+k];
				float b=input[basej+k];
				sumXY += a*b;
			}
			float sumX = sum[i];
			float sumY = sum[j];
			float s1= (sumXY*cols) - (sumX*sumY) ;
			float s2=s23[i];
			float s3=s23[j];
			float s4= sqrtf(s2*s3);
			float correlation=s1/s4;
			size_t k=getIndex(i,j,rows);
			output[k]=correlation;
		}
	}

	static float* getDevInput(const float* input,const size_t cols,const size_t rows) {
		float* output;
		size_t inputSize=rows*cols*sizeof(float);
		cudaMalloc(&output,inputSize);
		cudaMemcpy(output,input,inputSize,cudaMemcpyHostToDevice);
		return output;
	}

	static float* getDevOutput(const size_t rows) {
		float* output;
		size_t outputSize=(rows)*(rows-1)/2*sizeof(float);
		cudaMalloc(&output,outputSize);
		cudaMemset(output,0,outputSize);
		return output;
	}

	static float* getOutput(float* input,const size_t rows) {
		size_t outputSize=(rows)*(rows-1)/2*sizeof(float);
		float* output=(float*)malloc(outputSize);
		assert(output!=NULL);
		cudaMemcpy(output,input,outputSize,cudaMemcpyDeviceToHost);
		return output;
	}

	extern float* getCorrelation(const float* vectors,const size_t cols,const size_t rows) {
		float* dev_sum;
		cudaMalloc(&dev_sum,rows*sizeof(float));
		float* dev_s23;
		cudaMalloc(&dev_s23,rows*sizeof(float));

		float* dev_input=getDevInput(vectors,cols,rows);
		

		fprintf(stderr,"start\n");

		fprintf(stderr,"precomputing sums\n");
		makePresumSingle<<<rows/1024+1,1024>>>(dev_input,cols,rows,dev_sum,dev_s23);
		fprintf(stderr,"%s\n",cudaGetErrorString(cudaGetLastError()));
		float* dev_output=getDevOutput(rows);
		cudaDeviceSynchronize();
		fprintf(stderr, "done\n");

		
		if(1){
			size_t blockDim=32;
			size_t blockCount=rows/blockDim+1;
			makeCorrelation<<<dim3(blockCount,blockCount),dim3(blockDim,blockDim)>>>(dev_input,cols,rows,dev_sum,dev_s23,dev_output);
			fprintf(stderr,"%s\n",cudaGetErrorString(cudaGetLastError()));
		}else{
			int blocksize=32;
			size_t shared=cols*2*blocksize*sizeof(float);
			while(shared>48*1024) {
				blocksize--;
				shared=cols*2*blocksize*sizeof(float);
			}
			fprintf(stderr," %zu %zu %08x\n",shared,blocksize,shared);
			//cudaFuncSetCacheConfig("makeCorrelation2", cudaFuncCachePreferShared);
			cudaDeviceSetCacheConfig( cudaFuncCachePreferShared);
			fprintf(stderr,"%s\n",cudaGetErrorString(cudaGetLastError()));
			makeCorrelation2<<<dim3(rows/blocksize+1,rows/blocksize+1),dim3(blocksize,blocksize),shared>>>(dev_input,cols,rows,dev_sum,dev_s23,dev_output);
			fprintf(stderr,"%s\n",cudaGetErrorString(cudaGetLastError()));
		}
		cudaDeviceSynchronize();
		fprintf(stderr,"%s\n",cudaGetErrorString(cudaGetLastError()));
		fprintf(stderr,"end\n");

		float* output=getOutput(dev_output,rows);
		cudaDeviceSynchronize();
		cudaFree(dev_output);
		cudaFree(dev_input);
		return(output);
	}

}


	.file	"tmpxft_002ead03_00000000-6_correlationCUDA.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2035:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2035:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	getIndex
	.type	getIndex, @function
getIndex:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2027:
	.size	getIndex, .-getIndex
	.globl	getPos
	.type	getPos, @function
getPos:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2028:
	.size	getPos, .-getPos
	.globl	_Z44__device_stub__Z16makePresumSinglePKfmmPfS1_PKfmmPfS1_
	.type	_Z44__device_stub__Z16makePresumSinglePKfmmPfS1_PKfmmPfS1_, @function
_Z44__device_stub__Z16makePresumSinglePKfmmPfS1_PKfmmPfS1_:
.LFB2057:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L6
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	makePresumSingle(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L6:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2057:
	.size	_Z44__device_stub__Z16makePresumSinglePKfmmPfS1_PKfmmPfS1_, .-_Z44__device_stub__Z16makePresumSinglePKfmmPfS1_PKfmmPfS1_
	.globl	makePresumSingle
	.type	makePresumSingle, @function
makePresumSingle:
.LFB2058:
	.cfi_startproc
	endbr64
	jmp	_Z44__device_stub__Z16makePresumSinglePKfmmPfS1_PKfmmPfS1_
	.cfi_endproc
.LFE2058:
	.size	makePresumSingle, .-makePresumSingle
	.globl	_Z47__device_stub__Z16makeCorrelation2PKfmmPfS1_S1_PKfmmPfS1_S1_
	.type	_Z47__device_stub__Z16makeCorrelation2PKfmmPfS1_S1_PKfmmPfS1_S1_, @function
_Z47__device_stub__Z16makeCorrelation2PKfmmPfS1_S1_PKfmmPfS1_S1_:
.LFB2059:
	.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	.L12
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	makeCorrelation2(%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
.L12:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2059:
	.size	_Z47__device_stub__Z16makeCorrelation2PKfmmPfS1_S1_PKfmmPfS1_S1_, .-_Z47__device_stub__Z16makeCorrelation2PKfmmPfS1_S1_PKfmmPfS1_S1_
	.globl	makeCorrelation2
	.type	makeCorrelation2, @function
makeCorrelation2:
.LFB2060:
	.cfi_startproc
	endbr64
	jmp	_Z47__device_stub__Z16makeCorrelation2PKfmmPfS1_S1_PKfmmPfS1_S1_
	.cfi_endproc
.LFE2060:
	.size	makeCorrelation2, .-makeCorrelation2
	.globl	_Z46__device_stub__Z15makeCorrelationPKfmmPfS1_S1_PKfmmPfS1_S1_
	.type	_Z46__device_stub__Z15makeCorrelationPKfmmPfS1_S1_PKfmmPfS1_S1_, @function
_Z46__device_stub__Z15makeCorrelationPKfmmPfS1_S1_PKfmmPfS1_S1_:
.LFB2061:
	.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	.L17
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	makeCorrelation(%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
.L17:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2061:
	.size	_Z46__device_stub__Z15makeCorrelationPKfmmPfS1_S1_PKfmmPfS1_S1_, .-_Z46__device_stub__Z15makeCorrelationPKfmmPfS1_S1_PKfmmPfS1_S1_
	.globl	makeCorrelation
	.type	makeCorrelation, @function
makeCorrelation:
.LFB2062:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z15makeCorrelationPKfmmPfS1_S1_PKfmmPfS1_S1_
	.cfi_endproc
.LFE2062:
	.size	makeCorrelation, .-makeCorrelation
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"start\n"
.LC1:
	.string	"precomputing sums\n"
.LC2:
	.string	"%s\n"
.LC3:
	.string	"done\n"
.LC4:
	.string	"end\n"
	.text
	.globl	getCorrelation
	.type	getCorrelation, @function
getCorrelation:
.LFB2032:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %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
	leaq	0(,%rdx,4), %rbx
	movq	%rbx, %rsi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	leaq	40(%rsp), %r14
	call	cudaMalloc@PLT
	movq	%rbx, %rsi
	imulq	%r12, %rbx
	leaq	16(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	%r14, %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	40(%rsp), %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	stderr(%rip), %rdi
	leaq	.LC0(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	movq	40(%rsp), %r13
	call	__fprintf_chk@PLT
	movq	stderr(%rip), %rdi
	leaq	.LC1(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movq	%rbp, %rax
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	shrq	$10, %rax
	salq	$10, %rdx
	xorl	%r8d, %r8d
	movl	$1, %ecx
	incl	%eax
	movq	%rdx, 40(%rsp)
	movl	%eax, 28(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	28(%rsp), %rdi
	movl	36(%rsp), %esi
	movl	$1, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L23
	movq	16(%rsp), %r8
	movq	8(%rsp), %rcx
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	call	_Z44__device_stub__Z16makePresumSinglePKfmmPfS1_PKfmmPfS1_
.L23:
	call	cudaGetLastError@PLT
	leaq	-1(%rbp), %rbx
	leaq	.LC2(%rip), %r15
	imulq	%rbp, %rbx
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movq	%r15, %rdx
	movl	$2, %esi
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	shrq	%rbx
	movq	%r14, %rdi
	salq	$2, %rbx
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	call	cudaMemset@PLT
	movq	40(%rsp), %r14
	call	cudaDeviceSynchronize@PLT
	movq	stderr(%rip), %rdi
	leaq	.LC3(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movq	%rbp, %rax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	shrq	$5, %rax
	movl	$1, %ecx
	movabsq	$137438953504, %rdx
	movl	$1, %esi
	incq	%rax
	movq	%rdx, 40(%rsp)
	movl	%eax, 28(%rsp)
	movl	%eax, 32(%rsp)
	movq	28(%rsp), %rdi
	movl	$1, 48(%rsp)
	movl	$1, 36(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L24
	movq	16(%rsp), %r8
	movq	8(%rsp), %rcx
	movq	%r14, %r9
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	call	_Z46__device_stub__Z15makeCorrelationPKfmmPfS1_S1_PKfmmPfS1_S1_
.L24:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movq	%r15, %rdx
	movl	$2, %esi
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	call	cudaDeviceSynchronize@PLT
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	movq	stderr(%rip), %rdi
	movq	%r15, %rdx
	movl	$2, %esi
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	stderr(%rip), %rdi
	leaq	.LC4(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movq	%rbx, %rdi
	call	malloc@PLT
	movl	$2, %ecx
	movq	%rbx, %rdx
	movq	%r14, %rsi
	movq	%rax, %rdi
	movq	%rax, %rbp
	call	cudaMemcpy@PLT
	call	cudaDeviceSynchronize@PLT
	movq	%r14, %rdi
	call	cudaFree@PLT
	movq	%r13, %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	movq	%rbp, %rax
	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	getCorrelation, .-getCorrelation
	.section	.rodata.str1.1
.LC5:
	.string	"makeCorrelation"
.LC6:
	.string	"makeCorrelation2"
.LC7:
	.string	"makePresumSingle"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2064:
	.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	.LC5(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	makeCorrelation(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC6(%rip), %rdx
	orl	$-1, %r8d
	leaq	makeCorrelation2(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC7(%rip), %rdx
	orl	$-1, %r8d
	leaq	makePresumSingle(%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
.LFE2064:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <assert.h>
#include <hip/hip_runtime.h>
#include <hip/hip_runtime_api.h>

extern "C" {
	__device__ size_t getIndex(const size_t x,const size_t y,const size_t n) {
		size_t k = ( n * ( n - 1 ) / 2 ) - ( ( n - x ) * ( n - x - 1 ) / 2 ) + y - x - 1;
		return k;
	}
	__device__ void getPos(const size_t k,const size_t n,size_t* x, size_t* y) {
		size_t i = n - 2 - floor(sqrtf(-8*k + 4*n*(n-1)-7)/2.0 - 0.5);
		size_t j = k + i + 1 - n*(n-1)/2 + (n-i)*((n-i)-1)/2;
		*x = i;
		*y = j;
	}

	__global__ void makePresumSingle(const float* input,const size_t cols,const size_t rows,float* sum,float* s23) {
		size_t row = blockIdx.x*blockDim.x+threadIdx.x;
		if(row<rows) {
			size_t base=row*cols;
			float csum=0.0;
			float csum2=0.0;
			for (size_t i=0;i<cols;i++) {
				float x=input[base+i];
				csum += x;
				csum2 += x*x;
			}
			float cs23=(csum2*cols) - (csum*csum);
			sum[row] = csum;
			s23[row] = cs23;
		}
	}

	__global__ void makeCorrelation2(const float* input,const size_t cols,const size_t rows,float* sum,float* s23,float* output) {
		size_t i = blockIdx.x*blockDim.x+threadIdx.x;
		size_t j = blockIdx.y*blockDim.y+threadIdx.y;

		extern __shared__ float cache[];
		if(
			(i<rows) &&
			(j<rows) &&
			(j>i)
			) {
			size_t basei=i*cols;
			size_t basej=j*cols;
			if(threadIdx.x==0) {
				for(size_t k=0;k<cols;k++) {
					cache[k+(threadIdx.y+blockDim.x)*cols]=input[basej+k];
				}
			}
			if(threadIdx.y==0) {
				for(size_t k=0;k<cols;k++) {
					cache[k+(threadIdx.x)*cols]=input[basei+k];
				}
			}
			/*
			for(size_t k=0;k<cols;k++) {
				cache[k+threadIdx.x*cols]=input[basei+k];
				cache[k+(threadIdx.y+8)*cols]=input[basej+k];
			}
			*/
			__syncthreads();
			float sumXY = 0.0;
			for(size_t k=0;k<cols;k++) {
				float a=cache[k+threadIdx.x*cols];
				float b=cache[k+(threadIdx.y+blockDim.x)*cols];
				sumXY += a*b;
			}
			float sumX = sum[i];
			float sumY = sum[j];
			float s1= (sumXY*cols) - (sumX*sumY) ;
			float s2=s23[i];
			float s3=s23[j];
			float s4= sqrtf(s2*s3);
			float correlation=s1/s4;
			size_t k=getIndex(i,j,rows);
			output[k]=correlation;
		}
	}

	__global__ void makeCorrelation(const float* input,const size_t cols,const size_t rows,float* sum,float* s23,float* output) {
		size_t i = blockIdx.x*blockDim.x+threadIdx.x;
		size_t j = blockIdx.y*blockDim.y+threadIdx.y;
		if(
			(i<rows) &&
			(j<rows) &&
			(j>i)
			) {
			size_t basei=i*cols;
			size_t basej=j*cols;
			float sumXY = 0.0;
			for(size_t k=0;k<cols;k++) {
				float a=input[basei+k];
				float b=input[basej+k];
				sumXY += a*b;
			}
			float sumX = sum[i];
			float sumY = sum[j];
			float s1= (sumXY*cols) - (sumX*sumY) ;
			float s2=s23[i];
			float s3=s23[j];
			float s4= sqrtf(s2*s3);
			float correlation=s1/s4;
			size_t k=getIndex(i,j,rows);
			output[k]=correlation;
		}
	}

	static float* getDevInput(const float* input,const size_t cols,const size_t rows) {
		float* output;
		size_t inputSize=rows*cols*sizeof(float);
		hipMalloc(&output,inputSize);
		hipMemcpy(output,input,inputSize,hipMemcpyHostToDevice);
		return output;
	}

	static float* getDevOutput(const size_t rows) {
		float* output;
		size_t outputSize=(rows)*(rows-1)/2*sizeof(float);
		hipMalloc(&output,outputSize);
		hipMemset(output,0,outputSize);
		return output;
	}

	static float* getOutput(float* input,const size_t rows) {
		size_t outputSize=(rows)*(rows-1)/2*sizeof(float);
		float* output=(float*)malloc(outputSize);
		assert(output!=NULL);
		hipMemcpy(output,input,outputSize,hipMemcpyDeviceToHost);
		return output;
	}

	extern float* getCorrelation(const float* vectors,const size_t cols,const size_t rows) {
		float* dev_sum;
		hipMalloc(&dev_sum,rows*sizeof(float));
		float* dev_s23;
		hipMalloc(&dev_s23,rows*sizeof(float));

		float* dev_input=getDevInput(vectors,cols,rows);
		

		fprintf(stderr,"start\n");

		fprintf(stderr,"precomputing sums\n");
		makePresumSingle<<<rows/1024+1,1024>>>(dev_input,cols,rows,dev_sum,dev_s23);
		fprintf(stderr,"%s\n",hipGetErrorString(hipGetLastError()));
		float* dev_output=getDevOutput(rows);
		hipDeviceSynchronize();
		fprintf(stderr, "done\n");

		
		if(1){
			size_t blockDim=32;
			size_t blockCount=rows/blockDim+1;
			makeCorrelation<<<dim3(blockCount,blockCount),dim3(blockDim,blockDim)>>>(dev_input,cols,rows,dev_sum,dev_s23,dev_output);
			fprintf(stderr,"%s\n",hipGetErrorString(hipGetLastError()));
		}else{
			int blocksize=32;
			size_t shared=cols*2*blocksize*sizeof(float);
			while(shared>48*1024) {
				blocksize--;
				shared=cols*2*blocksize*sizeof(float);
			}
			fprintf(stderr," %zu %zu %08x\n",shared,blocksize,shared);
			//cudaFuncSetCacheConfig("makeCorrelation2", cudaFuncCachePreferShared);
			hipDeviceSetCacheConfig( hipFuncCachePreferShared);
			fprintf(stderr,"%s\n",hipGetErrorString(hipGetLastError()));
			makeCorrelation2<<<dim3(rows/blocksize+1,rows/blocksize+1),dim3(blocksize,blocksize),shared>>>(dev_input,cols,rows,dev_sum,dev_s23,dev_output);
			fprintf(stderr,"%s\n",hipGetErrorString(hipGetLastError()));
		}
		hipDeviceSynchronize();
		fprintf(stderr,"%s\n",hipGetErrorString(hipGetLastError()));
		fprintf(stderr,"end\n");

		float* output=getOutput(dev_output,rows);
		hipDeviceSynchronize();
		hipFree(dev_output);
		hipFree(dev_input);
		return(output);
	}

}


	.text
	.file	"correlationCUDA.hip"
	.globl	__device_stub__makePresumSingle # -- Begin function __device_stub__makePresumSingle
	.type	__device_stub__makePresumSingle,@function
__device_stub__makePresumSingle:        # @__device_stub__makePresumSingle
	.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	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$makePresumSingle, %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_end0:
	.size	__device_stub__makePresumSingle, .Lfunc_end0-__device_stub__makePresumSingle
	.cfi_endproc
                                        # -- End function
	.globl	__device_stub__makeCorrelation2 # -- Begin function __device_stub__makeCorrelation2
	.type	__device_stub__makeCorrelation2,@function
__device_stub__makeCorrelation2:        # @__device_stub__makeCorrelation2
	.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	$makeCorrelation2, %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_end1:
	.size	__device_stub__makeCorrelation2, .Lfunc_end1-__device_stub__makeCorrelation2
	.cfi_endproc
                                        # -- End function
	.globl	__device_stub__makeCorrelation  # -- Begin function __device_stub__makeCorrelation
	.type	__device_stub__makeCorrelation,@function
__device_stub__makeCorrelation:         # @__device_stub__makeCorrelation
	.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	$makeCorrelation, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	__device_stub__makeCorrelation, .Lfunc_end2-__device_stub__makeCorrelation
	.cfi_endproc
                                        # -- End function
	.globl	getCorrelation                  # -- Begin function getCorrelation
	.type	getCorrelation,@function
getCorrelation:                         # @getCorrelation
	.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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movabsq	$4294967296, %r12               # imm = 0x100000000
	leaq	(,%rdx,4), %r13
	leaq	8(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	movq	%rsp, %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	movq	%r15, %r13
	imulq	%r14, %r13
	shlq	$2, %r13
	leaq	16(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	movq	(%rbp), %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rbp), %rbx
	movq	stderr(%rip), %rcx
	movl	$.L.str, %edi
	movl	$6, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movq	stderr(%rip), %rcx
	movl	$.L.str.1, %edi
	movl	$18, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movq	%r14, %rdi
	shrq	$10, %rdi
	incl	%edi
	btsq	$32, %rdi
	leaq	1024(%r12), %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_2
# %bb.1:
	movq	8(%rsp), %rcx
	movq	(%rsp), %r8
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	__device_stub__makePresumSingle
.LBB3_2:
	movq	stderr(%rip), %r13
	callq	hipGetLastError
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.2, %esi
	movq	%r13, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	fprintf
	leaq	-1(%r14), %r13
	imulq	%r14, %r13
	addq	%r13, %r13
	andq	$-4, %r13
	leaq	16(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	movq	(%rbp), %rdi
	xorl	%esi, %esi
	movq	%r13, %rdx
	callq	hipMemset
	movq	(%rbp), %rbp
	callq	hipDeviceSynchronize
	movq	stderr(%rip), %rcx
	movl	$.L.str.3, %edi
	movl	$5, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movq	%r14, %rax
	shrq	$5, %rax
	incl	%eax
	incq	%r12
	imulq	%rax, %r12
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_4
# %bb.3:
	movq	8(%rsp), %rcx
	movq	(%rsp), %r8
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%rbp, %r9
	callq	__device_stub__makeCorrelation
.LBB3_4:
	movq	stderr(%rip), %r14
	callq	hipGetLastError
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.2, %esi
	movq	%r14, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	fprintf
	callq	hipDeviceSynchronize
	movq	stderr(%rip), %r14
	callq	hipGetLastError
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.2, %esi
	movq	%r14, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	fprintf
	movq	stderr(%rip), %rcx
	movl	$.L.str.4, %edi
	movl	$4, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movq	%r13, %rdi
	callq	malloc
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	%rbp, %rsi
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	callq	hipDeviceSynchronize
	movq	%rbp, %rdi
	callq	hipFree
	movq	%rbx, %rdi
	callq	hipFree
	movq	%r14, %rax
	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_end3:
	.size	getCorrelation, .Lfunc_end3-getCorrelation
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$makePresumSingle, %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	$makeCorrelation2, %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	$makeCorrelation, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB5_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	makePresumSingle,@object        # @makePresumSingle
	.section	.rodata,"a",@progbits
	.globl	makePresumSingle
	.p2align	3, 0x0
makePresumSingle:
	.quad	__device_stub__makePresumSingle
	.size	makePresumSingle, 8

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

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"start\n"
	.size	.L.str, 7

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"precomputing sums\n"
	.size	.L.str.1, 19

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

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"done\n"
	.size	.L.str.3, 6

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"end\n"
	.size	.L.str.4, 5

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"makePresumSingle"
	.size	.L__unnamed_1, 17

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

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

	.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

	.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 __device_stub__makePresumSingle
	.addrsig_sym __device_stub__makeCorrelation2
	.addrsig_sym __device_stub__makeCorrelation
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym makePresumSingle
	.addrsig_sym makeCorrelation2
	.addrsig_sym makeCorrelation
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	makePresumSingle        ; -- Begin function makePresumSingle
	.globl	makePresumSingle
	.p2align	8
	.type	makePresumSingle,@function
makePresumSingle:                       ; @makePresumSingle
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b256 s[4:11], s[0:1], 0x0
	v_mov_b32_e32 v5, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	v_mov_b32_e32 v2, v5
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u64_e64 s[8:9], v[1:2]
	s_cbranch_execz .LBB0_5
; %bb.1:
	s_load_b64 s[0:1], s[0:1], 0x20
	v_mov_b32_e32 v0, 0
	s_cmp_eq_u64 s[6:7], 0
	s_cbranch_scc1 .LBB0_4
; %bb.2:                                ; %.lr.ph
	v_mad_u64_u32 v[3:4], null, v1, s6, 0
	s_mov_b64 s[2:3], s[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v0, v4
	v_mad_u64_u32 v[4:5], null, v1, s7, v[0:1]
	v_dual_mov_b32 v5, 0 :: v_dual_mov_b32 v0, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	v_add_co_u32 v3, vcc_lo, s4, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v4, vcc_lo, s5, v4, vcc_lo
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v6, v[3:4], off
	v_add_co_u32 v3, vcc_lo, v3, 4
	s_add_u32 s2, s2, -1
	v_add_co_ci_u32_e32 v4, vcc_lo, 0, v4, vcc_lo
	s_addc_u32 s3, s3, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u64 s[2:3], 0
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v5, v5, v6
	v_fmac_f32_e32 v0, v6, v6
	s_cbranch_scc0 .LBB0_3
.LBB0_4:                                ; %Flow56
	s_clz_i32_u32 s2, s7
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_min_u32 s4, s2, 32
	v_mul_f32_e32 v6, v5, v5
	s_lshl_b64 s[2:3], s[6:7], s4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_min_u32 s2, s2, 1
	s_or_b32 s2, s3, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	v_cvt_f32_u32_e32 v3, s2
	s_sub_i32 s2, 32, s4
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_ldexp_f32 v7, v3, s2
	v_add_co_u32 v3, vcc_lo, s10, v1
	v_add_co_ci_u32_e32 v4, vcc_lo, s11, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_fma_f32 v6, v0, v7, -v6
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v1
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v2, vcc_lo
	global_store_b32 v[3:4], v5, off
	global_store_b32 v[0:1], v6, off
.LBB0_5:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel makePresumSingle
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 8
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	makePresumSingle, .Lfunc_end0-makePresumSingle
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 336
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	makeCorrelation2        ; -- Begin function makeCorrelation2
	.globl	makeCorrelation2
	.p2align	8
	.type	makeCorrelation2,@function
makeCorrelation2:                       ; @makeCorrelation2
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b256 s[4:11], s[0:1], 0x0
	v_and_b32_e32 v4, 0x3ff, v0
	v_bfe_u32 v5, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s12, s2, 0xffff
	s_lshr_b32 s3, s2, 16
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[0:1], null, s14, s12, v[4:5]
	v_mov_b32_e32 v1, 0
	v_mad_u64_u32 v[2:3], null, s15, s3, v[5:6]
	v_mov_b32_e32 v3, v1
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_gt_u64_e32 vcc_lo, s[8:9], v[0:1]
	v_cmp_gt_u32_e64 s2, v2, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_u64_e64 s3, s[8:9], v[2:3]
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB1_12
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x20
	v_add_nc_u32_e32 v6, s12, v5
	v_cmp_eq_u32_e32 vcc_lo, 0, v4
	s_cmp_lg_u64 s[6:7], 0
	s_cselect_b32 s14, -1, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_mul_lo_u32 v8, v6, s6
	s_and_b32 s12, vcc_lo, s14
	s_and_saveexec_b32 s15, s12
	s_cbranch_execz .LBB1_4
; %bb.2:                                ; %.lr.ph
	v_mad_u64_u32 v[6:7], null, v2, s6, 0
	s_mov_b64 s[12:13], s[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[9:10], null, v2, s7, v[7:8]
	v_mov_b32_e32 v7, v9
	v_lshl_add_u32 v9, v8, 2, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[6:7], 2, v[6:7]
	v_add_co_u32 v6, vcc_lo, s4, v6
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v7, vcc_lo
.LBB1_3:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v10, v[6:7], off
	v_add_co_u32 v6, vcc_lo, v6, 4
	s_add_u32 s12, s12, -1
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	s_addc_u32 s13, s13, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u64 s[12:13], 0
	s_waitcnt vmcnt(0)
	ds_store_b32 v9, v10
	v_add_nc_u32_e32 v9, 4, v9
	s_cbranch_scc1 .LBB1_3
.LBB1_4:                                ; %Flow126
	s_or_b32 exec_lo, exec_lo, s15
	v_mul_lo_u32 v6, v4, s6
	v_cmp_eq_u32_e32 vcc_lo, 0, v5
	s_and_b32 s13, vcc_lo, s14
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s12, s13
	s_cbranch_execz .LBB1_7
; %bb.5:                                ; %.lr.ph76
	v_mad_u64_u32 v[4:5], null, v0, s6, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshl_add_u32 v7, v6, 2, 0
	v_mad_u64_u32 v[9:10], null, v0, s7, v[5:6]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v5, v9
	v_lshlrev_b64 v[4:5], 2, v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v5, vcc_lo
	s_mov_b64 s[4:5], s[6:7]
.LBB1_6:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v9, v[4:5], off
	v_add_co_u32 v4, vcc_lo, v4, 4
	s_add_u32 s4, s4, -1
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_addc_u32 s5, s5, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u64 s[4:5], 0
	s_waitcnt vmcnt(0)
	ds_store_b32 v7, v9
	v_add_nc_u32_e32 v7, 4, v7
	s_cbranch_scc1 .LBB1_6
.LBB1_7:                                ; %Flow124
	s_or_b32 exec_lo, exec_lo, s12
	s_cmp_eq_u64 s[6:7], 0
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB1_10
; %bb.8:                                ; %.lr.ph79
	v_lshl_add_u32 v5, v8, 2, 0
	v_lshl_add_u32 v6, v6, 2, 0
	v_mov_b32_e32 v4, 0
	s_mov_b64 s[4:5], s[6:7]
.LBB1_9:                                ; =>This Inner Loop Header: Depth=1
	ds_load_b32 v7, v6
	ds_load_b32 v8, v5
	s_add_u32 s4, s4, -1
	v_add_nc_u32_e32 v5, 4, v5
	v_add_nc_u32_e32 v6, 4, v6
	s_addc_u32 s5, s5, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u64 s[4:5], 0
	s_waitcnt lgkmcnt(0)
	v_fmac_f32_e32 v4, v7, v8
	s_cbranch_scc0 .LBB1_9
	s_branch .LBB1_11
.LBB1_10:
	v_mov_b32_e32 v4, 0
.LBB1_11:                               ; %Flow122
	v_lshlrev_b64 v[5:6], 2, v[0:1]
	v_lshlrev_b64 v[1:2], 2, v[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v7, vcc_lo, s0, v5
	v_add_co_ci_u32_e32 v8, vcc_lo, s1, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v9, vcc_lo, s0, v1
	v_add_co_ci_u32_e32 v10, vcc_lo, s1, v2, vcc_lo
	v_add_co_u32 v5, vcc_lo, s10, v5
	s_clause 0x1
	global_load_b32 v3, v[7:8], off
	global_load_b32 v9, v[9:10], off
	v_add_co_ci_u32_e32 v6, vcc_lo, s11, v6, vcc_lo
	v_add_co_u32 v7, vcc_lo, s10, v1
	v_add_co_ci_u32_e32 v8, vcc_lo, s11, v2, vcc_lo
	s_clause 0x1
	global_load_b32 v5, v[5:6], off
	global_load_b32 v6, v[7:8], off
	s_clz_i32_u32 s0, s7
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_min_u32 s1, s0, 32
	s_lshl_b64 s[4:5], s[6:7], s1
	s_waitcnt vmcnt(2)
	v_mul_f32_e32 v3, v3, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v7, 0x4f800000, v3
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v3
	v_cndmask_b32_e32 v3, v3, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_sqrt_f32_e32 v7, v3
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v8, -1, v7
	v_add_nc_u32_e32 v9, 1, v7
	v_fma_f32 v10, -v8, v7, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v11, -v9, v7, v3
	v_cmp_ge_f32_e64 s0, 0, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cndmask_b32_e64 v7, v7, v8, s0
	s_min_u32 s0, s4, 1
	s_or_b32 s4, s5, s0
	v_cmp_lt_f32_e64 s0, 0, v11
	v_cvt_f32_u32_e32 v8, s4
	s_delay_alu instid0(VALU_DEP_2)
	v_cndmask_b32_e64 v7, v7, v9, s0
	s_sub_i32 s0, 32, s1
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_ldexp_f32 v8, v8, s0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v9, 0x37800000, v7
	s_waitcnt vmcnt(0)
	v_dual_mul_f32 v5, v5, v6 :: v_dual_cndmask_b32 v6, v7, v9
	v_cmp_class_f32_e64 vcc_lo, v3, 0x260
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_fma_f32 v5, v4, v8, -v5
	v_sub_co_u32 v7, s0, s8, v0
	v_cndmask_b32_e32 v6, v6, v3, vcc_lo
	v_sub_co_ci_u32_e64 v3, null, s9, 0, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v9, vcc_lo, v7, -1
	v_div_scale_f32 v8, null, v6, v6, v5
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v4, vcc_lo, -1, v3, vcc_lo
	v_mul_lo_u32 v12, v9, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v10, v8
	s_add_u32 s0, s8, -1
	v_mul_lo_u32 v11, v4, v7
	v_mad_u64_u32 v[3:4], null, v9, v7, 0
	v_div_scale_f32 v9, vcc_lo, v5, v6, v5
	s_mul_i32 s4, s0, s9
	s_mul_hi_u32 s5, s0, s8
	s_addc_u32 s1, s9, -1
	s_waitcnt_depctr 0xfff
	v_fma_f32 v7, -v8, v10, 1.0
	v_add3_u32 v4, v4, v12, v11
	s_add_i32 s5, s5, s4
	s_mul_i32 s4, s0, s8
	s_mul_i32 s1, s1, s8
	v_fmac_f32_e32 v10, v7, v10
	v_lshrrev_b64 v[3:4], 1, v[3:4]
	s_add_i32 s5, s5, s1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v7, v9, v10
	v_add_co_u32 v0, s0, v3, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v3, s0, 0, v4, s0
	v_fma_f32 v11, -v8, v7, v9
	s_lshl_b64 s[0:1], s[4:5], 1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_not_b32_e32 v4, v3
	v_not_b32_e32 v3, v0
	v_fmac_f32_e32 v7, v11, v10
	s_and_b32 s0, s0, -4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_add_u32 s0, s2, s0
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f32 v0, -v8, v7, v9
	s_addc_u32 s1, s3, s1
	v_div_fmas_f32 v0, v0, v10, v7
	v_add_co_u32 v1, vcc_lo, s0, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_fixup_f32 v5, v0, v6, v5
	v_add_co_u32 v0, vcc_lo, v1, v3
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v1, vcc_lo, v2, v4, vcc_lo
	global_store_b32 v[0:1], v5, off
.LBB1_12:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel makeCorrelation2
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 13
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	makeCorrelation2, .Lfunc_end1-makeCorrelation2
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1192
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	makeCorrelation         ; -- Begin function makeCorrelation
	.globl	makeCorrelation
	.p2align	8
	.type	makeCorrelation,@function
makeCorrelation:                        ; @makeCorrelation
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b256 s[4:11], s[0:1], 0x0
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v4, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_mov_b32_e32 v1, 0
	v_mad_u64_u32 v[2:3], null, s15, s3, v[4:5]
	v_mov_b32_e32 v3, v1
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_gt_u64_e32 vcc_lo, s[8:9], v[0:1]
	v_cmp_gt_u32_e64 s2, v2, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_u64_e64 s3, s[8:9], v[2:3]
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB2_6
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x20
	s_cmp_eq_u64 s[6:7], 0
	s_cbranch_scc1 .LBB2_4
; %bb.2:                                ; %.lr.ph
	v_mad_u64_u32 v[4:5], null, v0, s6, 0
	v_mad_u64_u32 v[6:7], null, v2, s6, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[8:9], null, v0, s7, v[5:6]
	v_mad_u64_u32 v[9:10], null, v2, s7, v[7:8]
	v_dual_mov_b32 v5, v8 :: v_dual_mov_b32 v8, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[4:5], 2, v[4:5]
	v_mov_b32_e32 v7, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, s4, v4
	v_lshlrev_b64 v[6:7], 2, v[6:7]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v5, vcc_lo
	v_add_co_u32 v6, vcc_lo, s4, v6
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v7, vcc_lo
	s_mov_b64 s[4:5], s[6:7]
.LBB2_3:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v9, v[4:5], off
	global_load_b32 v10, v[6:7], off
	v_add_co_u32 v6, vcc_lo, v6, 4
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	v_add_co_u32 v4, vcc_lo, v4, 4
	s_add_u32 s4, s4, -1
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_addc_u32 s5, s5, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u64 s[4:5], 0
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v8, v9, v10
	s_cbranch_scc0 .LBB2_3
	s_branch .LBB2_5
.LBB2_4:
	v_mov_b32_e32 v8, 0
.LBB2_5:                                ; %Flow78
	v_lshlrev_b64 v[4:5], 2, v[0:1]
	v_lshlrev_b64 v[1:2], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v6, vcc_lo, s0, v4
	v_add_co_ci_u32_e32 v7, vcc_lo, s1, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v9, vcc_lo, s0, v1
	v_add_co_ci_u32_e32 v10, vcc_lo, s1, v2, vcc_lo
	v_add_co_u32 v3, vcc_lo, s10, v4
	s_clause 0x1
	global_load_b32 v7, v[6:7], off
	global_load_b32 v9, v[9:10], off
	v_add_co_ci_u32_e32 v4, vcc_lo, s11, v5, vcc_lo
	v_add_co_u32 v5, vcc_lo, s10, v1
	v_add_co_ci_u32_e32 v6, vcc_lo, s11, v2, vcc_lo
	s_clause 0x1
	global_load_b32 v3, v[3:4], off
	global_load_b32 v4, v[5:6], off
	s_clz_i32_u32 s0, s7
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_min_u32 s1, s0, 32
	s_lshl_b64 s[4:5], s[6:7], s1
	s_waitcnt vmcnt(2)
	v_mul_f32_e32 v5, v7, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_mul_f32_e32 v6, 0x4f800000, v5
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v5
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v3, v3, v4
	v_cndmask_b32_e32 v5, v5, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_sqrt_f32_e32 v6, v5
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v7, -1, v6
	v_add_nc_u32_e32 v9, 1, v6
	v_fma_f32 v10, -v7, v6, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v11, -v9, v6, v5
	v_cmp_ge_f32_e64 s0, 0, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cndmask_b32_e64 v6, v6, v7, s0
	s_min_u32 s0, s4, 1
	s_or_b32 s4, s5, s0
	v_cmp_lt_f32_e64 s0, 0, v11
	v_cvt_f32_u32_e32 v7, s4
	s_delay_alu instid0(VALU_DEP_2)
	v_cndmask_b32_e64 v6, v6, v9, s0
	s_sub_i32 s0, 32, s1
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_ldexp_f32 v7, v7, s0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v9, 0x37800000, v6
	v_cndmask_b32_e32 v4, v6, v9, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v5, 0x260
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f32 v6, v8, v7, -v3
	v_sub_co_u32 v7, s0, s8, v0
	v_sub_co_ci_u32_e64 v3, null, s9, 0, s0
	v_cndmask_b32_e32 v5, v4, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v9, vcc_lo, v7, -1
	v_add_co_ci_u32_e32 v4, vcc_lo, -1, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_scale_f32 v8, null, v5, v5, v6
	v_mul_lo_u32 v12, v9, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_mul_lo_u32 v11, v4, v7
	v_mad_u64_u32 v[3:4], null, v9, v7, 0
	v_rcp_f32_e32 v10, v8
	s_add_u32 s0, s8, -1
	s_addc_u32 s1, s9, -1
	s_mul_i32 s4, s0, s9
	s_mul_hi_u32 s5, s0, s8
	s_mul_i32 s1, s1, s8
	s_delay_alu instid0(VALU_DEP_1)
	v_add3_u32 v4, v4, v12, v11
	s_add_i32 s5, s5, s4
	s_mul_i32 s4, s0, s8
	s_add_i32 s5, s5, s1
	s_waitcnt_depctr 0xfff
	v_fma_f32 v7, -v8, v10, 1.0
	v_lshrrev_b64 v[3:4], 1, v[3:4]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v10, v7, v10
	v_div_scale_f32 v9, vcc_lo, v6, v5, v6
	v_add_co_u32 v0, s0, v3, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v3, s0, 0, v4, s0
	v_mul_f32_e32 v7, v9, v10
	s_lshl_b64 s[0:1], s[4:5], 1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_not_b32_e32 v4, v3
	v_not_b32_e32 v3, v0
	v_fma_f32 v11, -v8, v7, v9
	s_and_b32 s0, s0, -4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_add_u32 s0, s2, s0
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v7, v11, v10
	s_addc_u32 s1, s3, s1
	v_fma_f32 v0, -v8, v7, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_div_fmas_f32 v0, v0, v10, v7
	v_add_co_u32 v1, vcc_lo, s0, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v2, vcc_lo
	v_div_fixup_f32 v5, v0, v5, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v0, vcc_lo, v1, v3
	v_add_co_ci_u32_e32 v1, vcc_lo, v2, v4, vcc_lo
	global_store_b32 v[0:1], v5, off
.LBB2_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel makeCorrelation
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 13
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	makeCorrelation, .Lfunc_end2-makeCorrelation
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 968
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           makePresumSingle
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         makePresumSingle.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         168
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           makeCorrelation2
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         makeCorrelation2.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           8
        .value_kind:     by_value
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           makeCorrelation
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         makeCorrelation.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
