#include <cuda.h>
#include <stdio.h>
#include <math.h>
#include <sys/time.h>

#define gray_t double
#define PI 3.1415926535897
#define mymax(x, y) ((x) < (y) ? (y) : (x))
#define mymin(x, y) ((x) > (y) ? (y) : (x))
#define myabs(x) ((x) < 0? (-(x)) : (x))
// 检查以cuda开头的api调用是否出错或已经出错
#define checkCudaErrors(call)												\
{																			\
	const cudaError_t error = call;											\
	if (error != cudaSuccess) {												\
		printf("Error: %s:%d, ", __FILE__, __LINE__);						\
		printf("code:%d, reason: %s \n", error, cudaGetErrorString(error));	\
		exit(1);															\
	}																		\
}

// from CUDA7.pdf
// 计算 每个block内部的前缀和 并记录block sum（block内前缀和数组的最后一个值）的前缀和
__global__ void scan(gray_t* out, gray_t* block_sums, gray_t* data) {
    extern __shared__ gray_t s_data[];
    int tid = blockIdx.x * blockDim.x + threadIdx.x;
    s_data[threadIdx.x] = data[tid];

    for (int stride = 1; stride < blockDim.x; stride <<= 1) {
        __syncthreads();
        gray_t val = (threadIdx.x >= stride) ? s_data[threadIdx.x - stride] : 0;
        __syncthreads();
        s_data[threadIdx.x] += val;
    }

    out[tid] = s_data[threadIdx.x];
    if (threadIdx.x == 0) {
        for (int i = blockIdx.x + 1; i < gridDim.x; ++i) {
            atomicAdd(&block_sums[i], s_data[blockDim.x - 1]);
        } 
    }
}

// 将blocksum前缀和添加到block内部前缀和的每一项
__global__ void scan_update(gray_t* out, gray_t* block_sums) {
    __shared__ gray_t block_sum;
    int idx = blockIdx.x * blockDim.x + threadIdx.x;

    if (threadIdx.x == 0) {
        block_sum  = block_sums[blockIdx.x];
    }

    __syncthreads();

    out[idx] += block_sum;
}

int diveup(int total, int threadnum){
    return (total % threadnum ? (total / threadnum + 1) : (total / threadnum));
}

void test_scan() {
    double sigma = 150;
    int filter_size = int(sigma * 3 * 2 + 1) | 1;
    int mid = filter_size >> 1;
    gray_t* filter = new gray_t[mid + 1]; 
    gray_t* pre_filter = new gray_t[mid + 1]; // pre_filter[i]表示sum(filter[0], ..., filter[i])
    gray_t* cpu_pre_filter = new gray_t[mid + 1]; 
    double total = 0;

    for (int i = 0; i < mid + 1; ++i) {
        filter[i] = 1 / (sqrt(2 * PI) * sigma) * exp((- (i - mid) * (i - mid)) / (2 * sigma * sigma));
        total += 2 * filter[i];
    }

    total -= filter[mid];
    for (int i = 0; i < mid + 1; ++i) {
        filter[i] /= total;
    }

    gray_t* device_filter;
    checkCudaErrors(cudaMalloc((void **) &device_filter, sizeof(gray_t) * (mid + 1)));
    checkCudaErrors(cudaMemcpy(device_filter, filter, sizeof(gray_t) * (mid + 1), cudaMemcpyHostToDevice));
    // copy  filter to pre_filter
    int block_num = diveup(mid + 1, 32);
    gray_t* device_pre_filter;
    gray_t* block_sums;
    checkCudaErrors(cudaMalloc((void **) &block_sums, sizeof(gray_t) * (block_num)));
    checkCudaErrors(cudaMalloc((void **) &device_pre_filter, sizeof(gray_t) * (mid + 1)));

    scan<<<block_num, 32, sizeof(gray_t)*32>>>(device_pre_filter, block_sums, device_filter);
    checkCudaErrors(cudaDeviceSynchronize());
    scan_update<<<block_num, 32>>>(device_pre_filter, block_sums);
    checkCudaErrors(cudaDeviceSynchronize());

    checkCudaErrors(cudaMemcpy(pre_filter, device_pre_filter, sizeof(gray_t) * (mid + 1), cudaMemcpyDeviceToHost));
    checkCudaErrors(cudaFree(device_filter));
    checkCudaErrors(cudaFree(block_sums));
    checkCudaErrors(cudaFree(device_pre_filter));
    
    cpu_pre_filter[0] = filter[0];
    for (int i = 1; i < mid + 1; ++i) {
        cpu_pre_filter[i] = filter[i] + cpu_pre_filter[i - 1];
    }

    for (int i = 0; i < mid + 1; ++i) {
        printf("%lf ", cpu_pre_filter[i] - pre_filter[i]);
    }
}

__global__ void cal_filter(gray_t* filter, gray_t* total, int mid, double sigma) {
    extern __shared__ gray_t sdata[];
    // 计算filter
    int fi = blockIdx.x * blockDim.x + threadIdx.x;  // not unsigned int
    int tidx = threadIdx.x;
    if (fi <= mid) {
        filter[fi] = 1 / (sqrt(2 * PI) * sigma) * exp((- (fi - mid) * (fi - mid)) / (2 * sigma * sigma));
    }
    if (tidx == 0) {
        total[0] = 0.0;
    }
    __syncthreads(); // 确保当前线程块所需的filter计算完毕
    
    // 将filter加载到共享内存
    sdata[tidx] = fi <= mid ? filter[fi] : 0;
    __syncthreads();
    
    // 规约：把当前线程块的filter之和存放到共享内存sdata[0]
    for (unsigned int s = blockDim.x / 2; s > 0; s >>= 1) {
        if (tidx < s) {
            sdata[tidx] += sdata[tidx + s];
        }
        __syncthreads();
    }
    
    // 把所有线程块结果用原子加法累加到全局遍历total[0]上
    if (tidx == 0) {
        atomicAdd(total, 2.0 * sdata[0]);
    }
    if (fi == mid) {
        atomicAdd(total, - filter[mid]);
    }
}

__global__ void div_filter(gray_t* filter, gray_t* total, int mid, int loop) {
    // 计算filter
    int fi = blockIdx.x * blockDim.x + threadIdx.x;
    int sta = fi * loop;
    int end = mymin(sta + loop, mid + 1);
    for (int i = sta; i < end; ++i) {
        filter[i] /= total[0];
    }
}

void test_reduce() {
    double sigma = 150;
    int filter_size = int(sigma * 3 * 2 + 1) | 1;
    int mid = filter_size >> 1;
    gray_t* filter = new gray_t[mid + 1]; 
    gray_t* cpu_filter = new gray_t[mid + 1]; 
    double total = 0;


    for (int i = 0; i < mid + 1; ++i) {
        cpu_filter[i] = 1 / (sqrt(2 * PI) * sigma) * exp((- (i - mid) * (i - mid)) / (2 * sigma * sigma));
        total += cpu_filter[i];
    }

    total = 2 * total - cpu_filter[mid];
    for (int i = 0; i < mid + 1; ++i) {
        cpu_filter[i] /= total;
    }
    printf("[%lf]", total);
    gray_t* device_total;
    gray_t* device_filter;
    checkCudaErrors(cudaMalloc((void **) &device_total, sizeof(gray_t)));
    checkCudaErrors(cudaMalloc((void **) &device_filter, sizeof(gray_t) * (mid + 1)));
    cal_filter<<<diveup((mid + 1), 32), 32, sizeof(gray_t)*32>>>(device_filter, device_total, mid, sigma);
    checkCudaErrors(cudaDeviceSynchronize());
    div_filter<<<diveup((mid + 1), 32 * 8), 32>>>(device_filter, device_total, mid, 8);
    checkCudaErrors(cudaDeviceSynchronize());
    checkCudaErrors(cudaMemcpy(filter, device_filter, sizeof(gray_t) * (mid + 1), cudaMemcpyDeviceToHost));
    checkCudaErrors(cudaMemcpy(&total, device_total, sizeof(gray_t), cudaMemcpyDeviceToHost));
    checkCudaErrors(cudaFree(device_filter));
    checkCudaErrors(cudaFree(device_total));
    for (int i = 0; i < mid + 1; ++i) {
        printf("%lf ", filter[i] - cpu_filter[i]);
    }
}

__global__ void conv1(gray_t* img_src, gray_t* pre_filter, gray_t* filter, gray_t* temp_res, int n, int m, int mid){  
    int i = threadIdx.x+blockDim.x*blockIdx.x;
    int j = threadIdx.y+blockDim.y*blockIdx.y;
    if (i < n && j < m) {
        int pos = j + i * m;
        gray_t temp = 0;
        int i_sta = i - mid;
        int i_end = i + mid;
        // 当前行的卷积范围：[i-mid, i+mid]
        if (i - mid < 0) {
            // 合并计算[i-mid, 0)部分，即原filter的前mid-i个参数与mid-i个填充值（列首元素）的点乘
            temp += pre_filter[mid - i - 1] * img_src[j];
            i_sta = 0;
        }
        if (i + mid >= n) {
            // 合并计算(n-1, i+mid] 部分，即原filter的后xx=i+mid+1-n个参数（由于对称性 等价于前xx个）与xx个填充值（行尾元素）的点乘
            temp += pre_filter[i + mid - n] * img_src[(n - 1) * m + j];
            i_end = n - 1;
        }
        for (int xi = i_sta; xi <= i_end; ++xi) {
            // 第xi个元素离卷积中心i的距离为xi-i 使用的是距离卷积核中心mid距离为xi-i的卷积参数
            temp += filter[mid - myabs(i - xi)] * img_src[xi * m + j];
        }
        temp_res[pos] = temp;
    }
    
}

__global__ void conv2(gray_t* temp_res, gray_t* pre_filter, gray_t* filter, gray_t* img_dst, int n, int m, int mid){  
    int i = threadIdx.x+blockDim.x*blockIdx.x;
    int j = threadIdx.y+blockDim.y*blockIdx.y;
    if (i < n && j < m) {
        int pos = i * m + j;
        gray_t temp = 0;
        int j_sta = j - mid;
        int j_end = j + mid;
        // gray_t tmp = 0;
        // 当前行的卷积范围：[j-mid, j+mid]
        if (j - mid < 0) {
            // 合并计算[j-mid, 0)部分，即原filter的前mid-j个参数与mid-j个填充值（行首元素）的点乘
            temp += pre_filter[mid - j - 1] * temp_res[i * m];
            j_sta = 0;
        }
        if (j + mid >= m) {
            // 合并计算(m-1, j+mid] 部分，即原filter的后xx=j+mid+1-m个参数（由于对称性 等价于前xx个）与xx个填充值（行尾元素）的点乘
            temp += pre_filter[j + mid - m] * temp_res[i * m];
            j_end = m - 1;
        }
        for (int yj = j_sta; yj <= j_end; ++yj) {
            // 第yj个元素离卷积中心j的距离为yj-j 使用的是距离卷积核中心mid距离为yj-j的卷积参数
            temp += filter[mid - myabs(j - yj)] * temp_res[i * m + yj];
        }
        img_dst[pos] = temp;
    }
}

void guassian_smooth(const gray_t* img_src, gray_t** img_dst_ptr, int n, int m, double sigma) {
    gray_t* img_dst = new gray_t[n * m];
    *img_dst_ptr = img_dst;
    // 卷积核：用两次一维卷积分离实现二维卷积 复杂度从 O(m*n*filter_size*filter_size) 降为 O(m*n*filter_size)
    // 1. 根据sigma确定卷积核大小 原理参考https://www.cnblogs.com/shine-lee/p/9671253.html “|1”是为了取邻近的奇数
    int filter_size = int(sigma * 3 * 2 + 1) | 1;
    // 2. 根据高斯分布确定卷积核参数
    int mid = filter_size >> 1;
    gray_t* filter = new gray_t[mid + 1]; // 因为高斯卷积核的对称性 所以只存储前一半加一个参数
    gray_t* pre_filter = new gray_t[mid + 1]; // pre_filter[i]表示sum(filter[0], ..., filter[i])
    double total = 0;
    for (int i = 0; i < mid + 1; ++i) {
        filter[i] = 1 / (sqrt(2 * PI) * sigma) * exp((- (i - mid) * (i - mid)) / (2 * sigma * sigma));
        total += 2 * filter[i];
    }
    total -= filter[mid];
    for (int i = 0; i < mid + 1; ++i) {
        filter[i] /= total;
    }
    pre_filter[0] = filter[0];
    for (int i = 1; i < mid + 1; ++i) {
        pre_filter[i] = filter[i] + pre_filter[i - 1];
    }
    
    // 卷积（卷积核越界部分使用边界填充，保持图片大小不变）
    gray_t* temp_res;  // 存储进行第一维卷积后的结果
    gray_t* device_img_src;
    gray_t* device_pre_filter;
    gray_t* device_filter;
    gray_t* device_img_dst;
    checkCudaErrors(cudaMalloc((void **) &temp_res, sizeof(gray_t) * n * m));
    checkCudaErrors(cudaMalloc((void **) &device_img_src, sizeof(gray_t) * n * m));
    checkCudaErrors(cudaMalloc((void **) &device_pre_filter, sizeof(gray_t) * (mid + 1)));
    checkCudaErrors(cudaMalloc((void **) &device_filter, sizeof(gray_t) * (mid + 1)));
    checkCudaErrors(cudaMalloc((void **) &device_img_dst, sizeof(gray_t) * n * m));
    checkCudaErrors(cudaMemcpy(device_img_src, img_src, sizeof(gray_t) * n * m, cudaMemcpyHostToDevice));
    checkCudaErrors(cudaMemcpy(device_pre_filter, pre_filter, sizeof(gray_t) * (mid + 1), cudaMemcpyHostToDevice));
    checkCudaErrors(cudaMemcpy(device_filter, filter, sizeof(gray_t) * (mid + 1), cudaMemcpyHostToDevice));
    unsigned int grid_rows = diveup(n, 4);
    unsigned int grid_cols = diveup(m, 8);
    dim3 dimGrid(grid_rows, grid_cols);
    dim3 dimBlock(4, 8);
    // 1. 进行第一维卷积
    conv1<<<dimGrid, dimBlock>>>(device_img_src, device_pre_filter, device_filter, temp_res, n, m, mid);
    checkCudaErrors(cudaDeviceSynchronize());
    // 2. 进行第二维卷积
    conv2<<<dimGrid, dimBlock>>>(temp_res, device_pre_filter, device_filter, device_img_dst, n, m, mid);
    checkCudaErrors(cudaDeviceSynchronize());
    checkCudaErrors(cudaMemcpy(img_dst, device_img_dst, sizeof(gray_t) * n * m, cudaMemcpyDeviceToHost));
    checkCudaErrors(cudaFree(temp_res));
    checkCudaErrors(cudaFree(device_img_src));
    checkCudaErrors(cudaFree(device_pre_filter));
    checkCudaErrors(cudaFree(device_filter));
    checkCudaErrors(cudaFree(device_img_dst));
    delete[] filter;
    delete[] pre_filter;
}

void cpu_guassian_smooth(const gray_t* img_src, gray_t** img_dst_ptr, int n, int m, double sigma) {
    gray_t* img_dst = new gray_t[n * m];
    *img_dst_ptr = img_dst;
    // 卷积核：用两次一维卷积分离实现二维卷积 复杂度从 O(m*n*filter_size*filter_size) 降为 O(m*n*filter_size)
    // 1. 根据sigma确定卷积核大小 原理参考https://www.cnblogs.com/shine-lee/p/9671253.html “|1”是为了取邻近的奇数
    int filter_size = int(sigma * 3 * 2 + 1) | 1;
    // 2. 根据高斯分布确定卷积核参数
    int mid = filter_size >> 1;
    gray_t* filter = new gray_t[mid + 1]; // 因为高斯卷积核的对称性 所以只存储前一半加一个参数
    gray_t* pre_filter = new gray_t[mid + 1]; // pre_filter[i]表示sum(filter[0], ..., filter[i])
    double total = 0;
    for (int i = 0; i < mid + 1; ++i) {
        filter[i] = 1 / (sqrt(2 * PI) * sigma) * exp((- (i - mid) * (i - mid)) / (2 * sigma * sigma));
        total += 2 * filter[i];
    }
    total -= filter[mid];
    for (int i = 0; i < mid + 1; ++i) {
        filter[i] /= total;
    }
    pre_filter[0] = filter[0];
    for (int i = 1; i < mid + 1; ++i) {
        pre_filter[i] = filter[i] + pre_filter[i - 1];
    }
    
    // 卷积（卷积核越界部分使用边界填充，保持图片大小不变）
    gray_t* temp_res = new gray_t[n * m];  // 存储进行第一维卷积后的结果
    // 1. 进行第一维卷积
    for (int j = 0; j < m; ++j) {
        for (int i = 0; i < n; ++i) {
            int pos = i * m + j;
            temp_res[pos] = 0;
            int i_sta = i - mid;
            int i_end = i + mid;
            // 当前行的卷积范围：[i-mid, i+mid]
            if (i - mid < 0) {
                // 合并计算[i-mid, 0)部分，即原filter的前mid-i个参数与mid-i个填充值（列首元素）的点乘
                temp_res[pos] += pre_filter[mid - i - 1] * img_src[j];
                i_sta = 0;
            }
            if (i + mid >= n) {
                // 合并计算(n-1, i+mid] 部分，即原filter的后xx=i+mid+1-n个参数（由于对称性 等价于前xx个）与xx个填充值（行尾元素）的点乘
                temp_res[pos] += pre_filter[i + mid - n] * img_src[(n - 1) * m + j];
                i_end = n - 1;
            }
            for (int xi = i_sta; xi <= i_end; ++xi) {
                // 第xi个元素离卷积中心i的距离为xi-i 使用的是距离卷积核中心mid距离为xi-i的卷积参数
                temp_res[pos] += filter[mid - myabs(i - xi)] * img_src[xi * m + j];
            }
        }
    }
    // 2. 进行第二维卷积
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            int pos = i * m + j;
            img_dst[pos] = 0;
            int j_sta = j - mid;
            int j_end = j + mid;
            // 当前行的卷积范围：[j-mid, j+mid]
            if (j - mid < 0) {
                // 合并计算[j-mid, 0)部分，即原filter的前mid-j个参数与mid-j个填充值（行首元素）的点乘
                img_dst[pos] += pre_filter[mid - j - 1] * temp_res[i * m];
                j_sta = 0;
            }
            if (j + mid >= m) {
                // 合并计算(m-1, j+mid] 部分，即原filter的后xx=j+mid+1-m个参数（由于对称性 等价于前xx个）与xx个填充值（行尾元素）的点乘
                img_dst[pos] += pre_filter[j + mid - m] * temp_res[i * m];
                j_end = m - 1;
            }
            for (int yj = j_sta; yj <= j_end; ++yj) {
                // 第yj个元素离卷积中心j的距离为yj-j 使用的是距离卷积核中心mid距离为yj-j的卷积参数
                img_dst[pos] += filter[mid - myabs(j - yj)] * temp_res[i * m + yj];
            }
        }
    }

    delete[] filter;
    delete[] pre_filter;
    delete[] temp_res;
}

double get_time() {
    struct timeval t1;
    gettimeofday(&t1, NULL);
    return t1.tv_sec + t1.tv_usec / 1000000.0;
}

void test_guassian() {
    int n = 1023, m = 888;
    gray_t* src_img = new gray_t[n * m];
    for (int i = 0; i < n * m; ++i) {
        src_img[i] = 0.5 * (i + 1);
    } 
    gray_t sigma = 55.5;
    
    gray_t* cpu_res, *gpu_res;
    double time1 = get_time();
    cpu_guassian_smooth(src_img, &cpu_res, n, m, sigma);
    double time2 = get_time();
    guassian_smooth(src_img, &gpu_res, n, m, sigma);
    double time3 = get_time();
    printf("%lf,%lf\n",time2-time1,time3-time2);
    
    // for (int i = 0; i < n * m; ++i) {
    //     printf("%lf ", gpu_res[i] - cpu_res[i]);
    // } 
}


int main() {
    test_guassian();
}
	.file	"tmpxft_002b0f79_00000000-6_test_scan.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2037:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2037:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z6diveupii
	.type	_Z6diveupii, @function
_Z6diveupii:
.LFB2027:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	cltd
	idivl	%esi
	cmpl	$1, %edx
	sbbl	$-1, %eax
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z6diveupii, .-_Z6diveupii
	.globl	_Z19cpu_guassian_smoothPKdPPdiid
	.type	_Z19cpu_guassian_smoothPKdPPdiid, @function
_Z19cpu_guassian_smoothPKdPPdiid:
.LFB2031:
	.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	%edx, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	imull	%ecx, %r14d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	movabsq	$1152921504606846975, %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%r14d, %r14
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movsd	%xmm0, 16(%rsp)
	cmpq	%r14, %rdx
	jb	.L7
	leaq	0(,%r14,8), %rax
	movq	%rdi, %r15
	movq	%rsi, %rbx
	movl	%ecx, %ebp
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	_Znam@PLT
	movsd	16(%rsp), %xmm0
	mulsd	.LC1(%rip), %xmm0
	movabsq	$1152921504606846975, %rdx
	movq	%rax, (%rbx)
	movq	%rax, 32(%rsp)
	addsd	%xmm0, %xmm0
	addsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %ebx
	sarl	%ebx
	leal	1(%rbx), %r13d
	movslq	%r13d, %r13
	cmpq	%r13, %rdx
	jnb	.L8
.L7:
	call	__cxa_throw_bad_array_new_length@PLT
.L8:
	salq	$3, %r13
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	call	_Znam@PLT
	movq	%r13, %rdi
	movq	%rax, 40(%rsp)
	call	_Znam@PLT
	movq	40(%rsp), %rdx
	xorps	%xmm1, %xmm1
	movq	%rax, 8(%rsp)
.L9:
	cmpl	%r14d, %ebx
	jl	.L33
	movl	%r14d, %edi
	movl	%ebx, %esi
	movsd	16(%rsp), %xmm2
	movq	%rdx, 48(%rsp)
	subl	%r14d, %esi
	subl	%ebx, %edi
	movsd	%xmm1, 40(%rsp)
	imull	%edi, %esi
	addsd	%xmm2, %xmm2
	mulsd	16(%rsp), %xmm2
	cvtsi2sdl	%esi, %xmm0
	divsd	%xmm2, %xmm0
	call	exp@PLT
	movq	48(%rsp), %rdx
	movsd	.LC3(%rip), %xmm3
	mulsd	16(%rsp), %xmm3
	movaps	%xmm0, %xmm2
	movsd	40(%rsp), %xmm1
	movsd	.LC2(%rip), %xmm0
	divsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	movsd	%xmm0, (%rdx,%r14,8)
	addsd	%xmm0, %xmm0
	incq	%r14
	addsd	%xmm0, %xmm1
	jmp	.L9
.L33:
	subsd	-8(%rdx,%r13), %xmm1
	xorl	%eax, %eax
.L11:
	cmpl	%eax, %ebx
	jl	.L34
	movsd	(%rdx,%rax,8), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%rdx,%rax,8)
	incq	%rax
	jmp	.L11
.L34:
	movq	8(%rsp), %rax
	movsd	(%rdx), %xmm0
	movsd	%xmm0, (%rax)
	xorl	%eax, %eax
.L13:
	incq	%rax
	cmpl	%eax, %ebx
	jl	.L35
	movq	8(%rsp), %rcx
	movsd	(%rdx,%rax,8), %xmm0
	addsd	-8(%rcx,%rax,8), %xmm0
	movsd	%xmm0, (%rcx,%rax,8)
	jmp	.L13
.L35:
	movq	24(%rsp), %rdi
	movq	%rdx, 40(%rsp)
	call	_Znam@PLT
	leal	-1(%r12), %ecx
	xorl	%edi, %edi
	xorps	%xmm1, %xmm1
	movq	%rax, 16(%rsp)
	movl	%ecx, %eax
	movq	40(%rsp), %rdx
	imull	%ebp, %eax
	movl	%eax, 48(%rsp)
	movslq	%ebp, %rax
	salq	$3, %rax
	movq	%rax, 24(%rsp)
	movl	%ebx, %eax
	subl	%r12d, %eax
	movl	%eax, 60(%rsp)
.L15:
	cmpl	%edi, %ebp
	jle	.L30
	movl	48(%rsp), %eax
	movl	%ebx, %r9d
	xorl	%esi, %esi
	negl	%r9d
	addl	%edi, %eax
	cltq
	leaq	(%r15,%rax,8), %rax
	movq	%rax, 40(%rsp)
	movq	16(%rsp), %rax
	leaq	(%rax,%rdi,8), %rax
.L22:
	cmpl	%r12d, %esi
	jge	.L36
	movq	$0x000000000, (%rax)
	movl	%r9d, %r8d
	leal	(%rbx,%rsi), %r11d
	testl	%r9d, %r9d
	jns	.L16
	movl	%ebx, %r8d
	movq	8(%rsp), %r10
	subl	%esi, %r8d
	movslq	%r8d, %r8
	movsd	-8(%r10,%r8,8), %xmm0
	mulsd	(%r15,%rdi,8), %xmm0
	xorl	%r8d, %r8d
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%rax)
.L16:
	cmpl	%r11d, %r12d
	jg	.L17
	movl	60(%rsp), %r11d
	leal	(%r11,%rsi), %r10d
	movq	8(%rsp), %r11
	movslq	%r10d, %r10
	movsd	(%r11,%r10,8), %xmm0
	movq	40(%rsp), %r11
	mulsd	(%r11), %xmm0
	movl	%ecx, %r11d
	addsd	(%rax), %xmm0
	movsd	%xmm0, (%rax)
.L17:
	movslq	%r8d, %r10
	imull	%ebp, %r8d
	movslq	%r8d, %r8
	addq	%rdi, %r8
	leaq	(%r15,%r8,8), %r13
.L18:
	cmpl	%r10d, %r11d
	jl	.L37
	movl	%esi, %r8d
	subl	%r10d, %r8d
	movl	%r8d, %r14d
	negl	%r14d
	cmovns	%r14d, %r8d
	movl	%ebx, %r14d
	incq	%r10
	subl	%r8d, %r14d
	movslq	%r14d, %r14
	movsd	(%rdx,%r14,8), %xmm0
	mulsd	0(%r13), %xmm0
	addsd	(%rax), %xmm0
	movq	24(%rsp), %r14
	addq	%r14, %r13
	movsd	%xmm0, (%rax)
	jmp	.L18
.L37:
	movq	24(%rsp), %r10
	incl	%esi
	incl	%r9d
	addq	%r10, %rax
	jmp	.L22
.L36:
	incq	%rdi
	jmp	.L15
.L30:
	movl	%ebx, %eax
	xorl	%r10d, %r10d
	xorps	%xmm1, %xmm1
	xorl	%r11d, %r11d
	subl	%ebp, %eax
	leal	-1(%rbp), %r14d
	movl	%eax, 24(%rsp)
.L21:
	cmpl	%r12d, %r11d
	jge	.L28
	movq	16(%rsp), %rcx
	movslq	%r10d, %rax
	xorl	%esi, %esi
	salq	$3, %rax
	leaq	(%rcx,%rax), %r9
	movq	32(%rsp), %rcx
	addq	%rcx, %rax
.L29:
	cmpl	%ebp, %esi
	jge	.L38
	movl	%esi, %edi
	movq	$0x000000000, (%rax)
	leal	(%rbx,%rsi), %r13d
	subl	%ebx, %edi
	jns	.L23
	movl	%ebx, %edi
	movq	8(%rsp), %rcx
	subl	%esi, %edi
	movslq	%edi, %rdi
	movsd	-8(%rcx,%rdi,8), %xmm0
	mulsd	(%r9), %xmm0
	xorl	%edi, %edi
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%rax)
.L23:
	cmpl	%r13d, %ebp
	jg	.L24
	movl	24(%rsp), %ecx
	movl	%r14d, %r13d
	leal	(%rcx,%rsi), %r8d
	movq	8(%rsp), %rcx
	movslq	%r8d, %r8
	movsd	(%rcx,%r8,8), %xmm0
	mulsd	(%r9), %xmm0
	addsd	(%rax), %xmm0
	movsd	%xmm0, (%rax)
.L24:
	movslq	%edi, %rdi
.L25:
	cmpl	%edi, %r13d
	jl	.L39
	movl	%esi, %r8d
	subl	%edi, %r8d
	movl	%r8d, %r15d
	negl	%r15d
	cmovns	%r15d, %r8d
	movl	%ebx, %r15d
	subl	%r8d, %r15d
	movslq	%r15d, %r15
	movsd	(%rdx,%r15,8), %xmm0
	mulsd	(%r9,%rdi,8), %xmm0
	incq	%rdi
	addsd	(%rax), %xmm0
	movsd	%xmm0, (%rax)
	jmp	.L25
.L39:
	incl	%esi
	addq	$8, %rax
	jmp	.L29
.L38:
	incl	%r11d
	addl	%ebp, %r10d
	jmp	.L21
.L28:
	movq	%rdx, %rdi
	call	_ZdaPv@PLT
	movq	8(%rsp), %rdi
	call	_ZdaPv@PLT
	movq	16(%rsp), %rdi
	addq	$72, %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
	jmp	_ZdaPv@PLT
	.cfi_endproc
.LFE2031:
	.size	_Z19cpu_guassian_smoothPKdPPdiid, .-_Z19cpu_guassian_smoothPKdPPdiid
	.globl	_Z8get_timev
	.type	_Z8get_timev, @function
_Z8get_timev:
.LFB2032:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	gettimeofday@PLT
	cvtsi2sdq	8(%rsp), %xmm1
	cvtsi2sdq	16(%rsp), %xmm0
	divsd	.LC4(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2032:
	.size	_Z8get_timev, .-_Z8get_timev
	.globl	_Z27__device_stub__Z4scanPdS_S_PdS_S_
	.type	_Z27__device_stub__Z4scanPdS_S_PdS_S_, @function
_Z27__device_stub__Z4scanPdS_S_PdS_S_:
.LFB2059:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L43
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z4scanPdS_S_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L43:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2059:
	.size	_Z27__device_stub__Z4scanPdS_S_PdS_S_, .-_Z27__device_stub__Z4scanPdS_S_PdS_S_
	.globl	_Z4scanPdS_S_
	.type	_Z4scanPdS_S_, @function
_Z4scanPdS_S_:
.LFB2060:
	.cfi_startproc
	endbr64
	jmp	_Z27__device_stub__Z4scanPdS_S_PdS_S_
	.cfi_endproc
.LFE2060:
	.size	_Z4scanPdS_S_, .-_Z4scanPdS_S_
	.globl	_Z33__device_stub__Z11scan_updatePdS_PdS_
	.type	_Z33__device_stub__Z11scan_updatePdS_PdS_, @function
_Z33__device_stub__Z11scan_updatePdS_PdS_:
.LFB2061:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L48
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z11scan_updatePdS_(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L48:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2061:
	.size	_Z33__device_stub__Z11scan_updatePdS_PdS_, .-_Z33__device_stub__Z11scan_updatePdS_PdS_
	.globl	_Z11scan_updatePdS_
	.type	_Z11scan_updatePdS_, @function
_Z11scan_updatePdS_:
.LFB2062:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z11scan_updatePdS_PdS_
	.cfi_endproc
.LFE2062:
	.size	_Z11scan_updatePdS_, .-_Z11scan_updatePdS_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC7:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/He-Ze/SIFT-on-GPU-and-its-optimization/main/src/test_scan.cu"
.LC8:
	.string	"Error: %s:%d, "
.LC9:
	.string	"code:%d, reason: %s \n"
.LC10:
	.string	"%lf "
	.text
	.globl	_Z9test_scanv
	.type	_Z9test_scanv, @function
_Z9test_scanv:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$3608, %edi
	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
	subq	$88, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	_Znam@PLT
	movl	$3608, %edi
	movq	%rax, %rbx
	call	_Znam@PLT
	movl	$3608, %edi
	movq	%rax, %r13
	call	_Znam@PLT
	xorps	%xmm1, %xmm1
	movq	%rax, %rbp
.L54:
	movl	$450, %eax
	leal	-450(%r12), %edx
	movsd	%xmm1, 8(%rsp)
	subl	%r12d, %eax
	imull	%edx, %eax
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC5(%rip), %xmm0
	call	exp@PLT
	mulsd	.LC6(%rip), %xmm0
	movsd	8(%rsp), %xmm1
	movsd	%xmm0, (%rbx,%r12,8)
	addsd	%xmm0, %xmm0
	incq	%r12
	addsd	%xmm0, %xmm1
	cmpq	$451, %r12
	jne	.L54
	subsd	3600(%rbx), %xmm1
	xorl	%eax, %eax
.L55:
	movsd	(%rbx,%rax,8), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx,%rax,8)
	incq	%rax
	cmpq	$451, %rax
	jne	.L55
	leaq	24(%rsp), %rdi
	movl	$3608, %esi
	call	cudaMalloc@PLT
	movl	$82, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L76
	movq	24(%rsp), %rdi
	movl	$1, %ecx
	movl	$3608, %edx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L57
	movl	$83, %ecx
.L76:
	leaq	.LC7(%rip), %rdx
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r12d, %edi
	call	cudaGetErrorString@PLT
	movl	$2, %edi
	movl	%r12d, %edx
	leaq	.LC9(%rip), %rsi
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L57:
	leaq	40(%rsp), %rdi
	movl	$120, %esi
	call	cudaMalloc@PLT
	movl	$88, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L76
	leaq	32(%rsp), %rdi
	movl	$3608, %esi
	call	cudaMalloc@PLT
	movl	$89, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L76
	movl	$134217729, %edx
	xorl	%r9d, %r9d
	movl	$1, %ecx
	movabsq	$4294967311, %rdi
	salq	$5, %rdx
	movl	$256, %r8d
	movl	$1, %esi
	movl	$1, 68(%rsp)
	movq	%rdx, 60(%rsp)
	movq	%rdi, 48(%rsp)
	movl	$1, 56(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L60
	movq	24(%rsp), %rdx
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z27__device_stub__Z4scanPdS_S_PdS_S_
.L60:
	call	cudaDeviceSynchronize@PLT
	movl	$92, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L76
	movl	$134217729, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$5, %rdx
	movl	$1, %esi
	movabsq	$4294967311, %rdi
	movl	$1, 68(%rsp)
	movq	%rdx, 60(%rsp)
	movq	%rdi, 48(%rsp)
	movl	$1, 56(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L62
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z33__device_stub__Z11scan_updatePdS_PdS_
.L62:
	call	cudaDeviceSynchronize@PLT
	movl	$94, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L76
	movq	32(%rsp), %rsi
	movl	$2, %ecx
	movl	$3608, %edx
	movq	%r13, %rdi
	call	cudaMemcpy@PLT
	movl	$96, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L76
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movl	$97, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L76
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movl	$98, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L76
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movl	$99, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L76
	movsd	(%rbx), %xmm0
	movl	$8, %eax
	movsd	%xmm0, 0(%rbp)
.L68:
	movsd	(%rbx,%rax), %xmm0
	addsd	-8(%rbp,%rax), %xmm0
	movsd	%xmm0, 0(%rbp,%rax)
	addq	$8, %rax
	cmpq	$3608, %rax
	jne	.L68
	xorl	%ebx, %ebx
	leaq	.LC10(%rip), %r12
.L69:
	movsd	0(%rbp,%rbx), %xmm0
	movq	%r12, %rsi
	movl	$2, %edi
	movb	$1, %al
	subsd	0(%r13,%rbx), %xmm0
	addq	$8, %rbx
	call	__printf_chk@PLT
	cmpq	$3608, %rbx
	jne	.L69
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L70
	call	__stack_chk_fail@PLT
.L70:
	addq	$88, %rsp
	.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
.LFE2028:
	.size	_Z9test_scanv, .-_Z9test_scanv
	.globl	_Z34__device_stub__Z10cal_filterPdS_idPdS_id
	.type	_Z34__device_stub__Z10cal_filterPdS_idPdS_id, @function
_Z34__device_stub__Z10cal_filterPdS_idPdS_id:
.LFB2063:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rcx
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movsd	%xmm0, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L77
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z10cal_filterPdS_id(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	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 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L77:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L79
	call	__stack_chk_fail@PLT
.L79:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2063:
	.size	_Z34__device_stub__Z10cal_filterPdS_idPdS_id, .-_Z34__device_stub__Z10cal_filterPdS_idPdS_id
	.globl	_Z10cal_filterPdS_id
	.type	_Z10cal_filterPdS_id, @function
_Z10cal_filterPdS_id:
.LFB2064:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z10cal_filterPdS_idPdS_id
	.cfi_endproc
.LFE2064:
	.size	_Z10cal_filterPdS_id, .-_Z10cal_filterPdS_id
	.globl	_Z34__device_stub__Z10div_filterPdS_iiPdS_ii
	.type	_Z34__device_stub__Z10div_filterPdS_iiPdS_ii, @function
_Z34__device_stub__Z10div_filterPdS_iiPdS_ii:
.LFB2065:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L82
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z10div_filterPdS_ii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	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 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L82:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L84
	call	__stack_chk_fail@PLT
.L84:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2065:
	.size	_Z34__device_stub__Z10div_filterPdS_iiPdS_ii, .-_Z34__device_stub__Z10div_filterPdS_iiPdS_ii
	.globl	_Z10div_filterPdS_ii
	.type	_Z10div_filterPdS_ii, @function
_Z10div_filterPdS_ii:
.LFB2066:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z10div_filterPdS_iiPdS_ii
	.cfi_endproc
.LFE2066:
	.size	_Z10div_filterPdS_ii, .-_Z10div_filterPdS_ii
	.section	.rodata.str1.1
.LC11:
	.string	"[%lf]"
	.text
	.globl	_Z11test_reducev
	.type	_Z11test_reducev, @function
_Z11test_reducev:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$3608, %edi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	_Znam@PLT
	movl	$3608, %edi
	movq	%rax, %r12
	call	_Znam@PLT
	movq	$0x000000000, 8(%rsp)
	movq	%rax, %rbx
.L88:
	movl	$450, %eax
	leal	-450(%rbp), %edx
	subl	%ebp, %eax
	imull	%edx, %eax
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC5(%rip), %xmm0
	call	exp@PLT
	mulsd	.LC6(%rip), %xmm0
	movsd	%xmm0, (%rbx,%rbp,8)
	addsd	8(%rsp), %xmm0
	incq	%rbp
	movsd	%xmm0, 8(%rsp)
	cmpq	$451, %rbp
	jne	.L88
	addsd	%xmm0, %xmm0
	subsd	3600(%rbx), %xmm0
	xorl	%eax, %eax
	movsd	%xmm0, 8(%rsp)
.L89:
	movsd	(%rbx,%rax,8), %xmm1
	divsd	%xmm0, %xmm1
	movsd	%xmm1, (%rbx,%rax,8)
	incq	%rax
	cmpq	$451, %rax
	jne	.L89
	leaq	.LC11(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
	leaq	16(%rsp), %rdi
	movl	$8, %esi
	call	cudaMalloc@PLT
	movl	$176, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L107
	leaq	24(%rsp), %rdi
	movl	$3608, %esi
	call	cudaMalloc@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L91
	movl	$177, %ecx
.L107:
	leaq	.LC7(%rip), %rdx
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%ebp, %edi
	call	cudaGetErrorString@PLT
	movl	%ebp, %edx
	movq	%rax, %rcx
.L108:
	movl	$2, %edi
	leaq	.LC9(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L91:
	movl	$134217729, %edx
	xorl	%r9d, %r9d
	movl	$1, %ecx
	movabsq	$4294967311, %rdi
	salq	$5, %rdx
	movl	$256, %r8d
	movl	$1, %esi
	movl	$1, 52(%rsp)
	movq	%rdx, 44(%rsp)
	movq	%rdi, 32(%rsp)
	movl	$1, 40(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L92
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rdi
	movl	$450, %edx
	movsd	.LC12(%rip), %xmm0
	call	_Z34__device_stub__Z10cal_filterPdS_idPdS_id
.L92:
	call	cudaDeviceSynchronize@PLT
	movl	$179, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L107
	movl	$134217729, %edx
	movl	$2147483649, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$5, %rdx
	addq	%rdi, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 44(%rsp)
	movl	$1, 52(%rsp)
	movq	%rdi, 32(%rsp)
	movl	$1, 40(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L94
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rdi
	movl	$8, %ecx
	movl	$450, %edx
	call	_Z34__device_stub__Z10div_filterPdS_iiPdS_ii
.L94:
	call	cudaDeviceSynchronize@PLT
	movl	$181, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L107
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movl	$3608, %edx
	movq	%r12, %rdi
	call	cudaMemcpy@PLT
	movl	$182, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L107
	movq	16(%rsp), %rsi
	movl	$2, %ecx
	leaq	8(%rsp), %rdi
	movl	$8, %edx
	call	cudaMemcpy@PLT
	movl	$183, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L107
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movl	$184, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L107
	movq	16(%rsp), %rdi
	xorl	%ebp, %ebp
	leaq	.LC10(%rip), %r14
	call	cudaFree@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L99
	movl	$185, %ecx
	leaq	.LC7(%rip), %rdx
	leaq	.LC8(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	%r13d, %edi
	call	cudaGetErrorString@PLT
	movl	%r13d, %edx
	movq	%rax, %rcx
	jmp	.L108
.L99:
	movsd	(%r12,%rbp), %xmm0
	subsd	(%rbx,%rbp), %xmm0
	movq	%r14, %rsi
	movb	$1, %al
	movl	$2, %edi
	addq	$8, %rbp
	call	__printf_chk@PLT
	cmpq	$3608, %rbp
	jne	.L99
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L100
	call	__stack_chk_fail@PLT
.L100:
	addq	$64, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z11test_reducev, .-_Z11test_reducev
	.globl	_Z33__device_stub__Z5conv1PdS_S_S_iiiPdS_S_S_iii
	.type	_Z33__device_stub__Z5conv1PdS_S_S_iiiPdS_S_S_iii, @function
_Z33__device_stub__Z5conv1PdS_S_S_iiiPdS_S_S_iii:
.LFB2067:
	.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
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 12(%rsp)
	movl	%r9d, 8(%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	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%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	.L109
	pushq	56(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z5conv1PdS_S_S_iii(%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
.L109:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L111
	call	__stack_chk_fail@PLT
.L111:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2067:
	.size	_Z33__device_stub__Z5conv1PdS_S_S_iiiPdS_S_S_iii, .-_Z33__device_stub__Z5conv1PdS_S_S_iiiPdS_S_S_iii
	.globl	_Z5conv1PdS_S_S_iii
	.type	_Z5conv1PdS_S_S_iii, @function
_Z5conv1PdS_S_S_iii:
.LFB2068:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z5conv1PdS_S_S_iiiPdS_S_S_iii
	.cfi_endproc
.LFE2068:
	.size	_Z5conv1PdS_S_S_iii, .-_Z5conv1PdS_S_S_iii
	.globl	_Z33__device_stub__Z5conv2PdS_S_S_iiiPdS_S_S_iii
	.type	_Z33__device_stub__Z5conv2PdS_S_S_iiiPdS_S_S_iii, @function
_Z33__device_stub__Z5conv2PdS_S_S_iiiPdS_S_S_iii:
.LFB2069:
	.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
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 12(%rsp)
	movl	%r9d, 8(%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	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%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	.L114
	pushq	56(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z5conv2PdS_S_S_iii(%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
.L114:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L116
	call	__stack_chk_fail@PLT
.L116:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2069:
	.size	_Z33__device_stub__Z5conv2PdS_S_S_iiiPdS_S_S_iii, .-_Z33__device_stub__Z5conv2PdS_S_S_iiiPdS_S_S_iii
	.globl	_Z5conv2PdS_S_S_iii
	.type	_Z5conv2PdS_S_S_iii, @function
_Z5conv2PdS_S_S_iii:
.LFB2070:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z5conv2PdS_S_S_iiiPdS_S_S_iii
	.cfi_endproc
.LFE2070:
	.size	_Z5conv2PdS_S_S_iii, .-_Z5conv2PdS_S_S_iii
	.globl	_Z15guassian_smoothPKdPPdiid
	.type	_Z15guassian_smoothPKdPPdiid, @function
_Z15guassian_smoothPKdPPdiid:
.LFB2030:
	.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
	movabsq	$1152921504606846975, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 32(%rsp)
	movl	%edx, %edi
	imull	%ecx, %edi
	movsd	%xmm0, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	movslq	%edi, %rdi
	cmpq	%rdi, %r12
	jb	.L120
	salq	$3, %rdi
	movq	%rsi, %rbx
	movl	%edx, %r13d
	movl	%ecx, %r14d
	call	_Znam@PLT
	movsd	16(%rsp), %xmm0
	mulsd	.LC1(%rip), %xmm0
	movq	%rax, 24(%rsp)
	movq	%rax, (%rbx)
	addsd	%xmm0, %xmm0
	addsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %ebp
	sarl	%ebp
	leal	1(%rbp), %eax
	cltq
	cmpq	%rax, %r12
	jnb	.L121
.L120:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L149
	call	__cxa_throw_bad_array_new_length@PLT
.L121:
	salq	$3, %rax
	xorl	%r15d, %r15d
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	_Znam@PLT
	movq	8(%rsp), %rdi
	movq	%rax, %rbx
	call	_Znam@PLT
	xorps	%xmm1, %xmm1
	movq	%rax, %r12
.L123:
	cmpl	%r15d, %ebp
	jl	.L153
	movl	%r15d, %edx
	movl	%ebp, %eax
	movsd	16(%rsp), %xmm2
	movsd	%xmm1, 40(%rsp)
	subl	%r15d, %eax
	subl	%ebp, %edx
	imull	%edx, %eax
	addsd	%xmm2, %xmm2
	mulsd	16(%rsp), %xmm2
	cvtsi2sdl	%eax, %xmm0
	divsd	%xmm2, %xmm0
	call	exp@PLT
	movsd	.LC3(%rip), %xmm3
	mulsd	16(%rsp), %xmm3
	movaps	%xmm0, %xmm2
	movsd	.LC2(%rip), %xmm0
	movsd	40(%rsp), %xmm1
	divsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	movsd	%xmm0, (%rbx,%r15,8)
	addsd	%xmm0, %xmm0
	incq	%r15
	addsd	%xmm0, %xmm1
	jmp	.L123
.L153:
	movq	8(%rsp), %rax
	subsd	-8(%rbx,%rax), %xmm1
	xorl	%eax, %eax
.L125:
	cmpl	%eax, %ebp
	jl	.L154
	movsd	(%rbx,%rax,8), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx,%rax,8)
	incq	%rax
	jmp	.L125
.L154:
	movsd	(%rbx), %xmm0
	xorl	%eax, %eax
	movsd	%xmm0, (%r12)
.L127:
	incq	%rax
	cmpl	%eax, %ebp
	jl	.L155
	movsd	(%rbx,%rax,8), %xmm0
	addsd	-8(%r12,%rax,8), %xmm0
	movsd	%xmm0, (%r12,%rax,8)
	jmp	.L127
.L155:
	movslq	%r14d, %rdx
	movslq	%r13d, %rax
	leaq	56(%rsp), %rdi
	imulq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rsi
	movq	%rax, 16(%rsp)
	call	cudaMalloc@PLT
	movl	$277, %ecx
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	.L150
	movq	16(%rsp), %rsi
	leaq	64(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %r15d
	testl	%eax, %eax
	je	.L130
	movl	$278, %ecx
.L150:
	leaq	.LC7(%rip), %rdx
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r15d, %edi
	call	cudaGetErrorString@PLT
	movl	%r15d, %edx
	movq	%rax, %rcx
.L151:
	movl	$2, %edi
	leaq	.LC9(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L130:
	movq	8(%rsp), %rsi
	leaq	72(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	$279, %ecx
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	.L150
	movq	8(%rsp), %rsi
	leaq	80(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	$280, %ecx
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	.L150
	movq	16(%rsp), %rsi
	leaq	88(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	$281, %ecx
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	.L150
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	64(%rsp), %rdi
	call	cudaMemcpy@PLT
	movl	$282, %ecx
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	.L150
	movq	8(%rsp), %rdx
	movq	72(%rsp), %rdi
	movl	$1, %ecx
	movq	%r12, %rsi
	call	cudaMemcpy@PLT
	movl	$283, %ecx
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	.L150
	movq	8(%rsp), %rdx
	movq	80(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	movl	$284, %ecx
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	.L150
	movl	$4, %esi
	movl	%r13d, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	call	_Z6diveupii
	movl	$8, %esi
	movl	%r14d, %edi
	movl	%eax, %ecx
	call	_Z6diveupii
	movl	%ecx, 96(%rsp)
	movabsq	$34359738372, %rdx
	movl	$1, %ecx
	movl	%eax, 100(%rsp)
	movq	96(%rsp), %rdi
	movl	$1, %esi
	movl	$1, 104(%rsp)
	movq	%rdx, 108(%rsp)
	movl	$1, 116(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L137
	pushq	%rsi
	.cfi_def_cfa_offset 200
	movl	%r13d, %r8d
	movl	%r14d, %r9d
	pushq	%rbp
	.cfi_def_cfa_offset 208
	movq	72(%rsp), %rcx
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z33__device_stub__Z5conv1PdS_S_S_iiiPdS_S_S_iii
	popq	%rdi
	.cfi_def_cfa_offset 200
	popq	%r8
	.cfi_def_cfa_offset 192
.L137:
	call	cudaDeviceSynchronize@PLT
	movl	$291, %ecx
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	.L150
	movl	116(%rsp), %ecx
	movq	108(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	96(%rsp), %rdi
	movl	104(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L139
	pushq	%rax
	.cfi_def_cfa_offset 200
	movl	%r14d, %r9d
	movl	%r13d, %r8d
	pushq	%rbp
	.cfi_def_cfa_offset 208
	movq	104(%rsp), %rcx
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z33__device_stub__Z5conv2PdS_S_S_iiiPdS_S_S_iii
	popq	%rdx
	.cfi_def_cfa_offset 200
	popq	%rcx
	.cfi_def_cfa_offset 192
.L139:
	call	cudaDeviceSynchronize@PLT
	movl	$294, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L152
	movq	16(%rsp), %rdx
	movq	88(%rsp), %rsi
	movl	$2, %ecx
	movq	24(%rsp), %rdi
	call	cudaMemcpy@PLT
	movl	$295, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L152
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movl	$296, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L152
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movl	$297, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L152
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movl	$298, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L152
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movl	$299, %ecx
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L152
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L146
	movl	$300, %ecx
.L152:
	leaq	.LC7(%rip), %rdx
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%ebp, %edi
	call	cudaGetErrorString@PLT
	movl	%ebp, %edx
	movq	%rax, %rcx
	jmp	.L151
.L146:
	movq	%rbx, %rdi
	call	_ZdaPv@PLT
	movq	%r12, %rdi
	call	_ZdaPv@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L147
.L149:
	call	__stack_chk_fail@PLT
.L147:
	addq	$136, %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
.LFE2030:
	.size	_Z15guassian_smoothPKdPPdiid, .-_Z15guassian_smoothPKdPPdiid
	.section	.rodata.str1.1
.LC15:
	.string	"%lf,%lf\n"
	.text
	.globl	_Z13test_guassianv
	.type	_Z13test_guassianv, @function
_Z13test_guassianv:
.LFB2033:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$7267392, %edi
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	_Znam@PLT
	movsd	.LC13(%rip), %xmm1
	movq	%rax, %rbx
	movl	$1, %eax
.L157:
	cvtsi2sdl	%eax, %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -8(%rbx,%rax,8)
	incq	%rax
	cmpq	$908425, %rax
	jne	.L157
	call	_Z8get_timev
	leaq	24(%rsp), %rsi
	movl	$888, %ecx
	movq	%rbx, %rdi
	movsd	%xmm0, (%rsp)
	movsd	.LC14(%rip), %xmm0
	movl	$1023, %edx
	call	_Z19cpu_guassian_smoothPKdPPdiid
	call	_Z8get_timev
	leaq	32(%rsp), %rsi
	movl	$888, %ecx
	movq	%rbx, %rdi
	movsd	%xmm0, 8(%rsp)
	movsd	.LC14(%rip), %xmm0
	movl	$1023, %edx
	call	_Z15guassian_smoothPKdPPdiid
	call	_Z8get_timev
	movsd	8(%rsp), %xmm2
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	movaps	%xmm0, %xmm1
	je	.L158
	call	__stack_chk_fail@PLT
.L158:
	movaps	%xmm2, %xmm0
	subsd	%xmm2, %xmm1
	subsd	(%rsp), %xmm0
	addq	$48, %rsp
	.cfi_def_cfa_offset 16
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	movb	$2, %al
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2033:
	.size	_Z13test_guassianv, .-_Z13test_guassianv
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2034:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z13test_guassianv
	xorl	%eax, %eax
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2034:
	.size	main, .-main
	.section	.rodata.str1.1
.LC16:
	.string	"_Z5conv2PdS_S_S_iii"
.LC17:
	.string	"_Z5conv1PdS_S_S_iii"
.LC18:
	.string	"_Z10div_filterPdS_ii"
.LC19:
	.string	"_Z10cal_filterPdS_id"
.LC20:
	.string	"_Z11scan_updatePdS_"
.LC21:
	.string	"_Z4scanPdS_S_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2072:
	.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	.LC16(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z5conv2PdS_S_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	.LC17(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z5conv1PdS_S_S_iii(%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
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC18(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z10div_filterPdS_ii(%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
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC19(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z10cal_filterPdS_id(%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
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC20(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11scan_updatePdS_(%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
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC21(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z4scanPdS_S_(%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
.LFE2072:
	.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
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.align 8
.LC3:
	.long	536225458
	.long	1074007443
	.align 8
.LC4:
	.long	0
	.long	1093567616
	.align 8
.LC5:
	.long	0
	.long	1088813312
	.align 8
.LC6:
	.long	169349989
	.long	1063635358
	.align 8
.LC12:
	.long	0
	.long	1080213504
	.align 8
.LC13:
	.long	0
	.long	1071644672
	.align 8
.LC14:
	.long	0
	.long	1078706176
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <hip/hip_runtime.h>
#include <stdio.h>
#include <math.h>
#include <sys/time.h>

#define gray_t double
#define PI 3.1415926535897
#define mymax(x, y) ((x) < (y) ? (y) : (x))
#define mymin(x, y) ((x) > (y) ? (y) : (x))
#define myabs(x) ((x) < 0? (-(x)) : (x))
// 检查以cuda开头的api调用是否出错或已经出错
#define checkCudaErrors(call)												\
{																			\
	const hipError_t error = call;											\
	if (error != hipSuccess) {												\
		printf("Error: %s:%d, ", __FILE__, __LINE__);						\
		printf("code:%d, reason: %s \n", error, hipGetErrorString(error));	\
		exit(1);															\
	}																		\
}

// from CUDA7.pdf
// 计算 每个block内部的前缀和 并记录block sum（block内前缀和数组的最后一个值）的前缀和
__global__ void scan(gray_t* out, gray_t* block_sums, gray_t* data) {
    extern __shared__ gray_t s_data[];
    int tid = blockIdx.x * blockDim.x + threadIdx.x;
    s_data[threadIdx.x] = data[tid];

    for (int stride = 1; stride < blockDim.x; stride <<= 1) {
        __syncthreads();
        gray_t val = (threadIdx.x >= stride) ? s_data[threadIdx.x - stride] : 0;
        __syncthreads();
        s_data[threadIdx.x] += val;
    }

    out[tid] = s_data[threadIdx.x];
    if (threadIdx.x == 0) {
        for (int i = blockIdx.x + 1; i < gridDim.x; ++i) {
            atomicAdd(&block_sums[i], s_data[blockDim.x - 1]);
        } 
    }
}

// 将blocksum前缀和添加到block内部前缀和的每一项
__global__ void scan_update(gray_t* out, gray_t* block_sums) {
    __shared__ gray_t block_sum;
    int idx = blockIdx.x * blockDim.x + threadIdx.x;

    if (threadIdx.x == 0) {
        block_sum  = block_sums[blockIdx.x];
    }

    __syncthreads();

    out[idx] += block_sum;
}

int diveup(int total, int threadnum){
    return (total % threadnum ? (total / threadnum + 1) : (total / threadnum));
}

void test_scan() {
    double sigma = 150;
    int filter_size = int(sigma * 3 * 2 + 1) | 1;
    int mid = filter_size >> 1;
    gray_t* filter = new gray_t[mid + 1]; 
    gray_t* pre_filter = new gray_t[mid + 1]; // pre_filter[i]表示sum(filter[0], ..., filter[i])
    gray_t* cpu_pre_filter = new gray_t[mid + 1]; 
    double total = 0;

    for (int i = 0; i < mid + 1; ++i) {
        filter[i] = 1 / (sqrt(2 * PI) * sigma) * exp((- (i - mid) * (i - mid)) / (2 * sigma * sigma));
        total += 2 * filter[i];
    }

    total -= filter[mid];
    for (int i = 0; i < mid + 1; ++i) {
        filter[i] /= total;
    }

    gray_t* device_filter;
    checkCudaErrors(hipMalloc((void **) &device_filter, sizeof(gray_t) * (mid + 1)));
    checkCudaErrors(hipMemcpy(device_filter, filter, sizeof(gray_t) * (mid + 1), hipMemcpyHostToDevice));
    // copy  filter to pre_filter
    int block_num = diveup(mid + 1, 32);
    gray_t* device_pre_filter;
    gray_t* block_sums;
    checkCudaErrors(hipMalloc((void **) &block_sums, sizeof(gray_t) * (block_num)));
    checkCudaErrors(hipMalloc((void **) &device_pre_filter, sizeof(gray_t) * (mid + 1)));

    scan<<<block_num, 32, sizeof(gray_t)*32>>>(device_pre_filter, block_sums, device_filter);
    checkCudaErrors(hipDeviceSynchronize());
    scan_update<<<block_num, 32>>>(device_pre_filter, block_sums);
    checkCudaErrors(hipDeviceSynchronize());

    checkCudaErrors(hipMemcpy(pre_filter, device_pre_filter, sizeof(gray_t) * (mid + 1), hipMemcpyDeviceToHost));
    checkCudaErrors(hipFree(device_filter));
    checkCudaErrors(hipFree(block_sums));
    checkCudaErrors(hipFree(device_pre_filter));
    
    cpu_pre_filter[0] = filter[0];
    for (int i = 1; i < mid + 1; ++i) {
        cpu_pre_filter[i] = filter[i] + cpu_pre_filter[i - 1];
    }

    for (int i = 0; i < mid + 1; ++i) {
        printf("%lf ", cpu_pre_filter[i] - pre_filter[i]);
    }
}

__global__ void cal_filter(gray_t* filter, gray_t* total, int mid, double sigma) {
    extern __shared__ gray_t sdata[];
    // 计算filter
    int fi = blockIdx.x * blockDim.x + threadIdx.x;  // not unsigned int
    int tidx = threadIdx.x;
    if (fi <= mid) {
        filter[fi] = 1 / (sqrt(2 * PI) * sigma) * exp((- (fi - mid) * (fi - mid)) / (2 * sigma * sigma));
    }
    if (tidx == 0) {
        total[0] = 0.0;
    }
    __syncthreads(); // 确保当前线程块所需的filter计算完毕
    
    // 将filter加载到共享内存
    sdata[tidx] = fi <= mid ? filter[fi] : 0;
    __syncthreads();
    
    // 规约：把当前线程块的filter之和存放到共享内存sdata[0]
    for (unsigned int s = blockDim.x / 2; s > 0; s >>= 1) {
        if (tidx < s) {
            sdata[tidx] += sdata[tidx + s];
        }
        __syncthreads();
    }
    
    // 把所有线程块结果用原子加法累加到全局遍历total[0]上
    if (tidx == 0) {
        atomicAdd(total, 2.0 * sdata[0]);
    }
    if (fi == mid) {
        atomicAdd(total, - filter[mid]);
    }
}

__global__ void div_filter(gray_t* filter, gray_t* total, int mid, int loop) {
    // 计算filter
    int fi = blockIdx.x * blockDim.x + threadIdx.x;
    int sta = fi * loop;
    int end = mymin(sta + loop, mid + 1);
    for (int i = sta; i < end; ++i) {
        filter[i] /= total[0];
    }
}

void test_reduce() {
    double sigma = 150;
    int filter_size = int(sigma * 3 * 2 + 1) | 1;
    int mid = filter_size >> 1;
    gray_t* filter = new gray_t[mid + 1]; 
    gray_t* cpu_filter = new gray_t[mid + 1]; 
    double total = 0;


    for (int i = 0; i < mid + 1; ++i) {
        cpu_filter[i] = 1 / (sqrt(2 * PI) * sigma) * exp((- (i - mid) * (i - mid)) / (2 * sigma * sigma));
        total += cpu_filter[i];
    }

    total = 2 * total - cpu_filter[mid];
    for (int i = 0; i < mid + 1; ++i) {
        cpu_filter[i] /= total;
    }
    printf("[%lf]", total);
    gray_t* device_total;
    gray_t* device_filter;
    checkCudaErrors(hipMalloc((void **) &device_total, sizeof(gray_t)));
    checkCudaErrors(hipMalloc((void **) &device_filter, sizeof(gray_t) * (mid + 1)));
    cal_filter<<<diveup((mid + 1), 32), 32, sizeof(gray_t)*32>>>(device_filter, device_total, mid, sigma);
    checkCudaErrors(hipDeviceSynchronize());
    div_filter<<<diveup((mid + 1), 32 * 8), 32>>>(device_filter, device_total, mid, 8);
    checkCudaErrors(hipDeviceSynchronize());
    checkCudaErrors(hipMemcpy(filter, device_filter, sizeof(gray_t) * (mid + 1), hipMemcpyDeviceToHost));
    checkCudaErrors(hipMemcpy(&total, device_total, sizeof(gray_t), hipMemcpyDeviceToHost));
    checkCudaErrors(hipFree(device_filter));
    checkCudaErrors(hipFree(device_total));
    for (int i = 0; i < mid + 1; ++i) {
        printf("%lf ", filter[i] - cpu_filter[i]);
    }
}

__global__ void conv1(gray_t* img_src, gray_t* pre_filter, gray_t* filter, gray_t* temp_res, int n, int m, int mid){  
    int i = threadIdx.x+blockDim.x*blockIdx.x;
    int j = threadIdx.y+blockDim.y*blockIdx.y;
    if (i < n && j < m) {
        int pos = j + i * m;
        gray_t temp = 0;
        int i_sta = i - mid;
        int i_end = i + mid;
        // 当前行的卷积范围：[i-mid, i+mid]
        if (i - mid < 0) {
            // 合并计算[i-mid, 0)部分，即原filter的前mid-i个参数与mid-i个填充值（列首元素）的点乘
            temp += pre_filter[mid - i - 1] * img_src[j];
            i_sta = 0;
        }
        if (i + mid >= n) {
            // 合并计算(n-1, i+mid] 部分，即原filter的后xx=i+mid+1-n个参数（由于对称性 等价于前xx个）与xx个填充值（行尾元素）的点乘
            temp += pre_filter[i + mid - n] * img_src[(n - 1) * m + j];
            i_end = n - 1;
        }
        for (int xi = i_sta; xi <= i_end; ++xi) {
            // 第xi个元素离卷积中心i的距离为xi-i 使用的是距离卷积核中心mid距离为xi-i的卷积参数
            temp += filter[mid - myabs(i - xi)] * img_src[xi * m + j];
        }
        temp_res[pos] = temp;
    }
    
}

__global__ void conv2(gray_t* temp_res, gray_t* pre_filter, gray_t* filter, gray_t* img_dst, int n, int m, int mid){  
    int i = threadIdx.x+blockDim.x*blockIdx.x;
    int j = threadIdx.y+blockDim.y*blockIdx.y;
    if (i < n && j < m) {
        int pos = i * m + j;
        gray_t temp = 0;
        int j_sta = j - mid;
        int j_end = j + mid;
        // gray_t tmp = 0;
        // 当前行的卷积范围：[j-mid, j+mid]
        if (j - mid < 0) {
            // 合并计算[j-mid, 0)部分，即原filter的前mid-j个参数与mid-j个填充值（行首元素）的点乘
            temp += pre_filter[mid - j - 1] * temp_res[i * m];
            j_sta = 0;
        }
        if (j + mid >= m) {
            // 合并计算(m-1, j+mid] 部分，即原filter的后xx=j+mid+1-m个参数（由于对称性 等价于前xx个）与xx个填充值（行尾元素）的点乘
            temp += pre_filter[j + mid - m] * temp_res[i * m];
            j_end = m - 1;
        }
        for (int yj = j_sta; yj <= j_end; ++yj) {
            // 第yj个元素离卷积中心j的距离为yj-j 使用的是距离卷积核中心mid距离为yj-j的卷积参数
            temp += filter[mid - myabs(j - yj)] * temp_res[i * m + yj];
        }
        img_dst[pos] = temp;
    }
}

void guassian_smooth(const gray_t* img_src, gray_t** img_dst_ptr, int n, int m, double sigma) {
    gray_t* img_dst = new gray_t[n * m];
    *img_dst_ptr = img_dst;
    // 卷积核：用两次一维卷积分离实现二维卷积 复杂度从 O(m*n*filter_size*filter_size) 降为 O(m*n*filter_size)
    // 1. 根据sigma确定卷积核大小 原理参考https://www.cnblogs.com/shine-lee/p/9671253.html “|1”是为了取邻近的奇数
    int filter_size = int(sigma * 3 * 2 + 1) | 1;
    // 2. 根据高斯分布确定卷积核参数
    int mid = filter_size >> 1;
    gray_t* filter = new gray_t[mid + 1]; // 因为高斯卷积核的对称性 所以只存储前一半加一个参数
    gray_t* pre_filter = new gray_t[mid + 1]; // pre_filter[i]表示sum(filter[0], ..., filter[i])
    double total = 0;
    for (int i = 0; i < mid + 1; ++i) {
        filter[i] = 1 / (sqrt(2 * PI) * sigma) * exp((- (i - mid) * (i - mid)) / (2 * sigma * sigma));
        total += 2 * filter[i];
    }
    total -= filter[mid];
    for (int i = 0; i < mid + 1; ++i) {
        filter[i] /= total;
    }
    pre_filter[0] = filter[0];
    for (int i = 1; i < mid + 1; ++i) {
        pre_filter[i] = filter[i] + pre_filter[i - 1];
    }
    
    // 卷积（卷积核越界部分使用边界填充，保持图片大小不变）
    gray_t* temp_res;  // 存储进行第一维卷积后的结果
    gray_t* device_img_src;
    gray_t* device_pre_filter;
    gray_t* device_filter;
    gray_t* device_img_dst;
    checkCudaErrors(hipMalloc((void **) &temp_res, sizeof(gray_t) * n * m));
    checkCudaErrors(hipMalloc((void **) &device_img_src, sizeof(gray_t) * n * m));
    checkCudaErrors(hipMalloc((void **) &device_pre_filter, sizeof(gray_t) * (mid + 1)));
    checkCudaErrors(hipMalloc((void **) &device_filter, sizeof(gray_t) * (mid + 1)));
    checkCudaErrors(hipMalloc((void **) &device_img_dst, sizeof(gray_t) * n * m));
    checkCudaErrors(hipMemcpy(device_img_src, img_src, sizeof(gray_t) * n * m, hipMemcpyHostToDevice));
    checkCudaErrors(hipMemcpy(device_pre_filter, pre_filter, sizeof(gray_t) * (mid + 1), hipMemcpyHostToDevice));
    checkCudaErrors(hipMemcpy(device_filter, filter, sizeof(gray_t) * (mid + 1), hipMemcpyHostToDevice));
    unsigned int grid_rows = diveup(n, 4);
    unsigned int grid_cols = diveup(m, 8);
    dim3 dimGrid(grid_rows, grid_cols);
    dim3 dimBlock(4, 8);
    // 1. 进行第一维卷积
    conv1<<<dimGrid, dimBlock>>>(device_img_src, device_pre_filter, device_filter, temp_res, n, m, mid);
    checkCudaErrors(hipDeviceSynchronize());
    // 2. 进行第二维卷积
    conv2<<<dimGrid, dimBlock>>>(temp_res, device_pre_filter, device_filter, device_img_dst, n, m, mid);
    checkCudaErrors(hipDeviceSynchronize());
    checkCudaErrors(hipMemcpy(img_dst, device_img_dst, sizeof(gray_t) * n * m, hipMemcpyDeviceToHost));
    checkCudaErrors(hipFree(temp_res));
    checkCudaErrors(hipFree(device_img_src));
    checkCudaErrors(hipFree(device_pre_filter));
    checkCudaErrors(hipFree(device_filter));
    checkCudaErrors(hipFree(device_img_dst));
    delete[] filter;
    delete[] pre_filter;
}

void cpu_guassian_smooth(const gray_t* img_src, gray_t** img_dst_ptr, int n, int m, double sigma) {
    gray_t* img_dst = new gray_t[n * m];
    *img_dst_ptr = img_dst;
    // 卷积核：用两次一维卷积分离实现二维卷积 复杂度从 O(m*n*filter_size*filter_size) 降为 O(m*n*filter_size)
    // 1. 根据sigma确定卷积核大小 原理参考https://www.cnblogs.com/shine-lee/p/9671253.html “|1”是为了取邻近的奇数
    int filter_size = int(sigma * 3 * 2 + 1) | 1;
    // 2. 根据高斯分布确定卷积核参数
    int mid = filter_size >> 1;
    gray_t* filter = new gray_t[mid + 1]; // 因为高斯卷积核的对称性 所以只存储前一半加一个参数
    gray_t* pre_filter = new gray_t[mid + 1]; // pre_filter[i]表示sum(filter[0], ..., filter[i])
    double total = 0;
    for (int i = 0; i < mid + 1; ++i) {
        filter[i] = 1 / (sqrt(2 * PI) * sigma) * exp((- (i - mid) * (i - mid)) / (2 * sigma * sigma));
        total += 2 * filter[i];
    }
    total -= filter[mid];
    for (int i = 0; i < mid + 1; ++i) {
        filter[i] /= total;
    }
    pre_filter[0] = filter[0];
    for (int i = 1; i < mid + 1; ++i) {
        pre_filter[i] = filter[i] + pre_filter[i - 1];
    }
    
    // 卷积（卷积核越界部分使用边界填充，保持图片大小不变）
    gray_t* temp_res = new gray_t[n * m];  // 存储进行第一维卷积后的结果
    // 1. 进行第一维卷积
    for (int j = 0; j < m; ++j) {
        for (int i = 0; i < n; ++i) {
            int pos = i * m + j;
            temp_res[pos] = 0;
            int i_sta = i - mid;
            int i_end = i + mid;
            // 当前行的卷积范围：[i-mid, i+mid]
            if (i - mid < 0) {
                // 合并计算[i-mid, 0)部分，即原filter的前mid-i个参数与mid-i个填充值（列首元素）的点乘
                temp_res[pos] += pre_filter[mid - i - 1] * img_src[j];
                i_sta = 0;
            }
            if (i + mid >= n) {
                // 合并计算(n-1, i+mid] 部分，即原filter的后xx=i+mid+1-n个参数（由于对称性 等价于前xx个）与xx个填充值（行尾元素）的点乘
                temp_res[pos] += pre_filter[i + mid - n] * img_src[(n - 1) * m + j];
                i_end = n - 1;
            }
            for (int xi = i_sta; xi <= i_end; ++xi) {
                // 第xi个元素离卷积中心i的距离为xi-i 使用的是距离卷积核中心mid距离为xi-i的卷积参数
                temp_res[pos] += filter[mid - myabs(i - xi)] * img_src[xi * m + j];
            }
        }
    }
    // 2. 进行第二维卷积
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            int pos = i * m + j;
            img_dst[pos] = 0;
            int j_sta = j - mid;
            int j_end = j + mid;
            // 当前行的卷积范围：[j-mid, j+mid]
            if (j - mid < 0) {
                // 合并计算[j-mid, 0)部分，即原filter的前mid-j个参数与mid-j个填充值（行首元素）的点乘
                img_dst[pos] += pre_filter[mid - j - 1] * temp_res[i * m];
                j_sta = 0;
            }
            if (j + mid >= m) {
                // 合并计算(m-1, j+mid] 部分，即原filter的后xx=j+mid+1-m个参数（由于对称性 等价于前xx个）与xx个填充值（行尾元素）的点乘
                img_dst[pos] += pre_filter[j + mid - m] * temp_res[i * m];
                j_end = m - 1;
            }
            for (int yj = j_sta; yj <= j_end; ++yj) {
                // 第yj个元素离卷积中心j的距离为yj-j 使用的是距离卷积核中心mid距离为yj-j的卷积参数
                img_dst[pos] += filter[mid - myabs(j - yj)] * temp_res[i * m + yj];
            }
        }
    }

    delete[] filter;
    delete[] pre_filter;
    delete[] temp_res;
}

double get_time() {
    struct timeval t1;
    gettimeofday(&t1, NULL);
    return t1.tv_sec + t1.tv_usec / 1000000.0;
}

void test_guassian() {
    int n = 1023, m = 888;
    gray_t* src_img = new gray_t[n * m];
    for (int i = 0; i < n * m; ++i) {
        src_img[i] = 0.5 * (i + 1);
    } 
    gray_t sigma = 55.5;
    
    gray_t* cpu_res, *gpu_res;
    double time1 = get_time();
    cpu_guassian_smooth(src_img, &cpu_res, n, m, sigma);
    double time2 = get_time();
    guassian_smooth(src_img, &gpu_res, n, m, sigma);
    double time3 = get_time();
    printf("%lf,%lf\n",time2-time1,time3-time2);
    
    // for (int i = 0; i < n * m; ++i) {
    //     printf("%lf ", gpu_res[i] - cpu_res[i]);
    // } 
}


int main() {
    test_guassian();
}
	.text
	.file	"test_scan.hip"
	.globl	_Z19__device_stub__scanPdS_S_   # -- Begin function _Z19__device_stub__scanPdS_S_
	.type	_Z19__device_stub__scanPdS_S_,@function
_Z19__device_stub__scanPdS_S_:          # @_Z19__device_stub__scanPdS_S_
	.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	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z4scanPdS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	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	_Z19__device_stub__scanPdS_S_, .Lfunc_end0-_Z19__device_stub__scanPdS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__scan_updatePdS_ # -- Begin function _Z26__device_stub__scan_updatePdS_
	.type	_Z26__device_stub__scan_updatePdS_,@function
_Z26__device_stub__scan_updatePdS_:     # @_Z26__device_stub__scan_updatePdS_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11scan_updatePdS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z26__device_stub__scan_updatePdS_, .Lfunc_end1-_Z26__device_stub__scan_updatePdS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z6diveupii                     # -- Begin function _Z6diveupii
	.type	_Z6diveupii,@function
_Z6diveupii:                            # @_Z6diveupii
	.cfi_startproc
# %bb.0:
	movl	%edi, %eax
	cltd
	idivl	%esi
	cmpl	$1, %edx
	sbbl	$-1, %eax
	retq
.Lfunc_end2:
	.size	_Z6diveupii, .Lfunc_end2-_Z6diveupii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z9test_scanv
.LCPI3_0:
	.quad	0x40e5f90000000000              # double 45000
.LCPI3_1:
	.quad	0x3f65c99e0a181365              # double 0.002659615202676257
	.text
	.globl	_Z9test_scanv
	.type	_Z9test_scanv,@function
_Z9test_scanv:                          # @_Z9test_scanv
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movabsq	$4294967311, %r12               # imm = 0x10000000F
	movl	$3608, %edi                     # imm = 0xE18
	callq	_Znam
	movq	%rax, %r15
	movl	$3608, %edi                     # imm = 0xE18
	callq	_Znam
	movq	%rax, %rbx
	movl	$3608, %edi                     # imm = 0xE18
	callq	_Znam
	movq	%rax, %r14
	xorpd	%xmm1, %xmm1
	movl	$450, %r13d                     # imm = 0x1C2
	xorl	%ebp, %ebp
.LBB3_1:                                # =>This Inner Loop Header: Depth=1
	movsd	%xmm1, 32(%rsp)                 # 8-byte Spill
	leal	(%r12,%rbp), %eax
	addl	$-465, %eax                     # imm = 0xFE2F
	imull	%r13d, %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	.LCPI3_0(%rip), %xmm0
	callq	exp
	movsd	32(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	mulsd	.LCPI3_1(%rip), %xmm0
	movsd	%xmm0, (%r15,%rbp,8)
	addsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	incq	%rbp
	addq	$-1, %r13
	jb	.LBB3_1
# %bb.2:
	subsd	3600(%r15), %xmm1
	xorl	%eax, %eax
.LBB3_3:                                # =>This Inner Loop Header: Depth=1
	movsd	(%r15,%rax,8), %xmm0            # xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%r15,%rax,8)
	incq	%rax
	cmpq	$451, %rax                      # imm = 0x1C3
	jne	.LBB3_3
# %bb.4:
	leaq	24(%rsp), %rdi
	movl	$3608, %esi                     # imm = 0xE18
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB3_5
# %bb.7:
	movq	24(%rsp), %rdi
	movl	$3608, %edx                     # imm = 0xE18
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB3_8
# %bb.9:
	leaq	16(%rsp), %rdi
	movl	$120, %esi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB3_10
# %bb.11:
	leaq	8(%rsp), %rdi
	movl	$3608, %esi                     # imm = 0xE18
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB3_12
# %bb.13:
	leaq	17(%r12), %r13
	movl	$256, %r8d                      # imm = 0x100
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_15
# %bb.14:
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rdx
	callq	_Z19__device_stub__scanPdS_S_
.LBB3_15:
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB3_16
# %bb.17:
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_19
# %bb.18:
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
	callq	_Z26__device_stub__scan_updatePdS_
.LBB3_19:
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB3_20
# %bb.21:
	movq	8(%rsp), %rsi
	movl	$3608, %edx                     # imm = 0xE18
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB3_22
# %bb.23:
	movq	24(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB3_24
# %bb.25:
	movq	16(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB3_26
# %bb.27:
	movq	8(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB3_28
# %bb.29:
	movsd	(%r15), %xmm0                   # xmm0 = mem[0],zero
	movsd	%xmm0, (%r14)
	movl	$1, %eax
.LBB3_30:                               # =>This Inner Loop Header: Depth=1
	addsd	(%r15,%rax,8), %xmm0
	movsd	%xmm0, (%r14,%rax,8)
	incq	%rax
	cmpq	$451, %rax                      # imm = 0x1C3
	jne	.LBB3_30
# %bb.31:                               # %.preheader.preheader
	xorl	%r15d, %r15d
.LBB3_32:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%r14,%r15,8), %xmm0            # xmm0 = mem[0],zero
	subsd	(%rbx,%r15,8), %xmm0
	movl	$.L.str.3, %edi
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	$451, %r15                      # imm = 0x1C3
	jne	.LBB3_32
# %bb.33:
	addq	$40, %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
.LBB3_5:
	.cfi_def_cfa_offset 96
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$82, %edx
	jmp	.LBB3_6
.LBB3_8:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$83, %edx
	jmp	.LBB3_6
.LBB3_10:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$88, %edx
	jmp	.LBB3_6
.LBB3_12:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$89, %edx
	jmp	.LBB3_6
.LBB3_16:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$92, %edx
	jmp	.LBB3_6
.LBB3_20:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$94, %edx
	jmp	.LBB3_6
.LBB3_22:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$96, %edx
	jmp	.LBB3_6
.LBB3_24:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$97, %edx
	jmp	.LBB3_6
.LBB3_26:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$98, %edx
	jmp	.LBB3_6
.LBB3_28:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$99, %edx
.LBB3_6:
	xorl	%eax, %eax
	callq	printf
	movl	%ebp, %edi
	callq	hipGetErrorString
	movl	$.L.str.2, %edi
	movl	%ebp, %esi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.Lfunc_end3:
	.size	_Z9test_scanv, .Lfunc_end3-_Z9test_scanv
	.cfi_endproc
                                        # -- End function
	.globl	_Z25__device_stub__cal_filterPdS_id # -- Begin function _Z25__device_stub__cal_filterPdS_id
	.type	_Z25__device_stub__cal_filterPdS_id,@function
_Z25__device_stub__cal_filterPdS_id:    # @_Z25__device_stub__cal_filterPdS_id
	.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	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	4(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	24(%rsp), %rdx
	movsd	%xmm0, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z10cal_filterPdS_id, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	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	_Z25__device_stub__cal_filterPdS_id, .Lfunc_end4-_Z25__device_stub__cal_filterPdS_id
	.cfi_endproc
                                        # -- End function
	.globl	_Z25__device_stub__div_filterPdS_ii # -- Begin function _Z25__device_stub__div_filterPdS_ii
	.type	_Z25__device_stub__div_filterPdS_ii,@function
_Z25__device_stub__div_filterPdS_ii:    # @_Z25__device_stub__div_filterPdS_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%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	$_Z10div_filterPdS_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	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_end5:
	.size	_Z25__device_stub__div_filterPdS_ii, .Lfunc_end5-_Z25__device_stub__div_filterPdS_ii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z11test_reducev
.LCPI6_0:
	.quad	0x40e5f90000000000              # double 45000
.LCPI6_1:
	.quad	0x3f65c99e0a181365              # double 0.002659615202676257
.LCPI6_2:
	.quad	0x4062c00000000000              # double 150
	.text
	.globl	_Z11test_reducev
	.type	_Z11test_reducev,@function
_Z11test_reducev:                       # @_Z11test_reducev
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movabsq	$4294967328, %r15               # imm = 0x100000020
	movl	$3608, %edi                     # imm = 0xE18
	callq	_Znam
	movq	%rax, %rbx
	movl	$3608, %edi                     # imm = 0xE18
	callq	_Znam
	movq	%rax, %r14
	leaq	-482(%r15), %r12
	xorpd	%xmm1, %xmm1
	movl	$450, %r13d                     # imm = 0x1C2
	movq	%rax, %rbp
.LBB6_1:                                # =>This Inner Loop Header: Depth=1
	movsd	%xmm1, 24(%rsp)                 # 8-byte Spill
	movl	%r13d, %eax
	imull	%r12d, %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	.LCPI6_0(%rip), %xmm0
	callq	exp
	movsd	24(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	mulsd	.LCPI6_1(%rip), %xmm0
	movsd	%xmm0, (%rbp)
	addsd	%xmm0, %xmm1
	incq	%r12
	addq	$8, %rbp
	addq	$-1, %r13
	jb	.LBB6_1
# %bb.2:
	addsd	%xmm1, %xmm1
	subsd	3600(%r14), %xmm1
	movsd	%xmm1, 32(%rsp)
	xorl	%eax, %eax
.LBB6_3:                                # =>This Inner Loop Header: Depth=1
	movsd	(%r14,%rax,8), %xmm0            # xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%r14,%rax,8)
	incq	%rax
	cmpq	$451, %rax                      # imm = 0x1C3
	jne	.LBB6_3
# %bb.4:
	movl	$.L.str.4, %edi
	movapd	%xmm1, %xmm0
	movb	$1, %al
	callq	printf
	leaq	16(%rsp), %rdi
	movl	$8, %esi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB6_5
# %bb.7:
	leaq	8(%rsp), %rdi
	movl	$3608, %esi                     # imm = 0xE18
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB6_8
# %bb.9:
	leaq	-17(%r15), %rdi
	movl	$256, %r8d                      # imm = 0x100
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_11
# %bb.10:
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
	movsd	.LCPI6_2(%rip), %xmm0           # xmm0 = mem[0],zero
	movl	$450, %edx                      # imm = 0x1C2
	callq	_Z25__device_stub__cal_filterPdS_id
.LBB6_11:
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB6_12
# %bb.13:
	leaq	-30(%r15), %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_15
# %bb.14:
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
	movl	$450, %edx                      # imm = 0x1C2
	movl	$8, %ecx
	callq	_Z25__device_stub__div_filterPdS_ii
.LBB6_15:
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB6_16
# %bb.17:
	movq	8(%rsp), %rsi
	movl	$3608, %edx                     # imm = 0xE18
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB6_18
# %bb.19:
	movq	16(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movl	$8, %edx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB6_20
# %bb.21:
	movq	8(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB6_22
# %bb.23:
	movq	16(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB6_27
# %bb.24:                               # %.preheader.preheader
	xorl	%r15d, %r15d
.LBB6_25:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rbx,%r15,8), %xmm0            # xmm0 = mem[0],zero
	subsd	(%r14,%r15,8), %xmm0
	movl	$.L.str.3, %edi
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	$451, %r15                      # imm = 0x1C3
	jne	.LBB6_25
# %bb.26:
	addq	$40, %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
.LBB6_5:
	.cfi_def_cfa_offset 96
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$176, %edx
	jmp	.LBB6_6
.LBB6_8:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$177, %edx
	jmp	.LBB6_6
.LBB6_12:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$179, %edx
	jmp	.LBB6_6
.LBB6_16:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$181, %edx
	jmp	.LBB6_6
.LBB6_18:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$182, %edx
	jmp	.LBB6_6
.LBB6_20:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$183, %edx
	jmp	.LBB6_6
.LBB6_22:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$184, %edx
	jmp	.LBB6_6
.LBB6_27:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$185, %edx
.LBB6_6:
	xorl	%eax, %eax
	callq	printf
	movl	%ebp, %edi
	callq	hipGetErrorString
	movl	$.L.str.2, %edi
	movl	%ebp, %esi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.Lfunc_end6:
	.size	_Z11test_reducev, .Lfunc_end6-_Z11test_reducev
	.cfi_endproc
                                        # -- End function
	.globl	_Z20__device_stub__conv1PdS_S_S_iii # -- Begin function _Z20__device_stub__conv1PdS_S_S_iii
	.type	_Z20__device_stub__conv1PdS_S_S_iii,@function
_Z20__device_stub__conv1PdS_S_S_iii:    # @_Z20__device_stub__conv1PdS_S_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	$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	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	8(%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	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	$_Z5conv1PdS_S_S_iii, %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_end7:
	.size	_Z20__device_stub__conv1PdS_S_S_iii, .Lfunc_end7-_Z20__device_stub__conv1PdS_S_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z20__device_stub__conv2PdS_S_S_iii # -- Begin function _Z20__device_stub__conv2PdS_S_S_iii
	.type	_Z20__device_stub__conv2PdS_S_S_iii,@function
_Z20__device_stub__conv2PdS_S_S_iii:    # @_Z20__device_stub__conv2PdS_S_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	$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	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	8(%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	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	$_Z5conv2PdS_S_S_iii, %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_end8:
	.size	_Z20__device_stub__conv2PdS_S_S_iii, .Lfunc_end8-_Z20__device_stub__conv2PdS_S_S_iii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z15guassian_smoothPKdPPdiid
.LCPI9_0:
	.quad	0x4008000000000000              # double 3
.LCPI9_1:
	.quad	0x3ff0000000000000              # double 1
.LCPI9_2:
	.quad	0x40040d931ff626b2              # double 2.5066282746309634
	.text
	.globl	_Z15guassian_smoothPKdPPdiid
	.type	_Z15guassian_smoothPKdPPdiid,@function
_Z15guassian_smoothPKdPPdiid:           # @_Z15guassian_smoothPKdPPdiid
	.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	$136, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movsd	%xmm0, 24(%rsp)                 # 8-byte Spill
	movl	%ecx, %r13d
                                        # kill: def $edx killed $edx def $rdx
	movq	%rsi, %rbx
	movq	%rdi, 112(%rsp)                 # 8-byte Spill
	movl	%ecx, %eax
	movq	%rdx, 16(%rsp)                  # 8-byte Spill
	imull	%edx, %eax
	leaq	(,%rax,8), %rdi
	testl	%eax, %eax
	movq	$-1, %r14
	cmovsq	%r14, %rdi
	callq	_Znam
	movsd	.LCPI9_0(%rip), %xmm0           # xmm0 = mem[0],zero
	mulsd	24(%rsp), %xmm0                 # 8-byte Folded Reload
	addsd	%xmm0, %xmm0
	addsd	.LCPI9_1(%rip), %xmm0
	cvttsd2si	%xmm0, %ecx
	movq	%rax, 104(%rsp)                 # 8-byte Spill
	movq	%rax, (%rbx)
	movl	%ecx, 84(%rsp)                  # 4-byte Spill
	movl	%ecx, %ebp
	sarl	%ebp
	movslq	%ebp, %rax
	cmpl	$-1, %ebp
	leaq	8(,%rax,8), %r12
	cmovgeq	%r12, %r14
	movq	%r14, %rdi
	callq	_Znam
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_Znam
	movq	%rax, %r14
	testl	%ebp, %ebp
	movq	%rbp, 48(%rsp)                  # 8-byte Spill
	js	.LBB9_9
# %bb.1:                                # %.lr.ph
	movq	%r13, 96(%rsp)                  # 8-byte Spill
	leal	1(%rbp), %eax
	movsd	.LCPI9_2(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	24(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	movsd	.LCPI9_1(%rip), %xmm2           # xmm2 = mem[0],zero
	divsd	%xmm0, %xmm2
	movsd	%xmm2, 128(%rsp)                # 8-byte Spill
	movapd	%xmm1, %xmm0
	addsd	%xmm1, %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, 120(%rsp)                # 8-byte Spill
	movl	%ebp, %ecx
	movq	%rcx, 88(%rsp)                  # 8-byte Spill
	movl	%eax, %r15d
	movl	%ebp, %r13d
	negl	%r13d
	xorpd	%xmm1, %xmm1
	xorl	%ebp, %ebp
.LBB9_2:                                # =>This Inner Loop Header: Depth=1
	movsd	%xmm1, 24(%rsp)                 # 8-byte Spill
	leal	(%r13,%rbp), %eax
	imull	%eax, %eax
	negl	%eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	120(%rsp), %xmm0                # 8-byte Folded Reload
	callq	exp
	movsd	24(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	mulsd	128(%rsp), %xmm0                # 8-byte Folded Reload
	movsd	%xmm0, (%rbx,%rbp,8)
	addsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	incq	%rbp
	cmpq	%rbp, %r15
	jne	.LBB9_2
# %bb.3:                                # %._crit_edge
	cmpl	$0, 48(%rsp)                    # 4-byte Folded Reload
	movq	96(%rsp), %r13                  # 8-byte Reload
	js	.LBB9_9
# %bb.4:                                # %.lr.ph187.preheader
	movq	88(%rsp), %rax                  # 8-byte Reload
	subsd	(%rbx,%rax,8), %xmm1
	xorl	%eax, %eax
.LBB9_5:                                # %.lr.ph187
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rbx,%rax,8), %xmm0            # xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx,%rax,8)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB9_5
# %bb.6:                                # %._crit_edge188
	movsd	(%rbx), %xmm0                   # xmm0 = mem[0],zero
	movsd	%xmm0, (%r14)
	cmpl	$2, 84(%rsp)                    # 4-byte Folded Reload
	jb	.LBB9_10
# %bb.7:                                # %.lr.ph192.preheader
	movsd	(%r14), %xmm0                   # xmm0 = mem[0],zero
	movl	$1, %eax
.LBB9_8:                                # %.lr.ph192
                                        # =>This Inner Loop Header: Depth=1
	addsd	(%rbx,%rax,8), %xmm0
	movsd	%xmm0, (%r14,%rax,8)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB9_8
	jmp	.LBB9_10
.LBB9_9:                                # %._crit_edge188.thread
	movsd	(%rbx), %xmm0                   # xmm0 = mem[0],zero
	movsd	%xmm0, (%r14)
.LBB9_10:                               # %._crit_edge193
	movslq	16(%rsp), %rax                  # 4-byte Folded Reload
	movslq	%r13d, %rbp
	imulq	%rax, %rbp
	shlq	$3, %rbp
	leaq	72(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB9_11
# %bb.14:
	leaq	64(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB9_15
# %bb.16:
	leaq	40(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB9_17
# %bb.18:
	leaq	32(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB9_19
# %bb.20:
	leaq	56(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB9_21
# %bb.22:
	movq	64(%rsp), %rdi
	movq	112(%rsp), %rsi                 # 8-byte Reload
	movq	%rbp, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB9_23
# %bb.24:
	movq	40(%rsp), %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB9_25
# %bb.26:
	movq	32(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB9_27
# %bb.28:
	movabsq	$34359738372, %rdx              # imm = 0x800000004
	movq	16(%rsp), %rsi                  # 8-byte Reload
	movl	%esi, %eax
	andl	$3, %eax
	leal	3(%rsi), %ecx
	testl	%esi, %esi
	cmovnsl	%esi, %ecx
	sarl	$2, %ecx
	cmpl	$1, %eax
	sbbl	$-1, %ecx
	movl	%r13d, %eax
	andl	$7, %eax
	leal	7(%r13), %r12d
	testl	%r13d, %r13d
	cmovnsl	%r13d, %r12d
	sarl	$3, %r12d
	cmpl	$1, %eax
	sbbl	$-1, %r12d
	shlq	$32, %r12
	orq	%rcx, %r12
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB9_30
# %bb.29:
	movq	64(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	72(%rsp), %rcx
	movq	48(%rsp), %rax                  # 8-byte Reload
	movl	%eax, (%rsp)
	movq	16(%rsp), %r8                   # 8-byte Reload
                                        # kill: def $r8d killed $r8d killed $r8
	movl	%r13d, %r9d
	callq	_Z20__device_stub__conv1PdS_S_S_iii
.LBB9_30:
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB9_31
# %bb.32:
	movq	%r12, %rdi
	movl	$1, %esi
	movabsq	$34359738372, %rdx              # imm = 0x800000004
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB9_34
# %bb.33:
	movq	72(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	56(%rsp), %rcx
	movq	48(%rsp), %rax                  # 8-byte Reload
	movl	%eax, (%rsp)
	movq	16(%rsp), %r8                   # 8-byte Reload
                                        # kill: def $r8d killed $r8d killed $r8
	movl	%r13d, %r9d
	callq	_Z20__device_stub__conv2PdS_S_S_iii
.LBB9_34:
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB9_35
# %bb.36:
	movq	56(%rsp), %rsi
	movq	104(%rsp), %rdi                 # 8-byte Reload
	movq	%rbp, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB9_37
# %bb.39:
	movq	72(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB9_40
# %bb.41:
	movq	64(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB9_42
# %bb.43:
	movq	40(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB9_44
# %bb.45:
	movq	32(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB9_46
# %bb.47:
	movq	56(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB9_48
# %bb.49:
	movq	%rbx, %rdi
	callq	_ZdaPv
	movq	%r14, %rdi
	callq	_ZdaPv
	addq	$136, %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
.LBB9_11:
	.cfi_def_cfa_offset 192
	movl	%eax, %r15d
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$277, %edx                      # imm = 0x115
	jmp	.LBB9_12
.LBB9_15:
	movl	%eax, %r15d
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$278, %edx                      # imm = 0x116
	jmp	.LBB9_12
.LBB9_17:
	movl	%eax, %r15d
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$279, %edx                      # imm = 0x117
	jmp	.LBB9_12
.LBB9_19:
	movl	%eax, %r15d
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$280, %edx                      # imm = 0x118
	jmp	.LBB9_12
.LBB9_21:
	movl	%eax, %r15d
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$281, %edx                      # imm = 0x119
	jmp	.LBB9_12
.LBB9_23:
	movl	%eax, %r15d
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$282, %edx                      # imm = 0x11A
	jmp	.LBB9_12
.LBB9_25:
	movl	%eax, %r15d
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$283, %edx                      # imm = 0x11B
	jmp	.LBB9_12
.LBB9_27:
	movl	%eax, %r15d
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$284, %edx                      # imm = 0x11C
	jmp	.LBB9_12
.LBB9_31:
	movl	%eax, %r15d
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$291, %edx                      # imm = 0x123
	jmp	.LBB9_12
.LBB9_35:
	movl	%eax, %r15d
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$294, %edx                      # imm = 0x126
.LBB9_12:
	xorl	%eax, %eax
	callq	printf
	movl	%r15d, %edi
	callq	hipGetErrorString
	movl	$.L.str.2, %edi
	movl	%r15d, %esi
	jmp	.LBB9_13
.LBB9_37:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$295, %edx                      # imm = 0x127
	jmp	.LBB9_38
.LBB9_40:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$296, %edx                      # imm = 0x128
	jmp	.LBB9_38
.LBB9_42:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$297, %edx                      # imm = 0x129
	jmp	.LBB9_38
.LBB9_44:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$298, %edx                      # imm = 0x12A
	jmp	.LBB9_38
.LBB9_46:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$299, %edx                      # imm = 0x12B
	jmp	.LBB9_38
.LBB9_48:
	movl	%eax, %ebp
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	movl	$300, %edx                      # imm = 0x12C
.LBB9_38:
	xorl	%eax, %eax
	callq	printf
	movl	%ebp, %edi
	callq	hipGetErrorString
	movl	$.L.str.2, %edi
	movl	%ebp, %esi
.LBB9_13:
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.Lfunc_end9:
	.size	_Z15guassian_smoothPKdPPdiid, .Lfunc_end9-_Z15guassian_smoothPKdPPdiid
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z19cpu_guassian_smoothPKdPPdiid
.LCPI10_0:
	.quad	0x4008000000000000              # double 3
.LCPI10_1:
	.quad	0x3ff0000000000000              # double 1
.LCPI10_2:
	.quad	0x40040d931ff626b2              # double 2.5066282746309634
	.text
	.globl	_Z19cpu_guassian_smoothPKdPPdiid
	.type	_Z19cpu_guassian_smoothPKdPPdiid,@function
_Z19cpu_guassian_smoothPKdPPdiid:       # @_Z19cpu_guassian_smoothPKdPPdiid
	.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	$104, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movsd	%xmm0, 32(%rsp)                 # 8-byte Spill
	movl	%ecx, %ebp
                                        # kill: def $edx killed $edx def $rdx
	movq	%rsi, %r15
	movq	%rdi, 80(%rsp)                  # 8-byte Spill
	movl	%ecx, %eax
	movq	%rdx, 64(%rsp)                  # 8-byte Spill
	imull	%edx, %eax
	leaq	(,%rax,8), %rdi
	testl	%eax, %eax
	movq	$-1, %r14
	cmovsq	%r14, %rdi
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	callq	_Znam
	movsd	.LCPI10_0(%rip), %xmm0          # xmm0 = mem[0],zero
	mulsd	32(%rsp), %xmm0                 # 8-byte Folded Reload
	addsd	%xmm0, %xmm0
	addsd	.LCPI10_1(%rip), %xmm0
	cvttsd2si	%xmm0, %ecx
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movq	%rax, (%r15)
	movl	%ecx, 56(%rsp)                  # 4-byte Spill
	movl	%ecx, %r13d
	sarl	%r13d
	movslq	%r13d, %rbx
	cmpl	$-1, %r13d
	leaq	8(,%rbx,8), %r12
	cmovlq	%r14, %r12
	movq	%r12, %rdi
	callq	_Znam
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_Znam
	testl	%r13d, %r13d
	movq	%rbp, 48(%rsp)                  # 8-byte Spill
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	js	.LBB10_1
# %bb.4:                                # %.lr.ph
	leal	1(%r13), %eax
	movsd	.LCPI10_2(%rip), %xmm0          # xmm0 = mem[0],zero
	movsd	32(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	movsd	.LCPI10_1(%rip), %xmm2          # xmm2 = mem[0],zero
	divsd	%xmm0, %xmm2
	movsd	%xmm2, 24(%rsp)                 # 8-byte Spill
	movapd	%xmm1, %xmm0
	addsd	%xmm1, %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, 16(%rsp)                 # 8-byte Spill
	movl	%r13d, %ebx
	movl	%eax, %ebp
	movl	%r13d, %r14d
	negl	%r14d
	xorpd	%xmm1, %xmm1
	xorl	%r12d, %r12d
.LBB10_5:                               # =>This Inner Loop Header: Depth=1
	movsd	%xmm1, 32(%rsp)                 # 8-byte Spill
	leal	(%r14,%r12), %eax
	imull	%eax, %eax
	negl	%eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	16(%rsp), %xmm0                 # 8-byte Folded Reload
	callq	exp
	movsd	32(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	mulsd	24(%rsp), %xmm0                 # 8-byte Folded Reload
	movsd	%xmm0, (%r15,%r12,8)
	addsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	incq	%r12
	cmpq	%r12, %rbp
	jne	.LBB10_5
# %bb.2:                                # %._crit_edge
	testl	%r13d, %r13d
	js	.LBB10_3
# %bb.14:                               # %.lr.ph199.preheader
	subsd	(%r15,%rbx,8), %xmm1
	xorl	%eax, %eax
	movq	40(%rsp), %rcx                  # 8-byte Reload
	movq	8(%rsp), %rdi                   # 8-byte Reload
.LBB10_15:                              # %.lr.ph199
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%r15,%rax,8), %xmm0            # xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%r15,%rax,8)
	incq	%rax
	cmpq	%rax, %rbp
	jne	.LBB10_15
# %bb.6:                                # %._crit_edge200
	movsd	(%r15), %xmm0                   # xmm0 = mem[0],zero
	movsd	%xmm0, (%rcx)
	cmpl	$2, 56(%rsp)                    # 4-byte Folded Reload
	jb	.LBB10_7
# %bb.16:                               # %.lr.ph204.preheader
	movsd	(%rcx), %xmm0                   # xmm0 = mem[0],zero
	movl	$1, %eax
.LBB10_17:                              # %.lr.ph204
                                        # =>This Inner Loop Header: Depth=1
	addsd	(%r15,%rax,8), %xmm0
	movsd	%xmm0, (%rcx,%rax,8)
	incq	%rax
	cmpq	%rax, %rbp
	jne	.LBB10_17
.LBB10_7:
	movq	48(%rsp), %rbp                  # 8-byte Reload
	jmp	.LBB10_8
.LBB10_3:
	movq	48(%rsp), %rbp                  # 8-byte Reload
	movq	40(%rsp), %rax                  # 8-byte Reload
.LBB10_1:                               # %._crit_edge.thread
	movq	8(%rsp), %rdi                   # 8-byte Reload
	movsd	(%r15), %xmm0                   # xmm0 = mem[0],zero
	movsd	%xmm0, (%rax)
.LBB10_8:                               # %._crit_edge205
	callq	_Znam
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movl	%ebp, %eax
	movl	64(%rsp), %ecx                  # 4-byte Reload
	movq	%rcx, 32(%rsp)                  # 8-byte Spill
	testl	%ebp, %ebp
	jle	.LBB10_18
# %bb.9:                                # %.preheader192.lr.ph
	movq	64(%rsp), %rdx                  # 8-byte Reload
	leal	-1(%rdx), %ecx
	movl	%ecx, 8(%rsp)                   # 4-byte Spill
	imull	48(%rsp), %ecx                  # 4-byte Folded Reload
	movl	%r13d, %esi
	negl	%esi
	movl	%esi, 76(%rsp)                  # 4-byte Spill
	movslq	%edx, %r12
	movslq	%ecx, %rcx
	movq	80(%rsp), %rdx                  # 8-byte Reload
	leaq	(%rdx,%rcx,8), %rcx
	movq	%rcx, 56(%rsp)                  # 8-byte Spill
	leaq	(,%rax,8), %rcx
	xorl	%r10d, %r10d
	xorpd	%xmm0, %xmm0
	movq	%rdx, 16(%rsp)                  # 8-byte Spill
	movq	%rbx, 96(%rsp)                  # 8-byte Spill
.LBB10_10:                              # %.preheader192
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_12 Depth 2
                                        #       Child Loop BB10_29 Depth 3
	cmpl	$0, 64(%rsp)                    # 4-byte Folded Reload
	jle	.LBB10_32
# %bb.11:                               # %.lr.ph212
                                        #   in Loop: Header=BB10_10 Depth=1
	movq	24(%rsp), %rdx                  # 8-byte Reload
	leaq	(%rdx,%r10,8), %rsi
	xorl	%ebp, %ebp
	movl	76(%rsp), %r14d                 # 4-byte Reload
.LBB10_12:                              #   Parent Loop BB10_10 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB10_29 Depth 3
	testl	%r14d, %r14d
	movl	$0, %r8d
	cmovgl	%r14d, %r8d
	movq	%rbp, %rdx
	imulq	%rax, %rdx
	movq	$0, (%rsi,%rdx,8)
	movq	%rbp, %r9
	subq	%rbx, %r9
	js	.LBB10_24
# %bb.13:                               #   in Loop: Header=BB10_12 Depth=2
	xorpd	%xmm1, %xmm1
	jmp	.LBB10_25
.LBB10_24:                              #   in Loop: Header=BB10_12 Depth=2
	movl	%ebp, %edi
	notl	%edi
	addl	%r13d, %edi
	movslq	%edi, %rdi
	movq	40(%rsp), %r9                   # 8-byte Reload
	movsd	(%r9,%rdi,8), %xmm1             # xmm1 = mem[0],zero
	movq	80(%rsp), %rdi                  # 8-byte Reload
	mulsd	(%rdi,%r10,8), %xmm1
	addsd	%xmm0, %xmm1
	movsd	%xmm1, (%rsi,%rdx,8)
	xorl	%r9d, %r9d
.LBB10_25:                              #   in Loop: Header=BB10_12 Depth=2
	leaq	(%rbx,%rbp), %rdi
	movq	%rdi, %r11
	subq	%r12, %r11
	jl	.LBB10_27
# %bb.26:                               #   in Loop: Header=BB10_12 Depth=2
	movq	40(%rsp), %rdi                  # 8-byte Reload
	movsd	(%rdi,%r11,8), %xmm2            # xmm2 = mem[0],zero
	movq	56(%rsp), %rdi                  # 8-byte Reload
	mulsd	(%rdi,%r10,8), %xmm2
	addsd	%xmm2, %xmm1
	movsd	%xmm1, (%rsi,%rdx,8)
	movl	8(%rsp), %edi                   # 4-byte Reload
                                        # kill: def $edi killed $edi def $rdi
.LBB10_27:                              #   in Loop: Header=BB10_12 Depth=2
	cmpl	%edi, %r9d
	jg	.LBB10_31
# %bb.28:                               # %.lr.ph209
                                        #   in Loop: Header=BB10_12 Depth=2
	movq	%r10, %rbx
	movq	%rax, %r10
	movq	%r12, %rax
	movq	%rcx, %r9
	imulq	%r8, %r9
	leaq	-1(%r8), %r12
	addq	16(%rsp), %r9                   # 8-byte Folded Reload
	movl	%ebp, %r11d
	subl	%r8d, %r11d
	movslq	%edi, %r8
.LBB10_29:                              #   Parent Loop BB10_10 Depth=1
                                        #     Parent Loop BB10_12 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	%r11d, %edi
	negl	%edi
	cmovnsl	%r11d, %edi
	addl	%r13d, %edi
	movslq	%edi, %rdi
	movsd	(%r15,%rdi,8), %xmm2            # xmm2 = mem[0],zero
	mulsd	(%r9), %xmm2
	addsd	%xmm2, %xmm1
	incq	%r12
	addq	%rcx, %r9
	decl	%r11d
	cmpq	%r8, %r12
	jl	.LBB10_29
# %bb.30:                               # %._crit_edge210
                                        #   in Loop: Header=BB10_12 Depth=2
	movsd	%xmm1, (%rsi,%rdx,8)
	movq	%rax, %r12
	movq	%r10, %rax
	movq	%rbx, %r10
	movq	96(%rsp), %rbx                  # 8-byte Reload
.LBB10_31:                              #   in Loop: Header=BB10_12 Depth=2
	incq	%rbp
	incl	%r14d
	cmpq	32(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB10_12
.LBB10_32:                              # %._crit_edge213
                                        #   in Loop: Header=BB10_10 Depth=1
	incq	%r10
	addq	$8, 16(%rsp)                    # 8-byte Folded Spill
	cmpq	%rax, %r10
	jne	.LBB10_10
.LBB10_18:                              # %.preheader191
	cmpl	$0, 64(%rsp)                    # 4-byte Folded Reload
	movq	48(%rsp), %rcx                  # 8-byte Reload
	jle	.LBB10_42
# %bb.19:                               # %.preheader.lr.ph
	leal	-1(%rcx), %edx
	movl	%r13d, %esi
	negl	%esi
	movl	%esi, 56(%rsp)                  # 4-byte Spill
	movslq	%ecx, %rdi
	xorl	%esi, %esi
	movq	%rsi, 16(%rsp)                  # 8-byte Spill
	xorpd	%xmm0, %xmm0
	xorl	%esi, %esi
	movq	%rsi, 8(%rsp)                   # 8-byte Spill
.LBB10_20:                              # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_22 Depth 2
                                        #       Child Loop BB10_38 Depth 3
	testl	%ecx, %ecx
	jle	.LBB10_41
# %bb.21:                               # %.lr.ph223
                                        #   in Loop: Header=BB10_20 Depth=1
	movl	16(%rsp), %ecx                  # 4-byte Reload
	movq	24(%rsp), %rsi                  # 8-byte Reload
	leaq	(%rsi,%rcx,8), %r10
	movq	8(%rsp), %r11                   # 8-byte Reload
	imulq	%rdi, %r11
	movq	88(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%r11,8), %r14
	xorl	%ebp, %ebp
	movl	56(%rsp), %esi                  # 4-byte Reload
.LBB10_22:                              #   Parent Loop BB10_20 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB10_38 Depth 3
	testl	%esi, %esi
	movl	$0, %r8d
	cmovgl	%esi, %r8d
	movq	$0, (%r14,%rbp,8)
	movq	%rbp, %rcx
	subq	%rbx, %rcx
	js	.LBB10_33
# %bb.23:                               #   in Loop: Header=BB10_22 Depth=2
	xorpd	%xmm1, %xmm1
	jmp	.LBB10_34
.LBB10_33:                              #   in Loop: Header=BB10_22 Depth=2
	movl	%ebp, %ecx
	notl	%ecx
	addl	%r13d, %ecx
	movslq	%ecx, %rcx
	movq	40(%rsp), %r9                   # 8-byte Reload
	movsd	(%r9,%rcx,8), %xmm1             # xmm1 = mem[0],zero
	movq	24(%rsp), %rcx                  # 8-byte Reload
	mulsd	(%rcx,%r11,8), %xmm1
	addsd	%xmm0, %xmm1
	movsd	%xmm1, (%r14,%rbp,8)
	xorl	%ecx, %ecx
.LBB10_34:                              #   in Loop: Header=BB10_22 Depth=2
	leaq	(%rbx,%rbp), %r9
	movq	%r9, %r12
	subq	%rdi, %r12
	jl	.LBB10_36
# %bb.35:                               #   in Loop: Header=BB10_22 Depth=2
	movq	40(%rsp), %r9                   # 8-byte Reload
	movsd	(%r9,%r12,8), %xmm2             # xmm2 = mem[0],zero
	movq	24(%rsp), %r9                   # 8-byte Reload
	mulsd	(%r9,%r11,8), %xmm2
	addsd	%xmm2, %xmm1
	movsd	%xmm1, (%r14,%rbp,8)
	movl	%edx, %r9d
.LBB10_36:                              #   in Loop: Header=BB10_22 Depth=2
	cmpl	%r9d, %ecx
	jg	.LBB10_40
# %bb.37:                               # %.lr.ph218
                                        #   in Loop: Header=BB10_22 Depth=2
	leaq	-1(%r8), %rcx
	movl	%ebp, %r12d
	subl	%r8d, %r12d
	movslq	%r9d, %r8
.LBB10_38:                              #   Parent Loop BB10_20 Depth=1
                                        #     Parent Loop BB10_22 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	%r12d, %r9d
	negl	%r9d
	cmovnsl	%r12d, %r9d
	addl	%r13d, %r9d
	movslq	%r9d, %r9
	movsd	(%r15,%r9,8), %xmm2             # xmm2 = mem[0],zero
	mulsd	8(%r10,%rcx,8), %xmm2
	addsd	%xmm2, %xmm1
	incq	%rcx
	decl	%r12d
	cmpq	%r8, %rcx
	jl	.LBB10_38
# %bb.39:                               # %._crit_edge219
                                        #   in Loop: Header=BB10_22 Depth=2
	movsd	%xmm1, (%r14,%rbp,8)
.LBB10_40:                              #   in Loop: Header=BB10_22 Depth=2
	incq	%rbp
	incl	%esi
	cmpq	%rax, %rbp
	jne	.LBB10_22
.LBB10_41:                              # %._crit_edge224
                                        #   in Loop: Header=BB10_20 Depth=1
	movq	8(%rsp), %r8                    # 8-byte Reload
	incq	%r8
	movq	48(%rsp), %rcx                  # 8-byte Reload
	movq	16(%rsp), %rsi                  # 8-byte Reload
	addl	%ecx, %esi
	movq	%rsi, 16(%rsp)                  # 8-byte Spill
	movq	%r8, %rsi
	movq	%r8, 8(%rsp)                    # 8-byte Spill
	cmpq	32(%rsp), %r8                   # 8-byte Folded Reload
	jne	.LBB10_20
.LBB10_42:                              # %._crit_edge226
	movq	%r15, %rdi
	callq	_ZdaPv
	movq	40(%rsp), %rdi                  # 8-byte Reload
	callq	_ZdaPv
	movq	24(%rsp), %rdi                  # 8-byte Reload
	addq	$104, %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
	jmp	_ZdaPv                          # TAILCALL
.Lfunc_end10:
	.size	_Z19cpu_guassian_smoothPKdPPdiid, .Lfunc_end10-_Z19cpu_guassian_smoothPKdPPdiid
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z8get_timev
.LCPI11_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	_Z8get_timev
	.type	_Z8get_timev,@function
_Z8get_timev:                           # @_Z8get_timev
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -16
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	cvtsi2sdq	(%rbx), %xmm1
	cvtsi2sdq	8(%rbx), %xmm0
	divsd	.LCPI11_0(%rip), %xmm0
	addsd	%xmm1, %xmm0
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_Z8get_timev, .Lfunc_end11-_Z8get_timev
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z13test_guassianv
.LCPI12_0:
	.quad	0x3fe0000000000000              # double 0.5
.LCPI12_1:
	.quad	0x412e848000000000              # double 1.0E+6
.LCPI12_2:
	.quad	0x404bc00000000000              # double 55.5
	.text
	.globl	_Z13test_guassianv
	.type	_Z13test_guassianv,@function
_Z13test_guassianv:                     # @_Z13test_guassianv
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	$7267392, %edi                  # imm = 0x6EE440
	callq	_Znam
	movq	%rax, %rbx
	xorl	%eax, %eax
	movsd	.LCPI12_0(%rip), %xmm0          # xmm0 = mem[0],zero
.LBB12_1:                               # =>This Inner Loop Header: Depth=1
	leaq	1(%rax), %rcx
	xorps	%xmm1, %xmm1
	cvtsi2sd	%ecx, %xmm1
	mulsd	%xmm0, %xmm1
	movsd	%xmm1, (%rbx,%rax,8)
	movq	%rcx, %rax
	cmpq	$908424, %rcx                   # imm = 0xDDC88
	jne	.LBB12_1
# %bb.2:
	leaq	24(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	xorps	%xmm0, %xmm0
	cvtsi2sdq	(%r14), %xmm0
	xorps	%xmm1, %xmm1
	cvtsi2sdq	8(%r14), %xmm1
	divsd	.LCPI12_1(%rip), %xmm1
	addsd	%xmm0, %xmm1
	movsd	%xmm1, 16(%rsp)                 # 8-byte Spill
	leaq	48(%rsp), %rsi
	movsd	.LCPI12_2(%rip), %xmm0          # xmm0 = mem[0],zero
	movq	%rbx, %rdi
	movl	$1023, %edx                     # imm = 0x3FF
	movl	$888, %ecx                      # imm = 0x378
	callq	_Z19cpu_guassian_smoothPKdPPdiid
	leaq	24(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	xorps	%xmm0, %xmm0
	cvtsi2sdq	(%r14), %xmm0
	xorps	%xmm1, %xmm1
	cvtsi2sdq	8(%r14), %xmm1
	divsd	.LCPI12_1(%rip), %xmm1
	addsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)                  # 8-byte Spill
	leaq	40(%rsp), %rsi
	movq	%rbx, %rdi
	movl	$1023, %edx                     # imm = 0x3FF
	movl	$888, %ecx                      # imm = 0x378
	movsd	.LCPI12_2(%rip), %xmm0          # xmm0 = mem[0],zero
	callq	_Z15guassian_smoothPKdPPdiid
	leaq	24(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	xorps	%xmm0, %xmm0
	cvtsi2sdq	(%rbx), %xmm0
	xorps	%xmm1, %xmm1
	cvtsi2sdq	8(%rbx), %xmm1
	divsd	.LCPI12_1(%rip), %xmm1
	addsd	%xmm0, %xmm1
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	subsd	%xmm0, %xmm1
	subsd	16(%rsp), %xmm0                 # 8-byte Folded Reload
	movl	$.L.str.5, %edi
	movb	$2, %al
	addq	$56, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.Lfunc_end12:
	.size	_Z13test_guassianv, .Lfunc_end12-_Z13test_guassianv
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	_Z13test_guassianv
	xorl	%eax, %eax
	popq	%rcx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end13:
	.size	main, .Lfunc_end13-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:
	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	.LBB14_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB14_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z4scanPdS_S_, %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	$_Z11scan_updatePdS_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z10cal_filterPdS_id, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z10div_filterPdS_ii, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z5conv1PdS_S_S_iii, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z5conv2PdS_S_S_iii, %esi
	movl	$.L__unnamed_6, %edx
	movl	$.L__unnamed_6, %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_end14:
	.size	__hip_module_ctor, .Lfunc_end14-__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	.LBB15_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
.LBB15_2:
	retq
.Lfunc_end15:
	.size	__hip_module_dtor, .Lfunc_end15-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z4scanPdS_S_,@object           # @_Z4scanPdS_S_
	.section	.rodata,"a",@progbits
	.globl	_Z4scanPdS_S_
	.p2align	3, 0x0
_Z4scanPdS_S_:
	.quad	_Z19__device_stub__scanPdS_S_
	.size	_Z4scanPdS_S_, 8

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Error: %s:%d, "
	.size	.L.str, 15

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/He-Ze/SIFT-on-GPU-and-its-optimization/main/src/test_scan.hip"
	.size	.L.str.1, 124

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"code:%d, reason: %s \n"
	.size	.L.str.2, 22

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"%lf "
	.size	.L.str.3, 5

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

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

	.type	.L.str.4,@object                # @.str.4
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.4:
	.asciz	"[%lf]"
	.size	.L.str.4, 6

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

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

	.type	.L.str.5,@object                # @.str.5
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.5:
	.asciz	"%lf,%lf\n"
	.size	.L.str.5, 9

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z4scanPdS_S_"
	.size	.L__unnamed_1, 14

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z11scan_updatePdS_"
	.size	.L__unnamed_2, 20

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z10cal_filterPdS_id"
	.size	.L__unnamed_3, 21

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z10div_filterPdS_ii"
	.size	.L__unnamed_4, 21

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z5conv1PdS_S_S_iii"
	.size	.L__unnamed_5, 20

	.type	.L__unnamed_6,@object           # @5
.L__unnamed_6:
	.asciz	"_Z5conv2PdS_S_S_iii"
	.size	.L__unnamed_6, 20

	.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__scanPdS_S_
	.addrsig_sym _Z26__device_stub__scan_updatePdS_
	.addrsig_sym _Z25__device_stub__cal_filterPdS_id
	.addrsig_sym _Z25__device_stub__div_filterPdS_ii
	.addrsig_sym _Z20__device_stub__conv1PdS_S_S_iii
	.addrsig_sym _Z20__device_stub__conv2PdS_S_S_iii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z4scanPdS_S_
	.addrsig_sym _Z11scan_updatePdS_
	.addrsig_sym _Z10cal_filterPdS_id
	.addrsig_sym _Z10div_filterPdS_ii
	.addrsig_sym _Z5conv1PdS_S_S_iii
	.addrsig_sym _Z5conv2PdS_S_S_iii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z4scanPdS_S_           ; -- Begin function _Z4scanPdS_S_
	.globl	_Z4scanPdS_S_
	.p2align	8
	.type	_Z4scanPdS_S_,@function
_Z4scanPdS_S_:                          ; @_Z4scanPdS_S_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b64 s[4:5], s[0:1], 0x10
	v_lshl_add_u32 v5, v0, 3, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_cmp_lt_u32 s2, 2
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[1:2], 3, v[1:2]
	v_add_co_u32 v3, vcc_lo, s4, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v4, vcc_lo, s5, v2, vcc_lo
	global_load_b64 v[3:4], v[3:4], off
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b32 s8, s[0:1], 0x18
	s_waitcnt vmcnt(0)
	ds_store_b64 v5, v[3:4]
	s_cbranch_scc1 .LBB0_5
; %bb.1:                                ; %.lr.ph.preheader
	s_mov_b32 s0, 1
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v4, 0
	s_mov_b32 s1, exec_lo
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_cmpx_le_u32_e64 s0, v0
	s_cbranch_execz .LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	v_subrev_nc_u32_e32 v3, s0, v0
	s_delay_alu instid0(VALU_DEP_1)
	v_lshl_add_u32 v3, v3, 3, 0
	ds_load_b64 v[3:4], v3
.LBB0_4:                                ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	ds_load_b64 v[6:7], v5
	s_lshl_b32 s0, s0, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_ge_u32 s0, s2
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[3:4], v[3:4], v[6:7]
	ds_store_b64 v5, v[3:4]
	s_cbranch_scc0 .LBB0_2
.LBB0_5:                                ; %._crit_edge
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v1, vcc_lo, s4, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s5, v2, vcc_lo
	s_mov_b32 s0, exec_lo
	global_store_b64 v[1:2], v[3:4], off
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB0_12
; %bb.6:                                ; %.preheader
	s_add_i32 s0, s15, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_ge_u32 s0, s8
	s_cbranch_scc1 .LBB0_12
; %bb.7:                                ; %.lr.ph21
	s_lshl_b32 s1, s2, 3
	v_mov_b32_e32 v8, 0
	s_add_i32 s1, s1, 0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s1, s1, -8
	v_mov_b32_e32 v0, s1
	ds_load_b64 v[4:5], v0
.LBB0_8:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	s_mov_b32 s5, exec_lo
	s_mov_b32 s4, exec_lo
	v_mbcnt_lo_u32_b32 v0, s5, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	s_ashr_i32 s1, s0, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[2:3], s[0:1], 3
	s_add_u32 s2, s6, s2
	s_addc_u32 s3, s7, s3
	s_bcnt1_i32_b32 s1, s5
	global_load_b64 v[2:3], v8, s[2:3]
	v_cvt_f64_u32_e32 v[0:1], s1
	s_mov_b32 s1, 0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_mul_f64 v[6:7], v[4:5], v[0:1]
.LBB0_10:                               ; %atomicrmw.start
                                        ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f64 v[0:1], v[2:3], v[6:7]
	global_atomic_cmpswap_b64 v[0:1], v8, v[0:3], s[2:3] glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[2:3]
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
	s_or_b32 s1, vcc_lo, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB0_10
.LBB0_11:                               ; %Flow30
                                        ;   in Loop: Header=BB0_8 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
	s_add_i32 s0, s0, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lt_u32 s0, s8
	s_cbranch_scc1 .LBB0_8
.LBB0_12:                               ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z4scanPdS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.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 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_end0:
	.size	_Z4scanPdS_S_, .Lfunc_end0-_Z4scanPdS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 520
; 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: 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
	.protected	_Z11scan_updatePdS_     ; -- Begin function _Z11scan_updatePdS_
	.globl	_Z11scan_updatePdS_
	.p2align	8
	.type	_Z11scan_updatePdS_,@function
_Z11scan_updatePdS_:                    ; @_Z11scan_updatePdS_
; %bb.0:
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b32 s0, s[0:1], 0x1c
	s_mov_b32 s2, s15
	s_mov_b32 s3, 0
	s_mov_b32 s1, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB1_2
; %bb.1:
	s_lshl_b64 s[8:9], s[2:3], 3
	s_waitcnt lgkmcnt(0)
	s_add_u32 s6, s6, s8
	s_addc_u32 s7, s7, s9
	s_load_b64 s[6:7], s[6:7], 0x0
	v_mov_b32_e32 v3, 0
	s_waitcnt lgkmcnt(0)
	v_dual_mov_b32 v1, s6 :: v_dual_mov_b32 v2, s7
	ds_store_b64 v3, v[1:2]
.LBB1_2:
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt lgkmcnt(0)
	s_and_b32 s0, 0xffff, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mad_u64_u32 v[1:2], null, s2, s0, v[0:1]
	s_barrier
	buffer_gl0_inv
	v_mov_b32_e32 v4, 0
	v_ashrrev_i32_e32 v2, 31, v1
	ds_load_b64 v[4:5], v4
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	global_load_b64 v[2:3], v[0:1], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_add_f64 v[2:3], v[4:5], v[2:3]
	global_store_b64 v[0:1], v[2:3], off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11scan_updatePdS_
		.amdhsa_group_segment_fixed_size 8
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.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 6
		.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	_Z11scan_updatePdS_, .Lfunc_end1-_Z11scan_updatePdS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 208
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 8 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; 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
	.protected	_Z10cal_filterPdS_id    ; -- Begin function _Z10cal_filterPdS_id
	.globl	_Z10cal_filterPdS_id
	.p2align	8
	.type	_Z10cal_filterPdS_id,@function
_Z10cal_filterPdS_id:                   ; @_Z10cal_filterPdS_id
; %bb.0:
	s_clause 0x2
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b32 s8, s[0:1], 0x10
	s_load_b128 s[4:7], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[4:5], null, s15, s3, v[0:1]
	v_cmp_ge_i32_e64 s2, s8, v4
	v_ashrrev_i32_e32 v5, 31, v4
	s_delay_alu instid0(VALU_DEP_2)
	s_and_saveexec_b32 s9, s2
	s_cbranch_execz .LBB2_2
; %bb.1:
	s_load_b64 s[0:1], s[0:1], 0x18
	v_subrev_nc_u32_e32 v3, s8, v4
	s_mov_b32 s10, 0x1ff626b2
	s_mov_b32 s11, 0x40040d93
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v3, v3, v3
	v_sub_nc_u32_e32 v3, 0, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_f64_i32_e32 v[8:9], v3
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[1:2], s[0:1], s[0:1]
	v_mul_f64 v[6:7], s[0:1], s[10:11]
	s_mov_b32 s10, 0x6a5dcb37
	s_mov_b32 s11, 0x3e5ade15
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[1:2], v[1:2], s[0:1]
	v_div_scale_f64 v[10:11], null, v[6:7], v[6:7], 1.0
	v_div_scale_f64 v[22:23], vcc_lo, 1.0, v[6:7], 1.0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_scale_f64 v[12:13], null, v[1:2], v[1:2], v[8:9]
	v_rcp_f64_e32 v[14:15], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_rcp_f64_e32 v[16:17], v[12:13]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[18:19], -v[10:11], v[14:15], 1.0
	v_fma_f64 v[20:21], -v[12:13], v[16:17], 1.0
	v_fma_f64 v[14:15], v[14:15], v[18:19], v[14:15]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[16:17], v[16:17], v[20:21], v[16:17]
	v_fma_f64 v[18:19], -v[10:11], v[14:15], 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[20:21], -v[12:13], v[16:17], 1.0
	v_fma_f64 v[14:15], v[14:15], v[18:19], v[14:15]
	v_div_scale_f64 v[18:19], s0, v[8:9], v[1:2], v[8:9]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[16:17], v[16:17], v[20:21], v[16:17]
	v_mul_f64 v[20:21], v[22:23], v[14:15]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[24:25], v[18:19], v[16:17]
	v_fma_f64 v[10:11], -v[10:11], v[20:21], v[22:23]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[12:13], -v[12:13], v[24:25], v[18:19]
	v_div_fmas_f64 v[10:11], v[10:11], v[14:15], v[20:21]
	s_mov_b32 vcc_lo, s0
	s_mov_b32 s0, 0x652b82fe
	s_mov_b32 s1, 0x3ff71547
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[12:13], v[12:13], v[16:17], v[24:25]
	v_div_fixup_f64 v[1:2], v[12:13], v[1:2], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_mul_f64 v[8:9], v[1:2], s[0:1]
	s_mov_b32 s0, 0xfefa39ef
	s_mov_b32 s1, 0xbfe62e42
	v_cmp_nlt_f64_e32 vcc_lo, 0x40900000, v[1:2]
	v_rndne_f64_e32 v[8:9], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_fma_f64 v[12:13], v[8:9], s[0:1], v[1:2]
	s_mov_b32 s0, 0x3b39803f
	s_mov_b32 s1, 0xbc7abc9e
	v_cvt_i32_f64_e32 v3, v[8:9]
	v_fma_f64 v[12:13], v[8:9], s[0:1], v[12:13]
	s_mov_b32 s0, 0xfca7ab0c
	s_mov_b32 s1, 0x3e928af3
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[14:15], v[12:13], s[10:11], s[0:1]
	s_mov_b32 s0, 0x623fde64
	s_mov_b32 s1, 0x3ec71dee
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[14:15], v[12:13], v[14:15], s[0:1]
	s_mov_b32 s0, 0x7c89e6b0
	s_mov_b32 s1, 0x3efa0199
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[14:15], v[12:13], v[14:15], s[0:1]
	s_mov_b32 s0, 0x14761f6e
	s_mov_b32 s1, 0x3f2a01a0
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[14:15], v[12:13], v[14:15], s[0:1]
	s_mov_b32 s0, 0x1852b7b0
	s_mov_b32 s1, 0x3f56c16c
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[14:15], v[12:13], v[14:15], s[0:1]
	s_mov_b32 s0, 0x11122322
	s_mov_b32 s1, 0x3f811111
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[14:15], v[12:13], v[14:15], s[0:1]
	s_mov_b32 s0, 0x555502a1
	s_mov_b32 s1, 0x3fa55555
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[14:15], v[12:13], v[14:15], s[0:1]
	s_mov_b32 s0, 0x55555511
	s_mov_b32 s1, 0x3fc55555
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[14:15], v[12:13], v[14:15], s[0:1]
	s_mov_b32 s0, 11
	s_mov_b32 s1, 0x3fe00000
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[14:15], v[12:13], v[14:15], s[0:1]
	v_cmp_ngt_f64_e64 s0, 0xc090cc00, v[1:2]
	v_div_fixup_f64 v[1:2], v[10:11], v[6:7], 1.0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[14:15], v[12:13], v[14:15], 1.0
	v_fma_f64 v[8:9], v[12:13], v[14:15], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f64 v[8:9], v[8:9], v3
	v_cndmask_b32_e32 v3, 0x7ff00000, v9, vcc_lo
	s_and_b32 vcc_lo, s0, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v6, 0, v8, vcc_lo
	v_cndmask_b32_e64 v7, 0, v3, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mul_f64 v[1:2], v[1:2], v[6:7]
	v_lshlrev_b64 v[6:7], 3, v[4:5]
	v_add_co_u32 v6, vcc_lo, s4, v6
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v7, vcc_lo
	global_store_b64 v[6:7], v[1:2], off
.LBB2_2:
	s_or_b32 exec_lo, exec_lo, s9
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	s_and_saveexec_b32 s0, vcc_lo
	s_cbranch_execz .LBB2_4
; %bb.3:
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_mov_b32_e32 v2, v1
	global_store_b64 v1, v[1:2], s[6:7]
.LBB2_4:
	s_or_b32 exec_lo, exec_lo, s0
	v_mov_b32_e32 v1, 0
	v_mov_b32_e32 v2, 0
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s1, s2
	s_cbranch_execz .LBB2_6
; %bb.5:
	v_lshlrev_b64 v[1:2], 3, v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v1, s0, s4, v1
	v_add_co_ci_u32_e64 v2, s0, s5, v2, s0
	global_load_b64 v[1:2], v[1:2], off
.LBB2_6:
	s_or_b32 exec_lo, exec_lo, s1
	v_lshl_add_u32 v3, v0, 3, 0
	s_cmp_lt_u32 s3, 2
	s_waitcnt vmcnt(0)
	ds_store_b64 v3, v[1:2]
	s_waitcnt lgkmcnt(0)
	s_barrier
.LBB2_7:                                ; =>This Inner Loop Header: Depth=1
	buffer_gl0_inv
	s_cbranch_scc1 .LBB2_11
; %bb.8:                                ; %.lr.ph
                                        ;   in Loop: Header=BB2_7 Depth=1
	s_lshr_b32 s1, s3, 1
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_u32_e64 s1, v0
	s_cbranch_execz .LBB2_10
; %bb.9:                                ;   in Loop: Header=BB2_7 Depth=1
	v_lshl_add_u32 v1, s1, 3, v3
	ds_load_b64 v[1:2], v1
	ds_load_b64 v[5:6], v3
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[1:2], v[1:2], v[5:6]
	ds_store_b64 v3, v[1:2]
.LBB2_10:                               ;   in Loop: Header=BB2_7 Depth=1
	s_or_b32 exec_lo, exec_lo, s2
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_cmp_lt_u32 s3, 4
	s_mov_b32 s3, s1
	s_branch .LBB2_7
.LBB2_11:                               ; %._crit_edge
	s_and_saveexec_b32 s0, vcc_lo
	s_cbranch_execz .LBB2_15
; %bb.12:
	s_mov_b32 s1, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mbcnt_lo_u32_b32 v0, s1, 0
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	s_and_b32 s2, exec_lo, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_mov_b32 exec_lo, s2
	s_cbranch_execz .LBB2_15
; %bb.13:
	v_mov_b32_e32 v7, 0
	s_bcnt1_i32_b32 s1, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	v_cvt_f64_u32_e32 v[5:6], s1
	s_mov_b32 s1, 0
	global_load_b64 v[2:3], v7, s[6:7]
	ds_load_b64 v[0:1], v7
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[0:1], v[0:1], v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_mul_f64 v[5:6], v[0:1], v[5:6]
.LBB2_14:                               ; %atomicrmw.start
                                        ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f64 v[0:1], v[2:3], v[5:6]
	global_atomic_cmpswap_b64 v[0:1], v7, v[0:3], s[6:7] glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[2:3]
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
	s_or_b32 s1, vcc_lo, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB2_14
.LBB2_15:
	s_or_b32 exec_lo, exec_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_mov_b32 s0, exec_lo
	v_cmpx_eq_u32_e64 s8, v4
	s_cbranch_execz .LBB2_19
; %bb.16:
	s_mov_b32 s1, exec_lo
	s_mov_b32 s0, 0
	v_mbcnt_lo_u32_b32 v0, s1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	s_and_b32 s2, exec_lo, vcc_lo
	s_mov_b32 exec_lo, s2
	s_cbranch_execz .LBB2_19
; %bb.17:
	s_ashr_i32 s9, s8, 31
	v_mov_b32_e32 v6, 0
	s_lshl_b64 s[2:3], s[8:9], 3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s2, s4, s2
	s_addc_u32 s3, s5, s3
	s_bcnt1_i32_b32 s1, s1
	s_clause 0x1
	global_load_b64 v[0:1], v6, s[2:3]
	global_load_b64 v[2:3], v6, s[6:7]
	v_cvt_f64_u32_e32 v[4:5], s1
	s_waitcnt vmcnt(1)
	s_delay_alu instid0(VALU_DEP_1)
	v_mul_f64 v[4:5], -v[0:1], v[4:5]
.LBB2_18:                               ; %atomicrmw.start43
                                        ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f64 v[0:1], v[2:3], v[4:5]
	global_atomic_cmpswap_b64 v[0:1], v6, v[0:3], s[6:7] glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[2:3]
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
	s_or_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s0
	s_cbranch_execnz .LBB2_18
.LBB2_19:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z10cal_filterPdS_id
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 26
		.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_end2:
	.size	_Z10cal_filterPdS_id, .Lfunc_end2-_Z10cal_filterPdS_id
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1436
; NumSgprs: 18
; NumVgprs: 26
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 26
; 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
	.protected	_Z10div_filterPdS_ii    ; -- Begin function _Z10div_filterPdS_ii
	.globl	_Z10div_filterPdS_ii
	.p2align	8
	.type	_Z10div_filterPdS_ii,@function
_Z10div_filterPdS_ii:                   ; @_Z10div_filterPdS_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x24
	s_load_b64 s[2:3], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_add_i32 s2, s2, 1
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v0, v1, s3
	v_add_nc_u32_e32 v1, s3, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_min_i32_e32 v3, s2, v1
	s_mov_b32 s2, exec_lo
	v_cmpx_lt_i32_e64 v0, v3
	s_cbranch_execz .LBB3_3
; %bb.1:                                ; %.lr.ph.preheader
	s_load_b128 s[0:3], s[0:1], 0x0
	v_ashrrev_i32_e32 v1, 31, v0
	v_mov_b32_e32 v4, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[1:2], 3, v[0:1]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v1, vcc_lo, s0, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v2, vcc_lo
	s_mov_b32 s1, 0
.LBB3_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[5:6], v4, s[2:3]
	global_load_b64 v[7:8], v[1:2], off
	v_add_nc_u32_e32 v0, 1, v0
	s_waitcnt vmcnt(0)
	v_div_scale_f64 v[9:10], null, v[5:6], v[5:6], v[7:8]
	v_div_scale_f64 v[15:16], vcc_lo, v[7:8], v[5:6], v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[11:12], v[9:10]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[13:14], -v[9:10], v[11:12], 1.0
	v_fma_f64 v[11:12], v[11:12], v[13:14], v[11:12]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[13:14], -v[9:10], v[11:12], 1.0
	v_fma_f64 v[11:12], v[11:12], v[13:14], v[11:12]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[13:14], v[15:16], v[11:12]
	v_fma_f64 v[9:10], -v[9:10], v[13:14], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_div_fmas_f64 v[9:10], v[9:10], v[11:12], v[13:14]
	v_cmp_ge_i32_e32 vcc_lo, v0, v3
	s_or_b32 s1, vcc_lo, s1
	v_div_fixup_f64 v[5:6], v[9:10], v[5:6], v[7:8]
	global_store_b64 v[1:2], v[5:6], off
	v_add_co_u32 v1, s0, v1, 8
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v2, s0, 0, v2, s0
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB3_2
.LBB3_3:                                ; %Flow31
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z10div_filterPdS_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.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 17
		.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_end3:
	.size	_Z10div_filterPdS_ii, .Lfunc_end3-_Z10div_filterPdS_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 320
; NumSgprs: 18
; NumVgprs: 17
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 17
; 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
	.protected	_Z5conv1PdS_S_S_iii     ; -- Begin function _Z5conv1PdS_S_S_iii
	.globl	_Z5conv1PdS_S_S_iii
	.p2align	8
	.type	_Z5conv1PdS_S_S_iii,@function
_Z5conv1PdS_S_S_iii:                    ; @_Z5conv1PdS_S_S_iii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b128 s[8:11], s[0:1], 0x20
	v_and_b32_e32 v2, 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_mul_i32 s15, s15, s3
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_add_nc_u32_e32 v1, s15, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_gt_i32_e64 s2, s9, v1
	v_cmp_gt_i32_e32 vcc_lo, s8, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB4_10
; %bb.1:
	s_load_b256 s[0:7], s[0:1], 0x0
	v_mov_b32_e32 v2, 0
	v_subrev_nc_u32_e32 v5, s10, v0
	v_mov_b32_e32 v3, 0
	s_mov_b32 s11, exec_lo
	s_delay_alu instid0(VALU_DEP_2)
	v_cmpx_gt_i32_e32 0, v5
	s_cbranch_execz .LBB4_3
; %bb.2:
	v_xad_u32 v5, v0, -1, s10
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v6, 31, v5
	v_lshlrev_b64 v[2:3], 3, v[1:2]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[5:6], 3, v[5:6]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v5, vcc_lo, s2, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_ci_u32_e32 v6, vcc_lo, s3, v6, vcc_lo
	v_add_co_u32 v2, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	global_load_b64 v[5:6], v[5:6], off
	global_load_b64 v[2:3], v[2:3], off
	s_waitcnt vmcnt(0)
	v_fma_f64 v[2:3], v[5:6], v[2:3], 0
	v_mov_b32_e32 v5, 0
.LBB4_3:
	s_or_b32 exec_lo, exec_lo, s11
	v_add_nc_u32_e32 v6, s10, v0
	s_mov_b32 s11, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_le_i32_e64 s8, v6
	s_cbranch_execz .LBB4_5
; %bb.4:
	v_subrev_nc_u32_e32 v6, s8, v6
	s_add_i32 s8, s8, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[8:9], null, s8, s9, v[1:2]
	v_ashrrev_i32_e32 v7, 31, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[6:7], 3, v[6:7]
	v_ashrrev_i32_e32 v9, 31, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[8:9], 3, v[8:9]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v6, vcc_lo, s2, v6
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v7, vcc_lo, s3, v7, vcc_lo
	v_add_co_u32 v8, vcc_lo, s0, v8
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v9, vcc_lo, s1, v9, vcc_lo
	global_load_b64 v[6:7], v[6:7], off
	global_load_b64 v[8:9], v[8:9], off
	s_waitcnt vmcnt(0)
	v_fma_f64 v[2:3], v[6:7], v[8:9], v[2:3]
	v_mov_b32_e32 v6, s8
.LBB4_5:
	s_or_b32 exec_lo, exec_lo, s11
	s_waitcnt lgkmcnt(0)
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_le_i32_e64 v5, v6
	s_cbranch_execz .LBB4_9
; %bb.6:                                ; %.lr.ph.preheader
	v_mul_lo_u32 v8, s9, v5
	v_add_nc_u32_e32 v7, -1, v5
	s_mov_b32 s3, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_add3_u32 v4, v4, v8, s15
	v_sub_nc_u32_e32 v8, v0, v5
.LBB4_7:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v5, 0, v8
	v_add_nc_u32_e32 v7, 1, v7
	v_max_i32_e32 v9, v8, v5
	v_ashrrev_i32_e32 v5, 31, v4
	v_add_nc_u32_e32 v8, -1, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_sub_nc_u32_e32 v9, s10, v9
	v_lshlrev_b64 v[11:12], 3, v[4:5]
	v_add_nc_u32_e32 v4, s9, v4
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_ashrrev_i32_e32 v10, 31, v9
	v_add_co_u32 v11, vcc_lo, s0, v11
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v12, vcc_lo, s1, v12, vcc_lo
	v_lshlrev_b64 v[9:10], 3, v[9:10]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v9, vcc_lo, s4, v9
	v_add_co_ci_u32_e32 v10, vcc_lo, s5, v10, vcc_lo
	v_cmp_ge_i32_e32 vcc_lo, v7, v6
	global_load_b64 v[11:12], v[11:12], off
	global_load_b64 v[9:10], v[9:10], off
	s_or_b32 s3, vcc_lo, s3
	s_waitcnt vmcnt(0)
	v_fma_f64 v[2:3], v[9:10], v[11:12], v[2:3]
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB4_7
; %bb.8:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s3
.LBB4_9:                                ; %Flow98
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s2
	v_mad_u64_u32 v[4:5], null, v0, s9, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v5, 31, v4
	v_lshlrev_b64 v[0:1], 3, v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_store_b64 v[0:1], v[2:3], off
.LBB4_10:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z5conv1PdS_S_S_iii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 13
		.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_end4:
	.size	_Z5conv1PdS_S_S_iii, .Lfunc_end4-_Z5conv1PdS_S_S_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 656
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; 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	_Z5conv2PdS_S_S_iii     ; -- Begin function _Z5conv2PdS_S_S_iii
	.globl	_Z5conv2PdS_S_S_iii
	.p2align	8
	.type	_Z5conv2PdS_S_S_iii,@function
_Z5conv2PdS_S_S_iii:                    ; @_Z5conv2PdS_S_S_iii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b128 s[8:11], s[0:1], 0x20
	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, s8, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e64 s2, s9, v0
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB5_10
; %bb.1:
	s_load_b256 s[0:7], s[0:1], 0x0
	v_mul_lo_u32 v1, v2, s9
	v_mov_b32_e32 v3, 0
	v_subrev_nc_u32_e32 v8, s10, v0
	v_mov_b32_e32 v4, 0
	s_mov_b32 s8, exec_lo
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_ashrrev_i32_e32 v2, 31, v1
	v_cmpx_gt_i32_e32 0, v8
	s_cbranch_execz .LBB5_3
; %bb.2:
	v_xad_u32 v3, v0, -1, s10
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[5:6], 3, v[1:2]
	v_mov_b32_e32 v8, 0
	v_ashrrev_i32_e32 v4, 31, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 3, v[3:4]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v3, vcc_lo, s2, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v4, vcc_lo, s3, v4, vcc_lo
	v_add_co_u32 v5, vcc_lo, s0, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s1, v6, vcc_lo
	global_load_b64 v[3:4], v[3:4], off
	global_load_b64 v[5:6], v[5:6], off
	s_waitcnt vmcnt(0)
	v_fma_f64 v[3:4], v[3:4], v[5:6], 0
.LBB5_3:
	s_or_b32 exec_lo, exec_lo, s8
	v_add_nc_u32_e32 v7, s10, v0
	s_mov_b32 s8, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_le_i32_e64 s9, v7
	s_cbranch_execz .LBB5_5
; %bb.4:
	v_subrev_nc_u32_e32 v5, s9, v7
	v_lshlrev_b64 v[9:10], 3, v[1:2]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v6, 31, v5
	v_lshlrev_b64 v[5:6], 3, v[5:6]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, s2, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s3, v6, vcc_lo
	v_add_co_u32 v9, vcc_lo, s0, v9
	v_add_co_ci_u32_e32 v10, vcc_lo, s1, v10, vcc_lo
	s_add_i32 s2, s9, -1
	global_load_b64 v[5:6], v[5:6], off
	global_load_b64 v[9:10], v[9:10], off
	v_mov_b32_e32 v7, s2
	s_waitcnt vmcnt(0)
	v_fma_f64 v[3:4], v[5:6], v[9:10], v[3:4]
.LBB5_5:
	s_or_b32 exec_lo, exec_lo, s8
	s_waitcnt lgkmcnt(0)
	s_mov_b32 s2, exec_lo
	v_cmpx_le_i32_e64 v8, v7
	s_cbranch_execz .LBB5_9
; %bb.6:                                ; %.lr.ph.preheader
	v_add_nc_u32_e32 v5, v8, v1
	v_add_nc_u32_e32 v2, -1, v8
	v_sub_nc_u32_e32 v8, v0, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v6, 31, v5
	v_lshlrev_b64 v[5:6], 3, v[5:6]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, s0, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s1, v6, vcc_lo
	s_mov_b32 s1, 0
.LBB5_7:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	v_sub_nc_u32_e32 v9, 0, v8
	v_add_nc_u32_e32 v2, 1, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_max_i32_e32 v9, v8, v9
	v_cmp_ge_i32_e64 s0, v2, v7
	v_add_nc_u32_e32 v8, -1, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_sub_nc_u32_e32 v9, s10, v9
	s_or_b32 s1, s0, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v10, 31, v9
	v_lshlrev_b64 v[9:10], 3, v[9:10]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v9, vcc_lo, s4, v9
	v_add_co_ci_u32_e32 v10, vcc_lo, s5, v10, vcc_lo
	global_load_b64 v[11:12], v[5:6], off
	global_load_b64 v[9:10], v[9:10], off
	v_add_co_u32 v5, vcc_lo, v5, 8
	v_add_co_ci_u32_e32 v6, vcc_lo, 0, v6, vcc_lo
	s_waitcnt vmcnt(0)
	v_fma_f64 v[3:4], v[9:10], v[11:12], v[3:4]
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB5_7
; %bb.8:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s1
.LBB5_9:                                ; %Flow97
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s2
	v_add_nc_u32_e32 v0, v1, v0
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 3, v[0:1]
	v_add_co_u32 v0, vcc_lo, s6, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_store_b64 v[0:1], v[3:4], off
.LBB5_10:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z5conv2PdS_S_S_iii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 13
		.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_end5:
	.size	_Z5conv2PdS_S_S_iii, .Lfunc_end5-_Z5conv2PdS_S_S_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 636
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         144
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z4scanPdS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z4scanPdS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .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
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 8
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11scan_updatePdS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11scan_updatePdS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .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
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           8
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         152
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z10cal_filterPdS_id
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z10cal_filterPdS_id.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     26
    .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
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z10div_filterPdS_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z10div_filterPdS_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     17
    .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
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .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:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z5conv1PdS_S_S_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z5conv1PdS_S_S_iii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .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
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .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:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z5conv2PdS_S_S_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z5conv2PdS_S_S_iii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
