﻿char *title = "gauss filtering";
char *description = "gauss filtering";

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <assert.h>
#include <time.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <math.h>       /* exp */

#ifndef max
#define max( a, b ) ( ((a) > (b)) ? (a) : (b) )
#endif

#ifndef min
#define min( a, b ) ( ((a) < (b)) ? (a) : (b) )
#endif

#ifndef uint8_t
typedef unsigned char uint8_t;
#endif

#ifndef uint16_t
typedef unsigned short uint16_t;
#endif

#ifndef uint32_t
typedef unsigned int uint32_t;
#endif

// http://en.wikipedia.org/wiki/BMP_file_format
#define BMPMAGIC	0x00
#define BMPFILESIZE	0x02
#define BMPOFFSET	0x0A
#define BMPDIBSISE	0x0E
#define BMPWIDTH	0x12
#define BMPHEIGHT	0x16
#define BMPBITSPERPIXEL	0x1C

typedef struct {
	uint8_t magic[2];   /* the magic number used to identify the BMP file:
						0x42 0x4D (Hex code points for B and M).
						The following entries are possible:
						BM - Windows 3.1x, 95, NT, ... etc
						BA - OS/2 Bitmap Array
						CI - OS/2 Color Icon
						CP - OS/2 Color Pointer
						IC - OS/2 Icon
						PT - OS/2 Pointer. */
	uint32_t filesz;    /* the size of the BMP file in bytes */
	uint16_t creator1;  /* reserved. */
	uint16_t creator2;  /* reserved. */
	uint32_t offset;    /* the offset, i.e. starting address,
						of the byte where the bitmap data can be found. */
} bmp_header_t;

typedef struct {
	uint32_t header_sz;     /* the size of this header (40 bytes) */
	uint32_t width;         /* the bitmap width in pixels */
	uint32_t height;        /* the bitmap height in pixels */
	uint16_t nplanes;       /* the number of color planes being used.
							Must be set to 1. */
	uint16_t depth;         /* the number of bits per pixel,
							which is the color depth of the image.
							Typical values are 1, 4, 8, 16, 24 and 32. */
	uint32_t compress_type; /* the compression method being used.
							See also bmp_compression_method_t. */
	uint32_t bmp_bytesz;    /* the image size. This is the size of the raw bitmap
							data (see below), and should not be confused
							with the file size. */
	uint32_t hres;          /* the horizontal resolution of the image.
							(pixel per meter) */
	uint32_t vres;          /* the vertical resolution of the image.
							(pixel per meter) */
	uint32_t ncolors;       /* the number of colors in the color palette,
							or 0 to default to 2<sup><i>n</i></sup>. */
	uint32_t nimpcolors;    /* the number of important colors used,
							or 0 when every color is important;
							generally ignored. */
} bmp_dib_v3_header_t;

__global__ void global_defaultgaussfilter(
	unsigned int *input,
	unsigned int *output,
	double *matrix,	int Nh,
	int width,int height,
	int ddxx, int ddyy)
{
	assert(ddxx*ddyy==0);

	if(ddxx>0) for (int id = blockDim.x*blockIdx.x + threadIdx.x;
	id < width*height;
	id += blockDim.x*gridDim.x) {
		int x = id % width;
		int y = id / width;

		double s1 = 0;
		double s2 = 0;
		for (int dx = -Nh; dx <= Nh; dx++) {
			if (x + dx < 0) continue;
			if (x + dx >= width) continue;
			int value = (double)(unsigned int)input[id + dx];
			s1 += value*matrix[Nh + dx];
			s2 += matrix[Nh + dx];
		}
		output[id] = (unsigned int)(s1 / s2);
	}
	if(ddyy>0) for (int id = blockDim.x*blockIdx.x + threadIdx.x;
	id < width*height;
	id += blockDim.x*gridDim.x) {
		int x = id % width;
		int y = id / width;

		double s1 = 0;
		double s2 = 0;
		for (int dy = -Nh; dy <= Nh; dy++) {
			if (y + dy < 0) continue;
			if (y + dy >= height) continue;
			int value = (double)(unsigned int)input[id + width*dy];
			s1 += value*matrix[Nh + dy];
			s2 += matrix[Nh + dy];
		}
		output[id] = (unsigned int)(s1 / s2);
	}
}


__host__ void host_defaultgaussfilter(
	int gridSize, int blockSize, 
	unsigned int *r, unsigned int *g, unsigned int *b, 
	double *matrix, int Nh, 
	int width, int height)
{
	unsigned int *channel[3] = { r,g,b };

	// channel - массив данных
	// sigma - коэффициент размытия
	// width - ширина
	// height - высота

	cudaError_t err;
	unsigned int *device_a;
	unsigned int *device_b;
	double *device_matrix;

	err = cudaMalloc((void**)&device_a, width*height*sizeof(unsigned int));
	err = cudaMalloc((void**)&device_b, width*height*sizeof(unsigned int));
	err = cudaMalloc((void**)&device_matrix, (2 * Nh + 1) * sizeof(double));
	cudaMemcpy(device_matrix, matrix, (2 * Nh + 1)*sizeof(double), cudaMemcpyHostToDevice);

	int blocks = (gridSize > 0)? gridSize : min(15, (int)sqrt(width*height));
	int threads = (blockSize > 0)? blockSize : min(15, (int)sqrt(width*height));

	for(int j=0; j<3; j++) {
		cudaMemcpy(device_a, channel[j], width*height*sizeof(unsigned int), cudaMemcpyHostToDevice);

		global_defaultgaussfilter <<< blocks, threads >>>(device_a, device_b, device_matrix, Nh, width, height, 0, 1);
		global_defaultgaussfilter <<< blocks, threads >>>(device_b, device_a, device_matrix, Nh, width, height, 1, 0);

		cudaMemcpy(channel[j], device_a, width*height*sizeof(unsigned int), cudaMemcpyDeviceToHost);
	}

	// Освобождаем память на устройстве
	cudaFree((void*)device_a);
	cudaFree((void*)device_b);
	cudaFree((void*)device_matrix);

	err = err;
}

__global__ void global_recursivegaussfilter(
	unsigned int *input,
	unsigned int *output,
	double *bb,	int p, int q,
	int width,int height,
	int ddxx, int ddyy)
{
	assert(p==1);
	assert(q==3);
	assert(ddxx*ddyy==0);

	// Копируем в локальные переменные для ускорения доступа к значениям
	double b1 = bb[1]/bb[0];
	double b2 = bb[2]/bb[0];
	double b3 = bb[3]/bb[0];
	double B = 1.0 - (b1+b2+b3);

	if(ddxx>0) for (int y = blockDim.x*blockIdx.x + threadIdx.x;
	y < height;
	y += blockDim.x*gridDim.x) {
		int id = y*width;
		if(width>1) output[id]=B*input[id];id++;
		if(width>2) output[id]=B*input[id]+b1*output[id-1];id++;
		if(width>3) output[id]=B*input[id]+b1*output[id-1]+b2*output[id-2];id++;
		for(; id<width; id++) 
			output[id]=B*input[id]+b1*output[id-1]+b2*output[id-2]+b3*output[id-3];
	}
	if(ddxx<0) for (int y = blockDim.x*blockIdx.x + threadIdx.x;
	y < height;
	y += blockDim.x*gridDim.x) {
		int id = y*width+width;
		id--;if(width>1) output[id]=B*input[id];
		id--;if(width>2) output[id]=B*input[id]+b1*output[id+1];
		id--;if(width>3) output[id]=B*input[id]+b1*output[id+1]+b2*output[id+2];
		for(id--; id>=0; id--) 
			output[id]=B*input[id]+b1*output[id+1]+b2*output[id+2]+b3*output[id+3];
	}
	if(ddyy>0) for (int x = blockDim.x*blockIdx.x + threadIdx.x;
	x < width;
	x += blockDim.x*gridDim.x) {
		int id = x;
		if(height>1) output[id]=B*input[id];id+=width;
		if(height>2) output[id]=B*input[id]+b1*output[id-width];id+=width;
		if(height>3) output[id]=B*input[id]+b1*output[id-width]+b2*output[id-2*width];id+=width;
		for(int y=3; y<height; y++, id+=width) 
			output[id]=B*input[id]+b1*output[id-width]+b2*output[id-2*width]+b3*output[id-3*width];
	}
	if(ddyy<0) for (int x = blockDim.x*blockIdx.x + threadIdx.x;
	x < width;
	x += blockDim.x*gridDim.x){
		int id = height*width+x;
		id-=width;if(height>1) output[id]=B*input[id];
		id-=width;if(height>2) output[id]=B*input[id]+b1*output[id+width];
		id-=width;if(height>3) output[id]=B*input[id]+b1*output[id+width]+b2*output[id+2*width];
		for(id-=width; id>=0; id-=width) 
			output[id]=B*input[id]+b1*output[id+width]+b2*output[id+2*width]+b3*output[id+3*width];
	}
}

__host__ void host_recursivegaussfilter(
	int gridSize, int blockSize, 
	unsigned int *r, unsigned int *g, unsigned int *b, 
	double *bb, int p, int q, 
	int width, int height)
{

	unsigned int *channel[3] = { r,g,b };

	// channel - массив данных
	// sigma - коэффициенты
	// width - ширина
	// height - высота

	cudaError_t err;
	unsigned int *device_a;
	unsigned int *device_b;
	double *device_bb;

	err = cudaMalloc((void**)&device_a, width*height*sizeof(unsigned int));
	err = cudaMalloc((void**)&device_b, width*height*sizeof(unsigned int));
	err = cudaMalloc((void**)&device_bb, (p+q) * sizeof(double));
	cudaMemcpy(device_bb, bb, (p+q)*sizeof(double), cudaMemcpyHostToDevice);

	int blocks = (gridSize > 0)? gridSize : min(15, (int)sqrt(max(width,height)));
	int threads = (blockSize > 0)? blockSize : min(15, (int)sqrt(max(width,height)));

	for(int j=0; j<3; j++) {
		cudaMemcpy(device_a, channel[j], width*height*sizeof(unsigned int), cudaMemcpyHostToDevice);

		global_recursivegaussfilter <<< blocks, threads >>>(device_a, device_b, device_bb, p, q, width, height, 0, 1);
		global_recursivegaussfilter <<< blocks, threads >>>(device_b, device_a, device_bb, p, q, width, height, 0, -1);
		global_recursivegaussfilter <<< blocks, threads >>>(device_a, device_b, device_bb, p, q, width, height, 1, 0);
		global_recursivegaussfilter <<< blocks, threads >>>(device_b, device_a, device_bb, p, q, width, height, -1, 0);

		cudaMemcpy(channel[j], device_a, width*height*sizeof(unsigned int), cudaMemcpyDeviceToHost);
	}

	// Освобождаем память на устройстве
	cudaFree((void*)device_a);
	cudaFree((void*)device_b);
	cudaFree((void*)device_bb);

	err = err;
}

#define RECURSIVE 1
#define DEFAULT 0

int main(int argc, char* argv[])
{
	int i, j;

	std::cout << title << std::endl;

	// Find/set the device.
	int device_count = 0;
	cudaGetDeviceCount(&device_count);
	for (i = 0; i < device_count; ++i)
	{
		cudaDeviceProp properties;
		cudaGetDeviceProperties(&properties, i);
		std::cout << "Running on GPU " << i << " (" << properties.name << ")" << std::endl;
	}

	if (argc < 5){
		printf("Usage :\t%s filter sigma inputfilename.bmp ouputfilename.bmp\n", argv[0]);
		printf("filter :\tgauss recursivegauss\n");
		exit(-1);
	}

	// Получаем параметры - имена файлов

	char *filter = argv[1];
	double sigma = atof(argv[2]);
	char *inputFileName = argv[3];
	char *outputFileName = argv[4];
	int gridSize = (argc>5)?atoi(argv[5]):0;
	int blockSize = (argc>6)?atoi(argv[6]):0;
	int mode =(strcmp(filter,"gauss")==0)?DEFAULT:RECURSIVE;

	printf("Title :\t%s\n", title);
	printf("Description :\t%s\n", description);
	printf("Filter :\t%s\n", filter);
	printf("Sigma :\t%le\n", sigma);
	printf("Input file name :\t%s\n", inputFileName);
	printf("Output file name :\t%s\n", outputFileName);

	FILE *file = fopen(inputFileName, "rb");
	if (!file) { 
		fprintf(stderr, "Open file error (%s)\n", inputFileName); 
		fflush(stderr); 
		exit(-1); 
	}
	fseek(file, 0L, SEEK_END);
	long size = ftell(file);
	unsigned char *buffer = (unsigned char *)malloc((size_t)size);
	fseek(file, 0L, SEEK_SET);
	fread((void*)buffer, (size_t)1, (size_t)size, file);
	fclose(file);

	uint32_t width = *(uint32_t *)&buffer[BMPWIDTH];
	uint32_t height = *(uint32_t *)&buffer[BMPHEIGHT];
	uint32_t file_size = *(uint32_t *)&buffer[BMPFILESIZE];
	uint32_t offset = *(uint32_t *)&buffer[BMPOFFSET];
	uint16_t bits_per_pixel = *(uint16_t *)&buffer[BMPBITSPERPIXEL];
	uint16_t bytes_per_pixel = ((int)((bits_per_pixel+7)/8));
	uint32_t bytes_per_line = ((int)((bits_per_pixel * width+31)/32))*4; // http://en.wikipedia.org/wiki/BMP_file_format

	printf("BMP image size :\t%ld x %ld\n", width, height);
	printf("BMP file size :\t%ld\n", file_size);
	printf("BMP pixels offset :\t%ld\n", offset);
	printf("BMP bits per pixel :\t%d\n", bits_per_pixel);
	printf("BMP bytes per pixel :\t%d\n", bytes_per_pixel);
	printf("BMP bytes per line :\t%d\n", bytes_per_line);

	uint8_t *pixels =(uint8_t *)&buffer[offset];
	uint8_t *pixel;
	uint32_t x, y;

	/* выделение памяти под байтовые цветовые каналы */
	int count = width*height;
	unsigned int* channel[3];
	for (j = 0; j < 3; j++)
		channel[j] = (unsigned int*)malloc(count*sizeof(unsigned int));

	int pos = 0;
	for (y = 0; y < height; y++) {
		for (x = 0; x < width; x++) {
			pixel = &pixels[y*bytes_per_line+x*bytes_per_pixel];
			channel[0][pos] = (unsigned int)pixel[0];
			channel[1][pos] = (unsigned int)pixel[1];
			channel[2][pos] = (unsigned int)pixel[2];
			pos++;
		}
	}

	switch(mode){
	case RECURSIVE:{
		int p = 1, q = 3;
		double * bb = (double*)malloc((p+q)*sizeof(double));

		//// http://mognovse.ru/qgi-chekan-rostislav-vladimirovich.html
		//// cтандартные рекомендации по выбору константы q представляют собой:
		//double qq;
		//if(sigma>2.5) qq=0.98711*sigma - 0.96330;
		//else if(sigma>0.5) qq=3.97156 - 4.14554*sqrt(1.0 - 0.26891*sigma);
		//else qq=3.97156 - 4.14554*sqrt(1.0 - 0.26891*sigma);

		//double qq2 = qq*qq;
		//double qq3 = qq2*qq;

		//bb[0] = 1.5725 + 2.44413*qq + 1.4281*qq2;
		//bb[1] = 2.44413*qq + 2.85619*qq2 + 1.26661*qq3;
		//bb[2] = -1.4281*qq2 - 1.26661*qq3;
		//bb[3] = 0.422205*qq3;

		// http://habrahabr.ru/post/151157/
		double sigma_inv_4;

		sigma_inv_4 = sigma*sigma; sigma_inv_4 = 1.0/(sigma_inv_4*sigma_inv_4);

		double coef_A = sigma_inv_4*(sigma*(sigma*(sigma*1.1442707+0.0130625)-0.7500910)+0.2546730);
		double coef_W = sigma_inv_4*(sigma*(sigma*(sigma*1.3642870+0.0088755)-0.3255340)+0.3016210);
		double coef_B = sigma_inv_4*(sigma*(sigma*(sigma*1.2397166-0.0001644)-0.6363580)-0.0536068);

		double z0_abs   = exp(coef_A);

		double z0_real  = z0_abs*cos(coef_W);
		double z0_im    = z0_abs*sin(coef_W);
		double z2       = exp(coef_B);

		double z0_abs_2 = z0_abs*z0_abs;

		bb[3] = 1.0/(z2*z0_abs_2);
		bb[2] = -(2*z0_real+z2)*bb[3];
		bb[1] = (z0_abs_2+2*z0_real*z2)*bb[3];
		bb[0] = 1.0;

		clock_t t1, t2;
		t1 = clock();

		host_recursivegaussfilter(gridSize, blockSize, 
			channel[0], channel[1], channel[2], 
			bb, p, q,
			width, height);

		t2 = clock();
		double seconds = ((double)(t2-t1))/CLOCKS_PER_SEC;
		printf("Execution time :\t%le\n", seconds);

		free(bb);
				   }
				   break;
	default:{
		// Nh - полуразмер
		int Nh = (int)(3 * sigma);

		double * matrix = (double*)malloc((2 * Nh + 1)*sizeof(double));
		for (int i = -Nh; i <= Nh; i++) matrix[Nh + i] = exp(-(double)i*i / (2.0*sigma*sigma));

		clock_t t1, t2;
		t1 = clock();

		host_defaultgaussfilter(gridSize, blockSize, 
			channel[0], channel[1], channel[2], 
			matrix, Nh, 
			width, height);

		t2 = clock();
		double seconds = ((double)(t2-t1))/CLOCKS_PER_SEC;
		printf("Execution time :\t%le\n", seconds);

		free(matrix);
			}
			break;
	}

	pos = 0;
	for (y = 0; y < height; y++) {
		for (x = 0; x < width; x++) {
			pixel = &pixels[y*bytes_per_line+x*bytes_per_pixel];
			pixel[0] = (uint8_t)channel[0][pos];
			pixel[1] = (uint8_t)channel[1][pos];
			pixel[2] = (uint8_t)channel[2][pos];
			pos++;
		}
	}
	/* высвобождаем массивы */
	for (j = 0; j < 3; j++)
		free(channel[j]);

	/* выводим результаты */
	file = fopen(outputFileName, "wb");
	if (!file) {
		fprintf(stderr, "Open file error (%s)\n", outputFileName); 
		fflush(stderr);
		exit(-1);
	}
	fwrite((void*)buffer, (size_t)1, (size_t)size, file);
	printf("Output file size :\t%ld\n", size);
	free(buffer);
	fclose(file);

	cudaDeviceReset();

	exit(0);
}
	.file	"tmpxft_00224710_00000000-6_cudagaussfilter.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3640:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3640:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z54__device_stub__Z25global_defaultgaussfilterPjS_PdiiiiiPjS_Pdiiiii
	.type	_Z54__device_stub__Z25global_defaultgaussfilterPjS_PdiiiiiPjS_Pdiiiii, @function
_Z54__device_stub__Z25global_defaultgaussfilterPjS_PdiiiiiPjS_Pdiiiii:
.LFB3662:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	208(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	216(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	64(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z25global_defaultgaussfilterPjS_Pdiiiii(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 224
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L2:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3662:
	.size	_Z54__device_stub__Z25global_defaultgaussfilterPjS_PdiiiiiPjS_Pdiiiii, .-_Z54__device_stub__Z25global_defaultgaussfilterPjS_PdiiiiiPjS_Pdiiiii
	.globl	_Z25global_defaultgaussfilterPjS_Pdiiiii
	.type	_Z25global_defaultgaussfilterPjS_Pdiiiii, @function
_Z25global_defaultgaussfilterPjS_Pdiiiii:
.LFB3663:
	.cfi_startproc
	endbr64
	jmp	_Z54__device_stub__Z25global_defaultgaussfilterPjS_PdiiiiiPjS_Pdiiiii
	.cfi_endproc
.LFE3663:
	.size	_Z25global_defaultgaussfilterPjS_Pdiiiii, .-_Z25global_defaultgaussfilterPjS_Pdiiiii
	.globl	_Z57__device_stub__Z27global_recursivegaussfilterPjS_PdiiiiiiPjS_Pdiiiiii
	.type	_Z57__device_stub__Z27global_recursivegaussfilterPjS_PdiiiiiiPjS_Pdiiiiii, @function
_Z57__device_stub__Z27global_recursivegaussfilterPjS_PdiiiiiiPjS_Pdiiiiii:
.LFB3664:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	208(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	216(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	224(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	pushq	56(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z27global_recursivegaussfilterPjS_Pdiiiiii(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 224
	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 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L8:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3664:
	.size	_Z57__device_stub__Z27global_recursivegaussfilterPjS_PdiiiiiiPjS_Pdiiiiii, .-_Z57__device_stub__Z27global_recursivegaussfilterPjS_PdiiiiiiPjS_Pdiiiiii
	.globl	_Z27global_recursivegaussfilterPjS_Pdiiiiii
	.type	_Z27global_recursivegaussfilterPjS_Pdiiiiii, @function
_Z27global_recursivegaussfilterPjS_Pdiiiiii:
.LFB3665:
	.cfi_startproc
	endbr64
	jmp	_Z57__device_stub__Z27global_recursivegaussfilterPjS_PdiiiiiiPjS_Pdiiiiii
	.cfi_endproc
.LFE3665:
	.size	_Z27global_recursivegaussfilterPjS_Pdiiiiii, .-_Z27global_recursivegaussfilterPjS_Pdiiiiii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z27global_recursivegaussfilterPjS_Pdiiiiii"
.LC1:
	.string	"_Z25global_defaultgaussfilterPjS_Pdiiiii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3667:
	.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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z27global_recursivegaussfilterPjS_Pdiiiiii(%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	.LC1(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z25global_defaultgaussfilterPjS_Pdiiiii(%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
.LFE3667:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_,"axG",@progbits,_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_,comdat
	.weak	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
	.type	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_, @function
_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_:
.LFB3967:
	.cfi_startproc
	endbr64
	cvtsi2sdl	%edi, %xmm0
	jmp	sqrt@PLT
	.cfi_endproc
.LFE3967:
	.size	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_, .-_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
	.text
	.globl	_Z23host_defaultgaussfilteriiPjS_S_Pdiii
	.type	_Z23host_defaultgaussfilteriiPjS_S_Pdiii, @function
_Z23host_defaultgaussfilteriiPjS_S_Pdiii:
.LFB3635:
	.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
	movq	%r9, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	movl	152(%rsp), %r13d
	movq	%rsp, %rdi
	movq	%rdx, 48(%rsp)
	imull	160(%rsp), %r13d
	movq	%rcx, 56(%rsp)
	movq	%r8, 64(%rsp)
	movslq	%r13d, %r12
	salq	$2, %r12
	movq	%r12, %rsi
	call	cudaMalloc@PLT
	leaq	8(%rsp), %rdi
	movq	%r12, %rsi
	call	cudaMalloc@PLT
	movl	144(%rsp), %eax
	leaq	16(%rsp), %rdi
	leal	1(%rax,%rax), %r15d
	movslq	%r15d, %r15
	salq	$3, %r15
	movq	%r15, %rsi
	call	cudaMalloc@PLT
	movq	16(%rsp), %rdi
	movq	%r15, %rdx
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	testl	%ebx, %ebx
	jg	.L17
	movl	%r13d, %edi
	movl	$15, %ebx
	call	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
	cvttsd2sil	%xmm0, %eax
	cmpl	$15, %eax
	jg	.L17
	movl	%r13d, %edi
	call	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
	cvttsd2sil	%xmm0, %ebx
.L17:
	testl	%ebp, %ebp
	jg	.L18
	movl	%r13d, %edi
	movl	$15, %ebp
	call	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
	cvttsd2sil	%xmm0, %eax
	cmpl	$15, %eax
	jg	.L18
	movl	%r13d, %edi
	call	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
	cvttsd2sil	%xmm0, %ebp
.L18:
	movabsq	$4294967297, %r14
	xorl	%r13d, %r13d
.L21:
	movq	48(%rsp,%r13,8), %r15
	movq	(%rsp), %rdi
	movl	$1, %ecx
	movq	%r12, %rdx
	movq	%r15, %rsi
	call	cudaMemcpy@PLT
	movq	%r14, 40(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r14, 28(%rsp)
	movl	44(%rsp), %ecx
	movl	%ebp, 36(%rsp)
	movl	32(%rsp), %esi
	movl	%ebx, 24(%rsp)
	movq	36(%rsp), %rdx
	movq	24(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L19
	pushq	$1
	.cfi_def_cfa_offset 152
	pushq	$0
	.cfi_def_cfa_offset 160
	movl	176(%rsp), %r9d
	movl	168(%rsp), %r8d
	movl	160(%rsp), %ecx
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	call	_Z54__device_stub__Z25global_defaultgaussfilterPjS_PdiiiiiPjS_Pdiiiii
	popq	%rcx
	.cfi_def_cfa_offset 152
	popq	%rsi
	.cfi_def_cfa_offset 144
.L19:
	movq	%r14, 40(%rsp)
	movl	44(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r14, 28(%rsp)
	movl	32(%rsp), %esi
	movl	%ebp, 36(%rsp)
	movq	36(%rsp), %rdx
	movl	%ebx, 24(%rsp)
	movq	24(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L20
	pushq	$0
	.cfi_def_cfa_offset 152
	pushq	$1
	.cfi_def_cfa_offset 160
	movl	176(%rsp), %r9d
	movl	168(%rsp), %r8d
	movl	160(%rsp), %ecx
	movq	32(%rsp), %rdx
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rdi
	call	_Z54__device_stub__Z25global_defaultgaussfilterPjS_PdiiiiiPjS_Pdiiiii
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L20:
	movq	(%rsp), %rsi
	movl	$2, %ecx
	movq	%r12, %rdx
	movq	%r15, %rdi
	incq	%r13
	call	cudaMemcpy@PLT
	cmpq	$3, %r13
	jne	.L21
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	addq	$88, %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
.LFE3635:
	.size	_Z23host_defaultgaussfilteriiPjS_S_Pdiii, .-_Z23host_defaultgaussfilteriiPjS_S_Pdiii
	.globl	_Z25host_recursivegaussfilteriiPjS_S_Pdiiii
	.type	_Z25host_recursivegaussfilteriiPjS_S_Pdiiii, @function
_Z25host_recursivegaussfilteriiPjS_S_Pdiiii:
.LFB3636:
	.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
	movq	%r9, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	movq	%rdx, 64(%rsp)
	movl	176(%rsp), %r12d
	movl	184(%rsp), %r13d
	movq	%rcx, 72(%rsp)
	movl	%r12d, %eax
	movq	%r8, 80(%rsp)
	imull	%r13d, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rsi
	movq	%rax, (%rsp)
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	24(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	160(%rsp), %r15d
	leaq	32(%rsp), %rdi
	addl	168(%rsp), %r15d
	movslq	%r15d, %r15
	salq	$3, %r15
	movq	%r15, %rsi
	call	cudaMalloc@PLT
	movq	32(%rsp), %rdi
	movq	%r15, %rdx
	movq	%r14, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	testl	%ebx, %ebx
	jg	.L28
	cmpl	%r13d, %r12d
	movl	%r13d, %r14d
	movl	$15, %ebx
	cmovge	%r12d, %r14d
	movl	%r14d, %edi
	call	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
	cvttsd2sil	%xmm0, %eax
	cmpl	$15, %eax
	jg	.L28
	movl	%r14d, %edi
	call	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
	cvttsd2sil	%xmm0, %ebx
.L28:
	testl	%ebp, %ebp
	jg	.L29
	cmpl	%r13d, %r12d
	movl	%r13d, %r14d
	movl	$15, %ebp
	cmovge	%r12d, %r14d
	movl	%r14d, %edi
	call	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
	cvttsd2sil	%xmm0, %eax
	cmpl	$15, %eax
	jg	.L29
	movl	%r14d, %edi
	call	_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsrSt12__is_integerIT_E7__valueEdE6__typeES3_
	cvttsd2sil	%xmm0, %ebp
.L29:
	movabsq	$4294967297, %r14
	xorl	%r15d, %r15d
.L34:
	movq	64(%rsp,%r15,8), %rax
	movq	(%rsp), %rdx
	movl	$1, %ecx
	movq	16(%rsp), %rdi
	movq	%rax, %rsi
	movq	%rax, 8(%rsp)
	call	cudaMemcpy@PLT
	movq	%r14, 56(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r14, 44(%rsp)
	movl	60(%rsp), %ecx
	movl	%ebp, 52(%rsp)
	movl	48(%rsp), %esi
	movl	%ebx, 40(%rsp)
	movq	52(%rsp), %rdx
	movq	40(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	pushq	%rsi
	.cfi_def_cfa_offset 168
	movl	%r12d, %r9d
	pushq	$1
	.cfi_def_cfa_offset 176
	pushq	$0
	.cfi_def_cfa_offset 184
	pushq	%r13
	.cfi_def_cfa_offset 192
	movl	200(%rsp), %r8d
	movl	192(%rsp), %ecx
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rsi
	movq	48(%rsp), %rdi
	call	_Z57__device_stub__Z27global_recursivegaussfilterPjS_PdiiiiiiPjS_Pdiiiiii
	addq	$32, %rsp
	.cfi_def_cfa_offset 160
.L30:
	movq	%r14, 56(%rsp)
	movl	60(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r14, 44(%rsp)
	movl	48(%rsp), %esi
	movl	%ebp, 52(%rsp)
	movq	52(%rsp), %rdx
	movl	%ebx, 40(%rsp)
	movq	40(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L31
	pushq	%rcx
	.cfi_def_cfa_offset 168
	movl	%r12d, %r9d
	pushq	$-1
	.cfi_def_cfa_offset 176
	pushq	$0
	.cfi_def_cfa_offset 184
	pushq	%r13
	.cfi_def_cfa_offset 192
	movl	200(%rsp), %r8d
	movl	192(%rsp), %ecx
	movq	64(%rsp), %rdx
	movq	48(%rsp), %rsi
	movq	56(%rsp), %rdi
	call	_Z57__device_stub__Z27global_recursivegaussfilterPjS_PdiiiiiiPjS_Pdiiiiii
	addq	$32, %rsp
	.cfi_def_cfa_offset 160
.L31:
	movq	%r14, 56(%rsp)
	movl	60(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r14, 44(%rsp)
	movl	48(%rsp), %esi
	movl	%ebp, 52(%rsp)
	movq	52(%rsp), %rdx
	movl	%ebx, 40(%rsp)
	movq	40(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L32
	pushq	%rdx
	.cfi_def_cfa_offset 168
	movl	%r12d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 176
	pushq	$1
	.cfi_def_cfa_offset 184
	pushq	%r13
	.cfi_def_cfa_offset 192
	movl	200(%rsp), %r8d
	movl	192(%rsp), %ecx
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rsi
	movq	48(%rsp), %rdi
	call	_Z57__device_stub__Z27global_recursivegaussfilterPjS_PdiiiiiiPjS_Pdiiiiii
	addq	$32, %rsp
	.cfi_def_cfa_offset 160
.L32:
	movq	%r14, 56(%rsp)
	movl	60(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r14, 44(%rsp)
	movl	48(%rsp), %esi
	movl	%ebp, 52(%rsp)
	movq	52(%rsp), %rdx
	movl	%ebx, 40(%rsp)
	movq	40(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L33
	pushq	%rax
	.cfi_def_cfa_offset 168
	movl	%r12d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 176
	pushq	$-1
	.cfi_def_cfa_offset 184
	pushq	%r13
	.cfi_def_cfa_offset 192
	movl	200(%rsp), %r8d
	movl	192(%rsp), %ecx
	movq	64(%rsp), %rdx
	movq	48(%rsp), %rsi
	movq	56(%rsp), %rdi
	call	_Z57__device_stub__Z27global_recursivegaussfilterPjS_PdiiiiiiPjS_Pdiiiiii
	addq	$32, %rsp
	.cfi_def_cfa_offset 160
.L33:
	movq	(%rsp), %rdx
	movq	16(%rsp), %rsi
	movl	$2, %ecx
	incq	%r15
	movq	8(%rsp), %rdi
	call	cudaMemcpy@PLT
	cmpq	$3, %r15
	jne	.L34
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	addq	$104, %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
.LFE3636:
	.size	_Z25host_recursivegaussfilteriiPjS_S_Pdiiii, .-_Z25host_recursivegaussfilteriiPjS_S_Pdiiii
	.section	.rodata.str1.1
.LC2:
	.string	"Running on GPU "
.LC3:
	.string	" ("
.LC4:
	.string	")"
.LC5:
	.string	"Usage :\t%s filter sigma inputfilename.bmp ouputfilename.bmp\n"
.LC6:
	.string	"filter :\tgauss recursivegauss\n"
.LC7:
	.string	"gauss"
.LC8:
	.string	"Title :\t%s\n"
.LC9:
	.string	"Description :\t%s\n"
.LC10:
	.string	"Filter :\t%s\n"
.LC11:
	.string	"Sigma :\t%le\n"
.LC12:
	.string	"Input file name :\t%s\n"
.LC13:
	.string	"Output file name :\t%s\n"
.LC14:
	.string	"rb"
.LC15:
	.string	"Open file error (%s)\n"
.LC16:
	.string	"BMP image size :\t%ld x %ld\n"
.LC17:
	.string	"BMP file size :\t%ld\n"
.LC18:
	.string	"BMP pixels offset :\t%ld\n"
.LC19:
	.string	"BMP bits per pixel :\t%d\n"
.LC20:
	.string	"BMP bytes per pixel :\t%d\n"
.LC21:
	.string	"BMP bytes per line :\t%d\n"
.LC37:
	.string	"Execution time :\t%le\n"
.LC39:
	.string	"wb"
.LC40:
	.string	"Output file size :\t%ld\n"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3637:
	.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
	leaq	.LC2(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	_ZSt4cout(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	xorl	%ebx, %ebx
	subq	$1176, %rsp
	.cfi_def_cfa_offset 1232
	movq	title(%rip), %rsi
	movq	%fs:40, %rax
	movq	%rax, 1160(%rsp)
	xorl	%eax, %eax
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	xorl	%esi, %esi
	leaq	124(%rsp), %rdi
	movl	%esi, 124(%rsp)
	call	cudaGetDeviceCount@PLT
.L41:
	cmpl	%ebx, 124(%rsp)
	jle	.L67
	leaq	128(%rsp), %r15
	movl	%ebx, %esi
	movq	%r15, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movq	%r14, %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %esi
	incl	%ebx
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r15, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	jmp	.L41
.L67:
	cmpl	$4, %r12d
	jg	.L43
	movq	0(%r13), %rdx
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L64
.L43:
	movq	16(%r13), %rdi
	movq	8(%r13), %rbp
	call	atof@PLT
	movq	32(%r13), %rax
	movq	24(%r13), %rbx
	movsd	%xmm0, 8(%rsp)
	movq	%rax, 56(%rsp)
	cmpl	$5, %r12d
	je	.L60
	movq	40(%r13), %rdi
	call	atoi@PLT
	xorl	%ecx, %ecx
	movl	%eax, 64(%rsp)
	movl	%ecx, 48(%rsp)
	cmpl	$6, %r12d
	je	.L44
	movq	48(%r13), %rdi
	call	atoi@PLT
	movl	%eax, 48(%rsp)
	jmp	.L44
.L60:
	xorl	%edx, %edx
	movl	%edx, 64(%rsp)
	movl	%edx, 48(%rsp)
.L44:
	movq	%rbp, %rdi
	leaq	.LC7(%rip), %rsi
	call	strcmp@PLT
	movq	title(%rip), %rdx
	movl	$2, %edi
	leaq	.LC8(%rip), %rsi
	movl	%eax, %r15d
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	description(%rip), %rdx
	leaq	.LC9(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%rbp, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC10(%rip), %rsi
	call	__printf_chk@PLT
	movsd	8(%rsp), %xmm0
	leaq	.LC11(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%rbx, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC12(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rdx
	leaq	.LC13(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC14(%rip), %rsi
	movq	%rbx, %rdi
	call	fopen@PLT
	movq	%rax, %rbp
	testq	%rax, %rax
	jne	.L45
	movq	%rbx, %rcx
.L66:
	movq	stderr(%rip), %rdi
	leaq	.LC15(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	stderr(%rip), %rdi
	call	fflush@PLT
.L64:
	orl	$-1, %edi
.L65:
	call	exit@PLT
.L45:
	xorl	%esi, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	call	fseek@PLT
	movq	%rbp, %rdi
	call	ftell@PLT
	movq	%rax, %rdi
	movq	%rax, 32(%rsp)
	call	malloc@PLT
	xorl	%edx, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	movq	%rax, %rbx
	call	fseek@PLT
	movq	32(%rsp), %rcx
	movq	%rbp, %r8
	movq	%rbx, %rdi
	movl	$1, %edx
	movq	%rcx, %rsi
	call	__fread_chk@PLT
	movq	%rbp, %rdi
	call	fclose@PLT
	movl	2(%rbx), %eax
	movl	18(%rbx), %ebp
	movl	$2, %edi
	movzwl	28(%rbx), %r12d
	movl	22(%rbx), %r13d
	leaq	.LC16(%rip), %rsi
	movl	%eax, 16(%rsp)
	movl	%ebp, %edx
	movl	10(%rbx), %r14d
	leal	7(%r12), %eax
	movl	%r13d, %ecx
	sarl	$3, %eax
	movl	%eax, 52(%rsp)
	movl	%r12d, %eax
	imull	%ebp, %eax
	addl	$31, %eax
	shrl	$5, %eax
	sall	$2, %eax
	movl	%eax, 68(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	16(%rsp), %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC17(%rip), %rsi
	call	__printf_chk@PLT
	movl	%r14d, %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC18(%rip), %rsi
	call	__printf_chk@PLT
	movl	%r12d, %edx
	movl	%ebp, %r12d
	movl	$2, %edi
	imull	%r13d, %r12d
	leaq	.LC19(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	52(%rsp), %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC20(%rip), %rsi
	call	__printf_chk@PLT
	movslq	%r12d, %r12
	movl	68(%rsp), %edx
	xorl	%eax, %eax
	leaq	.LC21(%rip), %rsi
	salq	$2, %r12
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, 40(%rsp)
	call	malloc@PLT
	xorl	%edi, %edi
	movl	%ebp, %r10d
	xorl	%ecx, %ecx
	movq	%rax, 16(%rsp)
	leaq	(%rbx,%r14), %rax
	xorl	%r8d, %r8d
	movq	%rax, 80(%rsp)
	movslq	%ebp, %rax
	movq	%rax, 88(%rsp)
.L46:
	cmpl	%r13d, %r8d
	je	.L48
	movl	%edi, %esi
	movq	%rcx, %rax
	leaq	(%r10,%rcx), %r9
.L49:
	cmpq	%r9, %rax
	je	.L68
	movq	80(%rsp), %r11
	movl	%esi, %edx
	movq	24(%rsp), %r14
	addq	%r11, %rdx
	movzbl	(%rdx), %r11d
	movl	%r11d, (%r14,%rax,4)
	movzbl	1(%rdx), %r11d
	movq	40(%rsp), %r14
	movzbl	2(%rdx), %edx
	movl	%r11d, (%r14,%rax,4)
	movq	16(%rsp), %r11
	movl	%edx, (%r11,%rax,4)
	movl	52(%rsp), %edx
	incq	%rax
	addl	%edx, %esi
	jmp	.L49
.L68:
	movq	88(%rsp), %rax
	incl	%r8d
	addq	%rax, %rcx
	movl	68(%rsp), %eax
	addl	%eax, %edi
	jmp	.L46
.L48:
	testl	%r15d, %r15d
	je	.L50
	movl	$32, %edi
	call	malloc@PLT
	movsd	8(%rsp), %xmm0
	movsd	.LC22(%rip), %xmm2
	movq	%rax, %r12
	mulsd	%xmm0, %xmm0
	movaps	%xmm2, %xmm6
	mulsd	%xmm0, %xmm0
	divsd	%xmm0, %xmm6
	movsd	8(%rsp), %xmm0
	mulsd	.LC23(%rip), %xmm0
	addsd	.LC24(%rip), %xmm0
	mulsd	8(%rsp), %xmm0
	subsd	.LC25(%rip), %xmm0
	mulsd	8(%rsp), %xmm0
	addsd	.LC26(%rip), %xmm0
	mulsd	%xmm6, %xmm0
	movsd	%xmm6, 72(%rsp)
	call	exp@PLT
	movsd	%xmm0, 104(%rsp)
	movsd	8(%rsp), %xmm0
	mulsd	.LC27(%rip), %xmm0
	addsd	.LC28(%rip), %xmm0
	mulsd	8(%rsp), %xmm0
	subsd	.LC29(%rip), %xmm0
	mulsd	8(%rsp), %xmm0
	addsd	.LC30(%rip), %xmm0
	mulsd	72(%rsp), %xmm0
	call	cos@PLT
	movsd	%xmm0, 96(%rsp)
	movsd	8(%rsp), %xmm0
	mulsd	.LC31(%rip), %xmm0
	subsd	.LC32(%rip), %xmm0
	mulsd	8(%rsp), %xmm0
	subsd	.LC33(%rip), %xmm0
	mulsd	8(%rsp), %xmm0
	subsd	.LC34(%rip), %xmm0
	mulsd	72(%rsp), %xmm0
	call	exp@PLT
	movsd	104(%rsp), %xmm1
	movsd	.LC22(%rip), %xmm2
	movaps	%xmm0, %xmm3
	movaps	%xmm1, %xmm5
	movaps	%xmm2, %xmm4
	movsd	%xmm2, (%r12)
	mulsd	%xmm1, %xmm5
	mulsd	96(%rsp), %xmm1
	mulsd	%xmm5, %xmm3
	addsd	%xmm1, %xmm1
	divsd	%xmm3, %xmm4
	movaps	%xmm1, %xmm3
	mulsd	%xmm0, %xmm1
	addsd	%xmm0, %xmm3
	xorps	.LC35(%rip), %xmm3
	addsd	%xmm5, %xmm1
	mulsd	%xmm4, %xmm3
	movsd	%xmm4, 24(%r12)
	mulsd	%xmm4, %xmm1
	movsd	%xmm3, 16(%r12)
	movsd	%xmm1, 8(%r12)
	call	clock@PLT
	pushq	%r13
	.cfi_def_cfa_offset 1240
	movq	%r12, %r9
	pushq	%rbp
	.cfi_def_cfa_offset 1248
	movq	%rax, %r14
	pushq	$3
	.cfi_def_cfa_offset 1256
	pushq	$1
	.cfi_def_cfa_offset 1264
	movq	48(%rsp), %r8
	movq	72(%rsp), %rcx
	movq	56(%rsp), %rdx
	movl	80(%rsp), %esi
	movl	96(%rsp), %edi
	call	_Z25host_recursivegaussfilteriiPjS_S_Pdiiii
	addq	$32, %rsp
	.cfi_def_cfa_offset 1232
	call	clock@PLT
	subq	%r14, %rax
.L63:
	cvtsi2sdq	%rax, %xmm0
	leaq	.LC37(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	divsd	.LC36(%rip), %xmm0
	call	__printf_chk@PLT
	movq	%r12, %rdi
	movl	%ebp, %ebp
	call	free@PLT
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L51
.L50:
	movsd	8(%rsp), %xmm0
	mulsd	.LC38(%rip), %xmm0
	cvttsd2sil	%xmm0, %r14d
	leal	1(%r14,%r14), %edi
	movl	%r14d, %r15d
	movslq	%edi, %rdi
	negl	%r15d
	salq	$3, %rdi
	movslq	%r15d, %r15
	call	malloc@PLT
	movq	%rax, %r12
	movslq	%r14d, %rax
	leaq	(%r12,%rax,8), %rax
.L52:
	cmpl	%r15d, %r14d
	jl	.L69
	cvtsi2sdl	%r15d, %xmm1
	movq	%rax, 72(%rsp)
	movaps	%xmm1, %xmm0
	xorps	.LC35(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	movsd	8(%rsp), %xmm1
	addsd	%xmm1, %xmm1
	mulsd	8(%rsp), %xmm1
	divsd	%xmm1, %xmm0
	call	exp@PLT
	movq	72(%rsp), %rax
	movsd	%xmm0, (%rax,%r15,8)
	incq	%r15
	jmp	.L52
.L69:
	call	clock@PLT
	movq	%r12, %r9
	movq	%rax, %r15
	pushq	%rax
	.cfi_def_cfa_offset 1240
	pushq	%r13
	.cfi_def_cfa_offset 1248
	pushq	%rbp
	.cfi_def_cfa_offset 1256
	pushq	%r14
	.cfi_def_cfa_offset 1264
	movq	48(%rsp), %r8
	movq	72(%rsp), %rcx
	movq	56(%rsp), %rdx
	movl	80(%rsp), %esi
	movl	96(%rsp), %edi
	call	_Z23host_defaultgaussfilteriiPjS_S_Pdiii
	addq	$32, %rsp
	.cfi_def_cfa_offset 1232
	call	clock@PLT
	subq	%r15, %rax
	jmp	.L63
.L70:
	movq	88(%rsp), %rax
	incl	%r8d
	addq	%rax, %rcx
	movl	68(%rsp), %eax
	addl	%eax, %edi
.L51:
	cmpl	%r13d, %r8d
	je	.L56
	movl	%edi, %esi
	movq	%rcx, %rax
	leaq	(%rcx,%rbp), %r9
.L57:
	cmpq	%r9, %rax
	je	.L70
	movq	80(%rsp), %r10
	movq	24(%rsp), %r11
	movl	%esi, %edx
	addq	%r10, %rdx
	movl	(%r11,%rax,4), %r10d
	movq	16(%rsp), %r11
	movb	%r10b, (%rdx)
	movq	40(%rsp), %r10
	movl	(%r10,%rax,4), %r10d
	movb	%r10b, 1(%rdx)
	movl	(%r11,%rax,4), %r10d
	incq	%rax
	movb	%r10b, 2(%rdx)
	movl	52(%rsp), %edx
	addl	%edx, %esi
	jmp	.L57
.L56:
	movq	24(%rsp), %rdi
	call	free@PLT
	movq	40(%rsp), %rdi
	call	free@PLT
	movq	16(%rsp), %rdi
	call	free@PLT
	movq	56(%rsp), %rdi
	leaq	.LC39(%rip), %rsi
	call	fopen@PLT
	movq	%rax, %rbp
	testq	%rax, %rax
	jne	.L58
	movq	56(%rsp), %rcx
	jmp	.L66
.L58:
	movq	32(%rsp), %rdx
	movq	%rax, %rcx
	movl	$1, %esi
	movq	%rbx, %rdi
	call	fwrite@PLT
	movq	32(%rsp), %rdx
	leaq	.LC40(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	fclose@PLT
	call	cudaDeviceReset@PLT
	xorl	%edi, %edi
	jmp	.L65
	.cfi_endproc
.LFE3637:
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	description
	.section	.rodata.str1.1
.LC41:
	.string	"gauss filtering"
	.section	.data.rel.local,"aw"
	.align 8
	.type	description, @object
	.size	description, 8
description:
	.quad	.LC41
	.globl	title
	.align 8
	.type	title, @object
	.size	title, 8
title:
	.quad	.LC41
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC22:
	.long	0
	.long	1072693248
	.align 8
.LC23:
	.long	-886811103
	.long	1072844526
	.align 8
.LC24:
	.long	309237645
	.long	1066057859
	.align 8
.LC25:
	.long	-683621355
	.long	1072169150
	.align 8
.LC26:
	.long	-74766791
	.long	1070615695
	.align 8
.LC27:
	.long	-1695172052
	.long	1073075230
	.align 8
.LC28:
	.long	1910676331
	.long	1065495889
	.align 8
.LC29:
	.long	-1896932436
	.long	1070912908
	.align 8
.LC30:
	.long	716331825
	.long	1070812610
	.align 8
.LC31:
	.long	315944666
	.long	1072944609
	.align 8
.LC32:
	.long	1060533941
	.long	1059425369
	.align 8
.LC33:
	.long	1943111924
	.long	1071930635
	.align 8
.LC34:
	.long	-1179666025
	.long	1068200537
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC35:
	.long	0
	.long	-2147483648
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC36:
	.long	0
	.long	1093567616
	.align 8
.LC38:
	.long	0
	.long	1074266112
	.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:

﻿char *title = "gauss filtering";
char *description = "gauss filtering";

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <assert.h>
#include <time.h>
#include <hip/hip_runtime.h>

#include <math.h>       /* exp */

#ifndef max
#define max( a, b ) ( ((a) > (b)) ? (a) : (b) )
#endif

#ifndef min
#define min( a, b ) ( ((a) < (b)) ? (a) : (b) )
#endif

#ifndef uint8_t
typedef unsigned char uint8_t;
#endif

#ifndef uint16_t
typedef unsigned short uint16_t;
#endif

#ifndef uint32_t
typedef unsigned int uint32_t;
#endif

// http://en.wikipedia.org/wiki/BMP_file_format
#define BMPMAGIC	0x00
#define BMPFILESIZE	0x02
#define BMPOFFSET	0x0A
#define BMPDIBSISE	0x0E
#define BMPWIDTH	0x12
#define BMPHEIGHT	0x16
#define BMPBITSPERPIXEL	0x1C

typedef struct {
	uint8_t magic[2];   /* the magic number used to identify the BMP file:
						0x42 0x4D (Hex code points for B and M).
						The following entries are possible:
						BM - Windows 3.1x, 95, NT, ... etc
						BA - OS/2 Bitmap Array
						CI - OS/2 Color Icon
						CP - OS/2 Color Pointer
						IC - OS/2 Icon
						PT - OS/2 Pointer. */
	uint32_t filesz;    /* the size of the BMP file in bytes */
	uint16_t creator1;  /* reserved. */
	uint16_t creator2;  /* reserved. */
	uint32_t offset;    /* the offset, i.e. starting address,
						of the byte where the bitmap data can be found. */
} bmp_header_t;

typedef struct {
	uint32_t header_sz;     /* the size of this header (40 bytes) */
	uint32_t width;         /* the bitmap width in pixels */
	uint32_t height;        /* the bitmap height in pixels */
	uint16_t nplanes;       /* the number of color planes being used.
							Must be set to 1. */
	uint16_t depth;         /* the number of bits per pixel,
							which is the color depth of the image.
							Typical values are 1, 4, 8, 16, 24 and 32. */
	uint32_t compress_type; /* the compression method being used.
							See also bmp_compression_method_t. */
	uint32_t bmp_bytesz;    /* the image size. This is the size of the raw bitmap
							data (see below), and should not be confused
							with the file size. */
	uint32_t hres;          /* the horizontal resolution of the image.
							(pixel per meter) */
	uint32_t vres;          /* the vertical resolution of the image.
							(pixel per meter) */
	uint32_t ncolors;       /* the number of colors in the color palette,
							or 0 to default to 2<sup><i>n</i></sup>. */
	uint32_t nimpcolors;    /* the number of important colors used,
							or 0 when every color is important;
							generally ignored. */
} bmp_dib_v3_header_t;

__global__ void global_defaultgaussfilter(
	unsigned int *input,
	unsigned int *output,
	double *matrix,	int Nh,
	int width,int height,
	int ddxx, int ddyy)
{
	assert(ddxx*ddyy==0);

	if(ddxx>0) for (int id = blockDim.x*blockIdx.x + threadIdx.x;
	id < width*height;
	id += blockDim.x*gridDim.x) {
		int x = id % width;
		int y = id / width;

		double s1 = 0;
		double s2 = 0;
		for (int dx = -Nh; dx <= Nh; dx++) {
			if (x + dx < 0) continue;
			if (x + dx >= width) continue;
			int value = (double)(unsigned int)input[id + dx];
			s1 += value*matrix[Nh + dx];
			s2 += matrix[Nh + dx];
		}
		output[id] = (unsigned int)(s1 / s2);
	}
	if(ddyy>0) for (int id = blockDim.x*blockIdx.x + threadIdx.x;
	id < width*height;
	id += blockDim.x*gridDim.x) {
		int x = id % width;
		int y = id / width;

		double s1 = 0;
		double s2 = 0;
		for (int dy = -Nh; dy <= Nh; dy++) {
			if (y + dy < 0) continue;
			if (y + dy >= height) continue;
			int value = (double)(unsigned int)input[id + width*dy];
			s1 += value*matrix[Nh + dy];
			s2 += matrix[Nh + dy];
		}
		output[id] = (unsigned int)(s1 / s2);
	}
}


__host__ void host_defaultgaussfilter(
	int gridSize, int blockSize, 
	unsigned int *r, unsigned int *g, unsigned int *b, 
	double *matrix, int Nh, 
	int width, int height)
{
	unsigned int *channel[3] = { r,g,b };

	// channel - массив данных
	// sigma - коэффициент размытия
	// width - ширина
	// height - высота

	hipError_t err;
	unsigned int *device_a;
	unsigned int *device_b;
	double *device_matrix;

	err = hipMalloc((void**)&device_a, width*height*sizeof(unsigned int));
	err = hipMalloc((void**)&device_b, width*height*sizeof(unsigned int));
	err = hipMalloc((void**)&device_matrix, (2 * Nh + 1) * sizeof(double));
	hipMemcpy(device_matrix, matrix, (2 * Nh + 1)*sizeof(double), hipMemcpyHostToDevice);

	int blocks = (gridSize > 0)? gridSize : min(15, (int)sqrt(width*height));
	int threads = (blockSize > 0)? blockSize : min(15, (int)sqrt(width*height));

	for(int j=0; j<3; j++) {
		hipMemcpy(device_a, channel[j], width*height*sizeof(unsigned int), hipMemcpyHostToDevice);

		global_defaultgaussfilter <<< blocks, threads >>>(device_a, device_b, device_matrix, Nh, width, height, 0, 1);
		global_defaultgaussfilter <<< blocks, threads >>>(device_b, device_a, device_matrix, Nh, width, height, 1, 0);

		hipMemcpy(channel[j], device_a, width*height*sizeof(unsigned int), hipMemcpyDeviceToHost);
	}

	// Освобождаем память на устройстве
	hipFree((void*)device_a);
	hipFree((void*)device_b);
	hipFree((void*)device_matrix);

	err = err;
}

__global__ void global_recursivegaussfilter(
	unsigned int *input,
	unsigned int *output,
	double *bb,	int p, int q,
	int width,int height,
	int ddxx, int ddyy)
{
	assert(p==1);
	assert(q==3);
	assert(ddxx*ddyy==0);

	// Копируем в локальные переменные для ускорения доступа к значениям
	double b1 = bb[1]/bb[0];
	double b2 = bb[2]/bb[0];
	double b3 = bb[3]/bb[0];
	double B = 1.0 - (b1+b2+b3);

	if(ddxx>0) for (int y = blockDim.x*blockIdx.x + threadIdx.x;
	y < height;
	y += blockDim.x*gridDim.x) {
		int id = y*width;
		if(width>1) output[id]=B*input[id];id++;
		if(width>2) output[id]=B*input[id]+b1*output[id-1];id++;
		if(width>3) output[id]=B*input[id]+b1*output[id-1]+b2*output[id-2];id++;
		for(; id<width; id++) 
			output[id]=B*input[id]+b1*output[id-1]+b2*output[id-2]+b3*output[id-3];
	}
	if(ddxx<0) for (int y = blockDim.x*blockIdx.x + threadIdx.x;
	y < height;
	y += blockDim.x*gridDim.x) {
		int id = y*width+width;
		id--;if(width>1) output[id]=B*input[id];
		id--;if(width>2) output[id]=B*input[id]+b1*output[id+1];
		id--;if(width>3) output[id]=B*input[id]+b1*output[id+1]+b2*output[id+2];
		for(id--; id>=0; id--) 
			output[id]=B*input[id]+b1*output[id+1]+b2*output[id+2]+b3*output[id+3];
	}
	if(ddyy>0) for (int x = blockDim.x*blockIdx.x + threadIdx.x;
	x < width;
	x += blockDim.x*gridDim.x) {
		int id = x;
		if(height>1) output[id]=B*input[id];id+=width;
		if(height>2) output[id]=B*input[id]+b1*output[id-width];id+=width;
		if(height>3) output[id]=B*input[id]+b1*output[id-width]+b2*output[id-2*width];id+=width;
		for(int y=3; y<height; y++, id+=width) 
			output[id]=B*input[id]+b1*output[id-width]+b2*output[id-2*width]+b3*output[id-3*width];
	}
	if(ddyy<0) for (int x = blockDim.x*blockIdx.x + threadIdx.x;
	x < width;
	x += blockDim.x*gridDim.x){
		int id = height*width+x;
		id-=width;if(height>1) output[id]=B*input[id];
		id-=width;if(height>2) output[id]=B*input[id]+b1*output[id+width];
		id-=width;if(height>3) output[id]=B*input[id]+b1*output[id+width]+b2*output[id+2*width];
		for(id-=width; id>=0; id-=width) 
			output[id]=B*input[id]+b1*output[id+width]+b2*output[id+2*width]+b3*output[id+3*width];
	}
}

__host__ void host_recursivegaussfilter(
	int gridSize, int blockSize, 
	unsigned int *r, unsigned int *g, unsigned int *b, 
	double *bb, int p, int q, 
	int width, int height)
{

	unsigned int *channel[3] = { r,g,b };

	// channel - массив данных
	// sigma - коэффициенты
	// width - ширина
	// height - высота

	hipError_t err;
	unsigned int *device_a;
	unsigned int *device_b;
	double *device_bb;

	err = hipMalloc((void**)&device_a, width*height*sizeof(unsigned int));
	err = hipMalloc((void**)&device_b, width*height*sizeof(unsigned int));
	err = hipMalloc((void**)&device_bb, (p+q) * sizeof(double));
	hipMemcpy(device_bb, bb, (p+q)*sizeof(double), hipMemcpyHostToDevice);

	int blocks = (gridSize > 0)? gridSize : min(15, (int)sqrt(max(width,height)));
	int threads = (blockSize > 0)? blockSize : min(15, (int)sqrt(max(width,height)));

	for(int j=0; j<3; j++) {
		hipMemcpy(device_a, channel[j], width*height*sizeof(unsigned int), hipMemcpyHostToDevice);

		global_recursivegaussfilter <<< blocks, threads >>>(device_a, device_b, device_bb, p, q, width, height, 0, 1);
		global_recursivegaussfilter <<< blocks, threads >>>(device_b, device_a, device_bb, p, q, width, height, 0, -1);
		global_recursivegaussfilter <<< blocks, threads >>>(device_a, device_b, device_bb, p, q, width, height, 1, 0);
		global_recursivegaussfilter <<< blocks, threads >>>(device_b, device_a, device_bb, p, q, width, height, -1, 0);

		hipMemcpy(channel[j], device_a, width*height*sizeof(unsigned int), hipMemcpyDeviceToHost);
	}

	// Освобождаем память на устройстве
	hipFree((void*)device_a);
	hipFree((void*)device_b);
	hipFree((void*)device_bb);

	err = err;
}

#define RECURSIVE 1
#define DEFAULT 0

int main(int argc, char* argv[])
{
	int i, j;

	std::cout << title << std::endl;

	// Find/set the device.
	int device_count = 0;
	hipGetDeviceCount(&device_count);
	for (i = 0; i < device_count; ++i)
	{
		hipDeviceProp_t properties;
		hipGetDeviceProperties(&properties, i);
		std::cout << "Running on GPU " << i << " (" << properties.name << ")" << std::endl;
	}

	if (argc < 5){
		printf("Usage :\t%s filter sigma inputfilename.bmp ouputfilename.bmp\n", argv[0]);
		printf("filter :\tgauss recursivegauss\n");
		exit(-1);
	}

	// Получаем параметры - имена файлов

	char *filter = argv[1];
	double sigma = atof(argv[2]);
	char *inputFileName = argv[3];
	char *outputFileName = argv[4];
	int gridSize = (argc>5)?atoi(argv[5]):0;
	int blockSize = (argc>6)?atoi(argv[6]):0;
	int mode =(strcmp(filter,"gauss")==0)?DEFAULT:RECURSIVE;

	printf("Title :\t%s\n", title);
	printf("Description :\t%s\n", description);
	printf("Filter :\t%s\n", filter);
	printf("Sigma :\t%le\n", sigma);
	printf("Input file name :\t%s\n", inputFileName);
	printf("Output file name :\t%s\n", outputFileName);

	FILE *file = fopen(inputFileName, "rb");
	if (!file) { 
		fprintf(stderr, "Open file error (%s)\n", inputFileName); 
		fflush(stderr); 
		exit(-1); 
	}
	fseek(file, 0L, SEEK_END);
	long size = ftell(file);
	unsigned char *buffer = (unsigned char *)malloc((size_t)size);
	fseek(file, 0L, SEEK_SET);
	fread((void*)buffer, (size_t)1, (size_t)size, file);
	fclose(file);

	uint32_t width = *(uint32_t *)&buffer[BMPWIDTH];
	uint32_t height = *(uint32_t *)&buffer[BMPHEIGHT];
	uint32_t file_size = *(uint32_t *)&buffer[BMPFILESIZE];
	uint32_t offset = *(uint32_t *)&buffer[BMPOFFSET];
	uint16_t bits_per_pixel = *(uint16_t *)&buffer[BMPBITSPERPIXEL];
	uint16_t bytes_per_pixel = ((int)((bits_per_pixel+7)/8));
	uint32_t bytes_per_line = ((int)((bits_per_pixel * width+31)/32))*4; // http://en.wikipedia.org/wiki/BMP_file_format

	printf("BMP image size :\t%ld x %ld\n", width, height);
	printf("BMP file size :\t%ld\n", file_size);
	printf("BMP pixels offset :\t%ld\n", offset);
	printf("BMP bits per pixel :\t%d\n", bits_per_pixel);
	printf("BMP bytes per pixel :\t%d\n", bytes_per_pixel);
	printf("BMP bytes per line :\t%d\n", bytes_per_line);

	uint8_t *pixels =(uint8_t *)&buffer[offset];
	uint8_t *pixel;
	uint32_t x, y;

	/* выделение памяти под байтовые цветовые каналы */
	int count = width*height;
	unsigned int* channel[3];
	for (j = 0; j < 3; j++)
		channel[j] = (unsigned int*)malloc(count*sizeof(unsigned int));

	int pos = 0;
	for (y = 0; y < height; y++) {
		for (x = 0; x < width; x++) {
			pixel = &pixels[y*bytes_per_line+x*bytes_per_pixel];
			channel[0][pos] = (unsigned int)pixel[0];
			channel[1][pos] = (unsigned int)pixel[1];
			channel[2][pos] = (unsigned int)pixel[2];
			pos++;
		}
	}

	switch(mode){
	case RECURSIVE:{
		int p = 1, q = 3;
		double * bb = (double*)malloc((p+q)*sizeof(double));

		//// http://mognovse.ru/qgi-chekan-rostislav-vladimirovich.html
		//// cтандартные рекомендации по выбору константы q представляют собой:
		//double qq;
		//if(sigma>2.5) qq=0.98711*sigma - 0.96330;
		//else if(sigma>0.5) qq=3.97156 - 4.14554*sqrt(1.0 - 0.26891*sigma);
		//else qq=3.97156 - 4.14554*sqrt(1.0 - 0.26891*sigma);

		//double qq2 = qq*qq;
		//double qq3 = qq2*qq;

		//bb[0] = 1.5725 + 2.44413*qq + 1.4281*qq2;
		//bb[1] = 2.44413*qq + 2.85619*qq2 + 1.26661*qq3;
		//bb[2] = -1.4281*qq2 - 1.26661*qq3;
		//bb[3] = 0.422205*qq3;

		// http://habrahabr.ru/post/151157/
		double sigma_inv_4;

		sigma_inv_4 = sigma*sigma; sigma_inv_4 = 1.0/(sigma_inv_4*sigma_inv_4);

		double coef_A = sigma_inv_4*(sigma*(sigma*(sigma*1.1442707+0.0130625)-0.7500910)+0.2546730);
		double coef_W = sigma_inv_4*(sigma*(sigma*(sigma*1.3642870+0.0088755)-0.3255340)+0.3016210);
		double coef_B = sigma_inv_4*(sigma*(sigma*(sigma*1.2397166-0.0001644)-0.6363580)-0.0536068);

		double z0_abs   = exp(coef_A);

		double z0_real  = z0_abs*cos(coef_W);
		double z0_im    = z0_abs*sin(coef_W);
		double z2       = exp(coef_B);

		double z0_abs_2 = z0_abs*z0_abs;

		bb[3] = 1.0/(z2*z0_abs_2);
		bb[2] = -(2*z0_real+z2)*bb[3];
		bb[1] = (z0_abs_2+2*z0_real*z2)*bb[3];
		bb[0] = 1.0;

		clock_t t1, t2;
		t1 = clock();

		host_recursivegaussfilter(gridSize, blockSize, 
			channel[0], channel[1], channel[2], 
			bb, p, q,
			width, height);

		t2 = clock();
		double seconds = ((double)(t2-t1))/CLOCKS_PER_SEC;
		printf("Execution time :\t%le\n", seconds);

		free(bb);
				   }
				   break;
	default:{
		// Nh - полуразмер
		int Nh = (int)(3 * sigma);

		double * matrix = (double*)malloc((2 * Nh + 1)*sizeof(double));
		for (int i = -Nh; i <= Nh; i++) matrix[Nh + i] = exp(-(double)i*i / (2.0*sigma*sigma));

		clock_t t1, t2;
		t1 = clock();

		host_defaultgaussfilter(gridSize, blockSize, 
			channel[0], channel[1], channel[2], 
			matrix, Nh, 
			width, height);

		t2 = clock();
		double seconds = ((double)(t2-t1))/CLOCKS_PER_SEC;
		printf("Execution time :\t%le\n", seconds);

		free(matrix);
			}
			break;
	}

	pos = 0;
	for (y = 0; y < height; y++) {
		for (x = 0; x < width; x++) {
			pixel = &pixels[y*bytes_per_line+x*bytes_per_pixel];
			pixel[0] = (uint8_t)channel[0][pos];
			pixel[1] = (uint8_t)channel[1][pos];
			pixel[2] = (uint8_t)channel[2][pos];
			pos++;
		}
	}
	/* высвобождаем массивы */
	for (j = 0; j < 3; j++)
		free(channel[j]);

	/* выводим результаты */
	file = fopen(outputFileName, "wb");
	if (!file) {
		fprintf(stderr, "Open file error (%s)\n", outputFileName); 
		fflush(stderr);
		exit(-1);
	}
	fwrite((void*)buffer, (size_t)1, (size_t)size, file);
	printf("Output file size :\t%ld\n", size);
	free(buffer);
	fclose(file);

	hipDeviceReset();

	exit(0);
}
	.text
	.file	"cudagaussfilter.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z40__device_stub__global_defaultgaussfilterPjS_Pdiiiii # -- Begin function _Z40__device_stub__global_defaultgaussfilterPjS_Pdiiiii
	.type	_Z40__device_stub__global_defaultgaussfilterPjS_Pdiiiii,@function
_Z40__device_stub__global_defaultgaussfilterPjS_Pdiiiii: # @_Z40__device_stub__global_defaultgaussfilterPjS_Pdiiiii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	216(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z25global_defaultgaussfilterPjS_Pdiiiii, %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_end0:
	.size	_Z40__device_stub__global_defaultgaussfilterPjS_Pdiiiii, .Lfunc_end0-_Z40__device_stub__global_defaultgaussfilterPjS_Pdiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z23host_defaultgaussfilteriiPjS_S_Pdiii # -- Begin function _Z23host_defaultgaussfilteriiPjS_S_Pdiii
	.type	_Z23host_defaultgaussfilteriiPjS_S_Pdiii,@function
_Z23host_defaultgaussfilteriiPjS_S_Pdiii: # @_Z23host_defaultgaussfilteriiPjS_S_Pdiii
	.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	$72, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 16(%rsp)                   # 8-byte Spill
	movl	%esi, 24(%rsp)                  # 4-byte Spill
	movl	%edi, %ebx
	movl	144(%rsp), %ebp
	movl	128(%rsp), %r14d
	movq	%rdx, 48(%rsp)
	movq	%rcx, 56(%rsp)
	movq	%r8, 64(%rsp)
	imull	136(%rsp), %ebp
	movslq	%ebp, %r15
	shlq	$2, %r15
	leaq	8(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	leaq	40(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	leal	1(,%r14,2), %eax
	movslq	%eax, %r12
	shlq	$3, %r12
	leaq	32(%rsp), %r13
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movq	(%r13), %rdi
	movq	16(%rsp), %rsi                  # 8-byte Reload
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%ebx, %ebx
	jg	.LBB1_9
# %bb.1:
	cvtsi2sd	%ebp, %xmm1
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm0, %xmm1
	jb	.LBB1_3
# %bb.2:
	xorps	%xmm0, %xmm0
	sqrtsd	%xmm1, %xmm0
	jmp	.LBB1_4
.LBB1_3:                                # %call.sqrt
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 16(%rsp)                 # 8-byte Spill
	callq	sqrt
	movsd	16(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
.LBB1_4:                                # %.split
	cvttsd2si	%xmm0, %eax
	movl	$15, %ebx
	cmpl	$15, %eax
	jg	.LBB1_9
# %bb.5:
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm0, %xmm1
	jb	.LBB1_7
# %bb.6:
	xorps	%xmm0, %xmm0
	sqrtsd	%xmm1, %xmm0
	jmp	.LBB1_8
.LBB1_7:                                # %call.sqrt61
	movapd	%xmm1, %xmm0
	callq	sqrt
.LBB1_8:                                # %.split60
	cvttsd2si	%xmm0, %ebx
.LBB1_9:
	movl	24(%rsp), %ecx                  # 4-byte Reload
	testl	%ecx, %ecx
	jg	.LBB1_18
# %bb.10:
	xorps	%xmm1, %xmm1
	cvtsi2sd	%ebp, %xmm1
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm0, %xmm1
	jb	.LBB1_12
# %bb.11:
	xorps	%xmm0, %xmm0
	sqrtsd	%xmm1, %xmm0
	jmp	.LBB1_13
.LBB1_12:                               # %call.sqrt63
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 24(%rsp)                 # 8-byte Spill
	callq	sqrt
	movsd	24(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
.LBB1_13:                               # %.split62
	cvttsd2si	%xmm0, %eax
	movl	$15, %ecx
	cmpl	$15, %eax
	jg	.LBB1_18
# %bb.14:
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm0, %xmm1
	jb	.LBB1_16
# %bb.15:
	xorps	%xmm0, %xmm0
	sqrtsd	%xmm1, %xmm0
	jmp	.LBB1_17
.LBB1_16:                               # %call.sqrt65
	movapd	%xmm1, %xmm0
	callq	sqrt
.LBB1_17:                               # %.split64
	cvttsd2si	%xmm0, %ecx
.LBB1_18:
	movl	%ebx, %r13d
	btsq	$32, %r13
	movl	%ecx, %r12d
	btsq	$32, %r12
	xorl	%ebp, %ebp
.LBB1_19:                               # =>This Inner Loop Header: Depth=1
	movq	8(%rsp), %rdi
	movq	48(%rsp,%rbp,8), %rbx
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_21
# %bb.20:                               #   in Loop: Header=BB1_19 Depth=1
	movq	8(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdx
	movl	%r14d, %ecx
	movl	136(%rsp), %r8d
	movl	144(%rsp), %r9d
	pushq	$1
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	callq	_Z40__device_stub__global_defaultgaussfilterPjS_Pdiiiii
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.LBB1_21:                               #   in Loop: Header=BB1_19 Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_23
# %bb.22:                               #   in Loop: Header=BB1_19 Depth=1
	movq	40(%rsp), %rdi
	movq	8(%rsp), %rsi
	movq	32(%rsp), %rdx
	movl	%r14d, %ecx
	movl	136(%rsp), %r8d
	movl	144(%rsp), %r9d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	_Z40__device_stub__global_defaultgaussfilterPjS_Pdiiiii
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.LBB1_23:                               #   in Loop: Header=BB1_19 Depth=1
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	incq	%rbp
	cmpq	$3, %rbp
	jne	.LBB1_19
# %bb.24:
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z23host_defaultgaussfilteriiPjS_S_Pdiii, .Lfunc_end1-_Z23host_defaultgaussfilteriiPjS_S_Pdiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii # -- Begin function _Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii
	.type	_Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii,@function
_Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii: # @_Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$176, %rsp
	.cfi_def_cfa_offset 224
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	224(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	232(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	240(%rsp), %rax
	movq	%rax, 64(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z27global_recursivegaussfilterPjS_Pdiiiiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$192, %rsp
	.cfi_adjust_cfa_offset -192
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii, .Lfunc_end2-_Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z25host_recursivegaussfilteriiPjS_S_Pdiiii # -- Begin function _Z25host_recursivegaussfilteriiPjS_S_Pdiiii
	.type	_Z25host_recursivegaussfilteriiPjS_S_Pdiiii,@function
_Z25host_recursivegaussfilteriiPjS_S_Pdiiii: # @_Z25host_recursivegaussfilteriiPjS_S_Pdiiii
	.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	$72, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 32(%rsp)                   # 8-byte Spill
	movl	%esi, 40(%rsp)                  # 4-byte Spill
	movl	%edi, %r13d
	movl	152(%rsp), %eax
	movl	136(%rsp), %r14d
	movl	128(%rsp), %r15d
	movq	%rdx, 48(%rsp)
	movq	%rcx, 56(%rsp)
	movq	%r8, 64(%rsp)
                                        # kill: def $eax killed $eax killed $rax
	imull	144(%rsp), %eax
	movslq	%eax, %r12
	shlq	$2, %r12
	leaq	8(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	leaq	24(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movq	%r15, %rbx
	leal	(%r14,%r15), %eax
	movslq	%eax, %rbp
	shlq	$3, %rbp
	leaq	16(%rsp), %r14
	movq	%r14, %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
	movq	(%r14), %rdi
	movq	32(%rsp), %rsi                  # 8-byte Reload
	movq	%rbp, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%r13d, %r13d
	jg	.LBB3_9
# %bb.1:
	movl	152(%rsp), %eax
	movl	144(%rsp), %ecx
	cmpl	%eax, %ecx
                                        # kill: def $eax killed $eax killed $rax
	cmovgl	%ecx, %eax
	cvtsi2sd	%eax, %xmm1
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm0, %xmm1
	jb	.LBB3_3
# %bb.2:
	xorps	%xmm0, %xmm0
	sqrtsd	%xmm1, %xmm0
	jmp	.LBB3_4
.LBB3_3:                                # %call.sqrt
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 32(%rsp)                 # 8-byte Spill
	callq	sqrt
	movsd	32(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
.LBB3_4:                                # %.split
	cvttsd2si	%xmm0, %eax
	movl	$15, %r13d
	cmpl	$15, %eax
	jg	.LBB3_9
# %bb.5:
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm0, %xmm1
	jb	.LBB3_7
# %bb.6:
	xorps	%xmm0, %xmm0
	sqrtsd	%xmm1, %xmm0
	jmp	.LBB3_8
.LBB3_7:                                # %call.sqrt107
	movapd	%xmm1, %xmm0
	callq	sqrt
.LBB3_8:                                # %.split106
	cvttsd2si	%xmm0, %r13d
.LBB3_9:
	movl	40(%rsp), %ecx                  # 4-byte Reload
	testl	%ecx, %ecx
	jg	.LBB3_18
# %bb.10:
	movl	152(%rsp), %eax
	movl	144(%rsp), %ecx
	cmpl	%eax, %ecx
                                        # kill: def $eax killed $eax killed $rax
	cmovgl	%ecx, %eax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%eax, %xmm1
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm0, %xmm1
	jb	.LBB3_12
# %bb.11:
	xorps	%xmm0, %xmm0
	sqrtsd	%xmm1, %xmm0
	jmp	.LBB3_13
.LBB3_12:                               # %call.sqrt109
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 40(%rsp)                 # 8-byte Spill
	callq	sqrt
	movsd	40(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
.LBB3_13:                               # %.split108
	cvttsd2si	%xmm0, %eax
	movl	$15, %ecx
	cmpl	$15, %eax
	jg	.LBB3_18
# %bb.14:
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm0, %xmm1
	jb	.LBB3_16
# %bb.15:
	xorps	%xmm0, %xmm0
	sqrtsd	%xmm1, %xmm0
	jmp	.LBB3_17
.LBB3_16:                               # %call.sqrt111
	movapd	%xmm1, %xmm0
	callq	sqrt
.LBB3_17:                               # %.split110
	cvttsd2si	%xmm0, %ecx
.LBB3_18:
	movl	%r13d, %r13d
	btsq	$32, %r13
	movl	%ecx, %ebp
	btsq	$32, %rbp
	xorl	%r15d, %r15d
.LBB3_19:                               # =>This Inner Loop Header: Depth=1
	movq	8(%rsp), %rdi
	movq	48(%rsp,%r15,8), %r14
	movq	%r14, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_21
# %bb.20:                               #   in Loop: Header=BB3_19 Depth=1
	movq	8(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	%ebx, %ecx
	movl	144(%rsp), %r8d
                                        # kill: def $r8d killed $r8d killed $r8
	movl	152(%rsp), %r9d
	pushq	$1
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	movl	176(%rsp), %eax
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	callq	_Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
.LBB3_21:                               #   in Loop: Header=BB3_19 Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_23
# %bb.22:                               #   in Loop: Header=BB3_19 Depth=1
	movq	24(%rsp), %rdi
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rdx
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	%ebx, %ecx
	movl	144(%rsp), %r8d
                                        # kill: def $r8d killed $r8d killed $r8
	movl	152(%rsp), %r9d
	pushq	$-1
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	movl	176(%rsp), %eax
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	callq	_Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
.LBB3_23:                               #   in Loop: Header=BB3_19 Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_25
# %bb.24:                               #   in Loop: Header=BB3_19 Depth=1
	movq	8(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	%ebx, %ecx
	movl	144(%rsp), %r8d
                                        # kill: def $r8d killed $r8d killed $r8
	movl	152(%rsp), %r9d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	movl	176(%rsp), %eax
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	callq	_Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
.LBB3_25:                               #   in Loop: Header=BB3_19 Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_27
# %bb.26:                               #   in Loop: Header=BB3_19 Depth=1
	movq	24(%rsp), %rdi
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rdx
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	%ebx, %ecx
	movl	144(%rsp), %r8d
                                        # kill: def $r8d killed $r8d killed $r8
	movl	152(%rsp), %r9d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$-1
	.cfi_adjust_cfa_offset 8
	movl	176(%rsp), %eax
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	callq	_Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
.LBB3_27:                               #   in Loop: Header=BB3_19 Depth=1
	movq	8(%rsp), %rsi
	movq	%r14, %rdi
	movq	%r12, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	incq	%r15
	cmpq	$3, %r15
	jne	.LBB3_19
# %bb.28:
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z25host_recursivegaussfilteriiPjS_S_Pdiiii, .Lfunc_end3-_Z25host_recursivegaussfilteriiPjS_S_Pdiiii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI4_0:
	.quad	0x3ff0000000000000              # double 1
.LCPI4_1:
	.quad	0x3ff24eeecb245621              # double 1.1442707000000001
.LCPI4_2:
	.quad	0x3f8ac083126e978d              # double 0.013062499999999999
.LCPI4_3:
	.quad	0xbfe800bed740c415              # double -0.75009099999999995
.LCPI4_4:
	.quad	0x3fd04c8ffb8b2639              # double 0.25467299999999998
.LCPI4_5:
	.quad	0x3ff5d41e9af5ba2c              # double 1.364287
.LCPI4_6:
	.quad	0x3f822d5171e29b6b              # double 0.0088754999999999997
.LCPI4_7:
	.quad	0xbfd4d58c8eef1bac              # double -0.32553399999999999
.LCPI4_8:
	.quad	0x3fd34dc22ab25b31              # double 0.30162099999999997
.LCPI4_9:
	.quad	0x3ff3d5e112d4eeda              # double 1.2397165999999999
.LCPI4_10:
	.quad	0xbf258c593f3676b5              # double -1.6440000000000001E-4
.LCPI4_11:
	.quad	0xbfe45d0b73d188f4              # double -0.63635799999999998
.LCPI4_12:
	.quad	0xbfab7259b9afb997              # double -0.053606800000000003
.LCPI4_14:
	.quad	0x4008000000000000              # double 3
.LCPI4_15:
	.quad	0x412e848000000000              # double 1.0E+6
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI4_13:
	.quad	0x8000000000000000              # double -0
	.quad	0x8000000000000000              # double -0
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.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	$1576, %rsp                     # imm = 0x628
	.cfi_def_cfa_offset 1632
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %rbx
	movl	%edi, %ebp
	movq	title(%rip), %r14
	testq	%r14, %r14
	jne	.LBB4_2
# %bb.1:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
	jmp	.LBB4_3
.LBB4_2:
	movq	%r14, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB4_3:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leaq	60(%rsp), %r14
	movl	$0, (%r14)
	movq	%r14, %rdi
	callq	hipGetDeviceCount
	cmpl	$0, (%r14)
	jle	.LBB4_6
# %bb.4:                                # %.lr.ph.preheader
	xorl	%r14d, %r14d
	leaq	96(%rsp), %r15
.LBB4_5:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	hipGetDevicePropertiesR0600
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%r14d, %esi
	callq	_ZNSolsEi
	movq	%rax, %r12
	movl	$.L.str.2, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r15, %rdi
	callq	strlen
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$.L.str.3, %esi
	movl	$1, %edx
	movq	%r12, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r12), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incl	%r14d
	cmpl	60(%rsp), %r14d
	jl	.LBB4_5
.LBB4_6:                                # %._crit_edge
	cmpl	$4, %ebp
	jg	.LBB4_9
# %bb.7:
	movq	(%rbx), %rsi
	movl	$.L.str.4, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.Lstr, %edi
	callq	puts@PLT
	jmp	.LBB4_8
.LBB4_9:
	movq	8(%rbx), %r15
	movq	16(%rbx), %rdi
	callq	atof
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	movq	24(%rbx), %r14
	movq	32(%rbx), %r12
	xorl	%r13d, %r13d
	cmpl	$5, %ebp
	jne	.LBB4_11
# %bb.10:
	movl	$0, 20(%rsp)                    # 4-byte Folded Spill
	jmp	.LBB4_13
.LBB4_11:
	movq	40(%rbx), %rdi
	callq	atoi
	movl	%eax, 20(%rsp)                  # 4-byte Spill
	cmpl	$7, %ebp
	jb	.LBB4_13
# %bb.12:
	movq	48(%rbx), %rdi
	callq	atoi
	movl	%eax, %r13d
.LBB4_13:                               # %.thread
	movl	$.L.str.6, %esi
	movq	%r15, %rdi
	callq	strcmp
	movl	%eax, %ebp
	movq	title(%rip), %rsi
	movl	$.L.str.7, %edi
	xorl	%eax, %eax
	callq	printf
	movq	description(%rip), %rsi
	movl	$.L.str.8, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.9, %edi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.10, %edi
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movl	$.L.str.11, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.12, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.13, %esi
	movq	%r14, %rdi
	callq	fopen
	testq	%rax, %rax
	je	.LBB4_39
# %bb.14:
	movq	%rax, %rbx
	movl	%ebp, 24(%rsp)                  # 4-byte Spill
	movl	%r13d, 36(%rsp)                 # 4-byte Spill
	movq	%r12, 88(%rsp)                  # 8-byte Spill
	xorl	%r15d, %r15d
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$2, %edx
	callq	fseek
	movq	%rbx, %rdi
	callq	ftell
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	malloc
	movq	%rax, %r12
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	fseek
	movl	$1, %esi
	movq	%r12, %rdi
	movq	%r14, 80(%rsp)                  # 8-byte Spill
	movq	%r14, %rdx
	movq	%rbx, %rcx
	callq	fread
	movq	%rbx, %rdi
	callq	fclose
	movl	18(%r12), %r13d
	movl	22(%r12), %edx
	movq	%rdx, 48(%rsp)                  # 8-byte Spill
	movl	2(%r12), %eax
	movl	%eax, 16(%rsp)                  # 4-byte Spill
	movl	10(%r12), %eax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movzwl	28(%r12), %ebx
	leal	7(%rbx), %ebp
	shrl	$3, %ebp
	movl	%r13d, %r14d
	imull	%ebx, %r14d
	addl	$31, %r14d
	shrl	$3, %r14d
	andl	$-4, %r14d
	movl	$.L.str.15, %edi
	movl	%r13d, %esi
                                        # kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.16, %edi
	movl	16(%rsp), %esi                  # 4-byte Reload
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.17, %edi
	movq	8(%rsp), %rsi                   # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.18, %edi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.19, %edi
	movl	%ebp, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.20, %edi
	movl	%r14d, 16(%rsp)                 # 4-byte Spill
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	printf
	movl	%r13d, %eax
	imull	48(%rsp), %eax                  # 4-byte Folded Reload
	movslq	%eax, %rbx
	shlq	$2, %rbx
.LBB4_15:                               # =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 96(%rsp,%r15,8)
	incq	%r15
	cmpq	$3, %r15
	jne	.LBB4_15
# %bb.16:                               # %.preheader195
	addq	8(%rsp), %r12                   # 8-byte Folded Reload
	movq	48(%rsp), %r15                  # 8-byte Reload
	testl	%r15d, %r15d
	je	.LBB4_23
# %bb.17:                               # %.preheader194.lr.ph
	movq	96(%rsp), %rax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movq	104(%rsp), %rcx
	xorl	%edx, %edx
	movq	112(%rsp), %rsi
	xorl	%edi, %edi
	xorl	%r8d, %r8d
.LBB4_18:                               # %.preheader194
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_20 Depth 2
	testq	%r13, %r13
	je	.LBB4_22
# %bb.19:                               # %.lr.ph200
                                        #   in Loop: Header=BB4_18 Depth=1
	movslq	%r8d, %r11
	movq	8(%rsp), %rax                   # 8-byte Reload
	leaq	(%rax,%r11,4), %r9
	leaq	(%rcx,%r11,4), %r10
	leaq	(%rsi,%r11,4), %rbx
	movl	%edx, %r14d
	xorl	%r11d, %r11d
.LBB4_20:                               #   Parent Loop BB4_18 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r14d, %r15d
	movzbl	(%r12,%r15), %eax
	movl	%eax, (%r9,%r11,4)
	movzbl	1(%r12,%r15), %eax
	movl	%eax, (%r10,%r11,4)
	movzbl	2(%r12,%r15), %eax
	movl	%eax, (%rbx,%r11,4)
	incq	%r11
	addl	%ebp, %r14d
	cmpq	%r11, %r13
	jne	.LBB4_20
# %bb.21:                               # %._crit_edge201.loopexit
                                        #   in Loop: Header=BB4_18 Depth=1
	addl	%r11d, %r8d
	movq	48(%rsp), %r15                  # 8-byte Reload
.LBB4_22:                               # %._crit_edge201
                                        #   in Loop: Header=BB4_18 Depth=1
	incl	%edi
	addl	16(%rsp), %edx                  # 4-byte Folded Reload
	cmpl	%r15d, %edi
	jne	.LBB4_18
.LBB4_23:                               # %._crit_edge204
	cmpl	$0, 24(%rsp)                    # 4-byte Folded Reload
	jne	.LBB4_28
# %bb.24:
	movsd	.LCPI4_14(%rip), %xmm0          # xmm0 = mem[0],zero
	mulsd	(%rsp), %xmm0                   # 8-byte Folded Reload
	cvttsd2si	%xmm0, %ebx
	leal	1(,%rbx,2), %eax
	movslq	%eax, %rdi
	shlq	$3, %rdi
	callq	malloc
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movq	%rbx, 64(%rsp)                  # 8-byte Spill
	testl	%ebx, %ebx
	js	.LBB4_27
# %bb.25:                               # %.lr.ph208
	movq	64(%rsp), %rdx                  # 8-byte Reload
	movl	%edx, %eax
	negl	%eax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movsd	(%rsp), %xmm1                   # 8-byte Reload
                                        # xmm1 = mem[0],zero
	movapd	%xmm1, %xmm0
	addsd	%xmm1, %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	movl	%edx, %eax
	shlq	$3, %rax
	movslq	%edx, %rcx
	shlq	$3, %rcx
	subq	%rcx, %rax
	movq	40(%rsp), %r15                  # 8-byte Reload
	addq	%rax, %r15
	leal	(%rdx,%rdx), %r14d
	orq	$1, %r14
	xorl	%ebx, %ebx
.LBB4_26:                               # =>This Inner Loop Header: Depth=1
	movq	8(%rsp), %rax                   # 8-byte Reload
	addl	%ebx, %eax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%eax, %xmm1
	movapd	%xmm1, %xmm0
	xorpd	.LCPI4_13(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	divsd	(%rsp), %xmm0                   # 8-byte Folded Reload
	callq	exp
	movsd	%xmm0, (%r15,%rbx,8)
	incq	%rbx
	cmpl	%ebx, %r14d
	jne	.LBB4_26
.LBB4_27:                               # %._crit_edge209
	callq	clock
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	96(%rsp), %rdx
	movq	104(%rsp), %rcx
	movq	112(%rsp), %r8
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	28(%rsp), %edi                  # 4-byte Reload
	movl	44(%rsp), %esi                  # 4-byte Reload
	movq	%rdx, 16(%rsp)                  # 8-byte Spill
	movq	%rcx, 8(%rsp)                   # 8-byte Spill
	movq	%r8, %rbx
	movq	48(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %r9
	movq	56(%rsp), %r15                  # 8-byte Reload
	pushq	%r15
	.cfi_adjust_cfa_offset 8
	pushq	%r13
	.cfi_adjust_cfa_offset 8
	pushq	88(%rsp)                        # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	callq	_Z23host_defaultgaussfilteriiPjS_S_Pdiii
	jmp	.LBB4_29
.LBB4_28:
	.cfi_def_cfa_offset 1632
	movl	$32, %edi
	callq	malloc
	movq	%rax, %r14
	movsd	(%rsp), %xmm3                   # 8-byte Reload
                                        # xmm3 = mem[0],zero
	movapd	%xmm3, %xmm2
	mulsd	%xmm3, %xmm2
	mulsd	%xmm2, %xmm2
	movsd	.LCPI4_1(%rip), %xmm0           # xmm0 = mem[0],zero
	mulsd	%xmm3, %xmm0
	addsd	.LCPI4_2(%rip), %xmm0
	movsd	.LCPI4_0(%rip), %xmm1           # xmm1 = mem[0],zero
	mulsd	%xmm3, %xmm0
	addsd	.LCPI4_3(%rip), %xmm0
	mulsd	%xmm3, %xmm0
	addsd	.LCPI4_4(%rip), %xmm0
	movsd	.LCPI4_5(%rip), %xmm4           # xmm4 = mem[0],zero
	mulsd	%xmm3, %xmm4
	addsd	.LCPI4_6(%rip), %xmm4
	divsd	%xmm2, %xmm1
	mulsd	%xmm3, %xmm4
	addsd	.LCPI4_7(%rip), %xmm4
	mulsd	%xmm1, %xmm0
	mulsd	%xmm3, %xmm4
	addsd	.LCPI4_8(%rip), %xmm4
	movsd	.LCPI4_9(%rip), %xmm2           # xmm2 = mem[0],zero
	mulsd	%xmm3, %xmm2
	addsd	.LCPI4_10(%rip), %xmm2
	mulsd	%xmm1, %xmm4
	movsd	%xmm4, 8(%rsp)                  # 8-byte Spill
	mulsd	%xmm3, %xmm2
	addsd	.LCPI4_11(%rip), %xmm2
	mulsd	%xmm3, %xmm2
	addsd	.LCPI4_12(%rip), %xmm2
	mulsd	%xmm1, %xmm2
	movsd	%xmm2, 24(%rsp)                 # 8-byte Spill
	callq	exp
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	cos
	mulsd	(%rsp), %xmm0                   # 8-byte Folded Reload
	movsd	%xmm0, 40(%rsp)                 # 8-byte Spill
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	sin
	movsd	24(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	exp
	movsd	(%rsp), %xmm2                   # 8-byte Reload
                                        # xmm2 = mem[0],zero
	mulsd	%xmm2, %xmm2
	movapd	%xmm2, %xmm1
	movapd	%xmm2, %xmm3
	mulsd	%xmm0, %xmm1
	movsd	.LCPI4_0(%rip), %xmm2           # xmm2 = mem[0],zero
	divsd	%xmm1, %xmm2
	movsd	%xmm2, 24(%r14)
	movsd	40(%rsp), %xmm4                 # 8-byte Reload
                                        # xmm4 = mem[0],zero
	addsd	%xmm4, %xmm4
	movapd	%xmm4, %xmm1
	addsd	%xmm0, %xmm1
	xorpd	.LCPI4_13(%rip), %xmm1
	mulsd	%xmm2, %xmm1
	movsd	%xmm1, 16(%r14)
	mulsd	%xmm0, %xmm4
	addsd	%xmm3, %xmm4
	mulsd	%xmm2, %xmm4
	movsd	%xmm4, 8(%r14)
	movabsq	$4607182418800017408, %rax      # imm = 0x3FF0000000000000
	movq	%rax, (%r14)
	callq	clock
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	96(%rsp), %rdx
	movq	104(%rsp), %rcx
	movq	112(%rsp), %r8
	movl	20(%rsp), %edi                  # 4-byte Reload
	movl	36(%rsp), %esi                  # 4-byte Reload
	movq	%rdx, 8(%rsp)                   # 8-byte Spill
	movq	%rcx, (%rsp)                    # 8-byte Spill
	movq	%r8, %rbx
	movq	%r14, %r9
	pushq	%r15
	.cfi_adjust_cfa_offset 8
	pushq	%r13
	.cfi_adjust_cfa_offset 8
	pushq	$3
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	_Z25host_recursivegaussfilteriiPjS_S_Pdiiii
.LBB4_29:
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	callq	clock
	subq	24(%rsp), %rax                  # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI4_15(%rip), %xmm0
	movl	$.L.str.21, %edi
	movb	$1, %al
	callq	printf
	movq	%r14, %rdi
	callq	free
	testl	%r15d, %r15d
	je	.LBB4_36
# %bb.30:                               # %.preheader193.lr.ph
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.LBB4_31:                               # %.preheader193
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_33 Depth 2
	testq	%r13, %r13
	je	.LBB4_35
# %bb.32:                               # %.lr.ph212
                                        #   in Loop: Header=BB4_31 Depth=1
	movslq	%edx, %r8
	movq	8(%rsp), %rsi                   # 8-byte Reload
	leaq	(%rsi,%r8,4), %rsi
	movq	(%rsp), %rdi                    # 8-byte Reload
	leaq	(%rdi,%r8,4), %rdi
	leaq	(%rbx,%r8,4), %r9
	movl	%eax, %r10d
	xorl	%r8d, %r8d
.LBB4_33:                               #   Parent Loop BB4_31 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r10d, %r11d
	movb	(%rsi,%r8,4), %r14b
	movb	%r14b, (%r12,%r11)
	movb	(%rdi,%r8,4), %r14b
	movb	%r14b, 1(%r12,%r11)
	movb	(%r9,%r8,4), %r14b
	movb	%r14b, 2(%r12,%r11)
	incq	%r8
	addl	%ebp, %r10d
	cmpq	%r8, %r13
	jne	.LBB4_33
# %bb.34:                               # %._crit_edge213.loopexit
                                        #   in Loop: Header=BB4_31 Depth=1
	addl	%r8d, %edx
.LBB4_35:                               # %._crit_edge213
                                        #   in Loop: Header=BB4_31 Depth=1
	incl	%ecx
	addl	16(%rsp), %eax                  # 4-byte Folded Reload
	cmpl	%r15d, %ecx
	jne	.LBB4_31
.LBB4_36:                               # %.preheader.preheader
	xorl	%ebx, %ebx
.LBB4_37:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	96(%rsp,%rbx,8), %rdi
	callq	free
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB4_37
# %bb.38:
	movl	$.L.str.22, %esi
	movq	88(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rdi
	callq	fopen
	testq	%rax, %rax
	jne	.LBB4_40
.LBB4_39:
	movq	stderr(%rip), %rdi
	movl	$.L.str.14, %esi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	fprintf
	movq	stderr(%rip), %rdi
	callq	fflush
.LBB4_8:
	movl	$-1, %edi
	callq	exit
.LBB4_40:
	movq	%rax, %rbx
	movl	$1, %esi
	movq	72(%rsp), %r15                  # 8-byte Reload
	movq	%r15, %rdi
	movq	80(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rdx
	movq	%rax, %rcx
	callq	fwrite
	movl	$.L.str.23, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	printf
	movq	%r15, %rdi
	callq	free
	movq	%rbx, %rdi
	callq	fclose
	callq	hipDeviceReset
	xorl	%edi, %edi
	callq	exit
.Lfunc_end4:
	.size	main, .Lfunc_end4-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	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z25global_defaultgaussfilterPjS_Pdiiiii, %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	$_Z27global_recursivegaussfilterPjS_Pdiiiiii, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end5:
	.size	__hip_module_ctor, .Lfunc_end5-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB6_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB6_2:
	retq
.Lfunc_end6:
	.size	__hip_module_dtor, .Lfunc_end6-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"gauss filtering"
	.size	.L.str, 16

	.type	title,@object                   # @title
	.data
	.globl	title
	.p2align	3, 0x0
title:
	.quad	.L.str
	.size	title, 8

	.type	description,@object             # @description
	.globl	description
	.p2align	3, 0x0
description:
	.quad	.L.str
	.size	description, 8

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

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

	.type	.L.str.1,@object                # @.str.1
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.1:
	.asciz	"Running on GPU "
	.size	.L.str.1, 16

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

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Usage :\t%s filter sigma inputfilename.bmp ouputfilename.bmp\n"
	.size	.L.str.4, 61

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

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Title :\t%s\n"
	.size	.L.str.7, 12

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Description :\t%s\n"
	.size	.L.str.8, 18

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Filter :\t%s\n"
	.size	.L.str.9, 13

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Sigma :\t%le\n"
	.size	.L.str.10, 13

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Input file name :\t%s\n"
	.size	.L.str.11, 22

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Output file name :\t%s\n"
	.size	.L.str.12, 23

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"rb"
	.size	.L.str.13, 3

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Open file error (%s)\n"
	.size	.L.str.14, 22

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"BMP image size :\t%ld x %ld\n"
	.size	.L.str.15, 28

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"BMP file size :\t%ld\n"
	.size	.L.str.16, 21

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"BMP pixels offset :\t%ld\n"
	.size	.L.str.17, 25

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"BMP bits per pixel :\t%d\n"
	.size	.L.str.18, 25

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"BMP bytes per pixel :\t%d\n"
	.size	.L.str.19, 26

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"BMP bytes per line :\t%d\n"
	.size	.L.str.20, 25

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"Execution time :\t%le\n"
	.size	.L.str.21, 22

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"wb"
	.size	.L.str.22, 3

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"Output file size :\t%ld\n"
	.size	.L.str.23, 24

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z25global_defaultgaussfilterPjS_Pdiiiii"
	.size	.L__unnamed_1, 41

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z27global_recursivegaussfilterPjS_Pdiiiiii"
	.size	.L__unnamed_2, 44

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"filter :\tgauss recursivegauss"
	.size	.Lstr, 30

	.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 _Z40__device_stub__global_defaultgaussfilterPjS_Pdiiiii
	.addrsig_sym _Z42__device_stub__global_recursivegaussfilterPjS_Pdiiiiii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z25global_defaultgaussfilterPjS_Pdiiiii
	.addrsig_sym _Z27global_recursivegaussfilterPjS_Pdiiiiii
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z25global_defaultgaussfilterPjS_Pdiiiii ; -- Begin function _Z25global_defaultgaussfilterPjS_Pdiiiii
	.globl	_Z25global_defaultgaussfilterPjS_Pdiiiii
	.p2align	8
	.type	_Z25global_defaultgaussfilterPjS_Pdiiiii,@function
_Z25global_defaultgaussfilterPjS_Pdiiiii: ; @_Z25global_defaultgaussfilterPjS_Pdiiiii
; %bb.0:
	s_clause 0x3
	s_load_b128 s[4:7], s[0:1], 0x18
	s_load_b128 s[8:11], s[0:1], 0x0
	s_load_b64 s[12:13], s[0:1], 0x10
	s_load_b32 s14, s[0:1], 0x28
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s7, 1
	s_mul_i32 s7, s6, s5
	s_cbranch_scc1 .LBB0_11
; %bb.1:
	s_load_b32 s16, s[0:1], 0x3c
	s_add_u32 s2, s0, 48
	s_addc_u32 s3, s1, 0
	s_mov_b32 s18, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s16, s16, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s16, v[0:1]
	v_cmpx_gt_i32_e64 s7, v1
	s_cbranch_execz .LBB0_10
; %bb.2:                                ; %.lr.ph97
	s_sub_i32 s19, 0, s4
	s_cmp_gt_i32 s4, -1
	s_load_b32 s22, s[2:3], 0x0
	s_cselect_b32 s20, -1, 0
	s_ashr_i32 s17, s5, 31
	v_subrev_nc_u32_e32 v7, s4, v1
	s_add_i32 s21, s5, s17
	s_lshl_b32 s2, s4, 1
	s_xor_b32 s21, s21, s17
	s_mov_b32 s3, 0
	v_cvt_f32_u32_e32 v2, s21
	s_sub_i32 s17, 0, s21
	s_or_b32 s23, s2, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_rcp_iflag_f32_e32 v2, v2
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s22, s22, s16
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v2, 0x4f7ffffe, v2
	v_cvt_u32_f32_e32 v2, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v3, s17, v2
	v_mul_hi_u32 v3, v2, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_add_nc_u32_e32 v8, v2, v3
.LBB0_3:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v4, 0x7ff80000
	v_ashrrev_i32_e32 v2, 31, v1
	s_and_not1_b32 vcc_lo, exec_lo, s20
	s_cbranch_vccnz .LBB0_9
; %bb.4:                                ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v3, v1, v2
	s_mov_b32 s16, 0
	v_xor_b32_e32 v3, v3, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_u32 v4, v3, v8
	v_mul_lo_u32 v4, v4, s21
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v3, v3, v4
	v_subrev_nc_u32_e32 v4, s21, v3
	v_cmp_le_u32_e32 vcc_lo, s21, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v3, v3, v4, vcc_lo
	v_subrev_nc_u32_e32 v4, s21, v3
	v_cmp_le_u32_e32 vcc_lo, s21, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v5, v3, v4, vcc_lo
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v4, 0
	v_xad_u32 v5, v5, v2, s19
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_sub_nc_u32_e32 v9, v5, v2
	v_dual_mov_b32 v6, v4 :: v_dual_mov_b32 v5, v3
.LBB0_5:                                ; %.lr.ph
                                        ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v10, s16, v9
	v_cmp_lt_i32_e32 vcc_lo, -1, v10
	v_cmp_gt_i32_e64 s2, s5, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s17, vcc_lo, s2
	s_and_saveexec_b32 s2, s17
	s_cbranch_execz .LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	v_add_nc_u32_e32 v10, s16, v7
	s_ashr_i32 s17, s16, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[24:25], s[16:17], 3
	s_add_u32 s24, s12, s24
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v11, 31, v10
	s_addc_u32 s25, s13, s25
	s_load_b64 s[24:25], s[24:25], 0x0
	v_lshlrev_b64 v[10:11], 2, v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v10, vcc_lo, s8, v10
	v_add_co_ci_u32_e32 v11, vcc_lo, s9, v11, vcc_lo
	global_load_b32 v10, v[10:11], off
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[5:6], v[5:6], s[24:25]
	s_waitcnt vmcnt(0)
	v_cvt_f64_i32_e32 v[10:11], v10
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[3:4], s[24:25], v[10:11], v[3:4]
.LBB0_7:                                ;   in Loop: Header=BB0_5 Depth=2
	s_or_b32 exec_lo, exec_lo, s2
	s_add_i32 s16, s16, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s23, s16
	s_cbranch_scc0 .LBB0_5
; %bb.8:                                ; %._crit_edge.loopexit
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_scale_f64 v[9:10], null, v[5:6], v[5:6], v[3:4]
	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
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[11:12], v[11:12], v[13:14], v[11:12]
	v_fma_f64 v[13:14], -v[9:10], v[11:12], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f64 v[11:12], v[11:12], v[13:14], v[11:12]
	v_div_scale_f64 v[13:14], vcc_lo, v[3:4], v[5:6], v[3:4]
	v_mul_f64 v[15:16], v[13:14], v[11:12]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[9:10], -v[9:10], v[15:16], v[13:14]
	v_div_fmas_f64 v[9:10], v[9:10], v[11:12], v[15:16]
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fixup_f64 v[3:4], v[9:10], v[5:6], v[3:4]
.LBB0_9:                                ; %._crit_edge
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_u32_f64_e32 v4, v[3:4]
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	v_add_nc_u32_e32 v1, s22, v1
	v_add_nc_u32_e32 v7, s22, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cmp_le_i32_e32 vcc_lo, s7, v1
	v_add_co_u32 v2, s2, s10, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, s2, s11, v3, s2
	s_or_b32 s3, vcc_lo, s3
	global_store_b32 v[2:3], v4, off
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB0_3
.LBB0_10:                               ; %Flow146
	s_or_b32 exec_lo, exec_lo, s18
.LBB0_11:                               ; %.loopexit89
	s_cmp_lt_i32 s14, 1
	s_cbranch_scc1 .LBB0_21
; %bb.12:
	s_load_b32 s2, s[0:1], 0x3c
	s_add_u32 s0, s0, 48
	s_addc_u32 s1, s1, 0
	s_mov_b32 s3, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	v_cmpx_gt_i32_e64 s7, v1
	s_cbranch_execz .LBB0_21
; %bb.13:                               ; %.lr.ph109
	s_sub_i32 s14, 0, s4
	s_cmp_gt_i32 s4, -1
	s_load_b32 s0, s[0:1], 0x0
	s_cselect_b32 s15, -1, 0
	s_ashr_i32 s16, s5, 31
	s_mov_b32 s1, 0
	s_add_i32 s3, s5, s16
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_xor_b32 s17, s3, s16
	v_cvt_f32_u32_e32 v0, s17
	s_sub_i32 s3, 0, s17
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_iflag_f32_e32 v0, v0
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v0, 0x4f7ffffe, v0
	v_cvt_u32_f32_e32 v2, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v0, s3, v2
	s_mul_i32 s3, s5, s4
	v_mul_hi_u32 v3, v2, v0
	v_subrev_nc_u32_e32 v0, s3, v1
	s_lshl_b32 s3, s4, 1
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s4, s0, s2
	s_or_b32 s18, s3, 1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_nc_u32_e32 v9, v2, v3
.LBB0_14:                               ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_16 Depth 2
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v4, 0x7ff80000
	v_ashrrev_i32_e32 v2, 31, v1
	s_and_not1_b32 vcc_lo, exec_lo, s15
	s_cbranch_vccnz .LBB0_20
; %bb.15:                               ; %.lr.ph103.preheader
                                        ;   in Loop: Header=BB0_14 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v3, v1, v2
	v_mov_b32_e32 v7, v0
	s_mov_b32 s2, 0
	v_xor_b32_e32 v3, v3, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_u32 v4, v3, v9
	v_mul_lo_u32 v5, v4, s17
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v3, v3, v5
	v_add_nc_u32_e32 v5, 1, v4
	v_subrev_nc_u32_e32 v6, s17, v3
	v_cmp_le_u32_e32 vcc_lo, s17, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_cndmask_b32 v4, v4, v5 :: v_dual_cndmask_b32 v3, v3, v6
	v_xor_b32_e32 v6, s16, v2
	v_add_nc_u32_e32 v5, 1, v4
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_le_u32_e32 vcc_lo, s17, v3
	v_cndmask_b32_e32 v5, v4, v5, vcc_lo
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v4, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xad_u32 v5, v5, v6, s14
	v_sub_nc_u32_e32 v10, v5, v6
	s_delay_alu instid0(VALU_DEP_3)
	v_dual_mov_b32 v6, v4 :: v_dual_mov_b32 v5, v3
.LBB0_16:                               ; %.lr.ph103
                                        ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v8, s2, v10
	v_cmp_lt_i32_e32 vcc_lo, -1, v8
	v_cmp_gt_i32_e64 s0, s6, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s3, vcc_lo, s0
	s_and_saveexec_b32 s0, s3
	s_cbranch_execz .LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=2
	v_ashrrev_i32_e32 v8, 31, v7
	s_ashr_i32 s3, s2, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[20:21], s[2:3], 3
	s_add_u32 s20, s12, s20
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[11:12], 2, v[7:8]
	s_addc_u32 s21, s13, s21
	s_load_b64 s[20:21], s[20:21], 0x0
	v_add_co_u32 v11, vcc_lo, s8, v11
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v12, vcc_lo, s9, v12, vcc_lo
	global_load_b32 v8, v[11:12], off
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[3:4], v[3:4], s[20:21]
	s_waitcnt vmcnt(0)
	v_cvt_f64_i32_e32 v[11:12], v8
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[5:6], s[20:21], v[11:12], v[5:6]
.LBB0_18:                               ;   in Loop: Header=BB0_16 Depth=2
	s_or_b32 exec_lo, exec_lo, s0
	v_add_nc_u32_e32 v7, s5, v7
	s_add_i32 s2, s2, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s18, s2
	s_cbranch_scc0 .LBB0_16
; %bb.19:                               ; %._crit_edge104.loopexit
                                        ;   in Loop: Header=BB0_14 Depth=1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_scale_f64 v[7:8], null, v[3:4], v[3:4], v[5:6]
	v_rcp_f64_e32 v[10:11], v[7:8]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[12:13], -v[7:8], v[10:11], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[10:11], v[10:11], v[12:13], v[10:11]
	v_fma_f64 v[12:13], -v[7:8], v[10:11], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f64 v[10:11], v[10:11], v[12:13], v[10:11]
	v_div_scale_f64 v[12:13], vcc_lo, v[5:6], v[3:4], v[5:6]
	v_mul_f64 v[14:15], v[12:13], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[7:8], -v[7:8], v[14:15], v[12:13]
	v_div_fmas_f64 v[7:8], v[7:8], v[10:11], v[14:15]
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fixup_f64 v[3:4], v[7:8], v[3:4], v[5:6]
.LBB0_20:                               ; %Flow
                                        ;   in Loop: Header=BB0_14 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_u32_f64_e32 v4, v[3:4]
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	v_add_nc_u32_e32 v1, s4, v1
	v_add_nc_u32_e32 v0, s4, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cmp_le_i32_e32 vcc_lo, s7, v1
	v_add_co_u32 v2, s0, s10, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, s0, s11, v3, s0
	s_or_b32 s1, vcc_lo, s1
	global_store_b32 v[2:3], v4, off
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB0_14
.LBB0_21:                               ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z25global_defaultgaussfilterPjS_Pdiiiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 26
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z25global_defaultgaussfilterPjS_Pdiiiii, .Lfunc_end0-_Z25global_defaultgaussfilterPjS_Pdiiiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1392
; NumSgprs: 28
; NumVgprs: 17
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 3
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 28
; 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	_Z27global_recursivegaussfilterPjS_Pdiiiiii ; -- Begin function _Z27global_recursivegaussfilterPjS_Pdiiiiii
	.globl	_Z27global_recursivegaussfilterPjS_Pdiiiiii
	.p2align	8
	.type	_Z27global_recursivegaussfilterPjS_Pdiiiiii,@function
_Z27global_recursivegaussfilterPjS_Pdiiiiii: ; @_Z27global_recursivegaussfilterPjS_Pdiiiiii
; %bb.0:
	s_load_b64 s[2:3], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_load_b256 s[4:11], s[2:3], 0x0
	s_waitcnt lgkmcnt(0)
	v_div_scale_f64 v[1:2], null, s[4:5], s[4:5], s[6:7]
	v_div_scale_f64 v[3:4], null, s[4:5], s[4:5], s[8:9]
	v_div_scale_f64 v[7:8], null, s[4:5], s[4:5], s[10:11]
	v_div_scale_f64 v[17:18], vcc_lo, s[6:7], s[4:5], s[6:7]
	v_div_scale_f64 v[19:20], s2, s[8:9], s[4:5], s[8:9]
	v_rcp_f64_e32 v[5:6], v[1:2]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_rcp_f64_e32 v[9:10], v[3:4]
	v_rcp_f64_e32 v[11:12], v[7:8]
	s_delay_alu instid0(TRANS32_DEP_3) | instskip(SKIP_4) | instid1(VALU_DEP_3)
	v_fma_f64 v[13:14], -v[1:2], v[5:6], 1.0
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[15:16], -v[3:4], v[9:10], 1.0
	v_fma_f64 v[5:6], v[5:6], v[13:14], v[5:6]
	v_fma_f64 v[13:14], -v[7:8], v[11:12], 1.0
	v_fma_f64 v[9:10], v[9:10], v[15:16], v[9:10]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[15:16], -v[1:2], v[5:6], 1.0
	v_fma_f64 v[11:12], v[11:12], v[13:14], v[11:12]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[13:14], -v[3:4], v[9:10], 1.0
	v_fma_f64 v[5:6], v[5:6], v[15:16], v[5:6]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[15:16], -v[7:8], v[11:12], 1.0
	v_fma_f64 v[9:10], v[9:10], v[13:14], v[9:10]
	v_div_scale_f64 v[13:14], s3, s[10:11], s[4:5], s[10:11]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_mul_f64 v[21:22], v[17:18], v[5:6]
	v_fma_f64 v[11:12], v[11:12], v[15:16], v[11:12]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_f64 v[15:16], v[19:20], v[9:10]
	v_fma_f64 v[1:2], -v[1:2], v[21:22], v[17:18]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_f64 v[17:18], v[13:14], v[11:12]
	v_fma_f64 v[3:4], -v[3:4], v[15:16], v[19:20]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_div_fmas_f64 v[1:2], v[1:2], v[5:6], v[21:22]
	s_mov_b32 vcc_lo, s2
	v_fma_f64 v[5:6], -v[7:8], v[17:18], v[13:14]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_div_fmas_f64 v[3:4], v[3:4], v[9:10], v[15:16]
	s_mov_b32 vcc_lo, s3
	v_div_fixup_f64 v[1:2], v[1:2], s[4:5], s[6:7]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_fmas_f64 v[5:6], v[5:6], v[11:12], v[17:18]
	v_div_fixup_f64 v[3:4], v[3:4], s[4:5], s[8:9]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_fixup_f64 v[5:6], v[5:6], s[4:5], s[10:11]
	v_add_f64 v[7:8], v[1:2], v[3:4]
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x20
	s_load_b128 s[8:11], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s6, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[7:8], v[7:8], v[5:6]
	v_add_f64 v[7:8], -v[7:8], 1.0
	s_cbranch_scc1 .LBB1_14
; %bb.1:
	s_load_b32 s12, s[0:1], 0x3c
	s_add_u32 s2, s0, 48
	s_addc_u32 s3, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s26, s12, 0xffff
	s_mov_b32 s12, exec_lo
	v_mad_u64_u32 v[9:10], null, s15, s26, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s5, v9
	s_cbranch_execz .LBB1_13
; %bb.2:                                ; %.lr.ph263
	s_load_b32 s2, s[2:3], 0x0
	s_cmp_gt_i32 s4, 1
	v_mad_u64_u32 v[10:11], null, v9, s4, 3
	s_cselect_b32 s3, -1, 0
	s_cmp_gt_i32 s4, 2
	s_mov_b32 s27, 0
	s_cselect_b32 s13, -1, 0
	s_cmp_gt_i32 s4, 3
	s_mov_b32 s28, 0
	s_cselect_b32 s14, -1, 0
	s_add_u32 s16, s10, -4
	s_addc_u32 s17, s11, -1
	s_add_u32 s18, s8, 4
	s_addc_u32 s19, s9, 0
	s_add_u32 s20, s8, 8
	v_mov_b32_e32 v11, v10
	s_addc_u32 s21, s9, 0
	s_add_u32 s22, s10, -12
	s_addc_u32 s23, s11, -1
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s24, s2, s26
	s_mul_i32 s2, s2, s4
	s_mul_i32 s25, s24, s4
	s_mul_i32 s26, s2, s26
.LBB1_3:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_11 Depth 2
	v_mul_lo_u32 v12, v9, s4
	s_and_not1_b32 vcc_lo, exec_lo, s3
	s_delay_alu instid0(VALU_DEP_1)
	v_ashrrev_i32_e32 v13, 31, v12
	s_cbranch_vccnz .LBB1_5
; %bb.4:                                ;   in Loop: Header=BB1_3 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[14:15], 2, v[12:13]
	v_add_co_u32 v16, vcc_lo, s8, v14
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v17, vcc_lo, s9, v15, vcc_lo
	v_add_co_u32 v14, vcc_lo, s10, v14
	v_add_co_ci_u32_e32 v15, vcc_lo, s11, v15, vcc_lo
	global_load_b32 v16, v[16:17], off
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[16:17], v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[16:17], v[7:8], v[16:17]
	v_cvt_u32_f64_e32 v16, v[16:17]
	global_store_b32 v[14:15], v16, off
.LBB1_5:                                ;   in Loop: Header=BB1_3 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s13
	s_cbranch_vccnz .LBB1_7
; %bb.6:                                ;   in Loop: Header=BB1_3 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[14:15], 2, v[12:13]
	v_add_co_u32 v16, vcc_lo, s10, v14
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v17, vcc_lo, s11, v15, vcc_lo
	v_add_co_u32 v14, vcc_lo, s18, v14
	v_add_co_ci_u32_e32 v15, vcc_lo, s19, v15, vcc_lo
	global_load_b32 v18, v[16:17], off
	global_load_b32 v19, v[14:15], off
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[14:15], v18
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[18:19], v19
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[14:15], v[1:2], v[14:15]
	v_fma_f64 v[14:15], v[7:8], v[18:19], v[14:15]
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_u32_f64_e32 v14, v[14:15]
	global_store_b32 v[16:17], v14, off offset:4
.LBB1_7:                                ;   in Loop: Header=BB1_3 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s14
	s_cbranch_vccnz .LBB1_9
; %bb.8:                                ;   in Loop: Header=BB1_3 Depth=1
	v_lshlrev_b64 v[13:14], 2, v[12:13]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v15, vcc_lo, s10, v13
	v_add_co_ci_u32_e32 v16, vcc_lo, s11, v14, vcc_lo
	v_add_co_u32 v13, vcc_lo, s20, v13
	v_add_co_ci_u32_e32 v14, vcc_lo, s21, v14, vcc_lo
	global_load_b64 v[17:18], v[15:16], off
	global_load_b32 v19, v[13:14], off
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[13:14], v18
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[18:19], v19
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[13:14], v[1:2], v[13:14]
	v_fma_f64 v[13:14], v[7:8], v[18:19], v[13:14]
	v_cvt_f64_u32_e32 v[17:18], v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[13:14], v[3:4], v[17:18], v[13:14]
	v_cvt_u32_f64_e32 v13, v[13:14]
	global_store_b32 v[15:16], v13, off offset:8
.LBB1_9:                                ;   in Loop: Header=BB1_3 Depth=1
	v_add_nc_u32_e32 v16, 3, v12
	s_mov_b32 s29, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s4, v16
	s_cbranch_execz .LBB1_12
; %bb.10:                               ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB1_3 Depth=1
	v_mad_u64_u32 v[12:13], null, s25, s28, v[10:11]
	s_mov_b32 s30, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v13, 31, v12
	v_lshlrev_b64 v[12:13], 2, v[12:13]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v12, vcc_lo, s16, v12
	v_add_co_ci_u32_e32 v13, vcc_lo, s17, v13, vcc_lo
	global_load_b32 v17, v[12:13], off
	v_ashrrev_i32_e32 v12, 31, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[12:13], 2, v[11:12]
	v_add_co_u32 v14, vcc_lo, s22, v12
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v15, vcc_lo, s23, v13, vcc_lo
	v_add_co_u32 v12, vcc_lo, s8, v12
	v_add_co_ci_u32_e32 v13, vcc_lo, s9, v13, vcc_lo
.LBB1_11:                               ; %.lr.ph
                                        ;   Parent Loop BB1_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_b32 v22, v[12:13], off
	global_load_b64 v[18:19], v[14:15], off
	s_waitcnt vmcnt(2)
	v_cvt_f64_u32_e32 v[20:21], v17
	s_delay_alu instid0(VALU_DEP_1)
	v_mul_f64 v[20:21], v[1:2], v[20:21]
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[22:23], v22
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[24:25], v19
	v_cvt_f64_u32_e32 v[17:18], v18
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], v[7:8], v[22:23], v[20:21]
	v_fma_f64 v[19:20], v[3:4], v[24:25], v[19:20]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[17:18], v[5:6], v[17:18], v[19:20]
	v_cvt_u32_f64_e32 v17, v[17:18]
	v_add_co_u32 v18, vcc_lo, v14, 4
	v_add_co_ci_u32_e32 v19, vcc_lo, 0, v15, vcc_lo
	v_add_nc_u32_e32 v16, 1, v16
	v_add_co_u32 v12, vcc_lo, v12, 4
	v_add_co_ci_u32_e32 v13, vcc_lo, 0, v13, vcc_lo
	global_store_b32 v[14:15], v17, off offset:12
	v_dual_mov_b32 v14, v18 :: v_dual_mov_b32 v15, v19
	v_cmp_le_i32_e64 s2, s4, v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s30, s2, s30
	s_and_not1_b32 exec_lo, exec_lo, s30
	s_cbranch_execnz .LBB1_11
.LBB1_12:                               ; %Flow393
                                        ;   in Loop: Header=BB1_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s29
	v_add_nc_u32_e32 v9, s24, v9
	v_add_nc_u32_e32 v11, s26, v11
	s_add_i32 s28, s28, 1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s5, v9
	s_or_b32 s27, vcc_lo, s27
	s_and_not1_b32 exec_lo, exec_lo, s27
	s_cbranch_execnz .LBB1_3
.LBB1_13:                               ; %Flow395
	s_or_b32 exec_lo, exec_lo, s12
.LBB1_14:                               ; %.loopexit259
	s_cmp_gt_i32 s6, -1
	s_cbranch_scc1 .LBB1_28
; %bb.15:
	s_load_b32 s6, s[0:1], 0x3c
	s_add_u32 s2, s0, 48
	s_addc_u32 s3, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s27, s6, 0xffff
	s_mov_b32 s6, exec_lo
	v_mad_u64_u32 v[9:10], null, s15, s27, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s5, v9
	s_cbranch_execz .LBB1_27
; %bb.16:                               ; %.lr.ph270
	s_load_b32 s2, s[2:3], 0x0
	s_cmp_gt_i32 s4, 1
	v_mad_u64_u32 v[11:12], null, s4, v9, s[4:5]
	s_cselect_b32 s3, -1, 0
	s_cmp_gt_i32 s4, 2
	s_mov_b32 s30, 0
	s_cselect_b32 s12, -1, 0
	s_cmp_gt_i32 s4, 3
	v_mov_b32_e32 v12, 0
	s_cselect_b32 s13, -1, 0
	s_add_u32 s14, s10, 4
	s_addc_u32 s16, s11, 0
	s_add_u32 s17, s8, -4
	v_add_nc_u32_e32 v10, -4, v11
	s_addc_u32 s18, s9, -1
	s_add_u32 s19, s10, -4
	s_addc_u32 s20, s11, -1
	s_add_u32 s21, s8, -8
	s_addc_u32 s22, s9, -1
	s_add_u32 s23, s8, -12
	v_add_nc_u32_e32 v17, -3, v11
	v_mov_b32_e32 v11, v10
	s_addc_u32 s24, s9, -1
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s25, s2, s27
	s_mul_i32 s2, s2, s4
	s_add_u32 s28, s10, 8
	s_mul_i32 s26, s25, s4
	s_mul_i32 s27, s2, s27
	s_addc_u32 s29, s11, 0
	s_mov_b32 s31, 0
.LBB1_17:                               ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_25 Depth 2
	v_mad_u64_u32 v[13:14], null, s4, v9, s[4:5]
	s_and_not1_b32 vcc_lo, exec_lo, s3
	s_delay_alu instid0(VALU_DEP_1)
	v_ashrrev_i32_e32 v14, 31, v13
	s_cbranch_vccnz .LBB1_19
; %bb.18:                               ;   in Loop: Header=BB1_17 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[15:16], 2, v[13:14]
	v_add_co_u32 v18, vcc_lo, s17, v15
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v19, vcc_lo, s18, v16, vcc_lo
	v_add_co_u32 v15, vcc_lo, s19, v15
	v_add_co_ci_u32_e32 v16, vcc_lo, s20, v16, vcc_lo
	global_load_b32 v18, v[18:19], off
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[18:19], v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[18:19], v[7:8], v[18:19]
	v_cvt_u32_f64_e32 v18, v[18:19]
	global_store_b32 v[15:16], v18, off
.LBB1_19:                               ;   in Loop: Header=BB1_17 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s12
	s_cbranch_vccnz .LBB1_21
; %bb.20:                               ;   in Loop: Header=BB1_17 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[15:16], 2, v[13:14]
	v_add_co_u32 v18, vcc_lo, s10, v15
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v19, vcc_lo, s11, v16, vcc_lo
	v_add_co_u32 v15, vcc_lo, s21, v15
	v_add_co_ci_u32_e32 v16, vcc_lo, s22, v16, vcc_lo
	global_load_b32 v20, v[18:19], off offset:-4
	global_load_b32 v21, v[15:16], off
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[15:16], v20
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[20:21], v21
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[15:16], v[1:2], v[15:16]
	v_fma_f64 v[15:16], v[7:8], v[20:21], v[15:16]
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_u32_f64_e32 v15, v[15:16]
	global_store_b32 v[18:19], v15, off offset:-8
.LBB1_21:                               ;   in Loop: Header=BB1_17 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s13
	s_cbranch_vccnz .LBB1_23
; %bb.22:                               ;   in Loop: Header=BB1_17 Depth=1
	v_lshlrev_b64 v[14:15], 2, v[13:14]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v18, vcc_lo, s10, v14
	v_add_co_ci_u32_e32 v19, vcc_lo, s11, v15, vcc_lo
	v_add_co_u32 v14, vcc_lo, s23, v14
	v_add_co_ci_u32_e32 v15, vcc_lo, s24, v15, vcc_lo
	global_load_b64 v[20:21], v[18:19], off offset:-8
	global_load_b32 v16, v[14:15], off
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[14:15], v20
	v_cvt_f64_u32_e32 v[20:21], v21
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[22:23], v16
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[14:15], v[1:2], v[14:15]
	v_fma_f64 v[14:15], v[7:8], v[22:23], v[14:15]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[14:15], v[3:4], v[20:21], v[14:15]
	v_cvt_u32_f64_e32 v14, v[14:15]
	global_store_b32 v[18:19], v14, off offset:-12
.LBB1_23:                               ;   in Loop: Header=BB1_17 Depth=1
	s_mov_b32 s33, exec_lo
	v_cmpx_lt_i32_e32 3, v13
	s_cbranch_execz .LBB1_26
; %bb.24:                               ; %.lr.ph266.preheader
                                        ;   in Loop: Header=BB1_17 Depth=1
	v_mad_u64_u32 v[13:14], null, s26, s31, v[10:11]
	v_dual_mov_b32 v14, v12 :: v_dual_mov_b32 v19, v17
	v_lshlrev_b64 v[15:16], 2, v[11:12]
	s_mov_b32 s34, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[13:14], 2, v[13:14]
	v_add_co_u32 v13, vcc_lo, s14, v13
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v14, vcc_lo, s16, v14, vcc_lo
	global_load_b32 v18, v[13:14], off
	v_add_co_u32 v13, vcc_lo, s28, v15
	v_add_co_ci_u32_e32 v14, vcc_lo, s29, v16, vcc_lo
	v_add_co_u32 v15, vcc_lo, s8, v15
	v_add_co_ci_u32_e32 v16, vcc_lo, s9, v16, vcc_lo
.LBB1_25:                               ; %.lr.ph266
                                        ;   Parent Loop BB1_17 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_b32 v24, v[15:16], off
	global_load_b64 v[20:21], v[13:14], off
	s_waitcnt vmcnt(2)
	v_cvt_f64_u32_e32 v[22:23], v18
	v_add_nc_u32_e32 v19, -1, v19
	v_add_co_u32 v15, vcc_lo, v15, -4
	v_add_co_ci_u32_e32 v16, vcc_lo, -1, v16, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_cmp_eq_u32_e32 vcc_lo, 0, v19
	s_or_b32 s34, vcc_lo, s34
	v_mul_f64 v[22:23], v[1:2], v[22:23]
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[24:25], v24
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[26:27], v20
	v_cvt_f64_u32_e32 v[20:21], v21
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[22:23], v[7:8], v[24:25], v[22:23]
	v_fma_f64 v[22:23], v[3:4], v[26:27], v[22:23]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[20:21], v[5:6], v[20:21], v[22:23]
	v_cvt_u32_f64_e32 v18, v[20:21]
	global_store_b32 v[13:14], v18, off offset:-8
	v_add_co_u32 v13, s2, v13, -4
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v14, s2, -1, v14, s2
	s_and_not1_b32 exec_lo, exec_lo, s34
	s_cbranch_execnz .LBB1_25
.LBB1_26:                               ; %Flow389
                                        ;   in Loop: Header=BB1_17 Depth=1
	s_or_b32 exec_lo, exec_lo, s33
	v_add_nc_u32_e32 v9, s25, v9
	v_add_nc_u32_e32 v17, s27, v17
	v_add_nc_u32_e32 v11, s27, v11
	s_add_i32 s31, s31, 1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s5, v9
	s_or_b32 s30, vcc_lo, s30
	s_and_not1_b32 exec_lo, exec_lo, s30
	s_cbranch_execnz .LBB1_17
.LBB1_27:                               ; %Flow391
	s_or_b32 exec_lo, exec_lo, s6
.LBB1_28:                               ; %.loopexit258
	s_cmp_lt_i32 s7, 1
	s_cbranch_scc1 .LBB1_40
; %bb.29:
	s_load_b32 s6, s[0:1], 0x3c
	s_add_u32 s2, s0, 48
	s_addc_u32 s3, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s19, s6, 0xffff
	s_mov_b32 s6, exec_lo
	v_mad_u64_u32 v[9:10], null, s15, s19, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s4, v9
	s_cbranch_execz .LBB1_39
; %bb.30:                               ; %.lr.ph278
	s_load_b32 s22, s[2:3], 0x0
	s_cmp_gt_i32 s5, 1
	s_delay_alu instid0(VALU_DEP_2)
	v_mad_u64_u32 v[11:12], null, s4, 3, v[9:10]
	s_cselect_b32 s14, -1, 0
	s_cmp_gt_i32 s5, 2
	s_mov_b32 s12, s4
	s_cselect_b32 s16, -1, 0
	s_cmp_gt_i32 s5, 3
	s_cselect_b32 s17, -1, 0
	s_lshl_b32 s2, s4, 1
	s_ashr_i32 s13, s4, 31
	s_ashr_i32 s3, s2, 31
	s_add_i32 s18, s5, -3
	s_lshl_b64 s[20:21], s[2:3], 2
	s_lshl_b64 s[12:13], s[12:13], 2
	s_sub_u32 s3, s10, s20
	s_subb_u32 s20, s11, s21
	s_mov_b32 s21, 0
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s19, s22, s19
.LBB1_31:                               ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_37 Depth 2
	v_ashrrev_i32_e32 v10, 31, v9
	s_and_not1_b32 vcc_lo, exec_lo, s14
	s_cbranch_vccnz .LBB1_33
; %bb.32:                               ;   in Loop: Header=BB1_31 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[12:13], 2, v[9:10]
	v_add_co_u32 v14, vcc_lo, s8, v12
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v15, vcc_lo, s9, v13, vcc_lo
	v_add_co_u32 v12, vcc_lo, s10, v12
	v_add_co_ci_u32_e32 v13, vcc_lo, s11, v13, vcc_lo
	global_load_b32 v14, v[14:15], off
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[14:15], v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[14:15], v[7:8], v[14:15]
	v_cvt_u32_f64_e32 v14, v[14:15]
	global_store_b32 v[12:13], v14, off
.LBB1_33:                               ;   in Loop: Header=BB1_31 Depth=1
	v_add_nc_u32_e32 v12, s4, v9
	s_and_not1_b32 vcc_lo, exec_lo, s16
	s_delay_alu instid0(VALU_DEP_1)
	v_ashrrev_i32_e32 v13, 31, v12
	s_cbranch_vccnz .LBB1_35
; %bb.34:                               ;   in Loop: Header=BB1_31 Depth=1
	v_lshlrev_b64 v[14:15], 2, v[9:10]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[16:17], 2, v[12:13]
	v_add_co_u32 v14, vcc_lo, s10, v14
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v15, vcc_lo, s11, v15, vcc_lo
	v_add_co_u32 v16, vcc_lo, s8, v16
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v17, vcc_lo, s9, v17, vcc_lo
	global_load_b32 v10, v[14:15], off
	v_add_co_u32 v14, vcc_lo, v14, s12
	global_load_b32 v18, v[16:17], off
	v_add_co_ci_u32_e32 v15, vcc_lo, s13, v15, vcc_lo
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[16:17], v10
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[18:19], v18
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[16:17], v[1:2], v[16:17]
	v_fma_f64 v[16:17], v[7:8], v[18:19], v[16:17]
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_u32_f64_e32 v10, v[16:17]
	global_store_b32 v[14:15], v10, off
.LBB1_35:                               ;   in Loop: Header=BB1_31 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s17
	s_cbranch_vccnz .LBB1_38
; %bb.36:                               ; %.lr.ph274.preheader
                                        ;   in Loop: Header=BB1_31 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[13:14], 2, v[12:13]
	v_add_nc_u32_e32 v12, s4, v12
	s_mov_b32 s22, s18
	v_add_co_u32 v15, vcc_lo, s10, v13
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v16, vcc_lo, s11, v14, vcc_lo
	v_ashrrev_i32_e32 v13, 31, v12
	global_load_b32 v10, v[15:16], off
	v_lshlrev_b64 v[13:14], 2, v[12:13]
	v_subrev_nc_u32_e32 v12, s2, v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v13, vcc_lo, s8, v13
	v_add_co_ci_u32_e32 v14, vcc_lo, s9, v14, vcc_lo
	global_load_b32 v14, v[13:14], off
	v_ashrrev_i32_e32 v13, 31, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[12:13], 2, v[12:13]
	v_add_co_u32 v12, vcc_lo, s10, v12
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v13, vcc_lo, s11, v13, vcc_lo
	global_load_b32 v19, v[12:13], off
	v_add_co_u32 v15, vcc_lo, v15, s12
	v_add_co_ci_u32_e32 v16, vcc_lo, s13, v16, vcc_lo
	s_waitcnt vmcnt(2)
	v_cvt_f64_u32_e32 v[12:13], v10
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[17:18], v14
	v_mov_b32_e32 v14, v9
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[12:13], v[1:2], v[12:13]
	v_fma_f64 v[12:13], v[7:8], v[17:18], v[12:13]
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[17:18], v19
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[12:13], v[3:4], v[17:18], v[12:13]
	v_cvt_u32_f64_e32 v10, v[12:13]
	v_ashrrev_i32_e32 v12, 31, v11
	s_delay_alu instid0(VALU_DEP_1)
	v_lshlrev_b64 v[12:13], 2, v[11:12]
	global_store_b32 v[15:16], v10, off
.LBB1_37:                               ; %.lr.ph274
                                        ;   Parent Loop BB1_31 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_add_co_u32 v15, vcc_lo, s8, v12
	v_add_co_ci_u32_e32 v16, vcc_lo, s9, v13, vcc_lo
	s_add_i32 s22, s22, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s22, 0
	global_load_b32 v17, v[15:16], off
	v_add_co_u32 v15, vcc_lo, s3, v12
	v_add_co_ci_u32_e32 v16, vcc_lo, s20, v13, vcc_lo
	global_load_b32 v19, v[15:16], off
	v_ashrrev_i32_e32 v15, 31, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[15:16], 2, v[14:15]
	v_add_nc_u32_e32 v14, s4, v14
	v_add_co_u32 v15, vcc_lo, s10, v15
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v16, vcc_lo, s11, v16, vcc_lo
	global_load_b32 v21, v[15:16], off
	v_cvt_f64_u32_e32 v[15:16], v10
	v_mul_f64 v[15:16], v[1:2], v[15:16]
	s_waitcnt vmcnt(2)
	v_cvt_f64_u32_e32 v[17:18], v17
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[19:20], v19
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_fma_f64 v[15:16], v[7:8], v[17:18], v[15:16]
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[17:18], v21
	v_fma_f64 v[15:16], v[3:4], v[19:20], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[15:16], v[5:6], v[17:18], v[15:16]
	v_cvt_u32_f64_e32 v10, v[15:16]
	v_add_co_u32 v15, vcc_lo, s10, v12
	v_add_co_ci_u32_e32 v16, vcc_lo, s11, v13, vcc_lo
	v_add_co_u32 v12, vcc_lo, v12, s12
	v_add_co_ci_u32_e32 v13, vcc_lo, s13, v13, vcc_lo
	global_store_b32 v[15:16], v10, off
	s_cbranch_scc0 .LBB1_37
.LBB1_38:                               ; %._crit_edge275
                                        ;   in Loop: Header=BB1_31 Depth=1
	v_add_nc_u32_e32 v9, s19, v9
	v_add_nc_u32_e32 v11, s19, v11
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_le_i32_e32 vcc_lo, s4, v9
	s_or_b32 s21, vcc_lo, s21
	s_and_not1_b32 exec_lo, exec_lo, s21
	s_cbranch_execnz .LBB1_31
.LBB1_39:                               ; %Flow387
	s_or_b32 exec_lo, exec_lo, s6
.LBB1_40:                               ; %.loopexit257
	s_cmp_gt_i32 s7, -1
	s_cbranch_scc1 .LBB1_53
; %bb.41:
	s_load_b32 s2, s[0:1], 0x3c
	s_add_u32 s0, s0, 48
	s_addc_u32 s1, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s7, s2, 0xffff
	s_mov_b32 s2, exec_lo
	s_mul_i32 s15, s15, s7
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v18, s15, v0
	v_cmpx_gt_i32_e64 s4, v18
	s_cbranch_execz .LBB1_53
; %bb.42:                               ; %.lr.ph287
	s_load_b32 s0, s[0:1], 0x0
	s_add_i32 s3, s5, -1
	s_cmp_gt_i32 s5, 1
	s_mul_i32 s3, s3, s4
	s_cselect_b32 s2, -1, 0
	s_cmp_gt_i32 s5, 2
	v_add_nc_u32_e32 v19, s3, v0
	s_cselect_b32 s1, -1, 0
	s_cmp_gt_i32 s5, 3
	v_mov_b32_e32 v13, 0
	s_cselect_b32 s6, -1, 0
	s_add_i32 s12, s5, -3
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mad_u64_u32 v[9:10], null, s4, s12, v[0:1]
	s_add_i32 s12, s5, -4
	s_add_i32 s5, s5, -2
	v_mad_u64_u32 v[10:11], null, s4, s12, v[0:1]
	v_mad_u64_u32 v[11:12], null, s4, s5, v[0:1]
	s_lshl_b32 s5, s4, 1
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s7, s0, s7
	s_mov_b32 s12, 0
.LBB1_43:                               ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_51 Depth 2
	v_add_nc_u32_e32 v16, s3, v18
	s_and_not1_b32 vcc_lo, exec_lo, s2
	s_delay_alu instid0(VALU_DEP_1)
	v_ashrrev_i32_e32 v17, 31, v16
	s_cbranch_vccnz .LBB1_45
; %bb.44:                               ;   in Loop: Header=BB1_43 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[14:15], 2, v[16:17]
	v_add_co_u32 v20, vcc_lo, s8, v14
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v21, vcc_lo, s9, v15, vcc_lo
	v_add_co_u32 v14, vcc_lo, s10, v14
	v_add_co_ci_u32_e32 v15, vcc_lo, s11, v15, vcc_lo
	global_load_b32 v0, v[20:21], off
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[20:21], v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[20:21], v[7:8], v[20:21]
	v_cvt_u32_f64_e32 v0, v[20:21]
	global_store_b32 v[14:15], v0, off
.LBB1_45:                               ;   in Loop: Header=BB1_43 Depth=1
	v_subrev_nc_u32_e32 v14, s4, v16
	s_and_not1_b32 vcc_lo, exec_lo, s1
	s_delay_alu instid0(VALU_DEP_1)
	v_ashrrev_i32_e32 v15, 31, v14
	s_cbranch_vccnz .LBB1_47
; %bb.46:                               ;   in Loop: Header=BB1_43 Depth=1
	v_lshlrev_b64 v[16:17], 2, v[16:17]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v16, vcc_lo, s10, v16
	v_add_co_ci_u32_e32 v17, vcc_lo, s11, v17, vcc_lo
	global_load_b32 v0, v[16:17], off
	v_lshlrev_b64 v[16:17], 2, v[14:15]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v20, vcc_lo, s8, v16
	v_add_co_ci_u32_e32 v21, vcc_lo, s9, v17, vcc_lo
	v_add_co_u32 v16, vcc_lo, s10, v16
	v_add_co_ci_u32_e32 v17, vcc_lo, s11, v17, vcc_lo
	global_load_b32 v12, v[20:21], off
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[20:21], v0
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[22:23], v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[20:21], v[1:2], v[20:21]
	v_fma_f64 v[20:21], v[7:8], v[22:23], v[20:21]
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_u32_f64_e32 v0, v[20:21]
	global_store_b32 v[16:17], v0, off
.LBB1_47:                               ;   in Loop: Header=BB1_43 Depth=1
	v_subrev_nc_u32_e32 v16, s4, v14
	s_and_not1_b32 vcc_lo, exec_lo, s6
	s_cbranch_vccnz .LBB1_49
; %bb.48:                               ;   in Loop: Header=BB1_43 Depth=1
	v_lshlrev_b64 v[14:15], 2, v[14:15]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v17, 31, v16
	v_add_co_u32 v14, vcc_lo, s10, v14
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v15, vcc_lo, s11, v15, vcc_lo
	global_load_b32 v0, v[14:15], off
	v_lshlrev_b64 v[14:15], 2, v[16:17]
	v_add_co_u32 v20, vcc_lo, s8, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v21, vcc_lo, s9, v15, vcc_lo
	global_load_b32 v12, v[20:21], off
	v_add_nc_u32_e32 v20, s5, v16
	v_ashrrev_i32_e32 v21, 31, v20
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[20:21], 2, v[20:21]
	v_add_co_u32 v20, vcc_lo, s10, v20
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v21, vcc_lo, s11, v21, vcc_lo
	v_add_co_u32 v14, vcc_lo, s10, v14
	v_add_co_ci_u32_e32 v15, vcc_lo, s11, v15, vcc_lo
	global_load_b32 v17, v[20:21], off
	s_waitcnt vmcnt(2)
	v_cvt_f64_u32_e32 v[20:21], v0
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[22:23], v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[20:21], v[1:2], v[20:21]
	v_fma_f64 v[20:21], v[7:8], v[22:23], v[20:21]
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[22:23], v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[20:21], v[3:4], v[22:23], v[20:21]
	v_cvt_u32_f64_e32 v0, v[20:21]
	global_store_b32 v[14:15], v0, off
.LBB1_49:                               ;   in Loop: Header=BB1_43 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_subrev_nc_u32_e32 v0, s4, v16
	s_mov_b32 s13, exec_lo
	v_cmpx_lt_i32_e32 -1, v0
	s_cbranch_execz .LBB1_52
; %bb.50:                               ; %.lr.ph283.preheader
                                        ;   in Loop: Header=BB1_43 Depth=1
	v_dual_mov_b32 v0, v11 :: v_dual_mov_b32 v15, v10
	v_mov_b32_e32 v14, v19
	v_mov_b32_e32 v16, v9
	s_mov_b32 s14, 0
.LBB1_51:                               ; %.lr.ph283
                                        ;   Parent Loop BB1_43 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_add_nc_u32_e32 v20, s15, v16
	v_add_nc_u32_e32 v12, s15, v15
	v_subrev_nc_u32_e32 v15, s4, v15
	v_subrev_nc_u32_e32 v16, s4, v16
	v_ashrrev_i32_e32 v21, 31, v20
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[20:21], 2, v[20:21]
	v_add_co_u32 v20, vcc_lo, s10, v20
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v21, vcc_lo, s11, v21, vcc_lo
	global_load_b32 v17, v[20:21], off
	v_lshlrev_b64 v[20:21], 2, v[12:13]
	v_add_co_u32 v22, vcc_lo, s8, v20
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v23, vcc_lo, s9, v21, vcc_lo
	v_add_co_u32 v20, s0, s10, v20
	v_add_co_ci_u32_e64 v21, s0, s11, v21, s0
	global_load_b32 v12, v[22:23], off
	v_add_nc_u32_e32 v22, s15, v0
	v_subrev_nc_u32_e32 v0, s4, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v23, 31, v22
	v_lshlrev_b64 v[22:23], 2, v[22:23]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v22, vcc_lo, s10, v22
	v_add_co_ci_u32_e32 v23, vcc_lo, s11, v23, vcc_lo
	global_load_b32 v26, v[22:23], off
	v_add_nc_u32_e32 v22, s15, v14
	v_subrev_nc_u32_e32 v14, s4, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v23, 31, v22
	v_lshlrev_b64 v[22:23], 2, v[22:23]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v22, vcc_lo, s10, v22
	v_add_co_ci_u32_e32 v23, vcc_lo, s11, v23, vcc_lo
	global_load_b32 v28, v[22:23], off
	s_waitcnt vmcnt(3)
	v_cvt_f64_u32_e32 v[22:23], v17
	v_add_nc_u32_e32 v17, s15, v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_cmp_gt_i32_e32 vcc_lo, 0, v17
	s_or_b32 s14, vcc_lo, s14
	s_waitcnt vmcnt(2)
	v_cvt_f64_u32_e32 v[24:25], v12
	v_mul_f64 v[22:23], v[1:2], v[22:23]
	s_waitcnt vmcnt(1)
	v_cvt_f64_u32_e32 v[26:27], v26
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_fma_f64 v[22:23], v[7:8], v[24:25], v[22:23]
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[24:25], v28
	v_fma_f64 v[22:23], v[3:4], v[26:27], v[22:23]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[22:23], v[5:6], v[24:25], v[22:23]
	v_cvt_u32_f64_e32 v12, v[22:23]
	global_store_b32 v[20:21], v12, off
	s_and_not1_b32 exec_lo, exec_lo, s14
	s_cbranch_execnz .LBB1_51
.LBB1_52:                               ; %Flow381
                                        ;   in Loop: Header=BB1_43 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	v_add_nc_u32_e32 v18, s7, v18
	v_add_nc_u32_e32 v9, s7, v9
	v_add_nc_u32_e32 v10, s7, v10
	v_add_nc_u32_e32 v19, s7, v19
	v_add_nc_u32_e32 v11, s7, v11
	v_cmp_le_i32_e32 vcc_lo, s4, v18
	s_or_b32 s12, vcc_lo, s12
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s12
	s_cbranch_execnz .LBB1_43
.LBB1_53:                               ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z27global_recursivegaussfilterPjS_Pdiiiiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 29
		.amdhsa_next_free_sgpr 35
		.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	_Z27global_recursivegaussfilterPjS_Pdiiiiii, .Lfunc_end1-_Z27global_recursivegaussfilterPjS_Pdiiiiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 3956
; NumSgprs: 37
; NumVgprs: 29
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 4
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 37
; NumVGPRsForWavesPerEU: 29
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
