#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#define N 600
#define DIMS 2
#define epsilon 0.1
#define ss 1
#define blocksize 16
#define BLK (blocksize*blocksize)
#define dimGrid (N / BLK + 1)

__device__ float distance(float *a, float *b) {
    int i;
    float d = 0.0, t;
    for(i=0;i<DIMS;i++) {
        t = a[i] - b[i];
        d += t*t;
    }
    return d;
}

__device__ void meanshift(float *x, float *y, float *result) {
    int j, i;
    float sum1[DIMS], sum2 = 0.0, dis, k;
    for (i=0;i<DIMS;i++) sum1[i] = 0.0;
    for(j=0;j<N;j++) {
        dis = distance(y,x+DIMS*j);
        if (dis > ss*ss) continue;
        k = exp( - dis / (2*ss) );
        sum2 += k;
        for(i=0;i<DIMS;i++) sum1[i] += k * x[DIMS*j+i];
    }
    for(i=0;i<DIMS;i++) result[i] = sum1[i] / sum2;
}

__global__ void msfunction(float *x, float *y) {
    __shared__ float ys[BLK*DIMS], temp[BLK*DIMS], m[BLK];
    int h, j = threadIdx.x * blockDim.x  + threadIdx.y;
    int i = blockIdx.x * BLK + j;
    if (i < N) {
        memcpy(ys+DIMS*j, x+DIMS*i, DIMS*sizeof(float));
        do {
            meanshift(x, ys+DIMS*j, temp+DIMS*j);
            m[j] = sqrt(distance(temp+DIMS*j, ys+DIMS*j));
            memcpy(ys+DIMS*j, temp+DIMS*j, DIMS*sizeof(float));
        } while (m[j]>epsilon);
        for(h=0;h<DIMS;h++)
            y[DIMS*i+h] = ys[DIMS*j+h];
    }
}

int main() {
    dim3 dimBlock( blocksize, blocksize );
    int i, j, errors = 0;
    float *x, *y, *xd, *yd, msecs, temp;
    clock_t start, end;
    x = (float *)malloc(DIMS*N*sizeof(float));
    y = (float *)malloc(DIMS*N*sizeof(float));
    FILE *data = fopen("data.txt", "r"), *output = fopen("meanshift.txt", "w"), *check = fopen("results.txt", "r");
    for (i=0;i<DIMS*N;i++)
        fscanf(data, "%f", &x[i]);
    fclose(data);
    cudaMalloc(&xd, N*DIMS*sizeof(float));
    cudaMalloc(&yd, N*DIMS*sizeof(float));
    cudaMemcpy(xd, x, N*DIMS*sizeof(float),cudaMemcpyHostToDevice);
    start = clock();
    msfunction<<<dimGrid,dimBlock>>>(xd, yd);
    cudaThreadSynchronize();
    end = clock();
    msecs = (float)1000*(end - start) / CLOCKS_PER_SEC;
    cudaMemcpy(y, yd, N*DIMS*sizeof(float),cudaMemcpyDeviceToHost);
    for (i=0;i<N;i++)
        for (j=0;j<DIMS;j++) {
            if (j==DIMS-1) fprintf(output, "%f\n", y[DIMS*i+j]);
            else fprintf(output, "%f ", y[DIMS*i+j]);
        }
    for (i=0;i<N*DIMS;i++) {
        fscanf(check, "%f", &temp);
        if ( fabs( temp - y[i] ) > 0.1) errors++;
    }
    printf("Time is %f msecs\n", msecs);
    printf("detected %d errors, %.2f %% of the total values\n", errors, (float)100*errors/(N*DIMS));
    fclose(output);
    fclose(check);
    cudaFree(xd);
    cudaFree(yd);
    free(x);
    free(y);
}
	.file	"tmpxft_002c1f1c_00000000-6_mshift_sharing.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2032:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2032:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z8distancePfS_
	.type	_Z8distancePfS_, @function
_Z8distancePfS_:
.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	_Z8distancePfS_, .-_Z8distancePfS_
	.globl	_Z9meanshiftPfS_S_
	.type	_Z9meanshiftPfS_S_, @function
_Z9meanshiftPfS_S_:
.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	_Z9meanshiftPfS_S_, .-_Z9meanshiftPfS_S_
	.globl	_Z32__device_stub__Z10msfunctionPfS_PfS_
	.type	_Z32__device_stub__Z10msfunctionPfS_PfS_, @function
_Z32__device_stub__Z10msfunctionPfS_PfS_:
.LFB2054:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L6
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z10msfunctionPfS_(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L6:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2054:
	.size	_Z32__device_stub__Z10msfunctionPfS_PfS_, .-_Z32__device_stub__Z10msfunctionPfS_PfS_
	.globl	_Z10msfunctionPfS_
	.type	_Z10msfunctionPfS_, @function
_Z10msfunctionPfS_:
.LFB2055:
	.cfi_startproc
	endbr64
	jmp	_Z32__device_stub__Z10msfunctionPfS_PfS_
	.cfi_endproc
.LFE2055:
	.size	_Z10msfunctionPfS_, .-_Z10msfunctionPfS_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"r"
.LC1:
	.string	"data.txt"
.LC2:
	.string	"w"
.LC3:
	.string	"meanshift.txt"
.LC4:
	.string	"results.txt"
.LC5:
	.string	"%f"
.LC8:
	.string	"%f "
.LC9:
	.string	"%f\n"
.LC12:
	.string	"Time is %f msecs\n"
.LC15:
	.string	"detected %d errors, %.2f %% of the total values\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$4800, %edi
	leaq	.LC5(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	movabsq	$68719476752, %rax
	movl	$1, 40(%rsp)
	movq	%rax, 32(%rsp)
	call	malloc@PLT
	movl	$4800, %edi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	leaq	4800(%rbp), %r12
	movq	%rax, %rbx
	call	fopen@PLT
	leaq	.LC2(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	movq	%rax, %r14
	call	fopen@PLT
	movq	%r13, %rsi
	leaq	.LC4(%rip), %rdi
	movq	%rbp, %r13
	movq	%rax, (%rsp)
	call	fopen@PLT
	movq	%rax, 8(%rsp)
.L13:
	movq	%r13, %rdx
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	addq	$4, %r13
	cmpq	%r12, %r13
	jne	.L13
	movq	%r14, %rdi
	call	fclose@PLT
	leaq	16(%rsp), %rdi
	movl	$4800, %esi
	call	cudaMalloc@PLT
	leaq	24(%rsp), %rdi
	movl	$4800, %esi
	call	cudaMalloc@PLT
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbp, %rsi
	movl	$4800, %edx
	call	cudaMemcpy@PLT
	call	clock@PLT
	movl	40(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	32(%rsp), %rdx
	movl	$1, %esi
	movq	%rax, %r14
	movabsq	$4294967299, %rdi
	movq	%rdi, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L14
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	call	_Z32__device_stub__Z10msfunctionPfS_PfS_
.L14:
	call	cudaThreadSynchronize@PLT
	xorl	%r12d, %r12d
	call	clock@PLT
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	subq	%r14, %rax
	movl	$4800, %edx
	leaq	.LC8(%rip), %r14
	cvtsi2ssq	%rax, %xmm0
	mulss	.LC6(%rip), %xmm0
	divss	.LC7(%rip), %xmm0
	movd	%xmm0, %r13d
	call	cudaMemcpy@PLT
.L15:
	movq	(%rsp), %rdi
	movq	%r14, %rdx
	movl	$2, %esi
	movb	$1, %al
	cvtss2sd	(%rbx,%r12), %xmm0
	call	__fprintf_chk@PLT
	movq	(%rsp), %rdi
	movl	$2, %esi
	movb	$1, %al
	cvtss2sd	4(%rbx,%r12), %xmm0
	leaq	.LC9(%rip), %rdx
	addq	$8, %r12
	call	__fprintf_chk@PLT
	cmpq	$4800, %r12
	jne	.L15
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
.L18:
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
	leaq	44(%rsp), %rdx
	movq	%r15, %rsi
	call	__isoc23_fscanf@PLT
	movss	44(%rsp), %xmm0
	subss	(%rbx,%r12,4), %xmm0
	andps	.LC10(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	comisd	.LC11(%rip), %xmm0
	jbe	.L16
	incl	%r14d
.L16:
	incq	%r12
	cmpq	$1200, %r12
	jne	.L18
	movd	%r13d, %xmm1
	leaq	.LC12(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	%xmm1, %xmm0
	call	__printf_chk@PLT
	movl	%r14d, %edx
	movb	$1, %al
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	cvtsi2ssl	%r14d, %xmm0
	mulss	.LC13(%rip), %xmm0
	divss	.LC14(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	movq	(%rsp), %rdi
	call	fclose@PLT
	movq	8(%rsp), %rdi
	call	fclose@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	main, .-main
	.section	.rodata.str1.1
.LC16:
	.string	"_Z10msfunctionPfS_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2057:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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	.LC16(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z10msfunctionPfS_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	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	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2057:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC6:
	.long	1148846080
	.align 4
.LC7:
	.long	1232348160
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC10:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC11:
	.long	-1717986918
	.long	1069128089
	.section	.rodata.cst4
	.align 4
.LC13:
	.long	1120403456
	.align 4
.LC14:
	.long	1150681088
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#define N 600
#define DIMS 2
#define epsilon 0.1
#define ss 1
#define blocksize 16
#define BLK (blocksize*blocksize)
#define dimGrid (N / BLK + 1)

__device__ float distance(float *a, float *b) {
    int i;
    float d = 0.0, t;
    for(i=0;i<DIMS;i++) {
        t = a[i] - b[i];
        d += t*t;
    }
    return d;
}

__device__ void meanshift(float *x, float *y, float *result) {
    int j, i;
    float sum1[DIMS], sum2 = 0.0, dis, k;
    for (i=0;i<DIMS;i++) sum1[i] = 0.0;
    for(j=0;j<N;j++) {
        dis = distance(y,x+DIMS*j);
        if (dis > ss*ss) continue;
        k = exp( - dis / (2*ss) );
        sum2 += k;
        for(i=0;i<DIMS;i++) sum1[i] += k * x[DIMS*j+i];
    }
    for(i=0;i<DIMS;i++) result[i] = sum1[i] / sum2;
}

__global__ void msfunction(float *x, float *y) {
    __shared__ float ys[BLK*DIMS], temp[BLK*DIMS], m[BLK];
    int h, j = threadIdx.x * blockDim.x  + threadIdx.y;
    int i = blockIdx.x * BLK + j;
    if (i < N) {
        memcpy(ys+DIMS*j, x+DIMS*i, DIMS*sizeof(float));
        do {
            meanshift(x, ys+DIMS*j, temp+DIMS*j);
            m[j] = sqrt(distance(temp+DIMS*j, ys+DIMS*j));
            memcpy(ys+DIMS*j, temp+DIMS*j, DIMS*sizeof(float));
        } while (m[j]>epsilon);
        for(h=0;h<DIMS;h++)
            y[DIMS*i+h] = ys[DIMS*j+h];
    }
}

int main() {
    dim3 dimBlock( blocksize, blocksize );
    int i, j, errors = 0;
    float *x, *y, *xd, *yd, msecs, temp;
    clock_t start, end;
    x = (float *)malloc(DIMS*N*sizeof(float));
    y = (float *)malloc(DIMS*N*sizeof(float));
    FILE *data = fopen("data.txt", "r"), *output = fopen("meanshift.txt", "w"), *check = fopen("results.txt", "r");
    for (i=0;i<DIMS*N;i++)
        fscanf(data, "%f", &x[i]);
    fclose(data);
    hipMalloc(&xd, N*DIMS*sizeof(float));
    hipMalloc(&yd, N*DIMS*sizeof(float));
    hipMemcpy(xd, x, N*DIMS*sizeof(float),hipMemcpyHostToDevice);
    start = clock();
    msfunction<<<dimGrid,dimBlock>>>(xd, yd);
    hipDeviceSynchronize();
    end = clock();
    msecs = (float)1000*(end - start) / CLOCKS_PER_SEC;
    hipMemcpy(y, yd, N*DIMS*sizeof(float),hipMemcpyDeviceToHost);
    for (i=0;i<N;i++)
        for (j=0;j<DIMS;j++) {
            if (j==DIMS-1) fprintf(output, "%f\n", y[DIMS*i+j]);
            else fprintf(output, "%f ", y[DIMS*i+j]);
        }
    for (i=0;i<N*DIMS;i++) {
        fscanf(check, "%f", &temp);
        if ( fabs( temp - y[i] ) > 0.1) errors++;
    }
    printf("Time is %f msecs\n", msecs);
    printf("detected %d errors, %.2f %% of the total values\n", errors, (float)100*errors/(N*DIMS));
    fclose(output);
    fclose(check);
    hipFree(xd);
    hipFree(yd);
    free(x);
    free(y);
}
	.text
	.file	"mshift_sharing.hip"
	.globl	_Z25__device_stub__msfunctionPfS_ # -- Begin function _Z25__device_stub__msfunctionPfS_
	.type	_Z25__device_stub__msfunctionPfS_,@function
_Z25__device_stub__msfunctionPfS_:      # @_Z25__device_stub__msfunctionPfS_
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%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	$_Z10msfunctionPfS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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	_Z25__device_stub__msfunctionPfS_, .Lfunc_end0-_Z25__device_stub__msfunctionPfS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI1_0:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI1_1:
	.quad	0x3fb999999999999a              # double 0.10000000000000001
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI1_2:
	.long	0x447a0000                      # float 1000
.LCPI1_3:
	.long	0x49742400                      # float 1.0E+6
.LCPI1_4:
	.long	0x42c80000                      # float 100
.LCPI1_5:
	.long	0x44960000                      # float 1200
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$4800, %edi                     # imm = 0x12C0
	callq	malloc
	movq	%rax, %rbp
	movl	$4800, %edi                     # imm = 0x12C0
	callq	malloc
	movq	%rax, %r14
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	movq	%rax, %r13
	movl	$.L.str.2, %edi
	movl	$.L.str.3, %esi
	callq	fopen
	movq	%rax, %r15
	movl	$.L.str.4, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	movq	%rax, %r12
	xorl	%ebx, %ebx
.LBB1_1:                                # =>This Inner Loop Header: Depth=1
	leaq	(%rbx,%rbp), %rdx
	movl	$.L.str.5, %esi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	addq	$4, %rbx
	cmpq	$4800, %rbx                     # imm = 0x12C0
	jne	.LBB1_1
# %bb.2:
	movq	%r13, %rdi
	callq	fclose
	leaq	24(%rsp), %r13
	movl	$4800, %esi                     # imm = 0x12C0
	movq	%r13, %rdi
	callq	hipMalloc
	leaq	8(%rsp), %rdi
	movl	$4800, %esi                     # imm = 0x12C0
	callq	hipMalloc
	movq	(%r13), %rdi
	movl	$4800, %edx                     # imm = 0x12C0
	movq	%rbp, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	callq	clock
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movabsq	$4294967299, %rdi               # imm = 0x100000003
	movabsq	$68719476752, %rdx              # imm = 0x1000000010
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_4
# %bb.3:
	movq	24(%rsp), %rdi
	movq	8(%rsp), %rsi
	callq	_Z25__device_stub__msfunctionPfS_
.LBB1_4:
	movq	%rbp, 48(%rsp)                  # 8-byte Spill
	callq	hipDeviceSynchronize
	callq	clock
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movq	8(%rsp), %rsi
	movl	$4800, %edx                     # imm = 0x12C0
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	xorl	%ebx, %ebx
.LBB1_5:                                # %.preheader44
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%rbx,8), %xmm0
	movl	$.L.str.7, %esi
	movq	%r15, %rdi
	movb	$1, %al
	callq	fprintf
	xorps	%xmm0, %xmm0
	cvtss2sd	4(%r14,%rbx,8), %xmm0
	movl	$.L.str.6, %esi
	movq	%r15, %rdi
	movb	$1, %al
	callq	fprintf
	incq	%rbx
	cmpq	$600, %rbx                      # imm = 0x258
	jne	.LBB1_5
# %bb.6:                                # %.preheader.preheader
	leaq	20(%rsp), %rbp
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
.LBB1_7:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movl	$.L.str.5, %esi
	movq	%r12, %rdi
	movq	%rbp, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movss	20(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	subss	(%r14,%rbx,4), %xmm0
	andps	.LCPI1_0(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	xorl	%eax, %eax
	ucomisd	.LCPI1_1(%rip), %xmm0
	seta	%al
	addl	%eax, %r13d
	incq	%rbx
	cmpq	$1200, %rbx                     # imm = 0x4B0
	jne	.LBB1_7
# %bb.8:
	movq	32(%rsp), %rax                  # 8-byte Reload
	subq	40(%rsp), %rax                  # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	mulss	.LCPI1_2(%rip), %xmm0
	divss	.LCPI1_3(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.8, %edi
	movb	$1, %al
	callq	printf
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r13d, %xmm0
	mulss	.LCPI1_4(%rip), %xmm0
	divss	.LCPI1_5(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.9, %edi
	movl	%r13d, %esi
	movb	$1, %al
	callq	printf
	movq	%r15, %rdi
	callq	fclose
	movq	%r12, %rdi
	callq	fclose
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	48(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	%r14, %rdi
	callq	free
	xorl	%eax, %eax
	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_end1:
	.size	main, .Lfunc_end1-main
	.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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB2_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB2_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z10msfunctionPfS_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end2:
	.size	__hip_module_ctor, .Lfunc_end2-__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	.LBB3_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
.LBB3_2:
	retq
.Lfunc_end3:
	.size	__hip_module_dtor, .Lfunc_end3-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z10msfunctionPfS_,@object      # @_Z10msfunctionPfS_
	.section	.rodata,"a",@progbits
	.globl	_Z10msfunctionPfS_
	.p2align	3, 0x0
_Z10msfunctionPfS_:
	.quad	_Z25__device_stub__msfunctionPfS_
	.size	_Z10msfunctionPfS_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"data.txt"
	.size	.L.str, 9

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"meanshift.txt"
	.size	.L.str.2, 14

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"results.txt"
	.size	.L.str.4, 12

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

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

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

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Time is %f msecs\n"
	.size	.L.str.8, 18

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"detected %d errors, %.2f %% of the total values\n"
	.size	.L.str.9, 49

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z10msfunctionPfS_"
	.size	.L__unnamed_1, 19

	.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 _Z25__device_stub__msfunctionPfS_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z10msfunctionPfS_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z10msfunctionPfS_      ; -- Begin function _Z10msfunctionPfS_
	.globl	_Z10msfunctionPfS_
	.p2align	8
	.type	_Z10msfunctionPfS_,@function
_Z10msfunctionPfS_:                     ; @_Z10msfunctionPfS_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x1c
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v0, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u32_u24 v2, v1, s2, v0
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshl_add_u32 v0, s15, 8, v2
	v_cmpx_gt_i32_e32 0x258, v0
	s_cbranch_execz .LBB0_8
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_lshlrev_b32_e32 v0, 1, v0
	s_mov_b32 s2, 0x9999999a
	s_mov_b32 s3, 0x3fb99999
	s_mov_b32 s10, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v3, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v4, vcc_lo, s5, v1, vcc_lo
	global_load_b64 v[5:6], v[3:4], off
	v_lshlrev_b32_e32 v4, 3, v2
	s_waitcnt vmcnt(0)
	ds_store_b64 v4, v[5:6]
.LBB0_2:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	ds_load_b64 v[2:3], v4
	v_dual_mov_b32 v5, 0 :: v_dual_mov_b32 v6, 0
	v_mov_b32_e32 v7, 0
	s_mov_b64 s[0:1], 0
.LBB0_3:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s8, s4, s0
	s_addc_u32 s9, s5, s1
	s_mov_b32 s11, exec_lo
	s_load_b64 s[8:9], s[8:9], 0x0
	s_waitcnt lgkmcnt(0)
	v_dual_subrev_f32 v8, s9, v3 :: v_dual_subrev_f32 v9, s8, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v8, v8, v8
	v_fmac_f32_e32 v8, v9, v9
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_nlt_f32_e32 1.0, v8
	s_cbranch_execz .LBB0_5
; %bb.4:                                ; %.loopexit.loopexit.i
                                        ;   in Loop: Header=BB0_3 Depth=2
	v_mul_f32_e32 v8, -0.5, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v9, 0x3fb8aa3b, v8
	v_fma_f32 v10, 0x3fb8aa3b, v8, -v9
	v_rndne_f32_e32 v11, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_sub_f32_e32 v9, v9, v11
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v8
	v_fmac_f32_e32 v10, 0x32a5705f, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f32_e32 v9, v9, v10
	v_cvt_i32_f32_e32 v10, v11
	v_exp_f32_e32 v9, v9
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v9, v9, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v9, 0, v9, vcc_lo
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v8
	v_cndmask_b32_e32 v8, 0x7f800000, v9, vcc_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_fmac_f32_e32 v6, s8, v8
	v_add_f32_e32 v5, v5, v8
	v_fmac_f32_e32 v7, s9, v8
.LBB0_5:                                ; %.loopexit.i
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s11
	s_add_u32 s0, s0, 8
	s_addc_u32 s1, s1, 0
	s_cmpk_lg_i32 s0, 0x12c0
	s_cbranch_scc1 .LBB0_3
; %bb.6:                                ; %.preheader.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_div_scale_f32 v8, null, v5, v5, v6
	v_div_scale_f32 v9, null, v5, v5, v7
	v_div_scale_f32 v14, vcc_lo, v6, v5, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v10, v8
	v_rcp_f32_e32 v11, v9
	s_waitcnt_depctr 0xfff
	v_fma_f32 v12, -v8, v10, 1.0
	v_fma_f32 v13, -v9, v11, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v10, v12, v10 :: v_dual_fmac_f32 v11, v13, v11
	v_div_scale_f32 v12, s0, v7, v5, v7
	v_mul_f32_e32 v13, v14, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v16, -v8, v13, v14
	v_fmac_f32_e32 v13, v16, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v8, -v8, v13, v14
	v_div_fmas_f32 v8, v8, v10, v13
	s_mov_b32 vcc_lo, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f32 v6, v8, v5, v6
	v_dual_mul_f32 v15, v12, v11 :: v_dual_sub_f32 v2, v6, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v17, -v9, v15, v12
	v_fmac_f32_e32 v15, v17, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v9, -v9, v15, v12
	v_div_fmas_f32 v9, v9, v11, v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f32 v7, v9, v5, v7
	v_sub_f32_e32 v3, v7, v3
	ds_store_b64 v4, v[6:7]
	v_mul_f32_e32 v3, v3, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v3, v2, v2
	v_mul_f32_e32 v2, 0x4f800000, v3
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v2, v3, v2, vcc_lo
	v_sqrt_f32_e32 v3, v2
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v5, -1, v3
	v_add_nc_u32_e32 v8, 1, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v9, -v5, v3, v2
	v_fma_f32 v10, -v8, v3, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s0, 0, v9
	v_cndmask_b32_e64 v3, v3, v5, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s0, 0, v10
	v_cndmask_b32_e64 v3, v3, v8, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v5, 0x37800000, v3
	v_cndmask_b32_e32 v3, v3, v5, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v2, 0x260
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v2, v3, v2, vcc_lo
	v_cvt_f64_f32_e32 v[2:3], v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cmp_nlt_f64_e32 vcc_lo, s[2:3], v[2:3]
	s_or_b32 s10, vcc_lo, s10
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s10
	s_cbranch_execnz .LBB0_2
; %bb.7:                                ; %.preheader
	s_or_b32 exec_lo, exec_lo, s10
	ds_load_b64 v[2:3], v4
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	s_waitcnt lgkmcnt(0)
	global_store_b64 v[0:1], v[2:3], off
.LBB0_8:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z10msfunctionPfS_
		.amdhsa_group_segment_fixed_size 2048
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.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 1
		.amdhsa_next_free_vgpr 18
		.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	_Z10msfunctionPfS_, .Lfunc_end0-_Z10msfunctionPfS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 820
; NumSgprs: 18
; NumVgprs: 18
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 2048 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 18
; 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: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 2048
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z10msfunctionPfS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z10msfunctionPfS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     18
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
