#include <cstdio>
#include <cstdlib>
#include <cuda_runtime.h>
#include <sys/time.h>

#define random(a, b) (rand() % (b - a) + a)
#define index(i, j, col) (((i) * (col)) + (j))

void PrintMatrix(float *A, int row, int col);
void FillMatrix(float *matrix, int row, int col, int padding);

__global__ void im2col(float *matrix, int channel_id,
                       int channel, float *matrix_flatten,
                       int height_stride, int width_stride,
                       int matrix_height, int matrix_width,
                       int filter_height, int filter_width,
                       int result_height, int result_width)
{
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    int j = blockIdx.y * blockDim.y + threadIdx.y;
    //   展平
    if (i < result_height && j < result_width)
        for (int x = 0; x < filter_height; x++)
            for (int y = 0; y < filter_width; y++)
                matrix_flatten[index(index(i, j, result_width), 
                             index(x, y, filter_width) + channel_id * filter_height * filter_width,
                             channel * filter_height * filter_width)]
                = matrix[index(i * height_stride + x, j * width_stride + y, matrix_width)];
    __syncthreads();
}

__global__ void MatrixMulCUDA(float *A, float *B, float *C, int m, int n, int k)
{
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    int j = blockIdx.y * blockDim.y + threadIdx.y;
    float sum = 0;
    if (i < m && j < k)
    {
        for (int x = 0; x < n; x++)
            sum += A[i * n + x] * B[x * k + j];
        C[i * k + j] = sum;
    }
}

int main(int argc, char **argv)
{
    if (argc != 5)
    {
        printf("Wrong Input!\n");
        return 1;
    }

    int size = atoi(argv[1]);
    int stride = atoi(argv[2]);
    
    int x = atoi(argv[3]);
    int y = atoi(argv[4]);
    dim3 threadsPerBlock(x, y);
    
    int channel = 3;
    float *matrix[channel];
    float *filter[channel];
    float *result;
    
    int matrix_height = size;
    int matrix_width = size;
    
    int filter_height = 3;
    int filter_width = 3;

    int padding = ((((matrix_height - filter_height) / stride + 1) * stride - (matrix_height - filter_height)) % stride) / 2;
    int matrix_size = sizeof(float) * (matrix_height + 2 * padding) * (matrix_width + 2 * padding);
    int result_size = sizeof(float) * ((matrix_height - filter_height + 2 * padding) / stride + 1) * ((matrix_width - filter_width + 2 * padding) / stride + 1);
    int filter_size = sizeof(float) * filter_height * filter_width;

    for (int i = 0; i < channel; i++)
    {
        matrix[i] = (float *)malloc(matrix_size);
        memset(matrix[i], 0, sizeof(matrix[i]));
        FillMatrix(matrix[i], matrix_height, matrix_width, padding);
    }
    for (int i = 0; i < channel; i++)
    {
        filter[i] = (float *)malloc(filter_size);
        for (int j = 0; j < filter_height * filter_width; j++)
            filter[i][j] = j + 1;
    }
    result = (float *)malloc(result_size);
    
    timeval t1, t2;
    gettimeofday(&t1, NULL);
    
    float *cuda_matrix[channel];
    float *cuda_filter[channel];
    float *cuda_result;

    for (int i = 0; i < channel; i++)
    {
        cudaMalloc(&cuda_matrix[i], matrix_size);
        cudaMemcpy(cuda_matrix[i], matrix[i], matrix_size, cudaMemcpyHostToDevice);
    }
    for (int i = 0; i < channel; i++)
    {
        cudaMalloc(&cuda_filter[i], filter_size);
        cudaMemcpy(cuda_filter[i], filter[i], filter_size, cudaMemcpyHostToDevice);
    }
    cudaMalloc(&cuda_result, result_size);

    float *matrix_flatten;
    cudaMalloc(&matrix_flatten, result_size * filter_height * filter_width * channel);

    int result_height = (matrix_height - filter_height + 2 * padding) / stride + 1;
    int result_width = (matrix_width - filter_width + 2 * padding) / stride + 1;
    
    dim3 numBlocks((result_height % threadsPerBlock.x) ? result_height / threadsPerBlock.x + 1 : result_height / threadsPerBlock.x, (result_width % threadsPerBlock.y) ? result_width / threadsPerBlock.y + 1 : result_width / threadsPerBlock.y);

    for (int i = 0; i < channel; i++)
        im2col<<<numBlocks, threadsPerBlock>>>(cuda_matrix[i], i, channel, matrix_flatten, stride, stride, matrix_height + 2 * padding, matrix_width + 2 * padding, filter_height, filter_width, result_height, result_width);

    float *filter_flatten;
    cudaMalloc(&filter_flatten, filter_size * channel);

    for (int i = 0; i < channel; i++)
        cudaMemcpy(filter_flatten + i * (filter_height * filter_width), filter[i], filter_size, cudaMemcpyHostToDevice);

    dim3 numBlocks1((result_height * result_width % threadsPerBlock.x) ? result_height * result_width / threadsPerBlock.x + 1 : result_height * result_width / threadsPerBlock.x, (filter_height * filter_width % threadsPerBlock.y) ? filter_height * filter_width / threadsPerBlock.y + 1 : filter_height * filter_width / threadsPerBlock.y);

    MatrixMulCUDA<<<numBlocks1, threadsPerBlock>>>(matrix_flatten, filter_flatten, cuda_result, result_height * result_width, filter_height * filter_width * channel, 1);
    gettimeofday(&t2, NULL);
    
    printf("Matrix Size:%d\tStride:%d\n", size, stride);
    printf("Calculation time:%ldms\n", t2.tv_sec * 1000 + t2.tv_usec/1000 - t1.tv_sec * 1000 - t1.tv_usec/1000);
    cudaMemcpy(result, cuda_result, result_size, cudaMemcpyDeviceToHost);
    
//     for (int i = 0; i < channel; i++)
//     {
//         printf("Matrix after padding of channel %d:\n",i);
//         PrintMatrix(matrix[i], matrix_height + 2 * padding, matrix_width + 2 * padding);
//     }
//     for (int i = 0; i < channel; i++)
//     {
//         printf("Filter of channel %d:\n",i);
//         PrintMatrix(filter[i], filter_height, filter_width);
//     }
//     printf("Result:\n");
//     PrintMatrix(result, ((matrix_height - filter_height + 2 * padding) / stride + 1), ((matrix_width - filter_width + 2 * padding) / stride + 1));
    
    for (int i = 0; i < channel; i++)
        cudaFree(cuda_matrix[i]);
    for (int i = 0; i < channel; i++)
        cudaFree(cuda_filter[i]);
    cudaFree(cuda_result);
    for (int i = 0; i < channel; i++)
        free(matrix[i]);
    for (int i = 0; i < channel; i++)
        free(filter[i]);
    free(result);
}

void FillMatrix(float *matrix, int row, int col, int padding)
{
    for (int i = padding; i < row + padding; i++)
        for (int j = padding; j < col + padding; j++)
            matrix[index(i, j, col + 2 * padding)] = random(0, 9);
}

void PrintMatrix(float *A, int row, int col)
{
    for (int i = 0; i < row; ++i)
    {
        for (int j = 0; j < col; ++j)
            printf("%f ", A[i * col + j]);
        printf("\n");
    }
}
	.file	"tmpxft_00383905_00000000-6_im2col_cuda.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2032:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2032:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z10FillMatrixPfiii
	.type	_Z10FillMatrixPfiii, @function
_Z10FillMatrixPfiii:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	(%rcx,%rsi), %eax
	movl	%ecx, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	leal	(%rdx,%rcx,2), %edi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	imull	%edi, %r15d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%ecx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%eax, 4(%rsp)
.L3:
	cmpl	%ecx, 4(%rsp)
	jle	.L2
	movslq	%r15d, %rax
	movslq	%ebx, %r12
	leaq	0(%r13,%rax,4), %r14
	leal	(%rbx,%rbp), %eax
	movl	%eax, (%rsp)
.L6:
	cmpl	%r12d, (%rsp)
	jle	.L9
	movl	%edi, 12(%rsp)
	movl	%ecx, 8(%rsp)
	call	rand@PLT
	movl	$9, %r8d
	movl	12(%rsp), %edi
	movl	8(%rsp), %ecx
	cltd
	idivl	%r8d
	cvtsi2ssl	%edx, %xmm0
	movss	%xmm0, (%r14,%r12,4)
	incq	%r12
	jmp	.L6
.L9:
	incl	%ecx
	addl	%edi, %r15d
	jmp	.L3
.L2:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z10FillMatrixPfiii, .-_Z10FillMatrixPfiii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%f "
.LC1:
	.string	"\n"
	.text
	.globl	_Z11PrintMatrixPfii
	.type	_Z11PrintMatrixPfii, @function
_Z11PrintMatrixPfii:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L11:
	cmpl	%r14d, %r13d
	jge	.L10
	movslq	%r12d, %rax
	xorl	%r15d, %r15d
	leaq	0(%rbp,%rax,4), %rcx
.L14:
	cmpl	%r15d, %ebx
	jle	.L16
	leaq	.LC0(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%rcx,%r15,4), %xmm0
	movq	%rcx, 8(%rsp)
	incq	%r15
	call	__printf_chk@PLT
	movq	8(%rsp), %rcx
	jmp	.L14
.L16:
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	incl	%r13d
	addl	%ebx, %r12d
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L11
.L10:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z11PrintMatrixPfii, .-_Z11PrintMatrixPfii
	.globl	_Z37__device_stub__Z6im2colPfiiS_iiiiiiiiPfiiS_iiiiiiii
	.type	_Z37__device_stub__Z6im2colPfiiS_iiiiiiiiPfiiS_iiiiiiii, @function
_Z37__device_stub__Z6im2colPfiiS_iiiiiiiiPfiiS_iiiiiiii:
.LFB2054:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movl	%r8d, 4(%rsp)
	movl	%r9d, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 136(%rsp)
	movq	%rsp, %rax
	movq	%rax, 144(%rsp)
	leaq	224(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	232(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	240(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	248(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	256(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	264(%rsp), %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L17
	pushq	48(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z6im2colPfiiS_iiiiiiii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 240
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L17:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2054:
	.size	_Z37__device_stub__Z6im2colPfiiS_iiiiiiiiPfiiS_iiiiiiii, .-_Z37__device_stub__Z6im2colPfiiS_iiiiiiiiPfiiS_iiiiiiii
	.globl	_Z6im2colPfiiS_iiiiiiii
	.type	_Z6im2colPfiiS_iiiiiiii, @function
_Z6im2colPfiiS_iiiiiiii:
.LFB2055:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z6im2colPfiiS_iiiiiiiiPfiiS_iiiiiiii
	.cfi_endproc
.LFE2055:
	.size	_Z6im2colPfiiS_iiiiiiii, .-_Z6im2colPfiiS_iiiiiiii
	.globl	_Z40__device_stub__Z13MatrixMulCUDAPfS_S_iiiPfS_S_iii
	.type	_Z40__device_stub__Z13MatrixMulCUDAPfS_S_iiiPfS_S_iii, @function
_Z40__device_stub__Z13MatrixMulCUDAPfS_S_iiiPfS_S_iii:
.LFB2056:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L22
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z13MatrixMulCUDAPfS_S_iii(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L22:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2056:
	.size	_Z40__device_stub__Z13MatrixMulCUDAPfS_S_iiiPfS_S_iii, .-_Z40__device_stub__Z13MatrixMulCUDAPfS_S_iiiPfS_S_iii
	.globl	_Z13MatrixMulCUDAPfS_S_iii
	.type	_Z13MatrixMulCUDAPfS_S_iii, @function
_Z13MatrixMulCUDAPfS_S_iii:
.LFB2057:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z13MatrixMulCUDAPfS_S_iiiPfS_S_iii
	.cfi_endproc
.LFE2057:
	.size	_Z13MatrixMulCUDAPfS_S_iii, .-_Z13MatrixMulCUDAPfS_S_iii
	.section	.rodata.str1.1
.LC2:
	.string	"Wrong Input!\n"
.LC3:
	.string	"Matrix Size:%d\tStride:%d\n"
.LC4:
	.string	"Calculation time:%ldms\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	cmpl	$5, %edi
	je	.L28
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	$1, %eax
	jmp	.L27
.L28:
	movq	8(%rsi), %rdi
	movq	%rsi, %rbx
	xorl	%r15d, %r15d
	call	atoi@PLT
	movq	16(%rbx), %rdi
	movl	%eax, 12(%rsp)
	call	atoi@PLT
	movq	24(%rbx), %rdi
	movl	%eax, 8(%rsp)
	call	atoi@PLT
	movq	32(%rbx), %rdi
	movl	%eax, 32(%rsp)
	call	atoi@PLT
	movl	$2, %ecx
	movl	$1, 92(%rsp)
	movl	%eax, %ebp
	movl	12(%rsp), %eax
	leal	-3(%rax), %ebx
	movl	%ebx, %eax
	cltd
	idivl	8(%rsp)
	movl	8(%rsp), %eax
	subl	%edx, %eax
	cltd
	idivl	8(%rsp)
	movl	%edx, %eax
	cltd
	idivl	%ecx
	movl	12(%rsp), %edx
	movl	%eax, %r13d
	leal	(%rax,%rax), %eax
	leal	(%rax,%rdx), %r14d
	addl	%ebx, %eax
	cltd
	movl	%r14d, %ecx
	idivl	8(%rsp)
	imull	%r14d, %ecx
	sall	$2, %ecx
	leal	1(%rax), %ebx
	movl	%ebx, %eax
	imull	%ebx, %eax
	movl	%eax, 36(%rsp)
	leal	0(,%rax,4), %r12d
	movslq	%ecx, %rax
	movq	%rax, 16(%rsp)
.L30:
	movq	16(%rsp), %rdi
	call	malloc@PLT
	movq	16(%rsp), %rcx
	movl	$8, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	movq	%rax, 152(%rsp,%r15,8)
	incq	%r15
	call	__memset_chk@PLT
	movl	12(%rsp), %edx
	movl	%r13d, %ecx
	movq	%rax, %rdi
	movl	%edx, %esi
	call	_Z10FillMatrixPfiii
	cmpq	$3, %r15
	jne	.L30
	xorl	%r13d, %r13d
.L32:
	movl	$36, %edi
	call	malloc@PLT
	movl	$1, %edx
	movq	%rax, 176(%rsp,%r13,8)
.L31:
	cvtsi2ssl	%edx, %xmm0
	movss	%xmm0, -4(%rax,%rdx,4)
	incq	%rdx
	cmpq	$10, %rdx
	jne	.L31
	incq	%r13
	cmpq	$3, %r13
	jne	.L32
	movslq	%r12d, %rax
	xorl	%r13d, %r13d
	leaq	200(%rsp), %r15
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	leaq	120(%rsp), %rdi
	xorl	%esi, %esi
	movq	%rax, 40(%rsp)
	call	gettimeofday@PLT
.L33:
	movq	16(%rsp), %rsi
	leaq	(%r15,%r13), %rdi
	call	cudaMalloc@PLT
	movq	0(%r13,%r15), %rdi
	movq	16(%rsp), %rdx
	movl	$1, %ecx
	movq	152(%rsp,%r13), %rsi
	addq	$8, %r13
	call	cudaMemcpy@PLT
	cmpq	$24, %r13
	jne	.L33
	leaq	224(%rsp), %r13
	xorl	%r15d, %r15d
.L34:
	movq	%r13, %rdi
	movl	$36, %esi
	addq	$8, %r13
	call	cudaMalloc@PLT
	movq	-8(%r13), %rdi
	movl	$1, %ecx
	movq	176(%rsp,%r15), %rsi
	movl	$36, %edx
	addq	$8, %r15
	call	cudaMemcpy@PLT
	cmpq	$24, %r15
	jne	.L34
	movq	24(%rsp), %rsi
	leaq	56(%rsp), %rdi
	call	cudaMalloc@PLT
	imull	$27, %r12d, %esi
	leaq	64(%rsp), %rdi
	movslq	%esi, %rsi
	call	cudaMalloc@PLT
	xorl	%edx, %edx
	movl	%ebx, %eax
	movl	$1, 104(%rsp)
	divl	%ebp
	cmpl	$1, %edx
	sbbl	$-1, %eax
	xorl	%edx, %edx
	movl	%eax, %ecx
	movl	%ebx, %eax
	divl	32(%rsp)
	movl	%ecx, 100(%rsp)
	cmpl	$1, %edx
	sbbl	$-1, %eax
	xorl	%r12d, %r12d
	movl	%eax, 96(%rsp)
.L39:
	movl	32(%rsp), %eax
	movl	%ebp, 88(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	92(%rsp), %ecx
	movq	96(%rsp), %rdi
	movl	%eax, 84(%rsp)
	movl	104(%rsp), %esi
	movq	84(%rsp), %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L38
	movq	200(%rsp,%r12,8), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 328
	movl	$3, %edx
	movl	%r12d, %esi
	pushq	%rbx
	.cfi_def_cfa_offset 336
	pushq	$3
	.cfi_def_cfa_offset 344
	pushq	$3
	.cfi_def_cfa_offset 352
	pushq	%r14
	.cfi_def_cfa_offset 360
	pushq	%r14
	.cfi_def_cfa_offset 368
	movl	56(%rsp), %r9d
	movq	112(%rsp), %rcx
	movl	%r9d, %r8d
	call	_Z37__device_stub__Z6im2colPfiiS_iiiiiiiiPfiiS_iiiiiiii
	addq	$48, %rsp
	.cfi_def_cfa_offset 320
.L38:
	incq	%r12
	cmpq	$3, %r12
	jne	.L39
	leaq	72(%rsp), %rdi
	movl	$108, %esi
	leaq	176(%rsp), %r13
	xorl	%r12d, %r12d
	call	cudaMalloc@PLT
.L40:
	movq	72(%rsp), %rdi
	movq	0(%r13), %rsi
	movl	$1, %ecx
	movl	$36, %edx
	addq	$8, %r13
	addq	%r12, %rdi
	addq	$36, %r12
	call	cudaMemcpy@PLT
	cmpq	$108, %r12
	jne	.L40
	xorl	%edx, %edx
	movl	$9, %eax
	movl	$1, %esi
	divl	%ebp
	cmpl	$1, %edx
	sbbl	$-1, %eax
	xorl	%edx, %edx
	movl	%eax, %ecx
	movl	36(%rsp), %eax
	movl	%ecx, 112(%rsp)
	movl	92(%rsp), %ecx
	divl	32(%rsp)
	cmpl	$1, %edx
	movq	84(%rsp), %rdx
	sbbl	$-1, %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%eax, 108(%rsp)
	movq	108(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L43
	imull	%ebx, %ebx
	movq	56(%rsp), %rdx
	movq	72(%rsp), %rsi
	movl	$1, %r9d
	movq	64(%rsp), %rdi
	movl	$27, %r8d
	movl	%ebx, %ecx
	call	_Z40__device_stub__Z13MatrixMulCUDAPfS_S_iiiPfS_S_iii
.L43:
	leaq	136(%rsp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movl	8(%rsp), %ecx
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	$1000, %esi
	movl	$2, %edi
	movq	144(%rsp), %rax
	imulq	$1000, 136(%rsp), %rcx
	cqto
	idivq	%rsi
	movq	$-1000, %rsi
	addq	%rax, %rcx
	imulq	$-1000, 120(%rsp), %rax
	addq	%rax, %rcx
	movq	128(%rsp), %rax
	cqto
	idivq	%rsi
	leaq	.LC4(%rip), %rsi
	leaq	(%rcx,%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	$2, %ecx
	movq	40(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	200(%rsp), %rdi
	call	cudaFree@PLT
	movq	208(%rsp), %rdi
	call	cudaFree@PLT
	movq	216(%rsp), %rdi
	call	cudaFree@PLT
	movq	224(%rsp), %rdi
	call	cudaFree@PLT
	movq	232(%rsp), %rdi
	call	cudaFree@PLT
	movq	240(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	152(%rsp), %rdi
	call	free@PLT
	movq	160(%rsp), %rdi
	call	free@PLT
	movq	168(%rsp), %rdi
	call	free@PLT
	movq	176(%rsp), %rdi
	call	free@PLT
	movq	184(%rsp), %rdi
	call	free@PLT
	movq	192(%rsp), %rdi
	call	free@PLT
	movq	40(%rsp), %rdi
	call	free@PLT
	xorl	%eax, %eax
.L27:
	movq	248(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	addq	$264, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	main, .-main
	.section	.rodata.str1.1
.LC5:
	.string	"_Z13MatrixMulCUDAPfS_S_iii"
.LC6:
	.string	"_Z6im2colPfiiS_iiiiiiii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2059:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -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	.LC5(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z13MatrixMulCUDAPfS_S_iii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC6(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z6im2colPfiiS_iiiiiiii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	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	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2059:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.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
	.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 <cstdio>
#include <cstdlib>
#include <hip/hip_runtime.h>
#include <sys/time.h>

#define random(a, b) (rand() % (b - a) + a)
#define index(i, j, col) (((i) * (col)) + (j))

void PrintMatrix(float *A, int row, int col);
void FillMatrix(float *matrix, int row, int col, int padding);

__global__ void im2col(float *matrix, int channel_id,
                       int channel, float *matrix_flatten,
                       int height_stride, int width_stride,
                       int matrix_height, int matrix_width,
                       int filter_height, int filter_width,
                       int result_height, int result_width)
{
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    int j = blockIdx.y * blockDim.y + threadIdx.y;
    //   展平
    if (i < result_height && j < result_width)
        for (int x = 0; x < filter_height; x++)
            for (int y = 0; y < filter_width; y++)
                matrix_flatten[index(index(i, j, result_width), 
                             index(x, y, filter_width) + channel_id * filter_height * filter_width,
                             channel * filter_height * filter_width)]
                = matrix[index(i * height_stride + x, j * width_stride + y, matrix_width)];
    __syncthreads();
}

__global__ void MatrixMulCUDA(float *A, float *B, float *C, int m, int n, int k)
{
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    int j = blockIdx.y * blockDim.y + threadIdx.y;
    float sum = 0;
    if (i < m && j < k)
    {
        for (int x = 0; x < n; x++)
            sum += A[i * n + x] * B[x * k + j];
        C[i * k + j] = sum;
    }
}

int main(int argc, char **argv)
{
    if (argc != 5)
    {
        printf("Wrong Input!\n");
        return 1;
    }

    int size = atoi(argv[1]);
    int stride = atoi(argv[2]);
    
    int x = atoi(argv[3]);
    int y = atoi(argv[4]);
    dim3 threadsPerBlock(x, y);
    
    int channel = 3;
    float *matrix[channel];
    float *filter[channel];
    float *result;
    
    int matrix_height = size;
    int matrix_width = size;
    
    int filter_height = 3;
    int filter_width = 3;

    int padding = ((((matrix_height - filter_height) / stride + 1) * stride - (matrix_height - filter_height)) % stride) / 2;
    int matrix_size = sizeof(float) * (matrix_height + 2 * padding) * (matrix_width + 2 * padding);
    int result_size = sizeof(float) * ((matrix_height - filter_height + 2 * padding) / stride + 1) * ((matrix_width - filter_width + 2 * padding) / stride + 1);
    int filter_size = sizeof(float) * filter_height * filter_width;

    for (int i = 0; i < channel; i++)
    {
        matrix[i] = (float *)malloc(matrix_size);
        memset(matrix[i], 0, sizeof(matrix[i]));
        FillMatrix(matrix[i], matrix_height, matrix_width, padding);
    }
    for (int i = 0; i < channel; i++)
    {
        filter[i] = (float *)malloc(filter_size);
        for (int j = 0; j < filter_height * filter_width; j++)
            filter[i][j] = j + 1;
    }
    result = (float *)malloc(result_size);
    
    timeval t1, t2;
    gettimeofday(&t1, NULL);
    
    float *cuda_matrix[channel];
    float *cuda_filter[channel];
    float *cuda_result;

    for (int i = 0; i < channel; i++)
    {
        hipMalloc(&cuda_matrix[i], matrix_size);
        hipMemcpy(cuda_matrix[i], matrix[i], matrix_size, hipMemcpyHostToDevice);
    }
    for (int i = 0; i < channel; i++)
    {
        hipMalloc(&cuda_filter[i], filter_size);
        hipMemcpy(cuda_filter[i], filter[i], filter_size, hipMemcpyHostToDevice);
    }
    hipMalloc(&cuda_result, result_size);

    float *matrix_flatten;
    hipMalloc(&matrix_flatten, result_size * filter_height * filter_width * channel);

    int result_height = (matrix_height - filter_height + 2 * padding) / stride + 1;
    int result_width = (matrix_width - filter_width + 2 * padding) / stride + 1;
    
    dim3 numBlocks((result_height % threadsPerBlock.x) ? result_height / threadsPerBlock.x + 1 : result_height / threadsPerBlock.x, (result_width % threadsPerBlock.y) ? result_width / threadsPerBlock.y + 1 : result_width / threadsPerBlock.y);

    for (int i = 0; i < channel; i++)
        im2col<<<numBlocks, threadsPerBlock>>>(cuda_matrix[i], i, channel, matrix_flatten, stride, stride, matrix_height + 2 * padding, matrix_width + 2 * padding, filter_height, filter_width, result_height, result_width);

    float *filter_flatten;
    hipMalloc(&filter_flatten, filter_size * channel);

    for (int i = 0; i < channel; i++)
        hipMemcpy(filter_flatten + i * (filter_height * filter_width), filter[i], filter_size, hipMemcpyHostToDevice);

    dim3 numBlocks1((result_height * result_width % threadsPerBlock.x) ? result_height * result_width / threadsPerBlock.x + 1 : result_height * result_width / threadsPerBlock.x, (filter_height * filter_width % threadsPerBlock.y) ? filter_height * filter_width / threadsPerBlock.y + 1 : filter_height * filter_width / threadsPerBlock.y);

    MatrixMulCUDA<<<numBlocks1, threadsPerBlock>>>(matrix_flatten, filter_flatten, cuda_result, result_height * result_width, filter_height * filter_width * channel, 1);
    gettimeofday(&t2, NULL);
    
    printf("Matrix Size:%d\tStride:%d\n", size, stride);
    printf("Calculation time:%ldms\n", t2.tv_sec * 1000 + t2.tv_usec/1000 - t1.tv_sec * 1000 - t1.tv_usec/1000);
    hipMemcpy(result, cuda_result, result_size, hipMemcpyDeviceToHost);
    
//     for (int i = 0; i < channel; i++)
//     {
//         printf("Matrix after padding of channel %d:\n",i);
//         PrintMatrix(matrix[i], matrix_height + 2 * padding, matrix_width + 2 * padding);
//     }
//     for (int i = 0; i < channel; i++)
//     {
//         printf("Filter of channel %d:\n",i);
//         PrintMatrix(filter[i], filter_height, filter_width);
//     }
//     printf("Result:\n");
//     PrintMatrix(result, ((matrix_height - filter_height + 2 * padding) / stride + 1), ((matrix_width - filter_width + 2 * padding) / stride + 1));
    
    for (int i = 0; i < channel; i++)
        hipFree(cuda_matrix[i]);
    for (int i = 0; i < channel; i++)
        hipFree(cuda_filter[i]);
    hipFree(cuda_result);
    for (int i = 0; i < channel; i++)
        free(matrix[i]);
    for (int i = 0; i < channel; i++)
        free(filter[i]);
    free(result);
}

void FillMatrix(float *matrix, int row, int col, int padding)
{
    for (int i = padding; i < row + padding; i++)
        for (int j = padding; j < col + padding; j++)
            matrix[index(i, j, col + 2 * padding)] = random(0, 9);
}

void PrintMatrix(float *A, int row, int col)
{
    for (int i = 0; i < row; ++i)
    {
        for (int j = 0; j < col; ++j)
            printf("%f ", A[i * col + j]);
        printf("\n");
    }
}
	.text
	.file	"im2col_cuda.hip"
	.globl	_Z21__device_stub__im2colPfiiS_iiiiiiii # -- Begin function _Z21__device_stub__im2colPfiiS_iiiiiiii
	.type	_Z21__device_stub__im2colPfiiS_iiiiiiii,@function
_Z21__device_stub__im2colPfiiS_iiiiiiii: # @_Z21__device_stub__im2colPfiiS_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	$176, %rsp
	.cfi_def_cfa_offset 224
	.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	12(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	8(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	4(%rsp), %rcx
	movl	%r8d, (%rcx)
	movq	%rsp, %r8
	movl	%r9d, (%r8)
	leaq	80(%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	224(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	232(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	240(%rsp), %rax
	movq	%rax, 64(%rbx)
	leaq	248(%rsp), %rax
	movq	%rax, 72(%rbx)
	leaq	256(%rsp), %rax
	movq	%rax, 80(%rbx)
	leaq	264(%rsp), %rax
	movq	%rax, 88(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z6im2colPfiiS_iiiiiiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$192, %rsp
	.cfi_adjust_cfa_offset -192
	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	_Z21__device_stub__im2colPfiiS_iiiiiiii, .Lfunc_end0-_Z21__device_stub__im2colPfiiS_iiiiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z28__device_stub__MatrixMulCUDAPfS_S_iii # -- Begin function _Z28__device_stub__MatrixMulCUDAPfS_S_iii
	.type	_Z28__device_stub__MatrixMulCUDAPfS_S_iii,@function
_Z28__device_stub__MatrixMulCUDAPfS_S_iii: # @_Z28__device_stub__MatrixMulCUDAPfS_S_iii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z13MatrixMulCUDAPfS_S_iii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z28__device_stub__MatrixMulCUDAPfS_S_iii, .Lfunc_end1-_Z28__device_stub__MatrixMulCUDAPfS_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$5, %edi
	jne	.LBB2_1
# %bb.2:
	movq	%rsi, %r14
	movq	8(%rsi), %rdi
	callq	atoi
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	callq	atoi
	movl	%eax, %r15d
	movq	24(%r14), %rdi
	callq	atoi
	movl	%eax, -44(%rbp)                 # 4-byte Spill
	movq	32(%r14), %rdi
	callq	atoi
                                        # kill: def $eax killed $eax def $rax
	movq	%rsp, -136(%rbp)                # 8-byte Spill
	movq	%rax, %rcx
	movq	%rax, -104(%rbp)                # 8-byte Spill
	shlq	$32, %rax
	movq	%rax, -80(%rbp)                 # 8-byte Spill
	movq	%rsp, %r12
	addq	$-32, %r12
	movq	%r12, %rsp
	movq	%rsp, %rax
	addq	$-32, %rax
	movq	%rax, -72(%rbp)                 # 8-byte Spill
	movq	%rax, %rsp
	leal	-3(%rbx), %ecx
	movl	%ecx, %eax
	cltd
	idivl	%r15d
	incl	%eax
	imull	%r15d, %eax
	subl	%ecx, %eax
	cltd
	idivl	%r15d
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	movl	%eax, %r14d
	sarl	%r14d
	andl	$-2, %eax
	leal	(%rax,%rbx), %ecx
	movq	%rcx, -144(%rbp)                # 8-byte Spill
                                        # kill: def $ecx killed $ecx killed $rcx
	imull	%ecx, %ecx
	shll	$2, %ecx
	addl	%ebx, %eax
	addl	$-3, %eax
	cltd
	movl	%r15d, -48(%rbp)                # 4-byte Spill
	idivl	%r15d
                                        # kill: def $eax killed $eax def $rax
	leal	4(,%rax,4), %edx
	movl	%edx, -56(%rbp)                 # 4-byte Spill
                                        # kill: def $eax killed $eax killed $rax def $rax
	incl	%eax
	movq	%rax, -64(%rbp)                 # 8-byte Spill
	movslq	%ecx, %r15
	xorl	%r13d, %r13d
.LBB2_3:                                # =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, (%r12,%r13,8)
	movq	$0, (%rax)
	movq	%rax, %rdi
	movl	%ebx, %esi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	callq	_Z10FillMatrixPfiii
	incq	%r13
	cmpq	$3, %r13
	jne	.LBB2_3
# %bb.4:                                # %.preheader202.preheader
	movq	%rbx, -128(%rbp)                # 8-byte Spill
	movl	-44(%rbp), %eax                 # 4-byte Reload
	orq	%rax, -80(%rbp)                 # 8-byte Folded Spill
	xorl	%r14d, %r14d
.LBB2_5:                                # %.preheader202
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_6 Depth 2
	movl	$36, %edi
	callq	malloc
	movq	-72(%rbp), %rcx                 # 8-byte Reload
	movq	%rax, (%rcx,%r14,8)
	xorl	%ecx, %ecx
.LBB2_6:                                #   Parent Loop BB2_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	leaq	1(%rcx), %rdx
	xorps	%xmm0, %xmm0
	cvtsi2ss	%edx, %xmm0
	movss	%xmm0, (%rax,%rcx,4)
	movq	%rdx, %rcx
	cmpq	$9, %rdx
	jne	.LBB2_6
# %bb.7:                                #   in Loop: Header=BB2_5 Depth=1
	incq	%r14
	cmpq	$3, %r14
	jne	.LBB2_5
# %bb.8:
	movl	-56(%rbp), %eax                 # 4-byte Reload
	imull	-64(%rbp), %eax                 # 4-byte Folded Reload
	movslq	%eax, %rdi
	movq	%rdi, -96(%rbp)                 # 8-byte Spill
	callq	malloc
	movq	%rax, -56(%rbp)                 # 8-byte Spill
	xorl	%r14d, %r14d
	leaq	-160(%rbp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	%rsp, %r13
	addq	$-32, %r13
	movq	%r13, %rsp
	movq	%rsp, %rbx
	addq	$-32, %rbx
	movq	%rbx, %rsp
.LBB2_9:                                # =>This Inner Loop Header: Depth=1
	leaq	(%r14,%r13), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	movq	(%r13,%r14), %rdi
	movq	(%r12,%r14), %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	addq	$8, %r14
	cmpq	$24, %r14
	jne	.LBB2_9
# %bb.10:                               # %.preheader201.preheader
	xorl	%r14d, %r14d
	movq	-72(%rbp), %r15                 # 8-byte Reload
.LBB2_11:                               # %.preheader201
                                        # =>This Inner Loop Header: Depth=1
	leaq	(%rbx,%r14), %rdi
	movl	$36, %esi
	callq	hipMalloc
	movq	(%rbx,%r14), %rdi
	movq	(%r15,%r14), %rsi
	movl	$36, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	addq	$8, %r14
	cmpq	$24, %r14
	jne	.LBB2_11
# %bb.12:
	leaq	-88(%rbp), %rdi
	movq	-96(%rbp), %r14                 # 8-byte Reload
	movq	%r14, %rsi
	callq	hipMalloc
	leal	(%r14,%r14,8), %eax
	leal	(%rax,%rax,2), %eax
	movslq	%eax, %rsi
	leaq	-120(%rbp), %rdi
	callq	hipMalloc
	movq	-64(%rbp), %rsi                 # 8-byte Reload
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	-44(%rbp)                       # 4-byte Folded Reload
	movl	%eax, %ecx
	xorl	%r15d, %r15d
	cmpl	$1, %edx
	sbbl	$-1, %ecx
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	-104(%rbp)                      # 4-byte Folded Reload
	movl	%eax, %r14d
	cmpl	$1, %edx
	sbbl	$-1, %r14d
	shlq	$32, %r14
	orq	%rcx, %r14
.LBB2_13:                               # =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	$1, %esi
	movq	-80(%rbp), %rdx                 # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_15
# %bb.14:                               #   in Loop: Header=BB2_13 Depth=1
	movq	(%r13,%r15,8), %rdi
	movq	-120(%rbp), %rcx
	movl	%r15d, %esi
	movl	$3, %edx
	movl	-48(%rbp), %r8d                 # 4-byte Reload
	movl	%r8d, %r9d
	movq	-64(%rbp), %rax                 # 8-byte Reload
	pushq	%rax
	pushq	%rax
	movl	$3, %eax
	pushq	%rax
	pushq	%rax
	movq	-144(%rbp), %rax                # 8-byte Reload
	pushq	%rax
	pushq	%rax
	callq	_Z21__device_stub__im2colPfiiS_iiiiiiii
	addq	$48, %rsp
.LBB2_15:                               #   in Loop: Header=BB2_13 Depth=1
	incq	%r15
	cmpq	$3, %r15
	jne	.LBB2_13
# %bb.16:
	leaq	-112(%rbp), %rdi
	movl	$108, %esi
	callq	hipMalloc
	xorl	%r14d, %r14d
	movq	-72(%rbp), %r15                 # 8-byte Reload
.LBB2_17:                               # =>This Inner Loop Header: Depth=1
	movq	-112(%rbp), %rdi
	addq	%r14, %rdi
	movq	(%r15), %rsi
	movl	$36, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	addq	$36, %r14
	addq	$8, %r15
	cmpq	$108, %r14
	jne	.LBB2_17
# %bb.18:
	movq	-64(%rbp), %r14                 # 8-byte Reload
	imull	%r14d, %r14d
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	-44(%rbp)                       # 4-byte Folded Reload
	movl	%eax, %edi
	cmpl	$1, %edx
	sbbl	$-1, %edi
	movl	$9, %eax
	xorl	%edx, %edx
	divl	-104(%rbp)                      # 4-byte Folded Reload
                                        # kill: def $eax killed $eax def $rax
	cmpl	$1, %edx
	sbbl	$-1, %eax
	shlq	$32, %rax
	orq	%rax, %rdi
	movl	$1, %esi
	movq	-80(%rbp), %rdx                 # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_20
# %bb.19:
	movq	-120(%rbp), %rdi
	movq	-112(%rbp), %rsi
	movq	-88(%rbp), %rdx
	movl	%r14d, %ecx
	movl	$27, %r8d
	movl	$1, %r9d
	callq	_Z28__device_stub__MatrixMulCUDAPfS_S_iii
.LBB2_20:
	xorl	%r15d, %r15d
	leaq	-176(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	$.L.str.1, %edi
	movq	-128(%rbp), %rsi                # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	movl	-48(%rbp), %edx                 # 4-byte Reload
	xorl	%eax, %eax
	callq	printf
	movabsq	$2361183241434822607, %rax      # imm = 0x20C49BA5E353F7CF
	imulq	8(%r14)
	movq	%rdx, %rcx
	movabsq	$-2361183241434822607, %rax     # imm = 0xDF3B645A1CAC0831
	imulq	-152(%rbp)
	movq	(%r14), %rax
	movq	%rcx, %rsi
	shrq	$63, %rsi
	sarq	$7, %rcx
	addq	%rcx, %rsi
	movq	%rdx, %rcx
	shrq	$63, %rcx
	sarq	$7, %rdx
	addq	%rdx, %rcx
	addq	%rsi, %rcx
	subq	-160(%rbp), %rax
	imulq	$1000, %rax, %rsi               # imm = 0x3E8
	addq	%rcx, %rsi
	movl	$.L.str.2, %edi
	xorl	%eax, %eax
	callq	printf
	movq	-88(%rbp), %rsi
	movq	-56(%rbp), %rdi                 # 8-byte Reload
	movq	-96(%rbp), %rdx                 # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
.LBB2_21:                               # =>This Inner Loop Header: Depth=1
	movq	(%r13,%r15,8), %rdi
	callq	hipFree
	incq	%r15
	cmpq	$3, %r15
	jne	.LBB2_21
# %bb.22:                               # %.preheader200.preheader
	xorl	%r14d, %r14d
.LBB2_23:                               # %.preheader200
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbx,%r14,8), %rdi
	callq	hipFree
	incq	%r14
	cmpq	$3, %r14
	jne	.LBB2_23
# %bb.24:
	movq	-88(%rbp), %rdi
	callq	hipFree
	xorl	%ebx, %ebx
	movq	-72(%rbp), %r14                 # 8-byte Reload
.LBB2_25:                               # =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rdi
	callq	free
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB2_25
# %bb.26:                               # %.preheader.preheader
	xorl	%ebx, %ebx
.LBB2_27:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	(%r14,%rbx,8), %rdi
	callq	free
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB2_27
# %bb.28:
	movq	-56(%rbp), %rdi                 # 8-byte Reload
	callq	free
	xorl	%eax, %eax
	movq	-136(%rbp), %rsp                # 8-byte Reload
	jmp	.LBB2_29
.LBB2_1:
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$1, %eax
.LBB2_29:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
                                        # -- End function
	.globl	_Z10FillMatrixPfiii             # -- Begin function _Z10FillMatrixPfiii
	.type	_Z10FillMatrixPfiii,@function
_Z10FillMatrixPfiii:                    # @_Z10FillMatrixPfiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
                                        # kill: def $ecx killed $ecx def $rcx
                                        # kill: def $edx killed $edx def $rdx
	movq	%rdx, (%rsp)                    # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB3_4
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdi, %rbp
	addl	%ecx, %esi
	movq	(%rsp), %rdx                    # 8-byte Reload
	leal	(%rcx,%rdx), %eax
	leal	(%rdx,%rcx,2), %edx
	movslq	%ecx, %r15
	movslq	%eax, %r12
	movslq	%edx, %rcx
	movslq	%esi, %rax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	leaq	4(,%rcx,4), %rax
	shlq	$2, %rcx
	movq	%rcx, 16(%rsp)                  # 8-byte Spill
	imulq	%r15, %rax
	addq	%rax, %rbp
	movq	%r15, %r13
.LBB3_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_5 Depth 2
	movq	%rbp, %r14
	movq	%r13, %rbx
	cmpl	$0, (%rsp)                      # 4-byte Folded Reload
	jle	.LBB3_3
.LBB3_5:                                #   Parent Loop BB3_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	cltq
	imulq	$954437177, %rax, %rcx          # imm = 0x38E38E39
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$33, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,8), %ecx
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%r14)
	incq	%rbx
	addq	$4, %r14
	cmpq	%r12, %rbx
	jl	.LBB3_5
.LBB3_3:                                # %._crit_edge
                                        #   in Loop: Header=BB3_2 Depth=1
	incq	%r15
	addq	16(%rsp), %rbp                  # 8-byte Folded Reload
	cmpq	8(%rsp), %r15                   # 8-byte Folded Reload
	jl	.LBB3_2
.LBB3_4:                                # %._crit_edge17
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z10FillMatrixPfiii, .Lfunc_end3-_Z10FillMatrixPfiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z11PrintMatrixPfii             # -- Begin function _Z11PrintMatrixPfii
	.type	_Z11PrintMatrixPfii,@function
_Z11PrintMatrixPfii:                    # @_Z11PrintMatrixPfii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB4_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%edx, %r12d
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
.LBB4_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB4_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB4_2 Depth=1
	movl	%r13d, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r15d, %r15d
.LBB4_4:                                #   Parent Loop BB4_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%r15,4), %xmm0
	movl	$.L.str.3, %edi
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB4_4
.LBB4_5:                                # %._crit_edge
                                        #   in Loop: Header=BB4_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%rbp
	addl	%ebx, %r13d
	cmpq	16(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB4_2
.LBB4_6:                                # %._crit_edge13
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z11PrintMatrixPfii, .Lfunc_end4-_Z11PrintMatrixPfii
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z6im2colPfiiS_iiiiiiii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z13MatrixMulCUDAPfS_S_iii, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.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	_Z6im2colPfiiS_iiiiiiii,@object # @_Z6im2colPfiiS_iiiiiiii
	.section	.rodata,"a",@progbits
	.globl	_Z6im2colPfiiS_iiiiiiii
	.p2align	3, 0x0
_Z6im2colPfiiS_iiiiiiii:
	.quad	_Z21__device_stub__im2colPfiiS_iiiiiiii
	.size	_Z6im2colPfiiS_iiiiiiii, 8

	.type	_Z13MatrixMulCUDAPfS_S_iii,@object # @_Z13MatrixMulCUDAPfS_S_iii
	.globl	_Z13MatrixMulCUDAPfS_S_iii
	.p2align	3, 0x0
_Z13MatrixMulCUDAPfS_S_iii:
	.quad	_Z28__device_stub__MatrixMulCUDAPfS_S_iii
	.size	_Z13MatrixMulCUDAPfS_S_iii, 8

	.type	.L.str.1,@object                # @.str.1
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.1:
	.asciz	"Matrix Size:%d\tStride:%d\n"
	.size	.L.str.1, 26

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Calculation time:%ldms\n"
	.size	.L.str.2, 24

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"%f "
	.size	.L.str.3, 4

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z6im2colPfiiS_iiiiiiii"
	.size	.L__unnamed_1, 24

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z13MatrixMulCUDAPfS_S_iii"
	.size	.L__unnamed_2, 27

	.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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Wrong Input!"
	.size	.Lstr, 13

	.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 _Z21__device_stub__im2colPfiiS_iiiiiiii
	.addrsig_sym _Z28__device_stub__MatrixMulCUDAPfS_S_iii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z6im2colPfiiS_iiiiiiii
	.addrsig_sym _Z13MatrixMulCUDAPfS_S_iii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z6im2colPfiiS_iiiiiiii ; -- Begin function _Z6im2colPfiiS_iiiiiiii
	.globl	_Z6im2colPfiiS_iiiiiiii
	.p2align	8
	.type	_Z6im2colPfiiS_iiiiiiii,@function
_Z6im2colPfiiS_iiiiiiii:                ; @_Z6im2colPfiiS_iiiiiiii
; %bb.0:
	s_clause 0x2
	s_load_b32 s2, s[0:1], 0x44
	s_load_b128 s[8:11], s[0:1], 0x24
	s_load_b32 s13, s[0:1], 0x34
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v4, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[2:3], null, s14, s2, v[1:2]
	v_mad_u64_u32 v[0:1], null, s15, s3, v[4:5]
	v_cmp_gt_i32_e32 vcc_lo, s11, v2
	s_mov_b32 s11, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e64 s2, s13, v0
	s_and_b32 s2, vcc_lo, s2
	s_cmp_gt_i32 s9, 0
	s_cselect_b32 s3, -1, 0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, s3
	s_and_saveexec_b32 s12, s2
	s_cbranch_execz .LBB0_5
; %bb.1:                                ; %.preheader.lr.ph
	s_load_b256 s[0:7], s[0:1], 0x0
	v_mad_u64_u32 v[3:4], null, v2, s13, v[0:1]
	s_cmp_gt_i32 s10, 0
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v4, v0, s7
	s_delay_alu instid0(VALU_DEP_2)
	v_mad_u64_u32 v[5:6], null, v3, s3, s[2:3]
	s_mul_i32 s2, s10, s9
	s_mul_i32 s3, s8, s6
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[0:1], null, s3, v2, v[4:5]
	v_mul_lo_u32 v5, s2, v5
	s_cselect_b32 s2, -1, 0
.LBB0_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mov_b32_e32 v1, v5
	v_mov_b32_e32 v3, v0
	s_and_not1_b32 vcc_lo, exec_lo, s2
	s_mov_b32 s3, s10
	s_cbranch_vccnz .LBB0_4
.LBB0_3:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_ashrrev_i32_e32 v2, 31, v1
	s_add_i32 s3, s3, -1
	s_cmp_eq_u32 s3, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[6:7], 2, v[3:4]
	v_add_nc_u32_e32 v3, 1, v3
	v_add_co_u32 v6, vcc_lo, s0, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, s1, v7, vcc_lo
	global_load_b32 v4, v[6:7], off
	v_lshlrev_b64 v[6:7], 2, v[1:2]
	v_add_nc_u32_e32 v1, 1, v1
	v_add_co_u32 v6, vcc_lo, s4, v6
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v7, vcc_lo
	s_waitcnt vmcnt(0)
	global_store_b32 v[6:7], v4, off
	s_cbranch_scc0 .LBB0_3
.LBB0_4:                                ; %._crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v0, s8, v0
	v_add_nc_u32_e32 v5, s10, v5
	s_add_i32 s11, s11, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s11, s9
	s_cbranch_scc0 .LBB0_2
.LBB0_5:                                ; %Flow89
	s_or_b32 exec_lo, exec_lo, s12
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z6im2colPfiiS_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 8
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z6im2colPfiiS_iiiiiiii, .Lfunc_end0-_Z6im2colPfiiS_iiiiiiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 380
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; 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
	.protected	_Z13MatrixMulCUDAPfS_S_iii ; -- Begin function _Z13MatrixMulCUDAPfS_S_iii
	.globl	_Z13MatrixMulCUDAPfS_S_iii
	.p2align	8
	.type	_Z13MatrixMulCUDAPfS_S_iii,@function
_Z13MatrixMulCUDAPfS_S_iii:             ; @_Z13MatrixMulCUDAPfS_S_iii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b128 s[4:7], s[0:1], 0x18
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v3, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_mad_u64_u32 v[1:2], null, s15, s3, v[3:4]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, s4, v0
	v_cmp_gt_i32_e64 s2, s6, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB1_6
; %bb.1:                                ; %.preheader
	s_clause 0x1
	s_load_b128 s[8:11], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	s_cmp_lt_i32 s5, 1
	s_cbranch_scc1 .LBB1_4
; %bb.2:                                ; %.lr.ph
	v_mul_lo_u32 v2, v0, s5
	v_mov_b32_e32 v6, 0
	v_mov_b32_e32 v4, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s8, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v3, vcc_lo
.LBB1_3:                                ; =>This Inner Loop Header: Depth=1
	v_ashrrev_i32_e32 v5, 31, v4
	s_add_i32 s5, s5, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_cmp_eq_u32 s5, 0
	v_lshlrev_b64 v[7:8], 2, v[4:5]
	v_add_nc_u32_e32 v4, s6, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v7, vcc_lo, s10, v7
	v_add_co_ci_u32_e32 v8, vcc_lo, s11, v8, vcc_lo
	global_load_b32 v5, v[2:3], off
	global_load_b32 v7, v[7:8], off
	v_add_co_u32 v2, vcc_lo, v2, 4
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v6, v5, v7
	s_cbranch_scc0 .LBB1_3
	s_branch .LBB1_5
.LBB1_4:
	v_mov_b32_e32 v6, 0
.LBB1_5:                                ; %Flow54
	v_mad_u64_u32 v[2:3], null, v0, s6, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[0:1], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v6, off
.LBB1_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13MatrixMulCUDAPfS_S_iii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z13MatrixMulCUDAPfS_S_iii, .Lfunc_end1-_Z13MatrixMulCUDAPfS_S_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 340
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .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:           _Z6im2colPfiiS_iiiiiiii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z6im2colPfiiS_iiiiiiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z13MatrixMulCUDAPfS_S_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z13MatrixMulCUDAPfS_S_iii.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
