#include <fstream>
#include <cuda.h>
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <ctime>
#include <cuda_runtime_api.h>

using namespace std;

struct  pixel //to store RGB values
{
	unsigned char r;
	unsigned char g;
	unsigned char b;
};

static void HandleError( cudaError_t err, const char *file, int line ) {
	if (err != cudaSuccess) {
		cout<<cudaGetErrorString(err)<<" in "<< file <<" at line "<< line<<endl;
	}
}


#define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ ))

__host__ __device__ pixel padding(pixel* Pixel_val, int x_coord, int y_coord, int img_width, int img_height) 
{	pixel Px;
	Px.r=0; Px.g=0; Px.b=0;
	if(x_coord< img_width && y_coord <img_height && x_coord>=0 && y_coord>=0)
	{
		Px=Pixel_val[y_coord*img_width+x_coord];
	}
	return Px;
}

__global__ void vertical_conv(pixel* Pixel_in_v, pixel* Pixel_out_v,int img_wd_v, int img_ht_v, float* kernel_v, int k_v)
{
	float tmp_r, tmp_g, tmp_b;
	size_t col=blockIdx.x*blockDim.x + threadIdx.x;
	size_t row=blockIdx.y*blockDim.y + threadIdx.y;
	size_t pix_idx_v=row*img_wd_v+col;
	tmp_r=0, tmp_g=0, tmp_b=0;		
	if(row<img_ht_v && col<img_wd_v){

		for(int l=0;l<k_v;l++)
		{//doing by 1 D arrays	
			pixel pix_val=padding(Pixel_in_v, col, (row+l-(k_v-1)/2), img_wd_v, img_ht_v);
			tmp_r+=pix_val.r * kernel_v[l];
			tmp_b+=pix_val.b * kernel_v[l];
			tmp_g+=pix_val.g * kernel_v[l];
		}

		Pixel_out_v[pix_idx_v].r=tmp_r;
		Pixel_out_v[pix_idx_v].g=tmp_g;
		Pixel_out_v[pix_idx_v].b=tmp_b;
	}
}			


__global__ void horizontal_conv(pixel* Pixel_in, pixel* Pixel_out, int img_wd, int img_ht, float* kernel, int k)
{
	float tmp_r, tmp_b, tmp_g;
	size_t col=blockIdx.x*blockDim.x + threadIdx.x;
	size_t row=blockIdx.y*blockDim.y + threadIdx.y;
	size_t pix_idx=row*img_wd+col;

	tmp_r=0, tmp_g=0, tmp_b=0;
	if(row<img_ht && col<img_wd)
	{
		for(int l=0; l<k;l++)
		{
			pixel pix_val=padding(Pixel_in, col+ l-(k-1)/2, row, img_wd, img_ht);
			tmp_r+=pix_val.r * kernel[l];
			tmp_g+=pix_val.g * kernel[l];
			tmp_b+=pix_val.b * kernel[l];
		}
		Pixel_out[pix_idx].r=tmp_r;
		Pixel_out[pix_idx].g=tmp_g;
		Pixel_out[pix_idx].b=tmp_b;
	}
}
pixel* vertical_conv_cpu(pixel* Pixel_in, int img_wd, int img_ht, float* kernel, int k)
{
	float tmp_r, tmp_g, tmp_b;
	pixel* Pixel_out=(pixel*)(malloc(img_wd*img_ht*sizeof(pixel)));
	for(int pix_idx=0;pix_idx<img_ht*img_wd;pix_idx++)
	{
		//vertical convolution
		int row=(int)(pix_idx/img_wd);
		int col=pix_idx%img_wd;
					
		if(row<img_ht && col<img_wd){
			tmp_r=0, tmp_g=0, tmp_b=0;
			for(int l=0;l<k;l++)
			{
				pixel pix_val=padding(Pixel_in, col,(row+l-(k-1)/2), img_wd, img_ht);
				tmp_r+=pix_val.r * kernel[l];
				tmp_b+=pix_val.b * kernel[l];
				tmp_g+=pix_val.g * kernel[l];
			}

			Pixel_out[pix_idx].r=tmp_r;
			Pixel_out[pix_idx].g=tmp_g;
			Pixel_out[pix_idx].b=tmp_b;
		}
	}
	return Pixel_out;
}

pixel* horizontal_conv_cpu(pixel* Pixel_in, int img_wd, int img_ht, float* kernel, int k )
{
	float tmp_r, tmp_b, tmp_g;
	//horizontal convolution
	pixel* Pixel_out=(pixel*)(malloc(img_wd*img_ht*sizeof(pixel)));

	for(int pix_idx=0;pix_idx<img_ht*img_wd;pix_idx++)
	{
		//vertical convolution
		int row=(int)(pix_idx/img_wd);
		int col=pix_idx%img_wd;
					
		if(row<img_ht && col<img_wd){
			tmp_r=0, tmp_g=0, tmp_b=0;
			for(int l=0;l<k;l++)
			{//doing by 1 D arrays	
				pixel pix_val=padding(Pixel_in, col+l-(k-1)/2,row, img_wd, img_ht);
				tmp_r+=pix_val.r * kernel[l];
				tmp_b+=pix_val.b * kernel[l];
				tmp_g+=pix_val.g * kernel[l];
			}

			Pixel_out[pix_idx].r=tmp_r;
			Pixel_out[pix_idx].g=tmp_g;
			Pixel_out[pix_idx].b=tmp_b;
		}
	}
	return Pixel_out;
}


int main(int argc, char* argv[])
{
	int nDevices;
	HANDLE_ERROR(cudaGetDeviceCount(&nDevices));
	//cout<<"number of devices="<<nDevices<<endl;
	
	time_t start_of_code=time(NULL);
	if(argc != 3) //there should be three arguments
	return 1; //exit and return an error
	
	float sigma = atof(argv[2]); //standard deviation for the gaussian 
    
	//Getting the kernel
	int k=floor(6*sigma);//sigma might have fractional part

	if(k%2==0) k++; //to make the size odd

	float *kernel0 = (float *)malloc(k * sizeof(float)); 	//y based gaussian
	float *kernel1 = (float *)malloc(k * sizeof(float));	//x based gaussian

	
	float constant1=sqrt(2*M_PI*sigma*sigma);//constants needed to define the kernel
	float constant2=2*sigma*sigma;

	int mid=floor(k/2);
	kernel0[mid]=1/constant1;	
	kernel1[mid]=1/constant1;

	for(int i=0;i<floor(k/2);i++)	//using symmetry from center, to generate the separable kernels 
	{
		kernel0[i]=((exp(-(floor(k/2)-i)*(floor(k/2)-i)/constant2)))/constant1;

		kernel1[i]=kernel0[i];

		kernel0[k-1-i]=kernel0[i];

		kernel1[k-1-i]=kernel1[i];

	}

	time_t kernel_generation=time(NULL); //find time taken for kernel generation
	cout<<" Kernel generation time:"<<double(kernel_generation - start_of_code)<<" sec"<<endl;

	
	//reading the PPM file line by line
	ifstream infile;
	infile.open(argv[1]);
	string line;

	int img_wd, img_ht;
	int max_val;
	int line_count=0;

	//line one contains P6, line 2 mentions about gimp version, line 3 stores the height and width
	getline(infile, line);
	istringstream iss1(line);

	//reading first line to check format
	int word;
	string str1;

	iss1>>str1;
	if(str1.compare("P6")!=0)	//comparing magic number
	{
		cout<<"wrong file format"<<endl;
		return 1;
	}

	getline(infile,line); //this line has version related comment, hence ignoring

	getline(infile,line); //this stores image dims
	istringstream iss2(line);
	iss2>>word;// this will be image width
	img_wd=word;
	iss2>>word;// this will be image height
	img_ht=word;
	//cout<<"wd="<<img_wd<<", ht="<<img_ht<<endl;

	size_t num_pixels=img_wd*img_ht;
	pixel *Pixel_out_cpu=(pixel*)malloc(num_pixels*sizeof(pixel));//store cpu output, global memory
	pixel *Pixel_out=(pixel*)malloc(num_pixels*sizeof(pixel));//store gpu output, global memory
	//storing the pixels as lexicographically
	pixel *Pixel = (pixel*)malloc(num_pixels*sizeof(pixel)); //store input image on global memory

	int pix_cnt=0, cnt=0;

	getline(infile,line); //this stores max value
	
	istringstream iss3(line);
	iss3>>word;
	max_val=word;//max pixel value

	unsigned int val;

	while (getline(infile, line))
	{
		istringstream iss4(line);
		for (int i=0; i<=line.length();i++)
		{
			if(pix_cnt<num_pixels)
			{	
				val =((int)line[i]);
				
				if(cnt%3==0)
				{		
					Pixel[pix_cnt].r=val;
				}
				else if(cnt%3==1)
				{
					Pixel[pix_cnt].g=val;
				}
				else
				{
					Pixel[pix_cnt].b=val;
					pix_cnt++;
				}
				cnt++;
			}
		} 	
		line_count++;		
	}

	time_t reading_file=time(NULL);
	cout<<" File reading time:"<<double(reading_file - kernel_generation)<<" sec"<<endl;//computed the reading time


	cudaDeviceProp prop;
   	HANDLE_ERROR(cudaGetDeviceProperties(&prop, 0));	//using GPU0

    	float thread_block=sqrt(prop.maxThreadsPerBlock);
	dim3 DimGrid(ceil(img_wd/thread_block),ceil(img_ht/thread_block),1); //image saved as a 2D grid
	dim3 DimBlock(thread_block,thread_block,1);
	//cout<<"grid="<<DimGrid.x<<" "<<DimGrid.y<<" "<<DimGrid.z<<endl;
	//cout<<"block="<<DimBlock.x<<" "<<DimBlock.y<<" "<<DimBlock.z<<endl;


	//allocating gpu memory

	pixel *Pixel_tmp_gpu, *Pixel_gpu, *Pixel_gpu_res;
   
	HANDLE_ERROR(cudaMalloc(&Pixel_gpu_res,num_pixels*sizeof(pixel))); //allocate space to store convolution result

	HANDLE_ERROR(cudaMalloc(&Pixel_tmp_gpu,num_pixels*sizeof(pixel))); //allocate space to store convolution temporary

	HANDLE_ERROR(cudaMalloc(&Pixel_gpu,num_pixels*sizeof(pixel))); //allocate space to copy image to GPU memory
	
	float *kernel0_gpu, *kernel1_gpu;
	
	HANDLE_ERROR(cudaMalloc(&kernel0_gpu, k*sizeof(float)));//allocate memory for kernel0

	HANDLE_ERROR(cudaMalloc(&kernel1_gpu, k*sizeof(float)));//allocate memory for kernel1
	
	//cout<<"memory allocated"<<endl;

	//copying needed data

	HANDLE_ERROR(cudaMemcpy(Pixel_gpu, Pixel, num_pixels*sizeof(pixel),cudaMemcpyHostToDevice));//copy input image from global to gpu

	HANDLE_ERROR(cudaMemcpy(kernel0_gpu, kernel0,k*sizeof(float),cudaMemcpyHostToDevice));//copy the kernel0 host to device

	HANDLE_ERROR(cudaMemcpy(kernel1_gpu,kernel1,k*sizeof(float),cudaMemcpyHostToDevice));//copy kernel1 host to device

	//cout<<"memory transfers done"<<endl;

	time_t before_vertical_convolution =time(NULL);
	vertical_conv<<<DimGrid,DimBlock>>>(Pixel_gpu, Pixel_tmp_gpu,img_wd, img_ht,kernel0_gpu,k);
	//cout<<img_wd<<" "<<img_ht<<endl;
	time_t vertical_convolution=time(NULL);

	cout<<" vertical_convolution time on gpu: "<<double(vertical_convolution - before_vertical_convolution)<<"sec"<<endl;

	horizontal_conv<<<DimGrid,DimBlock>>>(Pixel_tmp_gpu, Pixel_gpu_res, img_wd, img_ht, kernel1_gpu, k);
	time_t horizontal_convolution=time(NULL);

	HANDLE_ERROR(cudaMemcpy(Pixel_out,Pixel_gpu_res, num_pixels*sizeof(pixel),cudaMemcpyDeviceToHost));

	cout<<" horizontal convolution time on gpu:" <<double(horizontal_convolution-vertical_convolution)<<" sec"<<endl;
	//writing this to PPM file
	ofstream ofs;
	ofs.open("output_gpu.ppm", ofstream::out);
	ofs<<"P6\n"<<img_wd<<" "<<img_ht<<"\n"<<max_val<<"\n";
	
	for(int i=0; i <num_pixels;i++)
	{
		ofs<<Pixel_out[i].r<<Pixel_out[i].g<<Pixel_out[i].b;	//write as ascii
	}
	ofs.close();
	
	time_t end1=time(NULL);
	cout<<"File writing GPU: " <<double(end1-horizontal_convolution)<<" sec"<<endl;

	pixel *Pixel_tmp=vertical_conv_cpu(Pixel,img_wd, img_ht,kernel0,k);
	
	time_t vertical_convolution_cpu=time(NULL);

	Pixel_out=horizontal_conv_cpu(Pixel_tmp, img_wd, img_ht, kernel1, k);

	time_t horizontal_convolution_cpu=time(NULL);

	cout<<" vertical_convolution time on cpu: "<<double(vertical_convolution_cpu - end1)<<"sec"<<endl;

	cout<<" horizontal _convolution time on cpu: "<<double(horizontal_convolution_cpu-vertical_convolution_cpu )<<"sec"<<endl;
	//writing this to PPM file

	ofs.open("output_cpu.ppm", ofstream::out);
	ofs<<"P6\n"<<img_wd<<" "<<img_ht<<"\n"<<max_val<<"\n";
	
	for(int j=0; j <img_ht*img_wd;j++)
	{
		ofs<<Pixel_out[j].r<<Pixel_out[j].g<<Pixel_out[j].b;	//write as ascii
	}
	
	ofs.close();
	time_t end=time(NULL);

	cout<<" Saving the result CPU:"<<double(end-horizontal_convolution_cpu)<<" sec"<<endl;

	//display time taken for different processes
	

	return 0;
}


	.file	"tmpxft_002706d0_00000000-6_convd.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3831:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3831:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4595:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4595:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" in "
.LC1:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/aditisingh/Image_convolution_2D/master/convd.cu"
.LC2:
	.string	" at line "
	.text
	.type	_ZL11HandleError9cudaErrorPKci.constprop.0, @function
_ZL11HandleError9cudaErrorPKci.constprop.0:
.LFB4596:
	.cfi_startproc
	testl	%edi, %edi
	je	.L3
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%esi, %ebx
	call	cudaGetErrorString@PLT
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 8
	movq	%rax, %rdi
	jmp	_ZNSolsEPFRSoS_E.isra.0
.L3:
	ret
	.cfi_endproc
.LFE4596:
	.size	_ZL11HandleError9cudaErrorPKci.constprop.0, .-_ZL11HandleError9cudaErrorPKci.constprop.0
	.globl	_Z7paddingP5pixeliiii
	.type	_Z7paddingP5pixeliiii, @function
_Z7paddingP5pixeliiii:
.LFB3824:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cmpl	%ecx, %esi
	jge	.L12
	cmpl	%r8d, %edx
	jge	.L12
	movl	%esi, %edi
	orl	%edx, %edi
	js	.L12
	imull	%edx, %ecx
	addl	%esi, %ecx
	movslq	%ecx, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	addq	%rcx, %rax
	movb	(%rax), %cl
	movb	1(%rax), %dl
	movzbl	2(%rax), %eax
	jmp	.L10
.L12:
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
.L10:
	movb	%cl, -3(%rsp)
	salq	$16, %rax
	movb	%dl, -2(%rsp)
	movzwl	-3(%rsp), %edx
	orl	%edx, %eax
	ret
	.cfi_endproc
.LFE3824:
	.size	_Z7paddingP5pixeliiii, .-_Z7paddingP5pixeliiii
	.globl	_Z17vertical_conv_cpuP5pixeliiPfi
	.type	_Z17vertical_conv_cpuP5pixeliiPfi, @function
_Z17vertical_conv_cpuP5pixeliiPfi:
.LFB3825:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	imull	%edx, %r14d
	movq	%rcx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%r8d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%esi, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%rdi, 16(%rsp)
	movslq	%r14d, %rdi
	leaq	(%rdi,%rdi,2), %rdi
	call	malloc@PLT
	movl	$2, %ecx
	xorl	%r10d, %r10d
	movq	%rax, 8(%rsp)
	leal	-1(%r12), %eax
	movq	8(%rsp), %r11
	cltd
	idivl	%ecx
	movl	%eax, %r9d
	negl	%r9d
.L20:
	cmpl	%r10d, %r14d
	jle	.L31
	movl	%r10d, %eax
	cltd
	idivl	%ebx
	movl	%edx, %esi
	cmpl	%eax, %ebp
	jle	.L23
	cmpl	%edx, %ebx
	jle	.L23
	addl	%r9d, %eax
	xorps	%xmm0, %xmm0
	xorl	%r15d, %r15d
	movl	%eax, 28(%rsp)
	movaps	%xmm0, %xmm1
	movaps	%xmm0, %xmm2
.L21:
	cmpl	%r15d, %r12d
	jle	.L32
	movl	28(%rsp), %eax
	movq	16(%rsp), %rdi
	movl	%ebx, %ecx
	movl	%ebp, %r8d
	leal	(%rax,%r15), %edx
	call	_Z7paddingP5pixeliiii
	movss	0(%r13,%r15,4), %xmm4
	incq	%r15
	movslq	%eax, %rdx
	movzbl	%ah, %eax
	movq	%rdx, %rcx
	movzbl	%dl, %edx
	cvtsi2ssl	%edx, %xmm3
	shrq	$16, %rcx
	movzbl	%cl, %edx
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm2
	cvtsi2ssl	%edx, %xmm3
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm0
	cvtsi2ssl	%eax, %xmm3
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm1
	jmp	.L21
.L32:
	cvttss2sil	%xmm2, %eax
	movb	%al, (%r11)
	cvttss2sil	%xmm1, %eax
	movb	%al, 1(%r11)
	cvttss2sil	%xmm0, %eax
	movb	%al, 2(%r11)
.L23:
	incl	%r10d
	addq	$3, %r11
	jmp	.L20
.L31:
	movq	8(%rsp), %rax
	addq	$56, %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
.LFE3825:
	.size	_Z17vertical_conv_cpuP5pixeliiPfi, .-_Z17vertical_conv_cpuP5pixeliiPfi
	.globl	_Z19horizontal_conv_cpuP5pixeliiPfi
	.type	_Z19horizontal_conv_cpuP5pixeliiPfi, @function
_Z19horizontal_conv_cpuP5pixeliiPfi:
.LFB3826:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	imull	%edx, %r14d
	movq	%rcx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%r8d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%esi, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%rdi, 16(%rsp)
	movslq	%r14d, %rdi
	leaq	(%rdi,%rdi,2), %rdi
	call	malloc@PLT
	movl	$2, %ecx
	xorl	%r10d, %r10d
	movq	%rax, 8(%rsp)
	leal	-1(%r12), %eax
	movq	8(%rsp), %r11
	cltd
	idivl	%ecx
	movl	%eax, %r9d
	negl	%r9d
.L34:
	cmpl	%r10d, %r14d
	jle	.L45
	movl	%r10d, %eax
	cltd
	idivl	%ebx
	movl	%eax, 24(%rsp)
	cmpl	%eax, %ebp
	jle	.L37
	cmpl	%edx, %ebx
	jle	.L37
	leal	(%r9,%rdx), %eax
	xorps	%xmm1, %xmm1
	xorl	%r15d, %r15d
	movl	%eax, 28(%rsp)
	movaps	%xmm1, %xmm0
	movaps	%xmm1, %xmm2
.L35:
	cmpl	%r15d, %r12d
	jle	.L46
	movl	28(%rsp), %eax
	movl	24(%rsp), %edx
	movl	%ebx, %ecx
	movl	%ebp, %r8d
	movq	16(%rsp), %rdi
	leal	(%rax,%r15), %esi
	call	_Z7paddingP5pixeliiii
	movss	0(%r13,%r15,4), %xmm4
	incq	%r15
	movslq	%eax, %rdx
	movzbl	%ah, %eax
	movq	%rdx, %rcx
	movzbl	%dl, %edx
	cvtsi2ssl	%edx, %xmm3
	shrq	$16, %rcx
	movzbl	%cl, %edx
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm2
	cvtsi2ssl	%edx, %xmm3
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm0
	cvtsi2ssl	%eax, %xmm3
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm1
	jmp	.L35
.L46:
	cvttss2sil	%xmm2, %eax
	movb	%al, (%r11)
	cvttss2sil	%xmm1, %eax
	movb	%al, 1(%r11)
	cvttss2sil	%xmm0, %eax
	movb	%al, 2(%r11)
.L37:
	incl	%r10d
	addq	$3, %r11
	jmp	.L34
.L45:
	movq	8(%rsp), %rax
	addq	$56, %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
.LFE3826:
	.size	_Z19horizontal_conv_cpuP5pixeliiPfi, .-_Z19horizontal_conv_cpuP5pixeliiPfi
	.globl	_Z46__device_stub__Z13vertical_convP5pixelS0_iiPfiP5pixelS0_iiPfi
	.type	_Z46__device_stub__Z13vertical_convP5pixelS0_iiPfiP5pixelS0_iiPfi, @function
_Z46__device_stub__Z13vertical_convP5pixelS0_iiPfiP5pixelS0_iiPfi:
.LFB3853:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movl	%edx, 28(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 24(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L47
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z13vertical_convP5pixelS0_iiPfi(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L47:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3853:
	.size	_Z46__device_stub__Z13vertical_convP5pixelS0_iiPfiP5pixelS0_iiPfi, .-_Z46__device_stub__Z13vertical_convP5pixelS0_iiPfiP5pixelS0_iiPfi
	.globl	_Z13vertical_convP5pixelS0_iiPfi
	.type	_Z13vertical_convP5pixelS0_iiPfi, @function
_Z13vertical_convP5pixelS0_iiPfi:
.LFB3854:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z13vertical_convP5pixelS0_iiPfiP5pixelS0_iiPfi
	.cfi_endproc
.LFE3854:
	.size	_Z13vertical_convP5pixelS0_iiPfi, .-_Z13vertical_convP5pixelS0_iiPfi
	.globl	_Z48__device_stub__Z15horizontal_convP5pixelS0_iiPfiP5pixelS0_iiPfi
	.type	_Z48__device_stub__Z15horizontal_convP5pixelS0_iiPfiP5pixelS0_iiPfi, @function
_Z48__device_stub__Z15horizontal_convP5pixelS0_iiPfiP5pixelS0_iiPfi:
.LFB3855:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movl	%edx, 28(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 24(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L52
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z15horizontal_convP5pixelS0_iiPfi(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L52:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3855:
	.size	_Z48__device_stub__Z15horizontal_convP5pixelS0_iiPfiP5pixelS0_iiPfi, .-_Z48__device_stub__Z15horizontal_convP5pixelS0_iiPfiP5pixelS0_iiPfi
	.globl	_Z15horizontal_convP5pixelS0_iiPfi
	.type	_Z15horizontal_convP5pixelS0_iiPfi, @function
_Z15horizontal_convP5pixelS0_iiPfi:
.LFB3856:
	.cfi_startproc
	endbr64
	jmp	_Z48__device_stub__Z15horizontal_convP5pixelS0_iiPfiP5pixelS0_iiPfi
	.cfi_endproc
.LFE3856:
	.size	_Z15horizontal_convP5pixelS0_iiPfi, .-_Z15horizontal_convP5pixelS0_iiPfi
	.section	.rodata.str1.1
.LC4:
	.string	"_Z15horizontal_convP5pixelS0_iiPfi"
.LC5:
	.string	"_Z13vertical_convP5pixelS0_iiPfi"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3858:
	.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	.LC4(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z15horizontal_convP5pixelS0_iiPfi(%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	.LC5(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z13vertical_convP5pixelS0_iiPfi(%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
.LFE3858:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC10:
	.string	" Kernel generation time:"
.LC11:
	.string	" sec"
.LC12:
	.string	"P6"
.LC13:
	.string	"wrong file format"
.LC14:
	.string	" File reading time:"
.LC15:
	.string	" vertical_convolution time on gpu: "
.LC16:
	.string	"sec"
.LC17:
	.string	" horizontal convolution time on gpu:"
.LC18:
	.string	"output_gpu.ppm"
.LC19:
	.string	"P6\n"
.LC20:
	.string	" "
.LC21:
	.string	"\n"
.LC22:
	.string	"File writing GPU: "
.LC23:
	.string	" vertical_convolution time on cpu: "
.LC24:
	.string	" horizontal _convolution time on cpu: "
.LC25:
	.string	"output_cpu.ppm"
.LC26:
	.string	" Saving the result CPU:"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3827:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3827
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$3448, %rsp
	.cfi_def_cfa_offset 3504
	movq	%fs:40, %rax
	movq	%rax, 3432(%rsp)
	xorl	%eax, %eax
	leaq	80(%rsp), %rdi
.LEHB0:
	call	cudaGetDeviceCount@PLT
	movl	$149, %esi
	movl	%eax, %edi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	xorl	%edi, %edi
	call	time@PLT
	cmpl	$3, %ebx
	jne	.L88
	movq	16(%rbp), %rdi
	movq	%rax, %r12
	call	atof@PLT
	cvtsd2ss	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	movss	%xmm1, 8(%rsp)
	mulss	.LC6(%rip), %xmm0
	call	floorf@PLT
	cvttss2sil	%xmm0, %eax
	movl	%eax, 16(%rsp)
	andl	$1, %eax
	cmpl	$1, %eax
	adcl	$0, 16(%rsp)
	movslq	16(%rsp), %rax
	xorl	%r13d, %r13d
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	movq	24(%rsp), %rdi
	movq	%rax, 40(%rsp)
	call	malloc@PLT
	movss	8(%rsp), %xmm1
	movsd	.LC7(%rip), %xmm0
	movq	%rax, %rbx
	cvtss2sd	%xmm1, %xmm2
	mulsd	%xmm2, %xmm0
	mulsd	%xmm2, %xmm0
	call	sqrt@PLT
	movl	16(%rsp), %eax
	movl	$2, %ecx
	movss	8(%rsp), %xmm1
	cvtsd2ss	%xmm0, %xmm2
	movss	.LC8(%rip), %xmm0
	movq	24(%rsp), %r15
	cltd
	movaps	%xmm1, %xmm3
	idivl	%ecx
	movq	40(%rsp), %rcx
	divss	%xmm2, %xmm0
	addss	%xmm1, %xmm3
	mulss	%xmm1, %xmm3
	cltq
	movq	%rax, %r14
	movss	%xmm0, (%rcx,%rax,4)
	movss	%xmm0, (%rbx,%rax,4)
.L62:
	subq	$4, %r15
	cmpl	%r13d, %r14d
	jle	.L100
	cvtsi2sdl	%r13d, %xmm0
	movss	%xmm2, 20(%rsp)
	cvtsi2sdl	%r14d, %xmm1
	movss	%xmm3, 8(%rsp)
	subsd	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	xorps	.LC9(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvtss2sd	%xmm3, %xmm1
	divsd	%xmm1, %xmm0
	call	exp@PLT
	movss	20(%rsp), %xmm2
	movq	40(%rsp), %rax
	movss	8(%rsp), %xmm3
	cvtss2sd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%rax,%r13,4)
	movss	%xmm0, (%rbx,%r13,4)
	incq	%r13
	movss	%xmm0, (%rax,%r15)
	movss	%xmm0, (%rbx,%r15)
	jmp	.L62
.L100:
	xorl	%edi, %edi
	leaq	_ZSt4cout(%rip), %r13
	call	time@PLT
	leaq	.LC10(%rip), %rsi
	movq	%r13, %rdi
	movq	%rax, %r15
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%r15, %rax
	subq	%r12, %rax
	leaq	1880(%rsp), %r12
	cvtsi2sdq	%rax, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC11(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%r12, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE0:
	movq	8(%rbp), %rsi
	movl	$8, %edx
	movq	%r12, %rdi
.LEHB1:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
.LEHE1:
	leaq	152(%rsp), %rbp
	leaq	168(%rsp), %rax
	xorl	%edx, %edx
	movq	%r12, %rdi
	movq	%rbp, %rsi
	movq	%rax, 152(%rsp)
	movq	%rdx, 160(%rsp)
	movb	$0, 168(%rsp)
.LEHB2:
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	leaq	216(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rsi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode@PLT
.LEHE2:
	leaq	200(%rsp), %rax
	leaq	184(%rsp), %r14
	movq	8(%rsp), %rdi
	movb	$0, 200(%rsp)
	movq	%rax, 184(%rsp)
	movq	%r14, %rsi
	xorl	%eax, %eax
	movq	%rax, 192(%rsp)
.LEHB3:
	call	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	%r14, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEPKc@PLT
	movl	%eax, %r14d
	testl	%eax, %eax
	je	.L64
	leaq	.LC13(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$1, %r14d
	jmp	.L65
.L64:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	leaq	600(%rsp), %r12
	movl	$8, %edx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode@PLT
.LEHE3:
	leaq	84(%rsp), %rbp
	movq	%r12, %rdi
	movq	%rbp, %rsi
.LEHB4:
	call	_ZNSirsERi@PLT
	movl	84(%rsp), %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	movl	%eax, 8(%rsp)
	call	_ZNSirsERi@PLT
	movl	84(%rsp), %eax
	leaq	152(%rsp), %r13
	movl	%eax, 20(%rsp)
	movl	8(%rsp), %eax
	movl	20(%rsp), %ecx
	imull	%ecx, %eax
	movslq	%eax, %rbp
	movl	%eax, 72(%rsp)
	leaq	0(%rbp,%rbp,2), %rax
	movq	%rax, %rdi
	movq	%rax, 32(%rsp)
	call	malloc@PLT
	leaq	0(%rbp,%rbp,2), %rdi
	movq	%rax, 64(%rsp)
	call	malloc@PLT
	leaq	1880(%rsp), %rdi
	movq	%r13, %rsi
	movq	%rax, 48(%rsp)
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	leaq	984(%rsp), %r12
	movl	$8, %edx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode@PLT
.LEHE4:
	leaq	84(%rsp), %rsi
	movq	%r12, %rdi
.LEHB5:
	call	_ZNSirsERi@PLT
	movl	84(%rsp), %eax
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	movl	%eax, 76(%rsp)
	leaq	152(%rsp), %rax
	movq	%rax, 56(%rsp)
.L66:
	movq	56(%rsp), %rsi
	leaq	1880(%rsp), %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L101
	movq	56(%rsp), %rsi
	leaq	2400(%rsp), %rdi
	movl	$8, %edx
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode@PLT
	movq	160(%rsp), %r9
	movq	152(%rsp), %r10
	xorl	%esi, %esi
	movl	$3, %r8d
.L72:
	movslq	%r12d, %rcx
	cmpq	%rbp, %rcx
	jnb	.L67
	movl	%r13d, %eax
	movsbl	(%r10,%rsi), %edi
	cltd
	idivl	%r8d
	leaq	(%rcx,%rcx,2), %rax
	movq	48(%rsp), %rcx
	addq	%rcx, %rax
	testl	%edx, %edx
	jne	.L68
	movb	%dil, (%rax)
	jmp	.L71
.L68:
	decl	%edx
	jne	.L70
	movb	%dil, 1(%rax)
	jmp	.L71
.L70:
	movb	%dil, 2(%rax)
	incl	%r12d
.L71:
	incl	%r13d
.L67:
	incq	%rsi
	cmpq	%rsi, %r9
	jnb	.L72
	leaq	2400(%rsp), %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	jmp	.L66
.L101:
	xorl	%edi, %edi
	call	time@PLT
	leaq	.LC14(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %rbp
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	subq	%r15, %rbp
	movq	%rax, %rdi
	cvtsi2sdq	%rbp, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	2400(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaGetDeviceProperties_v2@PLT
	movl	%eax, %edi
	movl	$273, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	cvtsi2sdl	2720(%rsp), %xmm0
	call	sqrt@PLT
	cvtsd2ss	%xmm0, %xmm4
	cvtsi2ssl	20(%rsp), %xmm0
	movss	%xmm4, 56(%rsp)
	divss	%xmm4, %xmm0
	call	ceilf@PLT
	movd	%xmm0, %ebp
	cvtsi2ssl	8(%rsp), %xmm0
	divss	56(%rsp), %xmm0
	call	ceilf@PLT
	movd	%ebp, %xmm7
	movq	32(%rsp), %rsi
	leaq	104(%rsp), %rdi
	movl	$1, 136(%rsp)
	cvttss2siq	%xmm0, %rax
	movl	$1, 148(%rsp)
	movl	%eax, 128(%rsp)
	cvttss2siq	%xmm7, %rax
	movl	%eax, 132(%rsp)
	cvttss2siq	56(%rsp), %rax
	movl	%eax, 140(%rsp)
	movl	%eax, 144(%rsp)
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$286, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	32(%rsp), %rsi
	leaq	88(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$288, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	32(%rsp), %rsi
	leaq	96(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$290, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	24(%rsp), %rsi
	leaq	112(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$294, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	24(%rsp), %rsi
	leaq	120(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$296, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	32(%rsp), %rdx
	movq	48(%rsp), %rsi
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$302, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	24(%rsp), %rdx
	movq	40(%rsp), %rsi
	movl	$1, %ecx
	movq	112(%rsp), %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$304, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	24(%rsp), %rdx
	movq	120(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$306, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	xorl	%edi, %edi
	call	time@PLT
	movl	148(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	140(%rsp), %rdx
	movq	128(%rsp), %rdi
	movl	136(%rsp), %esi
	xorl	%r8d, %r8d
	movq	%rax, %r12
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L74
	movl	16(%rsp), %r9d
	movq	112(%rsp), %r8
	movl	20(%rsp), %ecx
	movl	8(%rsp), %edx
	movq	88(%rsp), %rsi
	movq	96(%rsp), %rdi
	call	_Z46__device_stub__Z13vertical_convP5pixelS0_iiPfiP5pixelS0_iiPfi
.L74:
	xorl	%edi, %edi
	call	time@PLT
	leaq	.LC15(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %rbp
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%rbp, %rax
	subq	%r12, %rax
	cvtsi2sdq	%rax, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC16(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	148(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	140(%rsp), %rdx
	movq	128(%rsp), %rdi
	movl	136(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L75
	movl	16(%rsp), %r9d
	movq	120(%rsp), %r8
	movl	20(%rsp), %ecx
	movl	8(%rsp), %edx
	movq	104(%rsp), %rsi
	movq	88(%rsp), %rdi
	call	_Z48__device_stub__Z15horizontal_convP5pixelS0_iiPfiP5pixelS0_iiPfi
.L75:
	xorl	%edi, %edi
	call	time@PLT
	movq	32(%rsp), %rdx
	movq	104(%rsp), %rsi
	movl	$2, %ecx
	movq	64(%rsp), %rdi
	movq	%rax, %r15
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$320, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	leaq	.LC17(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%r15, %rax
	subq	%rbp, %rax
	cvtsi2sdq	%rax, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	1368(%rsp), %rbp
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE5:
	movl	$16, %edx
	leaq	.LC18(%rip), %rsi
	movq	%rbp, %rdi
.LEHB6:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	leaq	.LC19(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	8(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC20(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	20(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC21(%rip), %rbp
	movq	%rax, %rdi
	movq	%rbp, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	76(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movq	%rbp, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	64(%rsp), %r12
	movq	32(%rsp), %rbp
	leaq	1368(%rsp), %r13
	addq	%r12, %rbp
.L76:
	cmpq	%rbp, %r12
	je	.L102
	movsbl	(%r12), %esi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movsbl	1(%r12), %esi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movsbl	2(%r12), %esi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	addq	$3, %r12
	jmp	.L76
.L102:
	movq	%r13, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
	xorl	%edi, %edi
	call	time@PLT
	leaq	.LC22(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %rbp
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%rbp, %rax
	subq	%r15, %rax
	cvtsi2sdq	%rax, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	16(%rsp), %r8d
	movq	40(%rsp), %rcx
	movl	20(%rsp), %edx
	movl	8(%rsp), %esi
	movq	48(%rsp), %rdi
	call	_Z17vertical_conv_cpuP5pixeliiPfi
	xorl	%edi, %edi
	movq	%rax, %r15
	call	time@PLT
	movl	8(%rsp), %esi
	movl	20(%rsp), %edx
	movq	%rbx, %rcx
	movl	16(%rsp), %r8d
	movq	%r15, %rdi
	movq	%rax, %r12
	call	_Z19horizontal_conv_cpuP5pixeliiPfi
	xorl	%edi, %edi
	movq	%rax, %rbx
	call	time@PLT
	leaq	.LC23(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %r15
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%r12, %rax
	subq	%rbp, %rax
	cvtsi2sdq	%rax, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC16(%rip), %rbp
	movq	%rax, %rdi
	movq	%rbp, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC24(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%r15, %rax
	subq	%r12, %rax
	cvtsi2sdq	%rax, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movq	%rbp, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$16, %edx
	leaq	.LC25(%rip), %rsi
	movq	%r13, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	leaq	.LC19(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	8(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC20(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	20(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC21(%rip), %rbp
	movq	%rax, %rdi
	movq	%rbp, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	76(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movq	%rbp, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	xorl	%ebp, %ebp
.L78:
	cmpl	%ebp, 72(%rsp)
	jle	.L103
	movsbl	(%rbx), %esi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movsbl	1(%rbx), %esi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movsbl	2(%rbx), %esi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	incl	%ebp
	addq	$3, %rbx
	jmp	.L78
.L103:
	movq	%r13, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
	xorl	%edi, %edi
	call	time@PLT
	leaq	.LC26(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %rbx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	subq	%r15, %rbx
	movq	%rax, %rdi
	cvtsi2sdq	%rbx, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.LEHE6:
	movq	%r13, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	984(%rsp), %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	leaq	600(%rsp), %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
.L65:
	leaq	184(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	leaq	216(%rsp), %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	leaq	152(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	leaq	1880(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L59
.L88:
	movl	$1, %r14d
	jmp	.L59
.L95:
	endbr64
	movq	%rax, %rbx
.L80:
	leaq	1368(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L81
.L94:
	endbr64
	movq	%rax, %rbx
.L81:
	leaq	984(%rsp), %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	jmp	.L82
.L93:
	endbr64
	movq	%rax, %rbx
.L82:
	leaq	600(%rsp), %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	jmp	.L83
.L92:
	endbr64
	movq	%rax, %rbx
.L83:
	leaq	184(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	leaq	216(%rsp), %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	jmp	.L84
.L91:
	endbr64
	movq	%rax, %rbx
.L84:
	leaq	152(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L85
.L90:
	endbr64
	movq	%rax, %rbx
.L85:
	leaq	1880(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	3432(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L99
	movq	%rbx, %rdi
.LEHB7:
	call	_Unwind_Resume@PLT
.LEHE7:
.L59:
	movq	3432(%rsp), %rax
	subq	%fs:40, %rax
	je	.L87
.L99:
	call	__stack_chk_fail@PLT
.L87:
	addq	$3448, %rsp
	.cfi_def_cfa_offset 56
	movl	%r14d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3827:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3827:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3827-.LLSDACSB3827
.LLSDACSB3827:
	.uleb128 .LEHB0-.LFB3827
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3827
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L90-.LFB3827
	.uleb128 0
	.uleb128 .LEHB2-.LFB3827
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L91-.LFB3827
	.uleb128 0
	.uleb128 .LEHB3-.LFB3827
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L92-.LFB3827
	.uleb128 0
	.uleb128 .LEHB4-.LFB3827
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L93-.LFB3827
	.uleb128 0
	.uleb128 .LEHB5-.LFB3827
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L94-.LFB3827
	.uleb128 0
	.uleb128 .LEHB6-.LFB3827
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L95-.LFB3827
	.uleb128 0
	.uleb128 .LEHB7-.LFB3827
	.uleb128 .LEHE7-.LEHB7
	.uleb128 0
	.uleb128 0
.LLSDACSE3827:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC6:
	.long	1086324736
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC7:
	.long	1413754136
	.long	1075388923
	.section	.rodata.cst4
	.align 4
.LC8:
	.long	1065353216
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC9:
	.long	0
	.long	-2147483648
	.long	0
	.long	0
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <fstream>
#include <hip/hip_runtime.h>
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <ctime>
#include <hip/hip_runtime_api.h>

using namespace std;

struct  pixel //to store RGB values
{
	unsigned char r;
	unsigned char g;
	unsigned char b;
};

static void HandleError( hipError_t err, const char *file, int line ) {
	if (err != hipSuccess) {
		cout<<hipGetErrorString(err)<<" in "<< file <<" at line "<< line<<endl;
	}
}


#define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ ))

__host__ __device__ pixel padding(pixel* Pixel_val, int x_coord, int y_coord, int img_width, int img_height) 
{	pixel Px;
	Px.r=0; Px.g=0; Px.b=0;
	if(x_coord< img_width && y_coord <img_height && x_coord>=0 && y_coord>=0)
	{
		Px=Pixel_val[y_coord*img_width+x_coord];
	}
	return Px;
}

__global__ void vertical_conv(pixel* Pixel_in_v, pixel* Pixel_out_v,int img_wd_v, int img_ht_v, float* kernel_v, int k_v)
{
	float tmp_r, tmp_g, tmp_b;
	size_t col=blockIdx.x*blockDim.x + threadIdx.x;
	size_t row=blockIdx.y*blockDim.y + threadIdx.y;
	size_t pix_idx_v=row*img_wd_v+col;
	tmp_r=0, tmp_g=0, tmp_b=0;		
	if(row<img_ht_v && col<img_wd_v){

		for(int l=0;l<k_v;l++)
		{//doing by 1 D arrays	
			pixel pix_val=padding(Pixel_in_v, col, (row+l-(k_v-1)/2), img_wd_v, img_ht_v);
			tmp_r+=pix_val.r * kernel_v[l];
			tmp_b+=pix_val.b * kernel_v[l];
			tmp_g+=pix_val.g * kernel_v[l];
		}

		Pixel_out_v[pix_idx_v].r=tmp_r;
		Pixel_out_v[pix_idx_v].g=tmp_g;
		Pixel_out_v[pix_idx_v].b=tmp_b;
	}
}			


__global__ void horizontal_conv(pixel* Pixel_in, pixel* Pixel_out, int img_wd, int img_ht, float* kernel, int k)
{
	float tmp_r, tmp_b, tmp_g;
	size_t col=blockIdx.x*blockDim.x + threadIdx.x;
	size_t row=blockIdx.y*blockDim.y + threadIdx.y;
	size_t pix_idx=row*img_wd+col;

	tmp_r=0, tmp_g=0, tmp_b=0;
	if(row<img_ht && col<img_wd)
	{
		for(int l=0; l<k;l++)
		{
			pixel pix_val=padding(Pixel_in, col+ l-(k-1)/2, row, img_wd, img_ht);
			tmp_r+=pix_val.r * kernel[l];
			tmp_g+=pix_val.g * kernel[l];
			tmp_b+=pix_val.b * kernel[l];
		}
		Pixel_out[pix_idx].r=tmp_r;
		Pixel_out[pix_idx].g=tmp_g;
		Pixel_out[pix_idx].b=tmp_b;
	}
}
pixel* vertical_conv_cpu(pixel* Pixel_in, int img_wd, int img_ht, float* kernel, int k)
{
	float tmp_r, tmp_g, tmp_b;
	pixel* Pixel_out=(pixel*)(malloc(img_wd*img_ht*sizeof(pixel)));
	for(int pix_idx=0;pix_idx<img_ht*img_wd;pix_idx++)
	{
		//vertical convolution
		int row=(int)(pix_idx/img_wd);
		int col=pix_idx%img_wd;
					
		if(row<img_ht && col<img_wd){
			tmp_r=0, tmp_g=0, tmp_b=0;
			for(int l=0;l<k;l++)
			{
				pixel pix_val=padding(Pixel_in, col,(row+l-(k-1)/2), img_wd, img_ht);
				tmp_r+=pix_val.r * kernel[l];
				tmp_b+=pix_val.b * kernel[l];
				tmp_g+=pix_val.g * kernel[l];
			}

			Pixel_out[pix_idx].r=tmp_r;
			Pixel_out[pix_idx].g=tmp_g;
			Pixel_out[pix_idx].b=tmp_b;
		}
	}
	return Pixel_out;
}

pixel* horizontal_conv_cpu(pixel* Pixel_in, int img_wd, int img_ht, float* kernel, int k )
{
	float tmp_r, tmp_b, tmp_g;
	//horizontal convolution
	pixel* Pixel_out=(pixel*)(malloc(img_wd*img_ht*sizeof(pixel)));

	for(int pix_idx=0;pix_idx<img_ht*img_wd;pix_idx++)
	{
		//vertical convolution
		int row=(int)(pix_idx/img_wd);
		int col=pix_idx%img_wd;
					
		if(row<img_ht && col<img_wd){
			tmp_r=0, tmp_g=0, tmp_b=0;
			for(int l=0;l<k;l++)
			{//doing by 1 D arrays	
				pixel pix_val=padding(Pixel_in, col+l-(k-1)/2,row, img_wd, img_ht);
				tmp_r+=pix_val.r * kernel[l];
				tmp_b+=pix_val.b * kernel[l];
				tmp_g+=pix_val.g * kernel[l];
			}

			Pixel_out[pix_idx].r=tmp_r;
			Pixel_out[pix_idx].g=tmp_g;
			Pixel_out[pix_idx].b=tmp_b;
		}
	}
	return Pixel_out;
}


int main(int argc, char* argv[])
{
	int nDevices;
	HANDLE_ERROR(hipGetDeviceCount(&nDevices));
	//cout<<"number of devices="<<nDevices<<endl;
	
	time_t start_of_code=time(NULL);
	if(argc != 3) //there should be three arguments
	return 1; //exit and return an error
	
	float sigma = atof(argv[2]); //standard deviation for the gaussian 
    
	//Getting the kernel
	int k=floor(6*sigma);//sigma might have fractional part

	if(k%2==0) k++; //to make the size odd

	float *kernel0 = (float *)malloc(k * sizeof(float)); 	//y based gaussian
	float *kernel1 = (float *)malloc(k * sizeof(float));	//x based gaussian

	
	float constant1=sqrt(2*M_PI*sigma*sigma);//constants needed to define the kernel
	float constant2=2*sigma*sigma;

	int mid=floor(k/2);
	kernel0[mid]=1/constant1;	
	kernel1[mid]=1/constant1;

	for(int i=0;i<floor(k/2);i++)	//using symmetry from center, to generate the separable kernels 
	{
		kernel0[i]=((exp(-(floor(k/2)-i)*(floor(k/2)-i)/constant2)))/constant1;

		kernel1[i]=kernel0[i];

		kernel0[k-1-i]=kernel0[i];

		kernel1[k-1-i]=kernel1[i];

	}

	time_t kernel_generation=time(NULL); //find time taken for kernel generation
	cout<<" Kernel generation time:"<<double(kernel_generation - start_of_code)<<" sec"<<endl;

	
	//reading the PPM file line by line
	ifstream infile;
	infile.open(argv[1]);
	string line;

	int img_wd, img_ht;
	int max_val;
	int line_count=0;

	//line one contains P6, line 2 mentions about gimp version, line 3 stores the height and width
	getline(infile, line);
	istringstream iss1(line);

	//reading first line to check format
	int word;
	string str1;

	iss1>>str1;
	if(str1.compare("P6")!=0)	//comparing magic number
	{
		cout<<"wrong file format"<<endl;
		return 1;
	}

	getline(infile,line); //this line has version related comment, hence ignoring

	getline(infile,line); //this stores image dims
	istringstream iss2(line);
	iss2>>word;// this will be image width
	img_wd=word;
	iss2>>word;// this will be image height
	img_ht=word;
	//cout<<"wd="<<img_wd<<", ht="<<img_ht<<endl;

	size_t num_pixels=img_wd*img_ht;
	pixel *Pixel_out_cpu=(pixel*)malloc(num_pixels*sizeof(pixel));//store cpu output, global memory
	pixel *Pixel_out=(pixel*)malloc(num_pixels*sizeof(pixel));//store gpu output, global memory
	//storing the pixels as lexicographically
	pixel *Pixel = (pixel*)malloc(num_pixels*sizeof(pixel)); //store input image on global memory

	int pix_cnt=0, cnt=0;

	getline(infile,line); //this stores max value
	
	istringstream iss3(line);
	iss3>>word;
	max_val=word;//max pixel value

	unsigned int val;

	while (getline(infile, line))
	{
		istringstream iss4(line);
		for (int i=0; i<=line.length();i++)
		{
			if(pix_cnt<num_pixels)
			{	
				val =((int)line[i]);
				
				if(cnt%3==0)
				{		
					Pixel[pix_cnt].r=val;
				}
				else if(cnt%3==1)
				{
					Pixel[pix_cnt].g=val;
				}
				else
				{
					Pixel[pix_cnt].b=val;
					pix_cnt++;
				}
				cnt++;
			}
		} 	
		line_count++;		
	}

	time_t reading_file=time(NULL);
	cout<<" File reading time:"<<double(reading_file - kernel_generation)<<" sec"<<endl;//computed the reading time


	hipDeviceProp_t prop;
   	HANDLE_ERROR(hipGetDeviceProperties(&prop, 0));	//using GPU0

    	float thread_block=sqrt(prop.maxThreadsPerBlock);
	dim3 DimGrid(ceil(img_wd/thread_block),ceil(img_ht/thread_block),1); //image saved as a 2D grid
	dim3 DimBlock(thread_block,thread_block,1);
	//cout<<"grid="<<DimGrid.x<<" "<<DimGrid.y<<" "<<DimGrid.z<<endl;
	//cout<<"block="<<DimBlock.x<<" "<<DimBlock.y<<" "<<DimBlock.z<<endl;


	//allocating gpu memory

	pixel *Pixel_tmp_gpu, *Pixel_gpu, *Pixel_gpu_res;
   
	HANDLE_ERROR(hipMalloc(&Pixel_gpu_res,num_pixels*sizeof(pixel))); //allocate space to store convolution result

	HANDLE_ERROR(hipMalloc(&Pixel_tmp_gpu,num_pixels*sizeof(pixel))); //allocate space to store convolution temporary

	HANDLE_ERROR(hipMalloc(&Pixel_gpu,num_pixels*sizeof(pixel))); //allocate space to copy image to GPU memory
	
	float *kernel0_gpu, *kernel1_gpu;
	
	HANDLE_ERROR(hipMalloc(&kernel0_gpu, k*sizeof(float)));//allocate memory for kernel0

	HANDLE_ERROR(hipMalloc(&kernel1_gpu, k*sizeof(float)));//allocate memory for kernel1
	
	//cout<<"memory allocated"<<endl;

	//copying needed data

	HANDLE_ERROR(hipMemcpy(Pixel_gpu, Pixel, num_pixels*sizeof(pixel),hipMemcpyHostToDevice));//copy input image from global to gpu

	HANDLE_ERROR(hipMemcpy(kernel0_gpu, kernel0,k*sizeof(float),hipMemcpyHostToDevice));//copy the kernel0 host to device

	HANDLE_ERROR(hipMemcpy(kernel1_gpu,kernel1,k*sizeof(float),hipMemcpyHostToDevice));//copy kernel1 host to device

	//cout<<"memory transfers done"<<endl;

	time_t before_vertical_convolution =time(NULL);
	vertical_conv<<<DimGrid,DimBlock>>>(Pixel_gpu, Pixel_tmp_gpu,img_wd, img_ht,kernel0_gpu,k);
	//cout<<img_wd<<" "<<img_ht<<endl;
	time_t vertical_convolution=time(NULL);

	cout<<" vertical_convolution time on gpu: "<<double(vertical_convolution - before_vertical_convolution)<<"sec"<<endl;

	horizontal_conv<<<DimGrid,DimBlock>>>(Pixel_tmp_gpu, Pixel_gpu_res, img_wd, img_ht, kernel1_gpu, k);
	time_t horizontal_convolution=time(NULL);

	HANDLE_ERROR(hipMemcpy(Pixel_out,Pixel_gpu_res, num_pixels*sizeof(pixel),hipMemcpyDeviceToHost));

	cout<<" horizontal convolution time on gpu:" <<double(horizontal_convolution-vertical_convolution)<<" sec"<<endl;
	//writing this to PPM file
	ofstream ofs;
	ofs.open("output_gpu.ppm", ofstream::out);
	ofs<<"P6\n"<<img_wd<<" "<<img_ht<<"\n"<<max_val<<"\n";
	
	for(int i=0; i <num_pixels;i++)
	{
		ofs<<Pixel_out[i].r<<Pixel_out[i].g<<Pixel_out[i].b;	//write as ascii
	}
	ofs.close();
	
	time_t end1=time(NULL);
	cout<<"File writing GPU: " <<double(end1-horizontal_convolution)<<" sec"<<endl;

	pixel *Pixel_tmp=vertical_conv_cpu(Pixel,img_wd, img_ht,kernel0,k);
	
	time_t vertical_convolution_cpu=time(NULL);

	Pixel_out=horizontal_conv_cpu(Pixel_tmp, img_wd, img_ht, kernel1, k);

	time_t horizontal_convolution_cpu=time(NULL);

	cout<<" vertical_convolution time on cpu: "<<double(vertical_convolution_cpu - end1)<<"sec"<<endl;

	cout<<" horizontal _convolution time on cpu: "<<double(horizontal_convolution_cpu-vertical_convolution_cpu )<<"sec"<<endl;
	//writing this to PPM file

	ofs.open("output_cpu.ppm", ofstream::out);
	ofs<<"P6\n"<<img_wd<<" "<<img_ht<<"\n"<<max_val<<"\n";
	
	for(int j=0; j <img_ht*img_wd;j++)
	{
		ofs<<Pixel_out[j].r<<Pixel_out[j].g<<Pixel_out[j].b;	//write as ascii
	}
	
	ofs.close();
	time_t end=time(NULL);

	cout<<" Saving the result CPU:"<<double(end-horizontal_convolution_cpu)<<" sec"<<endl;

	//display time taken for different processes
	

	return 0;
}


	.text
	.file	"convd.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z7paddingP5pixeliiii           # -- Begin function _Z7paddingP5pixeliiii
	.type	_Z7paddingP5pixeliiii,@function
_Z7paddingP5pixeliiii:                  # @_Z7paddingP5pixeliiii
	.cfi_startproc
# %bb.0:
	xorl	%eax, %eax
	cmpl	%ecx, %esi
	jge	.LBB0_2
# %bb.1:
	movl	%edx, %r9d
	orl	%esi, %r9d
	js	.LBB0_2
# %bb.3:
	movl	$0, %r9d
	movl	$0, %r10d
	cmpl	%r8d, %edx
	jge	.LBB0_5
# %bb.4:
	imull	%edx, %ecx
	addl	%esi, %ecx
	movslq	%ecx, %rax
	leaq	(%rax,%rax,2), %rcx
	movb	(%rdi,%rcx), %al
	movb	1(%rdi,%rcx), %r9b
	movb	2(%rdi,%rcx), %r10b
	jmp	.LBB0_5
.LBB0_2:
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
.LBB0_5:
	movzbl	%r10b, %ecx
	shll	$16, %ecx
	movzbl	%r9b, %edx
	shll	$8, %edx
	orl	%ecx, %edx
	movzbl	%al, %eax
	orl	%edx, %eax
	retq
.Lfunc_end0:
	.size	_Z7paddingP5pixeliiii, .Lfunc_end0-_Z7paddingP5pixeliiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z28__device_stub__vertical_convP5pixelS0_iiPfi # -- Begin function _Z28__device_stub__vertical_convP5pixelS0_iiPfi
	.type	_Z28__device_stub__vertical_convP5pixelS0_iiPfi,@function
_Z28__device_stub__vertical_convP5pixelS0_iiPfi: # @_Z28__device_stub__vertical_convP5pixelS0_iiPfi
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	20(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	16(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	40(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z13vertical_convP5pixelS0_iiPfi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z28__device_stub__vertical_convP5pixelS0_iiPfi, .Lfunc_end1-_Z28__device_stub__vertical_convP5pixelS0_iiPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z30__device_stub__horizontal_convP5pixelS0_iiPfi # -- Begin function _Z30__device_stub__horizontal_convP5pixelS0_iiPfi
	.type	_Z30__device_stub__horizontal_convP5pixelS0_iiPfi,@function
_Z30__device_stub__horizontal_convP5pixelS0_iiPfi: # @_Z30__device_stub__horizontal_convP5pixelS0_iiPfi
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	20(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	16(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	40(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z15horizontal_convP5pixelS0_iiPfi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z30__device_stub__horizontal_convP5pixelS0_iiPfi, .Lfunc_end2-_Z30__device_stub__horizontal_convP5pixelS0_iiPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z17vertical_conv_cpuP5pixeliiPfi # -- Begin function _Z17vertical_conv_cpuP5pixeliiPfi
	.type	_Z17vertical_conv_cpuP5pixeliiPfi,@function
_Z17vertical_conv_cpuP5pixeliiPfi:      # @_Z17vertical_conv_cpuP5pixeliiPfi
	.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
                                        # kill: def $r8d killed $r8d def $r8
	movq	%r8, 24(%rsp)                   # 8-byte Spill
	movq	%rcx, %rbp
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, 64(%rsp)                  # 8-byte Spill
	movl	%edx, %ebx
	imull	%esi, %ebx
	movslq	%ebx, %r14
	leaq	(%r14,%r14,2), %rdi
	callq	malloc
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	testl	%r14d, %r14d
	jle	.LBB3_8
# %bb.1:                                # %.lr.ph59
	movl	%r12d, %ecx
	movq	24(%rsp), %rdx                  # 8-byte Reload
	leal	-1(%rdx), %eax
	shrl	$31, %eax
	addl	%edx, %eax
	decl	%eax
	sarl	%eax
	negl	%eax
	movl	%eax, 16(%rsp)                  # 4-byte Spill
	movl	%ebx, %r9d
	movl	%edx, %r14d
	xorl	%r8d, %r8d
	movq	%r9, 40(%rsp)                   # 8-byte Spill
	movq	%rbp, 56(%rsp)                  # 8-byte Spill
.LBB3_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_10 Depth 2
	movl	%r8d, %eax
	cltd
	idivl	%ecx
	testl	%ecx, %ecx
	js	.LBB3_7
# %bb.3:                                #   in Loop: Header=BB3_2 Depth=1
	movl	%eax, %r13d
	cmpl	%r15d, %eax
	jge	.LBB3_7
# %bb.4:                                # %.preheader
                                        #   in Loop: Header=BB3_2 Depth=1
	movq	%r8, 48(%rsp)                   # 8-byte Spill
	cmpl	$0, 24(%rsp)                    # 4-byte Folded Reload
	jle	.LBB3_5
# %bb.9:                                # %.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	%edx, %r12d
	addl	16(%rsp), %r13d                 # 4-byte Folded Reload
	xorps	%xmm3, %xmm3
	xorl	%ebp, %ebp
	xorps	%xmm0, %xmm0
	xorps	%xmm2, %xmm2
.LBB3_10:                               #   Parent Loop BB3_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	%xmm3, 20(%rsp)                 # 4-byte Spill
	movss	%xmm0, 8(%rsp)                  # 4-byte Spill
	movss	%xmm2, 12(%rsp)                 # 4-byte Spill
	leal	(%r13,%rbp), %edx
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movl	%r12d, %esi
	movl	%ecx, %ebx
	movl	%r15d, %r8d
	callq	_Z7paddingP5pixeliiii
	movss	20(%rsp), %xmm3                 # 4-byte Reload
                                        # xmm3 = mem[0],zero,zero,zero
	movl	$255, %r8d
	movl	%ebx, %ecx
	movl	%eax, %r9d
	andl	$16711680, %r9d                 # imm = 0xFF0000
	movl	%eax, %edx
	shrl	$16, %r9d
	andl	%r8d, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movq	56(%rsp), %rax                  # 8-byte Reload
	movss	(%rax,%rbp,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2ss	%r9d, %xmm2
	addss	%xmm0, %xmm3
	shrl	$8, %edx
	mulss	%xmm1, %xmm2
	movss	12(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	addss	%xmm2, %xmm0
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movss	12(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	andl	%r8d, %edx
	xorps	%xmm0, %xmm0
	cvtsi2ss	%edx, %xmm0
	mulss	%xmm1, %xmm0
	movss	8(%rsp), %xmm1                  # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm1
	movss	%xmm1, 8(%rsp)                  # 4-byte Spill
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	incq	%rbp
	cmpq	%rbp, %r14
	jne	.LBB3_10
	jmp	.LBB3_6
.LBB3_5:                                #   in Loop: Header=BB3_2 Depth=1
	xorps	%xmm2, %xmm2
	xorps	%xmm0, %xmm0
	xorps	%xmm3, %xmm3
.LBB3_6:                                # %._crit_edge
                                        #   in Loop: Header=BB3_2 Depth=1
	cvttss2si	%xmm3, %eax
	movq	48(%rsp), %r8                   # 8-byte Reload
	leaq	(%r8,%r8,2), %rdx
	movq	32(%rsp), %rsi                  # 8-byte Reload
	movb	%al, (%rsi,%rdx)
	cvttss2si	%xmm0, %eax
	movb	%al, 1(%rsi,%rdx)
	cvttss2si	%xmm2, %eax
	movb	%al, 2(%rsi,%rdx)
	movq	40(%rsp), %r9                   # 8-byte Reload
.LBB3_7:                                #   in Loop: Header=BB3_2 Depth=1
	incq	%r8
	cmpq	%r9, %r8
	jne	.LBB3_2
.LBB3_8:                                # %._crit_edge60
	movq	32(%rsp), %rax                  # 8-byte Reload
	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	_Z17vertical_conv_cpuP5pixeliiPfi, .Lfunc_end3-_Z17vertical_conv_cpuP5pixeliiPfi
	.cfi_endproc
                                        # -- End function
	.globl	_Z19horizontal_conv_cpuP5pixeliiPfi # -- Begin function _Z19horizontal_conv_cpuP5pixeliiPfi
	.type	_Z19horizontal_conv_cpuP5pixeliiPfi,@function
_Z19horizontal_conv_cpuP5pixeliiPfi:    # @_Z19horizontal_conv_cpuP5pixeliiPfi
	.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
                                        # kill: def $r8d killed $r8d def $r8
	movq	%r8, 24(%rsp)                   # 8-byte Spill
	movq	%rcx, %rbp
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, 64(%rsp)                  # 8-byte Spill
	movl	%edx, %ebx
	imull	%esi, %ebx
	movslq	%ebx, %r14
	leaq	(%r14,%r14,2), %rdi
	callq	malloc
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	testl	%r14d, %r14d
	jle	.LBB4_8
# %bb.1:                                # %.lr.ph59
	movl	%r12d, %ecx
	movq	24(%rsp), %rdx                  # 8-byte Reload
	leal	-1(%rdx), %eax
	shrl	$31, %eax
	addl	%edx, %eax
	decl	%eax
	sarl	%eax
	negl	%eax
	movl	%eax, 16(%rsp)                  # 4-byte Spill
	movl	%ebx, %esi
	movl	%edx, %r14d
	xorl	%r8d, %r8d
	movq	%rsi, 40(%rsp)                  # 8-byte Spill
	movq	%rbp, 56(%rsp)                  # 8-byte Spill
.LBB4_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_10 Depth 2
	movl	%r8d, %eax
	cltd
	idivl	%ecx
	testl	%ecx, %ecx
	js	.LBB4_7
# %bb.3:                                #   in Loop: Header=BB4_2 Depth=1
	cmpl	%r15d, %eax
	jge	.LBB4_7
# %bb.4:                                # %.preheader
                                        #   in Loop: Header=BB4_2 Depth=1
	movq	%r8, 48(%rsp)                   # 8-byte Spill
	cmpl	$0, 24(%rsp)                    # 4-byte Folded Reload
	jle	.LBB4_5
# %bb.9:                                # %.lr.ph
                                        #   in Loop: Header=BB4_2 Depth=1
	movl	%edx, %r13d
	addl	16(%rsp), %r13d                 # 4-byte Folded Reload
	xorps	%xmm3, %xmm3
	xorl	%ebp, %ebp
	xorps	%xmm2, %xmm2
	xorps	%xmm0, %xmm0
.LBB4_10:                               #   Parent Loop BB4_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	%xmm3, 20(%rsp)                 # 4-byte Spill
	movss	%xmm0, 8(%rsp)                  # 4-byte Spill
	movss	%xmm2, 12(%rsp)                 # 4-byte Spill
	leal	(%r13,%rbp), %esi
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movl	%eax, %edx
	movl	%ecx, %ebx
	movl	%r15d, %r8d
	movl	%eax, %r12d
	callq	_Z7paddingP5pixeliiii
	movss	20(%rsp), %xmm3                 # 4-byte Reload
                                        # xmm3 = mem[0],zero,zero,zero
	movl	$255, %r8d
	movl	%ebx, %ecx
	movl	%eax, %esi
	andl	$16711680, %esi                 # imm = 0xFF0000
	movl	%eax, %edx
	shrl	$16, %esi
	andl	%r8d, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movl	%r12d, %eax
	movq	56(%rsp), %r9                   # 8-byte Reload
	movss	(%r9,%rbp,4), %xmm1             # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	xorps	%xmm2, %xmm2
	cvtsi2ss	%esi, %xmm2
	addss	%xmm0, %xmm3
	shrl	$8, %edx
	mulss	%xmm1, %xmm2
	movss	12(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	addss	%xmm2, %xmm0
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movss	12(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	andl	%r8d, %edx
	xorps	%xmm0, %xmm0
	cvtsi2ss	%edx, %xmm0
	mulss	%xmm1, %xmm0
	movss	8(%rsp), %xmm1                  # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm1
	movss	%xmm1, 8(%rsp)                  # 4-byte Spill
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	incq	%rbp
	cmpq	%rbp, %r14
	jne	.LBB4_10
	jmp	.LBB4_6
.LBB4_5:                                #   in Loop: Header=BB4_2 Depth=1
	xorps	%xmm0, %xmm0
	xorps	%xmm2, %xmm2
	xorps	%xmm3, %xmm3
.LBB4_6:                                # %._crit_edge
                                        #   in Loop: Header=BB4_2 Depth=1
	cvttss2si	%xmm3, %eax
	movq	48(%rsp), %r8                   # 8-byte Reload
	leaq	(%r8,%r8,2), %rdx
	movq	32(%rsp), %rsi                  # 8-byte Reload
	movb	%al, (%rsi,%rdx)
	cvttss2si	%xmm0, %eax
	movb	%al, 1(%rsi,%rdx)
	cvttss2si	%xmm2, %eax
	movb	%al, 2(%rsi,%rdx)
	movq	40(%rsp), %rsi                  # 8-byte Reload
.LBB4_7:                                #   in Loop: Header=BB4_2 Depth=1
	incq	%r8
	cmpq	%rsi, %r8
	jne	.LBB4_2
.LBB4_8:                                # %._crit_edge60
	movq	32(%rsp), %rax                  # 8-byte Reload
	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_end4:
	.size	_Z19horizontal_conv_cpuP5pixeliiPfi, .Lfunc_end4-_Z19horizontal_conv_cpuP5pixeliiPfi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI5_0:
	.long	0x40c00000                      # float 6
.LCPI5_2:
	.long	0x3f800000                      # float 1
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI5_1:
	.quad	0x401921fb54442d18              # double 6.2831853071795862
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI5_3:
	.quad	0x8000000000000000              # double -0
	.quad	0x8000000000000000              # double -0
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$3880, %rsp                     # imm = 0xF28
	.cfi_def_cfa_offset 3936
	.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, %r13
	movl	%edi, %r14d
	leaq	188(%rsp), %rdi
	callq	hipGetDeviceCount
	movl	%eax, %edi
	movl	$149, %esi
	callq	_ZL11HandleError10hipError_tPKci
	xorl	%edi, %edi
	callq	time
	movl	$1, %ebp
	cmpl	$3, %r14d
	jne	.LBB5_167
# %bb.1:
	movq	%rax, %rbx
	movq	16(%r13), %rdi
	callq	atof
	cvtsd2ss	%xmm0, %xmm1
	movss	%xmm1, 16(%rsp)                 # 4-byte Spill
	movss	.LCPI5_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	callq	floorf@PLT
	cvttss2si	%xmm0, %r14d
	orl	$1, %r14d
	movslq	%r14d, %r15
	shlq	$2, %r15
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movq	%r15, 56(%rsp)                  # 8-byte Spill
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %r15
	xorps	%xmm1, %xmm1
	cvtss2sd	16(%rsp), %xmm1                 # 4-byte Folded Reload
	movsd	.LCPI5_1(%rip), %xmm0           # xmm0 = mem[0],zero
	mulsd	%xmm1, %xmm0
	mulsd	%xmm1, %xmm0
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jb	.LBB5_3
# %bb.2:
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB5_4
.LBB5_3:                                # %call.sqrt
	callq	sqrt
.LBB5_4:                                # %.split
	cvtsd2ss	%xmm0, %xmm0
	movl	%r14d, %eax
	shrl	$31, %eax
	addl	%r14d, %eax
	sarl	%eax
	movss	.LCPI5_2(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm1
	movslq	%eax, %rcx
	movq	88(%rsp), %rbp                  # 8-byte Reload
	movss	%xmm1, (%rbp,%rcx,4)
	movss	%xmm1, (%r15,%rcx,4)
	movq	%r14, 80(%rsp)                  # 8-byte Spill
	cmpl	$2, %r14d
	movq	%r15, %r12
	jl	.LBB5_7
# %bb.5:                                # %.lr.ph
	xorps	%xmm1, %xmm1
	cvtsi2sd	%eax, %xmm1
	movsd	%xmm1, 32(%rsp)                 # 8-byte Spill
	movss	16(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	movaps	%xmm2, %xmm1
	addss	%xmm2, %xmm1
	mulss	%xmm2, %xmm1
	cvtss2sd	%xmm1, %xmm1
	movsd	%xmm1, 16(%rsp)                 # 8-byte Spill
	cvtss2sd	%xmm0, %xmm0
	movsd	%xmm0, 48(%rsp)                 # 8-byte Spill
	movq	80(%rsp), %rax                  # 8-byte Reload
	leal	-1(%rax), %r14d
	xorps	%xmm0, %xmm0
	xorl	%r15d, %r15d
.LBB5_6:                                # =>This Inner Loop Header: Depth=1
	movsd	32(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	subsd	%xmm0, %xmm1
	movapd	%xmm1, %xmm0
	xorpd	.LCPI5_3(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	divsd	16(%rsp), %xmm0                 # 8-byte Folded Reload
	callq	exp
	divsd	48(%rsp), %xmm0                 # 8-byte Folded Reload
	xorps	%xmm1, %xmm1
	cvtsd2ss	%xmm0, %xmm1
	movss	%xmm1, (%rbp,%r15,4)
	movss	%xmm1, (%r12,%r15,4)
	movslq	%r14d, %r14
	movss	%xmm1, (%rbp,%r14,4)
	incq	%r15
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r15d, %xmm0
	movss	%xmm1, (%r12,%r14,4)
	decl	%r14d
	movsd	32(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	ja	.LBB5_6
.LBB5_7:                                # %._crit_edge
	movq	%r12, 136(%rsp)                 # 8-byte Spill
	xorl	%edi, %edi
	callq	time
	movq	%rax, %r15
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$24, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r15, %rax
	subq	%rbx, %rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leaq	736(%rsp), %rbx
	movq	%rbx, %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev
	movq	8(%r13), %rsi
.Ltmp0:
	movq	%rbx, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
.Ltmp1:
# %bb.8:
	leaq	120(%rsp), %r14
	movq	%r14, -16(%r14)
	movq	$0, -8(%r14)
	movb	$0, (%r14)
	movq	736(%rsp), %rax
	addq	-24(%rax), %rbx
.Ltmp3:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp4:
# %bb.9:                                # %.noexc
.Ltmp5:
	movsbl	%al, %edx
	leaq	736(%rsp), %rbx
	leaq	104(%rsp), %rsi
	movq	%rbx, %rdi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp6:
# %bb.10:                               # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit
.Ltmp8:
	leaq	2024(%rsp), %rdi
	leaq	104(%rsp), %rsi
	movl	$8, %edx
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode
.Ltmp9:
# %bb.11:
	leaq	208(%rsp), %rax
	movq	%rax, -16(%rax)
	movq	$0, -8(%rax)
	movb	$0, (%rax)
.Ltmp11:
	leaq	2024(%rsp), %rdi
	leaq	192(%rsp), %rsi
	callq	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
.Ltmp12:
# %bb.12:
	leaq	192(%rsp), %rdi
	movl	$.L.str.3, %esi
	callq	_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEPKc
	testl	%eax, %eax
	je	.LBB5_17
# %bb.13:
.Ltmp13:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$17, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp14:
# %bb.14:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp15:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp16:
# %bb.15:                               # %.noexc359
.Ltmp17:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp18:
# %bb.16:                               # %.noexc360
	movl	$1, %ebp
.Ltmp19:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp20:
	jmp	.LBB5_162
.LBB5_17:
	movq	736(%rsp), %rax
	addq	-24(%rax), %rbx
.Ltmp21:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp22:
# %bb.18:                               # %.noexc232
.Ltmp23:
	movsbl	%al, %edx
	leaq	736(%rsp), %rbx
	leaq	104(%rsp), %rsi
	movq	%rbx, %rdi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp24:
# %bb.19:                               # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit234
	movq	736(%rsp), %rax
	addq	-24(%rax), %rbx
.Ltmp25:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp26:
# %bb.20:                               # %.noexc235
.Ltmp27:
	movsbl	%al, %edx
	leaq	736(%rsp), %rbx
	leaq	104(%rsp), %rsi
	movq	%rbx, %rdi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp28:
# %bb.21:                               # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit237
.Ltmp30:
	leaq	1256(%rsp), %rdi
	leaq	104(%rsp), %rsi
	movl	$8, %edx
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode
.Ltmp31:
# %bb.22:
.Ltmp33:
	movq	%r15, 72(%rsp)                  # 8-byte Spill
	leaq	1256(%rsp), %rdi
	leaq	44(%rsp), %rsi
	callq	_ZNSirsERi
.Ltmp34:
# %bb.23:
	leaq	44(%rsp), %rsi
	movl	(%rsi), %ebp
.Ltmp35:
	leaq	1256(%rsp), %rdi
	callq	_ZNSirsERi
.Ltmp36:
# %bb.24:
	movl	44(%rsp), %r15d
	movl	%r15d, 28(%rsp)                 # 4-byte Spill
	movl	%ebp, 48(%rsp)                  # 4-byte Spill
	imull	%ebp, %r15d
	movslq	%r15d, %rax
	leaq	(%rax,%rax,2), %r14
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movq	%r14, 16(%rsp)                  # 8-byte Spill
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, %r13
	movq	736(%rsp), %rax
	addq	-24(%rax), %rbx
.Ltmp38:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp39:
# %bb.25:                               # %.noexc238
.Ltmp40:
	movsbl	%al, %edx
	leaq	736(%rsp), %rdi
	leaq	104(%rsp), %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp41:
# %bb.26:                               # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit240
.Ltmp43:
	leaq	1640(%rsp), %rdi
	leaq	104(%rsp), %rsi
	movl	$8, %edx
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode
.Ltmp44:
# %bb.27:
.Ltmp46:
	leaq	1640(%rsp), %rdi
	leaq	44(%rsp), %rsi
	callq	_ZNSirsERi
.Ltmp47:
# %bb.28:
	movl	44(%rsp), %eax
	movl	%eax, 68(%rsp)                  # 4-byte Spill
	xorl	%r12d, %r12d
	leaq	104(%rsp), %rbp
	xorl	%ebx, %ebx
.LBB5_29:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_34 Depth 2
	movq	736(%rsp), %rax
	movq	-24(%rax), %rdi
	leaq	736(%rsp), %r14
	addq	%r14, %rdi
.Ltmp49:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp50:
# %bb.30:                               # %.noexc241
                                        #   in Loop: Header=BB5_29 Depth=1
.Ltmp51:
	movsbl	%al, %edx
	movq	%r14, %rdi
	movq	%rbp, %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp52:
# %bb.31:                               #   in Loop: Header=BB5_29 Depth=1
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB5_43
# %bb.32:                               #   in Loop: Header=BB5_29 Depth=1
.Ltmp262:
	leaq	2408(%rsp), %rdi
	movq	%rbp, %rsi
	movl	$8, %edx
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode
.Ltmp263:
# %bb.33:                               # %.preheader
                                        #   in Loop: Header=BB5_29 Depth=1
	movq	104(%rsp), %rax
	movq	112(%rsp), %rcx
	incq	%rcx
	xorl	%edx, %edx
.LBB5_34:                               #   Parent Loop BB5_29 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpl	%r15d, %ebx
	jae	.LBB5_41
# %bb.35:                               #   in Loop: Header=BB5_34 Depth=2
	movslq	%ebx, %rdi
	movb	(%rax,%rdx), %sil
	movslq	%r12d, %r8
	imulq	$1431655766, %r8, %r9           # imm = 0x55555556
	movq	%r9, %r10
	shrq	$63, %r10
	shrq	$32, %r9
	addl	%r10d, %r9d
	leal	(%r9,%r9,2), %r9d
	subl	%r9d, %r8d
	leaq	(%rdi,%rdi,2), %rdi
	cmpl	$1, %r8d
	je	.LBB5_38
# %bb.36:                               #   in Loop: Header=BB5_34 Depth=2
	testl	%r8d, %r8d
	jne	.LBB5_39
# %bb.37:                               #   in Loop: Header=BB5_34 Depth=2
	movb	%sil, (%r13,%rdi)
	jmp	.LBB5_40
.LBB5_38:                               #   in Loop: Header=BB5_34 Depth=2
	movb	%sil, 1(%r13,%rdi)
	jmp	.LBB5_40
.LBB5_39:                               #   in Loop: Header=BB5_34 Depth=2
	movb	%sil, 2(%r13,%rdi)
	incl	%ebx
.LBB5_40:                               #   in Loop: Header=BB5_34 Depth=2
	incl	%r12d
.LBB5_41:                               #   in Loop: Header=BB5_34 Depth=2
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	.LBB5_34
# %bb.42:                               #   in Loop: Header=BB5_29 Depth=1
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	leaq	2408(%rsp), %rdi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	2528(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	jmp	.LBB5_29
.LBB5_43:
	xorl	%edi, %edi
	callq	time
	movq	%rax, %rbx
.Ltmp54:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$19, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp55:
# %bb.44:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit245
	subq	72(%rsp), %rbx                  # 8-byte Folded Reload
	cvtsi2sd	%rbx, %xmm0
.Ltmp56:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp57:
# %bb.45:                               # %_ZNSolsEd.exit
.Ltmp58:
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp59:
# %bb.46:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit248
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp60:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp61:
# %bb.47:                               # %.noexc362
.Ltmp62:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp63:
# %bb.48:                               # %.noexc363
.Ltmp64:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp65:
# %bb.49:                               # %_ZNSolsEPFRSoS_E.exit250
.Ltmp67:
	leaq	2408(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipGetDevicePropertiesR0600
.Ltmp68:
# %bb.50:
.Ltmp69:
	movl	%eax, %edi
	movl	$273, %esi                      # imm = 0x111
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp70:
# %bb.51:
	xorps	%xmm0, %xmm0
	cvtsi2sdl	2728(%rsp), %xmm0
	xorps	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jb	.LBB5_53
# %bb.52:
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB5_54
.LBB5_53:                               # %call.sqrt438
	callq	sqrt
.LBB5_54:                               # %.split437
	xorps	%xmm1, %xmm1
	cvtsd2ss	%xmm0, %xmm1
	movss	%xmm1, 72(%rsp)                 # 4-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2ssl	48(%rsp), %xmm0         # 4-byte Folded Reload
	divss	%xmm1, %xmm0
	callq	ceilf@PLT
	movss	%xmm0, 100(%rsp)                # 4-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2ssl	28(%rsp), %xmm0         # 4-byte Folded Reload
	divss	72(%rsp), %xmm0                 # 4-byte Folded Reload
	callq	ceilf@PLT
	movss	%xmm0, 96(%rsp)                 # 4-byte Spill
.Ltmp72:
	leaq	160(%rsp), %rdi
	movq	16(%rsp), %rsi                  # 8-byte Reload
	callq	hipMalloc
.Ltmp73:
# %bb.55:                               # %_ZL9hipMallocI5pixelE10hipError_tPPT_m.exit
.Ltmp74:
	movl	%eax, %edi
	movl	$286, %esi                      # imm = 0x11E
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp75:
# %bb.56:
.Ltmp76:
	leaq	176(%rsp), %rdi
	movq	16(%rsp), %rsi                  # 8-byte Reload
	callq	hipMalloc
.Ltmp77:
# %bb.57:                               # %_ZL9hipMallocI5pixelE10hipError_tPPT_m.exit253
.Ltmp78:
	movl	%eax, %edi
	movl	$288, %esi                      # imm = 0x120
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp79:
# %bb.58:
.Ltmp80:
	leaq	168(%rsp), %rdi
	movq	16(%rsp), %rsi                  # 8-byte Reload
	callq	hipMalloc
.Ltmp81:
# %bb.59:                               # %_ZL9hipMallocI5pixelE10hipError_tPPT_m.exit255
.Ltmp82:
	movl	%eax, %edi
	movl	$290, %esi                      # imm = 0x122
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp83:
# %bb.60:
.Ltmp85:
	leaq	152(%rsp), %rdi
	movq	56(%rsp), %rsi                  # 8-byte Reload
	callq	hipMalloc
.Ltmp86:
# %bb.61:                               # %_ZL9hipMallocIfE10hipError_tPPT_m.exit
.Ltmp87:
	movl	%eax, %edi
	movl	$294, %esi                      # imm = 0x126
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp88:
# %bb.62:
.Ltmp89:
	leaq	144(%rsp), %rdi
	movq	56(%rsp), %rsi                  # 8-byte Reload
	callq	hipMalloc
.Ltmp90:
# %bb.63:                               # %_ZL9hipMallocIfE10hipError_tPPT_m.exit258
.Ltmp91:
	movl	%eax, %edi
	movl	$296, %esi                      # imm = 0x128
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp92:
# %bb.64:
	movq	168(%rsp), %rdi
.Ltmp93:
	movq	%r13, %rsi
	movq	16(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp94:
# %bb.65:
.Ltmp95:
	movl	%eax, %edi
	movl	$302, %esi                      # imm = 0x12E
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp96:
# %bb.66:
	movq	152(%rsp), %rdi
.Ltmp97:
	movq	88(%rsp), %rsi                  # 8-byte Reload
	movq	56(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp98:
# %bb.67:
.Ltmp99:
	movl	%eax, %edi
	movl	$304, %esi                      # imm = 0x130
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp100:
# %bb.68:
	movq	144(%rsp), %rdi
.Ltmp101:
	movq	136(%rsp), %rsi                 # 8-byte Reload
	movq	56(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp102:
# %bb.69:
.Ltmp103:
	movl	%eax, %edi
	movl	$306, %esi                      # imm = 0x132
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp104:
# %bb.70:
	cvttss2si	100(%rsp), %rax         # 4-byte Folded Reload
	cvttss2si	96(%rsp), %r12          # 4-byte Folded Reload
	movl	%eax, %eax
	shlq	$32, %r12
	cvttss2si	72(%rsp), %r14          # 4-byte Folded Reload
	orq	%rax, %r12
	movl	%r14d, %eax
	shlq	$32, %r14
	orq	%rax, %r14
	xorl	%edi, %edi
	callq	time
	movq	%rax, %rbp
.Ltmp106:
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp107:
# %bb.71:
	testl	%eax, %eax
	jne	.LBB5_73
# %bb.72:
	movq	168(%rsp), %rdi
	movq	176(%rsp), %rsi
	movq	152(%rsp), %r8
.Ltmp108:
	movl	48(%rsp), %edx                  # 4-byte Reload
	movl	28(%rsp), %ecx                  # 4-byte Reload
	movq	80(%rsp), %r9                   # 8-byte Reload
                                        # kill: def $r9d killed $r9d killed $r9
	callq	_Z28__device_stub__vertical_convP5pixelS0_iiPfi
.Ltmp109:
.LBB5_73:
	xorl	%edi, %edi
	callq	time
	movq	%rax, %rbx
.Ltmp111:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$35, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp112:
# %bb.74:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit260
	movq	%rbx, %rax
	subq	%rbp, %rax
	cvtsi2sd	%rax, %xmm0
.Ltmp113:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp114:
# %bb.75:                               # %_ZNSolsEd.exit262
.Ltmp115:
	movq	%rax, %rbp
	movl	$.L.str.7, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp116:
# %bb.76:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit264
	movq	(%rbp), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
.Ltmp117:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp118:
# %bb.77:                               # %.noexc366
.Ltmp119:
	movsbl	%al, %esi
	movq	%rbp, %rdi
	callq	_ZNSo3putEc
.Ltmp120:
# %bb.78:                               # %.noexc367
.Ltmp121:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp122:
# %bb.79:                               # %_ZNSolsEPFRSoS_E.exit266
.Ltmp123:
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp124:
# %bb.80:
	testl	%eax, %eax
	jne	.LBB5_82
# %bb.81:
	movq	176(%rsp), %rdi
	movq	160(%rsp), %rsi
	movq	144(%rsp), %r8
.Ltmp125:
	movl	48(%rsp), %edx                  # 4-byte Reload
	movl	28(%rsp), %ecx                  # 4-byte Reload
	movq	80(%rsp), %r9                   # 8-byte Reload
                                        # kill: def $r9d killed $r9d killed $r9
	callq	_Z30__device_stub__horizontal_convP5pixelS0_iiPfi
.Ltmp126:
.LBB5_82:
	xorl	%edi, %edi
	callq	time
	movq	%rax, %r14
	movq	160(%rsp), %rsi
.Ltmp128:
	movq	32(%rsp), %rdi                  # 8-byte Reload
	movq	16(%rsp), %rdx                  # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp129:
# %bb.83:
.Ltmp130:
	movl	%eax, %edi
	movl	$320, %esi                      # imm = 0x140
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp131:
# %bb.84:
.Ltmp132:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$36, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp133:
# %bb.85:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit268
	movq	%r14, %rax
	subq	%rbx, %rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
.Ltmp134:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp135:
# %bb.86:                               # %_ZNSolsEd.exit270
.Ltmp136:
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp137:
# %bb.87:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit272
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp138:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp139:
# %bb.88:                               # %.noexc370
.Ltmp140:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp141:
# %bb.89:                               # %.noexc371
.Ltmp142:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp143:
# %bb.90:                               # %_ZNSolsEPFRSoS_E.exit274
.Ltmp145:
	leaq	224(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev
.Ltmp146:
# %bb.91:
.Ltmp148:
	movq	%r14, 56(%rsp)                  # 8-byte Spill
	leaq	224(%rsp), %rdi
	movl	$.L.str.9, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
.Ltmp149:
# %bb.92:
.Ltmp150:
	leaq	224(%rsp), %rdi
	movl	$.L.str.10, %esi
	movl	$3, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp151:
# %bb.93:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit276
.Ltmp152:
	leaq	224(%rsp), %rdi
	movl	48(%rsp), %esi                  # 4-byte Reload
	callq	_ZNSolsEi
.Ltmp153:
# %bb.94:
.Ltmp154:
	movq	%rax, %rbx
	movl	$.L.str.11, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp155:
# %bb.95:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit278
.Ltmp156:
	movq	%rbx, %rdi
	movl	28(%rsp), %esi                  # 4-byte Reload
	callq	_ZNSolsEi
.Ltmp157:
# %bb.96:
.Ltmp158:
	movq	%rax, %rbx
	movl	$.L.str.12, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp159:
# %bb.97:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit280
.Ltmp160:
	movq	%rbx, %rdi
	movl	68(%rsp), %esi                  # 4-byte Reload
	callq	_ZNSolsEi
.Ltmp161:
# %bb.98:
.Ltmp162:
	movl	$.L.str.12, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp163:
# %bb.99:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit282.preheader
	movl	%r15d, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	testl	%r15d, %r15d
	je	.LBB5_113
# %bb.100:                              # %.lr.ph401.preheader
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(%rax,%rax,2), %rbp
	xorl	%r12d, %r12d
	leaq	15(%rsp), %rbx
.LBB5_101:                              # %.lr.ph401
                                        # =>This Inner Loop Header: Depth=1
	movq	32(%rsp), %rax                  # 8-byte Reload
	movb	(%rax,%r12), %al
	movb	%al, 15(%rsp)
	movq	224(%rsp), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 240(%rsp,%rcx)
	je	.LBB5_104
# %bb.102:                              #   in Loop: Header=BB5_101 Depth=1
.Ltmp164:
	movl	$1, %edx
	leaq	224(%rsp), %rdi
	movq	%rbx, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp165:
# %bb.103:                              #   in Loop: Header=BB5_101 Depth=1
	movq	%rax, %r14
	jmp	.LBB5_105
.LBB5_104:                              #   in Loop: Header=BB5_101 Depth=1
.Ltmp166:
	movsbl	%al, %esi
	leaq	224(%rsp), %r14
	movq	%r14, %rdi
	callq	_ZNSo3putEc
.Ltmp167:
.LBB5_105:                              #   in Loop: Header=BB5_101 Depth=1
	movq	32(%rsp), %rax                  # 8-byte Reload
	movb	1(%rax,%r12), %al
	movb	%al, 15(%rsp)
	movq	(%r14), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%r14,%rcx)
	je	.LBB5_108
# %bb.106:                              #   in Loop: Header=BB5_101 Depth=1
.Ltmp168:
	movl	$1, %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp169:
# %bb.107:                              #   in Loop: Header=BB5_101 Depth=1
	movq	%rax, %r14
	jmp	.LBB5_109
.LBB5_108:                              #   in Loop: Header=BB5_101 Depth=1
.Ltmp170:
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
.Ltmp171:
.LBB5_109:                              #   in Loop: Header=BB5_101 Depth=1
	movq	32(%rsp), %rax                  # 8-byte Reload
	movb	2(%rax,%r12), %al
	movb	%al, 15(%rsp)
	movq	(%r14), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%r14,%rcx)
	je	.LBB5_111
# %bb.110:                              #   in Loop: Header=BB5_101 Depth=1
.Ltmp172:
	movl	$1, %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp173:
	jmp	.LBB5_112
.LBB5_111:                              #   in Loop: Header=BB5_101 Depth=1
.Ltmp174:
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
.Ltmp175:
.LBB5_112:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit282
                                        #   in Loop: Header=BB5_101 Depth=1
	addq	$3, %r12
	cmpq	%r12, %rbp
	jne	.LBB5_101
.LBB5_113:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit282._crit_edge
.Ltmp177:
	leaq	224(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp178:
# %bb.114:
	xorl	%edi, %edi
	callq	time
	movq	%rax, %r14
.Ltmp180:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.13, %esi
	movl	$18, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp181:
	movq	56(%rsp), %rcx                  # 8-byte Reload
# %bb.115:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit296
	movq	%r14, %rax
	subq	%rcx, %rax
	cvtsi2sd	%rax, %xmm0
.Ltmp182:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp183:
# %bb.116:                              # %_ZNSolsEd.exit298
.Ltmp184:
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp185:
# %bb.117:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit300
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp186:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp187:
# %bb.118:                              # %.noexc374
.Ltmp188:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp189:
# %bb.119:                              # %.noexc375
.Ltmp190:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp191:
# %bb.120:                              # %_ZNSolsEPFRSoS_E.exit302
	movq	%r14, 32(%rsp)                  # 8-byte Spill
	movq	%r13, %rdi
	movl	48(%rsp), %r12d                 # 4-byte Reload
	movl	%r12d, %esi
	movl	28(%rsp), %ebp                  # 4-byte Reload
	movl	%ebp, %edx
	movq	88(%rsp), %rcx                  # 8-byte Reload
	movq	80(%rsp), %r14                  # 8-byte Reload
	movl	%r14d, %r8d
	callq	_Z17vertical_conv_cpuP5pixeliiPfi
	movq	%rax, %rbx
	xorl	%edi, %edi
	callq	time
	movq	%rax, %r13
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	%ebp, %edx
	movq	136(%rsp), %rcx                 # 8-byte Reload
	movl	%r14d, %r8d
	callq	_Z19horizontal_conv_cpuP5pixeliiPfi
	movq	%rax, %r14
	xorl	%edi, %edi
	callq	time
	movq	%rax, %rbx
.Ltmp193:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.14, %esi
	movl	$35, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp194:
# %bb.121:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit304
	movq	%r13, %rax
	subq	32(%rsp), %rax                  # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
.Ltmp195:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp196:
# %bb.122:                              # %_ZNSolsEd.exit306
.Ltmp197:
	movq	%rax, %r12
	movl	$.L.str.7, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp198:
# %bb.123:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit308
	movq	(%r12), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp199:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp200:
# %bb.124:                              # %.noexc378
.Ltmp201:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp202:
# %bb.125:                              # %.noexc379
.Ltmp203:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp204:
# %bb.126:                              # %_ZNSolsEPFRSoS_E.exit310
.Ltmp205:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.15, %esi
	movl	$38, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp206:
# %bb.127:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit312
	movq	%rbx, %rax
	subq	%r13, %rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
.Ltmp207:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp208:
# %bb.128:                              # %_ZNSolsEd.exit314
.Ltmp209:
	movq	%rax, %r12
	movl	$.L.str.7, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp210:
# %bb.129:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit316
	movq	(%r12), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp211:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp212:
# %bb.130:                              # %.noexc382
.Ltmp213:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp214:
# %bb.131:                              # %.noexc383
.Ltmp215:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp216:
# %bb.132:                              # %_ZNSolsEPFRSoS_E.exit318
.Ltmp217:
	leaq	224(%rsp), %rdi
	movl	$.L.str.16, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
.Ltmp218:
# %bb.133:
.Ltmp219:
	leaq	224(%rsp), %rdi
	movl	$.L.str.10, %esi
	movl	$3, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp220:
# %bb.134:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit320
.Ltmp221:
	leaq	224(%rsp), %rbp
	movq	%rbp, %rdi
	movl	48(%rsp), %esi                  # 4-byte Reload
	callq	_ZNSolsEi
.Ltmp222:
# %bb.135:
.Ltmp223:
	movq	%rax, %r12
	movl	$.L.str.11, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp224:
# %bb.136:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit322
.Ltmp225:
	movq	%r12, %rdi
	movl	28(%rsp), %esi                  # 4-byte Reload
	callq	_ZNSolsEi
.Ltmp226:
# %bb.137:
.Ltmp227:
	movq	%rax, %r12
	movl	$.L.str.12, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp228:
# %bb.138:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit324
.Ltmp229:
	movq	%r12, %rdi
	movl	68(%rsp), %esi                  # 4-byte Reload
	callq	_ZNSolsEi
.Ltmp230:
# %bb.139:
.Ltmp231:
	movl	$.L.str.12, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp232:
# %bb.140:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit326.preheader
	movq	%rbx, 32(%rsp)                  # 8-byte Spill
	testl	%r15d, %r15d
	jle	.LBB5_154
# %bb.141:                              # %.lr.ph405.preheader
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(%rax,%rax,2), %r15
	xorl	%ebx, %ebx
	leaq	15(%rsp), %r12
.LBB5_142:                              # %.lr.ph405
                                        # =>This Inner Loop Header: Depth=1
	movb	(%r14,%rbx), %al
	movb	%al, 15(%rsp)
	movq	224(%rsp), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 240(%rsp,%rcx)
	je	.LBB5_145
# %bb.143:                              #   in Loop: Header=BB5_142 Depth=1
.Ltmp233:
	movl	$1, %edx
	movq	%rbp, %rdi
	movq	%r12, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp234:
# %bb.144:                              #   in Loop: Header=BB5_142 Depth=1
	movq	%rax, %r13
	jmp	.LBB5_146
.LBB5_145:                              #   in Loop: Header=BB5_142 Depth=1
.Ltmp235:
	movsbl	%al, %esi
	movq	%rbp, %rdi
	callq	_ZNSo3putEc
.Ltmp236:
	movq	%rbp, %r13
.LBB5_146:                              #   in Loop: Header=BB5_142 Depth=1
	movb	1(%r14,%rbx), %al
	movb	%al, 15(%rsp)
	movq	(%r13), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%r13,%rcx)
	je	.LBB5_149
# %bb.147:                              #   in Loop: Header=BB5_142 Depth=1
.Ltmp237:
	movl	$1, %edx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp238:
# %bb.148:                              #   in Loop: Header=BB5_142 Depth=1
	movq	%rax, %r13
	jmp	.LBB5_150
.LBB5_149:                              #   in Loop: Header=BB5_142 Depth=1
.Ltmp239:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp240:
.LBB5_150:                              #   in Loop: Header=BB5_142 Depth=1
	movb	2(%r14,%rbx), %al
	movb	%al, 15(%rsp)
	movq	(%r13), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%r13,%rcx)
	je	.LBB5_152
# %bb.151:                              #   in Loop: Header=BB5_142 Depth=1
.Ltmp241:
	movl	$1, %edx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp242:
	jmp	.LBB5_153
.LBB5_152:                              #   in Loop: Header=BB5_142 Depth=1
.Ltmp243:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp244:
.LBB5_153:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit326
                                        #   in Loop: Header=BB5_142 Depth=1
	addq	$3, %rbx
	cmpq	%rbx, %r15
	jne	.LBB5_142
.LBB5_154:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit326._crit_edge
.Ltmp246:
	leaq	224(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp247:
	movq	32(%rsp), %rbx                  # 8-byte Reload
# %bb.155:
	xorl	%edi, %edi
	callq	time
	movq	%rax, %r14
.Ltmp249:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.17, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp250:
# %bb.156:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit343
	subq	%rbx, %r14
	cvtsi2sd	%r14, %xmm0
.Ltmp251:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp252:
# %bb.157:                              # %_ZNSolsEd.exit345
.Ltmp253:
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp254:
# %bb.158:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit347
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp255:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp256:
# %bb.159:                              # %.noexc386
.Ltmp257:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp258:
# %bb.160:                              # %.noexc387
.Ltmp259:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp260:
# %bb.161:                              # %_ZNSolsEPFRSoS_E.exit349
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	232(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 224(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	472(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	leaq	1640(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	1760(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	leaq	1256(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	1376(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	xorl	%ebp, %ebp
	leaq	120(%rsp), %r14
.LBB5_162:                              # %_ZNSolsEPFRSoS_E.exit
	movq	192(%rsp), %rdi
	leaq	208(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB5_164
# %bb.163:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB5_164:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	leaq	2024(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	2144(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	movq	104(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB5_166
# %bb.165:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i350
	callq	_ZdlPv
.LBB5_166:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit352
	leaq	736(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
.LBB5_167:
	movl	%ebp, %eax
	addq	$3880, %rsp                     # imm = 0xF28
	.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
.LBB5_168:
	.cfi_def_cfa_offset 3936
.Ltmp147:
	jmp	.LBB5_197
.LBB5_169:
.Ltmp48:
	jmp	.LBB5_197
.LBB5_170:
.Ltmp45:
	jmp	.LBB5_176
.LBB5_171:
.Ltmp32:
	jmp	.LBB5_190
.LBB5_172:
.Ltmp110:
	jmp	.LBB5_197
.LBB5_173:
.Ltmp71:
	jmp	.LBB5_197
.LBB5_174:
.Ltmp42:
	jmp	.LBB5_176
.LBB5_175:
.Ltmp37:
.LBB5_176:
	movq	%rax, %rbx
	jmp	.LBB5_199
.LBB5_177:
.Ltmp10:
	jmp	.LBB5_180
.LBB5_178:
.Ltmp2:
	movq	%rax, %rbx
	jmp	.LBB5_205
.LBB5_179:
.Ltmp7:
.LBB5_180:
	movq	%rax, %rbx
	jmp	.LBB5_203
.LBB5_181:
.Ltmp261:
	jmp	.LBB5_195
.LBB5_182:
.Ltmp192:
	jmp	.LBB5_195
.LBB5_183:
.Ltmp84:
	jmp	.LBB5_197
.LBB5_184:
.Ltmp66:
	jmp	.LBB5_197
.LBB5_185:
.Ltmp127:
	jmp	.LBB5_197
.LBB5_186:
.Ltmp144:
	jmp	.LBB5_197
.LBB5_187:
.Ltmp179:
	jmp	.LBB5_195
.LBB5_188:
.Ltmp105:
	jmp	.LBB5_197
.LBB5_189:
.Ltmp29:
.LBB5_190:
	movq	%rax, %rbx
	jmp	.LBB5_200
.LBB5_191:
.Ltmp248:
	jmp	.LBB5_195
.LBB5_192:
.Ltmp264:
	jmp	.LBB5_197
.LBB5_193:
.Ltmp245:
	jmp	.LBB5_195
.LBB5_194:
.Ltmp176:
.LBB5_195:
	movq	%rax, %rbx
	leaq	224(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	jmp	.LBB5_198
.LBB5_196:
.Ltmp53:
.LBB5_197:
	movq	%rax, %rbx
.LBB5_198:
	leaq	1640(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	1760(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
.LBB5_199:
	leaq	1256(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	1376(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
.LBB5_200:
	movq	192(%rsp), %rdi
	leaq	208(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB5_202
# %bb.201:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i353
	callq	_ZdlPv
.LBB5_202:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit355
	leaq	2024(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	2144(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
.LBB5_203:
	movq	104(%rsp), %rdi
	leaq	120(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB5_205
# %bb.204:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i356
	callq	_ZdlPv
.LBB5_205:
	leaq	736(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end5:
	.size	main, .Lfunc_end5-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table5:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp6-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp6
	.uleb128 .Ltmp7-.Lfunc_begin0           #     jumps to .Ltmp7
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp9-.Ltmp8                  #   Call between .Ltmp8 and .Ltmp9
	.uleb128 .Ltmp10-.Lfunc_begin0          #     jumps to .Ltmp10
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp11-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp28-.Ltmp11                #   Call between .Ltmp11 and .Ltmp28
	.uleb128 .Ltmp29-.Lfunc_begin0          #     jumps to .Ltmp29
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp30-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp31-.Ltmp30                #   Call between .Ltmp30 and .Ltmp31
	.uleb128 .Ltmp32-.Lfunc_begin0          #     jumps to .Ltmp32
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp33-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp36-.Ltmp33                #   Call between .Ltmp33 and .Ltmp36
	.uleb128 .Ltmp37-.Lfunc_begin0          #     jumps to .Ltmp37
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp38-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp41-.Ltmp38                #   Call between .Ltmp38 and .Ltmp41
	.uleb128 .Ltmp42-.Lfunc_begin0          #     jumps to .Ltmp42
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp43-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp44-.Ltmp43                #   Call between .Ltmp43 and .Ltmp44
	.uleb128 .Ltmp45-.Lfunc_begin0          #     jumps to .Ltmp45
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp46-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp47-.Ltmp46                #   Call between .Ltmp46 and .Ltmp47
	.uleb128 .Ltmp48-.Lfunc_begin0          #     jumps to .Ltmp48
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp49-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp52-.Ltmp49                #   Call between .Ltmp49 and .Ltmp52
	.uleb128 .Ltmp53-.Lfunc_begin0          #     jumps to .Ltmp53
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp262-.Lfunc_begin0         # >> Call Site 12 <<
	.uleb128 .Ltmp263-.Ltmp262              #   Call between .Ltmp262 and .Ltmp263
	.uleb128 .Ltmp264-.Lfunc_begin0         #     jumps to .Ltmp264
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp54-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Ltmp65-.Ltmp54                #   Call between .Ltmp54 and .Ltmp65
	.uleb128 .Ltmp66-.Lfunc_begin0          #     jumps to .Ltmp66
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp67-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp70-.Ltmp67                #   Call between .Ltmp67 and .Ltmp70
	.uleb128 .Ltmp71-.Lfunc_begin0          #     jumps to .Ltmp71
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp70-.Lfunc_begin0          # >> Call Site 15 <<
	.uleb128 .Ltmp72-.Ltmp70                #   Call between .Ltmp70 and .Ltmp72
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp72-.Lfunc_begin0          # >> Call Site 16 <<
	.uleb128 .Ltmp83-.Ltmp72                #   Call between .Ltmp72 and .Ltmp83
	.uleb128 .Ltmp84-.Lfunc_begin0          #     jumps to .Ltmp84
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp85-.Lfunc_begin0          # >> Call Site 17 <<
	.uleb128 .Ltmp104-.Ltmp85               #   Call between .Ltmp85 and .Ltmp104
	.uleb128 .Ltmp105-.Lfunc_begin0         #     jumps to .Ltmp105
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp106-.Lfunc_begin0         # >> Call Site 18 <<
	.uleb128 .Ltmp109-.Ltmp106              #   Call between .Ltmp106 and .Ltmp109
	.uleb128 .Ltmp110-.Lfunc_begin0         #     jumps to .Ltmp110
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp111-.Lfunc_begin0         # >> Call Site 19 <<
	.uleb128 .Ltmp126-.Ltmp111              #   Call between .Ltmp111 and .Ltmp126
	.uleb128 .Ltmp127-.Lfunc_begin0         #     jumps to .Ltmp127
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp128-.Lfunc_begin0         # >> Call Site 20 <<
	.uleb128 .Ltmp143-.Ltmp128              #   Call between .Ltmp128 and .Ltmp143
	.uleb128 .Ltmp144-.Lfunc_begin0         #     jumps to .Ltmp144
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp145-.Lfunc_begin0         # >> Call Site 21 <<
	.uleb128 .Ltmp146-.Ltmp145              #   Call between .Ltmp145 and .Ltmp146
	.uleb128 .Ltmp147-.Lfunc_begin0         #     jumps to .Ltmp147
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp148-.Lfunc_begin0         # >> Call Site 22 <<
	.uleb128 .Ltmp163-.Ltmp148              #   Call between .Ltmp148 and .Ltmp163
	.uleb128 .Ltmp179-.Lfunc_begin0         #     jumps to .Ltmp179
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp164-.Lfunc_begin0         # >> Call Site 23 <<
	.uleb128 .Ltmp175-.Ltmp164              #   Call between .Ltmp164 and .Ltmp175
	.uleb128 .Ltmp176-.Lfunc_begin0         #     jumps to .Ltmp176
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp177-.Lfunc_begin0         # >> Call Site 24 <<
	.uleb128 .Ltmp178-.Ltmp177              #   Call between .Ltmp177 and .Ltmp178
	.uleb128 .Ltmp179-.Lfunc_begin0         #     jumps to .Ltmp179
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp180-.Lfunc_begin0         # >> Call Site 25 <<
	.uleb128 .Ltmp191-.Ltmp180              #   Call between .Ltmp180 and .Ltmp191
	.uleb128 .Ltmp192-.Lfunc_begin0         #     jumps to .Ltmp192
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp193-.Lfunc_begin0         # >> Call Site 26 <<
	.uleb128 .Ltmp232-.Ltmp193              #   Call between .Ltmp193 and .Ltmp232
	.uleb128 .Ltmp248-.Lfunc_begin0         #     jumps to .Ltmp248
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp233-.Lfunc_begin0         # >> Call Site 27 <<
	.uleb128 .Ltmp244-.Ltmp233              #   Call between .Ltmp233 and .Ltmp244
	.uleb128 .Ltmp245-.Lfunc_begin0         #     jumps to .Ltmp245
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp246-.Lfunc_begin0         # >> Call Site 28 <<
	.uleb128 .Ltmp247-.Ltmp246              #   Call between .Ltmp246 and .Ltmp247
	.uleb128 .Ltmp248-.Lfunc_begin0         #     jumps to .Ltmp248
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp249-.Lfunc_begin0         # >> Call Site 29 <<
	.uleb128 .Ltmp260-.Ltmp249              #   Call between .Ltmp249 and .Ltmp260
	.uleb128 .Ltmp261-.Lfunc_begin0         #     jumps to .Ltmp261
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp260-.Lfunc_begin0         # >> Call Site 30 <<
	.uleb128 .Lfunc_end5-.Ltmp260           #   Call between .Ltmp260 and .Lfunc_end5
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.type	_ZL11HandleError10hipError_tPKci,@function # -- Begin function _ZL11HandleError10hipError_tPKci
_ZL11HandleError10hipError_tPKci:       # @_ZL11HandleError10hipError_tPKci
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	je	.LBB6_5
# %bb.1:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	%esi, %ebx
	callq	hipGetErrorString
	testq	%rax, %rax
	je	.LBB6_2
# %bb.3:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB6_4
.LBB6_5:
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	retq
.LBB6_2:
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	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
.LBB6_4:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movl	$_ZSt4cout, %edi
	movl	$.L.str.18, %esi
	movl	$4, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$110, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$.L.str.19, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebx, %esi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZNSo5flushEv                   # TAILCALL
.Lfunc_end6:
	.size	_ZL11HandleError10hipError_tPKci, .Lfunc_end6-_ZL11HandleError10hipError_tPKci
	.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	.LBB7_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB7_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z13vertical_convP5pixelS0_iiPfi, %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	$_Z15horizontal_convP5pixelS0_iiPfi, %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_end7:
	.size	__hip_module_ctor, .Lfunc_end7-__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	.LBB8_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
.LBB8_2:
	retq
.Lfunc_end8:
	.size	__hip_module_dtor, .Lfunc_end8-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z13vertical_convP5pixelS0_iiPfi,@object # @_Z13vertical_convP5pixelS0_iiPfi
	.section	.rodata,"a",@progbits
	.globl	_Z13vertical_convP5pixelS0_iiPfi
	.p2align	3, 0x0
_Z13vertical_convP5pixelS0_iiPfi:
	.quad	_Z28__device_stub__vertical_convP5pixelS0_iiPfi
	.size	_Z13vertical_convP5pixelS0_iiPfi, 8

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/aditisingh/Image_convolution_2D/master/convd.hip"
	.size	.L.str, 111

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	" Kernel generation time:"
	.size	.L.str.1, 25

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	" sec"
	.size	.L.str.2, 5

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"wrong file format"
	.size	.L.str.4, 18

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	" File reading time:"
	.size	.L.str.5, 20

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	" vertical_convolution time on gpu: "
	.size	.L.str.6, 36

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"sec"
	.size	.L.str.7, 4

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	" horizontal convolution time on gpu:"
	.size	.L.str.8, 37

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"output_gpu.ppm"
	.size	.L.str.9, 15

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"P6\n"
	.size	.L.str.10, 4

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

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"\n"
	.size	.L.str.12, 2

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"File writing GPU: "
	.size	.L.str.13, 19

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	" vertical_convolution time on cpu: "
	.size	.L.str.14, 36

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	" horizontal _convolution time on cpu: "
	.size	.L.str.15, 39

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"output_cpu.ppm"
	.size	.L.str.16, 15

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	" Saving the result CPU:"
	.size	.L.str.17, 24

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	" in "
	.size	.L.str.18, 5

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	" at line "
	.size	.L.str.19, 10

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z13vertical_convP5pixelS0_iiPfi"
	.size	.L__unnamed_1, 33

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z15horizontal_convP5pixelS0_iiPfi"
	.size	.L__unnamed_2, 35

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

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z28__device_stub__vertical_convP5pixelS0_iiPfi
	.addrsig_sym _Z30__device_stub__horizontal_convP5pixelS0_iiPfi
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z13vertical_convP5pixelS0_iiPfi
	.addrsig_sym _Z15horizontal_convP5pixelS0_iiPfi
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z13vertical_convP5pixelS0_iiPfi ; -- Begin function _Z13vertical_convP5pixelS0_iiPfi
	.globl	_Z13vertical_convP5pixelS0_iiPfi
	.p2align	8
	.type	_Z13vertical_convP5pixelS0_iiPfi,@function
_Z13vertical_convP5pixelS0_iiPfi:       ; @_Z13vertical_convP5pixelS0_iiPfi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b64 s[10:11], s[0:1], 0x10
	v_bfe_u32 v5, v0, 10, 10
	v_dual_mov_b32 v1, 0 :: v_dual_and_b32 v4, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	v_mad_u64_u32 v[2:3], null, s15, s3, v[5:6]
	s_mul_i32 s14, s14, s2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_4) | instid1(VALU_DEP_2)
	v_dual_mov_b32 v3, v1 :: v_dual_add_nc_u32 v0, s14, v4
	s_ashr_i32 s9, s10, 31
	s_ashr_i32 s3, s11, 31
	s_mov_b32 s2, s11
	s_mov_b32 s8, s10
	v_cmp_gt_u64_e32 vcc_lo, s[2:3], v[2:3]
	v_cmp_gt_u64_e64 s2, s[8:9], v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, vcc_lo
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_10
; %bb.1:                                ; %.preheader
	s_clause 0x1
	s_load_b32 s12, s[0:1], 0x20
	s_load_b128 s[4:7], s[0:1], 0x0
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v5, 0
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s12, 1
	s_cbranch_scc1 .LBB0_9
; %bb.2:                                ; %.lr.ph
	s_add_i32 s2, s12, -1
	v_cmp_gt_i32_e32 vcc_lo, s10, v0
	s_lshr_b32 s13, s2, 1
	s_load_b64 s[2:3], s[0:1], 0x18
	v_subrev_nc_u32_e32 v1, s13, v2
	v_mov_b32_e32 v3, 0
	v_mov_b32_e32 v5, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v6, s10, v1
	v_add3_u32 v6, v4, v6, s14
	v_mov_b32_e32 v4, 0
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	v_dual_mov_b32 v9, 0 :: v_dual_mov_b32 v8, 0
	v_mov_b32_e32 v7, 0
	s_and_saveexec_b32 s13, vcc_lo
	s_cbranch_execz .LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	v_or_b32_e32 v7, v1, v0
	v_cmp_gt_i32_e64 s0, s11, v1
	v_dual_mov_b32 v8, 0 :: v_dual_mov_b32 v9, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_lt_i32_e64 s1, -1, v7
	v_mov_b32_e32 v7, 0
	s_and_b32 s1, s0, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	v_mad_i64_i32 v[7:8], null, v6, 3, s[4:5]
	s_clause 0x1
	global_load_u8 v9, v[7:8], off offset:2
	global_load_u16 v10, v[7:8], off
	s_waitcnt vmcnt(1)
	v_lshlrev_b32_e32 v8, 16, v9
	s_waitcnt vmcnt(0)
	v_and_b32_e32 v7, 0xff00, v10
	v_and_b32_e32 v9, 0xff, v10
.LBB0_6:                                ; %Flow
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
.LBB0_7:                                ; %_Z7paddingP5pixeliiii.exit
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s13
	s_waitcnt lgkmcnt(0)
	s_load_b32 s0, s[2:3], 0x0
	v_cvt_f32_ubyte0_e32 v9, v9
	v_cvt_f32_ubyte2_e32 v8, v8
	v_cvt_f32_ubyte1_e32 v7, v7
	s_add_i32 s12, s12, -1
	v_add_nc_u32_e32 v6, s10, v6
	v_add_nc_u32_e32 v1, 1, v1
	s_add_u32 s2, s2, 4
	s_addc_u32 s3, s3, 0
	s_cmp_eq_u32 s12, 0
	s_waitcnt lgkmcnt(0)
	v_dual_fmac_f32 v3, s0, v9 :: v_dual_fmac_f32 v4, s0, v8
	v_fmac_f32_e32 v5, s0, v7
	s_cbranch_scc0 .LBB0_3
; %bb.8:                                ; %._crit_edge.loopexit
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_i32_f32_e32 v1, v3
	v_cvt_i32_f32_e32 v3, v5
	v_cvt_i32_f32_e32 v5, v4
.LBB0_9:                                ; %Flow91
	v_mad_u64_u32 v[6:7], null, v2, s8, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v4, v7
	v_mad_u64_u32 v[7:8], null, v6, 3, s[6:7]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mad_u64_u32 v[9:10], null, v2, s9, v[4:5]
	v_lshlrev_b16 v4, 8, v3
	v_mov_b32_e32 v2, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[10:11], null, v9, 3, v[2:3]
	v_mov_b32_e32 v8, v10
	s_delay_alu instid0(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, v0, 3, v[7:8]
	v_or_b32_e32 v0, v1, v4
	s_clause 0x1
	global_store_b8 v[2:3], v5, off offset:2
	global_store_b16 v[2:3], v0, off
.LBB0_10:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13vertical_convP5pixelS0_iiPfi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 12
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z13vertical_convP5pixelS0_iiPfi, .Lfunc_end0-_Z13vertical_convP5pixelS0_iiPfi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 556
; NumSgprs: 18
; NumVgprs: 12
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 12
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z15horizontal_convP5pixelS0_iiPfi ; -- Begin function _Z15horizontal_convP5pixelS0_iiPfi
	.globl	_Z15horizontal_convP5pixelS0_iiPfi
	.p2align	8
	.type	_Z15horizontal_convP5pixelS0_iiPfi,@function
_Z15horizontal_convP5pixelS0_iiPfi:     ; @_Z15horizontal_convP5pixelS0_iiPfi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b64 s[10:11], s[0:1], 0x10
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v4, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_ashr_i32 s9, s10, 31
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_mov_b32_e32 v1, 0
	v_mad_u64_u32 v[2:3], null, s15, s3, v[4:5]
	s_ashr_i32 s3, s11, 31
	s_mov_b32 s2, s11
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v3, v1
	s_mov_b32 s8, s10
	v_cmp_gt_u64_e32 vcc_lo, s[2:3], v[2:3]
	v_cmp_gt_u64_e64 s2, s[8:9], v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, vcc_lo
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB1_10
; %bb.1:                                ; %.preheader
	s_clause 0x1
	s_load_b32 s12, s[0:1], 0x20
	s_load_b128 s[4:7], s[0:1], 0x0
	v_dual_mov_b32 v3, 0 :: v_dual_mov_b32 v4, 0
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s12, 1
	s_cbranch_scc1 .LBB1_9
; %bb.2:                                ; %.lr.ph
	s_load_b64 s[2:3], s[0:1], 0x18
	s_add_i32 s0, s12, -1
	v_mul_lo_u32 v1, v2, s10
	s_lshr_b32 s0, s0, 1
	v_cmp_gt_i32_e32 vcc_lo, s11, v2
	v_subrev_nc_u32_e32 v4, s0, v0
	v_dual_mov_b32 v3, 0 :: v_dual_mov_b32 v6, 0
	v_mov_b32_e32 v5, 0
.LBB1_3:                                ; =>This Inner Loop Header: Depth=1
	v_dual_mov_b32 v9, 0 :: v_dual_mov_b32 v8, 0
	v_mov_b32_e32 v7, 0
	s_mov_b32 s1, exec_lo
	v_cmpx_gt_i32_e64 s10, v4
	s_cbranch_execz .LBB1_7
; %bb.4:                                ;   in Loop: Header=BB1_3 Depth=1
	v_or_b32_e32 v7, v4, v2
	v_dual_mov_b32 v9, 0 :: v_dual_mov_b32 v8, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_lt_i32_e64 s0, -1, v7
	v_mov_b32_e32 v7, 0
	s_and_b32 s11, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s0, s11
	s_cbranch_execz .LBB1_6
; %bb.5:                                ;   in Loop: Header=BB1_3 Depth=1
	v_add_nc_u32_e32 v9, v1, v4
	s_delay_alu instid0(VALU_DEP_1)
	v_mad_i64_i32 v[7:8], null, v9, 3, s[4:5]
	s_clause 0x1
	global_load_u8 v9, v[7:8], off offset:2
	global_load_u16 v10, v[7:8], off
	s_waitcnt vmcnt(1)
	v_lshlrev_b32_e32 v7, 16, v9
	s_waitcnt vmcnt(0)
	v_and_b32_e32 v8, 0xff00, v10
	v_and_b32_e32 v9, 0xff, v10
.LBB1_6:                                ; %Flow
                                        ;   in Loop: Header=BB1_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
.LBB1_7:                                ; %_Z7paddingP5pixeliiii.exit
                                        ;   in Loop: Header=BB1_3 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt lgkmcnt(0)
	s_load_b32 s0, s[2:3], 0x0
	v_cvt_f32_ubyte0_e32 v9, v9
	v_cvt_f32_ubyte1_e32 v8, v8
	v_cvt_f32_ubyte2_e32 v7, v7
	s_add_i32 s12, s12, -1
	s_add_u32 s2, s2, 4
	s_addc_u32 s3, s3, 0
	s_cmp_eq_u32 s12, 0
	s_waitcnt lgkmcnt(0)
	v_dual_fmac_f32 v3, s0, v9 :: v_dual_add_nc_u32 v4, 1, v4
	v_dual_fmac_f32 v6, s0, v8 :: v_dual_fmac_f32 v5, s0, v7
	s_cbranch_scc0 .LBB1_3
; %bb.8:                                ; %._crit_edge.loopexit
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_i32_f32_e32 v1, v3
	v_cvt_i32_f32_e32 v4, v6
	s_delay_alu instid0(VALU_DEP_3)
	v_cvt_i32_f32_e32 v3, v5
.LBB1_9:                                ; %Flow89
	v_mad_u64_u32 v[5:6], null, v2, s8, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[7:8], null, v5, 3, s[6:7]
	v_mad_u64_u32 v[9:10], null, v2, s9, v[6:7]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v2, v8
	v_mad_u64_u32 v[5:6], null, v9, 3, v[2:3]
	v_lshlrev_b16 v2, 8, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v8, v5
	v_mad_u64_u32 v[4:5], null, v0, 3, v[7:8]
	s_delay_alu instid0(VALU_DEP_3)
	v_or_b32_e32 v0, v1, v2
	s_clause 0x1
	global_store_b8 v[4:5], v3, off offset:2
	global_store_b16 v[4:5], v0, off
.LBB1_10:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z15horizontal_convP5pixelS0_iiPfi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 11
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z15horizontal_convP5pixelS0_iiPfi, .Lfunc_end1-_Z15horizontal_convP5pixelS0_iiPfi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 548
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
