#include <cuda.h>
#include <iostream>

void matrixMul(int** A, int** B, int** C, int WIDTH); //loading, transfer, execution(host code)
void printArray(int **array, int WIDTH); // print Array elements
int main(int argc, char * argv[]){
    int WIDTH;
    int x,y;
    int **a,**b,**c;
    
    if(argc<2){
        printf("Not inserted block size, Try again\n");
        exit(-1);
    }
    //allocating program arguments
    WIDTH=atoi(argv[1]);

    //2D array dynamic allocation 
    a=(int**)malloc(sizeof(int*)*WIDTH);
    b=(int**)malloc(sizeof(int*)*WIDTH);
    c=(int**)malloc(sizeof(int*)*WIDTH);

    for(y=0;y<WIDTH;y++){
        a[y]=(int*)malloc(sizeof(int)*WIDTH);
        b[y]=(int*)malloc(sizeof(int)*WIDTH);
        c[y]=(int*)malloc(sizeof(int)*WIDTH);
    }
    
    //initializing 2D array
   for(y=0;y<WIDTH;y++){
       for(x=0;x<WIDTH;x++){
           a[y][x]=y*10+x;
           b[y][x]=(y*10+x)*100;
        }
   }
   clock_t start=clock();
   matrixMul(a,b,c,WIDTH);
   printArray(c,WIDTH);
   printf("Matrix Multiplication execution time(Serial): %fms\n",(double)(clock()-start));
   //free 2D array
    for(y=0;y<WIDTH;y++){
        free(a[y]);
        free(b[y]);
        free(c[y]);
    }

    free(a);
    free(b);
    free(c);
    return 0;
}


void matrixMul(int** A, int** B, int** C,int WIDTH)
{
    int x,y,k,sum;
    for(y=0;y<WIDTH;y++){
        for(x=0;x<WIDTH;x++){
            sum=0;
            for(k=0;k<WIDTH;k++){
                sum+=A[y][k]*B[k][x];
            }
            C[y][x]=sum;
        }
    }
}

void printArray(int **array, int WIDTH){
    int x,y;
    for(y=0;y<WIDTH;y++){
        for(x=0;x<WIDTH;x++)
            printf("%10d",array[y][x]);  
        printf("\n");
    }
}

	.file	"tmpxft_0028ea85_00000000-6_matmul-host.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3640:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3640:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z9matrixMulPPiS0_S0_i
	.type	_Z9matrixMulPPiS0_S0_i, @function
_Z9matrixMulPPiS0_S0_i:
.LFB3636:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	movq	%rdx, %rdi
	xorl	%edx, %edx
	movq	%rsi, %r9
	cmpl	%edx, %ecx
	jg	.L13
	ret
.L13:
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
.L11:
	movq	(%r8,%rdx,8), %rbp
	movq	(%rdi,%rdx,8), %rbx
	xorl	%eax, %eax
.L7:
	leaq	0(,%rax,4), %r12
	xorl	%esi, %esi
	xorl	%r10d, %r10d
.L4:
	movq	(%r9,%rsi,8), %r11
	movl	(%r11,%r12), %r11d
	imull	0(%rbp,%rsi,4), %r11d
	incq	%rsi
	addl	%r11d, %r10d
	cmpl	%esi, %ecx
	jg	.L4
	movl	%r10d, (%rbx,%rax,4)
	incq	%rax
	cmpl	%eax, %ecx
	jg	.L7
	incq	%rdx
	cmpl	%edx, %ecx
	jg	.L11
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3636:
	.size	_Z9matrixMulPPiS0_S0_i, .-_Z9matrixMulPPiS0_S0_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%10d"
.LC1:
	.string	"\n"
	.text
	.globl	_Z10printArrayPPii
	.type	_Z10printArrayPPii, @function
_Z10printArrayPPii:
.LFB3637:
	.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
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r14, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	pushq	%rdx
	.cfi_def_cfa_offset 64
.L16:
	cmpl	%ebx, %ebp
	jle	.L21
	xorl	%r12d, %r12d
	leaq	.LC0(%rip), %r15
.L17:
	movq	0(%r13,%rbx,8), %rax
	movq	%r15, %rsi
	movl	$2, %edi
	movl	(%rax,%r12,4), %edx
	xorl	%eax, %eax
	incq	%r12
	call	__printf_chk@PLT
	cmpq	%r14, %r12
	jne	.L17
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	jmp	.L16
.L21:
	popq	%rax
	.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
.LFE3637:
	.size	_Z10printArrayPPii, .-_Z10printArrayPPii
	.section	.rodata.str1.1
.LC2:
	.string	"Not inserted block size, Try again\n"
.LC3:
	.string	"Matrix Multiplication execution time(Serial): %fms\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3635:
	.cfi_startproc
	endbr64
	decl	%edi
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	pushq	%rcx
	.cfi_def_cfa_offset 64
	jg	.L23
	movl	$2, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %edi
	call	exit@PLT
.L23:
	movq	8(%rsi), %rdi
	xorl	%r14d, %r14d
	call	atoi@PLT
	movslq	%eax, %r15
	leaq	0(,%r15,8), %rbp
	movq	%r15, %rbx
	salq	$2, %r15
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, %r13
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rax, %rbp
.L24:
	cmpl	%r14d, %ebx
	jle	.L33
	movq	%r15, %rdi
	call	malloc@PLT
	movq	%r15, %rdi
	movq	%rax, 0(%r13,%r14,8)
	call	malloc@PLT
	movq	%r15, %rdi
	movq	%rax, (%r12,%r14,8)
	call	malloc@PLT
	movq	%rax, 0(%rbp,%r14,8)
	incq	%r14
	jmp	.L24
.L33:
	xorl	%eax, %eax
.L26:
	cmpl	%eax, %ebx
	jle	.L34
	imull	$10, %eax, %ecx
	movq	0(%r13,%rax,8), %r8
	movq	(%r12,%rax,8), %rsi
	xorl	%edx, %edx
.L27:
	imull	$100, %ecx, %edi
	movl	%ecx, (%r8,%rdx,4)
	incl	%ecx
	movl	%edi, (%rsi,%rdx,4)
	incq	%rdx
	cmpl	%edx, %ebx
	jg	.L27
	incq	%rax
	jmp	.L26
.L34:
	call	clock@PLT
	movl	%ebx, %ecx
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	movq	%rax, %r14
	call	_Z9matrixMulPPiS0_S0_i
	movl	%ebx, %esi
	movq	%rbp, %rdi
	call	_Z10printArrayPPii
	call	clock@PLT
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	subq	%r14, %rax
	xorl	%r14d, %r14d
	cvtsi2sdq	%rax, %xmm0
	movb	$1, %al
	call	__printf_chk@PLT
.L29:
	cmpl	%r14d, %ebx
	jle	.L35
	movq	0(%r13,%r14,8), %rdi
	call	free@PLT
	movq	(%r12,%r14,8), %rdi
	call	free@PLT
	movq	0(%rbp,%r14,8), %rdi
	incq	%r14
	call	free@PLT
	jmp	.L29
.L35:
	movq	%r13, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	popq	%rdx
	.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
	.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
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	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 <iostream>

void matrixMul(int** A, int** B, int** C, int WIDTH); //loading, transfer, execution(host code)
void printArray(int **array, int WIDTH); // print Array elements
int main(int argc, char * argv[]){
    int WIDTH;
    int x,y;
    int **a,**b,**c;
    
    if(argc<2){
        printf("Not inserted block size, Try again\n");
        exit(-1);
    }
    //allocating program arguments
    WIDTH=atoi(argv[1]);

    //2D array dynamic allocation 
    a=(int**)malloc(sizeof(int*)*WIDTH);
    b=(int**)malloc(sizeof(int*)*WIDTH);
    c=(int**)malloc(sizeof(int*)*WIDTH);

    for(y=0;y<WIDTH;y++){
        a[y]=(int*)malloc(sizeof(int)*WIDTH);
        b[y]=(int*)malloc(sizeof(int)*WIDTH);
        c[y]=(int*)malloc(sizeof(int)*WIDTH);
    }
    
    //initializing 2D array
   for(y=0;y<WIDTH;y++){
       for(x=0;x<WIDTH;x++){
           a[y][x]=y*10+x;
           b[y][x]=(y*10+x)*100;
        }
   }
   clock_t start=clock();
   matrixMul(a,b,c,WIDTH);
   printArray(c,WIDTH);
   printf("Matrix Multiplication execution time(Serial): %fms\n",(double)(clock()-start));
   //free 2D array
    for(y=0;y<WIDTH;y++){
        free(a[y]);
        free(b[y]);
        free(c[y]);
    }

    free(a);
    free(b);
    free(c);
    return 0;
}


void matrixMul(int** A, int** B, int** C,int WIDTH)
{
    int x,y,k,sum;
    for(y=0;y<WIDTH;y++){
        for(x=0;x<WIDTH;x++){
            sum=0;
            for(k=0;k<WIDTH;k++){
                sum+=A[y][k]*B[k][x];
            }
            C[y][x]=sum;
        }
    }
}

void printArray(int **array, int WIDTH){
    int x,y;
    for(y=0;y<WIDTH;y++){
        for(x=0;x<WIDTH;x++)
            printf("%10d",array[y][x]);  
        printf("\n");
    }
}

	.text
	.file	"matmul-host.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.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
	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
	cmpl	$1, %edi
	jle	.LBB0_21
# %bb.1:
	movq	8(%rsi), %rdi
	callq	atoi
	movl	%eax, %ebp
	movl	%eax, %r12d
	movslq	%eax, %r13
	leaq	(,%r13,8), %r15
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %r15
	testl	%r13d, %r13d
	jle	.LBB0_22
# %bb.2:                                # %.lr.ph
	movl	%ebp, 4(%rsp)                   # 4-byte Spill
	shlq	$2, %r13
	xorl	%ebp, %ebp
.LBB0_3:                                # =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	malloc
	movq	%rax, (%rbx,%rbp,8)
	movq	%r13, %rdi
	callq	malloc
	movq	%rax, (%r14,%rbp,8)
	movq	%r13, %rdi
	callq	malloc
	movq	%rax, (%r15,%rbp,8)
	incq	%rbp
	cmpq	%rbp, %r12
	jne	.LBB0_3
# %bb.4:                                # %.preheader53
	testl	%r12d, %r12d
	movl	4(%rsp), %ebp                   # 4-byte Reload
	jle	.LBB0_22
# %bb.5:                                # %.preheader.lr.ph
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.LBB0_6:                                # %.lr.ph56
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_7 Depth 2
	movq	(%rbx,%rdx,8), %rsi
	movq	(%r14,%rdx,8), %rdi
	movl	%ecx, %r8d
	xorl	%r9d, %r9d
.LBB0_7:                                #   Parent Loop BB0_6 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	leal	(%rax,%r9), %r10d
	movl	%r10d, (%rsi,%r9,4)
	movl	%r8d, (%rdi,%r9,4)
	incq	%r9
	addl	$100, %r8d
	cmpq	%r9, %r12
	jne	.LBB0_7
# %bb.8:                                # %._crit_edge
                                        #   in Loop: Header=BB0_6 Depth=1
	incq	%rdx
	addl	$1000, %ecx                     # imm = 0x3E8
	addq	$10, %rax
	cmpq	%r12, %rdx
	jne	.LBB0_6
# %bb.9:                                # %._crit_edge58
	callq	clock
	movq	%rax, %r13
	testl	%ebp, %ebp
	jle	.LBB0_19
# %bb.10:                               # %.preheader23.lr.ph.i
	xorl	%eax, %eax
.LBB0_11:                               # %.preheader.lr.ph.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_12 Depth 2
                                        #       Child Loop BB0_13 Depth 3
	movq	(%r15,%rax,8), %rcx
	movq	(%rbx,%rax,8), %rdx
	xorl	%esi, %esi
.LBB0_12:                               # %.preheader.i
                                        #   Parent Loop BB0_11 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB0_13 Depth 3
	xorl	%edi, %edi
	xorl	%r8d, %r8d
.LBB0_13:                               #   Parent Loop BB0_11 Depth=1
                                        #     Parent Loop BB0_12 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movq	(%r14,%rdi,8), %r9
	movl	(%r9,%rsi,4), %r9d
	imull	(%rdx,%rdi,4), %r9d
	addl	%r9d, %r8d
	incq	%rdi
	cmpq	%rdi, %r12
	jne	.LBB0_13
# %bb.14:                               # %._crit_edge.i
                                        #   in Loop: Header=BB0_12 Depth=2
	movl	%r8d, (%rcx,%rsi,4)
	incq	%rsi
	cmpq	%r12, %rsi
	jne	.LBB0_12
# %bb.15:                               # %._crit_edge27.i
                                        #   in Loop: Header=BB0_11 Depth=1
	incq	%rax
	cmpq	%r12, %rax
	jne	.LBB0_11
	jmp	.LBB0_16
.LBB0_22:                               # %._crit_edge58.thread
	callq	clock
	movq	%rax, %r13
.LBB0_16:                               # %_Z9matrixMulPPiS0_S0_i.exit
	movq	%r15, %rdi
	movl	%ebp, %esi
	callq	_Z10printArrayPPii
	callq	clock
	subq	%r13, %rax
	cvtsi2sd	%rax, %xmm0
	movl	$.L.str.1, %edi
	movb	$1, %al
	callq	printf
	testl	%r12d, %r12d
	jle	.LBB0_20
# %bb.17:                               # %.lr.ph60.preheader
	xorl	%r13d, %r13d
.LBB0_18:                               # %.lr.ph60
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbx,%r13,8), %rdi
	callq	free
	movq	(%r14,%r13,8), %rdi
	callq	free
	movq	(%r15,%r13,8), %rdi
	callq	free
	incq	%r13
	cmpq	%r13, %r12
	jne	.LBB0_18
	jmp	.LBB0_20
.LBB0_19:                               # %._crit_edge61.critedge
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_Z10printArrayPPii
	callq	clock
	subq	%r13, %rax
	cvtsi2sd	%rax, %xmm0
	movl	$.L.str.1, %edi
	movb	$1, %al
	callq	printf
.LBB0_20:                               # %._crit_edge61
	movq	%rbx, %rdi
	callq	free
	movq	%r14, %rdi
	callq	free
	movq	%r15, %rdi
	callq	free
	xorl	%eax, %eax
	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
.LBB0_21:
	.cfi_def_cfa_offset 64
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$-1, %edi
	callq	exit
.Lfunc_end0:
	.size	main, .Lfunc_end0-main
	.cfi_endproc
                                        # -- End function
	.globl	_Z9matrixMulPPiS0_S0_i          # -- Begin function _Z9matrixMulPPiS0_S0_i
	.type	_Z9matrixMulPPiS0_S0_i,@function
_Z9matrixMulPPiS0_S0_i:                 # @_Z9matrixMulPPiS0_S0_i
	.cfi_startproc
# %bb.0:
	testl	%ecx, %ecx
	jle	.LBB1_8
# %bb.1:                                # %.preheader23.lr.ph
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	movl	%ecx, %eax
	xorl	%ecx, %ecx
.LBB1_2:                                # %.preheader.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_3 Depth 2
                                        #       Child Loop BB1_4 Depth 3
	movq	(%rdx,%rcx,8), %r8
	movq	(%rdi,%rcx,8), %r9
	xorl	%r10d, %r10d
.LBB1_3:                                # %.preheader
                                        #   Parent Loop BB1_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB1_4 Depth 3
	xorl	%r11d, %r11d
	xorl	%ebx, %ebx
.LBB1_4:                                #   Parent Loop BB1_2 Depth=1
                                        #     Parent Loop BB1_3 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movq	(%rsi,%r11,8), %r14
	movl	(%r14,%r10,4), %ebp
	imull	(%r9,%r11,4), %ebp
	addl	%ebp, %ebx
	incq	%r11
	cmpq	%r11, %rax
	jne	.LBB1_4
# %bb.5:                                # %._crit_edge
                                        #   in Loop: Header=BB1_3 Depth=2
	movl	%ebx, (%r8,%r10,4)
	incq	%r10
	cmpq	%rax, %r10
	jne	.LBB1_3
# %bb.6:                                # %._crit_edge27
                                        #   in Loop: Header=BB1_2 Depth=1
	incq	%rcx
	cmpq	%rax, %rcx
	jne	.LBB1_2
# %bb.7:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %rbp
.LBB1_8:                                # %._crit_edge29
	retq
.Lfunc_end1:
	.size	_Z9matrixMulPPiS0_S0_i, .Lfunc_end1-_Z9matrixMulPPiS0_S0_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z10printArrayPPii              # -- Begin function _Z10printArrayPPii
	.type	_Z10printArrayPPii,@function
_Z10printArrayPPii:                     # @_Z10printArrayPPii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB2_6
# %bb.1:                                # %.preheader.lr.ph
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	xorl	%r15d, %r15d
.LBB2_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_3 Depth 2
	xorl	%r12d, %r12d
.LBB2_3:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%rbx,%r15,8), %rax
	movl	(%rax,%r12,4), %esi
	movl	$.L.str.2, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r12
	cmpq	%r12, %r14
	jne	.LBB2_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%r15
	cmpq	%r14, %r15
	jne	.LBB2_2
# %bb.5:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r14
	.cfi_restore %r15
.LBB2_6:                                # %._crit_edge12
	retq
.Lfunc_end2:
	.size	_Z10printArrayPPii, .Lfunc_end2-_Z10printArrayPPii
	.cfi_endproc
                                        # -- End function
	.type	.L.str.1,@object                # @.str.1
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.1:
	.asciz	"Matrix Multiplication execution time(Serial): %fms\n"
	.size	.L.str.1, 52

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%10d"
	.size	.L.str.2, 5

	.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	"Not inserted block size, Try again"
	.size	.Lstr, 35

	.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_

	.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_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
