//matrix multiply using shared memory for optimization

#include <cassert>
#include <cstdlib>
#include <ctime>
#include <random>
#include <iostream>

#define BSZ 128
#define TSZ 16
#define SZ (BSZ * TSZ)
#define TT double

using namespace std;

default_random_engine& get_default_random_engine(){
  static default_random_engine eng(time(0));
  return eng;
}

template <typename T>
void random_matrix(T* m, size_t sz){
  uniform_real_distribution<T> dist(-100.F, 100.F);
  default_random_engine& eng = get_default_random_engine();

  for (size_t i = 0; i < sz; ++i)
    m[i] = dist(eng);
}

#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(cudaError_t code, const char *file, int line, bool abort=true)
{
   if (code != cudaSuccess) 
   {
      fprintf(stderr,"GPUassert: %s %s %d\n", cudaGetErrorString(code), file, line);
      if (abort) exit(code);
   }
}

template <typename T>
struct CudaMtx {
  T* data;
  size_t rows;
  size_t cols;
  size_t stride;
};

template <typename T>
struct Mtx {
public:
  T* data;
  size_t rows;
  size_t cols;
  bool is_cuda;

  Mtx(bool is_cuda, size_t rows, size_t cols):
    data(nullptr), rows(rows), cols(cols), is_cuda(is_cuda) {
    if (is_cuda) { gpuErrchk(cudaMalloc(&data, sizeof(T) * rows * cols)); }
    else         data = new T[rows * cols];
  }

  ~Mtx(){
    if (is_cuda) { gpuErrchk(cudaFree(data)); }
    else         delete[] data;
  }

  CudaMtx<T> cuda_mtx(){
    assert(is_cuda);
    CudaMtx<T> ret;
    ret.data = data;
    ret.rows = rows;
    ret.cols = ret.stride = cols;
    return ret;
  }
};

template <typename T>
__device__ T get_elem(CudaMtx<T>& a, size_t i, size_t j){
  return a.data[i * a.stride + j];
}

template <typename T>
__device__ void set_elem(CudaMtx<T>& a, size_t i, size_t j, T val){
  a.data[i * a.stride + j] = val;
}

template <typename T>
__device__ CudaMtx<T> sub_matrix_stride(CudaMtx<T>& m, size_t row_stride, size_t col_stride){
  CudaMtx<T> ret;
  ret.data = &m.data[m.cols * TSZ * row_stride + TSZ * col_stride];
  ret.rows = ret.cols = TSZ;
  ret.stride = m.stride;
  return ret;
}

template <typename T>
__global__ void matrix_multiply_cuda_v2(CudaMtx<T> c, CudaMtx<T> a, CudaMtx<T> b){
  size_t bx = blockIdx.x, by = blockIdx.y;
  CudaMtx<T> csub = sub_matrix_stride(c, bx, by);

  T cval = 0.;

  size_t row = threadIdx.x, col = threadIdx.y;

  for (size_t i = 0; i < BSZ; ++i){
    CudaMtx<T> asub = sub_matrix_stride(a, bx, i);
    CudaMtx<T> bsub = sub_matrix_stride(b, i, by);

    __shared__ T amem[TSZ][TSZ];
    __shared__ T bmem[TSZ][TSZ];

    amem[row][col] = get_elem(asub, row, col);
    bmem[row][col] = get_elem(bsub, row, col);

    __syncthreads();

    for (size_t j = 0; j < TSZ; ++j)
      cval += amem[row][j] * bmem[j][col];

    __syncthreads();
  }

  set_elem(csub, row, col, cval);
}

template <typename T>
clock_t matrix_multiply_v1(Mtx<T>& c, Mtx<T>& a, Mtx<T>& b){
  for (size_t i = 0; i < c.rows; ++i)
    for (size_t j = 0; j < c.cols; ++j){
      c.data[i * c.cols + j] = 0.;
      for (size_t k = 0; k < a.cols; ++k)
        c.data[i * c.cols + j] += a.data[i * a.cols + k] * b.data[k * b.cols + j];
    }

  return clock();
}

int main(){
  Mtx<TT> c(false, SZ, SZ), a(false, SZ, SZ), b(false, SZ, SZ), d(false, SZ, SZ);
  Mtx<TT> dc(true, SZ, SZ), da(true, SZ, SZ), db(true, SZ, SZ);

  random_matrix(a.data, SZ * SZ);
  random_matrix(b.data, SZ * SZ);

  clock_t timing_start = clock();

  gpuErrchk(cudaMemcpy(da.data, a.data, sizeof(TT) * SZ * SZ, cudaMemcpyHostToDevice));
  gpuErrchk(cudaMemcpy(db.data, b.data, sizeof(TT) * SZ * SZ, cudaMemcpyHostToDevice));

  dim3 dblock(BSZ, BSZ);
  dim3 dthread(TSZ, TSZ);
  matrix_multiply_cuda_v2<<<dblock, dthread>>>(dc.cuda_mtx(), da.cuda_mtx(), db.cuda_mtx());
  gpuErrchk(cudaPeekAtLastError());
  gpuErrchk(cudaDeviceSynchronize());

  gpuErrchk(cudaMemcpy(c.data, dc.data, sizeof(TT) * SZ * SZ, cudaMemcpyDeviceToHost));

  cout << "CUDA time: " << (clock() - timing_start) / (double)(CLOCKS_PER_SEC / 1000) << " ms" << endl;

  timing_start = clock();

  clock_t timing_end = matrix_multiply_v1(d, a, b);

  cout << "CPU time: " << (timing_end - timing_start) / (double)(CLOCKS_PER_SEC / 1000) << " ms" << endl;

  size_t mismatch = 0;
  for (size_t i = 0; i < SZ * SZ; ++i)
    if (fabs(c.data[i] - d.data[i]) / d.data[i] > 5e-3F){
      cout << "difference: " << (fabs(c.data[i] - d.data[i]) / d.data[i]) << endl;
      mismatch++;
      break;
    }

  if (mismatch == 0) cout << "All values match" << endl;
  else               cout << mismatch << " differences" << endl;
}

	.file	"tmpxft_0037d67c_00000000-6_matrix_multiply_v2.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4734:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4734:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_ZL63__device_stub__Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_R7CudaMtxIdES1_S1_, @function
_ZL63__device_stub__Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_R7CudaMtxIdES1_S1_:
.LFB4756:
	.cfi_startproc
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rcx
	movq	%rdi, 64(%rsp)
	movabsq	$4294967297, %rax
	movq	%rsi, 72(%rsp)
	leaq	16(%rsp), %rdi
	leaq	28(%rsp), %rsi
	movq	%rdx, 80(%rsp)
	movq	%rsp, %rdx
	movq	%rax, 16(%rsp)
	movl	$1, 24(%rsp)
	movq	%rax, 28(%rsp)
	movl	$1, 36(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	8(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_(%rip), %rdi
	pushq	8(%rsp)
	.cfi_def_cfa_offset 128
	movq	44(%rsp), %rcx
	movl	52(%rsp), %r8d
	movq	32(%rsp), %rsi
	movl	40(%rsp), %edx
	leaq	80(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L2:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4756:
	.size	_ZL63__device_stub__Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_R7CudaMtxIdES1_S1_, .-_ZL63__device_stub__Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_R7CudaMtxIdES1_S1_
	.section	.text._Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,"axG",@progbits,_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,comdat
	.weak	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.type	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_, @function
_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_:
.LFB5086:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	80(%rsp), %rdx
	leaq	48(%rsp), %rsi
	leaq	16(%rsp), %rdi
	call	_ZL63__device_stub__Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_R7CudaMtxIdES1_S1_
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5086:
	.size	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_, .-_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.text
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB5472:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE5472:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z25get_default_random_enginev
	.type	_Z25get_default_random_enginev, @function
_Z25get_default_random_enginev:
.LFB4719:
	.cfi_startproc
	endbr64
	movb	_ZGVZ25get_default_random_enginevE3eng(%rip), %al
	testb	%al, %al
	jne	.L18
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZGVZ25get_default_random_enginevE3eng(%rip), %rbx
	movq	%rbx, %rdi
	call	__cxa_guard_acquire@PLT
	testl	%eax, %eax
	je	.L12
	xorl	%edi, %edi
	call	time@PLT
	xorl	%edx, %edx
	movl	$2147483647, %ecx
	movq	%rbx, %rdi
	divq	%rcx
	movl	$1, %eax
	testq	%rdx, %rdx
	cmove	%rax, %rdx
	movq	%rdx, _ZZ25get_default_random_enginevE3eng(%rip)
	call	__cxa_guard_release@PLT
.L12:
	leaq	_ZZ25get_default_random_enginevE3eng(%rip), %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore 3
	leaq	_ZZ25get_default_random_enginevE3eng(%rip), %rax
	ret
	.cfi_endproc
.LFE4719:
	.size	_Z25get_default_random_enginev, .-_Z25get_default_random_enginev
	.section	.rodata._Z9gpuAssert9cudaErrorPKcib.str1.1,"aMS",@progbits,1
.LC0:
	.string	"GPUassert: %s %s %d\n"
	.section	.text._Z9gpuAssert9cudaErrorPKcib,"axG",@progbits,_Z9gpuAssert9cudaErrorPKcib,comdat
	.weak	_Z9gpuAssert9cudaErrorPKcib
	.type	_Z9gpuAssert9cudaErrorPKcib, @function
_Z9gpuAssert9cudaErrorPKcib:
.LFB4721:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L27
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%ecx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%edx, 12(%rsp)
	movq	%rsi, (%rsp)
	call	cudaGetErrorString@PLT
	movl	12(%rsp), %r9d
	movq	(%rsp), %r8
	leaq	.LC0(%rip), %rdx
	movq	stderr(%rip), %rdi
	movq	%rax, %rcx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	testb	%bpl, %bpl
	je	.L21
	movl	%ebx, %edi
	call	exit@PLT
.L21:
	addq	$24, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE4721:
	.size	_Z9gpuAssert9cudaErrorPKcib, .-_Z9gpuAssert9cudaErrorPKcib
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4759:
	.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	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_(%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
.LFE4759:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata._ZN3MtxIdEC2Ebmm.str1.1,"aMS",@progbits,1
.LC2:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/armandli/cuda_examples/master/matrix_multiply_v2.cu"
	.section	.text._ZN3MtxIdEC2Ebmm,"axG",@progbits,_ZN3MtxIdEC5Ebmm,comdat
	.align 2
	.weak	_ZN3MtxIdEC2Ebmm
	.type	_ZN3MtxIdEC2Ebmm, @function
_ZN3MtxIdEC2Ebmm:
.LFB5079:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	xorl	%eax, %eax
	movq	%rdi, %rbx
	movq	%rdx, 8(%rdi)
	imulq	%rcx, %rdx
	testb	%sil, %sil
	movb	%sil, 24(%rdi)
	movq	%rax, (%rdi)
	movq	%rcx, 16(%rdi)
	leaq	0(,%rdx,8), %rsi
	je	.L33
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$58, %edx
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	movl	%eax, %edi
	leaq	.LC2(%rip), %rsi
	jmp	_Z9gpuAssert9cudaErrorPKcib
.L33:
	.cfi_restore_state
	movabsq	$1152921504606846975, %rax
	cmpq	%rdx, %rax
	jb	.L34
	movq	%rsi, %rdi
	call	_Znam@PLT
	movq	%rax, (%rbx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L34:
	.cfi_restore_state
	call	__cxa_throw_bad_array_new_length@PLT
	.cfi_endproc
.LFE5079:
	.size	_ZN3MtxIdEC2Ebmm, .-_ZN3MtxIdEC2Ebmm
	.weak	_ZN3MtxIdEC1Ebmm
	.set	_ZN3MtxIdEC1Ebmm,_ZN3MtxIdEC2Ebmm
	.section	.text._ZN3MtxIdED2Ev,"axG",@progbits,_ZN3MtxIdED5Ev,comdat
	.align 2
	.weak	_ZN3MtxIdED2Ev
	.type	_ZN3MtxIdED2Ev, @function
_ZN3MtxIdED2Ev:
.LFB5082:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA5082
	endbr64
	cmpb	$0, 24(%rdi)
	movq	(%rdi), %rax
	je	.L39
	pushq	%rdx
	.cfi_def_cfa_offset 16
	movq	%rax, %rdi
	call	cudaFree@PLT
	movl	$1, %ecx
	movl	$63, %edx
	leaq	.LC2(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	popq	%rcx
	.cfi_def_cfa_offset 8
	ret
.L39:
	testq	%rax, %rax
	je	.L45
	movq	%rax, %rdi
	jmp	_ZdaPv@PLT
.L45:
	ret
	.cfi_endproc
.LFE5082:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table._ZN3MtxIdED2Ev,"aG",@progbits,_ZN3MtxIdED5Ev,comdat
.LLSDA5082:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE5082-.LLSDACSB5082
.LLSDACSB5082:
.LLSDACSE5082:
	.section	.text._ZN3MtxIdED2Ev,"axG",@progbits,_ZN3MtxIdED5Ev,comdat
	.size	_ZN3MtxIdED2Ev, .-_ZN3MtxIdED2Ev
	.weak	_ZN3MtxIdED1Ev
	.set	_ZN3MtxIdED1Ev,_ZN3MtxIdED2Ev
	.section	.text._Z13random_matrixIdEvPT_m,"axG",@progbits,_Z13random_matrixIdEvPT_m,comdat
	.weak	_Z13random_matrixIdEvPT_m
	.type	_Z13random_matrixIdEvPT_m, @function
_Z13random_matrixIdEvPT_m:
.LFB5084:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 32
	call	_Z25get_default_random_enginev
	movsd	.LC5(%rip), %xmm3
	xorl	%ecx, %ecx
	movsd	.LC6(%rip), %xmm4
	movsd	.LC7(%rip), %xmm5
	movq	%rax, %rsi
	movl	$2147483647, %edi
	xorps	%xmm2, %xmm2
	movsd	.LC8(%rip), %xmm6
	movsd	.LC9(%rip), %xmm7
.L49:
	cmpq	%rbp, %rcx
	je	.L58
	imulq	$16807, (%rsi), %rax
	xorl	%edx, %edx
	divq	%rdi
	movq	%rdx, %rax
	decq	%rax
	js	.L50
	cvtsi2sdq	%rax, %xmm0
	jmp	.L51
.L50:
	movq	%rax, %r8
	andl	$1, %eax
	shrq	%r8
	orq	%rax, %r8
	cvtsi2sdq	%r8, %xmm0
	addsd	%xmm0, %xmm0
.L51:
	imulq	$16807, %rdx, %rax
	xorl	%edx, %edx
	addsd	%xmm2, %xmm0
	divq	%rdi
	movq	%rdx, (%rsi)
	decq	%rdx
	js	.L52
	cvtsi2sdq	%rdx, %xmm1
	jmp	.L53
.L52:
	movq	%rdx, %rax
	andl	$1, %edx
	shrq	%rax
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm1
	addsd	%xmm1, %xmm1
.L53:
	mulsd	%xmm3, %xmm1
	addsd	%xmm1, %xmm0
	divsd	%xmm4, %xmm0
	comisd	%xmm5, %xmm0
	jb	.L54
	movsd	.LC3(%rip), %xmm0
.L54:
	mulsd	%xmm6, %xmm0
	subsd	%xmm7, %xmm0
	movsd	%xmm0, (%rbx,%rcx,8)
	incq	%rcx
	jmp	.L49
.L58:
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5084:
	.size	_Z13random_matrixIdEvPT_m, .-_Z13random_matrixIdEvPT_m
	.section	.rodata.str1.1
.LC10:
	.string	"CUDA time: "
.LC12:
	.string	" ms"
.LC13:
	.string	"CPU time: "
.LC16:
	.string	"difference: "
.LC17:
	.string	"All values match"
.LC18:
	.string	" differences"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4731:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4731
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$2048, %ecx
	movl	$2048, %edx
	xorl	%esi, %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	$408, %rsp
	.cfi_def_cfa_offset 464
	movq	%fs:40, %rax
	movq	%rax, 392(%rsp)
	xorl	%eax, %eax
	leaq	72(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, (%rsp)
.LEHB0:
	call	_ZN3MtxIdEC1Ebmm
.LEHE0:
	leaq	104(%rsp), %rdi
	movl	$2048, %ecx
	xorl	%esi, %esi
	movl	$2048, %edx
.LEHB1:
	call	_ZN3MtxIdEC1Ebmm
.LEHE1:
	leaq	136(%rsp), %rax
	movl	$2048, %ecx
	movl	$2048, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB2:
	call	_ZN3MtxIdEC1Ebmm
.LEHE2:
	leaq	168(%rsp), %rax
	movl	$2048, %ecx
	movl	$2048, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
.LEHB3:
	call	_ZN3MtxIdEC1Ebmm
.LEHE3:
	movl	$2048, %ecx
	movl	$2048, %edx
	movl	$1, %esi
	leaq	200(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
.LEHB4:
	call	_ZN3MtxIdEC1Ebmm
.LEHE4:
	movl	$2048, %ecx
	movl	$2048, %edx
	movl	$1, %esi
	leaq	232(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 32(%rsp)
.LEHB5:
	call	_ZN3MtxIdEC1Ebmm
.LEHE5:
	movl	$2048, %ecx
	movl	$2048, %edx
	movl	$1, %esi
	leaq	264(%rsp), %rdi
.LEHB6:
	call	_ZN3MtxIdEC1Ebmm
.LEHE6:
	movq	104(%rsp), %rdi
	movl	$4194304, %esi
	call	_Z13random_matrixIdEvPT_m
	movq	136(%rsp), %rdi
	movl	$4194304, %esi
	call	_Z13random_matrixIdEvPT_m
	call	clock@PLT
	movq	104(%rsp), %rsi
	movl	$1, %ecx
	movq	232(%rsp), %rdi
	movl	$33554432, %edx
	movq	%rax, %rbx
.LEHB7:
	call	cudaMemcpy@PLT
	leaq	.LC2(%rip), %rbp
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$147, %edx
	movq	%rbp, %rsi
	call	_Z9gpuAssert9cudaErrorPKcib
	movq	136(%rsp), %rsi
	movl	$1, %ecx
	movl	$33554432, %edx
	movq	264(%rsp), %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$148, %edx
	movq	%rbp, %rsi
	call	_Z9gpuAssert9cudaErrorPKcib
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$549755814016, %rdi
	movl	$1, 56(%rsp)
	movabsq	$68719476752, %rdx
	movq	%rdi, 48(%rsp)
	movq	%rdx, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L60
	movq	248(%rsp), %rdx
	movq	216(%rsp), %rcx
	leaq	296(%rsp), %rdi
	movq	200(%rsp), %rsi
	movq	280(%rsp), %rax
	movq	%rdx, 344(%rsp)
	movq	%rdx, 352(%rsp)
	movq	264(%rsp), %rdx
	movq	%rcx, 312(%rsp)
	movq	%rcx, 320(%rsp)
	movq	232(%rsp), %rcx
	movq	%rsi, 296(%rsp)
	movq	208(%rsp), %rsi
	movq	%rdx, 360(%rsp)
	movq	272(%rsp), %rdx
	movq	%rcx, 328(%rsp)
	movq	240(%rsp), %rcx
	movq	%rsi, 304(%rsp)
	leaq	328(%rsp), %rsi
	movq	%rdx, 368(%rsp)
	leaq	360(%rsp), %rdx
	movq	%rcx, 336(%rsp)
	movq	%rax, 376(%rsp)
	movq	%rax, 384(%rsp)
	call	_ZL63__device_stub__Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_R7CudaMtxIdES1_S1_
.L60:
	call	cudaPeekAtLastError@PLT
	leaq	.LC2(%rip), %rbp
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$153, %edx
	movq	%rbp, %rsi
	call	_Z9gpuAssert9cudaErrorPKcib
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$154, %edx
	movq	%rbp, %rsi
	call	_Z9gpuAssert9cudaErrorPKcib
	movq	72(%rsp), %rdi
	movl	$2, %ecx
	movl	$33554432, %edx
	movq	200(%rsp), %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$156, %edx
	movq	%rbp, %rsi
	call	_Z9gpuAssert9cudaErrorPKcib
	leaq	.LC10(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rbp
	call	clock@PLT
	movq	%rbp, %rdi
	subq	%rbx, %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC11(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	call	clock@PLT
	movq	120(%rsp), %rbx
	xorl	%ecx, %ecx
	xorl	%edi, %edi
	movq	%rax, 40(%rsp)
	movq	152(%rsp), %rax
	xorl	%r9d, %r9d
	movq	176(%rsp), %r15
	movq	184(%rsp), %r11
	movq	168(%rsp), %r13
	movq	104(%rsp), %r12
	leaq	0(,%rax,8), %r8
	movq	136(%rsp), %r14
.L61:
	cmpq	%r15, %r9
	je	.L65
	leaq	0(%r13,%rdi,8), %rsi
	leaq	(%r12,%rcx,8), %rbp
	xorl	%eax, %eax
.L66:
	cmpq	%rax, %r11
	je	.L98
	leaq	(%r14,%rax,8), %r10
	xorps	%xmm0, %xmm0
	xorl	%edx, %edx
.L62:
	movsd	%xmm0, (%rsi)
	cmpq	%rdx, %rbx
	je	.L99
	movsd	0(%rbp,%rdx,8), %xmm1
	mulsd	(%r10), %xmm1
	incq	%rdx
	addq	%r8, %r10
	addsd	%xmm1, %xmm0
	jmp	.L62
.L99:
	incq	%rax
	addq	$8, %rsi
	jmp	.L66
.L98:
	incq	%r9
	addq	%r11, %rdi
	addq	%rbx, %rcx
	jmp	.L61
.L65:
	call	clock@PLT
	leaq	_ZSt4cout(%rip), %rbp
	leaq	.LC13(%rip), %rsi
	movq	%rbp, %rdi
	movq	%rax, %rbx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	40(%rsp), %rax
	subq	%rax, %rbx
	cvtsi2sdq	%rbx, %xmm0
	divsd	.LC11(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	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	72(%rsp), %rax
	movq	168(%rsp), %rdx
	xorl	%ebx, %ebx
	movsd	.LC15(%rip), %xmm2
.L70:
	movsd	(%rdx,%rbx), %xmm1
	movsd	(%rax,%rbx), %xmm0
	subsd	%xmm1, %xmm0
	andps	.LC14(%rip), %xmm0
	divsd	%xmm1, %xmm0
	comisd	%xmm2, %xmm0
	jbe	.L90
	leaq	.LC16(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	168(%rsp), %rax
	movsd	(%rax,%rbx), %xmm1
	movq	72(%rsp), %rax
	movsd	(%rax,%rbx), %xmm0
	subsd	%xmm1, %xmm0
	andps	.LC14(%rip), %xmm0
	divsd	%xmm1, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$1, %esi
	movq	%rbp, %rdi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC18(%rip), %rsi
	jmp	.L97
.L90:
	addq	$8, %rbx
	cmpq	$33554432, %rbx
	jne	.L70
	leaq	.LC17(%rip), %rsi
	movq	%rbp, %rdi
.L97:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.LEHE7:
	leaq	264(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	movq	32(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	movq	24(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	movq	16(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	movq	8(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	leaq	104(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	movq	(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	movq	392(%rsp), %rax
	subq	%fs:40, %rax
	je	.L80
	jmp	.L92
.L87:
	endbr64
	movq	%rax, %rbx
.L72:
	leaq	264(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	jmp	.L73
.L86:
	endbr64
	movq	%rax, %rbx
.L73:
	leaq	232(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	jmp	.L74
.L85:
	endbr64
	movq	%rax, %rbx
.L74:
	leaq	200(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	jmp	.L75
.L84:
	endbr64
	movq	%rax, %rbx
.L75:
	leaq	168(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	jmp	.L76
.L83:
	endbr64
	movq	%rax, %rbx
.L76:
	leaq	136(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	jmp	.L77
.L82:
	endbr64
	movq	%rax, %rbx
.L77:
	leaq	104(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	jmp	.L78
.L81:
	endbr64
	movq	%rax, %rbx
.L78:
	movq	(%rsp), %rdi
	call	_ZN3MtxIdED1Ev
	movq	392(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L92
	movq	%rbx, %rdi
.LEHB8:
	call	_Unwind_Resume@PLT
.LEHE8:
.L92:
	call	__stack_chk_fail@PLT
.L80:
	addq	$408, %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
.LFE4731:
	.section	.gcc_except_table,"a",@progbits
.LLSDA4731:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4731-.LLSDACSB4731
.LLSDACSB4731:
	.uleb128 .LEHB0-.LFB4731
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4731
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L81-.LFB4731
	.uleb128 0
	.uleb128 .LEHB2-.LFB4731
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L82-.LFB4731
	.uleb128 0
	.uleb128 .LEHB3-.LFB4731
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L83-.LFB4731
	.uleb128 0
	.uleb128 .LEHB4-.LFB4731
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L84-.LFB4731
	.uleb128 0
	.uleb128 .LEHB5-.LFB4731
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L85-.LFB4731
	.uleb128 0
	.uleb128 .LEHB6-.LFB4731
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L86-.LFB4731
	.uleb128 0
	.uleb128 .LEHB7-.LFB4731
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L87-.LFB4731
	.uleb128 0
	.uleb128 .LEHB8-.LFB4731
	.uleb128 .LEHE8-.LEHB8
	.uleb128 0
	.uleb128 0
.LLSDACSE4731:
	.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
	.local	_ZGVZ25get_default_random_enginevE3eng
	.comm	_ZGVZ25get_default_random_enginevE3eng,8,8
	.local	_ZZ25get_default_random_enginevE3eng
	.comm	_ZZ25get_default_random_enginevE3eng,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	-1
	.long	1072693247
	.align 8
.LC5:
	.long	-8388608
	.long	1105199103
	.align 8
.LC6:
	.long	-16777216
	.long	1137704959
	.align 8
.LC7:
	.long	0
	.long	1072693248
	.align 8
.LC8:
	.long	0
	.long	1080623104
	.align 8
.LC9:
	.long	0
	.long	1079574528
	.align 8
.LC11:
	.long	0
	.long	1083129856
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC14:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC15:
	.long	1073741824
	.long	1064598241
	.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:

//matrix multiply using shared memory for optimization


#include <hip/hip_runtime.h>
#include <cassert>
#include <cstdlib>
#include <ctime>
#include <random>
#include <iostream>

#define BSZ 128
#define TSZ 16
#define SZ (BSZ * TSZ)
#define TT double

using namespace std;

default_random_engine& get_default_random_engine(){
  static default_random_engine eng(time(0));
  return eng;
}

template <typename T>
void random_matrix(T* m, size_t sz){
  uniform_real_distribution<T> dist(-100.F, 100.F);
  default_random_engine& eng = get_default_random_engine();

  for (size_t i = 0; i < sz; ++i)
    m[i] = dist(eng);
}

#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(hipError_t code, const char *file, int line, bool abort=true)
{
   if (code != hipSuccess) 
   {
      fprintf(stderr,"GPUassert: %s %s %d\n", hipGetErrorString(code), file, line);
      if (abort) exit(code);
   }
}

template <typename T>
struct CudaMtx {
  T* data;
  size_t rows;
  size_t cols;
  size_t stride;
};

template <typename T>
struct Mtx {
public:
  T* data;
  size_t rows;
  size_t cols;
  bool is_cuda;

  Mtx(bool is_cuda, size_t rows, size_t cols):
    data(nullptr), rows(rows), cols(cols), is_cuda(is_cuda) {
    if (is_cuda) { gpuErrchk(hipMalloc(&data, sizeof(T) * rows * cols)); }
    else         data = new T[rows * cols];
  }

  ~Mtx(){
    if (is_cuda) { gpuErrchk(hipFree(data)); }
    else         delete[] data;
  }

  CudaMtx<T> cuda_mtx(){
    assert(is_cuda);
    CudaMtx<T> ret;
    ret.data = data;
    ret.rows = rows;
    ret.cols = ret.stride = cols;
    return ret;
  }
};

template <typename T>
__device__ T get_elem(CudaMtx<T>& a, size_t i, size_t j){
  return a.data[i * a.stride + j];
}

template <typename T>
__device__ void set_elem(CudaMtx<T>& a, size_t i, size_t j, T val){
  a.data[i * a.stride + j] = val;
}

template <typename T>
__device__ CudaMtx<T> sub_matrix_stride(CudaMtx<T>& m, size_t row_stride, size_t col_stride){
  CudaMtx<T> ret;
  ret.data = &m.data[m.cols * TSZ * row_stride + TSZ * col_stride];
  ret.rows = ret.cols = TSZ;
  ret.stride = m.stride;
  return ret;
}

template <typename T>
__global__ void matrix_multiply_cuda_v2(CudaMtx<T> c, CudaMtx<T> a, CudaMtx<T> b){
  size_t bx = blockIdx.x, by = blockIdx.y;
  CudaMtx<T> csub = sub_matrix_stride(c, bx, by);

  T cval = 0.;

  size_t row = threadIdx.x, col = threadIdx.y;

  for (size_t i = 0; i < BSZ; ++i){
    CudaMtx<T> asub = sub_matrix_stride(a, bx, i);
    CudaMtx<T> bsub = sub_matrix_stride(b, i, by);

    __shared__ T amem[TSZ][TSZ];
    __shared__ T bmem[TSZ][TSZ];

    amem[row][col] = get_elem(asub, row, col);
    bmem[row][col] = get_elem(bsub, row, col);

    __syncthreads();

    for (size_t j = 0; j < TSZ; ++j)
      cval += amem[row][j] * bmem[j][col];

    __syncthreads();
  }

  set_elem(csub, row, col, cval);
}

template <typename T>
clock_t matrix_multiply_v1(Mtx<T>& c, Mtx<T>& a, Mtx<T>& b){
  for (size_t i = 0; i < c.rows; ++i)
    for (size_t j = 0; j < c.cols; ++j){
      c.data[i * c.cols + j] = 0.;
      for (size_t k = 0; k < a.cols; ++k)
        c.data[i * c.cols + j] += a.data[i * a.cols + k] * b.data[k * b.cols + j];
    }

  return clock();
}

int main(){
  Mtx<TT> c(false, SZ, SZ), a(false, SZ, SZ), b(false, SZ, SZ), d(false, SZ, SZ);
  Mtx<TT> dc(true, SZ, SZ), da(true, SZ, SZ), db(true, SZ, SZ);

  random_matrix(a.data, SZ * SZ);
  random_matrix(b.data, SZ * SZ);

  clock_t timing_start = clock();

  gpuErrchk(hipMemcpy(da.data, a.data, sizeof(TT) * SZ * SZ, hipMemcpyHostToDevice));
  gpuErrchk(hipMemcpy(db.data, b.data, sizeof(TT) * SZ * SZ, hipMemcpyHostToDevice));

  dim3 dblock(BSZ, BSZ);
  dim3 dthread(TSZ, TSZ);
  matrix_multiply_cuda_v2<<<dblock, dthread>>>(dc.cuda_mtx(), da.cuda_mtx(), db.cuda_mtx());
  gpuErrchk(hipPeekAtLastError());
  gpuErrchk(hipDeviceSynchronize());

  gpuErrchk(hipMemcpy(c.data, dc.data, sizeof(TT) * SZ * SZ, hipMemcpyDeviceToHost));

  cout << "CUDA time: " << (clock() - timing_start) / (double)(CLOCKS_PER_SEC / 1000) << " ms" << endl;

  timing_start = clock();

  clock_t timing_end = matrix_multiply_v1(d, a, b);

  cout << "CPU time: " << (timing_end - timing_start) / (double)(CLOCKS_PER_SEC / 1000) << " ms" << endl;

  size_t mismatch = 0;
  for (size_t i = 0; i < SZ * SZ; ++i)
    if (fabs(c.data[i] - d.data[i]) / d.data[i] > 5e-3F){
      cout << "difference: " << (fabs(c.data[i] - d.data[i]) / d.data[i]) << endl;
      mismatch++;
      break;
    }

  if (mismatch == 0) cout << "All values match" << endl;
  else               cout << mismatch << " differences" << endl;
}

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

                                        # End of file scope inline assembly
	.globl	_Z25get_default_random_enginev  # -- Begin function _Z25get_default_random_enginev
	.type	_Z25get_default_random_enginev,@function
_Z25get_default_random_enginev:         # @_Z25get_default_random_enginev
	.cfi_startproc
# %bb.0:
	movb	_ZGVZ25get_default_random_enginevE3eng(%rip), %al
	testb	%al, %al
	je	.LBB0_1
.LBB0_4:
	movl	$_ZZ25get_default_random_enginevE3eng, %eax
	retq
.LBB0_1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	$_ZGVZ25get_default_random_enginevE3eng, %edi
	callq	__cxa_guard_acquire
	testl	%eax, %eax
	je	.LBB0_3
# %bb.2:
	xorl	%edi, %edi
	callq	time
	movq	%rax, %rcx
	movabsq	$8589934597, %rdx               # imm = 0x200000005
	mulq	%rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	shrq	%rax
	addq	%rdx, %rax
	shrq	$30, %rax
	movq	%rax, %rdx
	shlq	$31, %rdx
	subq	%rdx, %rax
	leaq	(%rcx,%rax), %rdx
	cmpq	$1, %rdx
	adcq	%rcx, %rax
	movq	%rax, _ZZ25get_default_random_enginevE3eng(%rip)
	movl	$_ZGVZ25get_default_random_enginevE3eng, %edi
	callq	__cxa_guard_release
.LBB0_3:
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	jmp	.LBB0_4
.Lfunc_end0:
	.size	_Z25get_default_random_enginev, .Lfunc_end0-_Z25get_default_random_enginev
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI1_0:
	.quad	0x408f400000000000              # double 1000
.LCPI1_2:
	.quad	0x3f747ae140000000              # double 0.004999999888241291
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI1_1:
	.quad	0x7fffffffffffffff              # double NaN
	.quad	0x7fffffffffffffff              # double NaN
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$400, %rsp                      # imm = 0x190
	.cfi_def_cfa_offset 432
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	movl	$2048, %ebx                     # imm = 0x800
	movq	%rbx, 104(%rsp)
	movq	%rbx, 112(%rsp)
	xorl	%ebp, %ebp
	movb	%bpl, 120(%rsp)
	.cfi_escape 0x2e, 0x00
	movl	$33554432, %edi                 # imm = 0x2000000
	callq	_Znam
	movq	%rax, 96(%rsp)
	movq	%rbx, 72(%rsp)
	movq	%rbx, 80(%rsp)
	movb	%bpl, 88(%rsp)
.Ltmp0:
	.cfi_escape 0x2e, 0x00
	movl	$33554432, %edi                 # imm = 0x2000000
	callq	_Znam
.Ltmp1:
# %bb.1:
	movq	%rax, 64(%rsp)
	movq	%rbx, 40(%rsp)
	movq	%rbx, 48(%rsp)
	movb	$0, 56(%rsp)
.Ltmp3:
	.cfi_escape 0x2e, 0x00
	movl	$33554432, %edi                 # imm = 0x2000000
	callq	_Znam
.Ltmp4:
# %bb.2:
	movq	%rax, 32(%rsp)
	movl	$2048, %eax                     # imm = 0x800
	movq	%rax, 8(%rsp)
	movq	%rax, 16(%rsp)
	movb	$0, 24(%rsp)
.Ltmp6:
	.cfi_escape 0x2e, 0x00
	movl	$33554432, %edi                 # imm = 0x2000000
	callq	_Znam
.Ltmp7:
# %bb.3:
	movq	%rax, (%rsp)
.Ltmp9:
	.cfi_escape 0x2e, 0x00
	leaq	240(%rsp), %rdi
	movl	$2048, %edx                     # imm = 0x800
	movl	$2048, %ecx                     # imm = 0x800
	movl	$1, %esi
	callq	_ZN3MtxIdEC2Ebmm
.Ltmp10:
# %bb.4:
.Ltmp12:
	.cfi_escape 0x2e, 0x00
	leaq	208(%rsp), %rdi
	movl	$2048, %edx                     # imm = 0x800
	movl	$2048, %ecx                     # imm = 0x800
	movl	$1, %esi
	callq	_ZN3MtxIdEC2Ebmm
.Ltmp13:
# %bb.5:
.Ltmp15:
	.cfi_escape 0x2e, 0x00
	leaq	176(%rsp), %rdi
	movl	$2048, %edx                     # imm = 0x800
	movl	$2048, %ecx                     # imm = 0x800
	movl	$1, %esi
	callq	_ZN3MtxIdEC2Ebmm
.Ltmp16:
# %bb.6:
	movq	64(%rsp), %rdi
.Ltmp18:
	.cfi_escape 0x2e, 0x00
	movl	$4194304, %esi                  # imm = 0x400000
	callq	_Z13random_matrixIdEvPT_m
.Ltmp19:
# %bb.7:
	movq	32(%rsp), %rdi
.Ltmp20:
	.cfi_escape 0x2e, 0x00
	movl	$4194304, %esi                  # imm = 0x400000
	callq	_Z13random_matrixIdEvPT_m
.Ltmp21:
# %bb.8:
	.cfi_escape 0x2e, 0x00
	callq	clock
	movq	%rax, %rbx
	movq	208(%rsp), %rdi
	movq	64(%rsp), %rsi
.Ltmp23:
	.cfi_escape 0x2e, 0x00
	movl	$33554432, %edx                 # imm = 0x2000000
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp24:
# %bb.9:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_10
# %bb.13:                               # %_Z9gpuAssert10hipError_tPKcib.exit
	movq	176(%rsp), %rdi
	movq	32(%rsp), %rsi
.Ltmp27:
	.cfi_escape 0x2e, 0x00
	movl	$33554432, %edx                 # imm = 0x2000000
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp28:
# %bb.14:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_15
# %bb.17:                               # %_Z9gpuAssert10hipError_tPKcib.exit50
.Ltmp32:
	.cfi_escape 0x2e, 0x00
	movabsq	$549755814016, %rdi             # imm = 0x8000000080
	movabsq	$68719476752, %rdx              # imm = 0x1000000010
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp33:
# %bb.18:
	testl	%eax, %eax
	jne	.LBB1_21
# %bb.19:
	movupd	240(%rsp), %xmm0
	movq	256(%rsp), %rax
	movupd	208(%rsp), %xmm1
	movq	224(%rsp), %rcx
	movupd	176(%rsp), %xmm2
	movq	192(%rsp), %rdx
	leaq	368(%rsp), %rsi
	movupd	%xmm2, (%rsi)
	movq	%rdx, 16(%rsi)
	movq	%rdx, 24(%rsi)
	leaq	336(%rsp), %rdx
	movupd	%xmm1, (%rdx)
	movq	%rcx, 16(%rdx)
	movq	%rcx, 24(%rdx)
	leaq	304(%rsp), %rcx
	movupd	%xmm0, (%rcx)
	movq	%rax, 16(%rcx)
	movq	%rax, 24(%rcx)
	movq	%rcx, 272(%rsp)
	movq	%rdx, 280(%rsp)
	movq	%rsi, 288(%rsp)
.Ltmp34:
	.cfi_escape 0x2e, 0x00
	leaq	160(%rsp), %rdi
	leaq	144(%rsp), %rsi
	leaq	136(%rsp), %rdx
	leaq	128(%rsp), %rcx
	callq	__hipPopCallConfiguration
.Ltmp35:
# %bb.20:                               # %.noexc51
	movq	160(%rsp), %rsi
	movl	168(%rsp), %edx
	movq	144(%rsp), %rcx
	movl	152(%rsp), %r8d
.Ltmp36:
	.cfi_escape 0x2e, 0x10
	leaq	272(%rsp), %r9
	movl	$_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_, %edi
	pushq	128(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	144(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.Ltmp37:
.LBB1_21:
.Ltmp38:
	.cfi_escape 0x2e, 0x00
	callq	hipPeekAtLastError
.Ltmp39:
# %bb.22:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_23
# %bb.33:                               # %_Z9gpuAssert10hipError_tPKcib.exit55
.Ltmp42:
	.cfi_escape 0x2e, 0x00
	callq	hipDeviceSynchronize
.Ltmp43:
# %bb.34:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_35
# %bb.37:                               # %_Z9gpuAssert10hipError_tPKcib.exit58
	movq	96(%rsp), %rdi
	movq	240(%rsp), %rsi
.Ltmp46:
	.cfi_escape 0x2e, 0x00
	movl	$33554432, %edx                 # imm = 0x2000000
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp47:
# %bb.38:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB1_39
# %bb.41:                               # %_Z9gpuAssert10hipError_tPKcib.exit61
.Ltmp50:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp51:
# %bb.42:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	.cfi_escape 0x2e, 0x00
	callq	clock
	subq	%rbx, %rax
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI1_0(%rip), %xmm0
.Ltmp52:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp53:
# %bb.43:                               # %_ZNSolsEd.exit
.Ltmp54:
	movq	%rax, %rbx
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.2, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp55:
# %bb.44:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit65
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp56:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp57:
# %bb.45:                               # %.noexc90
.Ltmp58:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp59:
# %bb.46:                               # %.noexc91
.Ltmp60:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp61:
# %bb.47:                               # %_ZNSolsEPFRSoS_E.exit
	.cfi_escape 0x2e, 0x00
	callq	clock
	movq	%rax, %rbx
	.cfi_escape 0x2e, 0x00
	movq	%rsp, %rdi
	leaq	64(%rsp), %rsi
	leaq	32(%rsp), %rdx
	callq	_Z18matrix_multiply_v1IdElR3MtxIT_ES3_S3_
	movq	%rax, %r14
.Ltmp63:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp64:
# %bb.48:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit68
	subq	%rbx, %r14
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r14, %xmm0
	divsd	.LCPI1_0(%rip), %xmm0
.Ltmp65:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp66:
# %bb.49:                               # %_ZNSolsEd.exit70
.Ltmp67:
	movq	%rax, %rbx
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.2, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp68:
# %bb.50:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit72
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp69:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp70:
# %bb.51:                               # %.noexc93
.Ltmp71:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp72:
# %bb.52:                               # %.noexc94
.Ltmp73:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp74:
# %bb.53:                               # %_ZNSolsEPFRSoS_E.exit74.preheader
	movq	96(%rsp), %rax
	movq	(%rsp), %rcx
	xorl	%ebx, %ebx
	movapd	.LCPI1_1(%rip), %xmm0           # xmm0 = [NaN,NaN]
	movsd	.LCPI1_2(%rip), %xmm1           # xmm1 = mem[0],zero
.LBB1_54:                               # =>This Inner Loop Header: Depth=1
	movsd	(%rax,%rbx,8), %xmm2            # xmm2 = mem[0],zero
	movsd	(%rcx,%rbx,8), %xmm3            # xmm3 = mem[0],zero
	subsd	%xmm3, %xmm2
	andpd	%xmm0, %xmm2
	divsd	%xmm3, %xmm2
	ucomisd	%xmm1, %xmm2
	ja	.LBB1_55
# %bb.64:                               # %_ZNSolsEPFRSoS_E.exit74
                                        #   in Loop: Header=BB1_54 Depth=1
	incq	%rbx
	cmpq	$4194304, %rbx                  # imm = 0x400000
	jne	.LBB1_54
# %bb.65:                               # %.critedge
.Ltmp76:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp77:
# %bb.66:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit82
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp78:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp79:
	jmp	.LBB1_67
.LBB1_55:
.Ltmp80:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp81:
# %bb.56:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit76
	movq	96(%rsp), %rax
	movsd	(%rax,%rbx,8), %xmm0            # xmm0 = mem[0],zero
	movq	(%rsp), %rax
	movsd	(%rax,%rbx,8), %xmm1            # xmm1 = mem[0],zero
	subsd	%xmm1, %xmm0
	andpd	.LCPI1_1(%rip), %xmm0
	divsd	%xmm1, %xmm0
.Ltmp82:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp83:
# %bb.57:                               # %_ZNSolsEd.exit78
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp84:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp85:
# %bb.58:                               # %.noexc97
.Ltmp86:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp87:
# %bb.59:                               # %.noexc98
.Ltmp88:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp89:
# %bb.60:                               # %_ZNSolsEPFRSoS_E.exit80
.Ltmp91:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	movl	$1, %esi
	callq	_ZNSo9_M_insertImEERSoT_
.Ltmp92:
# %bb.61:                               # %_ZNSolsEm.exit
.Ltmp93:
	movq	%rax, %rbx
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.6, %esi
	movl	$12, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp94:
# %bb.62:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit87
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp95:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp96:
.LBB1_67:                               # %.noexc105.invoke
.Ltmp97:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp98:
# %bb.68:                               # %.noexc106.invoke
.Ltmp99:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp100:
# %bb.69:                               # %_ZNSolsEPFRSoS_E.exit84
	.cfi_escape 0x2e, 0x00
	leaq	176(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
	.cfi_escape 0x2e, 0x00
	leaq	208(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
	.cfi_escape 0x2e, 0x00
	leaq	240(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
	.cfi_escape 0x2e, 0x00
	movq	%rsp, %rdi
	callq	_ZN3MtxIdED2Ev
	.cfi_escape 0x2e, 0x00
	leaq	32(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
	.cfi_escape 0x2e, 0x00
	leaq	64(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
	.cfi_escape 0x2e, 0x00
	leaq	96(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
	xorl	%eax, %eax
	addq	$400, %rsp                      # imm = 0x190
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_10:
	.cfi_def_cfa_offset 432
	movq	stderr(%rip), %rbx
.Ltmp25:
	.cfi_escape 0x2e, 0x00
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp26:
# %bb.11:                               # %.noexc
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$149, %r8d
	jmp	.LBB1_12
.LBB1_15:
	movq	stderr(%rip), %rbx
.Ltmp29:
	.cfi_escape 0x2e, 0x00
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp30:
# %bb.16:                               # %.noexc49
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$150, %r8d
	jmp	.LBB1_12
.LBB1_23:
	movq	stderr(%rip), %rbx
.Ltmp40:
	.cfi_escape 0x2e, 0x00
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp41:
# %bb.24:                               # %.noexc54
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$155, %r8d
	jmp	.LBB1_12
.LBB1_35:
	movq	stderr(%rip), %rbx
.Ltmp44:
	.cfi_escape 0x2e, 0x00
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp45:
# %bb.36:                               # %.noexc57
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$156, %r8d
	jmp	.LBB1_12
.LBB1_39:
	movq	stderr(%rip), %rbx
.Ltmp48:
	.cfi_escape 0x2e, 0x00
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp49:
# %bb.40:                               # %.noexc60
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$158, %r8d
.LBB1_12:                               # %.noexc
	xorl	%eax, %eax
	callq	fprintf
	.cfi_escape 0x2e, 0x00
	movl	%ebp, %edi
	callq	exit
.LBB1_30:
.Ltmp17:
	movq	%rax, %rbx
	jmp	.LBB1_73
.LBB1_29:
.Ltmp14:
	movq	%rax, %rbx
	jmp	.LBB1_74
.LBB1_28:
.Ltmp11:
	movq	%rax, %rbx
	jmp	.LBB1_75
.LBB1_27:
.Ltmp8:
	movq	%rax, %rbx
	jmp	.LBB1_76
.LBB1_26:
.Ltmp5:
	movq	%rax, %rbx
	jmp	.LBB1_77
.LBB1_25:
.Ltmp2:
	movq	%rax, %rbx
	jmp	.LBB1_78
.LBB1_71:
.Ltmp22:
	jmp	.LBB1_72
.LBB1_63:
.Ltmp90:
	jmp	.LBB1_72
.LBB1_31:
.Ltmp31:
	jmp	.LBB1_72
.LBB1_70:
.Ltmp101:
	jmp	.LBB1_72
.LBB1_79:
.Ltmp75:
	jmp	.LBB1_72
.LBB1_32:
.Ltmp62:
.LBB1_72:
	movq	%rax, %rbx
	.cfi_escape 0x2e, 0x00
	leaq	176(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
.LBB1_73:
	.cfi_escape 0x2e, 0x00
	leaq	208(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
.LBB1_74:
	.cfi_escape 0x2e, 0x00
	leaq	240(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
.LBB1_75:
	.cfi_escape 0x2e, 0x00
	movq	%rsp, %rdi
	callq	_ZN3MtxIdED2Ev
.LBB1_76:
	.cfi_escape 0x2e, 0x00
	leaq	32(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
.LBB1_77:
	.cfi_escape 0x2e, 0x00
	leaq	64(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
.LBB1_78:
	.cfi_escape 0x2e, 0x00
	leaq	96(%rsp), %rdi
	callq	_ZN3MtxIdED2Ev
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.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 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin0          #     jumps to .Ltmp11
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp16-.Ltmp15                #   Call between .Ltmp15 and .Ltmp16
	.uleb128 .Ltmp17-.Lfunc_begin0          #     jumps to .Ltmp17
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp21-.Ltmp18                #   Call between .Ltmp18 and .Ltmp21
	.uleb128 .Ltmp22-.Lfunc_begin0          #     jumps to .Ltmp22
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp23-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp28-.Ltmp23                #   Call between .Ltmp23 and .Ltmp28
	.uleb128 .Ltmp31-.Lfunc_begin0          #     jumps to .Ltmp31
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp32-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp61-.Ltmp32                #   Call between .Ltmp32 and .Ltmp61
	.uleb128 .Ltmp62-.Lfunc_begin0          #     jumps to .Ltmp62
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp63-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp74-.Ltmp63                #   Call between .Ltmp63 and .Ltmp74
	.uleb128 .Ltmp75-.Lfunc_begin0          #     jumps to .Ltmp75
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp76-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Ltmp79-.Ltmp76                #   Call between .Ltmp76 and .Ltmp79
	.uleb128 .Ltmp101-.Lfunc_begin0         #     jumps to .Ltmp101
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp80-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Ltmp89-.Ltmp80                #   Call between .Ltmp80 and .Ltmp89
	.uleb128 .Ltmp90-.Lfunc_begin0          #     jumps to .Ltmp90
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp91-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp100-.Ltmp91               #   Call between .Ltmp91 and .Ltmp100
	.uleb128 .Ltmp101-.Lfunc_begin0         #     jumps to .Ltmp101
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp25-.Lfunc_begin0          # >> Call Site 15 <<
	.uleb128 .Ltmp30-.Ltmp25                #   Call between .Ltmp25 and .Ltmp30
	.uleb128 .Ltmp31-.Lfunc_begin0          #     jumps to .Ltmp31
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp40-.Lfunc_begin0          # >> Call Site 16 <<
	.uleb128 .Ltmp49-.Ltmp40                #   Call between .Ltmp40 and .Ltmp49
	.uleb128 .Ltmp62-.Lfunc_begin0          #     jumps to .Ltmp62
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp49-.Lfunc_begin0          # >> Call Site 17 <<
	.uleb128 .Lfunc_end1-.Ltmp49            #   Call between .Ltmp49 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZN3MtxIdEC2Ebmm,"axG",@progbits,_ZN3MtxIdEC2Ebmm,comdat
	.weak	_ZN3MtxIdEC2Ebmm                # -- Begin function _ZN3MtxIdEC2Ebmm
	.p2align	1, 0x90
	.type	_ZN3MtxIdEC2Ebmm,@function
_ZN3MtxIdEC2Ebmm:                       # @_ZN3MtxIdEC2Ebmm
	.cfi_startproc
# %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, %rbx
	movq	$0, (%rdi)
	movq	%rdx, 8(%rdi)
	movq	%rcx, 16(%rdi)
	movb	%sil, 24(%rdi)
	testl	%esi, %esi
	je	.LBB2_3
# %bb.1:
	imulq	%rcx, %rdx
	shlq	$3, %rdx
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB2_4
# %bb.2:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$60, %r8d
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebx, %edi
	callq	exit
.LBB2_3:
	imulq	%rdx, %rcx
	movq	%rcx, %rax
	shrq	$61, %rax
	shlq	$3, %rcx
	xorl	%edi, %edi
	negq	%rax
	sbbq	%rdi, %rdi
	orq	%rcx, %rdi
	callq	_Znam
	movq	%rax, (%rbx)
.LBB2_4:                                # %_Z9gpuAssert10hipError_tPKcib.exit
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_ZN3MtxIdEC2Ebmm, .Lfunc_end2-_ZN3MtxIdEC2Ebmm
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z13random_matrixIdEvPT_m
.LCPI3_0:
	.quad	0x4069000000000000              # double 200
.LCPI3_1:
	.quad	0xc059000000000000              # double -100
	.section	.text._Z13random_matrixIdEvPT_m,"axG",@progbits,_Z13random_matrixIdEvPT_m,comdat
	.weak	_Z13random_matrixIdEvPT_m
	.type	_Z13random_matrixIdEvPT_m,@function
_Z13random_matrixIdEvPT_m:              # @_Z13random_matrixIdEvPT_m
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_Z25get_default_random_enginev
	testq	%rbx, %rbx
	je	.LBB3_3
# %bb.1:                                # %.lr.ph.preheader
	xorl	%r15d, %r15d
.LBB3_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	$_ZZ25get_default_random_enginevE3eng, %edi
	callq	_ZSt18generate_canonicalIdLm53ESt26linear_congruential_engineImLm16807ELm0ELm2147483647EEET_RT1_
	mulsd	.LCPI3_0(%rip), %xmm0
	addsd	.LCPI3_1(%rip), %xmm0
	movsd	%xmm0, (%r14,%r15,8)
	incq	%r15
	cmpq	%r15, %rbx
	jne	.LBB3_2
.LBB3_3:                                # %._crit_edge
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z13random_matrixIdEvPT_m, .Lfunc_end3-_Z13random_matrixIdEvPT_m
	.cfi_endproc
                                        # -- End function
	.section	.text._Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,"axG",@progbits,_Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,comdat
	.weak	_Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_ # -- Begin function _Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.type	_Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,@function
_Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_: # @_Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	128(%rsp), %rax
	leaq	48(%rsp), %rbx
	movq	%rax, (%rbx)
	leaq	160(%rsp), %rax
	movq	%rax, 8(%rbx)
	leaq	192(%rsp), %rax
	movq	%rax, 16(%rbx)
	leaq	32(%rsp), %r14
	leaq	16(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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_end4:
	.size	_Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_, .Lfunc_end4-_Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.cfi_endproc
                                        # -- End function
	.section	.text._Z18matrix_multiply_v1IdElR3MtxIT_ES3_S3_,"axG",@progbits,_Z18matrix_multiply_v1IdElR3MtxIT_ES3_S3_,comdat
	.weak	_Z18matrix_multiply_v1IdElR3MtxIT_ES3_S3_ # -- Begin function _Z18matrix_multiply_v1IdElR3MtxIT_ES3_S3_
	.type	_Z18matrix_multiply_v1IdElR3MtxIT_ES3_S3_,@function
_Z18matrix_multiply_v1IdElR3MtxIT_ES3_S3_: # @_Z18matrix_multiply_v1IdElR3MtxIT_ES3_S3_
	.cfi_startproc
# %bb.0:
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	clock                           # TAILCALL
# %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	%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
	movq	(%rdi), %rcx
	movq	%rcx, -8(%rsp)                  # 8-byte Spill
	movq	16(%rdi), %rdi
	movq	16(%rsi), %r8
	leaq	(,%r8,8), %r9
	xorl	%r10d, %r10d
	xorl	%r11d, %r11d
.LBB5_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_4 Depth 2
                                        #       Child Loop BB5_6 Depth 3
	testq	%rdi, %rdi
	je	.LBB5_8
# %bb.3:                                # %.lr.ph30
                                        #   in Loop: Header=BB5_2 Depth=1
	movq	%rdi, %rcx
	imulq	%r11, %rcx
	movq	-8(%rsp), %rbx                  # 8-byte Reload
	leaq	(%rbx,%rcx,8), %rbx
	movq	(%rdx), %r14
	movq	16(%rdx), %r15
	shlq	$3, %r15
	movq	(%rsi), %r12
	addq	%r10, %r12
	xorl	%r13d, %r13d
.LBB5_4:                                #   Parent Loop BB5_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB5_6 Depth 3
	movq	$0, (%rbx,%r13,8)
	testq	%r8, %r8
	je	.LBB5_7
# %bb.5:                                # %.lr.ph
                                        #   in Loop: Header=BB5_4 Depth=2
	xorpd	%xmm0, %xmm0
	movq	%r14, %rbp
	xorl	%ecx, %ecx
.LBB5_6:                                #   Parent Loop BB5_2 Depth=1
                                        #     Parent Loop BB5_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movsd	(%r12,%rcx,8), %xmm1            # xmm1 = mem[0],zero
	mulsd	(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx,%r13,8)
	incq	%rcx
	addq	%r15, %rbp
	cmpq	%rcx, %r8
	jne	.LBB5_6
.LBB5_7:                                # %._crit_edge
                                        #   in Loop: Header=BB5_4 Depth=2
	incq	%r13
	addq	$8, %r14
	cmpq	%rdi, %r13
	jne	.LBB5_4
.LBB5_8:                                # %._crit_edge31
                                        #   in Loop: Header=BB5_2 Depth=1
	incq	%r11
	addq	%r9, %r10
	cmpq	%rax, %r11
	jne	.LBB5_2
# %bb.9:
	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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
	jmp	clock                           # TAILCALL
.Lfunc_end5:
	.size	_Z18matrix_multiply_v1IdElR3MtxIT_ES3_S3_, .Lfunc_end5-_Z18matrix_multiply_v1IdElR3MtxIT_ES3_S3_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZN3MtxIdED2Ev,"axG",@progbits,_ZN3MtxIdED2Ev,comdat
	.weak	_ZN3MtxIdED2Ev                  # -- Begin function _ZN3MtxIdED2Ev
	.p2align	1, 0x90
	.type	_ZN3MtxIdED2Ev,@function
_ZN3MtxIdED2Ev:                         # @_ZN3MtxIdED2Ev
.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
	cmpb	$0, 24(%rdi)
	movq	(%rdi), %rdi
	je	.LBB6_5
# %bb.1:
.Ltmp102:
	callq	hipFree
.Ltmp103:
# %bb.2:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.LBB6_3
.LBB6_6:                                # %_Z9gpuAssert10hipError_tPKcib.exit
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB6_5:
	.cfi_def_cfa_offset 32
	testq	%rdi, %rdi
	je	.LBB6_6
# %bb.8:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZdaPv                          # TAILCALL
.LBB6_3:
	.cfi_def_cfa_offset 32
	movq	stderr(%rip), %r14
.Ltmp104:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp105:
# %bb.4:                                # %.noexc
	movl	$.L.str.7, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$65, %r8d
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebx, %edi
	callq	exit
.LBB6_7:
.Ltmp106:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end6:
	.size	_ZN3MtxIdED2Ev, .Lfunc_end6-_ZN3MtxIdED2Ev
	.cfi_endproc
	.section	.gcc_except_table._ZN3MtxIdED2Ev,"aG",@progbits,_ZN3MtxIdED2Ev,comdat
	.p2align	2, 0x0
GCC_except_table6:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Ltmp102-.Lfunc_begin1         # >> Call Site 1 <<
	.uleb128 .Ltmp105-.Ltmp102              #   Call between .Ltmp102 and .Ltmp105
	.uleb128 .Ltmp106-.Lfunc_begin1         #     jumps to .Ltmp106
	.byte	1                               #   On action: 1
.Lcst_end1:
	.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_end7:
	.size	__clang_call_terminate, .Lfunc_end7-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _ZSt18generate_canonicalIdLm53ESt26linear_congruential_engineImLm16807ELm0ELm2147483647EEET_RT1_
.LCPI8_0:
	.quad	0x41dfffffff800000              # double 2147483646
.LCPI8_3:
	.quad	0x3ff0000000000000              # double 1
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI8_1:
	.long	0x40000000                      # float 2
.LCPI8_2:
	.long	0x5f000000                      # float 9.22337203E+18
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI8_4:
	.long	1127219200                      # 0x43300000
	.long	1160773632                      # 0x45300000
	.long	0                               # 0x0
	.long	0                               # 0x0
.LCPI8_5:
	.quad	0x4330000000000000              # double 4503599627370496
	.quad	0x4530000000000000              # double 1.9342813113834067E+25
	.section	.text._ZSt18generate_canonicalIdLm53ESt26linear_congruential_engineImLm16807ELm0ELm2147483647EEET_RT1_,"axG",@progbits,_ZSt18generate_canonicalIdLm53ESt26linear_congruential_engineImLm16807ELm0ELm2147483647EEET_RT1_,comdat
	.weak	_ZSt18generate_canonicalIdLm53ESt26linear_congruential_engineImLm16807ELm0ELm2147483647EEET_RT1_
	.type	_ZSt18generate_canonicalIdLm53ESt26linear_congruential_engineImLm16807ELm0ELm2147483647EEET_RT1_,@function
_ZSt18generate_canonicalIdLm53ESt26linear_congruential_engineImLm16807ELm0ELm2147483647EEET_RT1_: # @_ZSt18generate_canonicalIdLm53ESt26linear_congruential_engineImLm16807ELm0ELm2147483647EEET_RT1_
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$64, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	fldl	.LCPI8_0(%rip)
	fstpt	(%rsp)
	callq	logl
	fstpt	52(%rsp)                        # 10-byte Folded Spill
	flds	.LCPI8_1(%rip)
	fstpt	(%rsp)
	callq	logl
	fldt	52(%rsp)                        # 10-byte Folded Reload
	fdivp	%st, %st(1)
	flds	.LCPI8_2(%rip)
	xorl	%ecx, %ecx
	fxch	%st(1)
	fucomi	%st(1), %st
	fldz
	fcmovnb	%st(2), %st
	fstp	%st(2)
	fsubp	%st, %st(1)
	setae	%cl
	fnstcw	20(%rsp)
	movzwl	20(%rsp), %eax
	orl	$3072, %eax                     # imm = 0xC00
	movw	%ax, 22(%rsp)
	fldcw	22(%rsp)
	fistpll	40(%rsp)
	fldcw	20(%rsp)
	shlq	$63, %rcx
	xorq	40(%rsp), %rcx
	leaq	52(%rcx), %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rcx
	cmpq	$1, %rax
	adcq	$0, %rcx
	movq	(%rbx), %rax
	xorpd	%xmm0, %xmm0
	movsd	.LCPI8_3(%rip), %xmm1           # xmm1 = mem[0],zero
	movabsq	$8589934597, %rdi               # imm = 0x200000005
	movdqa	.LCPI8_4(%rip), %xmm2           # xmm2 = [1127219200,1160773632,0,0]
	movapd	.LCPI8_5(%rip), %xmm3           # xmm3 = [4.503599627370496E+15,1.9342813113834067E+25]
.LBB8_1:                                # %select.unfold
                                        # =>This Inner Loop Header: Depth=1
	imulq	$16807, %rax, %rsi              # imm = 0x41A7
	movq	%rsi, %rax
	mulq	%rdi
	movq	%rsi, %r8
	subq	%rdx, %r8
	shrq	%r8
	addq	%rdx, %r8
	shrq	$30, %r8
	movq	%r8, %rax
	shlq	$31, %rax
	subq	%rax, %r8
	leaq	(%rsi,%r8), %rax
	leaq	(%rsi,%r8), %rdx
	decq	%rdx
	movq	%rdx, %xmm4
	punpckldq	%xmm2, %xmm4            # xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
	subpd	%xmm3, %xmm4
	movapd	%xmm4, %xmm5
	unpckhpd	%xmm4, %xmm5                    # xmm5 = xmm5[1],xmm4[1]
	addsd	%xmm4, %xmm5
	mulsd	%xmm1, %xmm5
	movsd	%xmm1, 32(%rsp)
	fldl	32(%rsp)
	fmull	.LCPI8_0(%rip)
	addsd	%xmm5, %xmm0
	fstpl	24(%rsp)
	movsd	24(%rsp), %xmm1                 # xmm1 = mem[0],zero
	decq	%rcx
	jne	.LBB8_1
# %bb.2:
	movq	%rax, (%rbx)
	divsd	%xmm1, %xmm0
	ucomisd	.LCPI8_3(%rip), %xmm0
	jae	.LBB8_4
# %bb.3:
	addq	$64, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB8_4:
	.cfi_def_cfa_offset 80
	movsd	.LCPI8_3(%rip), %xmm0           # xmm0 = mem[0],zero
	xorpd	%xmm1, %xmm1
	addq	$64, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	nextafter                       # TAILCALL
.Lfunc_end8:
	.size	_ZSt18generate_canonicalIdLm53ESt26linear_congruential_engineImLm16807ELm0ELm2147483647EEET_RT1_, .Lfunc_end8-_ZSt18generate_canonicalIdLm53ESt26linear_congruential_engineImLm16807ELm0ELm2147483647EEET_RT1_
	.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	.LBB9_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB9_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_, %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_end9:
	.size	__hip_module_ctor, .Lfunc_end9-__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	.LBB10_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
.LBB10_2:
	retq
.Lfunc_end10:
	.size	__hip_module_dtor, .Lfunc_end10-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_ZZ25get_default_random_enginevE3eng,@object # @_ZZ25get_default_random_enginevE3eng
	.local	_ZZ25get_default_random_enginevE3eng
	.comm	_ZZ25get_default_random_enginevE3eng,8,8
	.type	_ZGVZ25get_default_random_enginevE3eng,@object # @_ZGVZ25get_default_random_enginevE3eng
	.local	_ZGVZ25get_default_random_enginevE3eng
	.comm	_ZGVZ25get_default_random_enginevE3eng,8,8
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/armandli/cuda_examples/master/matrix_multiply_v2.hip"
	.size	.L.str, 115

	.type	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,@object # @_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.section	.rodata._Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,"aG",@progbits,_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,comdat
	.weak	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.p2align	3, 0x0
_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_:
	.quad	_Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.size	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_, 8

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	" ms"
	.size	.L.str.2, 4

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"CPU time: "
	.size	.L.str.3, 11

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"difference: "
	.size	.L.str.4, 13

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"All values match"
	.size	.L.str.5, 17

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	" differences"
	.size	.L.str.6, 13

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_"
	.size	.L__unnamed_1, 50

	.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 __gxx_personality_v0
	.addrsig_sym _Z38__device_stub__matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZZ25get_default_random_enginevE3eng
	.addrsig_sym _ZGVZ25get_default_random_enginevE3eng
	.addrsig_sym _Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.section	.text._Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,"axG",@progbits,_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,comdat
	.protected	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_ ; -- Begin function _Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.globl	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
	.p2align	8
	.type	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,@function
_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_: ; @_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
; %bb.0:
	s_clause 0x3
	s_load_b128 s[8:11], s[0:1], 0x30
	s_load_b128 s[4:7], s[0:1], 0x50
	s_load_b64 s[20:21], s[0:1], 0x20
	s_load_b64 s[22:23], s[0:1], 0x40
	v_and_b32_e32 v3, 0x3ff, v0
	v_bfe_u32 v2, v0, 10, 10
	s_mov_b32 s18, s15
	s_mov_b32 s15, 0
	s_clause 0x1
	s_load_b64 s[12:13], s[0:1], 0x0
	s_load_b128 s[0:3], s[0:1], 0x10
	s_lshl_b64 s[16:17], s[14:15], 4
	v_lshlrev_b32_e32 v11, 3, v2
	s_mov_b32 s19, s15
	s_waitcnt lgkmcnt(0)
	v_mad_u64_u32 v[0:1], null, s10, v3, 0
	v_mad_u64_u32 v[7:8], null, s6, v3, 0
	s_lshr_b32 s10, s14, 28
	s_mul_hi_u32 s24, s8, s16
	s_mul_i32 s10, s8, s10
	s_mul_i32 s9, s9, s16
	s_mul_i32 s6, s8, s16
	s_add_i32 s8, s24, s10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v5, v8
	v_mad_u64_u32 v[8:9], null, s11, v3, v[1:2]
	s_lshl_b64 s[14:15], s[18:19], 4
	v_mad_u64_u32 v[9:10], null, s7, v3, v[5:6]
	s_add_i32 s7, s8, s9
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_mov_b32_e32 v1, v8
	s_lshl_b64 s[6:7], s[6:7], 3
	s_add_u32 s8, s20, s6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v8, v9
	v_lshlrev_b64 v[0:1], 3, v[0:1]
	s_addc_u32 s9, s21, s7
	s_lshl_b64 s[6:7], s[18:19], 7
	v_lshlrev_b32_e32 v4, 7, v3
	v_lshlrev_b64 v[7:8], 3, v[7:8]
	s_add_u32 s6, s22, s6
	v_add_co_u32 v0, vcc_lo, s8, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v1, vcc_lo
	s_addc_u32 s7, s23, s7
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_u32 v9, vcc_lo, s6, v7
	v_add_co_ci_u32_e32 v10, vcc_lo, s7, v8, vcc_lo
	v_add_co_u32 v7, vcc_lo, v0, v11
	v_add_co_ci_u32_e32 v8, vcc_lo, 0, v1, vcc_lo
	v_mov_b32_e32 v0, 0
	v_dual_mov_b32 v1, 0 :: v_dual_add_nc_u32 v6, 0x800, v11
	v_add_co_u32 v9, vcc_lo, v9, v11
	v_add_nc_u32_e32 v5, v4, v11
	v_add_co_ci_u32_e32 v10, vcc_lo, 0, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_4)
	v_add_nc_u32_e32 v11, v6, v4
	s_mov_b64 s[6:7], 0
.LBB0_1:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_alignbit_b32 v12, s7, s6, 28
	s_lshl_b64 s[8:9], s[6:7], 4
	s_mul_i32 s9, s8, s5
	s_mul_hi_u32 s10, s8, s4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)
	v_mul_lo_u32 v13, v12, s4
	s_mul_i32 s8, s8, s4
	s_add_i32 s10, s10, s9
	v_mov_b32_e32 v12, s8
	s_lshl_b64 s[8:9], s[6:7], 7
	v_add_co_u32 v14, vcc_lo, v7, s8
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v13, s10, v13
	v_add_co_ci_u32_e32 v15, vcc_lo, s9, v8, vcc_lo
	s_mov_b64 s[8:9], 16
	v_lshlrev_b64 v[12:13], 3, v[12:13]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v12, vcc_lo, v9, v12
	v_add_co_ci_u32_e32 v13, vcc_lo, v10, v13, vcc_lo
	global_load_b64 v[14:15], v[14:15], off
	global_load_b64 v[16:17], v[12:13], off
	v_dual_mov_b32 v12, v4 :: v_dual_mov_b32 v13, v6
	s_waitcnt vmcnt(1)
	ds_store_b64 v5, v[14:15]
	s_waitcnt vmcnt(0)
	ds_store_b64 v11, v[16:17]
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB0_2:                                ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ds_load_b64 v[14:15], v12
	ds_load_b64 v[16:17], v13
	s_add_u32 s8, s8, -1
	v_add_nc_u32_e32 v13, 0x80, v13
	v_add_nc_u32_e32 v12, 8, v12
	s_addc_u32 s9, s9, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u64 s[8:9], 0
	s_waitcnt lgkmcnt(0)
	v_fma_f64 v[0:1], v[14:15], v[16:17], v[0:1]
	s_cbranch_scc0 .LBB0_2
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	s_add_u32 s6, s6, 1
	s_addc_u32 s7, s7, 0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u64 s[6:7], 0x80
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc0 .LBB0_1
; %bb.4:
	v_mad_u64_u32 v[4:5], null, s2, v3, 0
	s_mul_i32 s2, s0, s17
	s_mul_i32 s1, s1, s16
	v_lshlrev_b32_e32 v2, 3, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[6:7], null, s3, v3, v[5:6]
	s_mul_hi_u32 s3, s0, s16
	s_mul_i32 s0, s0, s16
	s_add_i32 s2, s3, s2
	s_add_i32 s1, s2, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_mov_b32_e32 v5, v6
	s_lshl_b64 s[0:1], s[0:1], 3
	s_add_u32 s2, s12, s0
	s_addc_u32 s3, s13, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_lshlrev_b64 v[3:4], 3, v[4:5]
	s_lshl_b64 s[0:1], s[14:15], 3
	s_add_u32 s0, s2, s0
	s_addc_u32 s1, s3, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v3, vcc_lo, s0, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s1, v4, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, v3, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v4, vcc_lo
	global_store_b64 v[2:3], v[0:1], off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
		.amdhsa_group_segment_fixed_size 4096
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 96
		.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 18
		.amdhsa_next_free_sgpr 25
		.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
	.section	.text._Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,"axG",@progbits,_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_,comdat
.Lfunc_end0:
	.size	_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_, .Lfunc_end0-_Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 716
; NumSgprs: 27
; NumVgprs: 18
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4096 bytes/workgroup (compile time only)
; SGPRBlocks: 3
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 27
; NumVGPRsForWavesPerEU: 18
; 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:
      - .offset:         0
        .size:           32
        .value_kind:     by_value
      - .offset:         32
        .size:           32
        .value_kind:     by_value
      - .offset:         64
        .size:           32
        .value_kind:     by_value
    .group_segment_fixed_size: 4096
    .kernarg_segment_align: 8
    .kernarg_segment_size: 96
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_
    .private_segment_fixed_size: 0
    .sgpr_count:     27
    .sgpr_spill_count: 0
    .symbol:         _Z23matrix_multiply_cuda_v2IdEv7CudaMtxIT_ES2_S2_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     18
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
