#include <stdio.h>
#include <iostream>
#include <string.h>
#include <sstream>
#include <fstream>
//#include <bits/stdc++.h>
//#include <stdlib.h>
//#include <time.h>
using namespace std;
/***DEFINING THE DEFINES FOR THE ARRAY INDICES****************************/
//#define N 1
#define C 384
#define H 15
#define W 15
#define R 3
#define S 3
#define M 384
#define E 13
#define F 13
#define U 1
__global__ 
void ew_gpu_mmul(float* d_o, float* d_i, float* d_w, int width, int height, int stride, int ip_height, int wt_width, int num_wt,int num_img, int num_ch)
{
int row = threadIdx.y; int col = threadIdx.x;
{
if((row<height) && (col<width))//earlier it was num_wt*height & num_img*width
{
float prod = 0;
for (int i=0; i<wt_width; i++){
  for (int j=0; j<wt_width; j++){
   for(int k=0; k<num_ch; k++){
    float ip = d_i[blockIdx.x*num_ch*ip_height*ip_height+k*ip_height*ip_height+(stride*(row)+i)*ip_height+(stride*(col)+j)];
       float wt = d_w[(blockIdx.y)*num_ch*wt_width*wt_width+k*wt_width*wt_width+(i*wt_width+j)];
//	float wt = s_w[k*wt_width*wt_width+(i*wt_width+j)];	
	prod += ip*wt;
}
}
}
if(prod>=0)
d_o[blockIdx.x*num_wt*blockDim.x*blockDim.y+(blockIdx.y)*blockDim.x*blockDim.y+row*blockDim.x+col] = prod;
}
}
}
void element_wise_mmul(float* output, float* input, float* weight, int batch_size)
{
int x,y,i,j,m,n,k;
for(n=0; n<batch_size; n++){
for (m=0 ; m<M; m++){
 for (x=0; x<F; x++){
         for(y=0; y<E; y++){
            //    OP[x][y] = 0; // adding bias to output
                 for (i=0; i<R; i++){
                         for (j=0; j<S; j++){
				for(k=0; k<C; k++){
				float ip = input[n*C*H*W+k*H*W+(U*x+i)*H+(U*y+j)];
				float wt = weight[m*C*R*S+k*R*S+i*S+j];

				float prod = ip*wt;
				if (prod>=0)
				output[n*E*F*M+m*E*F+x*E+y] += prod;
                                 //OP[x][y] += IP[U*x+i][U*y+j]*WT[i][j];
                                                         }}
                                                 }
                                        }
                                         }
 

}
}
}
int main(int argc, char* argv[])
{
int batch_size = atoi(argv[1]);
/*************INITALIZING MATRICES*********************************/
float *IP = (float*) malloc(batch_size*C*H*W*sizeof(float));
//float IP[H][W];
float *OP = (float*) malloc(batch_size*M*F*E*sizeof(float));
//float OP[F][E];
float *OPG = (float*) malloc(batch_size*M*F*E*sizeof(float));
float *WT = (float*) malloc(M*C*R*S*sizeof(float));
//float WT[R][S];
float* d_o;
float* d_i;
float* d_w;

//clock_t cpu_start, gpu_start, cpu_end, gpu_end;
//int a,b,c,d;
int c,d,m,n,k;
/*INITIALIZING WEIGHT MATRIX*/
for (m=0; m<M; m++){
for(k=0;k<C;k++){
for (c=0; c<R; c++){
	for(d=0; d<S; d++){
		//WT[c][d] = 2.0;
	WT[m*C*R*S+k*R*S+c*S+d] = (float)rand()/(RAND_MAX+1.0);
//		WT[m*C*R*S+k*R*S+c*S+d] = 1;

}
}	
}
}
/*INITIALIZING OUTPUT MATRIX*/
for (n=0; n<batch_size;n++){
for (m=0; m<M; m++){
for (c=0; c<F; c++){
	for(d=0; d<E; d++){
		//OP[c][d] = 0;
		OP[n*M*F*E+m*F*E+c*E+d] = 0;
}
}	
}
}
/*INITIALIZING INPUT MATRIX*/
for (n=0; n<batch_size; n++){
for(k=0;k<C;k++){
for (c=0; c<H; c++){
	for(d=0; d<W; d++){
	//	IP[c][d] = (a+b+c+d);
	if ((c==0) || (d==0) || (c==14) || (d==14))
        IP[n*C*H*W+k*H*W+c*W+d] = 0;
        else
        IP[n*C*H*W+k*H*W+c*W+d] = (float)rand()/(RAND_MAX+1.0);

}
}	
}
}
cudaMalloc((void**) &d_i,batch_size*C*H*W*sizeof(float));
cudaMemcpy(d_i, IP, batch_size*C*H*W*sizeof(float), cudaMemcpyHostToDevice);
cudaMalloc((void**) &d_w, M*C*R*S*sizeof(float));
cudaMemcpy(d_w, WT, M*C*R*S*sizeof(float), cudaMemcpyHostToDevice);
cudaMalloc((void**) &d_o, batch_size*M*E*F*sizeof(float));
//cpu_start = clock();
//element_wise_mmul(OP, IP, WT,batch_size);
//cpu_end = clock();
dim3 dimGrid(batch_size,384,1);
dim3 dimBlock(13,13,1);
//gpu_start = clock();
ew_gpu_mmul<<<dimGrid, dimBlock>>>(d_o,d_i,d_w,13,13,1,15,3,384,batch_size,384);
//gpu_end = clock();
cudaMemcpy(OPG,d_o, batch_size*M*E*F*sizeof(float), cudaMemcpyDeviceToHost);
float max_error = 0;
string filename = "layer_4_"+to_string(batch_size);
ifstream fin(filename.c_str());
string line ;
int g,h,s,u;
for (u=0;u<batch_size;u++){
for (s=0;s<M;s++){
for (g=0; g<F; g++){
	for(h=0; h<E; h++){	
	getline(fin,line);
        float error = abs(OPG[u*M*F*E+s*E*F+g*E+h]-atof(line.c_str()));
	//float error = abs(OPG[u*M*F*E+s*E*F+g*E+h]-OP[u*M*F*E+s*E*F+g*E+h]);
	if(error > max_error)
	max_error = error; 
 //     printf("the output is %f for index %d, %d,%d,%d.\n",OP[u*M*F*E+s*E*F+g*E+h],u,s,g,h);
 //      printf("diff CPU and GPU is %f for index %d,%d,%d,%d.\n", OPG[u*M*F*E+s*E*F+g*E+h]-OP[u*M*F*E+s*E*F+g*E+h],u,s,g,h);
 //       printf("the output from GPU  is %f for index %d,%d,%d,%d.\n",OPG[u*M*F*E+s*E*F+g*E+h],u,s,g,h);
}
}
}
}
fin.close();
printf("max error is %f\n", max_error);
//cout<<"time taken by cpu call is "<<((double)(cpu_end-cpu_start))/CLOCKS_PER_SEC<<"secs"<<endl;
//cout<<"time taken by gpu call is "<<((double)(gpu_end-gpu_start))/CLOCKS_PER_SEC<<"secs"<<endl;

cudaFree(d_o);
cudaFree(d_i);
cudaFree(d_w);
free(OPG);
free(IP);
free(WT);
free(OP);	
return 0;
}


	.file	"tmpxft_003b11ab_00000000-6_3-cnn_gpu_reg_1acc2gm_l4.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3828:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3828:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z17element_wise_mmulPfS_S_i
	.type	_Z17element_wise_mmulPfS_S_i, @function
_Z17element_wise_mmulPfS_S_i:
.LFB3823:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	xorps	%xmm1, %xmm1
	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
	movq	%rdi, -32(%rsp)
	movq	%rsi, -24(%rsp)
	movl	%ecx, -4(%rsp)
	movq	%rax, -56(%rsp)
	movq	%rdx, -16(%rsp)
	xorl	%edx, %edx
.L3:
	movl	-4(%rsp), %eax
	cmpl	%eax, %edx
	jge	.L2
	imull	$64896, %edx, %esi
	xorl	%r15d, %r15d
.L17:
	movq	-56(%rsp), %rax
	xorl	%ecx, %ecx
	movq	%rax, -48(%rsp)
.L15:
	imull	$13, %ecx, %eax
	addl	%esi, %eax
	movl	%eax, -8(%rsp)
	xorl	%eax, %eax
.L13:
	movl	-8(%rsp), %ebx
	movq	-48(%rsp), %r8
	movq	%r15, %r9
	leal	(%rbx,%rax), %edi
	movq	-32(%rsp), %rbx
	movslq	%edi, %rdi
	leaq	(%rbx,%rdi,4), %r14
	movq	-24(%rsp), %rbx
	leaq	(%rbx,%rax,4), %rdi
	movq	%rdi, -40(%rsp)
	xorl	%edi, %edi
.L11:
	movq	-16(%rsp), %r10
	movq	-40(%rsp), %rbx
	leaq	(%r10,%r9,4), %r11
	leaq	(%rbx,%r8,4), %rbx
	xorl	%r10d, %r10d
.L9:
	movq	%r11, %r13
	movq	%rbx, %r12
	xorl	%ebp, %ebp
.L6:
	movss	(%r12), %xmm0
	mulss	0(%r13), %xmm0
	comiss	%xmm1, %xmm0
	jb	.L4
	addss	(%r14), %xmm0
	movss	%xmm0, (%r14)
.L4:
	incl	%ebp
	addq	$900, %r12
	addq	$36, %r13
	cmpl	$384, %ebp
	jne	.L6
	incl	%r10d
	addq	$4, %rbx
	addq	$4, %r11
	cmpl	$3, %r10d
	jne	.L9
	addl	$3, %edi
	addq	$15, %r8
	addq	$3, %r9
	cmpl	$9, %edi
	jne	.L11
	incq	%rax
	cmpq	$13, %rax
	jne	.L13
	incl	%ecx
	addq	$15, -48(%rsp)
	cmpl	$13, %ecx
	jne	.L15
	addq	$3456, %r15
	addl	$169, %esi
	cmpq	$1327104, %r15
	jne	.L17
	addq	$86400, -56(%rsp)
	incl	%edx
	jmp	.L3
.L2:
	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
.LFE3823:
	.size	_Z17element_wise_mmulPfS_S_i, .-_Z17element_wise_mmulPfS_S_i
	.globl	_Z43__device_stub__Z11ew_gpu_mmulPfS_S_iiiiiiiiPfS_S_iiiiiiii
	.type	_Z43__device_stub__Z11ew_gpu_mmulPfS_S_iiiiiiiiPfS_S_iiiiiiii, @function
_Z43__device_stub__Z11ew_gpu_mmulPfS_S_iiiiiiiiPfS_S_iiiiiiii:
.LFB3850:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	224(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	232(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	240(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	248(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	256(%rsp), %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L22
	pushq	56(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z11ew_gpu_mmulPfS_S_iiiiiiii(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 240
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L22:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3850:
	.size	_Z43__device_stub__Z11ew_gpu_mmulPfS_S_iiiiiiiiPfS_S_iiiiiiii, .-_Z43__device_stub__Z11ew_gpu_mmulPfS_S_iiiiiiiiPfS_S_iiiiiiii
	.globl	_Z11ew_gpu_mmulPfS_S_iiiiiiii
	.type	_Z11ew_gpu_mmulPfS_S_iiiiiiii, @function
_Z11ew_gpu_mmulPfS_S_iiiiiiii:
.LFB3851:
	.cfi_startproc
	endbr64
	jmp	_Z43__device_stub__Z11ew_gpu_mmulPfS_S_iiiiiiiiPfS_S_iiiiiiii
	.cfi_endproc
.LFE3851:
	.size	_Z11ew_gpu_mmulPfS_S_iiiiiiii, .-_Z11ew_gpu_mmulPfS_S_iiiiiiii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"_Z11ew_gpu_mmulPfS_S_iiiiiiii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3853:
	.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	_Z11ew_gpu_mmulPfS_S_iiiiiiii(%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
.LFE3853:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC4:
	.string	"layer_4_"
.LC6:
	.string	"max error is %f\n"
.LC3:
	.string	"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3824:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3824
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$936, %rsp
	.cfi_def_cfa_offset 992
	movq	8(%rsi), %rdi
	movq	%fs:40, %rax
	movq	%rax, 920(%rsp)
	xorl	%eax, %eax
	call	atoi@PLT
	movl	%eax, %r12d
	imull	$86400, %eax, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
	call	malloc@PLT
	movq	%rax, 32(%rsp)
	imull	$64896, %r12d, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rdi
	movq	%rax, 56(%rsp)
	call	malloc@PLT
	movl	$5308416, %edi
	movq	%rax, 40(%rsp)
	call	malloc@PLT
	movq	%rax, 48(%rsp)
	movq	%rax, %rsi
.L30:
	movq	%rsi, %rcx
	movl	%ebx, %ebp
	xorl	%r15d, %r15d
.L36:
	movq	%rcx, %rdi
	movl	%ebp, %r13d
.L34:
	xorl	%r14d, %r14d
.L31:
	movq	%rsi, 72(%rsp)
	movq	%rcx, 64(%rsp)
	movq	%rdi, 24(%rsp)
	call	rand@PLT
	movq	24(%rsp), %rdi
	movq	64(%rsp), %rcx
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC2(%rip), %xmm0
	movq	72(%rsp), %rsi
	movss	%xmm0, (%rdi,%r14,4)
	incq	%r14
	cmpq	$3, %r14
	jne	.L31
	addl	$3, %r13d
	leal	9(%rbp), %eax
	addq	$12, %rdi
	cmpl	%r13d, %eax
	jne	.L34
	incl	%r15d
	addq	$36, %rcx
	cmpl	$384, %r15d
	je	.L33
	movl	%r13d, %ebp
	jmp	.L36
.L33:
	addl	$3456, %ebx
	addq	$13824, %rsi
	cmpl	$1327104, %ebx
	jne	.L30
	movq	56(%rsp), %r8
	xorl	%esi, %esi
	xorl	%eax, %eax
.L35:
	cmpl	%r12d, %esi
	jge	.L90
	movq	%r8, %rdx
	xorl	%r9d, %r9d
.L37:
	movq	%rdx, %rdi
	movl	$169, %ecx
	incl	%r9d
	addq	$676, %rdx
	rep stosl
	cmpl	$384, %r9d
	jne	.L37
	incl	%esi
	addq	$259584, %r8
	jmp	.L35
.L90:
	xorl	%r13d, %r13d
	movl	$16385, %r8d
.L38:
	cmpl	%r12d, %r13d
	jge	.L45
	imull	$86400, %r13d, %ebx
	xorl	%ebp, %ebp
.L46:
	movl	%ebx, %edi
	xorl	%r14d, %r14d
.L44:
	movl	%r14d, %ecx
	movq	%r8, %rax
	shrq	%cl, %rax
	movq	32(%rsp), %rcx
	movq	%rax, 24(%rsp)
	movslq	%edi, %rax
	leaq	(%rcx,%rax,4), %r15
	xorl	%ecx, %ecx
.L41:
	movq	24(%rsp), %rdx
	movq	%r8, %rax
	shrq	%cl, %rax
	orq	%rdx, %rax
	testb	$1, %al
	je	.L39
	movl	$0x00000000, (%r15)
	jmp	.L40
.L39:
	movl	%edi, 72(%rsp)
	movl	%ecx, 64(%rsp)
	call	rand@PLT
	movl	72(%rsp), %edi
	movl	64(%rsp), %ecx
	movl	$16385, %r8d
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC2(%rip), %xmm0
	movss	%xmm0, (%r15)
.L40:
	incl	%ecx
	addq	$4, %r15
	cmpl	$15, %ecx
	jne	.L41
	incl	%r14d
	addl	$15, %edi
	cmpl	$15, %r14d
	jne	.L44
	incl	%ebp
	addl	$225, %ebx
	cmpl	$384, %ebp
	jne	.L46
	incl	%r13d
	jmp	.L38
.L45:
	movq	16(%rsp), %rsi
	leaq	88(%rsp), %rdi
	movl	%r12d, %ebx
.LEHB0:
	call	cudaMalloc@PLT
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	88(%rsp), %rdi
	call	cudaMemcpy@PLT
	leaq	96(%rsp), %rdi
	movl	$5308416, %esi
	call	cudaMalloc@PLT
	movq	48(%rsp), %rsi
	movq	96(%rsp), %rdi
	movl	$1, %ecx
	movl	$5308416, %edx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rsi
	leaq	80(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	$33554435, %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$7, %rax
	movl	%r12d, 104(%rsp)
	movabsq	$55834574861, %rdx
	movl	$1, %ecx
	movq	%rax, 108(%rsp)
	movq	104(%rsp), %rdi
	movl	112(%rsp), %esi
	movq	%rdx, 116(%rsp)
	movl	$1, 124(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L47
	pushq	%rcx
	.cfi_def_cfa_offset 1000
	movl	$1, %r9d
	movl	$13, %r8d
	movl	$13, %ecx
	pushq	$384
	.cfi_def_cfa_offset 1008
	pushq	%r12
	.cfi_def_cfa_offset 1016
	pushq	$384
	.cfi_def_cfa_offset 1024
	pushq	$3
	.cfi_def_cfa_offset 1032
	pushq	$15
	.cfi_def_cfa_offset 1040
	movq	144(%rsp), %rdx
	movq	136(%rsp), %rsi
	movq	128(%rsp), %rdi
	call	_Z43__device_stub__Z11ew_gpu_mmulPfS_S_iiiiiiiiPfS_S_iiiiiiii
	addq	$48, %rsp
	.cfi_def_cfa_offset 992
.L47:
	movq	8(%rsp), %rdx
	movq	80(%rsp), %rsi
	movl	$2, %ecx
	movl	%r12d, %r13d
	movq	40(%rsp), %rdi
	shrl	$31, %r13d
	call	cudaMemcpy@PLT
.LEHE0:
	testl	%r12d, %r12d
	jns	.L48
	movl	%r12d, %ebx
	negl	%ebx
.L48:
	movl	%ebx, %eax
	movl	$1, %ebp
	movl	$10000, %ecx
.L53:
	cmpl	$9, %eax
	jbe	.L49
	cmpl	$99, %eax
	ja	.L50
	incl	%ebp
	jmp	.L49
.L50:
	cmpl	$999, %eax
	ja	.L51
	addl	$2, %ebp
	jmp	.L49
.L51:
	cmpl	$9999, %eax
	ja	.L52
	addl	$3, %ebp
	jmp	.L49
.L52:
	movl	%eax, %eax
	xorl	%edx, %edx
	addl	$4, %ebp
	divq	%rcx
	jmp	.L53
.L49:
	leaq	192(%rsp), %rax
	leal	0(%r13,%rbp), %esi
	movl	$45, %edx
	decl	%ebp
	movq	%rax, 8(%rsp)
	movq	8(%rsp), %rdi
	leaq	208(%rsp), %rax
	movq	%rax, 192(%rsp)
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc@PLT
	movzbl	%r13b, %r8d
	movl	$201, %ecx
	leaq	719(%rsp), %rdi
	leaq	.LC3(%rip), %rsi
	addq	192(%rsp), %r8
	rep movsb
	movl	$100, %ecx
.L54:
	cmpl	$99, %ebx
	jbe	.L91
	movl	%ebx, %eax
	xorl	%edx, %edx
	movl	%ebp, %esi
	divl	%ecx
	addl	%edx, %edx
	movl	%eax, %ebx
	leal	1(%rdx), %eax
	movb	719(%rsp,%rdx), %dl
	movb	719(%rsp,%rax), %al
	movb	%al, (%r8,%rsi)
	leal	-1(%rbp), %eax
	subl	$2, %ebp
	movb	%dl, (%r8,%rax)
	jmp	.L54
.L91:
	leal	48(%rbx), %eax
	cmpl	$9, %ebx
	jbe	.L57
	addl	%ebx, %ebx
	leal	1(%rbx), %eax
	movb	719(%rsp,%rax), %al
	movb	%al, 1(%r8)
	movb	719(%rsp,%rbx), %al
.L57:
	movb	%al, (%r8)
	movq	8(%rsp), %rdi
	leaq	.LC4(%rip), %rdx
	xorl	%esi, %esi
.LEHB1:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6insertEmPKc@PLT
.LEHE1:
	movq	%rax, %rsi
	leaq	128(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	movl	$8, %edx
	movq	128(%rsp), %rsi
.LEHB2:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE2:
	leaq	176(%rsp), %rax
	xorl	%edx, %edx
	movb	$0, 176(%rsp)
	movq	%rax, 160(%rsp)
	xorl	%eax, %eax
	movq	%rax, 168(%rsp)
	movl	%edx, 24(%rsp)
	movl	$0x00000000, 16(%rsp)
.L58:
	cmpl	%r12d, 24(%rsp)
	jge	.L68
	imull	$64896, 24(%rsp), %r15d
	xorl	%r14d, %r14d
.L69:
	movl	%r15d, %ebp
.L67:
	movq	40(%rsp), %rcx
	movslq	%ebp, %rax
	xorl	%r13d, %r13d
	leaq	(%rcx,%rax,4), %rax
	movq	%rax, 64(%rsp)
.L64:
	movq	192(%rsp), %rax
	movq	-24(%rax), %rax
	movq	432(%rsp,%rax), %rbx
	testq	%rbx, %rbx
	jne	.L59
	movq	920(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L86
.LEHB3:
	call	_ZSt16__throw_bad_castv@PLT
.L59:
	cmpb	$0, 56(%rbx)
	je	.L61
	movb	67(%rbx), %al
	jmp	.L62
.L61:
	movq	%rbx, %rdi
	call	_ZNKSt5ctypeIcE13_M_widen_initEv@PLT
	movq	(%rbx), %rax
	movl	$10, %esi
	movq	%rbx, %rdi
	call	*48(%rax)
.L62:
	movq	8(%rsp), %rdi
	movsbl	%al, %edx
	leaq	160(%rsp), %rsi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_@PLT
	movq	64(%rsp), %rax
	movq	160(%rsp), %rdi
	cvtss2sd	(%rax,%r13,4), %xmm2
	movq	%xmm2, %rbx
	incq	%r13
	call	atof@PLT
	movaps	%xmm0, %xmm1
	movq	%rbx, %xmm0
	subsd	%xmm1, %xmm0
	andps	.LC5(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	maxss	16(%rsp), %xmm0
	movss	%xmm0, 16(%rsp)
	cmpq	$13, %r13
	jne	.L64
	addl	$13, %ebp
	leal	169(%r15), %eax
	cmpl	%ebp, %eax
	jne	.L67
	incl	%r14d
	cmpl	$384, %r14d
	je	.L66
	movl	%ebp, %r15d
	jmp	.L69
.L66:
	incl	24(%rsp)
	jmp	.L58
.L68:
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	16(%rsp), %xmm0
	call	__printf_chk@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	96(%rsp), %rdi
	call	cudaFree@PLT
.LEHE3:
	movq	40(%rsp), %rdi
	call	free@PLT
	movq	32(%rsp), %rdi
	call	free@PLT
	movq	48(%rsp), %rdi
	call	free@PLT
	movq	56(%rsp), %rdi
	call	free@PLT
	leaq	160(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	128(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	920(%rsp), %rax
	subq	%fs:40, %rax
	je	.L75
	jmp	.L86
.L78:
	endbr64
	movq	%rax, %rbx
.L70:
	movq	8(%rsp), %rdi
	jmp	.L89
.L80:
	endbr64
	movq	%rax, %rbx
.L72:
	leaq	160(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L73
.L79:
	endbr64
	movq	%rax, %rbx
.L73:
	leaq	128(%rsp), %rdi
.L89:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	920(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L86
	movq	%rbx, %rdi
.LEHB4:
	call	_Unwind_Resume@PLT
.LEHE4:
.L86:
	call	__stack_chk_fail@PLT
.L75:
	addq	$936, %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
.LFE3824:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3824:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3824-.LLSDACSB3824
.LLSDACSB3824:
	.uleb128 .LEHB0-.LFB3824
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3824
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L78-.LFB3824
	.uleb128 0
	.uleb128 .LEHB2-.LFB3824
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L79-.LFB3824
	.uleb128 0
	.uleb128 .LEHB3-.LFB3824
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L80-.LFB3824
	.uleb128 0
	.uleb128 .LEHB4-.LFB3824
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
.LLSDACSE3824:
	.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
.LC2:
	.long	805306368
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC5:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.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 <stdio.h>
#include <iostream>
#include <string.h>
#include <sstream>
#include <fstream>
//#include <bits/stdc++.h>
//#include <stdlib.h>
//#include <time.h>
using namespace std;
/***DEFINING THE DEFINES FOR THE ARRAY INDICES****************************/
//#define N 1
#define C 384
#define H 15
#define W 15
#define R 3
#define S 3
#define M 384
#define E 13
#define F 13
#define U 1
__global__ 
void ew_gpu_mmul(float* d_o, float* d_i, float* d_w, int width, int height, int stride, int ip_height, int wt_width, int num_wt,int num_img, int num_ch)
{
int row = threadIdx.y; int col = threadIdx.x;
{
if((row<height) && (col<width))//earlier it was num_wt*height & num_img*width
{
float prod = 0;
for (int i=0; i<wt_width; i++){
  for (int j=0; j<wt_width; j++){
   for(int k=0; k<num_ch; k++){
    float ip = d_i[blockIdx.x*num_ch*ip_height*ip_height+k*ip_height*ip_height+(stride*(row)+i)*ip_height+(stride*(col)+j)];
       float wt = d_w[(blockIdx.y)*num_ch*wt_width*wt_width+k*wt_width*wt_width+(i*wt_width+j)];
//	float wt = s_w[k*wt_width*wt_width+(i*wt_width+j)];	
	prod += ip*wt;
}
}
}
if(prod>=0)
d_o[blockIdx.x*num_wt*blockDim.x*blockDim.y+(blockIdx.y)*blockDim.x*blockDim.y+row*blockDim.x+col] = prod;
}
}
}
void element_wise_mmul(float* output, float* input, float* weight, int batch_size)
{
int x,y,i,j,m,n,k;
for(n=0; n<batch_size; n++){
for (m=0 ; m<M; m++){
 for (x=0; x<F; x++){
         for(y=0; y<E; y++){
            //    OP[x][y] = 0; // adding bias to output
                 for (i=0; i<R; i++){
                         for (j=0; j<S; j++){
				for(k=0; k<C; k++){
				float ip = input[n*C*H*W+k*H*W+(U*x+i)*H+(U*y+j)];
				float wt = weight[m*C*R*S+k*R*S+i*S+j];

				float prod = ip*wt;
				if (prod>=0)
				output[n*E*F*M+m*E*F+x*E+y] += prod;
                                 //OP[x][y] += IP[U*x+i][U*y+j]*WT[i][j];
                                                         }}
                                                 }
                                        }
                                         }
 

}
}
}
int main(int argc, char* argv[])
{
int batch_size = atoi(argv[1]);
/*************INITALIZING MATRICES*********************************/
float *IP = (float*) malloc(batch_size*C*H*W*sizeof(float));
//float IP[H][W];
float *OP = (float*) malloc(batch_size*M*F*E*sizeof(float));
//float OP[F][E];
float *OPG = (float*) malloc(batch_size*M*F*E*sizeof(float));
float *WT = (float*) malloc(M*C*R*S*sizeof(float));
//float WT[R][S];
float* d_o;
float* d_i;
float* d_w;

//clock_t cpu_start, gpu_start, cpu_end, gpu_end;
//int a,b,c,d;
int c,d,m,n,k;
/*INITIALIZING WEIGHT MATRIX*/
for (m=0; m<M; m++){
for(k=0;k<C;k++){
for (c=0; c<R; c++){
	for(d=0; d<S; d++){
		//WT[c][d] = 2.0;
	WT[m*C*R*S+k*R*S+c*S+d] = (float)rand()/(RAND_MAX+1.0);
//		WT[m*C*R*S+k*R*S+c*S+d] = 1;

}
}	
}
}
/*INITIALIZING OUTPUT MATRIX*/
for (n=0; n<batch_size;n++){
for (m=0; m<M; m++){
for (c=0; c<F; c++){
	for(d=0; d<E; d++){
		//OP[c][d] = 0;
		OP[n*M*F*E+m*F*E+c*E+d] = 0;
}
}	
}
}
/*INITIALIZING INPUT MATRIX*/
for (n=0; n<batch_size; n++){
for(k=0;k<C;k++){
for (c=0; c<H; c++){
	for(d=0; d<W; d++){
	//	IP[c][d] = (a+b+c+d);
	if ((c==0) || (d==0) || (c==14) || (d==14))
        IP[n*C*H*W+k*H*W+c*W+d] = 0;
        else
        IP[n*C*H*W+k*H*W+c*W+d] = (float)rand()/(RAND_MAX+1.0);

}
}	
}
}
hipMalloc((void**) &d_i,batch_size*C*H*W*sizeof(float));
hipMemcpy(d_i, IP, batch_size*C*H*W*sizeof(float), hipMemcpyHostToDevice);
hipMalloc((void**) &d_w, M*C*R*S*sizeof(float));
hipMemcpy(d_w, WT, M*C*R*S*sizeof(float), hipMemcpyHostToDevice);
hipMalloc((void**) &d_o, batch_size*M*E*F*sizeof(float));
//cpu_start = clock();
//element_wise_mmul(OP, IP, WT,batch_size);
//cpu_end = clock();
dim3 dimGrid(batch_size,384,1);
dim3 dimBlock(13,13,1);
//gpu_start = clock();
ew_gpu_mmul<<<dimGrid, dimBlock>>>(d_o,d_i,d_w,13,13,1,15,3,384,batch_size,384);
//gpu_end = clock();
hipMemcpy(OPG,d_o, batch_size*M*E*F*sizeof(float), hipMemcpyDeviceToHost);
float max_error = 0;
string filename = "layer_4_"+to_string(batch_size);
ifstream fin(filename.c_str());
string line ;
int g,h,s,u;
for (u=0;u<batch_size;u++){
for (s=0;s<M;s++){
for (g=0; g<F; g++){
	for(h=0; h<E; h++){	
	getline(fin,line);
        float error = abs(OPG[u*M*F*E+s*E*F+g*E+h]-atof(line.c_str()));
	//float error = abs(OPG[u*M*F*E+s*E*F+g*E+h]-OP[u*M*F*E+s*E*F+g*E+h]);
	if(error > max_error)
	max_error = error; 
 //     printf("the output is %f for index %d, %d,%d,%d.\n",OP[u*M*F*E+s*E*F+g*E+h],u,s,g,h);
 //      printf("diff CPU and GPU is %f for index %d,%d,%d,%d.\n", OPG[u*M*F*E+s*E*F+g*E+h]-OP[u*M*F*E+s*E*F+g*E+h],u,s,g,h);
 //       printf("the output from GPU  is %f for index %d,%d,%d,%d.\n",OPG[u*M*F*E+s*E*F+g*E+h],u,s,g,h);
}
}
}
}
fin.close();
printf("max error is %f\n", max_error);
//cout<<"time taken by cpu call is "<<((double)(cpu_end-cpu_start))/CLOCKS_PER_SEC<<"secs"<<endl;
//cout<<"time taken by gpu call is "<<((double)(gpu_end-gpu_start))/CLOCKS_PER_SEC<<"secs"<<endl;

hipFree(d_o);
hipFree(d_i);
hipFree(d_w);
free(OPG);
free(IP);
free(WT);
free(OP);	
return 0;
}


	.text
	.file	"3-cnn_gpu_reg_1acc2gm_l4.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z26__device_stub__ew_gpu_mmulPfS_S_iiiiiiii # -- Begin function _Z26__device_stub__ew_gpu_mmulPfS_S_iiiiiiii
	.type	_Z26__device_stub__ew_gpu_mmulPfS_S_iiiiiiii,@function
_Z26__device_stub__ew_gpu_mmulPfS_S_iiiiiiii: # @_Z26__device_stub__ew_gpu_mmulPfS_S_iiiiiiii
	.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	$192, %rsp
	.cfi_def_cfa_offset 240
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	240(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	248(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	256(%rsp), %rax
	movq	%rax, 64(%rbx)
	leaq	264(%rsp), %rax
	movq	%rax, 72(%rbx)
	leaq	272(%rsp), %rax
	movq	%rax, 80(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11ew_gpu_mmulPfS_S_iiiiiiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$208, %rsp
	.cfi_adjust_cfa_offset -208
	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	_Z26__device_stub__ew_gpu_mmulPfS_S_iiiiiiii, .Lfunc_end0-_Z26__device_stub__ew_gpu_mmulPfS_S_iiiiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z17element_wise_mmulPfS_S_i    # -- Begin function _Z17element_wise_mmulPfS_S_i
	.type	_Z17element_wise_mmulPfS_S_i,@function
_Z17element_wise_mmulPfS_S_i:           # @_Z17element_wise_mmulPfS_S_i
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, -64(%rsp)                 # 8-byte Spill
	movq	%rdi, -72(%rsp)                 # 8-byte Spill
	testl	%ecx, %ecx
	jle	.LBB1_17
# %bb.1:                                # %.preheader46.preheader
	movabsq	$64424509440, %rax              # imm = 0xF00000000
	movabsq	$4294967296, %r8                # imm = 0x100000000
	movl	%ecx, %ecx
	movq	%rcx, -80(%rsp)                 # 8-byte Spill
	xorl	%ecx, %ecx
	movq	%rcx, -96(%rsp)                 # 8-byte Spill
	xorps	%xmm0, %xmm0
	movabsq	$966367641600, %r11             # imm = 0xE100000000
	xorl	%edx, %edx
.LBB1_2:                                # %.preheader46
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_3 Depth 2
                                        #       Child Loop BB1_4 Depth 3
                                        #         Child Loop BB1_5 Depth 4
                                        #           Child Loop BB1_6 Depth 5
                                        #             Child Loop BB1_7 Depth 6
                                        #               Child Loop BB1_8 Depth 7
	movq	%rdx, -56(%rsp)                 # 8-byte Spill
	movabsq	$278726197641216, %rcx          # imm = 0xFD8000000000
	imulq	%rcx, %rdx
	sarq	$30, %rdx
	addq	-72(%rsp), %rdx                 # 8-byte Folded Reload
	movq	%rdx, -48(%rsp)                 # 8-byte Spill
	movq	-64(%rsp), %rcx                 # 8-byte Reload
	movq	%rcx, -88(%rsp)                 # 8-byte Spill
	xorl	%ecx, %ecx
.LBB1_3:                                # %.preheader45
                                        #   Parent Loop BB1_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB1_4 Depth 3
                                        #         Child Loop BB1_5 Depth 4
                                        #           Child Loop BB1_6 Depth 5
                                        #             Child Loop BB1_7 Depth 6
                                        #               Child Loop BB1_8 Depth 7
	movq	%rcx, -40(%rsp)                 # 8-byte Spill
	imulq	$676, %rcx, %rcx                # imm = 0x2A4
	addq	-48(%rsp), %rcx                 # 8-byte Folded Reload
	movq	%rcx, -32(%rsp)                 # 8-byte Spill
	movq	-96(%rsp), %r13                 # 8-byte Reload
	xorl	%ecx, %ecx
.LBB1_4:                                # %.preheader44
                                        #   Parent Loop BB1_2 Depth=1
                                        #     Parent Loop BB1_3 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB1_5 Depth 4
                                        #           Child Loop BB1_6 Depth 5
                                        #             Child Loop BB1_7 Depth 6
                                        #               Child Loop BB1_8 Depth 7
	movq	%rcx, -24(%rsp)                 # 8-byte Spill
	imulq	$52, %rcx, %rcx
	addq	-32(%rsp), %rcx                 # 8-byte Folded Reload
	movq	%r13, -16(%rsp)                 # 8-byte Spill
	xorl	%edi, %edi
.LBB1_5:                                # %.preheader43
                                        #   Parent Loop BB1_2 Depth=1
                                        #     Parent Loop BB1_3 Depth=2
                                        #       Parent Loop BB1_4 Depth=3
                                        # =>      This Loop Header: Depth=4
                                        #           Child Loop BB1_6 Depth 5
                                        #             Child Loop BB1_7 Depth 6
                                        #               Child Loop BB1_8 Depth 7
	movq	-88(%rsp), %r14                 # 8-byte Reload
	movq	%r13, -8(%rsp)                  # 8-byte Spill
	xorl	%r15d, %r15d
.LBB1_6:                                # %.preheader42
                                        #   Parent Loop BB1_2 Depth=1
                                        #     Parent Loop BB1_3 Depth=2
                                        #       Parent Loop BB1_4 Depth=3
                                        #         Parent Loop BB1_5 Depth=4
                                        # =>        This Loop Header: Depth=5
                                        #             Child Loop BB1_7 Depth 6
                                        #               Child Loop BB1_8 Depth 7
	movq	%r14, %r12
	movq	%r13, %rdx
	xorl	%ebp, %ebp
.LBB1_7:                                # %.preheader
                                        #   Parent Loop BB1_2 Depth=1
                                        #     Parent Loop BB1_3 Depth=2
                                        #       Parent Loop BB1_4 Depth=3
                                        #         Parent Loop BB1_5 Depth=4
                                        #           Parent Loop BB1_6 Depth=5
                                        # =>          This Loop Header: Depth=6
                                        #               Child Loop BB1_8 Depth 7
	xorl	%ebx, %ebx
	movq	%rdx, %r10
.LBB1_8:                                #   Parent Loop BB1_2 Depth=1
                                        #     Parent Loop BB1_3 Depth=2
                                        #       Parent Loop BB1_4 Depth=3
                                        #         Parent Loop BB1_5 Depth=4
                                        #           Parent Loop BB1_6 Depth=5
                                        #             Parent Loop BB1_7 Depth=6
                                        # =>            This Inner Loop Header: Depth=7
	movq	%r10, %r9
	sarq	$30, %r9
	movss	(%rsi,%r9), %xmm1               # xmm1 = mem[0],zero,zero,zero
	mulss	(%r12,%rbx), %xmm1
	ucomiss	%xmm0, %xmm1
	jb	.LBB1_10
# %bb.9:                                #   in Loop: Header=BB1_8 Depth=7
	addss	(%rcx,%rdi,4), %xmm1
	movss	%xmm1, (%rcx,%rdi,4)
.LBB1_10:                               #   in Loop: Header=BB1_8 Depth=7
	addq	%r11, %r10
	addq	$36, %rbx
	cmpq	$13824, %rbx                    # imm = 0x3600
	jne	.LBB1_8
# %bb.11:                               #   in Loop: Header=BB1_7 Depth=6
	incq	%rbp
	addq	%r8, %rdx
	addq	$4, %r12
	cmpq	$3, %rbp
	jne	.LBB1_7
# %bb.12:                               #   in Loop: Header=BB1_6 Depth=5
	incq	%r15
	addq	%rax, %r13
	addq	$12, %r14
	cmpq	$3, %r15
	jne	.LBB1_6
# %bb.13:                               #   in Loop: Header=BB1_5 Depth=4
	incq	%rdi
	movq	-8(%rsp), %r13                  # 8-byte Reload
	addq	%r8, %r13
	cmpq	$13, %rdi
	jne	.LBB1_5
# %bb.14:                               #   in Loop: Header=BB1_4 Depth=3
	movq	-24(%rsp), %rcx                 # 8-byte Reload
	incq	%rcx
	movq	-16(%rsp), %r13                 # 8-byte Reload
	addq	%rax, %r13
	cmpq	$13, %rcx
	jne	.LBB1_4
# %bb.15:                               #   in Loop: Header=BB1_3 Depth=2
	movq	-40(%rsp), %rcx                 # 8-byte Reload
	incq	%rcx
	addq	$13824, -88(%rsp)               # 8-byte Folded Spill
                                        # imm = 0x3600
	cmpq	$384, %rcx                      # imm = 0x180
	jne	.LBB1_3
# %bb.16:                               #   in Loop: Header=BB1_2 Depth=1
	movq	-56(%rsp), %rdx                 # 8-byte Reload
	incq	%rdx
	movabsq	$371085174374400, %rcx          # imm = 0x1518000000000
	addq	%rcx, -96(%rsp)                 # 8-byte Folded Spill
	cmpq	-80(%rsp), %rdx                 # 8-byte Folded Reload
	jne	.LBB1_2
.LBB1_17:                               # %._crit_edge
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z17element_wise_mmulPfS_S_i, .Lfunc_end1-_Z17element_wise_mmulPfS_S_i
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI2_0:
	.long	0x30000000                      # float 4.65661287E-10
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI2_1:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float 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	%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	$680, %rsp                      # imm = 0x2A8
	.cfi_def_cfa_offset 736
	.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	8(%rsi), %rdi
	.cfi_escape 0x2e, 0x00
	callq	atoi
	movl	%eax, %ebx
	imull	$86400, %eax, %eax              # imm = 0x15180
	movslq	%eax, %rdi
	shlq	$2, %rdi
	.cfi_escape 0x2e, 0x00
	movq	%rdi, 32(%rsp)                  # 8-byte Spill
	callq	malloc
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movq	%rbx, 8(%rsp)                   # 8-byte Spill
	imull	$64896, %ebx, %eax              # imm = 0xFD80
	movslq	%eax, %rdi
	shlq	$2, %rdi
	.cfi_escape 0x2e, 0x00
	movq	%rdi, 56(%rsp)                  # 8-byte Spill
	callq	malloc
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	.cfi_escape 0x2e, 0x00
	movl	$5308416, %edi                  # imm = 0x510000
	callq	malloc
	xorl	%ecx, %ecx
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	movq	%rax, %r14
.LBB2_1:                                # %.preheader155
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_2 Depth 2
                                        #       Child Loop BB2_3 Depth 3
                                        #         Child Loop BB2_4 Depth 4
	movq	%rcx, 16(%rsp)                  # 8-byte Spill
	movq	%r14, %r15
	xorl	%r12d, %r12d
.LBB2_2:                                # %.preheader154
                                        #   Parent Loop BB2_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_3 Depth 3
                                        #         Child Loop BB2_4 Depth 4
	movq	%r15, %r13
	xorl	%ebp, %ebp
.LBB2_3:                                # %.preheader153
                                        #   Parent Loop BB2_1 Depth=1
                                        #     Parent Loop BB2_2 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB2_4 Depth 4
	xorl	%ebx, %ebx
.LBB2_4:                                #   Parent Loop BB2_1 Depth=1
                                        #     Parent Loop BB2_2 Depth=2
                                        #       Parent Loop BB2_3 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	.cfi_escape 0x2e, 0x00
	callq	rand
	movss	.LCPI2_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	%xmm1, %xmm0
	movss	%xmm0, (%r13,%rbx,4)
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB2_4
# %bb.5:                                #   in Loop: Header=BB2_3 Depth=3
	incq	%rbp
	addq	$12, %r13
	cmpq	$3, %rbp
	jne	.LBB2_3
# %bb.6:                                #   in Loop: Header=BB2_2 Depth=2
	incq	%r12
	addq	$36, %r15
	cmpq	$384, %r12                      # imm = 0x180
	jne	.LBB2_2
# %bb.7:                                #   in Loop: Header=BB2_1 Depth=1
	movq	16(%rsp), %rcx                  # 8-byte Reload
	incq	%rcx
	addq	$13824, %r14                    # imm = 0x3600
	cmpq	$384, %rcx                      # imm = 0x180
	jne	.LBB2_1
# %bb.8:                                # %.preheader152
	movq	8(%rsp), %rcx                   # 8-byte Reload
	movl	%ecx, %eax
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	testl	%ecx, %ecx
	jle	.LBB2_22
# %bb.9:                                # %.preheader147.preheader
	xorl	%r14d, %r14d
.LBB2_10:                               # %.preheader147
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_11 Depth 2
                                        #       Child Loop BB2_12 Depth 3
                                        #         Child Loop BB2_13 Depth 4
	movq	%r14, %rbx
	movabsq	$371085174374400, %rax          # imm = 0x1518000000000
	imulq	%rax, %rbx
	sarq	$30, %rbx
	addq	40(%rsp), %rbx                  # 8-byte Folded Reload
	xorl	%r13d, %r13d
.LBB2_11:                               # %.preheader146
                                        #   Parent Loop BB2_10 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_12 Depth 3
                                        #         Child Loop BB2_13 Depth 4
	movq	%rbx, %r15
	xorl	%ebp, %ebp
.LBB2_12:                               # %.preheader145
                                        #   Parent Loop BB2_10 Depth=1
                                        #     Parent Loop BB2_11 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB2_13 Depth 4
	xorl	%r12d, %r12d
.LBB2_13:                               #   Parent Loop BB2_10 Depth=1
                                        #     Parent Loop BB2_11 Depth=2
                                        #       Parent Loop BB2_12 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	xorps	%xmm0, %xmm0
	cmpq	$14, %r12
	je	.LBB2_18
# %bb.14:                               #   in Loop: Header=BB2_13 Depth=4
	cmpq	$14, %rbp
	je	.LBB2_18
# %bb.15:                               #   in Loop: Header=BB2_13 Depth=4
	testq	%rbp, %rbp
	je	.LBB2_18
# %bb.16:                               #   in Loop: Header=BB2_13 Depth=4
	testq	%r12, %r12
	je	.LBB2_18
# %bb.17:                               #   in Loop: Header=BB2_13 Depth=4
	.cfi_escape 0x2e, 0x00
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI2_0(%rip), %xmm0
.LBB2_18:                               #   in Loop: Header=BB2_13 Depth=4
	movss	%xmm0, (%r15,%r12,4)
	incq	%r12
	cmpq	$15, %r12
	jne	.LBB2_13
# %bb.19:                               #   in Loop: Header=BB2_12 Depth=3
	incq	%rbp
	addq	$60, %r15
	cmpq	$15, %rbp
	jne	.LBB2_12
# %bb.20:                               #   in Loop: Header=BB2_11 Depth=2
	incq	%r13
	addq	$900, %rbx                      # imm = 0x384
	cmpq	$384, %r13                      # imm = 0x180
	jne	.LBB2_11
# %bb.21:                               #   in Loop: Header=BB2_10 Depth=1
	incq	%r14
	cmpq	48(%rsp), %r14                  # 8-byte Folded Reload
	jne	.LBB2_10
.LBB2_22:                               # %._crit_edge
	.cfi_escape 0x2e, 0x00
	leaq	88(%rsp), %r14
	movq	%r14, %rdi
	movq	32(%rsp), %rbx                  # 8-byte Reload
	movq	%rbx, %rsi
	callq	hipMalloc
	movq	(%r14), %rdi
	.cfi_escape 0x2e, 0x00
	movl	$1, %r14d
	movq	40(%rsp), %rsi                  # 8-byte Reload
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	.cfi_escape 0x2e, 0x00
	leaq	80(%rsp), %rbp
	movl	$5308416, %esi                  # imm = 0x510000
	movq	%rbp, %rdi
	callq	hipMalloc
	movq	(%rbp), %rdi
	.cfi_escape 0x2e, 0x00
	movl	$5308416, %edx                  # imm = 0x510000
	movq	72(%rsp), %rsi                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	.cfi_escape 0x2e, 0x00
	leaq	64(%rsp), %rdi
	movq	56(%rsp), %rbx                  # 8-byte Reload
	movq	%rbx, %rsi
	callq	hipMalloc
	movabsq	$1649267441664, %rdi            # imm = 0x18000000000
	addq	48(%rsp), %rdi                  # 8-byte Folded Reload
	.cfi_escape 0x2e, 0x00
	movabsq	$55834574861, %rdx              # imm = 0xD0000000D
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_24
# %bb.23:
	movq	64(%rsp), %rdi
	movq	88(%rsp), %rsi
	movq	80(%rsp), %rdx
	.cfi_escape 0x2e, 0x30
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	$384, %eax                      # imm = 0x180
	movl	$13, %ecx
	movl	$13, %r8d
	movl	$1, %r9d
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	24(%rsp)                        # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	$3
	.cfi_adjust_cfa_offset 8
	pushq	$15
	.cfi_adjust_cfa_offset 8
	callq	_Z26__device_stub__ew_gpu_mmulPfS_S_iiiiiiii
	addq	$48, %rsp
	.cfi_adjust_cfa_offset -48
.LBB2_24:
	movq	64(%rsp), %rsi
	.cfi_escape 0x2e, 0x00
	movq	24(%rsp), %rdi                  # 8-byte Reload
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rax                   # 8-byte Reload
	movl	%eax, %ebp
	negl	%ebp
	cmovsl	%eax, %ebp
	cmpl	$10, %ebp
	jb	.LBB2_33
# %bb.25:                               # %.lr.ph.i.i.preheader
	movl	$4, %r14d
	movl	$3518437209, %eax               # imm = 0xD1B71759
	movl	%ebp, %ecx
.LBB2_26:                               # %.lr.ph.i.i
                                        # =>This Inner Loop Header: Depth=1
	cmpl	$99, %ecx
	jbe	.LBB2_27
# %bb.28:                               #   in Loop: Header=BB2_26 Depth=1
	cmpl	$999, %ecx                      # imm = 0x3E7
	jbe	.LBB2_29
# %bb.30:                               #   in Loop: Header=BB2_26 Depth=1
	cmpl	$10000, %ecx                    # imm = 0x2710
	jb	.LBB2_33
# %bb.31:                               #   in Loop: Header=BB2_26 Depth=1
	movl	%ecx, %edx
	imulq	%rax, %rdx
	shrq	$45, %rdx
	addl	$4, %r14d
	cmpl	$99999, %ecx                    # imm = 0x1869F
	movl	%edx, %ecx
	ja	.LBB2_26
# %bb.32:                               # %_ZNSt8__detail14__to_chars_lenIjEEjT_i.exit.i.loopexit
	addl	$-3, %r14d
	jmp	.LBB2_33
.LBB2_27:
	addl	$-2, %r14d
	jmp	.LBB2_33
.LBB2_29:
	decl	%r14d
.LBB2_33:                               # %_ZNSt8__detail14__to_chars_lenIjEEjT_i.exit.i
	movq	8(%rsp), %rbx                   # 8-byte Reload
                                        # kill: def $ebx killed $ebx killed $rbx def $rbx
	shrl	$31, %ebx
	leal	(%r14,%rbx), %esi
	leaq	176(%rsp), %r12
	movq	%r12, -16(%r12)
.Ltmp0:
	.cfi_escape 0x2e, 0x00
	leaq	160(%rsp), %rdi
	movl	$45, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc
.Ltmp1:
# %bb.34:                               # %_ZNSt7__cxx119to_stringEi.exit
	movl	%ebx, %edi
	leaq	160(%rsp), %r13
	addq	(%r13), %rdi
	.cfi_escape 0x2e, 0x00
	movl	%r14d, %esi
	movl	%ebp, %edx
	callq	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
.Ltmp3:
	.cfi_escape 0x2e, 0x00
	movl	$.L.str, %ecx
	movl	$8, %r8d
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmPKcm
.Ltmp4:
# %bb.35:                               # %.noexc
	movq	%rax, %r14
	leaq	112(%rsp), %rdi
	movq	%rdi, -16(%rdi)
	movq	(%rax), %rsi
	movq	%rax, %rbx
	addq	$16, %rbx
	cmpq	%rbx, %rsi
	je	.LBB2_36
# %bb.37:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	movq	%rsi, 96(%rsp)
	movq	16(%r14), %rax
	movq	%rax, 112(%rsp)
	movq	8(%r14), %r15
	jmp	.LBB2_38
.LBB2_36:
	movq	8(%r14), %r15
	leaq	1(%r15), %rdx
	.cfi_escape 0x2e, 0x00
	callq	memcpy@PLT
.LBB2_38:
	movq	%r15, 104(%rsp)
	movq	%rbx, (%r14)
	movq	$0, 8(%r14)
	movb	$0, 16(%r14)
	movq	160(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB2_40
# %bb.39:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i123
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB2_40:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movq	96(%rsp), %rsi
.Ltmp6:
	.cfi_escape 0x2e, 0x00
	leaq	160(%rsp), %r14
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp7:
# %bb.41:
	leaq	144(%rsp), %rax
	movq	%rax, -16(%rax)
	movq	$0, -8(%rax)
	movb	$0, (%rax)
	cmpl	$0, 8(%rsp)                     # 4-byte Folded Reload
	jle	.LBB2_42
# %bb.43:                               # %.preheader144.preheader
	xorps	%xmm0, %xmm0
	xorl	%r13d, %r13d
	leaq	128(%rsp), %r12
.LBB2_44:                               # %.preheader144
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_45 Depth 2
                                        #       Child Loop BB2_46 Depth 3
                                        #         Child Loop BB2_47 Depth 4
	movq	%r13, 32(%rsp)                  # 8-byte Spill
	movabsq	$278726197641216, %rax          # imm = 0xFD8000000000
	imulq	%rax, %r13
	sarq	$30, %r13
	addq	24(%rsp), %r13                  # 8-byte Folded Reload
	xorl	%ebx, %ebx
.LBB2_45:                               # %.preheader143
                                        #   Parent Loop BB2_44 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_46 Depth 3
                                        #         Child Loop BB2_47 Depth 4
	movq	%r13, 56(%rsp)                  # 8-byte Spill
	xorl	%r15d, %r15d
.LBB2_46:                               # %.preheader
                                        #   Parent Loop BB2_44 Depth=1
                                        #     Parent Loop BB2_45 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB2_47 Depth 4
	xorl	%ebp, %ebp
	movaps	%xmm0, %xmm1
.LBB2_47:                               #   Parent Loop BB2_44 Depth=1
                                        #     Parent Loop BB2_45 Depth=2
                                        #       Parent Loop BB2_46 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movss	%xmm1, 16(%rsp)                 # 4-byte Spill
	movq	160(%rsp), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp9:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp10:
# %bb.48:                               # %.noexc124
                                        #   in Loop: Header=BB2_47 Depth=4
.Ltmp11:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp12:
# %bb.49:                               # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit
                                        #   in Loop: Header=BB2_47 Depth=4
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r13,%rbp,4), %xmm0
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	movq	128(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	callq	atof
	movsd	8(%rsp), %xmm1                  # 8-byte Reload
                                        # xmm1 = mem[0],zero
	subsd	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm1, %xmm0
	andps	.LCPI2_1(%rip), %xmm0
	maxss	16(%rsp), %xmm0                 # 4-byte Folded Reload
	incq	%rbp
	movaps	%xmm0, %xmm1
	cmpq	$13, %rbp
	jne	.LBB2_47
# %bb.50:                               #   in Loop: Header=BB2_46 Depth=3
	incq	%r15
	addq	$52, %r13
	cmpq	$13, %r15
	jne	.LBB2_46
# %bb.51:                               #   in Loop: Header=BB2_45 Depth=2
	incq	%rbx
	movq	56(%rsp), %r13                  # 8-byte Reload
	addq	$676, %r13                      # imm = 0x2A4
	cmpq	$384, %rbx                      # imm = 0x180
	jne	.LBB2_45
# %bb.52:                               #   in Loop: Header=BB2_44 Depth=1
	movq	32(%rsp), %r13                  # 8-byte Reload
	incq	%r13
	cmpq	48(%rsp), %r13                  # 8-byte Folded Reload
	jne	.LBB2_44
# %bb.53:                               # %._crit_edge182.loopexit
	cvtss2sd	%xmm0, %xmm0
	jmp	.LBB2_54
.LBB2_42:
	xorps	%xmm0, %xmm0
.LBB2_54:                               # %._crit_edge182
	movsd	%xmm0, 16(%rsp)                 # 8-byte Spill
.Ltmp14:
	.cfi_escape 0x2e, 0x00
	leaq	160(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp15:
# %bb.55:
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.1, %edi
	movsd	16(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movq	64(%rsp), %rdi
.Ltmp16:
	.cfi_escape 0x2e, 0x00
	callq	hipFree
.Ltmp17:
# %bb.56:
	movq	88(%rsp), %rdi
.Ltmp18:
	.cfi_escape 0x2e, 0x00
	callq	hipFree
.Ltmp19:
# %bb.57:
	movq	80(%rsp), %rdi
.Ltmp20:
	.cfi_escape 0x2e, 0x00
	callq	hipFree
.Ltmp21:
# %bb.58:
	.cfi_escape 0x2e, 0x00
	movq	24(%rsp), %rdi                  # 8-byte Reload
	callq	free
	.cfi_escape 0x2e, 0x00
	movq	40(%rsp), %rdi                  # 8-byte Reload
	callq	free
	.cfi_escape 0x2e, 0x00
	movq	72(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	128(%rsp), %rdi
	leaq	144(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_60
# %bb.59:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i132
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB2_60:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit134
	.cfi_escape 0x2e, 0x00
	leaq	160(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	96(%rsp), %rdi
	leaq	112(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_62
# %bb.61:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i135
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB2_62:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit137
	xorl	%eax, %eax
	addq	$680, %rsp                      # imm = 0x2A8
	.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
.LBB2_70:
	.cfi_def_cfa_offset 736
.Ltmp8:
	movq	%rax, %rbx
	jmp	.LBB2_71
.LBB2_63:
.Ltmp5:
	movq	%rax, %rbx
	movq	160(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB2_74
# %bb.64:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i126
	.cfi_escape 0x2e, 0x00
	jmp	.LBB2_73
.LBB2_75:
.Ltmp2:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	__clang_call_terminate
.LBB2_66:                               # %.loopexit.split-lp
.Ltmp22:
	jmp	.LBB2_67
.LBB2_65:                               # %.loopexit
.Ltmp13:
.LBB2_67:
	movq	%rax, %rbx
	movq	128(%rsp), %rdi
	leaq	144(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_69
# %bb.68:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i129
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB2_69:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit131
	.cfi_escape 0x2e, 0x00
	leaq	160(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
.LBB2_71:
	movq	96(%rsp), %rdi
	leaq	112(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_74
# %bb.72:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i138
	.cfi_escape 0x2e, 0x00
.LBB2_73:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit140
	callq	_ZdlPv
.LBB2_74:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit140
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.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	1                               #   On action: 1
	.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 .Ltmp4-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp6-.Ltmp4                  #   Call between .Ltmp4 and .Ltmp6
	.byte	0                               #     has no landing pad
	.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 .Ltmp12-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp12
	.uleb128 .Ltmp13-.Lfunc_begin0          #     jumps to .Ltmp13
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp14-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp21-.Ltmp14                #   Call between .Ltmp14 and .Ltmp21
	.uleb128 .Ltmp22-.Lfunc_begin0          #     jumps to .Ltmp22
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp21-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Lfunc_end2-.Ltmp21            #   Call between .Ltmp21 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.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_end3:
	.size	__clang_call_terminate, .Lfunc_end3-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_,"axG",@progbits,_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_,comdat
	.weak	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_ # -- Begin function _ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
	.type	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_,@function
_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_: # @_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
	.cfi_startproc
# %bb.0:
                                        # kill: def $esi killed $esi def $rsi
	cmpl	$100, %edx
	jb	.LBB4_1
# %bb.2:                                # %.lr.ph.preheader
	decl	%esi
.LBB4_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	%edx, %eax
	imulq	$1374389535, %rax, %rax         # imm = 0x51EB851F
	shrq	$37, %rax
	imull	$100, %eax, %ecx
	movl	%edx, %r8d
	subl	%ecx, %r8d
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits+1(%r8,%r8), %cl
	movl	%esi, %r9d
	movb	%cl, (%rdi,%r9)
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits(%r8,%r8), %cl
	leal	-1(%rsi), %r8d
	movb	%cl, (%rdi,%r8)
	addl	$-2, %esi
	cmpl	$9999, %edx                     # imm = 0x270F
	movl	%eax, %edx
	ja	.LBB4_3
	jmp	.LBB4_4
.LBB4_1:
	movl	%edx, %eax
.LBB4_4:                                # %._crit_edge
	cmpl	$10, %eax
	jb	.LBB4_6
# %bb.5:
	movl	%eax, %eax
	leaq	(%rax,%rax), %rcx
	movl	%ecx, %ecx
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits+1(%rcx), %cl
	movb	%cl, 1(%rdi)
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits(%rax,%rax), %al
	jmp	.LBB4_7
.LBB4_6:
	orb	$48, %al
.LBB4_7:
	movb	%al, (%rdi)
	retq
.Lfunc_end4:
	.size	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_, .Lfunc_end4-_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
	.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	$_Z11ew_gpu_mmulPfS_S_iiiiiiii, %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	_Z11ew_gpu_mmulPfS_S_iiiiiiii,@object # @_Z11ew_gpu_mmulPfS_S_iiiiiiii
	.section	.rodata,"a",@progbits
	.globl	_Z11ew_gpu_mmulPfS_S_iiiiiiii
	.p2align	3, 0x0
_Z11ew_gpu_mmulPfS_S_iiiiiiii:
	.quad	_Z26__device_stub__ew_gpu_mmulPfS_S_iiiiiiii
	.size	_Z11ew_gpu_mmulPfS_S_iiiiiiii, 8

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

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"max error is %f\n"
	.size	.L.str.1, 17

	.type	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits,@object # @__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits
	.section	.rodata.str1.16,"aMS",@progbits,1
	.p2align	4, 0x0
.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits:
	.asciz	"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899"
	.size	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits, 201

	.type	.L__unnamed_1,@object           # @0
	.section	.rodata.str1.1,"aMS",@progbits,1
.L__unnamed_1:
	.asciz	"_Z11ew_gpu_mmulPfS_S_iiiiiiii"
	.size	.L__unnamed_1, 30

	.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 _Z26__device_stub__ew_gpu_mmulPfS_S_iiiiiiii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z11ew_gpu_mmulPfS_S_iiiiiiii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z11ew_gpu_mmulPfS_S_iiiiiiii ; -- Begin function _Z11ew_gpu_mmulPfS_S_iiiiiiii
	.globl	_Z11ew_gpu_mmulPfS_S_iiiiiiii
	.p2align	8
	.type	_Z11ew_gpu_mmulPfS_S_iiiiiiii,@function
_Z11ew_gpu_mmulPfS_S_iiiiiiii:          ; @_Z11ew_gpu_mmulPfS_S_iiiiiiii
; %bb.0:
	s_load_b128 s[8:11], s[0:1], 0x18
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, s9, v1
	v_cmp_gt_i32_e64 s2, s8, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, vcc_lo
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_11
; %bb.1:                                ; %.preheader62
	s_clause 0x2
	s_load_b64 s[2:3], s[0:1], 0x28
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[8:9], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s2, 1
	s_cbranch_scc1 .LBB0_8
; %bb.2:                                ; %.preheader61.lr.ph
	s_load_b32 s16, s[0:1], 0x34
	v_mul_lo_u32 v2, v1, s10
	s_mul_i32 s17, s2, s2
	s_mov_b32 s13, 0
	s_mul_i32 s18, s11, s11
	s_mov_b32 s20, 0
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s12, s14, s16
	s_cmp_gt_i32 s16, 0
	v_mad_u64_u32 v[3:4], null, s12, s11, v[2:3]
	s_mul_i32 s12, s15, s16
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_mul_i32 s19, s12, s17
	v_mul_lo_u32 v4, s11, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, v0, s10, v[4:5]
	v_dual_mov_b32 v4, 0 :: v_dual_mov_b32 v5, 0
	s_cselect_b32 s10, -1, 0
.LBB0_3:                                ; %.preheader61
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;       Child Loop BB0_5 Depth 3
	s_delay_alu instid0(VALU_DEP_2)
	v_mov_b32_e32 v6, v2
	s_mov_b32 s21, s19
	s_mov_b32 s22, s13
.LBB0_4:                                ; %.preheader
                                        ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_5 Depth 3
	s_delay_alu instid0(VALU_DEP_1)
	v_mov_b32_e32 v3, v6
	s_and_not1_b32 vcc_lo, exec_lo, s10
	s_mov_b32 s12, s21
	s_mov_b32 s23, s16
	s_cbranch_vccnz .LBB0_6
.LBB0_5:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_4 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	v_lshlrev_b64 v[7:8], 2, v[3:4]
	s_lshl_b64 s[24:25], s[12:13], 2
	v_add_nc_u32_e32 v3, s18, v3
	s_add_u32 s24, s8, s24
	s_addc_u32 s25, s9, s25
	s_add_i32 s23, s23, -1
	v_add_co_u32 v7, vcc_lo, s6, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s7, v8, vcc_lo
	s_load_b32 s24, s[24:25], 0x0
	s_add_i32 s12, s12, s17
	s_cmp_eq_u32 s23, 0
	global_load_b32 v7, v[7:8], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fmac_f32_e32 v5, s24, v7
	s_cbranch_scc0 .LBB0_5
.LBB0_6:                                ; %._crit_edge
                                        ;   in Loop: Header=BB0_4 Depth=2
	v_add_nc_u32_e32 v6, 1, v6
	s_add_i32 s22, s22, 1
	s_add_i32 s21, s21, 1
	s_cmp_eq_u32 s22, s2
	s_cbranch_scc0 .LBB0_4
; %bb.7:                                ; %._crit_edge67
                                        ;   in Loop: Header=BB0_3 Depth=1
	v_add_nc_u32_e32 v2, s11, v2
	s_add_i32 s20, s20, 1
	s_add_i32 s19, s19, s2
	s_cmp_eq_u32 s20, s2
	s_cbranch_scc0 .LBB0_3
	s_branch .LBB0_9
.LBB0_8:
	v_mov_b32_e32 v5, 0
.LBB0_9:                                ; %._crit_edge71
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_le_f32_e32 vcc_lo, 0, v5
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB0_11
; %bb.10:
	s_load_b32 s0, s[0:1], 0x44
	s_mul_i32 s1, s14, s3
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	s_add_i32 s1, s1, s15
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s2, s0, 16
	s_and_b32 s0, s0, 0xffff
	v_mad_u64_u32 v[2:3], null, s1, s2, v[1:2]
	v_mad_u64_u32 v[3:4], null, v2, s0, v[0:1]
	v_mov_b32_e32 v4, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[3:4]
	v_add_co_u32 v0, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	global_store_b32 v[0:1], v5, off
.LBB0_11:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11ew_gpu_mmulPfS_S_iiiiiiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 312
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 26
		.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	_Z11ew_gpu_mmulPfS_S_iiiiiiii, .Lfunc_end0-_Z11ew_gpu_mmulPfS_S_iiiiiiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 480
; NumSgprs: 28
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 3
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 28
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .offset:         44
        .size:           4
        .value_kind:     by_value
      - .offset:         48
        .size:           4
        .value_kind:     by_value
      - .offset:         52
        .size:           4
        .value_kind:     by_value
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         60
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         64
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         68
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         70
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         72
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         74
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         76
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         78
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         120
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 312
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11ew_gpu_mmulPfS_S_iiiiiiii
    .private_segment_fixed_size: 0
    .sgpr_count:     28
    .sgpr_spill_count: 0
    .symbol:         _Z11ew_gpu_mmulPfS_S_iiiiiiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
