#include <stdexcept>
#include <algorithm>
#include <cuda_runtime.h>
#include <iostream>
#include <vector>
#include <stdlib.h>
#include <time.h>

template <class T>
class dev_array
{
// public functions
public:
    explicit dev_array()
        : start_(0),
          end_(0)
    {}

    // constructor
    explicit dev_array(size_t size)
    {
        allocate(size);
    }
    // destructor
    ~dev_array()
    {
        free();
    }

    // resize the vector
    void resize(size_t size)
    {
        free();
        allocate(size);
    }

    // get the size of the array
    size_t getSize() const
    {
        return end_ - start_;
    }

    // get data
    const T* getData() const
    {
        return start_;
    }

    T* getData()
    {
        return start_;
    }

    // set
    void set(const T* src, size_t size)
    {
        size_t min = std::min(size, getSize());
        cudaError_t result = cudaMemcpy(start_, src, min * sizeof(T), cudaMemcpyHostToDevice);
        if (result != cudaSuccess)
        {
            throw std::runtime_error("failed to copy to device memory");
        }
    }
    // get
    void get(T* dest, size_t size)
    {
        size_t min = std::min(size, getSize());
        cudaError_t result = cudaMemcpy(dest, start_, min * sizeof(T), cudaMemcpyDeviceToHost);
        if (result != cudaSuccess)
        {
            throw std::runtime_error("failed to copy to host memory");
        }
    }


// private functions
private:
    // allocate memory on the device
    void allocate(size_t size)
    {
        cudaError_t result = cudaMalloc((void**)&start_, size * sizeof(T));
        if (result != cudaSuccess)
        {
            start_ = end_ = 0;
            throw std::runtime_error("failed to allocate device memory");
        }
        end_ = start_ + size;
    }

    // free memory on the device
    void free()
    {
        if (start_ != 0)
        {
            cudaFree(start_);
            start_ = end_ = 0;
        }
    }

    T* start_;
    T* end_;
};

__global__ void matrixMultiplicationKernel(float* A, float* B, float* C, int N) {

    int ROW = blockIdx.y*blockDim.y+threadIdx.y;
    int COL = blockIdx.x*blockDim.x+threadIdx.x;

    float tmpSum = 0;

    if (ROW < N && COL < N) {
        // each thread computes one element of the block sub-matrix
        for (int i = 0; i < N; i++) {
            tmpSum += A[ROW * N + i] * B[i * N + COL];
        }
    }
    C[ROW * N + COL] = tmpSum;
}


void matrixMultiplication(float *A, float *B, float *C, int N){

    // declare the number of blocks per grid and the number of threads per block
    // use 1 to 512 threads per block
    dim3 threadsPerBlock(N, N);
    dim3 blocksPerGrid(1, 1);
        if (N*N > 512){
            threadsPerBlock.x = 512;
            threadsPerBlock.y = 512;
            blocksPerGrid.x = ceil(double(N)/double(threadsPerBlock.x));
            blocksPerGrid.y = ceil(double(N)/double(threadsPerBlock.y));
        }

    matrixMultiplicationKernel<<<blocksPerGrid,threadsPerBlock>>>(A, B, C, N);
}

void printMatrix(std::vector<float> mat, int N){
    for (int i=0; i<N; i++){
         for (int j=0; j<N; j++){
             std::cout<<mat[i*N+j]<<", ";
         }
         std::cout<<std::endl;
     }

}

int main() {
    // Perform matrix multiplication C = A*B
    // where A, B and C are NxN matrices
    int N = 4;
    int SIZE = N*N;

    // Allocate memory on the host
    std::vector<float> h_A(SIZE);
    std::vector<float> h_B(SIZE);
    std::vector<float> h_C(SIZE);

    // Initialize matrices on the host
    for (int i=0; i<N; i++){
        for (int j=0; j<N; j++){
            h_A[i*N+j] = sin(i);
            h_B[i*N+j] = cos(j);
        }
    }

    std::cout<< "\n> Matrix A"<<std::endl;
    printMatrix(h_A, N);
    
    std::cout<< "\n> Matrix B"<<std::endl;
    printMatrix(h_B, N);

    // Allocate memory on the device
    dev_array<float> d_A(SIZE);
    dev_array<float> d_B(SIZE);
    dev_array<float> d_C(SIZE);

    d_A.set(&h_A[0], SIZE);
    d_B.set(&h_B[0], SIZE);

    matrixMultiplication(d_A.getData(), d_B.getData(), d_C.getData(), N);
    cudaDeviceSynchronize();

    d_C.get(&h_C[0], SIZE);
    cudaDeviceSynchronize();

    std::cout<< "\n> Matrix C"<<std::endl;
    printMatrix(h_C, N);

    float *cpu_C;
    cpu_C=new float[SIZE];

    // Now do the matrix multiplication on the CPU
    float sum;
    for (int row=0; row<N; row++){
        for (int col=0; col<N; col++){
            sum = 0.f;
            for (int n=0; n<N; n++){
                sum += h_A[row*N+n]*h_B[n*N+col];
            }
            cpu_C[row*N+col] = sum;
        }
    }

    double err = 0;
    // Check the result and make sure it is correct
    for (int ROW=0; ROW < N; ROW++){
        for (int COL=0; COL < N; COL++){
            err += cpu_C[ROW * N + COL] - h_C[ROW * N + COL];

        }
    }

    std::cout << "\n> Error (CPU vs GPU): " << err << std::endl;

    return 0;
}

	.file	"tmpxft_0028538c_00000000-6_vecmulti.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4268:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4268:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB5040:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE5040:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	", "
	.text
	.globl	_Z11printMatrixSt6vectorIfSaIfEEi
	.type	_Z11printMatrixSt6vectorIfSaIfEEi, @function
_Z11printMatrixSt6vectorIfSaIfEEi:
.LFB4264:
	.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
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%esi, %r13
	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
	movq	%r13, %rbp
	salq	$2, %r13
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	pushq	%rdx
	.cfi_def_cfa_offset 64
.L4:
	cmpl	%ebp, %r12d
	jge	.L10
	leaq	(%rbx,%r13), %r15
.L5:
	movq	(%r14), %rax
	leaq	_ZSt4cout(%rip), %rdi
	cvtss2sd	(%rax,%rbx), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	addq	$4, %rbx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	%r15, %rbx
	jne	.L5
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	incl	%r12d
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L4
.L10:
	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
.LFE4264:
	.size	_Z11printMatrixSt6vectorIfSaIfEEi, .-_Z11printMatrixSt6vectorIfSaIfEEi
	.globl	_Z51__device_stub__Z26matrixMultiplicationKernelPfS_S_iPfS_S_i
	.type	_Z51__device_stub__Z26matrixMultiplicationKernelPfS_S_iPfS_S_i, @function
_Z51__device_stub__Z26matrixMultiplicationKernelPfS_S_iPfS_S_i:
.LFB4290:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L11
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z26matrixMultiplicationKernelPfS_S_i(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L11:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4290:
	.size	_Z51__device_stub__Z26matrixMultiplicationKernelPfS_S_iPfS_S_i, .-_Z51__device_stub__Z26matrixMultiplicationKernelPfS_S_iPfS_S_i
	.globl	_Z26matrixMultiplicationKernelPfS_S_i
	.type	_Z26matrixMultiplicationKernelPfS_S_i, @function
_Z26matrixMultiplicationKernelPfS_S_i:
.LFB4291:
	.cfi_startproc
	endbr64
	jmp	_Z51__device_stub__Z26matrixMultiplicationKernelPfS_S_iPfS_S_i
	.cfi_endproc
.LFE4291:
	.size	_Z26matrixMultiplicationKernelPfS_S_i, .-_Z26matrixMultiplicationKernelPfS_S_i
	.globl	_Z20matrixMultiplicationPfS_S_i
	.type	_Z20matrixMultiplicationPfS_S_i, @function
_Z20matrixMultiplicationPfS_S_i:
.LFB4263:
	.cfi_startproc
	endbr64
	movabsq	$4294967297, %rax
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%ecx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%rax, 20(%rsp)
	movl	%ecx, %eax
	imull	%ecx, %eax
	movl	$1, 16(%rsp)
	movl	$1, 28(%rsp)
	cmpl	$512, %eax
	jg	.L17
	movl	%ecx, %eax
	jmp	.L18
.L17:
	cvtsi2sdl	%ecx, %xmm0
	mulsd	.LC1(%rip), %xmm0
	call	ceil@PLT
	cvttsd2siq	%xmm0, %rax
	movl	%eax, 20(%rsp)
	movl	%eax, 24(%rsp)
	movl	$512, %eax
.L18:
	movl	%eax, 8(%rsp)
	movl	16(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	20(%rsp), %rdi
	movl	28(%rsp), %esi
	movl	%eax, 12(%rsp)
	movq	8(%rsp), %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%ebx, %ecx
	movq	%r13, %rdx
	movq	%r12, %rsi
	popq	%rbx
	.cfi_def_cfa_offset 32
	movq	%rbp, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	_Z51__device_stub__Z26matrixMultiplicationKernelPfS_S_iPfS_S_i
.L16:
	.cfi_restore_state
	addq	$40, %rsp
	.cfi_def_cfa_offset 40
	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
.LFE4263:
	.size	_Z20matrixMultiplicationPfS_S_i, .-_Z20matrixMultiplicationPfS_S_i
	.section	.rodata.str1.1
.LC2:
	.string	"_Z26matrixMultiplicationKernelPfS_S_i"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4293:
	.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	.LC2(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z26matrixMultiplicationKernelPfS_S_i(%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
.LFE4293:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIfSaIfEED2Ev,"axG",@progbits,_ZNSt6vectorIfSaIfEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEED2Ev
	.type	_ZNSt6vectorIfSaIfEED2Ev, @function
_ZNSt6vectorIfSaIfEED2Ev:
.LFB4608:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L23
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L23:
	ret
	.cfi_endproc
.LFE4608:
	.size	_ZNSt6vectorIfSaIfEED2Ev, .-_ZNSt6vectorIfSaIfEED2Ev
	.weak	_ZNSt6vectorIfSaIfEED1Ev
	.set	_ZNSt6vectorIfSaIfEED1Ev,_ZNSt6vectorIfSaIfEED2Ev
	.section	.rodata._ZN9dev_arrayIfE3setEPKfm.str1.1,"aMS",@progbits,1
.LC3:
	.string	"failed to copy to device memory"
	.section	.text._ZN9dev_arrayIfE3setEPKfm,"axG",@progbits,_ZN9dev_arrayIfE3setEPKfm,comdat
	.align 2
	.weak	_ZN9dev_arrayIfE3setEPKfm
	.type	_ZN9dev_arrayIfE3setEPKfm, @function
_ZN9dev_arrayIfE3setEPKfm:
.LFB4621:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4621
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	pushq	%rcx
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	movq	(%rdi), %rax
	movq	8(%rdi), %rdx
	movq	%rax, %rdi
	subq	%rax, %rdx
	sarq	$2, %rdx
	cmpq	%rcx, %rdx
	cmova	%rcx, %rdx
	movl	$1, %ecx
	salq	$2, %rdx
.LEHB0:
	call	cudaMemcpy@PLT
.LEHE0:
	testl	%eax, %eax
	je	.L25
	movl	$16, %edi
	call	__cxa_allocate_exception@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, %rbx
.LEHB1:
	call	_ZNSt13runtime_errorC1EPKc@PLT
.LEHE1:
	movq	_ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt13runtime_error(%rip), %rsi
	movq	%rbx, %rdi
.LEHB2:
	call	__cxa_throw@PLT
.L28:
	endbr64
	movq	%rax, %rbp
.L27:
	movq	%rbx, %rdi
	call	__cxa_free_exception@PLT
	movq	%rbp, %rdi
	call	_Unwind_Resume@PLT
.LEHE2:
.L25:
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4621:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table._ZN9dev_arrayIfE3setEPKfm,"aG",@progbits,_ZN9dev_arrayIfE3setEPKfm,comdat
.LLSDA4621:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4621-.LLSDACSB4621
.LLSDACSB4621:
	.uleb128 .LEHB0-.LFB4621
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4621
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L28-.LFB4621
	.uleb128 0
	.uleb128 .LEHB2-.LFB4621
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4621:
	.section	.text._ZN9dev_arrayIfE3setEPKfm,"axG",@progbits,_ZN9dev_arrayIfE3setEPKfm,comdat
	.size	_ZN9dev_arrayIfE3setEPKfm, .-_ZN9dev_arrayIfE3setEPKfm
	.section	.rodata._ZN9dev_arrayIfE8allocateEm.str1.1,"aMS",@progbits,1
.LC4:
	.string	"failed to allocate device memory"
	.section	.text._ZN9dev_arrayIfE8allocateEm,"axG",@progbits,_ZN9dev_arrayIfE8allocateEm,comdat
	.align 2
	.weak	_ZN9dev_arrayIfE8allocateEm
	.type	_ZN9dev_arrayIfE8allocateEm, @function
_ZN9dev_arrayIfE8allocateEm:
.LFB4793:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4793
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	0(,%rsi,4), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rbp, %rsi
	movq	%rdi, %rbx
	pushq	%rcx
	.cfi_def_cfa_offset 32
.LEHB3:
	call	cudaMalloc@PLT
.LEHE3:
	testl	%eax, %eax
	je	.L31
	xorl	%edx, %edx
	movl	$16, %edi
	movq	%rdx, 8(%rbx)
	movq	%rdx, (%rbx)
	call	__cxa_allocate_exception@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, %rbx
.LEHB4:
	call	_ZNSt13runtime_errorC1EPKc@PLT
.LEHE4:
	movq	_ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt13runtime_error(%rip), %rsi
	movq	%rbx, %rdi
.LEHB5:
	call	__cxa_throw@PLT
.L31:
	addq	(%rbx), %rbp
	movq	%rbp, 8(%rbx)
	popq	%rax
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L33:
	.cfi_restore_state
	endbr64
	movq	%rax, %rbp
.L32:
	movq	%rbx, %rdi
	call	__cxa_free_exception@PLT
	movq	%rbp, %rdi
	call	_Unwind_Resume@PLT
.LEHE5:
	.cfi_endproc
.LFE4793:
	.section	.gcc_except_table._ZN9dev_arrayIfE8allocateEm,"aG",@progbits,_ZN9dev_arrayIfE8allocateEm,comdat
.LLSDA4793:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4793-.LLSDACSB4793
.LLSDACSB4793:
	.uleb128 .LEHB3-.LFB4793
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB4793
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L33-.LFB4793
	.uleb128 0
	.uleb128 .LEHB5-.LFB4793
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
.LLSDACSE4793:
	.section	.text._ZN9dev_arrayIfE8allocateEm,"axG",@progbits,_ZN9dev_arrayIfE8allocateEm,comdat
	.size	_ZN9dev_arrayIfE8allocateEm, .-_ZN9dev_arrayIfE8allocateEm
	.section	.text._ZN9dev_arrayIfE4freeEv,"axG",@progbits,_ZN9dev_arrayIfE4freeEv,comdat
	.align 2
	.weak	_ZN9dev_arrayIfE4freeEv
	.type	_ZN9dev_arrayIfE4freeEv, @function
_ZN9dev_arrayIfE4freeEv:
.LFB4794:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.L36
	call	cudaFree@PLT
	xorl	%eax, %eax
	movq	%rax, 8(%rbx)
	movq	%rax, (%rbx)
.L36:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4794:
	.size	_ZN9dev_arrayIfE4freeEv, .-_ZN9dev_arrayIfE4freeEv
	.section	.text._ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm,"axG",@progbits,_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm,comdat
	.align 2
	.weak	_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm
	.type	_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm, @function
_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm:
.LFB4894:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	0(,%rsi,4), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 32
	je	.L46
	movabsq	$2305843009213693951, %rax
	cmpq	%rsi, %rax
	jnb	.L44
	movabsq	$4611686018427387903, %rax
	cmpq	%rsi, %rax
	jnb	.L45
	call	_ZSt28__throw_bad_array_new_lengthv@PLT
.L45:
	call	_ZSt17__throw_bad_allocv@PLT
.L44:
	movq	%rbp, %rdi
	call	_Znwm@PLT
	jmp	.L43
.L46:
	xorl	%eax, %eax
.L43:
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4894:
	.size	_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm, .-_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm
	.section	.text._ZNSt6vectorIfSaIfEEC2ERKS1_,"axG",@progbits,_ZNSt6vectorIfSaIfEEC5ERKS1_,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEEC2ERKS1_
	.type	_ZNSt6vectorIfSaIfEEC2ERKS1_, @function
_ZNSt6vectorIfSaIfEEC2ERKS1_:
.LFB4613:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%ecx, %ecx
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 32
	movq	8(%rsi), %rsi
	subq	0(%rbp), %rsi
	movq	%rcx, (%rdi)
	movq	%rcx, 8(%rdi)
	sarq	$2, %rsi
	movq	%rcx, 16(%rdi)
	call	_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm
	movq	0(%rbp), %rsi
	movq	8(%rbp), %rbp
	movq	(%rbx), %rcx
	subq	%rsi, %rbp
	cmpq	$4, %rbp
	jle	.L49
	movq	%rcx, %rdi
	movq	%rbp, %rdx
	call	memmove@PLT
	movq	%rax, %rcx
	jmp	.L50
.L49:
	jne	.L50
	movss	(%rsi), %xmm0
	movss	%xmm0, (%rcx)
.L50:
	addq	%rbp, %rcx
	movq	%rcx, 8(%rbx)
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4613:
	.size	_ZNSt6vectorIfSaIfEEC2ERKS1_, .-_ZNSt6vectorIfSaIfEEC2ERKS1_
	.weak	_ZNSt6vectorIfSaIfEEC1ERKS1_
	.set	_ZNSt6vectorIfSaIfEEC1ERKS1_,_ZNSt6vectorIfSaIfEEC2ERKS1_
	.section	.rodata._ZNSt6vectorIfSaIfEEC2EmRKS0_.str1.1,"aMS",@progbits,1
.LC5:
	.string	"cannot create std::vector larger than max_size()"
	.section	.text._ZNSt6vectorIfSaIfEEC2EmRKS0_,"axG",@progbits,_ZNSt6vectorIfSaIfEEC5EmRKS0_,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEEC2EmRKS0_
	.type	_ZNSt6vectorIfSaIfEEC2EmRKS0_, @function
_ZNSt6vectorIfSaIfEEC2EmRKS0_:
.LFB4605:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	pushq	%rcx
	.cfi_def_cfa_offset 32
	cmpq	%rsi, %rax
	jnb	.L53
	leaq	.LC5(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L53:
	xorl	%edx, %edx
	movq	%rdi, %rbp
	movq	%rsi, %rbx
	movq	%rdx, (%rdi)
	movq	%rdx, 8(%rdi)
	movq	%rdx, 16(%rdi)
	call	_ZNSt12_Vector_baseIfSaIfEE17_M_create_storageEm
	movq	0(%rbp), %rax
	testq	%rbx, %rbx
	je	.L54
	movl	$0x00000000, (%rax)
	leaq	4(%rax), %rdx
	decq	%rbx
	je	.L57
	leaq	(%rdx,%rbx,4), %rcx
	movq	%rdx, %rsi
.L55:
	cmpq	%rsi, %rcx
	je	.L62
	movl	$0x00000000, (%rsi)
	addq	$4, %rsi
	jmp	.L55
.L62:
	subq	%rax, %rcx
	leaq	-4(%rdx,%rcx), %rax
	jmp	.L54
.L57:
	movq	%rdx, %rax
.L54:
	movq	%rax, 8(%rbp)
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4605:
	.size	_ZNSt6vectorIfSaIfEEC2EmRKS0_, .-_ZNSt6vectorIfSaIfEEC2EmRKS0_
	.weak	_ZNSt6vectorIfSaIfEEC1EmRKS0_
	.set	_ZNSt6vectorIfSaIfEEC1EmRKS0_,_ZNSt6vectorIfSaIfEEC2EmRKS0_
	.section	.rodata.str1.1
.LC8:
	.string	"\n> Matrix A"
.LC9:
	.string	"\n> Matrix B"
.LC10:
	.string	"failed to copy to host memory"
.LC11:
	.string	"\n> Matrix C"
.LC12:
	.string	"\n> Error (CPU vs GPU): "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4265:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4265
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$16, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	176(%rsp), %rax
	movq	%rax, (%rsp)
	leaq	104(%rsp), %rax
	movq	(%rsp), %rdx
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
.LEHB6:
	call	_ZNSt6vectorIfSaIfEEC1EmRKS0_
.LEHE6:
	movq	(%rsp), %rdx
	movl	$16, %esi
	leaq	128(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 32(%rsp)
.LEHB7:
	call	_ZNSt6vectorIfSaIfEEC1EmRKS0_
.LEHE7:
	leaq	152(%rsp), %rax
	movq	(%rsp), %rdx
	movl	$16, %esi
	movq	%rax, %rdi
	movq	%rax, 40(%rsp)
.LEHB8:
	call	_ZNSt6vectorIfSaIfEEC1EmRKS0_
.LEHE8:
	movq	104(%rsp), %r12
	movq	128(%rsp), %r13
	xorl	%r15d, %r15d
.L64:
	cvtsi2sdl	%r15d, %xmm0
	movq	%r15, %rbp
	xorl	%r14d, %r14d
	salq	$4, %rbp
	leaq	0(%rbp,%r12), %rbx
	addq	%r13, %rbp
	call	sin@PLT
	cvtsd2ss	%xmm0, %xmm1
.L65:
	cvtsi2sdl	%r14d, %xmm0
	movss	%xmm1, (%rbx,%r14,4)
	movss	%xmm1, 8(%rsp)
	call	cos@PLT
	movss	8(%rsp), %xmm1
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 0(%rbp,%r14,4)
	incq	%r14
	cmpq	$4, %r14
	jne	.L65
	incq	%r15
	cmpq	$4, %r15
	jne	.L64
	leaq	_ZSt4cout(%rip), %r14
	leaq	.LC8(%rip), %rsi
	movq	%r14, %rdi
.LEHB9:
	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
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEEC1ERKS1_
.LEHE9:
	movq	(%rsp), %rdi
	movl	$4, %esi
.LEHB10:
	call	_Z11printMatrixSt6vectorIfSaIfEEi
.LEHE10:
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	leaq	.LC9(%rip), %rsi
	movq	%r14, %rdi
.LEHB11:
	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	32(%rsp), %rsi
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEEC1ERKS1_
.LEHE11:
	movq	(%rsp), %rdi
	movl	$4, %esi
.LEHB12:
	call	_Z11printMatrixSt6vectorIfSaIfEEi
.LEHE12:
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	leaq	56(%rsp), %rax
	movl	$16, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB13:
	call	_ZN9dev_arrayIfE8allocateEm
.LEHE13:
	leaq	72(%rsp), %rax
	movl	$16, %esi
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
.LEHB14:
	call	_ZN9dev_arrayIfE8allocateEm
.LEHE14:
	leaq	88(%rsp), %rbp
	movl	$16, %esi
	movq	%rbp, %rdi
.LEHB15:
	call	_ZN9dev_arrayIfE8allocateEm
.LEHE15:
	movq	8(%rsp), %rdi
	movl	$16, %edx
	movq	%r12, %rsi
.LEHB16:
	call	_ZN9dev_arrayIfE3setEPKfm
	movq	16(%rsp), %rdi
	movl	$16, %edx
	movq	%r13, %rsi
	call	_ZN9dev_arrayIfE3setEPKfm
	movq	88(%rsp), %rdx
	movq	72(%rsp), %rsi
	movl	$4, %ecx
	movq	56(%rsp), %rdi
	call	_Z20matrixMultiplicationPfS_S_i
	call	cudaDeviceSynchronize@PLT
	movq	88(%rsp), %rsi
	movq	96(%rsp), %rax
	movl	$2, %ecx
	movq	152(%rsp), %r15
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%r15, %rdi
	sarq	$2, %rdx
	cmpq	$61, %rax
	movl	$16, %eax
	cmovnb	%rax, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
.LEHE16:
	testl	%eax, %eax
	je	.L68
	movl	$16, %edi
	call	__cxa_allocate_exception@PLT
	leaq	.LC10(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, %rbx
.LEHB17:
	call	_ZNSt13runtime_errorC1EPKc@PLT
.LEHE17:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L105
	movq	_ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt13runtime_error(%rip), %rsi
	movq	%rbx, %rdi
.LEHB18:
	call	__cxa_throw@PLT
.L101:
	endbr64
	movq	%rax, %r12
.L70:
	movq	%rbx, %rdi
	call	__cxa_free_exception@PLT
	jmp	.L71
.L68:
	call	cudaDeviceSynchronize@PLT
	leaq	.LC11(%rip), %rsi
	movq	%r14, %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	40(%rsp), %rsi
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEEC1ERKS1_
.LEHE18:
	movq	(%rsp), %rdi
	movl	$4, %esi
.LEHB19:
	call	_Z11printMatrixSt6vectorIfSaIfEEi
.LEHE19:
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movl	$64, %edi
.LEHB20:
	call	_Znam@PLT
	movq	%rax, %rcx
	xorl	%eax, %eax
.L72:
	xorl	%edx, %edx
	leaq	(%r12,%rax), %r9
	leaq	(%rcx,%rax), %r8
.L76:
	leaq	0(%r13,%rdx,4), %rdi
	xorl	%esi, %esi
	xorps	%xmm0, %xmm0
.L73:
	movss	(%r9,%rsi,4), %xmm1
	mulss	(%rdi), %xmm1
	incq	%rsi
	addq	$16, %rdi
	addss	%xmm1, %xmm0
	cmpq	$4, %rsi
	jne	.L73
	movss	%xmm0, (%r8,%rdx,4)
	incq	%rdx
	cmpq	$4, %rdx
	jne	.L76
	addq	$16, %rax
	cmpq	$64, %rax
	jne	.L72
	movq	$0x000000000, (%rsp)
	xorl	%edx, %edx
.L75:
	movq	%rdx, %rax
	xorl	%esi, %esi
.L77:
	movss	(%rcx,%rax), %xmm0
	subss	(%r15,%rax), %xmm0
	incl	%esi
	addq	$4, %rax
	cvtss2sd	%xmm0, %xmm0
	addsd	(%rsp), %xmm0
	movsd	%xmm0, (%rsp)
	cmpl	$4, %esi
	jne	.L77
	addq	$16, %rdx
	cmpq	$64, %rdx
	jne	.L75
	leaq	.LC12(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.LEHE20:
	movq	%rbp, %rdi
	call	_ZN9dev_arrayIfE4freeEv
	movq	16(%rsp), %rdi
	call	_ZN9dev_arrayIfE4freeEv
	movq	8(%rsp), %rdi
	call	_ZN9dev_arrayIfE4freeEv
	leaq	152(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	leaq	128(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	leaq	104(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L88
	jmp	.L105
.L95:
	endbr64
	jmp	.L108
.L96:
	endbr64
.L108:
	movq	%rax, %r12
.L81:
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	jmp	.L80
.L100:
	endbr64
	movq	%rax, %r12
.L82:
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	jmp	.L71
.L99:
	endbr64
	movq	%rax, %r12
.L71:
	movq	%rbp, %rdi
	call	_ZN9dev_arrayIfE4freeEv
	jmp	.L83
.L98:
	endbr64
	movq	%rax, %r12
.L83:
	movq	16(%rsp), %rdi
	call	_ZN9dev_arrayIfE4freeEv
	jmp	.L84
.L97:
	endbr64
	movq	%rax, %r12
.L84:
	movq	8(%rsp), %rdi
	call	_ZN9dev_arrayIfE4freeEv
	jmp	.L80
.L94:
	endbr64
	movq	%rax, %r12
.L80:
	movq	40(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	jmp	.L85
.L93:
	endbr64
	movq	%rax, %r12
.L85:
	movq	32(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	jmp	.L86
.L92:
	endbr64
	movq	%rax, %r12
.L86:
	movq	24(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L105
	movq	%r12, %rdi
.LEHB21:
	call	_Unwind_Resume@PLT
.LEHE21:
.L105:
	call	__stack_chk_fail@PLT
.L88:
	addq	$216, %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
.LFE4265:
	.section	.gcc_except_table,"a",@progbits
.LLSDA4265:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4265-.LLSDACSB4265
.LLSDACSB4265:
	.uleb128 .LEHB6-.LFB4265
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB7-.LFB4265
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L92-.LFB4265
	.uleb128 0
	.uleb128 .LEHB8-.LFB4265
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L93-.LFB4265
	.uleb128 0
	.uleb128 .LEHB9-.LFB4265
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L94-.LFB4265
	.uleb128 0
	.uleb128 .LEHB10-.LFB4265
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L95-.LFB4265
	.uleb128 0
	.uleb128 .LEHB11-.LFB4265
	.uleb128 .LEHE11-.LEHB11
	.uleb128 .L94-.LFB4265
	.uleb128 0
	.uleb128 .LEHB12-.LFB4265
	.uleb128 .LEHE12-.LEHB12
	.uleb128 .L96-.LFB4265
	.uleb128 0
	.uleb128 .LEHB13-.LFB4265
	.uleb128 .LEHE13-.LEHB13
	.uleb128 .L94-.LFB4265
	.uleb128 0
	.uleb128 .LEHB14-.LFB4265
	.uleb128 .LEHE14-.LEHB14
	.uleb128 .L97-.LFB4265
	.uleb128 0
	.uleb128 .LEHB15-.LFB4265
	.uleb128 .LEHE15-.LEHB15
	.uleb128 .L98-.LFB4265
	.uleb128 0
	.uleb128 .LEHB16-.LFB4265
	.uleb128 .LEHE16-.LEHB16
	.uleb128 .L99-.LFB4265
	.uleb128 0
	.uleb128 .LEHB17-.LFB4265
	.uleb128 .LEHE17-.LEHB17
	.uleb128 .L101-.LFB4265
	.uleb128 0
	.uleb128 .LEHB18-.LFB4265
	.uleb128 .LEHE18-.LEHB18
	.uleb128 .L99-.LFB4265
	.uleb128 0
	.uleb128 .LEHB19-.LFB4265
	.uleb128 .LEHE19-.LEHB19
	.uleb128 .L100-.LFB4265
	.uleb128 0
	.uleb128 .LEHB20-.LFB4265
	.uleb128 .LEHE20-.LEHB20
	.uleb128 .L99-.LFB4265
	.uleb128 0
	.uleb128 .LEHB21-.LFB4265
	.uleb128 .LEHE21-.LEHB21
	.uleb128 0
	.uleb128 0
.LLSDACSE4265:
	.section	.text.startup
	.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	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1063256064
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.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 <stdexcept>
#include <algorithm>
#include <hip/hip_runtime.h>
#include <iostream>
#include <vector>
#include <stdlib.h>
#include <time.h>

template <class T>
class dev_array
{
// public functions
public:
    explicit dev_array()
        : start_(0),
          end_(0)
    {}

    // constructor
    explicit dev_array(size_t size)
    {
        allocate(size);
    }
    // destructor
    ~dev_array()
    {
        free();
    }

    // resize the vector
    void resize(size_t size)
    {
        free();
        allocate(size);
    }

    // get the size of the array
    size_t getSize() const
    {
        return end_ - start_;
    }

    // get data
    const T* getData() const
    {
        return start_;
    }

    T* getData()
    {
        return start_;
    }

    // set
    void set(const T* src, size_t size)
    {
        size_t min = std::min(size, getSize());
        hipError_t result = hipMemcpy(start_, src, min * sizeof(T), hipMemcpyHostToDevice);
        if (result != hipSuccess)
        {
            throw std::runtime_error("failed to copy to device memory");
        }
    }
    // get
    void get(T* dest, size_t size)
    {
        size_t min = std::min(size, getSize());
        hipError_t result = hipMemcpy(dest, start_, min * sizeof(T), hipMemcpyDeviceToHost);
        if (result != hipSuccess)
        {
            throw std::runtime_error("failed to copy to host memory");
        }
    }


// private functions
private:
    // allocate memory on the device
    void allocate(size_t size)
    {
        hipError_t result = hipMalloc((void**)&start_, size * sizeof(T));
        if (result != hipSuccess)
        {
            start_ = end_ = 0;
            throw std::runtime_error("failed to allocate device memory");
        }
        end_ = start_ + size;
    }

    // free memory on the device
    void free()
    {
        if (start_ != 0)
        {
            hipFree(start_);
            start_ = end_ = 0;
        }
    }

    T* start_;
    T* end_;
};

__global__ void matrixMultiplicationKernel(float* A, float* B, float* C, int N) {

    int ROW = blockIdx.y*blockDim.y+threadIdx.y;
    int COL = blockIdx.x*blockDim.x+threadIdx.x;

    float tmpSum = 0;

    if (ROW < N && COL < N) {
        // each thread computes one element of the block sub-matrix
        for (int i = 0; i < N; i++) {
            tmpSum += A[ROW * N + i] * B[i * N + COL];
        }
    }
    C[ROW * N + COL] = tmpSum;
}


void matrixMultiplication(float *A, float *B, float *C, int N){

    // declare the number of blocks per grid and the number of threads per block
    // use 1 to 512 threads per block
    dim3 threadsPerBlock(N, N);
    dim3 blocksPerGrid(1, 1);
        if (N*N > 512){
            threadsPerBlock.x = 512;
            threadsPerBlock.y = 512;
            blocksPerGrid.x = ceil(double(N)/double(threadsPerBlock.x));
            blocksPerGrid.y = ceil(double(N)/double(threadsPerBlock.y));
        }

    matrixMultiplicationKernel<<<blocksPerGrid,threadsPerBlock>>>(A, B, C, N);
}

void printMatrix(std::vector<float> mat, int N){
    for (int i=0; i<N; i++){
         for (int j=0; j<N; j++){
             std::cout<<mat[i*N+j]<<", ";
         }
         std::cout<<std::endl;
     }

}

int main() {
    // Perform matrix multiplication C = A*B
    // where A, B and C are NxN matrices
    int N = 4;
    int SIZE = N*N;

    // Allocate memory on the host
    std::vector<float> h_A(SIZE);
    std::vector<float> h_B(SIZE);
    std::vector<float> h_C(SIZE);

    // Initialize matrices on the host
    for (int i=0; i<N; i++){
        for (int j=0; j<N; j++){
            h_A[i*N+j] = sin(i);
            h_B[i*N+j] = cos(j);
        }
    }

    std::cout<< "\n> Matrix A"<<std::endl;
    printMatrix(h_A, N);
    
    std::cout<< "\n> Matrix B"<<std::endl;
    printMatrix(h_B, N);

    // Allocate memory on the device
    dev_array<float> d_A(SIZE);
    dev_array<float> d_B(SIZE);
    dev_array<float> d_C(SIZE);

    d_A.set(&h_A[0], SIZE);
    d_B.set(&h_B[0], SIZE);

    matrixMultiplication(d_A.getData(), d_B.getData(), d_C.getData(), N);
    hipDeviceSynchronize();

    d_C.get(&h_C[0], SIZE);
    hipDeviceSynchronize();

    std::cout<< "\n> Matrix C"<<std::endl;
    printMatrix(h_C, N);

    float *cpu_C;
    cpu_C=new float[SIZE];

    // Now do the matrix multiplication on the CPU
    float sum;
    for (int row=0; row<N; row++){
        for (int col=0; col<N; col++){
            sum = 0.f;
            for (int n=0; n<N; n++){
                sum += h_A[row*N+n]*h_B[n*N+col];
            }
            cpu_C[row*N+col] = sum;
        }
    }

    double err = 0;
    // Check the result and make sure it is correct
    for (int ROW=0; ROW < N; ROW++){
        for (int COL=0; COL < N; COL++){
            err += cpu_C[ROW * N + COL] - h_C[ROW * N + COL];

        }
    }

    std::cout << "\n> Error (CPU vs GPU): " << err << std::endl;

    return 0;
}

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

                                        # End of file scope inline assembly
	.globl	_Z41__device_stub__matrixMultiplicationKernelPfS_S_i # -- Begin function _Z41__device_stub__matrixMultiplicationKernelPfS_S_i
	.type	_Z41__device_stub__matrixMultiplicationKernelPfS_S_i,@function
_Z41__device_stub__matrixMultiplicationKernelPfS_S_i: # @_Z41__device_stub__matrixMultiplicationKernelPfS_S_i
	.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	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z26matrixMultiplicationKernelPfS_S_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z41__device_stub__matrixMultiplicationKernelPfS_S_i, .Lfunc_end0-_Z41__device_stub__matrixMultiplicationKernelPfS_S_i
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z20matrixMultiplicationPfS_S_i
.LCPI1_0:
	.quad	0x3f60000000000000              # double 0.001953125
	.text
	.globl	_Z20matrixMultiplicationPfS_S_i
	.type	_Z20matrixMultiplicationPfS_S_i,@function
_Z20matrixMultiplicationPfS_S_i:        # @_Z20matrixMultiplicationPfS_S_i
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	%ecx, %ebx
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movabsq	$4294967297, %r13               # imm = 0x100000001
	movl	%ecx, %eax
	imull	%ecx, %eax
	cmpl	$513, %eax                      # imm = 0x201
	jb	.LBB1_1
# %bb.2:
	cvtsi2sd	%ebx, %xmm0
	mulsd	.LCPI1_0(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %rax
	movl	%eax, %eax
	imulq	%rax, %r13
	movabsq	$2199023256064, %rdx            # imm = 0x20000000200
	jmp	.LBB1_3
.LBB1_1:
	movl	%ebx, %eax
	movq	%rax, %rdx
	shlq	$32, %rdx
	orq	%rax, %rdx
.LBB1_3:
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	je	.LBB1_5
# %bb.4:
	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
.LBB1_5:
	.cfi_def_cfa_offset 48
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	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
	jmp	_Z41__device_stub__matrixMultiplicationKernelPfS_S_i # TAILCALL
.Lfunc_end1:
	.size	_Z20matrixMultiplicationPfS_S_i, .Lfunc_end1-_Z20matrixMultiplicationPfS_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z11printMatrixSt6vectorIfSaIfEEi # -- Begin function _Z11printMatrixSt6vectorIfSaIfEEi
	.type	_Z11printMatrixSt6vectorIfSaIfEEi,@function
_Z11printMatrixSt6vectorIfSaIfEEi:      # @_Z11printMatrixSt6vectorIfSaIfEEi
	.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
	movl	%esi, 4(%rsp)                   # 4-byte Spill
	testl	%esi, %esi
	jle	.LBB2_5
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdi, %r14
	movl	4(%rsp), %r13d                  # 4-byte Reload
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
.LBB2_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_3 Depth 2
	movl	%ebx, %ebx
	movq	%r13, %r15
	movq	%rbx, %r12
.LBB2_3:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%r14), %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rax,%r12,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r12
	decq	%r15
	jne	.LBB2_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB2_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	4(%rsp), %ebx                   # 4-byte Folded Reload
	cmpq	%r13, %rbp
	jne	.LBB2_2
.LBB2_5:                                # %._crit_edge13
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z11printMatrixSt6vectorIfSaIfEEi, .Lfunc_end2-_Z11printMatrixSt6vectorIfSaIfEEi
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	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
	subq	$200, %rsp
	.cfi_def_cfa_offset 240
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$64, %edi
	callq	_Znwm
	movq	%rax, %rbx
	movq	%rax, 56(%rsp)
	addq	$64, %rax
	movq	%rax, 72(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	movups	%xmm0, 16(%rbx)
	movups	%xmm0, 32(%rbx)
	movups	%xmm0, 48(%rbx)
	movq	%rax, 64(%rsp)
.Ltmp0:
	movl	$64, %edi
	callq	_Znwm
.Ltmp1:
# %bb.1:
	movq	%rax, %r14
	movq	%rax, 32(%rsp)
	addq	$64, %rax
	movq	%rax, 48(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 48(%r14)
	movups	%xmm0, 32(%r14)
	movups	%xmm0, 16(%r14)
	movups	%xmm0, (%r14)
	movq	%rax, 40(%rsp)
.Ltmp3:
	movl	$64, %edi
	callq	_Znwm
.Ltmp4:
# %bb.2:
	movq	%rax, 8(%rsp)
	movq	%rax, %rcx
	addq	$64, %rcx
	movq	%rcx, 24(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 48(%rax)
	movups	%xmm0, 32(%rax)
	movups	%xmm0, 16(%rax)
	movups	%xmm0, (%rax)
	movq	%rcx, 16(%rsp)
	xorl	%r15d, %r15d
.LBB3_3:                                # %.preheader150
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r15d, %xmm0
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	xorl	%r12d, %r12d
.LBB3_4:                                #   Parent Loop BB3_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	sin
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%rbx,%r12,4)
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r12d, %xmm0
	callq	cos
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r14,%r12,4)
	incq	%r12
	cmpq	$4, %r12
	jne	.LBB3_4
# %bb.5:                                #   in Loop: Header=BB3_3 Depth=1
	incq	%r15
	addq	$16, %rbx
	addq	$16, %r14
	cmpq	$4, %r15
	jne	.LBB3_3
# %bb.6:
.Ltmp6:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp7:
# %bb.7:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp8:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp9:
# %bb.8:                                # %.noexc
.Ltmp10:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp11:
# %bb.9:                                # %.noexc130
.Ltmp12:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp13:
# %bb.10:                               # %_ZNSolsEPFRSoS_E.exit
.Ltmp14:
	leaq	176(%rsp), %rdi
	leaq	56(%rsp), %rsi
	callq	_ZNSt6vectorIfSaIfEEC2ERKS1_
.Ltmp15:
# %bb.11:
.Ltmp16:
	leaq	176(%rsp), %rdi
	movl	$4, %esi
	callq	_Z11printMatrixSt6vectorIfSaIfEEi
.Ltmp17:
# %bb.12:
	movq	176(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_14
# %bb.13:
	callq	_ZdlPv
.LBB3_14:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit
.Ltmp19:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp20:
# %bb.15:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit98
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp21:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp22:
# %bb.16:                               # %.noexc132
.Ltmp23:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp24:
# %bb.17:                               # %.noexc133
.Ltmp25:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp26:
# %bb.18:                               # %_ZNSolsEPFRSoS_E.exit99
.Ltmp27:
	leaq	152(%rsp), %rdi
	leaq	32(%rsp), %rsi
	callq	_ZNSt6vectorIfSaIfEEC2ERKS1_
.Ltmp28:
# %bb.19:
.Ltmp30:
	leaq	152(%rsp), %rdi
	movl	$4, %esi
	callq	_Z11printMatrixSt6vectorIfSaIfEEi
.Ltmp31:
# %bb.20:
	movq	152(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_22
# %bb.21:
	callq	_ZdlPv
.LBB3_22:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit101
.Ltmp33:
	leaq	112(%rsp), %rdi
	movl	$16, %esi
	callq	_ZN9dev_arrayIfE8allocateEm
.Ltmp34:
# %bb.23:                               # %_ZN9dev_arrayIfEC2Em.exit
.Ltmp36:
	leaq	96(%rsp), %rdi
	movl	$16, %esi
	callq	_ZN9dev_arrayIfE8allocateEm
.Ltmp37:
# %bb.24:                               # %_ZN9dev_arrayIfEC2Em.exit102
.Ltmp39:
	leaq	80(%rsp), %rdi
	movl	$16, %esi
	callq	_ZN9dev_arrayIfE8allocateEm
.Ltmp40:
# %bb.25:                               # %_ZN9dev_arrayIfEC2Em.exit103
	movq	56(%rsp), %rsi
.Ltmp42:
	leaq	112(%rsp), %rdi
	movl	$16, %edx
	callq	_ZN9dev_arrayIfE3setEPKfm
.Ltmp43:
# %bb.26:
	movq	32(%rsp), %rsi
.Ltmp44:
	leaq	96(%rsp), %rdi
	movl	$16, %edx
	callq	_ZN9dev_arrayIfE3setEPKfm
.Ltmp45:
# %bb.27:
	movq	112(%rsp), %rdi
	movq	96(%rsp), %rsi
	movq	80(%rsp), %rdx
.Ltmp46:
	movl	$4, %ecx
	callq	_Z20matrixMultiplicationPfS_S_i
.Ltmp47:
# %bb.28:
.Ltmp48:
	callq	hipDeviceSynchronize
.Ltmp49:
# %bb.29:
	movq	8(%rsp), %rsi
.Ltmp50:
	leaq	80(%rsp), %rdi
	movl	$16, %edx
	callq	_ZN9dev_arrayIfE3getEPfm
.Ltmp51:
# %bb.30:
.Ltmp52:
	callq	hipDeviceSynchronize
.Ltmp53:
# %bb.31:
.Ltmp54:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp55:
# %bb.32:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit104
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp56:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp57:
# %bb.33:                               # %.noexc136
.Ltmp58:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp59:
# %bb.34:                               # %.noexc137
.Ltmp60:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp61:
# %bb.35:                               # %_ZNSolsEPFRSoS_E.exit105
.Ltmp62:
	leaq	128(%rsp), %rdi
	leaq	8(%rsp), %rsi
	callq	_ZNSt6vectorIfSaIfEEC2ERKS1_
.Ltmp63:
# %bb.36:
.Ltmp65:
	leaq	128(%rsp), %rdi
	movl	$4, %esi
	callq	_Z11printMatrixSt6vectorIfSaIfEEi
.Ltmp66:
# %bb.37:
	movq	128(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_39
# %bb.38:
	callq	_ZdlPv
.LBB3_39:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit107
.Ltmp68:
	movl	$64, %edi
	callq	_Znam
.Ltmp69:
# %bb.40:                               # %.preheader149
	movq	56(%rsp), %rcx
	movq	32(%rsp), %rdx
	xorl	%esi, %esi
.LBB3_41:                               # %.preheader148
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_42 Depth 2
                                        #       Child Loop BB3_43 Depth 3
	movq	%rsi, %rdi
	shlq	$4, %rdi
	addq	%rax, %rdi
	movq	%rdx, %r8
	xorl	%r9d, %r9d
.LBB3_42:                               # %.preheader147
                                        #   Parent Loop BB3_41 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_43 Depth 3
	xorps	%xmm0, %xmm0
	xorl	%r10d, %r10d
.LBB3_43:                               #   Parent Loop BB3_41 Depth=1
                                        #     Parent Loop BB3_42 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%rcx,%r10), %xmm1              # xmm1 = mem[0],zero,zero,zero
	mulss	(%r8,%r10,4), %xmm1
	addss	%xmm1, %xmm0
	addq	$4, %r10
	cmpq	$16, %r10
	jne	.LBB3_43
# %bb.44:                               #   in Loop: Header=BB3_42 Depth=2
	movss	%xmm0, (%rdi,%r9,4)
	incq	%r9
	addq	$4, %r8
	cmpq	$4, %r9
	jne	.LBB3_42
# %bb.45:                               #   in Loop: Header=BB3_41 Depth=1
	incq	%rsi
	addq	$16, %rcx
	cmpq	$4, %rsi
	jne	.LBB3_41
# %bb.46:                               # %.preheader146
	xorps	%xmm0, %xmm0
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	movq	8(%rsp), %rcx
	xorl	%edx, %edx
.LBB3_47:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_48 Depth 2
	xorl	%esi, %esi
	movsd	(%rsp), %xmm1                   # 8-byte Reload
                                        # xmm1 = mem[0],zero
.LBB3_48:                               #   Parent Loop BB3_47 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rax,%rsi,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	subss	(%rcx,%rsi,4), %xmm0
	cvtss2sd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	incq	%rsi
	cmpq	$4, %rsi
	jne	.LBB3_48
# %bb.49:                               #   in Loop: Header=BB3_47 Depth=1
	movsd	%xmm1, (%rsp)                   # 8-byte Spill
	incq	%rdx
	addq	$16, %rax
	addq	$16, %rcx
	cmpq	$4, %rdx
	jne	.LBB3_47
# %bb.50:
.Ltmp71:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp72:
# %bb.51:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit114
.Ltmp73:
	movl	$_ZSt4cout, %edi
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp74:
# %bb.52:                               # %_ZNSolsEd.exit
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp75:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp76:
# %bb.53:                               # %.noexc140
.Ltmp77:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp78:
# %bb.54:                               # %.noexc141
.Ltmp79:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp80:
# %bb.55:                               # %_ZNSolsEPFRSoS_E.exit115
	leaq	80(%rsp), %rdi
	callq	_ZN9dev_arrayIfED2Ev
	leaq	96(%rsp), %rdi
	callq	_ZN9dev_arrayIfED2Ev
	leaq	112(%rsp), %rdi
	callq	_ZN9dev_arrayIfED2Ev
	movq	8(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_57
# %bb.56:
	callq	_ZdlPv
.LBB3_57:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit117
	movq	32(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_59
# %bb.58:
	callq	_ZdlPv
.LBB3_59:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit119
	movq	56(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_61
# %bb.60:
	callq	_ZdlPv
.LBB3_61:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit121
	xorl	%eax, %eax
	addq	$200, %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
	retq
.LBB3_62:
	.cfi_def_cfa_offset 240
.Ltmp70:
	jmp	.LBB3_78
.LBB3_63:
.Ltmp67:
	movq	%rax, %rbx
	movq	128(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_79
# %bb.64:
	callq	_ZdlPv
	jmp	.LBB3_79
.LBB3_65:
.Ltmp41:
	movq	%rax, %rbx
	jmp	.LBB3_80
.LBB3_66:
.Ltmp38:
	movq	%rax, %rbx
	jmp	.LBB3_81
.LBB3_67:
.Ltmp35:
	jmp	.LBB3_76
.LBB3_68:
.Ltmp32:
	movq	%rax, %rbx
	movq	152(%rsp), %rdi
	jmp	.LBB3_70
.LBB3_69:
.Ltmp18:
	movq	%rax, %rbx
	movq	176(%rsp), %rdi
.LBB3_70:
	testq	%rdi, %rdi
	je	.LBB3_82
# %bb.71:
	callq	_ZdlPv
	jmp	.LBB3_82
.LBB3_72:
.Ltmp5:
	movq	%rax, %rbx
	jmp	.LBB3_84
.LBB3_73:
.Ltmp2:
	movq	%rax, %rbx
	jmp	.LBB3_86
.LBB3_74:
.Ltmp81:
	jmp	.LBB3_78
.LBB3_75:
.Ltmp29:
.LBB3_76:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit109
	movq	%rax, %rbx
	jmp	.LBB3_82
.LBB3_77:
.Ltmp64:
.LBB3_78:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit113
	movq	%rax, %rbx
.LBB3_79:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit113
	leaq	80(%rsp), %rdi
	callq	_ZN9dev_arrayIfED2Ev
.LBB3_80:
	leaq	96(%rsp), %rdi
	callq	_ZN9dev_arrayIfED2Ev
.LBB3_81:
	leaq	112(%rsp), %rdi
	callq	_ZN9dev_arrayIfED2Ev
.LBB3_82:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit109
	movq	8(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_84
# %bb.83:
	callq	_ZdlPv
.LBB3_84:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit123
	movq	32(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_86
# %bb.85:
	callq	_ZdlPv
.LBB3_86:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit125
	movq	56(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_88
# %bb.87:
	callq	_ZdlPv
.LBB3_88:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit127
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table3:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp15-.Ltmp6                 #   Call between .Ltmp6 and .Ltmp15
	.uleb128 .Ltmp29-.Lfunc_begin0          #     jumps to .Ltmp29
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp16-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp17-.Ltmp16                #   Call between .Ltmp16 and .Ltmp17
	.uleb128 .Ltmp18-.Lfunc_begin0          #     jumps to .Ltmp18
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp19-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp28-.Ltmp19                #   Call between .Ltmp19 and .Ltmp28
	.uleb128 .Ltmp29-.Lfunc_begin0          #     jumps to .Ltmp29
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp30-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp31-.Ltmp30                #   Call between .Ltmp30 and .Ltmp31
	.uleb128 .Ltmp32-.Lfunc_begin0          #     jumps to .Ltmp32
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp33-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp34-.Ltmp33                #   Call between .Ltmp33 and .Ltmp34
	.uleb128 .Ltmp35-.Lfunc_begin0          #     jumps to .Ltmp35
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp36-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp37-.Ltmp36                #   Call between .Ltmp36 and .Ltmp37
	.uleb128 .Ltmp38-.Lfunc_begin0          #     jumps to .Ltmp38
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp39-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp40-.Ltmp39                #   Call between .Ltmp39 and .Ltmp40
	.uleb128 .Ltmp41-.Lfunc_begin0          #     jumps to .Ltmp41
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp42-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp63-.Ltmp42                #   Call between .Ltmp42 and .Ltmp63
	.uleb128 .Ltmp64-.Lfunc_begin0          #     jumps to .Ltmp64
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp65-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Ltmp66-.Ltmp65                #   Call between .Ltmp65 and .Ltmp66
	.uleb128 .Ltmp67-.Lfunc_begin0          #     jumps to .Ltmp67
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp68-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Ltmp69-.Ltmp68                #   Call between .Ltmp68 and .Ltmp69
	.uleb128 .Ltmp70-.Lfunc_begin0          #     jumps to .Ltmp70
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp71-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp80-.Ltmp71                #   Call between .Ltmp71 and .Ltmp80
	.uleb128 .Ltmp81-.Lfunc_begin0          #     jumps to .Ltmp81
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp80-.Lfunc_begin0          # >> Call Site 15 <<
	.uleb128 .Lfunc_end3-.Ltmp80            #   Call between .Ltmp80 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIfSaIfEEC2ERKS1_,"axG",@progbits,_ZNSt6vectorIfSaIfEEC2ERKS1_,comdat
	.weak	_ZNSt6vectorIfSaIfEEC2ERKS1_    # -- Begin function _ZNSt6vectorIfSaIfEEC2ERKS1_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIfSaIfEEC2ERKS1_,@function
_ZNSt6vectorIfSaIfEEC2ERKS1_:           # @_ZNSt6vectorIfSaIfEEC2ERKS1_
	.cfi_startproc
# %bb.0:
	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	%rsi, %r14
	movq	%rdi, %rbx
	movq	8(%rsi), %rax
	movq	(%rsi), %rcx
	movq	%rax, %r12
	subq	%rcx, %r12
	sarq	$2, %r12
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	cmpq	%rcx, %rax
	je	.LBB4_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIfE8allocateEmPKv
	movq	%rax, %r15
	jmp	.LBB4_3
.LBB4_1:
	xorl	%r15d, %r15d
.LBB4_3:
	movq	%r15, (%rbx)
	movq	%r15, 8(%rbx)
	leaq	(%r15,%r12,4), %rax
	movq	%rax, 16(%rbx)
	movq	(%r14), %rsi
	movq	8(%r14), %r14
	subq	%rsi, %r14
	cmpq	$5, %r14
	jl	.LBB4_5
# %bb.4:
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	memmove@PLT
.LBB4_7:
	addq	%r14, %r15
	movq	%r15, 8(%rbx)
	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
	retq
.LBB4_5:
	.cfi_def_cfa_offset 48
	cmpq	$4, %r14
	jne	.LBB4_7
# %bb.6:
	movss	(%rsi), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%r15)
	jmp	.LBB4_7
.Lfunc_end4:
	.size	_ZNSt6vectorIfSaIfEEC2ERKS1_, .Lfunc_end4-_ZNSt6vectorIfSaIfEEC2ERKS1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZN9dev_arrayIfE3setEPKfm,"axG",@progbits,_ZN9dev_arrayIfE3setEPKfm,comdat
	.weak	_ZN9dev_arrayIfE3setEPKfm       # -- Begin function _ZN9dev_arrayIfE3setEPKfm
	.p2align	1, 0x90
	.type	_ZN9dev_arrayIfE3setEPKfm,@function
_ZN9dev_arrayIfE3setEPKfm:              # @_ZN9dev_arrayIfE3setEPKfm
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%r14
	.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 %r14, -16
	movq	(%rdi), %rax
	movq	8(%rdi), %rcx
	subq	%rax, %rcx
	sarq	$2, %rcx
	cmpq	%rdx, %rcx
	cmovbq	%rcx, %rdx
	shlq	$2, %rdx
	movq	%rax, %rdi
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB5_1
# %bb.4:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB5_1:
	.cfi_def_cfa_offset 32
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %rbx
.Ltmp82:
	movl	$.L.str.7, %esi
	movq	%rax, %rdi
	callq	_ZNSt13runtime_errorC1EPKc
.Ltmp83:
# %bb.2:
	movl	$_ZTISt13runtime_error, %esi
	movl	$_ZNSt13runtime_errorD1Ev, %edx
	movq	%rbx, %rdi
	callq	__cxa_throw
.LBB5_3:
.Ltmp84:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	__cxa_free_exception
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end5:
	.size	_ZN9dev_arrayIfE3setEPKfm, .Lfunc_end5-_ZN9dev_arrayIfE3setEPKfm
	.cfi_endproc
	.section	.gcc_except_table._ZN9dev_arrayIfE3setEPKfm,"aG",@progbits,_ZN9dev_arrayIfE3setEPKfm,comdat
	.p2align	2, 0x0
GCC_except_table5:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp82-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp82
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp82-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp83-.Ltmp82                #   Call between .Ltmp82 and .Ltmp83
	.uleb128 .Ltmp84-.Lfunc_begin1          #     jumps to .Ltmp84
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp83-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Lfunc_end5-.Ltmp83            #   Call between .Ltmp83 and .Lfunc_end5
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZN9dev_arrayIfE3getEPfm,"axG",@progbits,_ZN9dev_arrayIfE3getEPfm,comdat
	.weak	_ZN9dev_arrayIfE3getEPfm        # -- Begin function _ZN9dev_arrayIfE3getEPfm
	.p2align	1, 0x90
	.type	_ZN9dev_arrayIfE3getEPfm,@function
_ZN9dev_arrayIfE3getEPfm:               # @_ZN9dev_arrayIfE3getEPfm
.Lfunc_begin2:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception2
# %bb.0:
	pushq	%r14
	.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 %r14, -16
	movq	%rsi, %rax
	movq	(%rdi), %rsi
	movq	8(%rdi), %rcx
	subq	%rsi, %rcx
	sarq	$2, %rcx
	cmpq	%rdx, %rcx
	cmovbq	%rcx, %rdx
	shlq	$2, %rdx
	movq	%rax, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB6_1
# %bb.4:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB6_1:
	.cfi_def_cfa_offset 32
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %rbx
.Ltmp85:
	movl	$.L.str.8, %esi
	movq	%rax, %rdi
	callq	_ZNSt13runtime_errorC1EPKc
.Ltmp86:
# %bb.2:
	movl	$_ZTISt13runtime_error, %esi
	movl	$_ZNSt13runtime_errorD1Ev, %edx
	movq	%rbx, %rdi
	callq	__cxa_throw
.LBB6_3:
.Ltmp87:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	__cxa_free_exception
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end6:
	.size	_ZN9dev_arrayIfE3getEPfm, .Lfunc_end6-_ZN9dev_arrayIfE3getEPfm
	.cfi_endproc
	.section	.gcc_except_table._ZN9dev_arrayIfE3getEPfm,"aG",@progbits,_ZN9dev_arrayIfE3getEPfm,comdat
	.p2align	2, 0x0
GCC_except_table6:
.Lexception2:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end2-.Lcst_begin2
.Lcst_begin2:
	.uleb128 .Lfunc_begin2-.Lfunc_begin2    # >> Call Site 1 <<
	.uleb128 .Ltmp85-.Lfunc_begin2          #   Call between .Lfunc_begin2 and .Ltmp85
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp85-.Lfunc_begin2          # >> Call Site 2 <<
	.uleb128 .Ltmp86-.Ltmp85                #   Call between .Ltmp85 and .Ltmp86
	.uleb128 .Ltmp87-.Lfunc_begin2          #     jumps to .Ltmp87
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp86-.Lfunc_begin2          # >> Call Site 3 <<
	.uleb128 .Lfunc_end6-.Ltmp86            #   Call between .Ltmp86 and .Lfunc_end6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZN9dev_arrayIfED2Ev,"axG",@progbits,_ZN9dev_arrayIfED2Ev,comdat
	.weak	_ZN9dev_arrayIfED2Ev            # -- Begin function _ZN9dev_arrayIfED2Ev
	.p2align	1, 0x90
	.type	_ZN9dev_arrayIfED2Ev,@function
_ZN9dev_arrayIfED2Ev:                   # @_ZN9dev_arrayIfED2Ev
.Lfunc_begin3:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception3
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.LBB7_3
# %bb.1:
.Ltmp88:
	callq	hipFree
.Ltmp89:
# %bb.2:                                # %.noexc
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
.LBB7_3:                                # %_ZN9dev_arrayIfE4freeEv.exit
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB7_4:
	.cfi_def_cfa_offset 16
.Ltmp90:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end7:
	.size	_ZN9dev_arrayIfED2Ev, .Lfunc_end7-_ZN9dev_arrayIfED2Ev
	.cfi_endproc
	.section	.gcc_except_table._ZN9dev_arrayIfED2Ev,"aG",@progbits,_ZN9dev_arrayIfED2Ev,comdat
	.p2align	2, 0x0
GCC_except_table7:
.Lexception3:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end3-.Lcst_begin3
.Lcst_begin3:
	.uleb128 .Ltmp88-.Lfunc_begin3          # >> Call Site 1 <<
	.uleb128 .Ltmp89-.Ltmp88                #   Call between .Ltmp88 and .Ltmp89
	.uleb128 .Ltmp90-.Lfunc_begin3          #     jumps to .Ltmp90
	.byte	1                               #   On action: 1
.Lcst_end3:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end8:
	.size	__clang_call_terminate, .Lfunc_end8-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIfE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIfE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIfE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIfE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIfE8allocateEmPKv,@function
_ZNSt15__new_allocatorIfE8allocateEmPKv: # @_ZNSt15__new_allocatorIfE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB9_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB9_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB9_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB9_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end9:
	.size	_ZNSt15__new_allocatorIfE8allocateEmPKv, .Lfunc_end9-_ZNSt15__new_allocatorIfE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZN9dev_arrayIfE8allocateEm,"axG",@progbits,_ZN9dev_arrayIfE8allocateEm,comdat
	.weak	_ZN9dev_arrayIfE8allocateEm     # -- Begin function _ZN9dev_arrayIfE8allocateEm
	.p2align	1, 0x90
	.type	_ZN9dev_arrayIfE8allocateEm,@function
_ZN9dev_arrayIfE8allocateEm:            # @_ZN9dev_arrayIfE8allocateEm
.Lfunc_begin4:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception4
# %bb.0:
	pushq	%r14
	.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 %r14, -16
	movq	%rsi, %r14
	movq	%rdi, %rbx
	shlq	$2, %r14
	movq	%r14, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB10_1
# %bb.4:
	addq	(%rbx), %r14
	movq	%r14, 8(%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB10_1:
	.cfi_def_cfa_offset 32
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %rbx
.Ltmp91:
	movl	$.L.str.6, %esi
	movq	%rax, %rdi
	callq	_ZNSt13runtime_errorC1EPKc
.Ltmp92:
# %bb.2:
	movl	$_ZTISt13runtime_error, %esi
	movl	$_ZNSt13runtime_errorD1Ev, %edx
	movq	%rbx, %rdi
	callq	__cxa_throw
.LBB10_3:
.Ltmp93:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	__cxa_free_exception
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end10:
	.size	_ZN9dev_arrayIfE8allocateEm, .Lfunc_end10-_ZN9dev_arrayIfE8allocateEm
	.cfi_endproc
	.section	.gcc_except_table._ZN9dev_arrayIfE8allocateEm,"aG",@progbits,_ZN9dev_arrayIfE8allocateEm,comdat
	.p2align	2, 0x0
GCC_except_table10:
.Lexception4:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end4-.Lcst_begin4
.Lcst_begin4:
	.uleb128 .Lfunc_begin4-.Lfunc_begin4    # >> Call Site 1 <<
	.uleb128 .Ltmp91-.Lfunc_begin4          #   Call between .Lfunc_begin4 and .Ltmp91
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp91-.Lfunc_begin4          # >> Call Site 2 <<
	.uleb128 .Ltmp92-.Ltmp91                #   Call between .Ltmp91 and .Ltmp92
	.uleb128 .Ltmp93-.Lfunc_begin4          #     jumps to .Ltmp93
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp92-.Lfunc_begin4          # >> Call Site 3 <<
	.uleb128 .Lfunc_end10-.Ltmp92           #   Call between .Ltmp92 and .Lfunc_end10
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end4:
	.p2align	2, 0x0
                                        # -- 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	$_Z26matrixMultiplicationKernelPfS_S_i, %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	_Z26matrixMultiplicationKernelPfS_S_i,@object # @_Z26matrixMultiplicationKernelPfS_S_i
	.section	.rodata,"a",@progbits
	.globl	_Z26matrixMultiplicationKernelPfS_S_i
	.p2align	3, 0x0
_Z26matrixMultiplicationKernelPfS_S_i:
	.quad	_Z41__device_stub__matrixMultiplicationKernelPfS_S_i
	.size	_Z26matrixMultiplicationKernelPfS_S_i, 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	"\n> Matrix A"
	.size	.L.str.1, 12

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"\n> Matrix B"
	.size	.L.str.2, 12

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"\n> Matrix C"
	.size	.L.str.3, 12

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"\n> Error (CPU vs GPU): "
	.size	.L.str.4, 24

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"failed to allocate device memory"
	.size	.L.str.6, 33

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"failed to copy to device memory"
	.size	.L.str.7, 32

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"failed to copy to host memory"
	.size	.L.str.8, 30

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z26matrixMultiplicationKernelPfS_S_i"
	.size	.L__unnamed_1, 38

	.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 _Z41__device_stub__matrixMultiplicationKernelPfS_S_i
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z26matrixMultiplicationKernelPfS_S_i
	.addrsig_sym _ZSt4cout
	.addrsig_sym _ZTISt13runtime_error
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z26matrixMultiplicationKernelPfS_S_i ; -- Begin function _Z26matrixMultiplicationKernelPfS_S_i
	.globl	_Z26matrixMultiplicationKernelPfS_S_i
	.p2align	8
	.type	_Z26matrixMultiplicationKernelPfS_S_i,@function
_Z26matrixMultiplicationKernelPfS_S_i:  ; @_Z26matrixMultiplicationKernelPfS_S_i
; %bb.0:
	s_clause 0x3
	s_load_b32 s3, s[0:1], 0x2c
	s_load_b32 s2, s[0:1], 0x18
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v2, 0x3ff, v0
	v_mov_b32_e32 v6, 0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s8, s3, 16
	s_and_b32 s3, s3, 0xffff
	v_mad_u64_u32 v[3:4], null, s15, s8, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[0:1], null, s14, s3, v[2:3]
	v_mul_lo_u32 v1, v3, s2
	s_mov_b32 s3, exec_lo
	v_max3_i32 v2, v3, v0, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s2, v2
	s_cbranch_execz .LBB0_3
; %bb.1:                                ; %.lr.ph.preheader
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_ashrrev_i32_e32 v2, 31, v1
	v_mov_b32_e32 v6, 0
	v_mov_b32_e32 v4, v0
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	s_mov_b32 s4, s2
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	v_ashrrev_i32_e32 v5, 31, v4
	s_add_i32 s4, s4, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_cmp_lg_u32 s4, 0
	v_lshlrev_b64 v[7:8], 2, v[4:5]
	v_add_nc_u32_e32 v4, s2, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v7, vcc_lo, s6, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s7, v8, vcc_lo
	global_load_b32 v5, v[2:3], off
	global_load_b32 v7, v[7:8], off
	v_add_co_u32 v2, vcc_lo, v2, 4
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v6, v5, v7
	s_cbranch_scc1 .LBB0_2
.LBB0_3:                                ; %Flow47
	s_or_b32 exec_lo, exec_lo, s3
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v1, v0
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v6, off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z26matrixMultiplicationKernelPfS_S_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 9
		.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	_Z26matrixMultiplicationKernelPfS_S_i, .Lfunc_end0-_Z26matrixMultiplicationKernelPfS_S_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 320
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; 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:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z26matrixMultiplicationKernelPfS_S_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z26matrixMultiplicationKernelPfS_S_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
