#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include"device_launch_parameters.h"
#include"cuda_runtime.h"
#include"cuda_runtime_api.h"
using namespace std;

int n, m, p, q;
const int szB = 3550, szL = 150;

double *matrix, *kernel, *result;

inline int read() {
    char c = getchar();
    int x = 0, f = 1;
    while (isdigit(c))
        x = (x << 3) + (x << 1) + (c^48), c = getchar();
    return x * f;
}

inline void read(double &r)
{
    double x=0,t=0;int s=0,f=1;char c=getchar();//x代表整数部分,t代表小数部分
    for (;!isdigit(c);c=getchar())
    {
        if (c=='-') f=-1;//读到负号就改变之
        if (c=='.') goto readt;//看到小数点,直接读小数部分
        if (c == ',') return ;
    }
    for (;isdigit(c)&&c!='.';c=getchar()) x=x*10+c-'0';//整数部分
    readt:for (;c=='.';c=getchar());//跳过小数点
    for (;isdigit(c);c=getchar()) t=t*10+c-'0',++s;//读小数部分,s代表小数有几位
    r=(x+t/pow(10,s))*f;//t除以10的s次方后变成小数部分
}

void input() {
    freopen("input.txt", "r", stdin);
    n = read();m=read();read();p = read();q = read();read();
//    cout << n << ' ' << m << ' ' << p << ' ' << q << endl;
    for (int i = 0; i < n; i++){
        for (int j = 0; j < m; j++) {
            read(matrix[i * szB + j]);
//            printf("%.3f ", matrix[i*szB+j]);
        }
//        printf("\n");
//            scanf("%lf,", &matrix[i*szB+j]);
//        scanf("%lf\n", &matrix[i*szB+m-1]);
    }
    for (int i = 0; i < p; i++){
        for (int j = 0; j < q; j++)
            read(kernel[i*szL+j]);
//            scanf("%lf,", &kernel[i*szL+j]);
//        scanf("%lf\n", &kernel[i*szL+q-1]);
    }
//    printf("input done\n");
}


void output() {
    FILE* fp = fopen("output.txt", "w");
    for (int i = 0; i < n; i++){
        for (int j = 0; j < m-1; j++)
            fprintf(fp, "%.3f,", result[(i+(p-1)/2)*szB+j+(q-1)/2]);
        fprintf(fp, "%.3f\n", result[(i+(p-1)/2)*szB+m-1+(q-1)/2]);
    }
    fclose(fp);
}

int getThreadNum()
{
    cudaDeviceProp prop;
    int count;
    cudaGetDeviceCount(&count);
    cudaGetDeviceProperties(&prop, 0);
    return prop.maxThreadsPerBlock;
}

__global__ void conv(double *matrix, double *kernel, double *result, int n, int m, int p, int q){
    int ti = threadIdx.x;
    int bi = blockIdx.x;
    int id = (bi * blockDim.x + ti);
    if(id < (n+p-1) * (m+q-1)){
        int i = id / (m+q-1);
        int j = id % (m+q-1);
        double tmp = 0.0;
        for(int k = max(0, i-p+1); k <= i; k++)
            for(int l = max(0, j-q+1); l <= j; l++)
                tmp += matrix[k*szB+l] * kernel[(i-k)*szL + j-l];
        result[i*szB+j] = tmp;
    }
}


int main()
{
    double *matrixGpu;
    double *kernelGpu;
    double *resultGpu;

    matrix = (double*)malloc(sizeof(double)*szB*szB);
    result = (double*)malloc(sizeof(double)*szB*szB);
    kernel = (double*)malloc(sizeof(double)*szL*szL);

    cudaMalloc((void**)&matrixGpu, szB*szB*sizeof(double));
    cudaMalloc((void**)&kernelGpu, szL*szL*sizeof(double));
    cudaMalloc((void**)&resultGpu, szB*szB*sizeof(double));

    input();
    cudaMemcpy(matrixGpu, matrix, 3550 *3550 * sizeof(double), cudaMemcpyHostToDevice);
    cudaMemcpy(kernelGpu, kernel, 150*150*sizeof(double), cudaMemcpyHostToDevice);

    int threadNum = getThreadNum();
    int blockNum = ((n+p-1) * (m+q-1) - 0.5) / threadNum + 1;
    
    conv<<<blockNum, threadNum>>>(matrixGpu, kernelGpu, resultGpu, n, m, p, q);
    cudaMemcpy(result, resultGpu, 3550*3550 * sizeof(double), cudaMemcpyDeviceToHost);

    output();
    cudaFree(matrixGpu);
    cudaFree(kernelGpu);
    cudaFree(resultGpu);
    
    return 0;
}

	.file	"tmpxft_00334899_00000000-6_v1ga.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2035:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2035:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.text._Z4readv,"axG",@progbits,_Z4readv,comdat
	.weak	_Z4readv
	.type	_Z4readv, @function
_Z4readv:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	xorl	%ebx, %ebx
	call	getchar@PLT
.L3:
	movsbl	%al, %edx
	subl	$48, %edx
	cmpl	$9, %edx
	ja	.L7
	imull	$10, %ebx, %ebx
	xorl	$48, %eax
	movsbl	%al, %eax
	addl	%eax, %ebx
	call	getchar@PLT
	jmp	.L3
.L7:
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z4readv, .-_Z4readv
	.section	.text._Z4readRd,"axG",@progbits,_Z4readRd,comdat
	.weak	_Z4readRd
	.type	_Z4readRd, @function
_Z4readRd:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	call	getchar@PLT
.L9:
	movsbl	%al, %edx
	subl	$48, %edx
	cmpl	$9, %edx
	jbe	.L26
	cmpb	$45, %al
	je	.L19
	cmpb	$46, %al
	je	.L20
	cmpb	$44, %al
	jne	.L10
	jmp	.L8
.L19:
	orl	$-1, %ebp
.L10:
	call	getchar@PLT
	jmp	.L9
.L26:
	movq	$0x000000000, (%rsp)
.L14:
	movsd	.LC1(%rip), %xmm0
	mulsd	(%rsp), %xmm0
	movsbl	%al, %eax
	cvtsi2sdl	%eax, %xmm1
	addsd	%xmm1, %xmm0
	subsd	.LC2(%rip), %xmm0
	movsd	%xmm0, (%rsp)
	call	getchar@PLT
	movl	%eax, %edx
	subl	$48, %edx
	cmpb	$9, %dl
	jbe	.L14
	jmp	.L15
.L20:
	movq	$0x000000000, (%rsp)
.L11:
.L15:
	cmpb	$46, %al
	jne	.L27
	call	getchar@PLT
	jmp	.L15
.L27:
	xorl	%r12d, %r12d
	xorps	%xmm2, %xmm2
.L17:
	movsbl	%al, %eax
	leal	-48(%rax), %edx
	cmpl	$9, %edx
	ja	.L28
	mulsd	.LC1(%rip), %xmm2
	cvtsi2sdl	%eax, %xmm0
	incl	%r12d
	addsd	%xmm0, %xmm2
	subsd	.LC2(%rip), %xmm2
	movsd	%xmm2, 8(%rsp)
	call	getchar@PLT
	movsd	8(%rsp), %xmm2
	jmp	.L17
.L28:
	cvtsi2sdl	%r12d, %xmm1
	movsd	.LC1(%rip), %xmm0
	movsd	%xmm2, 8(%rsp)
	call	pow@PLT
	movsd	8(%rsp), %xmm2
	divsd	%xmm0, %xmm2
	cvtsi2sdl	%ebp, %xmm0
	addsd	(%rsp), %xmm2
	mulsd	%xmm0, %xmm2
	movsd	%xmm2, (%rbx)
.L8:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z4readRd, .-_Z4readRd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"r"
.LC4:
	.string	"input.txt"
	.text
	.globl	_Z5inputv
	.type	_Z5inputv, @function
_Z5inputv:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC3(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	pushq	%rdx
	.cfi_def_cfa_offset 48
	movq	stdin(%rip), %rdx
	call	freopen@PLT
	call	_Z4readv
	movl	%eax, n(%rip)
	call	_Z4readv
	movl	%eax, m(%rip)
	call	_Z4readv
	call	_Z4readv
	movl	%eax, p(%rip)
	call	_Z4readv
	movl	%eax, q(%rip)
	call	_Z4readv
.L30:
	cmpl	%r13d, n(%rip)
	jle	.L37
	movslq	%r12d, %rbx
	xorl	%ebp, %ebp
	salq	$3, %rbx
.L33:
	cmpl	%ebp, m(%rip)
	jle	.L39
	movq	matrix(%rip), %rdi
	incl	%ebp
	addq	%rbx, %rdi
	addq	$8, %rbx
	call	_Z4readRd
	jmp	.L33
.L39:
	incl	%r13d
	addl	$3550, %r12d
	jmp	.L30
.L37:
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
.L32:
	cmpl	%r13d, p(%rip)
	jle	.L29
	movslq	%r12d, %rbx
	xorl	%ebp, %ebp
	salq	$3, %rbx
.L36:
	cmpl	%ebp, q(%rip)
	jle	.L40
	movq	kernel(%rip), %rdi
	incl	%ebp
	addq	%rbx, %rdi
	addq	$8, %rbx
	call	_Z4readRd
	jmp	.L36
.L40:
	incl	%r13d
	addl	$150, %r12d
	jmp	.L32
.L29:
	popq	%rax
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z5inputv, .-_Z5inputv
	.section	.rodata.str1.1
.LC5:
	.string	"w"
.LC6:
	.string	"output.txt"
.LC7:
	.string	"%.3f,"
.LC8:
	.string	"%.3f\n"
	.text
	.globl	_Z6outputv
	.type	_Z6outputv, @function
_Z6outputv:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC5(%rip), %rsi
	leaq	.LC6(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC7(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	pushq	%rdx
	.cfi_def_cfa_offset 48
	call	fopen@PLT
	movq	%rax, %rbx
.L42:
	cmpl	%r12d, n(%rip)
	jle	.L47
	xorl	%r13d, %r13d
.L44:
	movl	p(%rip), %eax
	movl	$2, %edi
	movl	m(%rip), %r8d
	movq	result(%rip), %rsi
	decl	%eax
	cltd
	idivl	%edi
	addl	%r12d, %eax
	imull	$3550, %eax, %ecx
	movl	q(%rip), %eax
	decl	%eax
	cltd
	idivl	%edi
	leal	-1(%r8), %edx
	cmpl	%r13d, %edx
	jle	.L48
	addl	%r13d, %ecx
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	incl	%r13d
	addl	%eax, %ecx
	movb	$1, %al
	movslq	%ecx, %rcx
	movsd	(%rsi,%rcx,8), %xmm0
	movl	$2, %esi
	call	__fprintf_chk@PLT
	jmp	.L44
.L48:
	leal	-1(%r8,%rcx), %edx
	movq	%rbx, %rdi
	incl	%r12d
	addl	%eax, %edx
	movb	$1, %al
	movslq	%edx, %rdx
	movsd	(%rsi,%rdx,8), %xmm0
	leaq	.LC8(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	jmp	.L42
.L47:
	popq	%rax
	.cfi_def_cfa_offset 40
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	fclose@PLT
	.cfi_endproc
.LFE2030:
	.size	_Z6outputv, .-_Z6outputv
	.globl	_Z12getThreadNumv
	.type	_Z12getThreadNumv, @function
_Z12getThreadNumv:
.LFB2031:
	.cfi_startproc
	endbr64
	subq	$1064, %rsp
	.cfi_def_cfa_offset 1072
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdi
	call	cudaGetDeviceCount@PLT
	leaq	16(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaGetDeviceProperties_v2@PLT
	movl	336(%rsp), %eax
	movq	1048(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	addq	$1064, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z12getThreadNumv, .-_Z12getThreadNumv
	.globl	_Z31__device_stub__Z4convPdS_S_iiiiPdS_S_iiii
	.type	_Z31__device_stub__Z4convPdS_S_iiiiPdS_S_iiii, @function
_Z31__device_stub__Z4convPdS_S_iiiiPdS_S_iiii:
.LFB2057:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	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, 168(%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	192(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L52
	pushq	56(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z4convPdS_S_iiii(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 208
	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 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L52:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2057:
	.size	_Z31__device_stub__Z4convPdS_S_iiiiPdS_S_iiii, .-_Z31__device_stub__Z4convPdS_S_iiiiPdS_S_iiii
	.globl	_Z4convPdS_S_iiii
	.type	_Z4convPdS_S_iiii, @function
_Z4convPdS_S_iiii:
.LFB2058:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z4convPdS_S_iiiiPdS_S_iiii
	.cfi_endproc
.LFE2058:
	.size	_Z4convPdS_S_iiii, .-_Z4convPdS_S_iiii
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2032:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	movl	$100820000, %edi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	movl	$100820000, %edi
	movq	%rax, matrix(%rip)
	call	malloc@PLT
	movl	$180000, %edi
	movq	%rax, result(%rip)
	call	malloc@PLT
	leaq	8(%rsp), %rdi
	movl	$100820000, %esi
	movq	%rax, kernel(%rip)
	call	cudaMalloc@PLT
	leaq	16(%rsp), %rdi
	movl	$180000, %esi
	call	cudaMalloc@PLT
	leaq	24(%rsp), %rdi
	movl	$100820000, %esi
	call	cudaMalloc@PLT
	call	_Z5inputv
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	movq	matrix(%rip), %rsi
	movl	$100820000, %edx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	movq	kernel(%rip), %rsi
	movl	$180000, %edx
	call	cudaMemcpy@PLT
	call	_Z12getThreadNumv
	movl	p(%rip), %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	addl	n(%rip), %edx
	movl	q(%rip), %ecx
	cvtsi2sdl	%eax, %xmm1
	movl	%eax, 44(%rsp)
	addl	m(%rip), %ecx
	decl	%edx
	movabsq	$4294967297, %rax
	decl	%ecx
	movq	%rax, 48(%rsp)
	imull	%ecx, %edx
	movq	%rax, 36(%rsp)
	movl	52(%rsp), %ecx
	movl	40(%rsp), %esi
	cvtsi2sdl	%edx, %xmm0
	subsd	.LC9(%rip), %xmm0
	divsd	%xmm1, %xmm0
	addsd	.LC10(%rip), %xmm0
	cvttsd2sil	%xmm0, %edx
	movl	%edx, 32(%rsp)
	movq	44(%rsp), %rdx
	movq	32(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L58
	movl	n(%rip), %ecx
	movl	p(%rip), %r9d
	pushq	%rax
	.cfi_def_cfa_offset 88
	movl	q(%rip), %eax
	movl	m(%rip), %r8d
	pushq	%rax
	.cfi_def_cfa_offset 96
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdi
	call	_Z31__device_stub__Z4convPdS_S_iiiiPdS_S_iiii
	popq	%rdx
	.cfi_def_cfa_offset 88
	popq	%rcx
	.cfi_def_cfa_offset 80
.L58:
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movl	$100820000, %edx
	movq	result(%rip), %rdi
	call	cudaMemcpy@PLT
	call	_Z6outputv
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L59
	call	__stack_chk_fail@PLT
.L59:
	xorl	%eax, %eax
	addq	$72, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2032:
	.size	main, .-main
	.section	.rodata.str1.1
.LC11:
	.string	"_Z4convPdS_S_iiii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2060:
	.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	.LC11(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z4convPdS_S_iiii(%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
.LFE2060:
	.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
	.globl	result
	.bss
	.align 8
	.type	result, @object
	.size	result, 8
result:
	.zero	8
	.globl	kernel
	.align 8
	.type	kernel, @object
	.size	kernel, 8
kernel:
	.zero	8
	.globl	matrix
	.align 8
	.type	matrix, @object
	.size	matrix, 8
matrix:
	.zero	8
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.align 8
.LC2:
	.long	0
	.long	1078460416
	.align 8
.LC9:
	.long	0
	.long	1071644672
	.align 8
.LC10:
	.long	0
	.long	1072693248
	.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 <stdio.h>
#include <stdlib.h>
#include <ctype.h>

#include"hip/hip_runtime.h"
#include"hip/hip_runtime_api.h"
using namespace std;

int n, m, p, q;
const int szB = 3550, szL = 150;

double *matrix, *kernel, *result;

inline int read() {
    char c = getchar();
    int x = 0, f = 1;
    while (isdigit(c))
        x = (x << 3) + (x << 1) + (c^48), c = getchar();
    return x * f;
}

inline void read(double &r)
{
    double x=0,t=0;int s=0,f=1;char c=getchar();//x代表整数部分,t代表小数部分
    for (;!isdigit(c);c=getchar())
    {
        if (c=='-') f=-1;//读到负号就改变之
        if (c=='.') goto readt;//看到小数点,直接读小数部分
        if (c == ',') return ;
    }
    for (;isdigit(c)&&c!='.';c=getchar()) x=x*10+c-'0';//整数部分
    readt:for (;c=='.';c=getchar());//跳过小数点
    for (;isdigit(c);c=getchar()) t=t*10+c-'0',++s;//读小数部分,s代表小数有几位
    r=(x+t/pow(10,s))*f;//t除以10的s次方后变成小数部分
}

void input() {
    freopen("input.txt", "r", stdin);
    n = read();m=read();read();p = read();q = read();read();
//    cout << n << ' ' << m << ' ' << p << ' ' << q << endl;
    for (int i = 0; i < n; i++){
        for (int j = 0; j < m; j++) {
            read(matrix[i * szB + j]);
//            printf("%.3f ", matrix[i*szB+j]);
        }
//        printf("\n");
//            scanf("%lf,", &matrix[i*szB+j]);
//        scanf("%lf\n", &matrix[i*szB+m-1]);
    }
    for (int i = 0; i < p; i++){
        for (int j = 0; j < q; j++)
            read(kernel[i*szL+j]);
//            scanf("%lf,", &kernel[i*szL+j]);
//        scanf("%lf\n", &kernel[i*szL+q-1]);
    }
//    printf("input done\n");
}


void output() {
    FILE* fp = fopen("output.txt", "w");
    for (int i = 0; i < n; i++){
        for (int j = 0; j < m-1; j++)
            fprintf(fp, "%.3f,", result[(i+(p-1)/2)*szB+j+(q-1)/2]);
        fprintf(fp, "%.3f\n", result[(i+(p-1)/2)*szB+m-1+(q-1)/2]);
    }
    fclose(fp);
}

int getThreadNum()
{
    hipDeviceProp_t prop;
    int count;
    hipGetDeviceCount(&count);
    hipGetDeviceProperties(&prop, 0);
    return prop.maxThreadsPerBlock;
}

__global__ void conv(double *matrix, double *kernel, double *result, int n, int m, int p, int q){
    int ti = threadIdx.x;
    int bi = blockIdx.x;
    int id = (bi * blockDim.x + ti);
    if(id < (n+p-1) * (m+q-1)){
        int i = id / (m+q-1);
        int j = id % (m+q-1);
        double tmp = 0.0;
        for(int k = max(0, i-p+1); k <= i; k++)
            for(int l = max(0, j-q+1); l <= j; l++)
                tmp += matrix[k*szB+l] * kernel[(i-k)*szL + j-l];
        result[i*szB+j] = tmp;
    }
}


int main()
{
    double *matrixGpu;
    double *kernelGpu;
    double *resultGpu;

    matrix = (double*)malloc(sizeof(double)*szB*szB);
    result = (double*)malloc(sizeof(double)*szB*szB);
    kernel = (double*)malloc(sizeof(double)*szL*szL);

    hipMalloc((void**)&matrixGpu, szB*szB*sizeof(double));
    hipMalloc((void**)&kernelGpu, szL*szL*sizeof(double));
    hipMalloc((void**)&resultGpu, szB*szB*sizeof(double));

    input();
    hipMemcpy(matrixGpu, matrix, 3550 *3550 * sizeof(double), hipMemcpyHostToDevice);
    hipMemcpy(kernelGpu, kernel, 150*150*sizeof(double), hipMemcpyHostToDevice);

    int threadNum = getThreadNum();
    int blockNum = ((n+p-1) * (m+q-1) - 0.5) / threadNum + 1;
    
    conv<<<blockNum, threadNum>>>(matrixGpu, kernelGpu, resultGpu, n, m, p, q);
    hipMemcpy(result, resultGpu, 3550*3550 * sizeof(double), hipMemcpyDeviceToHost);

    output();
    hipFree(matrixGpu);
    hipFree(kernelGpu);
    hipFree(resultGpu);
    
    return 0;
}

	.text
	.file	"v1ga.hip"
	.globl	_Z5inputv                       # -- Begin function _Z5inputv
	.type	_Z5inputv,@function
_Z5inputv:                              # @_Z5inputv
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	stdin(%rip), %rdx
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	callq	freopen
	callq	getchar
                                        # kill: def $eax killed $eax def $rax
	movsbl	%al, %ecx
	addl	$-48, %ecx
	xorl	%ebx, %ebx
	movl	$0, %r14d
	cmpl	$9, %ecx
	ja	.LBB0_3
# %bb.1:                                # %.lr.ph.i.preheader
	xorl	%r14d, %r14d
.LBB0_2:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	leal	(%r14,%r14,4), %ecx
	andl	$15, %eax
	leal	(%rax,%rcx,2), %r14d
	callq	getchar
                                        # kill: def $eax killed $eax def $rax
	movsbl	%al, %ecx
	addl	$-48, %ecx
	cmpl	$10, %ecx
	jb	.LBB0_2
.LBB0_3:                                # %_Z4readv.exit
	movl	%r14d, n(%rip)
	callq	getchar
                                        # kill: def $eax killed $eax def $rax
	movsbl	%al, %ecx
	addl	$-48, %ecx
	cmpl	$9, %ecx
	ja	.LBB0_6
# %bb.4:                                # %.lr.ph.i19.preheader
	xorl	%ebx, %ebx
.LBB0_5:                                # %.lr.ph.i19
                                        # =>This Inner Loop Header: Depth=1
	leal	(%rbx,%rbx,4), %ecx
	andl	$15, %eax
	leal	(%rax,%rcx,2), %ebx
	callq	getchar
                                        # kill: def $eax killed $eax def $rax
	movsbl	%al, %ecx
	addl	$-48, %ecx
	cmpl	$10, %ecx
	jb	.LBB0_5
.LBB0_6:                                # %_Z4readv.exit25
	movl	%ebx, m(%rip)
	callq	getchar
	movsbl	%al, %eax
	addl	$-48, %eax
	cmpl	$9, %eax
	ja	.LBB0_8
.LBB0_7:                                # %.lr.ph.i30
                                        # =>This Inner Loop Header: Depth=1
	callq	getchar
	movsbl	%al, %eax
	addl	$-48, %eax
	cmpl	$10, %eax
	jb	.LBB0_7
.LBB0_8:                                # %_Z4readv.exit36
	callq	getchar
                                        # kill: def $eax killed $eax def $rax
	movsbl	%al, %ecx
	addl	$-48, %ecx
	xorl	%ebx, %ebx
	movl	$0, %r14d
	cmpl	$9, %ecx
	ja	.LBB0_11
# %bb.9:                                # %.lr.ph.i41.preheader
	xorl	%r14d, %r14d
.LBB0_10:                               # %.lr.ph.i41
                                        # =>This Inner Loop Header: Depth=1
	leal	(%r14,%r14,4), %ecx
	andl	$15, %eax
	leal	(%rax,%rcx,2), %r14d
	callq	getchar
                                        # kill: def $eax killed $eax def $rax
	movsbl	%al, %ecx
	addl	$-48, %ecx
	cmpl	$10, %ecx
	jb	.LBB0_10
.LBB0_11:                               # %_Z4readv.exit47
	movl	%r14d, p(%rip)
	callq	getchar
                                        # kill: def $eax killed $eax def $rax
	movsbl	%al, %ecx
	addl	$-48, %ecx
	cmpl	$9, %ecx
	ja	.LBB0_14
# %bb.12:                               # %.lr.ph.i52.preheader
	xorl	%ebx, %ebx
.LBB0_13:                               # %.lr.ph.i52
                                        # =>This Inner Loop Header: Depth=1
	leal	(%rbx,%rbx,4), %ecx
	andl	$15, %eax
	leal	(%rax,%rcx,2), %ebx
	callq	getchar
                                        # kill: def $eax killed $eax def $rax
	movsbl	%al, %ecx
	addl	$-48, %ecx
	cmpl	$10, %ecx
	jb	.LBB0_13
.LBB0_14:                               # %_Z4readv.exit58
	movl	%ebx, q(%rip)
	callq	getchar
	movsbl	%al, %eax
	addl	$-48, %eax
	cmpl	$9, %eax
	ja	.LBB0_16
.LBB0_15:                               # %.lr.ph.i63
                                        # =>This Inner Loop Header: Depth=1
	callq	getchar
	movsbl	%al, %eax
	addl	$-48, %eax
	cmpl	$10, %eax
	jb	.LBB0_15
.LBB0_16:                               # %_Z4readv.exit69
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	jle	.LBB0_23
# %bb.17:                               # %.preheader71.preheader
	xorl	%ebx, %ebx
	movl	m(%rip), %eax
	xorl	%r14d, %r14d
.LBB0_18:                               # %.preheader71
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_20 Depth 2
	testl	%eax, %eax
	jle	.LBB0_22
# %bb.19:                               # %.lr.ph
                                        #   in Loop: Header=BB0_18 Depth=1
	movl	%ebx, %r15d
	andl	$2147483647, %r15d              # imm = 0x7FFFFFFF
	shlq	$4, %r15
	xorl	%r12d, %r12d
.LBB0_20:                               #   Parent Loop BB0_18 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	matrix(%rip), %rdi
	addq	%r15, %rdi
	callq	_Z4readRd
	incq	%r12
	movslq	m(%rip), %rax
	addq	$8, %r15
	cmpq	%rax, %r12
	jl	.LBB0_20
# %bb.21:                               # %._crit_edge.loopexit
                                        #   in Loop: Header=BB0_18 Depth=1
	movl	n(%rip), %ecx
.LBB0_22:                               # %._crit_edge
                                        #   in Loop: Header=BB0_18 Depth=1
	incq	%r14
	movslq	%ecx, %rdx
	addl	$1775, %ebx                     # imm = 0x6EF
	cmpq	%rdx, %r14
	jl	.LBB0_18
.LBB0_23:                               # %.preheader70
	movl	p(%rip), %ecx
	testl	%ecx, %ecx
	jle	.LBB0_30
# %bb.24:                               # %.preheader.preheader
	xorl	%ebx, %ebx
	movl	q(%rip), %eax
	xorl	%r14d, %r14d
.LBB0_25:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_27 Depth 2
	testl	%eax, %eax
	jle	.LBB0_29
# %bb.26:                               # %.lr.ph78
                                        #   in Loop: Header=BB0_25 Depth=1
	movl	%ebx, %r15d
	andl	$2147483647, %r15d              # imm = 0x7FFFFFFF
	shlq	$4, %r15
	xorl	%r12d, %r12d
.LBB0_27:                               #   Parent Loop BB0_25 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	kernel(%rip), %rdi
	addq	%r15, %rdi
	callq	_Z4readRd
	incq	%r12
	movslq	q(%rip), %rax
	addq	$8, %r15
	cmpq	%rax, %r12
	jl	.LBB0_27
# %bb.28:                               # %._crit_edge79.loopexit
                                        #   in Loop: Header=BB0_25 Depth=1
	movl	p(%rip), %ecx
.LBB0_29:                               # %._crit_edge79
                                        #   in Loop: Header=BB0_25 Depth=1
	incq	%r14
	movslq	%ecx, %rdx
	addl	$75, %ebx
	cmpq	%rdx, %r14
	jl	.LBB0_25
.LBB0_30:                               # %._crit_edge81
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z5inputv, .Lfunc_end0-_Z5inputv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z4readRd
.LCPI1_0:
	.quad	0x4024000000000000              # double 10
.LCPI1_1:
	.quad	0xc048000000000000              # double -48
	.section	.text._Z4readRd,"axG",@progbits,_Z4readRd,comdat
	.weak	_Z4readRd
	.type	_Z4readRd,@function
_Z4readRd:                              # @_Z4readRd
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	movq	%rdi, %rbx
	callq	getchar
	movsbl	%al, %ecx
	addl	$-58, %ecx
	movl	$1, %ebp
	cmpl	$-11, %ecx
	ja	.LBB1_5
# %bb.1:                                # %.lr.ph.preheader
	movl	%eax, %ecx
	shll	$24, %ecx
	movl	$-1, %r14d
.LBB1_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	cmpl	$754974720, %ecx                # imm = 0x2D000000
	cmovel	%r14d, %ebp
	cmpl	$738197504, %ecx                # imm = 0x2C000000
	je	.LBB1_14
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB1_2 Depth=1
	cmpl	$771751936, %ecx                # imm = 0x2E000000
	je	.LBB1_7
# %bb.4:                                #   in Loop: Header=BB1_2 Depth=1
	callq	getchar
	movl	%eax, %ecx
	shll	$24, %ecx
	movsbl	%al, %edx
	addl	$-58, %edx
	cmpl	$-10, %edx
	jb	.LBB1_2
.LBB1_5:                                # %.preheader29
	xorpd	%xmm1, %xmm1
.LBB1_6:                                # %.lr.ph49
                                        # =>This Inner Loop Header: Depth=1
	mulsd	.LCPI1_0(%rip), %xmm1
	movsbl	%al, %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	addsd	%xmm0, %xmm1
	addsd	.LCPI1_1(%rip), %xmm1
	movsd	%xmm1, 8(%rsp)                  # 8-byte Spill
	callq	getchar
	movsd	8(%rsp), %xmm1                  # 8-byte Reload
                                        # xmm1 = mem[0],zero
	movsbl	%al, %ecx
	addl	$-48, %ecx
	cmpl	$10, %ecx
	jb	.LBB1_6
	jmp	.LBB1_8
.LBB1_7:                                # %.loopexit30
	xorpd	%xmm0, %xmm0
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	jmp	.LBB1_8
.LBB1_15:                               # %.lr.ph52
                                        #   in Loop: Header=BB1_8 Depth=1
	callq	getchar
.LBB1_8:                                # %.loopexit
                                        # =>This Inner Loop Header: Depth=1
	cmpb	$46, %al
	je	.LBB1_15
# %bb.9:                                # %.preheader
	movsbl	%al, %ecx
	addl	$-48, %ecx
	xorpd	%xmm2, %xmm2
	xorpd	%xmm1, %xmm1
	cmpl	$9, %ecx
	ja	.LBB1_13
# %bb.10:                               # %.lr.ph59.preheader
	xorl	%r14d, %r14d
.LBB1_11:                               # %.lr.ph59
                                        # =>This Inner Loop Header: Depth=1
	movsbl	%al, %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	mulsd	.LCPI1_0(%rip), %xmm2
	addsd	%xmm0, %xmm2
	addsd	.LCPI1_1(%rip), %xmm2
	movsd	%xmm2, (%rsp)                   # 8-byte Spill
	incl	%r14d
	callq	getchar
	movsd	(%rsp), %xmm2                   # 8-byte Reload
                                        # xmm2 = mem[0],zero
	movsbl	%al, %ecx
	addl	$-48, %ecx
	cmpl	$10, %ecx
	jb	.LBB1_11
# %bb.12:                               # %._crit_edge.loopexit
	xorps	%xmm1, %xmm1
	cvtsi2sd	%r14d, %xmm1
.LBB1_13:                               # %._crit_edge
	movsd	%xmm2, (%rsp)                   # 8-byte Spill
	movsd	.LCPI1_0(%rip), %xmm0           # xmm0 = mem[0],zero
	callq	pow
	movsd	(%rsp), %xmm2                   # 8-byte Reload
                                        # xmm2 = mem[0],zero
	divsd	%xmm0, %xmm2
	movsd	8(%rsp), %xmm1                  # 8-byte Reload
                                        # xmm1 = mem[0],zero
	addsd	%xmm2, %xmm1
	xorps	%xmm0, %xmm0
	cvtsi2sd	%ebp, %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx)
.LBB1_14:                               # %.loopexit31
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z4readRd, .Lfunc_end1-_Z4readRd
	.cfi_endproc
                                        # -- End function
	.text
	.globl	_Z6outputv                      # -- Begin function _Z6outputv
	.type	_Z6outputv,@function
_Z6outputv:                             # @_Z6outputv
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	movl	$.L.str.2, %edi
	movl	$.L.str.3, %esi
	callq	fopen
	movq	%rax, %rbx
	cmpl	$0, n(%rip)
	jle	.LBB2_7
# %bb.1:                                # %.preheader.preheader
	xorl	%ebp, %ebp
.LBB2_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_4 Depth 2
	movl	m(%rip), %eax
	cmpl	$2, %eax
	jl	.LBB2_5
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB2_2 Depth=1
	xorl	%r14d, %r14d
.LBB2_4:                                # %.lr.ph
                                        #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	result(%rip), %rax
	movl	p(%rip), %ecx
	movl	%ecx, %edx
	decl	%edx
	shrl	$31, %edx
	addl	%edx, %ecx
	decl	%ecx
	sarl	%ecx
	movl	q(%rip), %edx
	movl	%edx, %esi
	decl	%esi
	shrl	$31, %esi
	addl	%esi, %edx
	decl	%edx
	sarl	%edx
	addl	%ebp, %ecx
	imull	$3550, %ecx, %ecx               # imm = 0xDDE
	addl	%r14d, %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movsd	(%rax,%rcx,8), %xmm0            # xmm0 = mem[0],zero
	movl	$.L.str.4, %esi
	movq	%rbx, %rdi
	movb	$1, %al
	callq	fprintf
	incl	%r14d
	movl	m(%rip), %eax
	decl	%eax
	cmpl	%eax, %r14d
	jl	.LBB2_4
	jmp	.LBB2_6
.LBB2_5:                                # %.preheader.._crit_edge_crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	decl	%eax
.LBB2_6:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	movq	result(%rip), %rcx
	movl	p(%rip), %edx
	movl	%edx, %esi
	decl	%esi
	shrl	$31, %esi
	addl	%esi, %edx
	decl	%edx
	sarl	%edx
	addl	%ebp, %edx
	imull	$3550, %edx, %edx               # imm = 0xDDE
	movl	q(%rip), %esi
	movl	%esi, %edi
	decl	%edi
	shrl	$31, %edi
	addl	%edi, %esi
	decl	%esi
	sarl	%esi
	addl	%eax, %esi
	addl	%edx, %esi
	movslq	%esi, %rax
	movsd	(%rcx,%rax,8), %xmm0            # xmm0 = mem[0],zero
	movl	$.L.str.5, %esi
	movq	%rbx, %rdi
	movb	$1, %al
	callq	fprintf
	incl	%ebp
	cmpl	n(%rip), %ebp
	jl	.LBB2_2
.LBB2_7:                                # %._crit_edge12
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	fclose                          # TAILCALL
.Lfunc_end2:
	.size	_Z6outputv, .Lfunc_end2-_Z6outputv
	.cfi_endproc
                                        # -- End function
	.globl	_Z12getThreadNumv               # -- Begin function _Z12getThreadNumv
	.type	_Z12getThreadNumv,@function
_Z12getThreadNumv:                      # @_Z12getThreadNumv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$1488, %rsp                     # imm = 0x5D0
	.cfi_def_cfa_offset 1504
	.cfi_offset %rbx, -16
	leaq	12(%rsp), %rdi
	callq	hipGetDeviceCount
	leaq	16(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	hipGetDevicePropertiesR0600
	movl	320(%rbx), %eax
	addq	$1488, %rsp                     # imm = 0x5D0
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z12getThreadNumv, .Lfunc_end3-_Z12getThreadNumv
	.cfi_endproc
                                        # -- End function
	.globl	_Z19__device_stub__convPdS_S_iiii # -- Begin function _Z19__device_stub__convPdS_S_iiii
	.type	_Z19__device_stub__convPdS_S_iiii,@function
_Z19__device_stub__convPdS_S_iiii:      # @_Z19__device_stub__convPdS_S_iiii
	.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	$160, %rsp
	.cfi_def_cfa_offset 208
	.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	208(%rsp), %rax
	movq	%rax, 48(%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	$_Z4convPdS_S_iiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z19__device_stub__convPdS_S_iiii, .Lfunc_end4-_Z19__device_stub__convPdS_S_iiii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI5_0:
	.quad	0xbfe0000000000000              # double -0.5
.LCPI5_1:
	.quad	0x3ff0000000000000              # double 1
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$1512, %rsp                     # imm = 0x5E8
	.cfi_def_cfa_offset 1536
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	$100820000, %edi                # imm = 0x6026420
	callq	malloc
	movq	%rax, matrix(%rip)
	movl	$100820000, %edi                # imm = 0x6026420
	callq	malloc
	movq	%rax, result(%rip)
	movl	$180000, %edi                   # imm = 0x2BF20
	callq	malloc
	movq	%rax, kernel(%rip)
	leaq	24(%rsp), %rbx
	movl	$100820000, %esi                # imm = 0x6026420
	movq	%rbx, %rdi
	callq	hipMalloc
	leaq	16(%rsp), %r14
	movl	$180000, %esi                   # imm = 0x2BF20
	movq	%r14, %rdi
	callq	hipMalloc
	leaq	8(%rsp), %rdi
	movl	$100820000, %esi                # imm = 0x6026420
	callq	hipMalloc
	callq	_Z5inputv
	movq	(%rbx), %rdi
	movq	matrix(%rip), %rsi
	movl	$100820000, %edx                # imm = 0x6026420
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r14), %rdi
	movq	kernel(%rip), %rsi
	movl	$180000, %edx                   # imm = 0x2BF20
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	36(%rsp), %rdi
	callq	hipGetDeviceCount
	leaq	40(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	hipGetDevicePropertiesR0600
	movl	320(%rbx), %edx
	movl	n(%rip), %eax
	movl	p(%rip), %ecx
	addl	%ecx, %eax
	decl	%eax
	movl	m(%rip), %ecx
	movl	q(%rip), %esi
	addl	%esi, %ecx
	decl	%ecx
	imull	%eax, %ecx
	cvtsi2sd	%ecx, %xmm0
	addsd	.LCPI5_0(%rip), %xmm0
	cvtsi2sd	%edx, %xmm1
	divsd	%xmm1, %xmm0
	addsd	.LCPI5_1(%rip), %xmm0
	cvttsd2si	%xmm0, %edi
	btsq	$32, %rdi
	btsq	$32, %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_2
# %bb.1:
	movq	24(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdx
	movl	n(%rip), %ecx
	movl	m(%rip), %r8d
	movl	p(%rip), %r9d
	movl	q(%rip), %eax
	movl	%eax, (%rsp)
	callq	_Z19__device_stub__convPdS_S_iiii
.LBB5_2:
	movq	result(%rip), %rdi
	movq	8(%rsp), %rsi
	movl	$100820000, %edx                # imm = 0x6026420
	movl	$2, %ecx
	callq	hipMemcpy
	callq	_Z6outputv
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$1512, %rsp                     # imm = 0x5E8
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	main, .Lfunc_end5-main
	.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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z4convPdS_S_iiii, %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_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__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	.LBB7_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
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	n,@object                       # @n
	.bss
	.globl	n
	.p2align	2, 0x0
n:
	.long	0                               # 0x0
	.size	n, 4

	.type	m,@object                       # @m
	.globl	m
	.p2align	2, 0x0
m:
	.long	0                               # 0x0
	.size	m, 4

	.type	p,@object                       # @p
	.globl	p
	.p2align	2, 0x0
p:
	.long	0                               # 0x0
	.size	p, 4

	.type	q,@object                       # @q
	.globl	q
	.p2align	2, 0x0
q:
	.long	0                               # 0x0
	.size	q, 4

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

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

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"input.txt"
	.size	.L.str, 10

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

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

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

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%.3f\n"
	.size	.L.str.5, 6

	.type	_Z4convPdS_S_iiii,@object       # @_Z4convPdS_S_iiii
	.section	.rodata,"a",@progbits
	.globl	_Z4convPdS_S_iiii
	.p2align	3, 0x0
_Z4convPdS_S_iiii:
	.quad	_Z19__device_stub__convPdS_S_iiii
	.size	_Z4convPdS_S_iiii, 8

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

	.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 _Z19__device_stub__convPdS_S_iiii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z4convPdS_S_iiii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z4convPdS_S_iiii       ; -- Begin function _Z4convPdS_S_iiii
	.globl	_Z4convPdS_S_iiii
	.p2align	8
	.type	_Z4convPdS_S_iiii,@function
_Z4convPdS_S_iiii:                      ; @_Z4convPdS_S_iiii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b128 s[8:11], s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[3:4], null, s15, s2, v[0:1]
	s_add_i32 s2, s8, s10
	s_add_i32 s8, s9, s11
	s_add_i32 s2, s2, -1
	s_add_i32 s8, s8, -1
	s_mul_i32 s2, s8, s2
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_cmp_gt_i32_e32 vcc_lo, s2, v3
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB0_10
; %bb.1:
	s_ashr_i32 s2, s8, 31
	v_ashrrev_i32_e32 v2, 31, v3
	s_add_i32 s3, s8, s2
	s_mov_b32 s9, 0
	s_xor_b32 s3, s3, s2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v4, v3, v2
	v_cvt_f32_u32_e32 v0, s3
	s_sub_i32 s4, 0, s3
	v_xor_b32_e32 v4, v4, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_iflag_f32_e32 v0, v0
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v0, 0x4f7ffffe, v0
	v_cvt_u32_f32_e32 v0, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v1, s4, v0
	v_mul_hi_u32 v1, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v0, v1
	v_mul_hi_u32 v0, v4, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v1, v0, s3
	v_sub_nc_u32_e32 v1, v4, v1
	v_add_nc_u32_e32 v4, 1, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v5, s3, v1
	v_cmp_le_u32_e32 vcc_lo, s3, v1
	v_dual_cndmask_b32 v1, v1, v5 :: v_dual_cndmask_b32 v0, v0, v4
	v_xor_b32_e32 v4, s2, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_le_u32_e32 vcc_lo, s3, v1
	v_add_nc_u32_e32 v5, 1, v0
	v_mov_b32_e32 v1, 0
	v_mov_b32_e32 v2, 0
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[2:3], s[0:1], 0x10
	v_cndmask_b32_e32 v0, v0, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v6, v0, v4
	v_sub_nc_u32_e32 v8, v6, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v5, v8, s8
	v_subrev_nc_u32_e32 v0, s10, v8
	s_mov_b32 s8, exec_lo
	v_max_i32_e32 v9, -1, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v0, v3, v5
	v_cmpx_lt_i32_e64 v9, v8
	s_cbranch_execz .LBB0_9
; %bb.2:                                ; %.lr.ph52
	v_mad_u64_u32 v[1:2], null, 0x96, v6, v[3:4]
	s_delay_alu instid0(VALU_DEP_3)
	v_subrev_nc_u32_e32 v2, s11, v0
	v_add_nc_u32_e32 v4, v4, v9
	s_movk_i32 s1, 0xdde
	s_waitcnt lgkmcnt(0)
	s_add_u32 s4, s4, 8
	s_addc_u32 s5, s5, 0
	v_max_i32_e32 v10, -1, v2
	v_sub_nc_u32_e32 v1, v1, v5
	v_ashrrev_i32_e32 v3, 31, v2
	v_mul_lo_u32 v4, 0x96, v4
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cmp_lt_i32_e32 vcc_lo, v10, v0
	v_sub_nc_u32_e32 v1, v1, v10
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_lt_i64_e64 s0, -1, v[2:3]
	v_sub_nc_u32_e32 v5, v1, v4
	s_delay_alu instid0(VALU_DEP_2)
	v_cndmask_b32_e64 v11, -1, v3, s0
	v_mad_u64_u32 v[3:4], null, v9, s1, 0xdde
	v_cndmask_b32_e64 v12, -1, v2, s0
	v_mov_b32_e32 v1, 0
	v_dual_mov_b32 v2, 0 :: v_dual_add_nc_u32 v13, 0xffffff69, v5
.LBB0_3:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	s_and_saveexec_b32 s10, vcc_lo
	s_cbranch_execz .LBB0_7
; %bb.4:                                ; %.lr.ph
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_ashrrev_i32_e32 v5, 31, v3
	v_add_co_u32 v4, s0, v12, v3
	v_mov_b32_e32 v14, v10
	s_mov_b32 s11, 0
	v_add_co_ci_u32_e64 v5, s0, v11, v5, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[6:7], 3, v[4:5]
	v_mov_b32_e32 v4, v13
	v_add_co_u32 v6, s0, s4, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v7, s0, s5, v7, s0
.LBB0_5:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v5, 31, v4
	v_add_nc_u32_e32 v14, 1, v14
	v_lshlrev_b64 v[15:16], 3, v[4:5]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_ge_i32_e64 s1, v14, v0
	v_add_nc_u32_e32 v4, -1, v4
	s_or_b32 s11, s1, s11
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v15, s0, s6, v15
	v_add_co_ci_u32_e64 v16, s0, s7, v16, s0
	global_load_b64 v[17:18], v[6:7], off
	global_load_b64 v[15:16], v[15:16], off
	v_add_co_u32 v6, s0, v6, 8
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v7, s0, 0, v7, s0
	s_waitcnt vmcnt(0)
	v_fma_f64 v[1:2], v[17:18], v[15:16], v[1:2]
	s_and_not1_b32 exec_lo, exec_lo, s11
	s_cbranch_execnz .LBB0_5
; %bb.6:                                ; %Flow
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s11
.LBB0_7:                                ; %Flow82
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	s_or_b32 exec_lo, exec_lo, s10
	v_add_nc_u32_e32 v9, 1, v9
	v_add_nc_u32_e32 v3, 0xdde, v3
	v_add_nc_u32_e32 v13, 0xffffff6a, v13
	v_cmp_ge_i32_e64 s0, v9, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s9, s0, s9
	s_and_not1_b32 exec_lo, exec_lo, s9
	s_cbranch_execnz .LBB0_3
; %bb.8:                                ; %Flow83
	s_or_b32 exec_lo, exec_lo, s9
.LBB0_9:                                ; %Flow84
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_or_b32 exec_lo, exec_lo, s8
	v_mad_u64_u32 v[3:4], null, 0xdde, v8, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[3:4], 3, v[3:4]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v3, vcc_lo, s2, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s3, v4, vcc_lo
	global_store_b64 v[3:4], v[1:2], off
.LBB0_10:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z4convPdS_S_iiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 19
		.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	_Z4convPdS_S_iiii, .Lfunc_end0-_Z4convPdS_S_iiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 792
; NumSgprs: 18
; NumVgprs: 19
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 19
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .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:           _Z4convPdS_S_iiii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z4convPdS_S_iiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     19
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
