#include <stdio.h>
#include <iostream>
#include <cuda.h>
#include <chrono>
#include <random>
using namespace std;


int random_in_range( int minimum, int maximum )
{
  thread_local std::ranlux48 rng( 
    std::chrono::system_clock::now().time_since_epoch().count() );
  return std::uniform_int_distribution <int> ( minimum, maximum )( rng );
}

__global__
void matrixMultiplication(int *a, int *b, int *c, int m, int n, int k)
{
    int row = blockIdx.y*blockDim.y + threadIdx.y;
    int col = blockIdx.x*blockDim.x + threadIdx.x;
    int sum=0;
   
    if(col<k && row<m) {
      for(int j=0;j<n;j++)
      {
          sum += a[row*n+j] * b[j*k+col];
      }
      c[k*row+col]=sum;
    }
    
}

void matrix_multiplication_cpu(int *a, int *b, int *c, int m, int n, int k) {
    for(int i = 0 ; i < m ; i++) {
        for(int j = 0 ; j < n ; j++) {
            long result = 0;
            for(int p = 0 ; p < k ; p++) {
                result=result+a[i*k+p]*b[p*k+j]; 
            }
            c[k*i+j] = result;
        }
    }
}

void init_result(int *a, int m, int k) {
    for(int i=0; i<m; i++) {
      for(int j=0; j<k; j++) {
        a[i*k + j] = 0;
      }
    }
}

void init_matrix(int *a, int n, int m) {
    for(int i=0; i<n; i++) {
      for(int j=0; j<m; j++) {
        a[i*m + j] = random_in_range(10,30);
      }
    }
}

void print_matrix(int *a, int n, int m) {
    for(int i=0; i<n; i++) {
      for(int j=0; j<m; j++) {
        cout<<"  "<<a[i*m + j];
      }
      cout<<endl;
    }
    cout<<endl;
}

int main()
{
    
    int *a,*b,*c;
    int *a_dev,*b_dev,*c_dev;
    int m=30, n=30, k=30;
    
    a = new int[m*n];
    b = new int[n*k];
    c = new int[m*k];
    
    init_matrix(a, m, n);
    init_matrix(b, n ,k);
    init_result(c, m, k);
    
    cout<<"First matrix : "<<endl;
    print_matrix(a, m, n);
    cout<<"Second matrix : "<<endl;
    print_matrix(b, n, k);
    
    cudaMalloc(&a_dev, sizeof(int)*m*n);
    cudaMalloc(&b_dev, sizeof(int)*n*k);
    cudaMalloc(&c_dev, sizeof(int)*m*k);
       
    cudaMemcpy(a_dev, a, sizeof(int)*m*n, cudaMemcpyHostToDevice);
    cudaMemcpy(b_dev, b, sizeof(int)*n*k, cudaMemcpyHostToDevice);
    
    dim3 dimGrid(1,1);
    dim3 dimBlock(n,n);
    
    float gpu_elapsed_time;
    cudaEvent_t gpu_start,gpu_stop;
    cudaEventCreate(&gpu_start);
    cudaEventCreate(&gpu_stop);
    cudaEventRecord(gpu_start,0);
    matrixMultiplication<<<dimGrid, dimBlock>>>(a_dev,b_dev,c_dev, m, n, k);
    cudaEventRecord(gpu_stop, 0);
    cudaEventSynchronize(gpu_stop);
    cudaEventElapsedTime(&gpu_elapsed_time, gpu_start, gpu_stop);
    cudaEventDestroy(gpu_start);
    cudaEventDestroy(gpu_stop);
    cout<<"GPU Elapsed time is: "<<gpu_elapsed_time<<" milliseconds"<<endl;
    
    cudaMemcpy(c, c_dev, sizeof(int)*m*k, cudaMemcpyDeviceToHost);
    
    cout<<"GPU Result : "<<endl;
    print_matrix(c, m, k);
    cout<<endl;

    cudaEventCreate(&gpu_start);
    cudaEventCreate(&gpu_stop);
    cudaEventRecord(gpu_start,0);
    matrix_multiplication_cpu(a, b, c, m, n, k);
    cudaEventRecord(gpu_stop, 0);
    cudaEventSynchronize(gpu_stop);
    cudaEventElapsedTime(&gpu_elapsed_time, gpu_start, gpu_stop);
    cudaEventDestroy(gpu_start);
    cudaEventDestroy(gpu_stop);
    cout<<"CPU Elapsed time is: "<<gpu_elapsed_time<<" milliseconds"<<endl;
 
    cout<<"CPU Result : "<<endl;
    print_matrix(c, m, k);
    
    cudaFree(a_dev);
    cudaFree(b_dev);
    cudaFree(c_dev);
    
    delete[] a;
    delete[] b;
    delete[] c;
    
    return 0;
}
	.file	"tmpxft_0021a8bc_00000000-6_part3.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4826:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4826:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB5600:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE5600:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z25matrix_multiplication_cpuPiS_S_iii
	.type	_Z25matrix_multiplication_cpuPiS_S_iii, @function
_Z25matrix_multiplication_cpuPiS_S_iii:
.LFB4819:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%r9d, %rax
	movq	%rdx, %r10
	xorl	%r11d, %r11d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	salq	$2, %rax
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%ecx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	movq	%rax, -8(%rsp)
.L4:
	cmpl	%r12d, %ebx
	jge	.L3
	movslq	%r11d, %rax
	xorl	%edx, %edx
	salq	$2, %rax
	leaq	(%r10,%rax), %r15
	addq	%rdi, %rax
.L9:
	cmpl	%edx, %r8d
	jle	.L6
	leaq	0(%rbp,%rdx,4), %r14
	xorl	%esi, %esi
	xorl	%r13d, %r13d
.L7:
	cmpl	%esi, %r9d
	jle	.L12
	movl	(%rax,%rsi,4), %ecx
	imull	(%r14), %ecx
	incq	%rsi
	movslq	%ecx, %rcx
	addq	%rcx, %r13
	movq	-8(%rsp), %rcx
	addq	%rcx, %r14
	jmp	.L7
.L12:
	movl	%r13d, (%r15,%rdx,4)
	incq	%rdx
	jmp	.L9
.L6:
	incl	%ebx
	addl	%r9d, %r11d
	jmp	.L4
.L3:
	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
.LFE4819:
	.size	_Z25matrix_multiplication_cpuPiS_S_iii, .-_Z25matrix_multiplication_cpuPiS_S_iii
	.globl	_Z11init_resultPiii
	.type	_Z11init_resultPiii, @function
_Z11init_resultPiii:
.LFB4820:
	.cfi_startproc
	endbr64
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
.L14:
	cmpl	%esi, %r8d
	jge	.L13
	movslq	%ecx, %rax
	leaq	(%rdi,%rax,4), %r9
	xorl	%eax, %eax
.L17:
	cmpl	%eax, %edx
	jle	.L18
	xorl	%r10d, %r10d
	movl	%r10d, (%r9,%rax,4)
	incq	%rax
	jmp	.L17
.L18:
	incl	%r8d
	addl	%edx, %ecx
	jmp	.L14
.L13:
	ret
	.cfi_endproc
.LFE4820:
	.size	_Z11init_resultPiii, .-_Z11init_resultPiii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"  "
	.text
	.globl	_Z12print_matrixPiii
	.type	_Z12print_matrixPiii, @function
_Z12print_matrixPiii:
.LFB4822:
	.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
	movl	%esi, %r14d
	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
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%rdi, 8(%rsp)
.L20:
	cmpl	%r14d, %r13d
	jge	.L22
	movq	8(%rsp), %rcx
	movslq	%r12d, %rax
	xorl	%ebp, %ebp
	leaq	(%rcx,%rax,4), %r15
.L23:
	cmpl	%ebp, %ebx
	jle	.L25
	leaq	.LC0(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%r15,%rbp,4), %esi
	incq	%rbp
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	jmp	.L23
.L25:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	incl	%r13d
	addl	%ebx, %r12d
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L20
.L22:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	leaq	_ZSt4cout(%rip), %rdi
	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
	jmp	_ZNSolsEPFRSoS_E.isra.0
	.cfi_endproc
.LFE4822:
	.size	_Z12print_matrixPiii, .-_Z12print_matrixPiii
	.globl	_Z47__device_stub__Z20matrixMultiplicationPiS_S_iiiPiS_S_iii
	.type	_Z47__device_stub__Z20matrixMultiplicationPiS_S_iiiPiS_S_iii, @function
_Z47__device_stub__Z20matrixMultiplicationPiS_S_iiiPiS_S_iii:
.LFB4848:
	.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	.L26
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z20matrixMultiplicationPiS_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
.L26:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4848:
	.size	_Z47__device_stub__Z20matrixMultiplicationPiS_S_iiiPiS_S_iii, .-_Z47__device_stub__Z20matrixMultiplicationPiS_S_iiiPiS_S_iii
	.globl	_Z20matrixMultiplicationPiS_S_iii
	.type	_Z20matrixMultiplicationPiS_S_iii, @function
_Z20matrixMultiplicationPiS_S_iii:
.LFB4849:
	.cfi_startproc
	endbr64
	jmp	_Z47__device_stub__Z20matrixMultiplicationPiS_S_iiiPiS_S_iii
	.cfi_endproc
.LFE4849:
	.size	_Z20matrixMultiplicationPiS_S_iii, .-_Z20matrixMultiplicationPiS_S_iii
	.section	.rodata.str1.1
.LC1:
	.string	"_Z20matrixMultiplicationPiS_S_iii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4851:
	.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	.LC1(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z20matrixMultiplicationPiS_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
.LFE4851:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv,"axG",@progbits,_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv,comdat
	.align 2
	.weak	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv
	.type	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv, @function
_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv:
.LFB5557:
	.cfi_startproc
	endbr64
	movq	104(%rdi), %rdx
	movq	%rdx, %rax
	subq	$5, %rax
	jns	.L34
	leaq	7(%rdx), %rax
.L34:
	movq	(%rdi,%rax,8), %rax
	movq	96(%rdi), %rcx
	addq	(%rdi,%rdx,8), %rcx
	cmpq	%rcx, %rax
	jb	.L35
	subq	%rcx, %rax
	xorl	%ecx, %ecx
	jmp	.L36
.L35:
	movl	$1, %esi
	salq	$48, %rsi
	subq	%rcx, %rsi
	movl	$1, %ecx
	addq	%rsi, %rax
.L36:
	movq	%rcx, 96(%rdi)
	movq	%rax, (%rdi,%rdx,8)
	incq	%rdx
	cmpq	$11, %rdx
	jbe	.L37
	xorl	%edx, %edx
.L37:
	movq	%rdx, 104(%rdi)
	ret
	.cfi_endproc
.LFE5557:
	.size	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv, .-_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv
	.section	.text._ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv,"axG",@progbits,_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv,comdat
	.align 2
	.weak	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	.type	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv, @function
_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv:
.LFB5484:
	.cfi_startproc
	endbr64
	movq	112(%rdi), %rax
	cmpq	$10, %rax
	jbe	.L43
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	$389, %ebp
	subq	%rax, %rbp
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
.L40:
	testq	%rbp, %rbp
	je	.L47
	movq	%rdi, 8(%rsp)
	decq	%rbp
	call	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv
	movq	8(%rsp), %rdi
	jmp	.L40
.L47:
	xorl	%eax, %eax
	movq	%rax, 112(%rdi)
	incq	112(%rdi)
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	.L46
.L43:
	incq	112(%rdi)
.L46:
	jmp	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EEclEv
	.cfi_endproc
.LFE5484:
	.size	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv, .-_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	.text
	.align 2
	.type	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0, @function
_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0:
.LFB5603:
	.cfi_startproc
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%esi, %rax
	movslq	%edx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	subq	%rax, %r13
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rax, %rbp
	movabsq	$281474976710654, %rax
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	pushq	%rcx
	.cfi_def_cfa_offset 48
	cmpq	%r13, %rax
	jb	.L54
	incq	%r13
	incq	%rax
	xorl	%edx, %edx
	divq	%r13
	imulq	%rax, %r13
	movq	%rax, %rbx
.L50:
	movq	%r12, %rdi
	call	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	cmpq	%r13, %rax
	jnb	.L50
	xorl	%edx, %edx
	divq	%rbx
	jmp	.L51
.L58:
	testq	%rdx, %rdx
	je	.L51
.L54:
	movl	$65535, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0
	movq	%r12, %rdi
	movl	%eax, %ebx
	call	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	movq	%rbx, %rdx
	salq	$48, %rdx
	addq	%rdx, %rax
	setc	%dl
	movzbl	%dl, %edx
	cmpq	%rax, %r13
	jnb	.L58
	jmp	.L54
.L51:
	popq	%rdx
	.cfi_def_cfa_offset 40
	addl	%ebp, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5603:
	.size	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0, .-_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0
	.globl	_Z15random_in_rangeii
	.type	_Z15random_in_rangeii, @function
_Z15random_in_rangeii:
.LFB4818:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 32
	cmpb	$0, %fs:_ZGVZ15random_in_rangeiiE3rng@tpoff
	jne	.L60
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	$19780503, %edx
	testq	%rax, %rax
	je	.L61
	movl	$2147483563, %ecx
	xorl	%edx, %edx
	divq	%rcx
.L61:
	testl	%edx, %edx
	movl	$1, %eax
	movl	$53668, %edi
	movabsq	$281474976710655, %r8
	cmovne	%edx, %eax
	xorl	%esi, %esi
.L62:
	xorl	%edx, %edx
	divl	%edi
	imull	$40014, %edx, %edx
	imull	$12211, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%ecx, %edx
	jnb	.L66
	leal	2147483563(%rdx), %eax
	subl	%ecx, %eax
.L66:
	xorl	%edx, %edx
	movl	%eax, %r9d
	divl	%edi
	imull	$40014, %edx, %edx
	imull	$12211, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%ecx, %edx
	jnb	.L63
	leal	2147483563(%rdx), %eax
	subl	%ecx, %eax
.L63:
	movq	%rax, %rdx
	salq	$32, %rdx
	addq	%r9, %rdx
	andq	%r8, %rdx
	movq	%rdx, %fs:_ZZ15random_in_rangeiiE3rng@tpoff(,%rsi,8)
	incq	%rsi
	cmpq	$12, %rsi
	jne	.L62
	movb	$1, %fs:_ZGVZ15random_in_rangeiiE3rng@tpoff
	xorl	%eax, %eax
	cmpq	$0, %fs:88+_ZZ15random_in_rangeiiE3rng@tpoff
	sete	%al
	xorl	%edx, %edx
	movq	%rax, %fs:96+_ZZ15random_in_rangeiiE3rng@tpoff
	movq	%rdx, %fs:104+_ZZ15random_in_rangeiiE3rng@tpoff
	movq	%rdx, %fs:112+_ZZ15random_in_rangeiiE3rng@tpoff
.L60:
	movq	%fs:0, %rax
	movl	%ebp, %edx
	movl	%ebx, %esi
	leaq	_ZZ15random_in_rangeiiE3rng@tpoff(%rax), %rdi
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE.isra.0
	.cfi_endproc
.LFE4818:
	.size	_Z15random_in_rangeii, .-_Z15random_in_rangeii
	.globl	_Z11init_matrixPiii
	.type	_Z11init_matrixPiii, @function
_Z11init_matrixPiii:
.LFB4821:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%esi, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r14d, %r14d
	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
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L74:
	cmpl	%r15d, %r14d
	jge	.L73
	movslq	%r13d, %rax
	xorl	%ebx, %ebx
	leaq	(%r12,%rax,4), %rdx
.L77:
	cmpl	%ebx, %ebp
	jle	.L79
	movl	$30, %esi
	movl	$10, %edi
	movq	%rdx, 8(%rsp)
	call	_Z15random_in_rangeii
	movq	8(%rsp), %rdx
	movl	%eax, (%rdx,%rbx,4)
	incq	%rbx
	jmp	.L77
.L79:
	incl	%r14d
	addl	%ebp, %r13d
	jmp	.L74
.L73:
	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
.LFE4821:
	.size	_Z11init_matrixPiii, .-_Z11init_matrixPiii
	.section	.rodata.str1.1
.LC2:
	.string	"First matrix : "
.LC3:
	.string	"Second matrix : "
.LC4:
	.string	"GPU Elapsed time is: "
.LC5:
	.string	" milliseconds"
.LC6:
	.string	"GPU Result : "
.LC7:
	.string	"CPU Elapsed time is: "
.LC8:
	.string	"CPU Result : "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4823:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$3600, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	_ZSt4cout(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	_Znam@PLT
	movl	$3600, %edi
	movq	%rax, %r12
	call	_Znam@PLT
	movl	$3600, %edi
	movq	%rax, %rbp
	call	_Znam@PLT
	movl	$30, %edx
	movl	$30, %esi
	movq	%r12, %rdi
	movq	%rax, %rbx
	call	_Z11init_matrixPiii
	movl	$30, %edx
	movl	$30, %esi
	movq	%rbp, %rdi
	call	_Z11init_matrixPiii
	movl	$30, %edx
	movl	$30, %esi
	movq	%rbx, %rdi
	call	_Z11init_resultPiii
	leaq	.LC2(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$30, %edx
	movl	$30, %esi
	movq	%r12, %rdi
	call	_Z12print_matrixPiii
	leaq	.LC3(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$30, %edx
	movl	$30, %esi
	movq	%rbp, %rdi
	call	_Z12print_matrixPiii
	leaq	8(%rsp), %rdi
	movl	$3600, %esi
	call	cudaMalloc@PLT
	leaq	16(%rsp), %rdi
	movl	$3600, %esi
	call	cudaMalloc@PLT
	leaq	24(%rsp), %rdi
	movl	$3600, %esi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	movq	%r12, %rsi
	movl	$3600, %edx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbp, %rsi
	movl	$3600, %edx
	call	cudaMemcpy@PLT
	leaq	32(%rsp), %rdi
	movabsq	$4294967297, %rax
	movl	$1, 56(%rsp)
	movq	%rax, 48(%rsp)
	movabsq	$128849018910, %rax
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	cudaEventCreate@PLT
	leaq	40(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	68(%rsp), %ecx
	movl	56(%rsp), %esi
	xorl	%r9d, %r9d
	movq	60(%rsp), %rdx
	movq	48(%rsp), %rdi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L81
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movl	$30, %r9d
	movl	$30, %r8d
	movq	8(%rsp), %rdi
	movl	$30, %ecx
	call	_Z47__device_stub__Z20matrixMultiplicationPiS_S_iiiPiS_S_iii
.L81:
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	leaq	4(%rsp), %r15
	leaq	.LC5(%rip), %r14
	call	cudaEventRecord@PLT
	movq	40(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	movq	%r15, %rdi
	call	cudaEventElapsedTime@PLT
	movq	32(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movq	40(%rsp), %rdi
	call	cudaEventDestroy@PLT
	leaq	.LC4(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	4(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdi
	movl	$3600, %edx
	call	cudaMemcpy@PLT
	leaq	.LC6(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$30, %edx
	movl	$30, %esi
	movq	%rbx, %rdi
	call	_Z12print_matrixPiii
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%r13, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	32(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	40(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$30, %ecx
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	movl	$30, %r9d
	movl	$30, %r8d
	movq	%r12, %rdi
	call	_Z25matrix_multiplication_cpuPiS_S_iii
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	40(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	movq	%r15, %rdi
	call	cudaEventElapsedTime@PLT
	movq	32(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movq	40(%rsp), %rdi
	call	cudaEventDestroy@PLT
	leaq	.LC7(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	4(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC8(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$30, %edx
	movl	$30, %esi
	movq	%rbx, %rdi
	call	_Z12print_matrixPiii
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	%r12, %rdi
	call	_ZdaPv@PLT
	movq	%rbp, %rdi
	call	_ZdaPv@PLT
	movq	%rbx, %rdi
	call	_ZdaPv@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L82
	call	__stack_chk_fail@PLT
.L82:
	addq	$88, %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
.LFE4823:
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.tbss,"awT",@nobits
	.align 8
	.type	_ZGVZ15random_in_rangeiiE3rng, @object
	.size	_ZGVZ15random_in_rangeiiE3rng, 8
_ZGVZ15random_in_rangeiiE3rng:
	.zero	8
	.align 8
	.type	_ZZ15random_in_rangeiiE3rng, @object
	.size	_ZZ15random_in_rangeiiE3rng, 120
_ZZ15random_in_rangeiiE3rng:
	.zero	120
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <iostream>
#include <hip/hip_runtime.h>
#include <chrono>
#include <random>
using namespace std;


int random_in_range( int minimum, int maximum )
{
  thread_local std::ranlux48 rng( 
    std::chrono::system_clock::now().time_since_epoch().count() );
  return std::uniform_int_distribution <int> ( minimum, maximum )( rng );
}

__global__
void matrixMultiplication(int *a, int *b, int *c, int m, int n, int k)
{
    int row = blockIdx.y*blockDim.y + threadIdx.y;
    int col = blockIdx.x*blockDim.x + threadIdx.x;
    int sum=0;
   
    if(col<k && row<m) {
      for(int j=0;j<n;j++)
      {
          sum += a[row*n+j] * b[j*k+col];
      }
      c[k*row+col]=sum;
    }
    
}

void matrix_multiplication_cpu(int *a, int *b, int *c, int m, int n, int k) {
    for(int i = 0 ; i < m ; i++) {
        for(int j = 0 ; j < n ; j++) {
            long result = 0;
            for(int p = 0 ; p < k ; p++) {
                result=result+a[i*k+p]*b[p*k+j]; 
            }
            c[k*i+j] = result;
        }
    }
}

void init_result(int *a, int m, int k) {
    for(int i=0; i<m; i++) {
      for(int j=0; j<k; j++) {
        a[i*k + j] = 0;
      }
    }
}

void init_matrix(int *a, int n, int m) {
    for(int i=0; i<n; i++) {
      for(int j=0; j<m; j++) {
        a[i*m + j] = random_in_range(10,30);
      }
    }
}

void print_matrix(int *a, int n, int m) {
    for(int i=0; i<n; i++) {
      for(int j=0; j<m; j++) {
        cout<<"  "<<a[i*m + j];
      }
      cout<<endl;
    }
    cout<<endl;
}

int main()
{
    
    int *a,*b,*c;
    int *a_dev,*b_dev,*c_dev;
    int m=30, n=30, k=30;
    
    a = new int[m*n];
    b = new int[n*k];
    c = new int[m*k];
    
    init_matrix(a, m, n);
    init_matrix(b, n ,k);
    init_result(c, m, k);
    
    cout<<"First matrix : "<<endl;
    print_matrix(a, m, n);
    cout<<"Second matrix : "<<endl;
    print_matrix(b, n, k);
    
    hipMalloc(&a_dev, sizeof(int)*m*n);
    hipMalloc(&b_dev, sizeof(int)*n*k);
    hipMalloc(&c_dev, sizeof(int)*m*k);
       
    hipMemcpy(a_dev, a, sizeof(int)*m*n, hipMemcpyHostToDevice);
    hipMemcpy(b_dev, b, sizeof(int)*n*k, hipMemcpyHostToDevice);
    
    dim3 dimGrid(1,1);
    dim3 dimBlock(n,n);
    
    float gpu_elapsed_time;
    hipEvent_t gpu_start,gpu_stop;
    hipEventCreate(&gpu_start);
    hipEventCreate(&gpu_stop);
    hipEventRecord(gpu_start,0);
    matrixMultiplication<<<dimGrid, dimBlock>>>(a_dev,b_dev,c_dev, m, n, k);
    hipEventRecord(gpu_stop, 0);
    hipEventSynchronize(gpu_stop);
    hipEventElapsedTime(&gpu_elapsed_time, gpu_start, gpu_stop);
    hipEventDestroy(gpu_start);
    hipEventDestroy(gpu_stop);
    cout<<"GPU Elapsed time is: "<<gpu_elapsed_time<<" milliseconds"<<endl;
    
    hipMemcpy(c, c_dev, sizeof(int)*m*k, hipMemcpyDeviceToHost);
    
    cout<<"GPU Result : "<<endl;
    print_matrix(c, m, k);
    cout<<endl;

    hipEventCreate(&gpu_start);
    hipEventCreate(&gpu_stop);
    hipEventRecord(gpu_start,0);
    matrix_multiplication_cpu(a, b, c, m, n, k);
    hipEventRecord(gpu_stop, 0);
    hipEventSynchronize(gpu_stop);
    hipEventElapsedTime(&gpu_elapsed_time, gpu_start, gpu_stop);
    hipEventDestroy(gpu_start);
    hipEventDestroy(gpu_stop);
    cout<<"CPU Elapsed time is: "<<gpu_elapsed_time<<" milliseconds"<<endl;
 
    cout<<"CPU Result : "<<endl;
    print_matrix(c, m, k);
    
    hipFree(a_dev);
    hipFree(b_dev);
    hipFree(c_dev);
    
    delete[] a;
    delete[] b;
    delete[] c;
    
    return 0;
}
	.text
	.file	"part3.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z15random_in_rangeii           # -- Begin function _Z15random_in_rangeii
	.type	_Z15random_in_rangeii,@function
_Z15random_in_rangeii:                  # @_Z15random_in_rangeii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebx
	movl	%edi, %ebp
	cmpb	$0, %fs:_ZGVZ15random_in_rangeiiE3rng@TPOFF
	je	.LBB0_1
.LBB0_2:
	movq	%rsp, %rdi
	movl	%ebp, (%rdi)
	movl	%ebx, 4(%rdi)
	movq	%fs:0, %rax
	leaq	_ZZ15random_in_rangeiiE3rng@TPOFF(%rax), %rsi
	movq	%rdi, %rdx
	callq	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB0_1:
	.cfi_def_cfa_offset 32
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%fs:0, %rcx
	leaq	_ZZ15random_in_rangeiiE3rng@TPOFF(%rcx), %rdi
	movq	%rax, %rsi
	callq	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm
	movq	$0, %fs:_ZZ15random_in_rangeiiE3rng@TPOFF+112
	movb	$1, %fs:_ZGVZ15random_in_rangeiiE3rng@TPOFF
	jmp	.LBB0_2
.Lfunc_end0:
	.size	_Z15random_in_rangeii, .Lfunc_end0-_Z15random_in_rangeii
	.cfi_endproc
                                        # -- End function
	.globl	_Z35__device_stub__matrixMultiplicationPiS_S_iii # -- Begin function _Z35__device_stub__matrixMultiplicationPiS_S_iii
	.type	_Z35__device_stub__matrixMultiplicationPiS_S_iii,@function
_Z35__device_stub__matrixMultiplicationPiS_S_iii: # @_Z35__device_stub__matrixMultiplicationPiS_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	$_Z20matrixMultiplicationPiS_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_end1:
	.size	_Z35__device_stub__matrixMultiplicationPiS_S_iii, .Lfunc_end1-_Z35__device_stub__matrixMultiplicationPiS_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z25matrix_multiplication_cpuPiS_S_iii # -- Begin function _Z25matrix_multiplication_cpuPiS_S_iii
	.type	_Z25matrix_multiplication_cpuPiS_S_iii,@function
_Z25matrix_multiplication_cpuPiS_S_iii: # @_Z25matrix_multiplication_cpuPiS_S_iii
	.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
	.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	%r8d, -36(%rsp)                 # 4-byte Spill
	movq	%rdx, -8(%rsp)                  # 8-byte Spill
	movq	%rsi, -16(%rsp)                 # 8-byte Spill
	movq	%rdi, -24(%rsp)                 # 8-byte Spill
	testl	%ecx, %ecx
	jle	.LBB2_7
# %bb.1:                                # %.preheader26.lr.ph
	movslq	%r9d, %rax
	movl	%ecx, %r8d
	movl	-36(%rsp), %r10d                # 4-byte Reload
	movl	%eax, %r11d
	movq	%rax, -32(%rsp)                 # 8-byte Spill
	leaq	(,%rax,4), %rbx
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
.LBB2_2:                                # %.preheader26
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_4 Depth 2
                                        #       Child Loop BB2_9 Depth 3
	cmpl	$0, -36(%rsp)                   # 4-byte Folded Reload
	jle	.LBB2_6
# %bb.3:                                # %.preheader.lr.ph
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	%r14d, %eax
	movq	-24(%rsp), %rcx                 # 8-byte Reload
	leaq	(%rcx,%rax,4), %r12
	movq	%r15, %rax
	imulq	-32(%rsp), %rax                 # 8-byte Folded Reload
	movq	-8(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %r13
	movq	-16(%rsp), %rdi                 # 8-byte Reload
	xorl	%eax, %eax
.LBB2_4:                                # %.preheader
                                        #   Parent Loop BB2_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_9 Depth 3
	testl	%r9d, %r9d
	jle	.LBB2_5
# %bb.8:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB2_4 Depth=2
	xorl	%esi, %esi
	movq	%rdi, %rbp
	xorl	%edx, %edx
.LBB2_9:                                # %.lr.ph
                                        #   Parent Loop BB2_2 Depth=1
                                        #     Parent Loop BB2_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rbp), %ecx
	imull	(%r12,%rsi,4), %ecx
	addl	%ecx, %edx
	incq	%rsi
	addq	%rbx, %rbp
	cmpq	%rsi, %r11
	jne	.LBB2_9
	jmp	.LBB2_10
.LBB2_5:                                #   in Loop: Header=BB2_4 Depth=2
	xorl	%edx, %edx
.LBB2_10:                               # %._crit_edge
                                        #   in Loop: Header=BB2_4 Depth=2
	movl	%edx, (%r13,%rax,4)
	incq	%rax
	addq	$4, %rdi
	cmpq	%r10, %rax
	jne	.LBB2_4
.LBB2_6:                                # %._crit_edge30
                                        #   in Loop: Header=BB2_2 Depth=1
	incq	%r15
	addl	%r9d, %r14d
	cmpq	%r8, %r15
	jne	.LBB2_2
.LBB2_7:                                # %._crit_edge32
	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	_Z25matrix_multiplication_cpuPiS_S_iii, .Lfunc_end2-_Z25matrix_multiplication_cpuPiS_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z11init_resultPiii             # -- Begin function _Z11init_resultPiii
	.type	_Z11init_resultPiii,@function
_Z11init_resultPiii:                    # @_Z11init_resultPiii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB3_6
# %bb.1:                                # %.preheader.lr.ph
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.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 %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebx
	movq	%rdi, %r14
	movl	%edx, %r15d
	shlq	$2, %r15
	movl	%esi, %r12d
	xorl	%ebp, %ebp
.LBB3_2:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	testl	%ebx, %ebx
	jle	.LBB3_4
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	%ebp, %eax
	leaq	(%r14,%rax,4), %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	memset@PLT
.LBB3_4:                                # %._crit_edge
                                        #   in Loop: Header=BB3_2 Depth=1
	addl	%ebx, %ebp
	decq	%r12
	jne	.LBB3_2
# %bb.5:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB3_6:                                # %._crit_edge13
	retq
.Lfunc_end3:
	.size	_Z11init_resultPiii, .Lfunc_end3-_Z11init_resultPiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z11init_matrixPiii             # -- Begin function _Z11init_matrixPiii
	.type	_Z11init_matrixPiii,@function
_Z11init_matrixPiii:                    # @_Z11init_matrixPiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB4_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%edx, %r12d
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
.LBB4_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB4_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB4_2 Depth=1
	movl	%r13d, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r15d, %r15d
.LBB4_4:                                #   Parent Loop BB4_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$10, %edi
	movl	$30, %esi
	callq	_Z15random_in_rangeii
	movl	%eax, (%r14,%r15,4)
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB4_4
.LBB4_5:                                # %._crit_edge
                                        #   in Loop: Header=BB4_2 Depth=1
	incq	%rbp
	addl	%ebx, %r13d
	cmpq	16(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB4_2
.LBB4_6:                                # %._crit_edge13
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z11init_matrixPiii, .Lfunc_end4-_Z11init_matrixPiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z12print_matrixPiii            # -- Begin function _Z12print_matrixPiii
	.type	_Z12print_matrixPiii,@function
_Z12print_matrixPiii:                   # @_Z12print_matrixPiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB5_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%edx, %r12d
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
.LBB5_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB5_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB5_2 Depth=1
	movl	%r13d, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r15d, %r15d
.LBB5_4:                                #   Parent Loop BB5_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$2, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	(%r14,%r15,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB5_4
.LBB5_5:                                # %._crit_edge
                                        #   in Loop: Header=BB5_2 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%rbp
	addl	%ebx, %r13d
	cmpq	16(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB5_2
.LBB5_6:                                # %._crit_edge13
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	_ZNSo5flushEv                   # TAILCALL
.Lfunc_end5:
	.size	_Z12print_matrixPiii, .Lfunc_end5-_Z12print_matrixPiii
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$3600, %edi                     # imm = 0xE10
	callq	_Znam
	movq	%rax, %rbp
	movl	$3600, %edi                     # imm = 0xE10
	callq	_Znam
	movq	%rax, %r14
	movl	$3600, %edi                     # imm = 0xE10
	callq	_Znam
	movq	%rax, %r15
	xorl	%ebx, %ebx
	movq	%rbp, %r12
.LBB6_1:                                # %.preheader.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_2 Depth 2
	xorl	%r13d, %r13d
.LBB6_2:                                #   Parent Loop BB6_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$10, %edi
	movl	$30, %esi
	callq	_Z15random_in_rangeii
	movl	%eax, (%r12,%r13,4)
	incq	%r13
	cmpq	$30, %r13
	jne	.LBB6_2
# %bb.3:                                # %._crit_edge.i
                                        #   in Loop: Header=BB6_1 Depth=1
	incq	%rbx
	addq	$120, %r12
	cmpq	$30, %rbx
	jne	.LBB6_1
# %bb.4:                                # %.preheader.i61.preheader
	xorl	%ebx, %ebx
	movq	%r14, %r12
.LBB6_5:                                # %.preheader.i61
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_6 Depth 2
	xorl	%r13d, %r13d
.LBB6_6:                                #   Parent Loop BB6_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$10, %edi
	movl	$30, %esi
	callq	_Z15random_in_rangeii
	movl	%eax, (%r12,%r13,4)
	incq	%r13
	cmpq	$30, %r13
	jne	.LBB6_6
# %bb.7:                                # %._crit_edge.i68
                                        #   in Loop: Header=BB6_5 Depth=1
	incq	%rbx
	addq	$120, %r12
	cmpq	$30, %rbx
	jne	.LBB6_5
# %bb.8:                                # %.preheader.i72.preheader
	movl	$3600, %edx                     # imm = 0xE10
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%rbp, %rdi
	movl	$30, %esi
	movl	$30, %edx
	callq	_Z12print_matrixPiii
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%r14, %rdi
	movl	$30, %esi
	movl	$30, %edx
	callq	_Z12print_matrixPiii
	leaq	40(%rsp), %r12
	movl	$3600, %esi                     # imm = 0xE10
	movq	%r12, %rdi
	callq	hipMalloc
	leaq	32(%rsp), %r13
	movl	$3600, %esi                     # imm = 0xE10
	movq	%r13, %rdi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movl	$3600, %esi                     # imm = 0xE10
	callq	hipMalloc
	movq	(%r12), %rdi
	movl	$3600, %edx                     # imm = 0xE10
	movq	%rbp, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r13), %rdi
	movl	$3600, %edx                     # imm = 0xE10
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	8(%rsp), %r12
	movq	%r12, %rdi
	callq	hipEventCreate
	movq	%rsp, %rdi
	callq	hipEventCreate
	movq	(%r12), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movabsq	$128849018910, %rdx             # imm = 0x1E0000001E
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	movq	%rbp, 48(%rsp)                  # 8-byte Spill
	jne	.LBB6_10
# %bb.9:
	movq	40(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	16(%rsp), %rdx
	movl	$30, %ecx
	movl	$30, %r8d
	movl	$30, %r9d
	callq	_Z35__device_stub__matrixMultiplicationPiS_S_iii
.LBB6_10:
	movq	%rsp, %r12
	movq	(%r12), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%r12), %rdi
	callq	hipEventSynchronize
	leaq	8(%rsp), %r13
	movq	(%r13), %rsi
	movq	(%r12), %rdx
	leaq	28(%rsp), %rbp
	movq	%rbp, %rdi
	callq	hipEventElapsedTime
	movq	(%r13), %rdi
	callq	hipEventDestroy
	movq	(%r12), %rdi
	callq	hipEventDestroy
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cvtss2sd	(%rbp), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbp
	movl	$.L.str.4, %esi
	movl	$13, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbp), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbp, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	16(%rsp), %rsi
	movl	$3600, %edx                     # imm = 0xE10
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$13, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %ebp
	addq	%rbp, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%r15, %rdi
	movl	$30, %esi
	movl	$30, %edx
	callq	_Z12print_matrixPiii
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%r13, %rdi
	callq	hipEventCreate
	movq	%r12, %rdi
	callq	hipEventCreate
	movq	(%r13), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	48(%rsp), %r13                  # 8-byte Reload
	movq	%r13, %rax
.LBB6_11:                               # %.preheader26.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_12 Depth 2
                                        #       Child Loop BB6_13 Depth 3
	imulq	$120, %rbx, %rcx
	addq	%r15, %rcx
	movq	%r14, %rdx
	xorl	%esi, %esi
.LBB6_12:                               # %.preheader.i78
                                        #   Parent Loop BB6_11 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB6_13 Depth 3
	xorl	%edi, %edi
	movq	%rdx, %r8
	xorl	%r9d, %r9d
.LBB6_13:                               # %.lr.ph.i
                                        #   Parent Loop BB6_11 Depth=1
                                        #     Parent Loop BB6_12 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%r8), %r10d
	imull	(%rax,%rdi,4), %r10d
	addl	%r10d, %r9d
	incq	%rdi
	addq	$120, %r8
	cmpq	$30, %rdi
	jne	.LBB6_13
# %bb.14:                               # %._crit_edge.i83
                                        #   in Loop: Header=BB6_12 Depth=2
	movl	%r9d, (%rcx,%rsi,4)
	incq	%rsi
	addq	$4, %rdx
	cmpq	$30, %rsi
	jne	.LBB6_12
# %bb.15:                               # %._crit_edge30.i
                                        #   in Loop: Header=BB6_11 Depth=1
	incq	%rbx
	addq	$120, %rax
	cmpq	$30, %rbx
	jne	.LBB6_11
# %bb.16:                               # %_Z25matrix_multiplication_cpuPiS_S_iii.exit
	movq	(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	(%rsp), %rdi
	callq	hipEventSynchronize
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
	leaq	28(%rsp), %r12
	movq	%r12, %rdi
	callq	hipEventElapsedTime
	movq	8(%rsp), %rdi
	callq	hipEventDestroy
	movq	(%rsp), %rdi
	callq	hipEventDestroy
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cvtss2sd	(%r12), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r12
	movl	$.L.str.4, %esi
	movl	$13, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r12), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$13, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%r15, %rdi
	movl	$30, %esi
	movl	$30, %edx
	callq	_Z12print_matrixPiii
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	%r13, %rdi
	callq	_ZdaPv
	movq	%r14, %rdi
	callq	_ZdaPv
	movq	%r15, %rdi
	callq	_ZdaPv
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	main, .Lfunc_end6-main
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm,"axG",@progbits,_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm,comdat
	.weak	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm # -- Begin function _ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm
	.p2align	1, 0x90
	.type	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm,@function
_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm: # @_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm
	.cfi_startproc
# %bb.0:
	movabsq	$730144469221, %rcx             # imm = 0xAA000070E5
	movq	%rsi, %rax
	mulq	%rcx
	movq	%rsi, %rax
	subq	%rdx, %rax
	shrq	%rax
	addq	%rdx, %rax
	shrq	$30, %rax
	imull	$2147483563, %eax, %eax         # imm = 0x7FFFFFAB
	movl	%esi, %edx
	subl	%eax, %edx
	cmpl	$1, %edx
	adcl	$0, %edx
	testq	%rsi, %rsi
	movl	$19780503, %ecx                 # imm = 0x12DD397
	cmovnel	%edx, %ecx
	xorl	%eax, %eax
	movabsq	$281474976710655, %rdx          # imm = 0xFFFFFFFFFFFF
.LBB7_1:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_2 Depth 2
	movl	$1, %esi
	movb	$1, %r9b
	xorl	%r8d, %r8d
.LBB7_2:                                #   Parent Loop BB7_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%ecx, %r10d
	shrl	$2, %r10d
	imulq	$327796565, %r10, %r10          # imm = 0x1389C755
	shrq	$42, %r10
	imull	$53668, %r10d, %r11d            # imm = 0xD1A4
	subl	%r11d, %ecx
	imull	$40014, %ecx, %r11d             # imm = 0x9C4E
	imull	$12211, %r10d, %ecx             # imm = 0x2FB3
	subl	%ecx, %r11d
	leal	2147483563(%r11), %ecx
	cmovael	%r11d, %ecx
	movq	%rcx, %r10
	imulq	%rsi, %r10
	addq	%r10, %r8
	shlq	$32, %rsi
	testb	$1, %r9b
	movl	$0, %r9d
	jne	.LBB7_2
# %bb.3:                                #   in Loop: Header=BB7_1 Depth=1
	andq	%rdx, %r8
	movq	%r8, (%rdi,%rax,8)
	incq	%rax
	cmpq	$12, %rax
	jne	.LBB7_1
# %bb.4:
	xorl	%eax, %eax
	cmpq	$0, 88(%rdi)
	sete	%al
	movq	%rax, 96(%rdi)
	movq	$0, 104(%rdi)
	retq
.Lfunc_end7:
	.size	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm, .Lfunc_end7-_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE4seedEm
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE,"axG",@progbits,_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE,comdat
	.weak	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE # -- Begin function _ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE
	.p2align	1, 0x90
	.type	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE,@function
_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE: # @_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r14
	movslq	4(%rdx), %rbp
	movq	%rdx, 8(%rsp)                   # 8-byte Spill
	movslq	(%rdx), %rax
	subq	%rax, %rbp
	movabsq	$281474976710655, %rax          # imm = 0xFFFFFFFFFFFF
	cmpq	%rax, %rbp
	jae	.LBB8_1
# %bb.4:
	incq	%rbp
	xorl	%edx, %edx
	divq	%rbp
	movq	%rax, %r15
	imulq	%rax, %rbp
.LBB8_5:                                # =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	cmpq	%rbp, %rax
	jae	.LBB8_5
# %bb.6:
	xorl	%edx, %edx
	divq	%r15
	jmp	.LBB8_7
.LBB8_1:
	movq	%rdi, %r15
	movabsq	$281470681743360, %rbx          # imm = 0xFFFF00000000
	leaq	16(%rsp), %r12
.LBB8_2:                                # =>This Inner Loop Header: Depth=1
	movq	%rbx, 16(%rsp)
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE
	movl	%eax, %r13d
	shlq	$48, %r13
	movq	%r14, %rdi
	callq	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	addq	%r13, %rax
	setb	%cl
	cmpq	%rbp, %rax
	ja	.LBB8_2
# %bb.3:                                #   in Loop: Header=BB8_2 Depth=1
	testb	%cl, %cl
	jne	.LBB8_2
.LBB8_7:                                # %.loopexit
	movq	8(%rsp), %rcx                   # 8-byte Reload
	addl	(%rcx), %eax
                                        # kill: def $eax killed $eax killed $rax
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE, .Lfunc_end8-_ZNSt24uniform_int_distributionIiEclISt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEEEiRT_RKNS0_10param_typeE
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv,"axG",@progbits,_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv,comdat
	.weak	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv # -- Begin function _ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	.p2align	1, 0x90
	.type	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv,@function
_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv: # @_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	112(%rdi), %rax
	cmpq	$11, %rax
	jb	.LBB9_2
# %bb.1:
	movl	$389, %esi                      # imm = 0x185
	subq	%rax, %rsi
	movq	%rbx, %rdi
	callq	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy
	xorl	%eax, %eax
.LBB9_2:
	incq	%rax
	movq	%rax, 112(%rbx)
	movq	96(%rbx), %rcx
	movq	104(%rbx), %rdx
	leaq	-5(%rdx), %rax
	leaq	7(%rdx), %rsi
	testq	%rax, %rax
	cmovnsq	%rax, %rsi
	movq	(%rbx,%rsi,8), %rsi
	addq	(%rbx,%rdx,8), %rcx
	movabsq	$281474976710656, %rax          # imm = 0x1000000000000
	addq	%rsi, %rax
	xorl	%edi, %edi
	cmpq	%rcx, %rsi
	cmovaeq	%rsi, %rax
	setb	%dil
	subq	%rcx, %rax
	movq	%rdi, 96(%rbx)
	movq	%rax, (%rbx,%rdx,8)
	movq	104(%rbx), %rcx
	incq	%rcx
	xorl	%edx, %edx
	cmpq	$12, %rcx
	cmovbq	%rcx, %rdx
	movq	%rdx, 104(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv, .Lfunc_end9-_ZNSt20discard_block_engineISt26subtract_with_carry_engineImLm48ELm5ELm12EELm389ELm11EEclEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy,"axG",@progbits,_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy,comdat
	.weak	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy # -- Begin function _ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy
	.p2align	1, 0x90
	.type	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy,@function
_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy: # @_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy
	.cfi_startproc
# %bb.0:
	testq	%rsi, %rsi
	je	.LBB10_3
# %bb.1:                                # %.lr.ph
	movq	104(%rdi), %rcx
	movabsq	$281474976710656, %rax          # imm = 0x1000000000000
	xorl	%edx, %edx
.LBB10_2:                               # =>This Inner Loop Header: Depth=1
	leaq	-5(%rcx), %r8
	leaq	7(%rcx), %r9
	testq	%r8, %r8
	cmovnsq	%r8, %r9
	movq	(%rdi,%r9,8), %r8
	movq	96(%rdi), %r9
	addq	(%rdi,%rcx,8), %r9
	leaq	(%r8,%rax), %r10
	xorl	%r11d, %r11d
	cmpq	%r9, %r8
	setb	%r11b
	cmovaeq	%r8, %r10
	subq	%r9, %r10
	movq	%r11, 96(%rdi)
	movq	%r10, (%rdi,%rcx,8)
	movq	104(%rdi), %rcx
	incq	%rcx
	cmpq	$12, %rcx
	cmovaeq	%rdx, %rcx
	movq	%rcx, 104(%rdi)
	decq	%rsi
	jne	.LBB10_2
.LBB10_3:                               # %._crit_edge
	retq
.Lfunc_end10:
	.size	_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy, .Lfunc_end10-_ZNSt26subtract_with_carry_engineImLm48ELm5ELm12EE7discardEy
	.cfi_endproc
                                        # -- End function
	.text
	.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	.LBB11_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB11_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z20matrixMultiplicationPiS_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_end11:
	.size	__hip_module_ctor, .Lfunc_end11-__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	.LBB12_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
.LBB12_2:
	retq
.Lfunc_end12:
	.size	__hip_module_dtor, .Lfunc_end12-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_ZZ15random_in_rangeiiE3rng,@object # @_ZZ15random_in_rangeiiE3rng
	.section	.tbss,"awT",@nobits
	.p2align	3, 0x0
_ZZ15random_in_rangeiiE3rng:
	.zero	120
	.size	_ZZ15random_in_rangeiiE3rng, 120

	.type	_ZGVZ15random_in_rangeiiE3rng,@object # @_ZGVZ15random_in_rangeiiE3rng
_ZGVZ15random_in_rangeiiE3rng:
	.byte	0                               # 0x0
	.size	_ZGVZ15random_in_rangeiiE3rng, 1

	.type	_Z20matrixMultiplicationPiS_S_iii,@object # @_Z20matrixMultiplicationPiS_S_iii
	.section	.rodata,"a",@progbits
	.globl	_Z20matrixMultiplicationPiS_S_iii
	.p2align	3, 0x0
_Z20matrixMultiplicationPiS_S_iii:
	.quad	_Z35__device_stub__matrixMultiplicationPiS_S_iii
	.size	_Z20matrixMultiplicationPiS_S_iii, 8

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

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"First matrix : "
	.size	.L.str.1, 16

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Second matrix : "
	.size	.L.str.2, 17

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"GPU Elapsed time is: "
	.size	.L.str.3, 22

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	" milliseconds"
	.size	.L.str.4, 14

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"GPU Result : "
	.size	.L.str.5, 14

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"CPU Elapsed time is: "
	.size	.L.str.6, 22

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"CPU Result : "
	.size	.L.str.7, 14

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z20matrixMultiplicationPiS_S_iii"
	.size	.L__unnamed_1, 34

	.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 _Z35__device_stub__matrixMultiplicationPiS_S_iii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z20matrixMultiplicationPiS_S_iii
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z20matrixMultiplicationPiS_S_iii ; -- Begin function _Z20matrixMultiplicationPiS_S_iii
	.globl	_Z20matrixMultiplicationPiS_S_iii
	.p2align	8
	.type	_Z20matrixMultiplicationPiS_S_iii,@function
_Z20matrixMultiplicationPiS_S_iii:      ; @_Z20matrixMultiplicationPiS_S_iii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b128 s[4:7], s[0:1], 0x18
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v3, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_mad_u64_u32 v[1:2], null, s15, s3, v[3:4]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, s6, v0
	v_cmp_gt_i32_e64 s2, s4, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, vcc_lo
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_6
; %bb.1:                                ; %.preheader
	s_clause 0x1
	s_load_b128 s[8:11], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	s_cmp_lt_i32 s5, 1
	s_cbranch_scc1 .LBB0_4
; %bb.2:                                ; %.lr.ph
	v_mul_lo_u32 v2, v1, s5
	v_mov_b32_e32 v5, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[3:4], 2, v[2:3]
	v_mov_b32_e32 v2, 0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v3, vcc_lo, s8, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s9, v4, vcc_lo
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_ashrrev_i32_e32 v6, 31, v5
	s_add_i32 s5, s5, -1
	s_cmp_eq_u32 s5, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[6:7], 2, v[5:6]
	v_add_co_u32 v6, vcc_lo, s10, v6
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, s11, v7, vcc_lo
	global_load_b32 v8, v[3:4], off
	global_load_b32 v9, v[6:7], off
	s_waitcnt vmcnt(0)
	v_mad_u64_u32 v[6:7], null, v9, v8, v[2:3]
	v_add_co_u32 v3, vcc_lo, v3, 4
	v_add_co_ci_u32_e32 v4, vcc_lo, 0, v4, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_dual_mov_b32 v2, v6 :: v_dual_add_nc_u32 v5, s6, v5
	s_cbranch_scc0 .LBB0_3
	s_branch .LBB0_5
.LBB0_4:
	v_mov_b32_e32 v2, 0
.LBB0_5:                                ; %Flow54
	v_mad_u64_u32 v[3:4], null, v1, s6, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[0:1], 2, v[3:4]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v2, off
.LBB0_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z20matrixMultiplicationPiS_S_iii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.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 10
		.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	_Z20matrixMultiplicationPiS_S_iii, .Lfunc_end0-_Z20matrixMultiplicationPiS_S_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 356
; NumSgprs: 18
; NumVgprs: 10
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 10
; 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
      - .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
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z20matrixMultiplicationPiS_S_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z20matrixMultiplicationPiS_S_iii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     10
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
