#include <cstdio>
#include <cstdlib>
#include <time.h>
#define CUDA_SAFE_CALL(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(cudaError_t code, char *file, int line, bool abort=true)
{
	if (code != cudaSuccess) 
	{
		fprintf(stderr,"CUDA_SAFE_CALL: %s %s %d\n", cudaGetErrorString(code), file, line);
		if (abort) exit(code);
	}
}

#define THREADS_PER_BLOCK 1
#define NUM_BLOCKS        5
#define ARR_LEN 5 //matrix size

#define ITERS 1
#define PRINT_TIME 1

//typedef float float;

/************************************/
/* SOR */
__global__ void MMM_global( int* A, int a, int b )
{
  long int i = blockDim.x * blockIdx.x + threadIdx.x;
  i += blockDim.y * blockIdx.y + threadIdx.y;
  int len = ARR_LEN;
  
  if( i < len )
	{
		*(A+ a*len + i ) = (  *(A+ a*len + i)  )  |  (  *(A+ b*len + i )  );
		//then reflect
	  *(A + i*len + a ) = *(A + a*len + i );
	}
  
}


//----------------------------------------------------------------------------
int main( int argc, char **argv )
{
	srand( time( NULL ));
  size_t mem_size = sizeof( int ) * ARR_LEN * ARR_LEN;

  //Randomizing matrix function
  void initRandArray( int* array, int length );
  void PrintMat( int*, int );
  
  //GPU dimensions
  dim3 dimGrid( NUM_BLOCKS, NUM_BLOCKS );
  dim3 dimBlock( THREADS_PER_BLOCK, THREADS_PER_BLOCK, 1 );
  
	// GPU Timing variables
	cudaEvent_t start, stop;
	float elapsed_gpu;
	
	//host array
	int* h_a;
	int* h_result;
	//allocate
	h_a      = (int*) malloc( mem_size );
	h_result = (int*) malloc( mem_size );
	
	//gpu arrays
	int* d_a;
  CUDA_SAFE_CALL(cudaMalloc((void **)&d_a, mem_size ));
	CUDA_SAFE_CALL(cudaSetDevice(0)); //set to correct device
//------------
//MMM test
//------------
  int i;
  int a = 0;
  int b = 1;
  printf("OR test\n----------\n");
  for( i = 0; i < ITERS; i++ )
  {
    
    //initialize host array
    initRandArray( h_a, (int)ARR_LEN );
    printf("Initial Array\n");
    PrintMat( h_a, ARR_LEN );
	  #if PRINT_TIME
	  // Create the cuda events
	    cudaEventCreate(&start);
	    cudaEventCreate(&stop);
	  // Record event on the default stream
	    cudaEventRecord(start, 0);
    #endif
    
    // Transfer the arrays to the GPU memory
	  CUDA_SAFE_CALL(cudaMemcpy(d_a, h_a, mem_size, cudaMemcpyHostToDevice));
	   
	  // Launch the kernel
	  MMM_global<<< dimGrid, dimBlock >>>(  d_a, a, b );
	
	  // Transfer the results back to the host
	  CUDA_SAFE_CALL(cudaMemcpy(h_result, d_a, mem_size, cudaMemcpyDeviceToHost));
	  
	  printf("GPU result\n");
	  PrintMat( h_result, ARR_LEN );
    
    #if PRINT_TIME
	  // Stop and destroy the timer
	    cudaEventRecord(stop,0);
	    cudaEventSynchronize(stop);
	    cudaEventElapsedTime(&elapsed_gpu, start, stop);
	    printf("time: %f (msec)\n", elapsed_gpu);
	    cudaEventDestroy(start);
	    cudaEventDestroy(stop);
    #endif
  }
  
	return 0;
}

//----------------------------------------------------------------------------
//intialize an array to random values	
void initRandArray ( int *arr, int len) {
	int i;
	int j;

	for (i = 0; i < len; i++)
	{
	  for( j = 0; j < len; j++ )
	  {
		  arr[i*len + j] = rand()&1;
		}
	}
}

void PrintMat( int* A, int V )
{
	int i,j;
	for( i = 0; i < V; i++ )
	{
		for( j = 0; j < V; j++ )
		{
			printf("%i ", *( A + i*V + j ) );
		}
		printf( "\n" );
	}
	return;
}


	.file	"tmpxft_002ebb4f_00000000-6_or.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2033:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2033:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata._Z9gpuAssert9cudaErrorPcib.str1.1,"aMS",@progbits,1
.LC0:
	.string	"CUDA_SAFE_CALL: %s %s %d\n"
	.section	.text._Z9gpuAssert9cudaErrorPcib,"axG",@progbits,_Z9gpuAssert9cudaErrorPcib,comdat
	.weak	_Z9gpuAssert9cudaErrorPcib
	.type	_Z9gpuAssert9cudaErrorPcib, @function
_Z9gpuAssert9cudaErrorPcib:
.LFB2027:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L8
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%ecx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%edx, 12(%rsp)
	movq	%rsi, (%rsp)
	call	cudaGetErrorString@PLT
	movl	12(%rsp), %r9d
	movq	(%rsp), %r8
	leaq	.LC0(%rip), %rdx
	movq	stderr(%rip), %rdi
	movq	%rax, %rcx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	testb	%bpl, %bpl
	je	.L2
	movl	%ebx, %edi
	call	exit@PLT
.L2:
	addq	$24, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z9gpuAssert9cudaErrorPcib, .-_Z9gpuAssert9cudaErrorPcib
	.text
	.globl	_Z13initRandArrayPii
	.type	_Z13initRandArrayPii, @function
_Z13initRandArrayPii:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movslq	%esi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r13, %rbp
	salq	$2, %r13
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
.L13:
	cmpl	%ebp, %r12d
	jge	.L18
	leaq	(%rbx,%r13), %r14
.L14:
	call	rand@PLT
	addq	$4, %rbx
	andl	$1, %eax
	movl	%eax, -4(%rbx)
	cmpq	%r14, %rbx
	jne	.L14
	incl	%r12d
	jmp	.L13
.L18:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z13initRandArrayPii, .-_Z13initRandArrayPii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%i "
.LC2:
	.string	"\n"
	.text
	.globl	_Z8PrintMatPii
	.type	_Z8PrintMatPii, @function
_Z8PrintMatPii:
.LFB2030:
	.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
	movslq	%esi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r14, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L20:
	cmpl	%ebx, %r13d
	jge	.L25
	leaq	(%r12,%rbp,4), %rcx
	addq	%r14, %rbp
	leaq	(%r12,%rbp,4), %r15
.L21:
	movl	(%rcx), %edx
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	movq	%rcx, 8(%rsp)
	call	__printf_chk@PLT
	movq	8(%rsp), %rcx
	addq	$4, %rcx
	cmpq	%r15, %rcx
	jne	.L21
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incl	%r13d
	call	__printf_chk@PLT
	jmp	.L20
.L25:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z8PrintMatPii, .-_Z8PrintMatPii
	.globl	_Z32__device_stub__Z10MMM_globalPiiiPiii
	.type	_Z32__device_stub__Z10MMM_globalPiiiPiii, @function
_Z32__device_stub__Z10MMM_globalPiiiPiii:
.LFB2055:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	32(%rsp), %rdi
	movl	%esi, 4(%rsp)
	leaq	44(%rsp), %rsi
	movl	%edx, (%rsp)
	leaq	16(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	pushq	24(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z10MMM_globalPiii(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 144
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L26:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2055:
	.size	_Z32__device_stub__Z10MMM_globalPiiiPiii, .-_Z32__device_stub__Z10MMM_globalPiiiPiii
	.globl	_Z10MMM_globalPiii
	.type	_Z10MMM_globalPiii, @function
_Z10MMM_globalPiii:
.LFB2056:
	.cfi_startproc
	endbr64
	jmp	_Z32__device_stub__Z10MMM_globalPiiiPiii
	.cfi_endproc
.LFE2056:
	.size	_Z10MMM_globalPiii, .-_Z10MMM_globalPiii
	.section	.rodata.str1.1
.LC3:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/andronovd/527Project/master/or.cu"
.LC4:
	.string	"OR test\n----------\n"
.LC5:
	.string	"Initial Array\n"
.LC6:
	.string	"GPU result\n"
.LC7:
	.string	"time: %f (msec)\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%edi, %edi
	leaq	.LC3(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	movl	$100, %edi
	movabsq	$21474836485, %rax
	movl	$1, 40(%rsp)
	movq	%rax, 32(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	malloc@PLT
	movl	$100, %edi
	movq	%rax, %rbx
	call	malloc@PLT
	leaq	24(%rsp), %rdi
	movl	$100, %esi
	movq	%rax, %rbp
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$68, %edx
	movq	%r12, %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPcib
	xorl	%edi, %edi
	call	cudaSetDevice@PLT
	movl	$1, %ecx
	movl	$69, %edx
	movq	%r12, %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPcib
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$5, %esi
	movq	%rbx, %rdi
	call	_Z13initRandArrayPii
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$5, %esi
	movq	%rbx, %rdi
	call	_Z8PrintMatPii
	leaq	8(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	16(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	24(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	movl	$100, %edx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$93, %edx
	movq	%r12, %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	52(%rsp), %ecx
	movl	40(%rsp), %esi
	xorl	%r9d, %r9d
	movq	44(%rsp), %rdx
	movq	32(%rsp), %rdi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L32
	movq	24(%rsp), %rdi
	movl	$1, %edx
	xorl	%esi, %esi
	call	_Z32__device_stub__Z10MMM_globalPiiiPiii
.L32:
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movl	$100, %edx
	movq	%rbp, %rdi
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$99, %edx
	movq	%r12, %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPcib
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$5, %esi
	movq	%rbp, %rdi
	call	_Z8PrintMatPii
	movq	16(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	16(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	16(%rsp), %rdx
	movq	8(%rsp), %rsi
	leaq	4(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	4(%rsp), %xmm0
	call	__printf_chk@PLT
	movq	8(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movq	16(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	addq	$64, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	main, .-main
	.section	.rodata.str1.1
.LC8:
	.string	"_Z10MMM_globalPiii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2058:
	.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	.LC8(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z10MMM_globalPiii(%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
.LFE2058:
	.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 <hip/hip_runtime.h>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#define CUDA_SAFE_CALL(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(hipError_t code, char *file, int line, bool abort=true)
{
	if (code != hipSuccess) 
	{
		fprintf(stderr,"CUDA_SAFE_CALL: %s %s %d\n", hipGetErrorString(code), file, line);
		if (abort) exit(code);
	}
}

#define THREADS_PER_BLOCK 1
#define NUM_BLOCKS        5
#define ARR_LEN 5 //matrix size

#define ITERS 1
#define PRINT_TIME 1

//typedef float float;

/************************************/
/* SOR */
__global__ void MMM_global( int* A, int a, int b )
{
  long int i = blockDim.x * blockIdx.x + threadIdx.x;
  i += blockDim.y * blockIdx.y + threadIdx.y;
  int len = ARR_LEN;
  
  if( i < len )
	{
		*(A+ a*len + i ) = (  *(A+ a*len + i)  )  |  (  *(A+ b*len + i )  );
		//then reflect
	  *(A + i*len + a ) = *(A + a*len + i );
	}
  
}


//----------------------------------------------------------------------------
int main( int argc, char **argv )
{
	srand( time( NULL ));
  size_t mem_size = sizeof( int ) * ARR_LEN * ARR_LEN;

  //Randomizing matrix function
  void initRandArray( int* array, int length );
  void PrintMat( int*, int );
  
  //GPU dimensions
  dim3 dimGrid( NUM_BLOCKS, NUM_BLOCKS );
  dim3 dimBlock( THREADS_PER_BLOCK, THREADS_PER_BLOCK, 1 );
  
	// GPU Timing variables
	hipEvent_t start, stop;
	float elapsed_gpu;
	
	//host array
	int* h_a;
	int* h_result;
	//allocate
	h_a      = (int*) malloc( mem_size );
	h_result = (int*) malloc( mem_size );
	
	//gpu arrays
	int* d_a;
  CUDA_SAFE_CALL(hipMalloc((void **)&d_a, mem_size ));
	CUDA_SAFE_CALL(hipSetDevice(0)); //set to correct device
//------------
//MMM test
//------------
  int i;
  int a = 0;
  int b = 1;
  printf("OR test\n----------\n");
  for( i = 0; i < ITERS; i++ )
  {
    
    //initialize host array
    initRandArray( h_a, (int)ARR_LEN );
    printf("Initial Array\n");
    PrintMat( h_a, ARR_LEN );
	  #if PRINT_TIME
	  // Create the cuda events
	    hipEventCreate(&start);
	    hipEventCreate(&stop);
	  // Record event on the default stream
	    hipEventRecord(start, 0);
    #endif
    
    // Transfer the arrays to the GPU memory
	  CUDA_SAFE_CALL(hipMemcpy(d_a, h_a, mem_size, hipMemcpyHostToDevice));
	   
	  // Launch the kernel
	  MMM_global<<< dimGrid, dimBlock >>>(  d_a, a, b );
	
	  // Transfer the results back to the host
	  CUDA_SAFE_CALL(hipMemcpy(h_result, d_a, mem_size, hipMemcpyDeviceToHost));
	  
	  printf("GPU result\n");
	  PrintMat( h_result, ARR_LEN );
    
    #if PRINT_TIME
	  // Stop and destroy the timer
	    hipEventRecord(stop,0);
	    hipEventSynchronize(stop);
	    hipEventElapsedTime(&elapsed_gpu, start, stop);
	    printf("time: %f (msec)\n", elapsed_gpu);
	    hipEventDestroy(start);
	    hipEventDestroy(stop);
    #endif
  }
  
	return 0;
}

//----------------------------------------------------------------------------
//intialize an array to random values	
void initRandArray ( int *arr, int len) {
	int i;
	int j;

	for (i = 0; i < len; i++)
	{
	  for( j = 0; j < len; j++ )
	  {
		  arr[i*len + j] = rand()&1;
		}
	}
}

void PrintMat( int* A, int V )
{
	int i,j;
	for( i = 0; i < V; i++ )
	{
		for( j = 0; j < V; j++ )
		{
			printf("%i ", *( A + i*V + j ) );
		}
		printf( "\n" );
	}
	return;
}


	.text
	.file	"or.hip"
	.globl	_Z25__device_stub__MMM_globalPiii # -- Begin function _Z25__device_stub__MMM_globalPiii
	.type	_Z25__device_stub__MMM_globalPiii,@function
_Z25__device_stub__MMM_globalPiii:      # @_Z25__device_stub__MMM_globalPiii
	.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	$96, %rsp
	.cfi_def_cfa_offset 144
	.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	4(%rsp), %rcx
	movl	%esi, (%rcx)
	movq	%rsp, %rsi
	movl	%edx, (%rsi)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%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	$_Z10MMM_globalPiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$112, %rsp
	.cfi_adjust_cfa_offset -112
	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__MMM_globalPiii, .Lfunc_end0-_Z25__device_stub__MMM_globalPiii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:                                # %.critedge
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	movl	$100, %edi
	callq	malloc
	movq	%rax, %r14
	movl	$100, %edi
	callq	malloc
	movq	%rax, %rbx
	leaq	16(%rsp), %rdi
	movl	$100, %esi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB1_1
# %bb.3:                                # %_Z9gpuAssert10hipError_tPcib.exit
	xorl	%edi, %edi
	callq	hipSetDevice
	testl	%eax, %eax
	jne	.LBB1_4
# %bb.5:                                # %_Z9gpuAssert10hipError_tPcib.exit22
	movl	$.Lstr, %edi
	callq	puts@PLT
	xorl	%r15d, %r15d
	movq	%r14, %r12
.LBB1_6:                                # %.lr.ph.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_7 Depth 2
	xorl	%r13d, %r13d
.LBB1_7:                                #   Parent Loop BB1_6 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	andl	$1, %eax
	movl	%eax, (%r12,%r13,4)
	incq	%r13
	cmpq	$5, %r13
	jne	.LBB1_7
# %bb.8:                                # %._crit_edge.i
                                        #   in Loop: Header=BB1_6 Depth=1
	incq	%r15
	addq	$20, %r12
	cmpq	$5, %r15
	jne	.LBB1_6
# %bb.9:                                # %_Z13initRandArrayPii.exit
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movq	%r14, %rdi
	movl	$5, %esi
	callq	_Z8PrintMatPii
	leaq	24(%rsp), %r15
	movq	%r15, %rdi
	callq	hipEventCreate
	leaq	8(%rsp), %rdi
	callq	hipEventCreate
	movq	(%r15), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	16(%rsp), %rdi
	movl	$100, %edx
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB1_10
# %bb.11:                               # %_Z9gpuAssert10hipError_tPcib.exit24
	movabsq	$21474836485, %rdi              # imm = 0x500000005
	movabsq	$4294967297, %rdx               # imm = 0x100000001
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_13
# %bb.12:
	movq	16(%rsp), %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_Z25__device_stub__MMM_globalPiii
.LBB1_13:
	movq	16(%rsp), %rsi
	movl	$100, %edx
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB1_14
# %bb.15:                               # %_Z9gpuAssert10hipError_tPcib.exit26
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movq	%rbx, %rdi
	movl	$5, %esi
	callq	_Z8PrintMatPii
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	movq	24(%rsp), %rsi
	movq	8(%rsp), %rdx
	leaq	36(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	cvtss2sd	(%rbx), %xmm0
	movl	$.L.str.4, %edi
	movb	$1, %al
	callq	printf
	movq	24(%rsp), %rdi
	callq	hipEventDestroy
	movq	8(%rsp), %rdi
	callq	hipEventDestroy
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_1:
	.cfi_def_cfa_offset 96
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$70, %r8d
	jmp	.LBB1_2
.LBB1_4:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$71, %r8d
	jmp	.LBB1_2
.LBB1_10:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$95, %r8d
	jmp	.LBB1_2
.LBB1_14:
	movl	%eax, %ebp
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$101, %r8d
.LBB1_2:
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebp, %edi
	callq	exit
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
                                        # -- End function
	.globl	_Z13initRandArrayPii            # -- Begin function _Z13initRandArrayPii
	.type	_Z13initRandArrayPii,@function
_Z13initRandArrayPii:                   # @_Z13initRandArrayPii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, (%rsp)                    # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB2_5
# %bb.1:                                # %.preheader.lr.ph
	movl	%esi, %ebx
	movl	%esi, %r15d
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
.LBB2_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_3 Depth 2
	movl	%r12d, %eax
	movq	(%rsp), %rcx                    # 8-byte Reload
	leaq	(%rcx,%rax,4), %rbp
	xorl	%r14d, %r14d
.LBB2_3:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	andl	$1, %eax
	movl	%eax, (%rbp,%r14,4)
	incq	%r14
	cmpq	%r14, %r15
	jne	.LBB2_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	incq	%r13
	addl	%ebx, %r12d
	cmpq	%r15, %r13
	jne	.LBB2_2
.LBB2_5:                                # %._crit_edge13
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z13initRandArrayPii, .Lfunc_end2-_Z13initRandArrayPii
	.cfi_endproc
                                        # -- End function
	.globl	_Z8PrintMatPii                  # -- Begin function _Z8PrintMatPii
	.type	_Z8PrintMatPii,@function
_Z8PrintMatPii:                         # @_Z8PrintMatPii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB3_6
# %bb.1:                                # %.preheader.lr.ph
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	leaq	(,%r14,4), %r15
	xorl	%r12d, %r12d
.LBB3_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_3 Depth 2
	xorl	%r13d, %r13d
.LBB3_3:                                #   Parent Loop BB3_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%r13,4), %esi
	movl	$.L.str.5, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r13
	cmpq	%r13, %r14
	jne	.LBB3_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%r12
	addq	%r15, %rbx
	cmpq	%r14, %r12
	jne	.LBB3_2
# %bb.5:
	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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
.LBB3_6:                                # %._crit_edge13
	retq
.Lfunc_end3:
	.size	_Z8PrintMatPii, .Lfunc_end3-_Z8PrintMatPii
	.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	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z10MMM_globalPiii, %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_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	_Z10MMM_globalPiii,@object      # @_Z10MMM_globalPiii
	.section	.rodata,"a",@progbits
	.globl	_Z10MMM_globalPiii
	.p2align	3, 0x0
_Z10MMM_globalPiii:
	.quad	_Z25__device_stub__MMM_globalPiii
	.size	_Z10MMM_globalPiii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/andronovd/527Project/master/or.hip"
	.size	.L.str, 97

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"time: %f (msec)\n"
	.size	.L.str.4, 17

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%i "
	.size	.L.str.5, 4

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"CUDA_SAFE_CALL: %s %s %d\n"
	.size	.L.str.7, 26

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z10MMM_globalPiii"
	.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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"OR test\n----------"
	.size	.Lstr, 19

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Initial Array"
	.size	.Lstr.1, 14

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"GPU result"
	.size	.Lstr.2, 11

	.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__MMM_globalPiii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z10MMM_globalPiii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z10MMM_globalPiii      ; -- Begin function _Z10MMM_globalPiii
	.globl	_Z10MMM_globalPiii
	.p2align	8
	.type	_Z10MMM_globalPiii,@function
_Z10MMM_globalPiii:                     ; @_Z10MMM_globalPiii
; %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_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s14, s2, v[1:2]
	v_mad_u64_u32 v[3:4], null, s15, s3, v[0:1]
	v_add_co_u32 v0, s2, v3, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v1, null, 0, 0, s2
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_u64_e32 5, v[0:1]
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x0
	v_lshlrev_b64 v[2:3], 2, v[0:1]
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s4, s2, 5
	s_mul_i32 s6, s3, 5
	s_ashr_i32 s5, s4, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[4:5], s[4:5], 2
	s_add_u32 s3, s0, s4
	s_addc_u32 s8, s1, s5
	s_ashr_i32 s7, s6, 31
	v_add_co_u32 v4, vcc_lo, s3, v2
	s_lshl_b64 s[4:5], s[6:7], 2
	v_add_co_ci_u32_e32 v5, vcc_lo, s8, v3, vcc_lo
	s_add_u32 s3, s0, s4
	s_addc_u32 s4, s1, s5
	v_add_co_u32 v2, vcc_lo, s3, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s4, v3, vcc_lo
	s_clause 0x1
	global_load_b32 v6, v[4:5], off
	global_load_b32 v7, v[2:3], off
	s_ashr_i32 s3, s2, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[2:3], s[2:3], 2
	s_add_u32 s0, s2, s0
	s_addc_u32 s1, s3, s1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, v0, 20, s[0:1]
	v_mad_u32_u24 v3, v1, 20, v3
	s_waitcnt vmcnt(0)
	v_or_b32_e32 v0, v7, v6
	s_clause 0x1
	global_store_b32 v[4:5], v0, off
	global_store_b32 v[2:3], v0, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z10MMM_globalPiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.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 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	_Z10MMM_globalPiii, .Lfunc_end0-_Z10MMM_globalPiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 280
; 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: 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:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .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: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z10MMM_globalPiii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z10MMM_globalPiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
