#include <iostream>
#include <vector>


struct Timer
{

		cudaEvent_t xstart, xstop;

		Timer()
		{
		cudaEventCreate(&xstart);
		cudaEventCreate(&xstop);
		}

		void start()
		{
		cudaEventRecord(xstart, 0);

		}

		void stop()
		{
		cudaEventRecord(xstop, 0);

		}

		void sync()
		{
		cudaEventSynchronize(xstop);

		}

		float elapsed() const
		{
			float time = 0;
		cudaEventElapsedTime(&time, xstart, xstop);
			return time;
		}
};

/*
A = Ar x Ac
B = Br x Bc
E faccio che Ac==Br

matrixmul<<dim3(Ar,Bc),Ac>>(a,b,c)
Rowmajor senza pitch
Assuming Ac < 1024
*/

__global__ void mmulk(float * a, float * b, float * c, int Br, int Bc)
{

}

template<class T,int base=0>
class MatrixWrap
{
public:
	MatrixWrap(T * p, int a,int b): pp(p),r(a),c(b) {}

	T operator() (int i,int j) const { return pp[(i-base)*c+(j-base)]; }

	T &operator() (int i,int j)  { return pp[(i-base)*c+(j-base)]; }

	int r,c;
	T * pp;
};

template <class T>
void mmul(MatrixWrap<T> a,MatrixWrap<T> b,MatrixWrap<T> c)
{
	// TODO assert
	for(int i = 0; i < c.r; i++)
		for(int j = 0; j < c.c; j++)
		{
			T t = 0;
			for(int k = 0; k < a.c; k++)
				t += a(i,k)*b(k,j);
			c(i,j) = t;
		}
}

template <class T>
void minit(MatrixWrap<T,0> a,T rv, T cv, T dv)
{
	for(int i = 0; i < a.r; i++)
		for(int j = 0; j < a.c; j++)
			a(i,j) = i*rv+j*cv+dv;

}

template <class T>
std::ostream & operator << (std::ostream & ons, MatrixWrap<T> & w)
{
	ons << "(" << w.r << "," << w.c << ")\n";
	for(int i = 0; i < w.r; i++)
	{
		for(int j = 0; j < w.c; j++)
			ons << w(i,j) << " ";
		ons << std::endl;
	}
	return ons;
}

int main(int argc, char const *argv[])
{
	int Ar = 1, Ac = 512, Bc = 1;
	int & Br = Ac;
	int sizeA = sizeof(float)*Ar*Ac;
	int sizeB = sizeof(float)*Ac*Bc;
	int sizeC = sizeof(float)*Ar*Bc;
	float *dev_a,*dev_b,*dev_c;
	std::vector<float> a(sizeA/sizeof(float));
	std::vector<float> b(sizeB/sizeof(float));
	std::vector<float> c(sizeC/sizeof(float));
	std::vector<float> cr(sizeC/sizeof(float));
	MatrixWrap<float,0> mwA(&a[0],Ar,Ac);
	MatrixWrap<float,0> mwB(&b[0],Ac,Bc);
	MatrixWrap<float,0> mwC(&c[0],Ar,Bc);
	MatrixWrap<float,0> mwCr(&cr[0],Ar,Bc);

	cudaMalloc( (void**)&dev_a, sizeA );
	cudaMalloc( (void**)&dev_b, sizeB );
	cudaMalloc( (void**)&dev_c, sizeC);

	minit<float>(mwA,2,1,0);
	minit<float>(mwB,-8,-4,0);
	minit<float>(mwC,0,0,1);
	minit<float>(mwCr,0,0,2);

	mmul(mwA,mwB,mwC);

	std::cout << mwA << std::endl;
	std::cout << mwB << std::endl;
	std::cout << mwC << std::endl;
	Timer t;
	t.start();
	cudaMemcpy(dev_a,mwA.pp,sizeA,cudaMemcpyHostToDevice);
	cudaMemcpy(dev_b,mwB.pp,sizeB,cudaMemcpyHostToDevice);
	if(Ac < 1024)
	{
		// invoke mmulk
	}
	cudaMemcpy(mwCr.pp,dev_c,sizeC,cudaMemcpyDeviceToHost);
	t.stop();
	t.sync();
	std::cout << mwCr << std::endl;
	std::cout << t.elapsed() << std::endl;
	cudaFree(dev_a);
	cudaFree(dev_b);
	cudaFree(dev_c);
	return 0;
}
	.file	"tmpxft_0028d679_00000000-6_matrixmul_stub.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4014:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4014:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4749:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4749:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z30__device_stub__Z5mmulkPfS_S_iiPfS_S_ii
	.type	_Z30__device_stub__Z5mmulkPfS_S_iiPfS_S_ii, @function
_Z30__device_stub__Z5mmulkPfS_S_iiPfS_S_ii:
.LFB4036:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L3
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z5mmulkPfS_S_ii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L3:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4036:
	.size	_Z30__device_stub__Z5mmulkPfS_S_iiPfS_S_ii, .-_Z30__device_stub__Z5mmulkPfS_S_iiPfS_S_ii
	.globl	_Z5mmulkPfS_S_ii
	.type	_Z5mmulkPfS_S_ii, @function
_Z5mmulkPfS_S_ii:
.LFB4037:
	.cfi_startproc
	endbr64
	jmp	_Z30__device_stub__Z5mmulkPfS_S_iiPfS_S_ii
	.cfi_endproc
.LFE4037:
	.size	_Z5mmulkPfS_S_ii, .-_Z5mmulkPfS_S_ii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z5mmulkPfS_S_ii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4039:
	.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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z5mmulkPfS_S_ii(%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
.LFE4039:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata._ZNSt6vectorIfSaIfEEC2EmRKS0_.str1.1,"aMS",@progbits,1
.LC1:
	.string	"cannot create std::vector larger than max_size()"
	.section	.text._ZNSt6vectorIfSaIfEEC2EmRKS0_,"axG",@progbits,_ZNSt6vectorIfSaIfEEC5EmRKS0_,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEEC2EmRKS0_
	.type	_ZNSt6vectorIfSaIfEEC2EmRKS0_, @function
_ZNSt6vectorIfSaIfEEC2EmRKS0_:
.LFB4346:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmpq	%rsi, %rax
	jnb	.L12
	leaq	.LC1(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L12:
	xorl	%eax, %eax
	movq	%rdi, %rbx
	leaq	0(,%rsi,4), %r12
	movq	%rsi, %rbp
	movq	%rax, (%rdi)
	movq	%rax, 8(%rdi)
	movq	%rax, 16(%rdi)
	xorl	%eax, %eax
	testq	%rsi, %rsi
	je	.L13
	movq	%r12, %rdi
	call	_Znwm@PLT
.L13:
	addq	%rax, %r12
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	movq	%r12, 16(%rbx)
	testq	%rbp, %rbp
	je	.L14
	movl	$0x00000000, (%rax)
	addq	$4, %rax
	decq	%rbp
	je	.L14
.L15:
	cmpq	%rax, %r12
	je	.L14
	movl	$0x00000000, (%rax)
	addq	$4, %rax
	jmp	.L15
.L14:
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4346:
	.size	_ZNSt6vectorIfSaIfEEC2EmRKS0_, .-_ZNSt6vectorIfSaIfEEC2EmRKS0_
	.weak	_ZNSt6vectorIfSaIfEEC1EmRKS0_
	.set	_ZNSt6vectorIfSaIfEEC1EmRKS0_,_ZNSt6vectorIfSaIfEEC2EmRKS0_
	.section	.text._ZNSt6vectorIfSaIfEED2Ev,"axG",@progbits,_ZNSt6vectorIfSaIfEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEED2Ev
	.type	_ZNSt6vectorIfSaIfEED2Ev, @function
_ZNSt6vectorIfSaIfEED2Ev:
.LFB4349:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L26
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L26:
	ret
	.cfi_endproc
.LFE4349:
	.size	_ZNSt6vectorIfSaIfEED2Ev, .-_ZNSt6vectorIfSaIfEED2Ev
	.weak	_ZNSt6vectorIfSaIfEED1Ev
	.set	_ZNSt6vectorIfSaIfEED1Ev,_ZNSt6vectorIfSaIfEED2Ev
	.section	.text._Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_,"axG",@progbits,_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_,comdat
	.weak	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
	.type	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_, @function
_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_:
.LFB4355:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	xorl	%r8d, %r8d
	xorl	%edx, %edx
	sarq	$32, %rax
	movl	%eax, %r10d
	movl	%eax, %ecx
.L29:
	cmpl	%edx, %edi
	jle	.L28
	movslq	%r8d, %rax
	leaq	(%rsi,%rax,4), %r9
	xorl	%eax, %eax
.L32:
	cmpl	%eax, %r10d
	jle	.L33
	cvtsi2ssl	%eax, %xmm4
	cvtsi2ssl	%edx, %xmm3
	mulss	%xmm1, %xmm4
	mulss	%xmm0, %xmm3
	addss	%xmm4, %xmm3
	addss	%xmm2, %xmm3
	movss	%xmm3, (%r9,%rax,4)
	incq	%rax
	jmp	.L32
.L33:
	incl	%edx
	addl	%ecx, %r8d
	jmp	.L29
.L28:
	ret
	.cfi_endproc
.LFE4355:
	.size	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_, .-_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
	.section	.rodata._ZlsIfERSoS0_R10MatrixWrapIT_Li0EE.str1.1,"aMS",@progbits,1
.LC3:
	.string	"("
.LC4:
	.string	","
.LC5:
	.string	")\n"
.LC6:
	.string	" "
	.section	.text._ZlsIfERSoS0_R10MatrixWrapIT_Li0EE,"axG",@progbits,_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE,comdat
	.weak	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
	.type	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE, @function
_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE:
.LFB4357:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC6(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rsi, %rbx
	leaq	.LC3(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%rbx), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	4(%rbx), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L35:
	cmpl	%r13d, (%rbx)
	jle	.L40
	xorl	%r14d, %r14d
.L37:
	movl	4(%rbx), %eax
	cmpl	%r14d, %eax
	jle	.L41
	imull	%r13d, %eax
	movq	8(%rbx), %rdx
	movq	%rbp, %rdi
	addl	%r14d, %eax
	incl	%r14d
	cltq
	cvtss2sd	(%rdx,%rax,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L37
.L41:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rbp, %rdi
	incl	%r13d
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L35
.L40:
	popq	%rbx
	.cfi_def_cfa_offset 40
	movq	%rbp, %rax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4357:
	.size	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE, .-_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4011:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4011
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$512, %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	$264, %rsp
	.cfi_def_cfa_offset 320
	movq	%fs:40, %rax
	movq	%rax, 248(%rsp)
	xorl	%eax, %eax
	leaq	224(%rsp), %rbx
	leaq	152(%rsp), %rax
	movq	%rax, %rdi
	movq	%rbx, %rdx
	movq	%rax, 8(%rsp)
.LEHB0:
	call	_ZNSt6vectorIfSaIfEEC1EmRKS0_
.LEHE0:
	leaq	176(%rsp), %rax
	movq	%rbx, %rdx
	movl	$512, %esi
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
.LEHB1:
	call	_ZNSt6vectorIfSaIfEEC1EmRKS0_
.LEHE1:
	leaq	200(%rsp), %rax
	movq	%rbx, %rdx
	movl	$1, %esi
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
.LEHB2:
	call	_ZNSt6vectorIfSaIfEEC1EmRKS0_
.LEHE2:
	leaq	136(%rsp), %r15
	movl	$1, %esi
	movq	%rbx, %rdi
	movq	%r15, %rdx
.LEHB3:
	call	_ZNSt6vectorIfSaIfEEC1EmRKS0_
.LEHE3:
	movabsq	$2199023255553, %rax
	movq	152(%rsp), %r13
	movq	176(%rsp), %r12
	leaq	48(%rsp), %rdi
	movq	%rax, 72(%rsp)
	movl	$8388609, %eax
	movl	$2048, %esi
	movq	200(%rsp), %rbp
	salq	$9, %rax
	movq	224(%rsp), %r14
	movq	%r13, 80(%rsp)
	movq	%rax, 88(%rsp)
	subq	$511, %rax
	movq	%r12, 96(%rsp)
	movq	%rax, 104(%rsp)
	movq	%rbp, 112(%rsp)
	movq	%rax, 120(%rsp)
	movq	%r14, 128(%rsp)
.LEHB4:
	call	cudaMalloc@PLT
	leaq	56(%rsp), %rdi
	movl	$2048, %esi
	call	cudaMalloc@PLT
	leaq	64(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movss	.LC7(%rip), %xmm1
	movss	.LC8(%rip), %xmm0
	xorps	%xmm2, %xmm2
	movq	72(%rsp), %rdi
	movq	80(%rsp), %rsi
	call	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
	movss	.LC9(%rip), %xmm1
	movq	88(%rsp), %rdi
	xorps	%xmm2, %xmm2
	movss	.LC10(%rip), %xmm0
	movq	96(%rsp), %rsi
	call	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
	xorps	%xmm1, %xmm1
	movq	104(%rsp), %rdi
	movss	.LC7(%rip), %xmm2
	movq	112(%rsp), %rsi
	movaps	%xmm1, %xmm0
	call	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
	xorps	%xmm1, %xmm1
	movss	.LC8(%rip), %xmm2
	movq	120(%rsp), %rdi
	movq	128(%rsp), %rsi
	movaps	%xmm1, %xmm0
	call	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L43:
	movss	0(%r13,%rax), %xmm1
	mulss	(%r12,%rax), %xmm1
	addq	$4, %rax
	addss	%xmm1, %xmm0
	cmpq	$2048, %rax
	jne	.L43
	movss	%xmm0, 0(%rbp)
	leaq	_ZSt4cout(%rip), %rbp
	leaq	72(%rsp), %rsi
	movq	%rbp, %rdi
	call	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	88(%rsp), %rsi
	movq	%rbp, %rdi
	call	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	104(%rsp), %rsi
	movq	%rbp, %rdi
	call	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%r15, %rdi
	call	cudaEventCreate@PLT
	leaq	144(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	136(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	48(%rsp), %rdi
	movl	$1, %ecx
	movl	$2048, %edx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movq	56(%rsp), %rdi
	movl	$1, %ecx
	movl	$2048, %edx
	movq	%r12, %rsi
	call	cudaMemcpy@PLT
	movq	64(%rsp), %rsi
	movl	$2, %ecx
	movl	$4, %edx
	movq	%r14, %rdi
	call	cudaMemcpy@PLT
	movq	144(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	144(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	leaq	120(%rsp), %rsi
	movq	%rbp, %rdi
	call	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	144(%rsp), %rdx
	movq	136(%rsp), %rsi
	leaq	44(%rsp), %rdi
	movl	$0x00000000, 44(%rsp)
	call	cudaEventElapsedTime@PLT
	movq	%rbp, %rdi
	cvtss2sd	44(%rsp), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
.LEHE4:
	movq	%rbx, %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	24(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	16(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	8(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	248(%rsp), %rax
	subq	%fs:40, %rax
	je	.L49
	jmp	.L55
.L53:
	endbr64
	movq	%rax, %rbp
.L44:
	movq	%rbx, %rdi
	movq	%rbp, %rbx
	call	_ZNSt6vectorIfSaIfEED1Ev
	jmp	.L45
.L52:
	endbr64
	movq	%rax, %rbx
.L45:
	movq	24(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	jmp	.L46
.L51:
	endbr64
	movq	%rax, %rbx
.L46:
	movq	16(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	jmp	.L47
.L50:
	endbr64
	movq	%rax, %rbx
.L47:
	movq	8(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	248(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L55
	movq	%rbx, %rdi
.LEHB5:
	call	_Unwind_Resume@PLT
.LEHE5:
.L55:
	call	__stack_chk_fail@PLT
.L49:
	addq	$264, %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
.LFE4011:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4011:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4011-.LLSDACSB4011
.LLSDACSB4011:
	.uleb128 .LEHB0-.LFB4011
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4011
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L50-.LFB4011
	.uleb128 0
	.uleb128 .LEHB2-.LFB4011
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L51-.LFB4011
	.uleb128 0
	.uleb128 .LEHB3-.LFB4011
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L52-.LFB4011
	.uleb128 0
	.uleb128 .LEHB4-.LFB4011
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L53-.LFB4011
	.uleb128 0
	.uleb128 .LEHB5-.LFB4011
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
.LLSDACSE4011:
	.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.cst4,"aM",@progbits,4
	.align 4
.LC7:
	.long	1065353216
	.align 4
.LC8:
	.long	1073741824
	.align 4
.LC9:
	.long	-1065353216
	.align 4
.LC10:
	.long	-1056964608
	.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 <hip/hip_runtime.h>
#include <iostream>
#include <vector>


struct Timer
{

		hipEvent_t xstart, xstop;

		Timer()
		{
		hipEventCreate(&xstart);
		hipEventCreate(&xstop);
		}

		void start()
		{
		hipEventRecord(xstart, 0);

		}

		void stop()
		{
		hipEventRecord(xstop, 0);

		}

		void sync()
		{
		hipEventSynchronize(xstop);

		}

		float elapsed() const
		{
			float time = 0;
		hipEventElapsedTime(&time, xstart, xstop);
			return time;
		}
};

/*
A = Ar x Ac
B = Br x Bc
E faccio che Ac==Br

matrixmul<<dim3(Ar,Bc),Ac>>(a,b,c)
Rowmajor senza pitch
Assuming Ac < 1024
*/

__global__ void mmulk(float * a, float * b, float * c, int Br, int Bc)
{

}

template<class T,int base=0>
class MatrixWrap
{
public:
	MatrixWrap(T * p, int a,int b): pp(p),r(a),c(b) {}

	T operator() (int i,int j) const { return pp[(i-base)*c+(j-base)]; }

	T &operator() (int i,int j)  { return pp[(i-base)*c+(j-base)]; }

	int r,c;
	T * pp;
};

template <class T>
void mmul(MatrixWrap<T> a,MatrixWrap<T> b,MatrixWrap<T> c)
{
	// TODO assert
	for(int i = 0; i < c.r; i++)
		for(int j = 0; j < c.c; j++)
		{
			T t = 0;
			for(int k = 0; k < a.c; k++)
				t += a(i,k)*b(k,j);
			c(i,j) = t;
		}
}

template <class T>
void minit(MatrixWrap<T,0> a,T rv, T cv, T dv)
{
	for(int i = 0; i < a.r; i++)
		for(int j = 0; j < a.c; j++)
			a(i,j) = i*rv+j*cv+dv;

}

template <class T>
std::ostream & operator << (std::ostream & ons, MatrixWrap<T> & w)
{
	ons << "(" << w.r << "," << w.c << ")\n";
	for(int i = 0; i < w.r; i++)
	{
		for(int j = 0; j < w.c; j++)
			ons << w(i,j) << " ";
		ons << std::endl;
	}
	return ons;
}

int main(int argc, char const *argv[])
{
	int Ar = 1, Ac = 512, Bc = 1;
	int & Br = Ac;
	int sizeA = sizeof(float)*Ar*Ac;
	int sizeB = sizeof(float)*Ac*Bc;
	int sizeC = sizeof(float)*Ar*Bc;
	float *dev_a,*dev_b,*dev_c;
	std::vector<float> a(sizeA/sizeof(float));
	std::vector<float> b(sizeB/sizeof(float));
	std::vector<float> c(sizeC/sizeof(float));
	std::vector<float> cr(sizeC/sizeof(float));
	MatrixWrap<float,0> mwA(&a[0],Ar,Ac);
	MatrixWrap<float,0> mwB(&b[0],Ac,Bc);
	MatrixWrap<float,0> mwC(&c[0],Ar,Bc);
	MatrixWrap<float,0> mwCr(&cr[0],Ar,Bc);

	hipMalloc( (void**)&dev_a, sizeA );
	hipMalloc( (void**)&dev_b, sizeB );
	hipMalloc( (void**)&dev_c, sizeC);

	minit<float>(mwA,2,1,0);
	minit<float>(mwB,-8,-4,0);
	minit<float>(mwC,0,0,1);
	minit<float>(mwCr,0,0,2);

	mmul(mwA,mwB,mwC);

	std::cout << mwA << std::endl;
	std::cout << mwB << std::endl;
	std::cout << mwC << std::endl;
	Timer t;
	t.start();
	hipMemcpy(dev_a,mwA.pp,sizeA,hipMemcpyHostToDevice);
	hipMemcpy(dev_b,mwB.pp,sizeB,hipMemcpyHostToDevice);
	if(Ac < 1024)
	{
		// invoke mmulk
	}
	hipMemcpy(mwCr.pp,dev_c,sizeC,hipMemcpyDeviceToHost);
	t.stop();
	t.sync();
	std::cout << mwCr << std::endl;
	std::cout << t.elapsed() << std::endl;
	hipFree(dev_a);
	hipFree(dev_b);
	hipFree(dev_c);
	return 0;
}
	.text
	.file	"matrixmul_stub.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z20__device_stub__mmulkPfS_S_ii # -- Begin function _Z20__device_stub__mmulkPfS_S_ii
	.type	_Z20__device_stub__mmulkPfS_S_ii,@function
_Z20__device_stub__mmulkPfS_S_ii:       # @_Z20__device_stub__mmulkPfS_S_ii
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.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)
	movq	%rsp, %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%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	$_Z5mmulkPfS_S_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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	_Z20__device_stub__mmulkPfS_S_ii, .Lfunc_end0-_Z20__device_stub__mmulkPfS_S_ii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI1_0:
	.long	0xc1000000                      # float -8
.LCPI1_1:
	.long	0xc0800000                      # float -4
.LCPI1_2:
	.long	0x3f800000                      # float 1
.LCPI1_3:
	.long	0x40000000                      # float 2
	.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	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	.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	$2048, %edi                     # imm = 0x800
	callq	_Znwm
	movq	%rax, %rbx
	movl	$2048, %edx                     # imm = 0x800
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.Ltmp0:
	movl	$2048, %edi                     # imm = 0x800
	callq	_Znwm
.Ltmp1:
# %bb.1:
	movq	%rax, %r14
	movl	$2048, %edx                     # imm = 0x800
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.Ltmp3:
	movl	$4, %edi
	callq	_Znwm
.Ltmp4:
# %bb.2:
	movq	%rax, %r15
	movl	$0, (%rax)
.Ltmp6:
	movl	$4, %edi
	callq	_Znwm
.Ltmp7:
# %bb.3:
	movq	%rax, %r12
	movl	$0, (%rax)
	movabsq	$2199023255553, %rax            # imm = 0x20000000001
	movq	%rax, 48(%rsp)
	movq	%rbx, 56(%rsp)
	movabsq	$4294967808, %rax               # imm = 0x100000200
	movq	%rax, 8(%rsp)
	movq	%r14, 16(%rsp)
	movabsq	$4294967297, %rax               # imm = 0x100000001
	movq	%rax, 104(%rsp)
	movq	%r15, 112(%rsp)
	movq	%rax, 88(%rsp)
	movq	%r12, 96(%rsp)
.Ltmp9:
	leaq	80(%rsp), %rdi
	movl	$2048, %esi                     # imm = 0x800
	callq	hipMalloc
.Ltmp10:
# %bb.4:
.Ltmp11:
	leaq	72(%rsp), %rdi
	movl	$2048, %esi                     # imm = 0x800
	callq	hipMalloc
.Ltmp12:
# %bb.5:
.Ltmp13:
	leaq	64(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
.Ltmp14:
# %bb.6:
	movq	48(%rsp), %rdx
	testl	%edx, %edx
	jle	.LBB1_12
# %bb.7:                                # %.preheader.lr.ph.i
	movq	56(%rsp), %rax
	movq	%rdx, %rcx
	shrq	$32, %rcx
	movl	%edx, %edx
	xorl	%esi, %esi
	xorl	%edi, %edi
.LBB1_8:                                # %.preheader.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_10 Depth 2
	testl	%ecx, %ecx
	jle	.LBB1_11
# %bb.9:                                # %.lr.ph.i
                                        #   in Loop: Header=BB1_8 Depth=1
	xorps	%xmm0, %xmm0
	cvtsi2ss	%edi, %xmm0
	movl	%esi, %r8d
	leaq	(%rax,%r8,4), %r8
	addss	%xmm0, %xmm0
	xorl	%r9d, %r9d
.LBB1_10:                               #   Parent Loop BB1_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm1, %xmm1
	cvtsi2ss	%r9d, %xmm1
	addss	%xmm0, %xmm1
	movss	%xmm1, (%r8,%r9,4)
	incq	%r9
	cmpq	%r9, %rcx
	jne	.LBB1_10
.LBB1_11:                               # %._crit_edge.i
                                        #   in Loop: Header=BB1_8 Depth=1
	incq	%rdi
	addl	%ecx, %esi
	cmpq	%rdx, %rdi
	jne	.LBB1_8
.LBB1_12:                               # %_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_.exit
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp15:
	movss	.LCPI1_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	.LCPI1_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	xorps	%xmm2, %xmm2
	callq	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
.Ltmp16:
# %bb.13:
	movq	104(%rsp), %r13
.Ltmp17:
	movss	.LCPI1_2(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	xorps	%xmm1, %xmm1
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
.Ltmp18:
# %bb.14:
	movq	88(%rsp), %rdi
.Ltmp19:
	movss	.LCPI1_3(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	xorps	%xmm1, %xmm1
	movq	%r12, %rsi
	callq	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
.Ltmp20:
# %bb.15:
	leaq	48(%rsp), %rbp
	movq	(%rbp), %rdi
	movq	8(%rbp), %rsi
	movq	8(%rsp), %rdx
	movq	16(%rsp), %rcx
	movq	%r13, %r8
	movq	%r15, %r9
	callq	_Z4mmulIfEv10MatrixWrapIT_Li0EES2_S2_
.Ltmp21:
	movl	$_ZSt4cout, %edi
	movq	%rbp, %rsi
	callq	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
.Ltmp22:
# %bb.16:
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp23:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp24:
# %bb.17:                               # %.noexc84
.Ltmp25:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp26:
# %bb.18:                               # %.noexc85
.Ltmp27:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp28:
# %bb.19:                               # %_ZNSolsEPFRSoS_E.exit
.Ltmp29:
	leaq	8(%rsp), %rsi
	movl	$_ZSt4cout, %edi
	callq	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
.Ltmp30:
# %bb.20:
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp31:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp32:
# %bb.21:                               # %.noexc87
.Ltmp33:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp34:
# %bb.22:                               # %.noexc88
.Ltmp35:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp36:
# %bb.23:                               # %_ZNSolsEPFRSoS_E.exit51
.Ltmp37:
	leaq	104(%rsp), %rsi
	movl	$_ZSt4cout, %edi
	callq	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
.Ltmp38:
# %bb.24:
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp39:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp40:
# %bb.25:                               # %.noexc91
.Ltmp41:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp42:
# %bb.26:                               # %.noexc92
.Ltmp43:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp44:
# %bb.27:                               # %_ZNSolsEPFRSoS_E.exit52
.Ltmp46:
	leaq	32(%rsp), %rdi
	callq	hipEventCreate
.Ltmp47:
# %bb.28:                               # %.noexc
	leaq	40(%rsp), %rdi
.Ltmp48:
	callq	hipEventCreate
.Ltmp49:
# %bb.29:                               # %_ZN5TimerC2Ev.exit
	movq	32(%rsp), %rdi
.Ltmp50:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp51:
# %bb.30:                               # %_ZN5Timer5startEv.exit
	movq	80(%rsp), %rdi
	movq	56(%rsp), %rsi
.Ltmp52:
	movl	$2048, %edx                     # imm = 0x800
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp53:
# %bb.31:
	movq	72(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp54:
	movl	$2048, %edx                     # imm = 0x800
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp55:
# %bb.32:
	movq	64(%rsp), %rsi
.Ltmp56:
	movl	$4, %edx
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp57:
# %bb.33:
	movq	40(%rsp), %rdi
.Ltmp58:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp59:
# %bb.34:                               # %_ZN5Timer4stopEv.exit
	movq	40(%rsp), %rdi
.Ltmp60:
	callq	hipEventSynchronize
.Ltmp61:
# %bb.35:                               # %_ZN5Timer4syncEv.exit
.Ltmp62:
	leaq	88(%rsp), %rsi
	movl	$_ZSt4cout, %edi
	callq	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
.Ltmp63:
# %bb.36:
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp64:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp65:
# %bb.37:                               # %.noexc95
.Ltmp66:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp67:
# %bb.38:                               # %.noexc96
.Ltmp68:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp69:
# %bb.39:                               # %_ZNSolsEPFRSoS_E.exit58
	leaq	28(%rsp), %rdi
	movl	$0, (%rdi)
	movq	32(%rsp), %rsi
	movq	40(%rsp), %rdx
.Ltmp70:
	callq	hipEventElapsedTime
.Ltmp71:
# %bb.40:
	cvtss2sd	28(%rsp), %xmm0
.Ltmp72:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp73:
# %bb.41:                               # %_ZNSolsEf.exit
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp74:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp75:
# %bb.42:                               # %.noexc99
.Ltmp76:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp77:
# %bb.43:                               # %.noexc100
.Ltmp78:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp79:
# %bb.44:                               # %_ZNSolsEPFRSoS_E.exit62
	movq	80(%rsp), %rdi
.Ltmp80:
	callq	hipFree
.Ltmp81:
# %bb.45:
	movq	72(%rsp), %rdi
.Ltmp82:
	callq	hipFree
.Ltmp83:
# %bb.46:
	movq	64(%rsp), %rdi
.Ltmp84:
	callq	hipFree
.Ltmp85:
# %bb.47:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit68
	movq	%r12, %rdi
	callq	_ZdlPv
	movq	%r15, %rdi
	callq	_ZdlPv
	movq	%r14, %rdi
	callq	_ZdlPv
	movq	%rbx, %rdi
	callq	_ZdlPv
	xorl	%eax, %eax
	addq	$120, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_50:
	.cfi_def_cfa_offset 176
.Ltmp8:
	movq	%rax, %r13
	jmp	.LBB1_54
.LBB1_49:
.Ltmp5:
	movq	%rax, %r13
	jmp	.LBB1_55
.LBB1_48:
.Ltmp2:
	movq	%rax, %r13
	jmp	.LBB1_56
.LBB1_52:
.Ltmp45:
	jmp	.LBB1_53
.LBB1_51:
.Ltmp86:
.LBB1_53:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit70
	movq	%rax, %r13
	movq	%r12, %rdi
	callq	_ZdlPv
.LBB1_54:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit72
	movq	%r15, %rdi
	callq	_ZdlPv
.LBB1_55:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit74
	movq	%r14, %rdi
	callq	_ZdlPv
.LBB1_56:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit76
	movq	%rbx, %rdi
	callq	_ZdlPv
	movq	%r13, %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 .Ltmp1-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp3-.Ltmp1                  #   Call between .Ltmp1 and .Ltmp3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 4 <<
	.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 5 <<
	.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 6 <<
	.uleb128 .Ltmp44-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp44
	.uleb128 .Ltmp45-.Lfunc_begin0          #     jumps to .Ltmp45
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp46-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp85-.Ltmp46                #   Call between .Ltmp46 and .Ltmp85
	.uleb128 .Ltmp86-.Lfunc_begin0          #     jumps to .Ltmp86
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp85-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Lfunc_end1-.Ltmp85            #   Call between .Ltmp85 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_,"axG",@progbits,_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_,comdat
	.weak	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_ # -- Begin function _Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
	.type	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_,@function
_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_: # @_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jle	.LBB2_6
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdi, %rax
	shrq	$32, %rax
	movl	%edi, %ecx
	xorl	%edx, %edx
	xorl	%edi, %edi
.LBB2_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_4 Depth 2
	testl	%eax, %eax
	jle	.LBB2_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB2_2 Depth=1
	xorps	%xmm3, %xmm3
	cvtsi2ss	%edi, %xmm3
	movl	%edx, %r8d
	leaq	(%rsi,%r8,4), %r8
	mulss	%xmm0, %xmm3
	xorl	%r9d, %r9d
.LBB2_4:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm4, %xmm4
	cvtsi2ss	%r9d, %xmm4
	mulss	%xmm1, %xmm4
	addss	%xmm3, %xmm4
	addss	%xmm2, %xmm4
	movss	%xmm4, (%r8,%r9,4)
	incq	%r9
	cmpq	%r9, %rax
	jne	.LBB2_4
.LBB2_5:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	incq	%rdi
	addl	%eax, %edx
	cmpq	%rcx, %rdi
	jne	.LBB2_2
.LBB2_6:                                # %._crit_edge14
	retq
.Lfunc_end2:
	.size	_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_, .Lfunc_end2-_Z5minitIfEv10MatrixWrapIT_Li0EES1_S1_S1_
	.cfi_endproc
                                        # -- End function
	.section	.text._Z4mmulIfEv10MatrixWrapIT_Li0EES2_S2_,"axG",@progbits,_Z4mmulIfEv10MatrixWrapIT_Li0EES2_S2_,comdat
	.weak	_Z4mmulIfEv10MatrixWrapIT_Li0EES2_S2_ # -- Begin function _Z4mmulIfEv10MatrixWrapIT_Li0EES2_S2_
	.type	_Z4mmulIfEv10MatrixWrapIT_Li0EES2_S2_,@function
_Z4mmulIfEv10MatrixWrapIT_Li0EES2_S2_:  # @_Z4mmulIfEv10MatrixWrapIT_Li0EES2_S2_
	.cfi_startproc
# %bb.0:
	testl	%r8d, %r8d
	jle	.LBB3_8
# %bb.1:                                # %.preheader22.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, %rax
	shrq	$32, %rax
	movq	%r8, %r10
	shrq	$32, %r10
	sarq	$32, %rdx
	sarq	$32, %rdi
	movq	%r8, %r11
	sarq	$32, %r11
	movl	%r8d, %r8d
	shlq	$2, %rdi
	shlq	$2, %rdx
	xorl	%ebx, %ebx
.LBB3_2:                                # %.preheader22
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
                                        #       Child Loop BB3_10 Depth 3
	testl	%r10d, %r10d
	jle	.LBB3_6
# %bb.3:                                # %.preheader.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movq	%rbx, %r14
	imulq	%r11, %r14
	leaq	(%r9,%r14,4), %r14
	movq	%rcx, %r15
	xorl	%r12d, %r12d
.LBB3_4:                                # %.preheader
                                        #   Parent Loop BB3_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_10 Depth 3
	xorps	%xmm0, %xmm0
	testl	%eax, %eax
	jle	.LBB3_5
# %bb.9:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB3_4 Depth=2
	movq	%r15, %r13
	xorl	%ebp, %ebp
.LBB3_10:                               # %.lr.ph
                                        #   Parent Loop BB3_2 Depth=1
                                        #     Parent Loop BB3_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%rsi,%rbp,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	mulss	(%r13), %xmm1
	addss	%xmm1, %xmm0
	incq	%rbp
	addq	%rdx, %r13
	cmpq	%rbp, %rax
	jne	.LBB3_10
.LBB3_5:                                # %._crit_edge
                                        #   in Loop: Header=BB3_4 Depth=2
	movss	%xmm0, (%r14,%r12,4)
	incq	%r12
	addq	$4, %r15
	cmpq	%r10, %r12
	jne	.LBB3_4
.LBB3_6:                                # %._crit_edge26
                                        #   in Loop: Header=BB3_2 Depth=1
	incq	%rbx
	addq	%rdi, %rsi
	cmpq	%r8, %rbx
	jne	.LBB3_2
# %bb.7:
	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
.LBB3_8:                                # %._crit_edge28
	retq
.Lfunc_end3:
	.size	_Z4mmulIfEv10MatrixWrapIT_Li0EES2_S2_, .Lfunc_end3-_Z4mmulIfEv10MatrixWrapIT_Li0EES2_S2_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZlsIfERSoS0_R10MatrixWrapIT_Li0EE,"axG",@progbits,_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE,comdat
	.weak	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE # -- Begin function _ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
	.type	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE,@function
_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE:     # @_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
	.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
	movl	$.L.str.1, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movl	$.L.str.2, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	4(%r14), %esi
	movq	%r15, %rdi
	callq	_ZNSolsEi
	movl	$.L.str.3, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cmpl	$0, (%r14)
	jle	.LBB4_6
# %bb.1:                                # %.preheader.lr.ph
	xorl	%r15d, %r15d
.LBB4_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_4 Depth 2
	movl	4(%r14), %eax
	testl	%eax, %eax
	jle	.LBB4_5
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB4_2 Depth=1
	xorl	%r12d, %r12d
.LBB4_4:                                # %.lr.ph
                                        #   Parent Loop BB4_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	8(%r14), %rcx
	imull	%r15d, %eax
	cltq
	addq	%r12, %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rcx,%rax,4), %xmm0
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	4(%r14), %eax
	incq	%r12
	cmpl	%eax, %r12d
	jl	.LBB4_4
.LBB4_5:                                # %._crit_edge
                                        #   in Loop: Header=BB4_2 Depth=1
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incl	%r15d
	cmpl	(%r14), %r15d
	jl	.LBB4_2
.LBB4_6:                                # %._crit_edge17
	movq	%rbx, %rax
	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
.Lfunc_end4:
	.size	_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE, .Lfunc_end4-_ZlsIfERSoS0_R10MatrixWrapIT_Li0EE
	.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	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z5mmulkPfS_S_ii, %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_end5:
	.size	__hip_module_ctor, .Lfunc_end5-__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	.LBB6_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
.LBB6_2:
	retq
.Lfunc_end6:
	.size	__hip_module_dtor, .Lfunc_end6-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z5mmulkPfS_S_ii,@object        # @_Z5mmulkPfS_S_ii
	.section	.rodata,"a",@progbits
	.globl	_Z5mmulkPfS_S_ii
	.p2align	3, 0x0
_Z5mmulkPfS_S_ii:
	.quad	_Z20__device_stub__mmulkPfS_S_ii
	.size	_Z5mmulkPfS_S_ii, 8

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

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

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	")\n"
	.size	.L.str.3, 3

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z5mmulkPfS_S_ii"
	.size	.L__unnamed_1, 17

	.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 _Z20__device_stub__mmulkPfS_S_ii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z5mmulkPfS_S_ii
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z5mmulkPfS_S_ii        ; -- Begin function _Z5mmulkPfS_S_ii
	.globl	_Z5mmulkPfS_S_ii
	.p2align	8
	.type	_Z5mmulkPfS_S_ii,@function
_Z5mmulkPfS_S_ii:                       ; @_Z5mmulkPfS_S_ii
; %bb.0:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z5mmulkPfS_S_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 1
		.amdhsa_next_free_sgpr 1
		.amdhsa_reserve_vcc 0
		.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	_Z5mmulkPfS_S_ii, .Lfunc_end0-_Z5mmulkPfS_S_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4
; NumSgprs: 0
; NumVgprs: 0
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 1
; NumVGPRsForWavesPerEU: 1
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z5mmulkPfS_S_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     0
    .sgpr_spill_count: 0
    .symbol:         _Z5mmulkPfS_S_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     0
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
