#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
#include<iostream>

using namespace std;

__global__ void multiply(int *a, int *b, int *c, int m, int n, int q)
{
int id_x = threadIdx.x;
int id_y = threadIdx.y;

int i,d=0;
for(i=0;i<n;i++)
  {
  d = d + (a[(id_y * n) + i] * b[(i * q) + id_x]);
  }
  c[(id_y * q) + id_x] = d;
}

int main()
{
int i;
int m,n,x,y;

cout<<"Enter the size of first matrix:\n";
cin>>m>>n;
cout<<"Enter the size of second matrix:\n";
cin>>x>>y;

if(n != x)
  {
  cout<<"matrix size is not valid for multiplication";
  cin>>i;
  return 0;
  }

int size_a = m*n;
int size_b = x*y;
int size_c = m*y;

int *h_a=new int[size_a];
int *h_b=new int[size_b];
int *h_c=new int[size_c];

cout<<"Enter the first matrix\n";

for(i=0;i<size_a;i++)
  {
  cin>>h_a[i];
  }

cout<<"Enter the second array:\n";
for(i=0;i<size_b;i++)
  {
  cin>>h_b[i];
  }

int*d_a,*d_b,*d_c;

if(cudaMalloc(&d_a, sizeof(int)*size_a) != cudaSuccess)
  {
  cout<<"Memory allocation failed\n";
  cin>>i;
  return 0;
  }

if(cudaMalloc(&d_b, sizeof(int)*size_b) != cudaSuccess)
  {
  cout<<"Memory allocation failed\n";
  cudaFree(d_a);
  cin>>i;
  return 0;
  }

if(cudaMalloc(&d_c, sizeof(int)*size_c) != cudaSuccess)
  {
  cout<<"Memory allocation failed\n";
  cudaFree(d_a);
  cudaFree(d_b);
  cin>>i;
  return 0;
  }

if(cudaMemcpy(d_a, h_a, sizeof(int)*size_a, cudaMemcpyHostToDevice) != cudaSuccess)
  {
  cout<<"Failed to copy data from host to device";
  cudaFree(d_a);
  cudaFree(d_b);
  cudaFree(d_c);
  cin>>i;
  return 0;
  }

if(cudaMemcpy(d_b, h_b, sizeof(int)*size_b, cudaMemcpyHostToDevice) != cudaSuccess)
  {
  cout<<"Failed to copy data from host to device";
  cudaFree(d_a);
  cudaFree(d_b);
  cudaFree(d_c);
  cin>>i;
  return 0;
  }

dim3 block(1,1,1);
dim3 thread(y,m,1);

multiply<<<block, thread>>>(d_a, d_b, d_c, m, n, y);

if(cudaMemcpy(h_c, d_c, size_c * sizeof(int), cudaMemcpyDeviceToHost) != cudaSuccess)
  {
  cout<<"Failed to copy data from device to host";
  delete[] h_a;
  delete[] h_b;
  cudaFree(d_a);
  cudaFree(d_b);
  cin>>i;
  return 0;
  }

cout<<"Multiplied Matrix is:\n";
for(i=0;i<size_c;i++)
{
  cout<<h_c[i]<<"  ";
  if((i+1)%y == 0) cout<<endl;
}

delete[] h_a;
delete[] h_b;
delete[] h_c;
cudaFree(d_a);
cudaFree(d_b);
cudaFree(d_c);

cin>>i;
return 0;

}
	.file	"tmpxft_00339acb_00000000-6_matrix_multiplication.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3638:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3638:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0, @function
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0:
.LFB4293:
	.cfi_startproc
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	testq	%rsi, %rsi
	jne	.L3
	movq	(%rdi), %rax
	movl	$1, %esi
	addq	-24(%rax), %rbx
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZNSt9basic_iosIcSt11char_traitsIcEE8setstateESt12_Ios_Iostate@PLT
.L3:
	.cfi_restore_state
	movq	%rsi, %rdi
	movq	%rsi, 8(%rsp)
	call	strlen@PLT
	movq	8(%rsp), %rsi
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	movq	%rax, %rdx
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@PLT
	.cfi_endproc
.LFE4293:
	.size	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0, .-_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	.globl	_Z34__device_stub__Z8multiplyPiS_S_iiiPiS_S_iii
	.type	_Z34__device_stub__Z8multiplyPiS_S_iiiPiS_S_iii, @function
_Z34__device_stub__Z8multiplyPiS_S_iiiPiS_S_iii:
.LFB3660:
	.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
	movl	%ecx, 20(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%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	20(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%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	.L6
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z8multiplyPiS_S_iii(%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
.L6:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3660:
	.size	_Z34__device_stub__Z8multiplyPiS_S_iiiPiS_S_iii, .-_Z34__device_stub__Z8multiplyPiS_S_iiiPiS_S_iii
	.globl	_Z8multiplyPiS_S_iii
	.type	_Z8multiplyPiS_S_iii, @function
_Z8multiplyPiS_S_iii:
.LFB3661:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z8multiplyPiS_S_iiiPiS_S_iii
	.cfi_endproc
.LFE3661:
	.size	_Z8multiplyPiS_S_iii, .-_Z8multiplyPiS_S_iii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Enter the size of first matrix:\n"
.LC1:
	.string	"Enter the size of second matrix:\n"
.LC2:
	.string	"matrix size is not valid for multiplication"
.LC3:
	.string	"Enter the first matrix\n"
.LC4:
	.string	"Enter the second array:\n"
.LC5:
	.string	"Memory allocation failed\n"
.LC6:
	.string	"Failed to copy data from host to device"
.LC7:
	.string	"Failed to copy data from device to host"
.LC8:
	.string	"Multiplied Matrix is:\n"
.LC9:
	.string	"  "
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3635:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	leaq	40(%rsp), %rsi
	leaq	_ZSt3cin(%rip), %rdi
	call	_ZNSirsERi@PLT
	leaq	44(%rsp), %rsi
	movq	%rax, %rdi
	call	_ZNSirsERi@PLT
	leaq	.LC1(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	leaq	48(%rsp), %rsi
	leaq	_ZSt3cin(%rip), %rdi
	call	_ZNSirsERi@PLT
	leaq	52(%rsp), %rsi
	movq	%rax, %rdi
	call	_ZNSirsERi@PLT
	movl	44(%rsp), %r12d
	leaq	.LC2(%rip), %rsi
	cmpl	48(%rsp), %r12d
	jne	.L39
	movl	40(%rsp), %r14d
	movl	%r12d, %r15d
	movl	52(%rsp), %eax
	movabsq	$2305843009213693950, %r13
	imull	%r14d, %r15d
	imull	%eax, %r12d
	imull	%eax, %r14d
	movslq	%r15d, %rax
	cmpq	%rax, %r13
	jb	.L14
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	_Znam@PLT
	movq	%rax, %rbp
	movslq	%r12d, %rax
	cmpq	%rax, %r13
	jnb	.L15
.L14:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	call	__cxa_throw_bad_array_new_length@PLT
.L15:
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
	call	_Znam@PLT
	movq	%rax, %rbx
	movslq	%r14d, %rax
	cmpq	%rax, %r13
	jb	.L14
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	_Znam@PLT
	leaq	.LC3(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %r13
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	xorl	%eax, %eax
.L17:
	movl	%eax, 36(%rsp)
	cmpl	%eax, %r15d
	jle	.L40
	cltq
	leaq	_ZSt3cin(%rip), %rdi
	leaq	0(%rbp,%rax,4), %rsi
	call	_ZNSirsERi@PLT
	movl	36(%rsp), %eax
	incl	%eax
	jmp	.L17
.L40:
	leaq	.LC4(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	xorl	%eax, %eax
.L19:
	movl	%eax, 36(%rsp)
	cmpl	%eax, %r12d
	jle	.L41
	cltq
	leaq	_ZSt3cin(%rip), %rdi
	leaq	(%rbx,%rax,4), %rsi
	call	_ZNSirsERi@PLT
	movl	36(%rsp), %eax
	incl	%eax
	jmp	.L19
.L41:
	movq	8(%rsp), %rsi
	leaq	56(%rsp), %rdi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L21
	leaq	.LC5(%rip), %rsi
.L39:
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	jmp	.L33
.L21:
	movq	16(%rsp), %rsi
	leaq	64(%rsp), %rdi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L22
	leaq	_ZSt4cout(%rip), %rdi
	leaq	.LC5(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	movq	56(%rsp), %rdi
	jmp	.L34
.L22:
	movq	24(%rsp), %rsi
	leaq	72(%rsp), %rdi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L23
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	jmp	.L38
.L23:
	movq	8(%rsp), %rdx
	movq	56(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbp, %rsi
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	jne	.L37
	movq	16(%rsp), %rdx
	movq	64(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	je	.L25
.L37:
	leaq	.LC6(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	jmp	.L35
.L25:
	movl	52(%rsp), %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	%eax, 92(%rsp)
	movl	40(%rsp), %eax
	movl	%eax, 96(%rsp)
	movq	92(%rsp), %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	movl	52(%rsp), %r9d
	movl	44(%rsp), %r8d
	movl	40(%rsp), %ecx
	movq	72(%rsp), %rdx
	movq	64(%rsp), %rsi
	movq	56(%rsp), %rdi
	call	_Z34__device_stub__Z8multiplyPiS_S_iiiPiS_S_iii
.L26:
	movq	24(%rsp), %rdx
	movq	72(%rsp), %rsi
	movl	$2, %ecx
	movq	%r13, %rdi
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	je	.L27
	leaq	.LC7(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	movq	%rbp, %rdi
	call	_ZdaPv@PLT
	movq	%rbx, %rdi
	call	_ZdaPv@PLT
.L38:
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	64(%rsp), %rdi
	jmp	.L34
.L27:
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	leaq	.LC9(%rip), %r12
	xorl	%eax, %eax
.L28:
	movl	%eax, 36(%rsp)
	cmpl	%eax, %r14d
	jle	.L42
	cltq
	leaq	_ZSt4cout(%rip), %rdi
	movl	0(%r13,%rax,4), %esi
	call	_ZNSolsEi@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.isra.0
	movl	36(%rsp), %eax
	incl	%eax
	cltd
	idivl	52(%rsp)
	testl	%edx, %edx
	jne	.L29
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.L29:
	movl	36(%rsp), %eax
	incl	%eax
	jmp	.L28
.L42:
	movq	%rbp, %rdi
	call	_ZdaPv@PLT
	movq	%rbx, %rdi
	call	_ZdaPv@PLT
	movq	%r13, %rdi
	call	_ZdaPv@PLT
.L35:
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rdi
.L34:
	call	cudaFree@PLT
.L33:
	leaq	36(%rsp), %rsi
	leaq	_ZSt3cin(%rip), %rdi
	call	_ZNSirsERi@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L31
.L36:
	call	__stack_chk_fail@PLT
.L31:
	addq	$120, %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
.LFE3635:
	.size	main, .-main
	.section	.rodata.str1.1
.LC10:
	.string	"_Z8multiplyPiS_S_iii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3663:
	.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	.LC10(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z8multiplyPiS_S_iii(%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
.LFE3663:
	.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 <stdio.h>
#include<iostream>

using namespace std;

__global__ void multiply(int *a, int *b, int *c, int m, int n, int q)
{
int id_x = threadIdx.x;
int id_y = threadIdx.y;

int i,d=0;
for(i=0;i<n;i++)
  {
  d = d + (a[(id_y * n) + i] * b[(i * q) + id_x]);
  }
  c[(id_y * q) + id_x] = d;
}

int main()
{
int i;
int m,n,x,y;

cout<<"Enter the size of first matrix:\n";
cin>>m>>n;
cout<<"Enter the size of second matrix:\n";
cin>>x>>y;

if(n != x)
  {
  cout<<"matrix size is not valid for multiplication";
  cin>>i;
  return 0;
  }

int size_a = m*n;
int size_b = x*y;
int size_c = m*y;

int *h_a=new int[size_a];
int *h_b=new int[size_b];
int *h_c=new int[size_c];

cout<<"Enter the first matrix\n";

for(i=0;i<size_a;i++)
  {
  cin>>h_a[i];
  }

cout<<"Enter the second array:\n";
for(i=0;i<size_b;i++)
  {
  cin>>h_b[i];
  }

int*d_a,*d_b,*d_c;

if(hipMalloc(&d_a, sizeof(int)*size_a) != hipSuccess)
  {
  cout<<"Memory allocation failed\n";
  cin>>i;
  return 0;
  }

if(hipMalloc(&d_b, sizeof(int)*size_b) != hipSuccess)
  {
  cout<<"Memory allocation failed\n";
  hipFree(d_a);
  cin>>i;
  return 0;
  }

if(hipMalloc(&d_c, sizeof(int)*size_c) != hipSuccess)
  {
  cout<<"Memory allocation failed\n";
  hipFree(d_a);
  hipFree(d_b);
  cin>>i;
  return 0;
  }

if(hipMemcpy(d_a, h_a, sizeof(int)*size_a, hipMemcpyHostToDevice) != hipSuccess)
  {
  cout<<"Failed to copy data from host to device";
  hipFree(d_a);
  hipFree(d_b);
  hipFree(d_c);
  cin>>i;
  return 0;
  }

if(hipMemcpy(d_b, h_b, sizeof(int)*size_b, hipMemcpyHostToDevice) != hipSuccess)
  {
  cout<<"Failed to copy data from host to device";
  hipFree(d_a);
  hipFree(d_b);
  hipFree(d_c);
  cin>>i;
  return 0;
  }

dim3 block(1,1,1);
dim3 thread(y,m,1);

multiply<<<block, thread>>>(d_a, d_b, d_c, m, n, y);

if(hipMemcpy(h_c, d_c, size_c * sizeof(int), hipMemcpyDeviceToHost) != hipSuccess)
  {
  cout<<"Failed to copy data from device to host";
  delete[] h_a;
  delete[] h_b;
  hipFree(d_a);
  hipFree(d_b);
  cin>>i;
  return 0;
  }

cout<<"Multiplied Matrix is:\n";
for(i=0;i<size_c;i++)
{
  cout<<h_c[i]<<"  ";
  if((i+1)%y == 0) cout<<endl;
}

delete[] h_a;
delete[] h_b;
delete[] h_c;
hipFree(d_a);
hipFree(d_b);
hipFree(d_c);

cin>>i;
return 0;

}
	.text
	.file	"matrix_multiplication.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z23__device_stub__multiplyPiS_S_iii # -- Begin function _Z23__device_stub__multiplyPiS_S_iii
	.type	_Z23__device_stub__multiplyPiS_S_iii,@function
_Z23__device_stub__multiplyPiS_S_iii:   # @_Z23__device_stub__multiplyPiS_S_iii
	.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	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%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	32(%rsp), %r12
	leaq	24(%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	$_Z8multiplyPiS_S_iii, %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	_Z23__device_stub__multiplyPiS_S_iii, .Lfunc_end0-_Z23__device_stub__multiplyPiS_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function 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	$88, %rsp
	.cfi_def_cfa_offset 144
	.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	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$32, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	leaq	36(%rsp), %rsi
	movl	$_ZSt3cin, %edi
	callq	_ZNSirsERi
	leaq	52(%rsp), %rbx
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_ZNSirsERi
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$33, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	leaq	84(%rsp), %r14
	movl	$_ZSt3cin, %edi
	movq	%r14, %rsi
	callq	_ZNSirsERi
	leaq	12(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZNSirsERi
	movl	(%rbx), %r13d
	cmpl	(%r14), %r13d
	jne	.LBB1_9
# %bb.1:
	movl	36(%rsp), %eax
	movl	%eax, %r12d
	imull	%r13d, %r12d
	movl	12(%rsp), %ebp
	imull	%ebp, %r13d
	imull	%eax, %ebp
	movslq	%r12d, %rax
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	leaq	(,%rax,4), %rdi
	testl	%eax, %eax
	movq	$-1, %r15
	movq	%rdi, 72(%rsp)                  # 8-byte Spill
	cmovsq	%r15, %rdi
	callq	_Znam
	movq	%rax, %rbx
	movslq	%r13d, %rax
	leaq	(,%rax,4), %rdi
	testl	%eax, %eax
	movq	%rdi, 56(%rsp)                  # 8-byte Spill
	cmovsq	%r15, %rdi
	callq	_Znam
	movq	%rax, %r14
	movl	%ebp, 48(%rsp)                  # 4-byte Spill
	movslq	%ebp, %rax
	leaq	(,%rax,4), %rbp
	testl	%eax, %eax
	cmovnsq	%rbp, %r15
	movq	%r15, %rdi
	callq	_Znam
	movq	%rax, %r15
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$0, 8(%rsp)
	cmpl	$0, 64(%rsp)                    # 4-byte Folded Reload
	jle	.LBB1_4
# %bb.2:                                # %.lr.ph.preheader
	xorl	%eax, %eax
.LBB1_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	cltq
	leaq	(%rbx,%rax,4), %rsi
	movl	$_ZSt3cin, %edi
	callq	_ZNSirsERi
	movl	8(%rsp), %eax
	incl	%eax
	movl	%eax, 8(%rsp)
	cmpl	%r12d, %eax
	jl	.LBB1_3
.LBB1_4:                                # %._crit_edge
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$24, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$0, 8(%rsp)
	testl	%r13d, %r13d
	jle	.LBB1_7
# %bb.5:                                # %.lr.ph47.preheader
	xorl	%eax, %eax
.LBB1_6:                                # %.lr.ph47
                                        # =>This Inner Loop Header: Depth=1
	cltq
	leaq	(%r14,%rax,4), %rsi
	movl	$_ZSt3cin, %edi
	callq	_ZNSirsERi
	movl	8(%rsp), %eax
	incl	%eax
	movl	%eax, 8(%rsp)
	cmpl	%r13d, %eax
	jl	.LBB1_6
.LBB1_7:                                # %._crit_edge48
	leaq	16(%rsp), %rdi
	movq	72(%rsp), %r13                  # 8-byte Reload
	movq	%r13, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB1_11
# %bb.8:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$25, %edx
	jmp	.LBB1_10
.LBB1_9:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$43, %edx
.LBB1_10:
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB1_21:
	leaq	8(%rsp), %rsi
	movl	$_ZSt3cin, %edi
	callq	_ZNSirsERi
	xorl	%eax, %eax
	addq	$88, %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_11:
	.cfi_def_cfa_offset 144
	leaq	24(%rsp), %rdi
	movq	56(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB1_13
# %bb.12:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$25, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	16(%rsp), %rdi
	jmp	.LBB1_20
.LBB1_13:
	leaq	40(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB1_16
# %bb.14:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$25, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB1_15:
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	jmp	.LBB1_20
.LBB1_16:
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB1_18
# %bb.17:
	movq	24(%rsp), %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	je	.LBB1_22
.LBB1_18:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$39, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB1_19:
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	40(%rsp), %rdi
.LBB1_20:
	callq	hipFree
	jmp	.LBB1_21
.LBB1_22:
	movl	12(%rsp), %eax
	movl	36(%rsp), %edx
	shlq	$32, %rdx
	orq	%rax, %rdx
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_24
# %bb.23:
	movq	16(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	40(%rsp), %rdx
	movl	36(%rsp), %ecx
	movl	52(%rsp), %r8d
	movl	12(%rsp), %r9d
	callq	_Z23__device_stub__multiplyPiS_S_iii
.LBB1_24:
	movq	40(%rsp), %rsi
	movq	%r15, %rdi
	movq	%rbp, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	movl	48(%rsp), %ebp                  # 4-byte Reload
	movl	$_ZSt4cout, %edi
	je	.LBB1_26
# %bb.25:
	movl	$.L.str.7, %esi
	movl	$39, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%rbx, %rdi
	callq	_ZdaPv
	movq	%r14, %rdi
	callq	_ZdaPv
	jmp	.LBB1_15
.LBB1_26:
	movl	$.L.str.8, %esi
	movl	$22, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$0, 8(%rsp)
	testl	%ebp, %ebp
	jle	.LBB1_31
# %bb.27:                               # %.lr.ph51.preheader
	xorl	%ecx, %ecx
.LBB1_28:                               # %.lr.ph51
                                        # =>This Inner Loop Header: Depth=1
	movslq	%ecx, %rax
	movl	(%r15,%rax,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.9, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	8(%rsp), %ecx
	incl	%ecx
	movl	%ecx, %eax
	cltd
	idivl	12(%rsp)
	testl	%edx, %edx
	jne	.LBB1_30
# %bb.29:                               #   in Loop: Header=BB1_28 Depth=1
	movl	$_ZSt4cout, %edi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	movl	8(%rsp), %ecx
	incl	%ecx
.LBB1_30:                               #   in Loop: Header=BB1_28 Depth=1
	movl	%ecx, 8(%rsp)
	cmpl	%ebp, %ecx
	jl	.LBB1_28
.LBB1_31:                               # %._crit_edge52
	movq	%rbx, %rdi
	callq	_ZdaPv
	movq	%r14, %rdi
	callq	_ZdaPv
	movq	%r15, %rdi
	callq	_ZdaPv
	jmp	.LBB1_19
.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	$_Z8multiplyPiS_S_iii, %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	_Z8multiplyPiS_S_iii,@object    # @_Z8multiplyPiS_S_iii
	.section	.rodata,"a",@progbits
	.globl	_Z8multiplyPiS_S_iii
	.p2align	3, 0x0
_Z8multiplyPiS_S_iii:
	.quad	_Z23__device_stub__multiplyPiS_S_iii
	.size	_Z8multiplyPiS_S_iii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Enter the size of first matrix:\n"
	.size	.L.str, 33

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Enter the size of second matrix:\n"
	.size	.L.str.1, 34

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"matrix size is not valid for multiplication"
	.size	.L.str.2, 44

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Enter the first matrix\n"
	.size	.L.str.3, 24

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Enter the second array:\n"
	.size	.L.str.4, 25

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Memory allocation failed\n"
	.size	.L.str.5, 26

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Failed to copy data from host to device"
	.size	.L.str.6, 40

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Failed to copy data from device to host"
	.size	.L.str.7, 40

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Multiplied Matrix is:\n"
	.size	.L.str.8, 23

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z8multiplyPiS_S_iii"
	.size	.L__unnamed_1, 21

	.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 _Z23__device_stub__multiplyPiS_S_iii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z8multiplyPiS_S_iii
	.addrsig_sym _ZSt4cout
	.addrsig_sym _ZSt3cin
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z8multiplyPiS_S_iii    ; -- Begin function _Z8multiplyPiS_S_iii
	.globl	_Z8multiplyPiS_S_iii
	.p2align	8
	.type	_Z8multiplyPiS_S_iii,@function
_Z8multiplyPiS_S_iii:                   ; @_Z8multiplyPiS_S_iii
; %bb.0:
	s_clause 0x2
	s_load_b64 s[2:3], s[0:1], 0x1c
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v6, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s2, 1
	s_cbranch_scc1 .LBB0_3
; %bb.1:                                ; %.lr.ph
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v7, v6, s2
	v_mov_b32_e32 v8, 0
	v_lshlrev_b32_e32 v0, 2, v1
	s_ashr_i32 s9, s3, 31
	s_mov_b32 s8, s3
	v_add_co_u32 v2, s6, s6, v0
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[4:5], 2, v[7:8]
	v_add_co_ci_u32_e64 v3, null, s7, 0, s6
	v_mov_b32_e32 v0, v8
	v_add_co_u32 v4, vcc_lo, s4, v4
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v5, vcc_lo
	s_lshl_b64 s[4:5], s[8:9], 2
.LBB0_2:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v9, v[4:5], off
	global_load_b32 v10, v[2:3], off
	v_add_co_u32 v2, vcc_lo, v2, s4
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	v_add_co_u32 v4, vcc_lo, v4, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_add_i32 s2, s2, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	s_cmp_lg_u32 s2, 0
	s_waitcnt vmcnt(0)
	v_mad_u64_u32 v[7:8], null, v10, v9, v[0:1]
	v_mov_b32_e32 v0, v7
	s_cbranch_scc1 .LBB0_2
	s_branch .LBB0_4
.LBB0_3:
	v_mov_b32_e32 v0, 0
.LBB0_4:                                ; %._crit_edge
	v_mad_u64_u32 v[2:3], null, v6, s3, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[1:2], 2, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, s0, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v2, vcc_lo
	global_store_b32 v[1:2], v0, off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8multiplyPiS_S_iii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 36
		.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 11
		.amdhsa_next_free_sgpr 10
		.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	_Z8multiplyPiS_S_iii, .Lfunc_end0-_Z8multiplyPiS_S_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 276
; NumSgprs: 12
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 12
; NumVGPRsForWavesPerEU: 11
; 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
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 36
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8multiplyPiS_S_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     12
    .sgpr_spill_count: 0
    .symbol:         _Z8multiplyPiS_S_iii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
