#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>

#include <cuda.h>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>


float* readImage(int* width, int* height, std::string path) {
	std::ifstream reader;
	reader.open(path);
	if (!reader.is_open()) {
		std::cerr << "Unable to open file." << std::endl;
		exit(1);
	}

	// Read file content
	// Read magic number
	std::string magicNumber;
	reader >> magicNumber;
	if (magicNumber != "P3") {
		std::cerr << "The magic number is not P3 (The file is not an ASCII PPM file)." << std::endl;
		exit(1);
	}

	// Read width and height
	std::string widthStr, heightStr;
	reader >> widthStr >> heightStr;
	*width = stoi(widthStr);
	*height = stoi(heightStr);
	std::cout << "The image dimension is " << *width << " x " << *height << "." << std::endl;

	// Read range
	std::string rangeStr;
	float range;
	reader >> rangeStr;
	range = stof(rangeStr);

	// Read pixel values of the image, allocate a vector, and store the image's pixel values in the vector
	int n = *width * *height * 3;
	float* vec = (float*) malloc(n * sizeof(float));
	if (vec == NULL) {
		std::cout << "Malloc for vector in readImage(int* width, int* height, std::string path) fails." << std::endl;
		exit(1);
	}
	std::string pixelValStr;
	for (int i = 0; i < n; i++) {
		reader >> pixelValStr;
		vec[i] = stof(pixelValStr);
	}

	// Close the file
	reader.close();
	std::cout << "Finish reading image file." << std::endl;

	return vec;
}

void writeImage(float* vec, int width, int height, std::string path) {
	std::cout << "Start writing image file." << std::endl;

	std::ofstream writer;
	writer.open(path);
	if (!writer.is_open()) {
		std::cerr << "Unable to write file." << std::endl;
		exit(1);
	}

	writer << "P3\n";
	writer << width << " " << height << "\n";
	writer << "255\n";
	for (int row = 0; row < height; row++) {
		for (int col = 0; col < width; col++) {
			for (int c = 0; c < 3; c++) {
				int index = (row * width + col) * 3 + c;
				writer << (int) vec[index] << " ";
			}
		}
		writer << "\n";
	}

	writer.close();
	std::cout << "Finish writing image file.\n" << std::endl;
}

void colorToGrayCPU(std::string readPath, std::string writePath) {
	int width, height;
	float* inVec = readImage(&width, &height, readPath);
	float* outVec = (float*) malloc(width * height * 3 * sizeof(float));
	if (outVec == NULL) {
		std::cout << "Malloc for vector in colorToGrayCPU(std::string readPath, std::string writePath) fails." << std::endl;
		exit(1);
	}
	
	for (int row = 0; row < height; row++) {
		for (int col = 0; col < width; col++) {
			int index = (row * width + col) * 3;
			float r = inVec[index];
			float g = inVec[index + 1];
			float b = inVec[index + 2];

			float gray = 0.21 * r + 0.72 * g + 0.07 * b;
			outVec[index] = gray;
			outVec[index + 1] = gray;
			outVec[index + 2] = gray;
		}
	}
	writeImage(outVec, width, height, writePath);

	// Free allocated memories
	free(outVec);
	free(inVec);
}

__global__
void colorToGrayKernel(float* inVec, float* outVec, int width, int height) {
	int row = blockIdx.y * blockDim.y + threadIdx.y;
	int col = blockIdx.x * blockDim.x + threadIdx.x;

	if (row < height && col < width) {
		int index = (row * width + col) * 3;
		float r = inVec[index];
		float g = inVec[index + 1];
		float b = inVec[index + 2];

		float gray = 0.21 * r + 0.72 * g + 0.07 * b;
		outVec[index] = gray;
		outVec[index + 1] = gray;
		outVec[index + 2] = gray;
	}
}

__global__
void gaussianBlurKernel(float* inVec, float* outVec, int width, int height, float* blurMat, int blurSize) {
	int row = blockIdx.y * blockDim.y + threadIdx.y;
	int col = blockIdx.x * blockDim.x + threadIdx.x;

	if (row < height && col < width) {
		int halfBlurSize = blurSize / 2;
		int counter = 0;
		float r = 0;
		float g = 0;
		float b = 0;
		for (int x = -halfBlurSize; x <= halfBlurSize; x++) {
			for (int y = -halfBlurSize; y <= halfBlurSize; y++) {
				int curRow = fmaxf(0, fminf(row + x, height - 1));
				int curCol = fmaxf(0, fminf(col + y, width - 1));
				int curIndex = (curRow * width + curCol) * 3;

				r += inVec[curIndex] * blurMat[counter];
				g += inVec[curIndex + 1] * blurMat[counter];
				b += inVec[curIndex + 2] * blurMat[counter];

				counter++;
			}
		}
		int index = (row * width + col) * 3;
		outVec[index] = r;
		outVec[index + 1] = g;
		outVec[index + 2] = b;
	}
}

void colorToGrayGPU(std::string readPath, std::string writePath) {
	int width, height;
	float* inVec = readImage(&width, &height, readPath);
	int size = width * height * 3 * sizeof(float);
	float* outVec = (float*) malloc(size);
	if (outVec == NULL) {
		std::cout << "Malloc for vector in colorToGrayGPU(std::string readPath, std::string writePath) fails." << std::endl;
		exit(1);
	}

	float* d_inVec, *d_outVec;
	cudaMalloc((void**) &d_inVec, size);
	cudaMemcpy(d_inVec, inVec, size, cudaMemcpyHostToDevice);
	cudaMalloc((void**) &d_outVec, size);
	cudaMemcpy(d_outVec, outVec, size, cudaMemcpyHostToDevice);

	// Launch kernel
	dim3 dimGrid(ceil(width / 16.0), ceil(height / 16.0), 1);
	dim3 dimBlock(16, 16, 1);
	colorToGrayKernel<<<dimGrid, dimBlock>>>(d_inVec, d_outVec, width, height);

	cudaMemcpy(outVec, d_outVec, size, cudaMemcpyDeviceToHost);
	cudaFree(d_inVec);
	cudaFree(d_outVec);

	writeImage(outVec, width, height, writePath);

	// Free allocated memories
	free(outVec);
	free(inVec);
}

float* genGaussianBlurMat(int blurSize, float sigma) {
	const float PI = 3.14159265359;
	float* blurMat = (float*) malloc(blurSize * blurSize * sizeof(float));	// Essentially a Gaussian blur matrix flattened into a 1D vector
	int halfBlurSize = blurSize / 2;
	float sum = 0.0;
	int counter = 0;
	for (int x = -halfBlurSize; x <= halfBlurSize; x++) {
		for (int y = -halfBlurSize; y <= halfBlurSize; y++) {
			float g = 1.0 / (2 * PI * sigma * sigma) * exp(-(x * x + y * y) / (2 * sigma * sigma));
			blurMat[counter] = g;
			sum += g;
			counter++;
		}
	}

	// Normalize the weights
	counter = 0;
	for (int x = -halfBlurSize; x <= halfBlurSize; x++) {
		for (int y = -halfBlurSize; y <= halfBlurSize; y++) {
			blurMat[counter] /= sum;
			counter++;
		}
	}

	return blurMat;
}

void gaussianBlurGPU(std::string readPath, std::string writePath, int blurSize, float sigma) {
	int width, height;
	float* inVec = readImage(&width, &height, readPath);
	int size = width * height * 3 * sizeof(float);
	float* outVec = (float*) malloc(size);
	if (outVec == NULL) {
		std::cout << "Malloc for vector in colorToGrayGPU(std::string readPath, std::string writePath) fails." << std::endl;
		exit(1);
	}

	// If blurSize is even, treat it as if it were odd so they have the same halfBlurSize
	// For example, blurSize = 4 and blurSize = 5 both have the same halfBlurSize 2
	if (blurSize % 2 == 0) {
		blurSize++;
	}
	float* blurMat = genGaussianBlurMat(blurSize, sigma);

	float* d_inVec, *d_outVec, *d_blurMat;
	cudaMalloc((void**) &d_inVec, size);
	cudaMemcpy(d_inVec, inVec, size, cudaMemcpyHostToDevice);
	cudaMalloc((void**) &d_outVec, size);
	cudaMemcpy(d_outVec, outVec, size, cudaMemcpyHostToDevice);
	cudaMalloc((void**) &d_blurMat, blurSize * blurSize * sizeof(float));
	cudaMemcpy(d_blurMat, blurMat, blurSize * blurSize * sizeof(float), cudaMemcpyHostToDevice);

	// Launch kernel
	dim3 dimGrid(ceil(width / 16.0), ceil(height / 16.0), 1);
	dim3 dimBlock(16, 16, 1);
	gaussianBlurKernel<<<dimGrid, dimBlock>>>(d_inVec, d_outVec, width, height, d_blurMat, blurSize);

	cudaMemcpy(outVec, d_outVec, size, cudaMemcpyDeviceToHost);
	cudaFree(d_inVec);
	cudaFree(d_outVec);
	cudaFree(d_blurMat);

	writeImage(outVec, width, height, writePath);

	// Free allocated memories
	free(outVec);
	free(inVec);
	free(blurMat);
}

int main() {
	// TODO
	std::string readPath = "pineapple_pizza.ppm";
	std::string writePathGrayCPU = "pineapple_pizza_gray_cpu.ppm";
	std::string writePathGrayGPU = "pineapple_pizza_gray_gpu.ppm";
	std::string writePathBlurGPU = "pineapple_pizza_blur_gpu.ppm";
	std::string writePathGrayBlurGPU = "pineapple_pizza_gray_blur_gpu.ppm";

	colorToGrayCPU(readPath, writePathGrayCPU);
	colorToGrayGPU(readPath, writePathGrayGPU);
	gaussianBlurGPU(readPath, writePathBlurGPU, 21, 7.0);
	gaussianBlurGPU(writePathGrayGPU, writePathGrayBlurGPU, 21, 7.0);

	return 0;
}
	.file	"tmpxft_0036de42_00000000-6_imageProcessing.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4087:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4087:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4832:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4832:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z18genGaussianBlurMatif
	.type	_Z18genGaussianBlurMatif, @function
_Z18genGaussianBlurMatif:
.LFB4082:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	imull	%edi, %edi
	movslq	%edi, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	salq	$2, %rdi
	movss	%xmm0, (%rsp)
	call	malloc@PLT
	movl	$2, %ecx
	movss	(%rsp), %xmm2
	xorps	%xmm4, %xmm4
	movq	%rax, %r12
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	xorl	%edx, %edx
	movl	%eax, %ebp
	movl	%eax, %ebx
	negl	%ebp
	movl	%ebp, %r14d
.L4:
	cmpl	%ebx, %r14d
	jg	.L11
	movl	%r14d, %ecx
	movslq	%edx, %r15
	movl	%ebp, %r13d
	imull	%r14d, %ecx
.L7:
	cmpl	%ebx, %r13d
	jg	.L14
	movl	%r13d, %eax
	movaps	%xmm2, %xmm1
	movl	%edx, 12(%rsp)
	imull	%r13d, %eax
	addss	%xmm2, %xmm1
	movl	%ecx, 4(%rsp)
	incl	%r13d
	movss	%xmm4, 8(%rsp)
	movss	%xmm2, (%rsp)
	mulss	%xmm2, %xmm1
	addl	%ecx, %eax
	negl	%eax
	cvtsi2ssl	%eax, %xmm0
	divss	%xmm1, %xmm0
	call	expf@PLT
	movss	(%rsp), %xmm2
	movl	12(%rsp), %edx
	movss	.LC1(%rip), %xmm3
	cvtss2sd	%xmm0, %xmm0
	movss	8(%rsp), %xmm4
	movsd	.LC2(%rip), %xmm1
	movl	4(%rsp), %ecx
	mulss	%xmm2, %xmm3
	mulss	%xmm2, %xmm3
	cvtss2sd	%xmm3, %xmm3
	divsd	%xmm3, %xmm1
	mulsd	%xmm0, %xmm1
	cvtsd2ss	%xmm1, %xmm1
	movss	%xmm1, (%r12,%r15,4)
	addss	%xmm1, %xmm4
	incq	%r15
	jmp	.L7
.L14:
	leal	1(%rbx), %ecx
	cmpl	%ecx, %ebp
	leal	(%rcx,%rbx), %eax
	movl	$0, %ecx
	cmovg	%ecx, %eax
	incl	%r14d
	addl	%eax, %edx
	jmp	.L4
.L11:
	movl	%ebp, %ecx
	xorl	%edx, %edx
	leal	1(%rbx), %esi
	xorl	%r8d, %r8d
.L6:
	cmpl	%ebx, %ecx
	jg	.L3
	movl	%ebp, %edi
	movslq	%edx, %rax
	subl	%edx, %edi
.L10:
	leal	(%rdi,%rax), %r9d
	cmpl	%r9d, %ebx
	jl	.L15
	movss	(%r12,%rax,4), %xmm0
	divss	%xmm4, %xmm0
	movss	%xmm0, (%r12,%rax,4)
	incq	%rax
	jmp	.L10
.L15:
	cmpl	%esi, %ebp
	leal	(%rsi,%rbx), %eax
	cmovg	%r8d, %eax
	incl	%ecx
	addl	%eax, %edx
	jmp	.L6
.L3:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	movq	%r12, %rax
	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
.LFE4082:
	.size	_Z18genGaussianBlurMatif, .-_Z18genGaussianBlurMatif
	.globl	_Z41__device_stub__Z17colorToGrayKernelPfS_iiPfS_ii
	.type	_Z41__device_stub__Z17colorToGrayKernelPfS_iiPfS_ii, @function
_Z41__device_stub__Z17colorToGrayKernelPfS_iiPfS_ii:
.LFB4109:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z17colorToGrayKernelPfS_ii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L16:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4109:
	.size	_Z41__device_stub__Z17colorToGrayKernelPfS_iiPfS_ii, .-_Z41__device_stub__Z17colorToGrayKernelPfS_iiPfS_ii
	.globl	_Z17colorToGrayKernelPfS_ii
	.type	_Z17colorToGrayKernelPfS_ii, @function
_Z17colorToGrayKernelPfS_ii:
.LFB4110:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z17colorToGrayKernelPfS_iiPfS_ii
	.cfi_endproc
.LFE4110:
	.size	_Z17colorToGrayKernelPfS_ii, .-_Z17colorToGrayKernelPfS_ii
	.globl	_Z45__device_stub__Z18gaussianBlurKernelPfS_iiS_iPfS_iiS_i
	.type	_Z45__device_stub__Z18gaussianBlurKernelPfS_iiS_iPfS_iiS_i, @function
_Z45__device_stub__Z18gaussianBlurKernelPfS_iiS_iPfS_iiS_i:
.LFB4111:
	.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	.L21
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z18gaussianBlurKernelPfS_iiS_i(%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
.L21:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4111:
	.size	_Z45__device_stub__Z18gaussianBlurKernelPfS_iiS_iPfS_iiS_i, .-_Z45__device_stub__Z18gaussianBlurKernelPfS_iiS_iPfS_iiS_i
	.globl	_Z18gaussianBlurKernelPfS_iiS_i
	.type	_Z18gaussianBlurKernelPfS_iiS_i, @function
_Z18gaussianBlurKernelPfS_iiS_i:
.LFB4112:
	.cfi_startproc
	endbr64
	jmp	_Z45__device_stub__Z18gaussianBlurKernelPfS_iiS_iPfS_iiS_i
	.cfi_endproc
.LFE4112:
	.size	_Z18gaussianBlurKernelPfS_iiS_i, .-_Z18gaussianBlurKernelPfS_iiS_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"_Z18gaussianBlurKernelPfS_iiS_i"
.LC4:
	.string	"_Z17colorToGrayKernelPfS_ii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4114:
	.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	.LC3(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z18gaussianBlurKernelPfS_iiS_i(%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	.LC4(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17colorToGrayKernelPfS_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	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
.LFE4114:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev,"axG",@progbits,_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD5Ev,comdat
	.align 2
	.weak	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev
	.type	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev, @function
_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev:
.LFB4193:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	call	__errno_location@PLT
	cmpl	$0, (%rax)
	jne	.L28
	movl	(%rbx), %edx
	movl	%edx, (%rax)
.L28:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4193:
	.size	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev, .-_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev
	.weak	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev
	.set	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev,_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev
	.section	.text._ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,"axG",@progbits,_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,comdat
	.weak	_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
	.type	_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_, @function
_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_:
.LFB4188:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4188
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rsi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rcx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdx, %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	%r8d, 12(%rsp)
	leaq	28(%rsp), %r13
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	__errno_location@PLT
	movl	12(%rsp), %edx
	leaq	32(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rbp
	movl	(%rax), %eax
	movl	%eax, 28(%rsp)
	xorl	%eax, %eax
	movl	%eax, 0(%rbp)
.LEHB0:
	call	*%r15
	movq	32(%rsp), %rdx
	cmpq	%rbx, %rdx
	jne	.L32
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	movq	%r14, %rdi
	call	_ZSt24__throw_invalid_argumentPKc@PLT
.L32:
	cmpl	$34, 0(%rbp)
	je	.L34
	movl	$2147483648, %ecx
	movl	$4294967295, %esi
	addq	%rax, %rcx
	cmpq	%rcx, %rsi
	jnb	.L35
.L34:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	movq	%r14, %rdi
	call	_ZSt20__throw_out_of_rangePKc@PLT
.LEHE0:
.L35:
	testq	%r12, %r12
	je	.L37
	subq	%rbx, %rdx
	movq	%rdx, (%r12)
.L37:
	movq	%r13, %rdi
	movl	%eax, 12(%rsp)
	call	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev
	movl	12(%rsp), %eax
	movq	40(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	jmp	.L45
.L41:
	endbr64
	movq	%rax, %rbx
.L38:
	movq	%r13, %rdi
	call	_ZZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	movq	%rbx, %rdi
.LEHB1:
	call	_Unwind_Resume@PLT
.LEHE1:
.L45:
	call	__stack_chk_fail@PLT
.L40:
	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
.LFE4188:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table._ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,"aG",@progbits,_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,comdat
.LLSDA4188:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4188-.LLSDACSB4188
.LLSDACSB4188:
	.uleb128 .LEHB0-.LFB4188
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L41-.LFB4188
	.uleb128 0
	.uleb128 .LEHB1-.LFB4188
	.uleb128 .LEHE1-.LEHB1
	.uleb128 0
	.uleb128 0
.LLSDACSE4188:
	.section	.text._ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,"axG",@progbits,_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,comdat
	.size	_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_, .-_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
	.section	.text._ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev,"axG",@progbits,_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD5Ev,comdat
	.align 2
	.weak	_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev
	.type	_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev, @function
_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev:
.LFB4238:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	call	__errno_location@PLT
	cmpl	$0, (%rax)
	jne	.L48
	movl	(%rbx), %edx
	movl	%edx, (%rax)
.L48:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4238:
	.size	_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev, .-_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev
	.weak	_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev
	.set	_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev,_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD2Ev
	.section	.text._ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,"axG",@progbits,_ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,comdat
	.weak	_ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
	.type	_ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_, @function
_ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_:
.LFB4233:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4233
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rsi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rcx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdx, %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %r13
	call	__errno_location@PLT
	leaq	32(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rbp
	movl	(%rax), %eax
	movl	%eax, 28(%rsp)
	xorl	%eax, %eax
	movl	%eax, 0(%rbp)
.LEHB2:
	call	*%r15
	movq	32(%rsp), %rax
	cmpq	%rbx, %rax
	jne	.L52
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L64
	movq	%r14, %rdi
	call	_ZSt24__throw_invalid_argumentPKc@PLT
.L52:
	cmpl	$34, 0(%rbp)
	jne	.L54
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L64
	movq	%r14, %rdi
	call	_ZSt20__throw_out_of_rangePKc@PLT
.LEHE2:
.L54:
	testq	%r12, %r12
	je	.L56
	subq	%rbx, %rax
	movq	%rax, (%r12)
.L56:
	movq	%r13, %rdi
	movss	%xmm0, 12(%rsp)
	call	_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev
	movss	12(%rsp), %xmm0
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L59
	jmp	.L64
.L60:
	endbr64
	movq	%rax, %rbx
.L57:
	movq	%r13, %rdi
	call	_ZZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_EN11_Save_errnoD1Ev
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L64
	movq	%rbx, %rdi
.LEHB3:
	call	_Unwind_Resume@PLT
.LEHE3:
.L64:
	call	__stack_chk_fail@PLT
.L59:
	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
.LFE4233:
	.section	.gcc_except_table._ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,"aG",@progbits,_ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,comdat
.LLSDA4233:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4233-.LLSDACSB4233
.LLSDACSB4233:
	.uleb128 .LEHB2-.LFB4233
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L60-.LFB4233
	.uleb128 0
	.uleb128 .LEHB3-.LFB4233
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
.LLSDACSE4233:
	.section	.text._ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,"axG",@progbits,_ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_,comdat
	.size	_ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_, .-_ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
	.section	.rodata.str1.1
.LC5:
	.string	"Unable to open file."
.LC6:
	.string	"P3"
.LC7:
	.string	"The magic number is not P3 (The file is not an ASCII PPM file)."
.LC8:
	.string	"stoi"
.LC9:
	.string	"The image dimension is "
.LC10:
	.string	" x "
.LC11:
	.string	"."
.LC12:
	.string	"stof"
.LC13:
	.string	"Malloc for vector in readImage(int* width, int* height, std::string path) fails."
.LC14:
	.string	"Finish reading image file."
	.text
	.globl	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.type	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, @function
_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
.LFB4077:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4077
	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
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$744, %rsp
	.cfi_def_cfa_offset 800
	movq	%fs:40, %rax
	movq	%rax, 728(%rsp)
	xorl	%eax, %eax
	leaq	208(%rsp), %rbx
	movq	%rbx, %rdi
.LEHB4:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE4:
	movq	0(%r13), %rsi
	movl	$8, %edx
	leaq	224(%rsp), %rdi
.LEHB5:
	call	_ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	movq	208(%rsp), %rdx
	movq	-24(%rdx), %rdi
	addq	%rbx, %rdi
	testq	%rax, %rax
	jne	.L68
	movl	$4, %esi
	call	_ZNSt9basic_iosIcSt11char_traitsIcEE8setstateESt12_Ios_Iostate@PLT
	jmp	.L69
.L68:
	xorl	%esi, %esi
	call	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate@PLT
.L69:
	leaq	328(%rsp), %rdi
	call	_ZNKSt12__basic_fileIcE7is_openEv@PLT
	testb	%al, %al
	jne	.L70
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %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
.LEHE5:
.L75:
	movl	$1, %edi
	call	exit@PLT
.L70:
	leaq	48(%rsp), %rax
	xorl	%edi, %edi
	movb	$0, 64(%rsp)
	movq	%rax, 8(%rsp)
	movq	8(%rsp), %rsi
	leaq	64(%rsp), %rax
	movq	%rdi, 56(%rsp)
	movq	%rbx, %rdi
	movq	%rax, 48(%rsp)
.LEHB6:
	call	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	cmpq	$2, 56(%rsp)
	jne	.L71
	movq	48(%rsp), %rdi
	movl	$2, %edx
	leaq	.LC6(%rip), %rsi
	call	memcmp@PLT
	testl	%eax, %eax
	je	.L72
.L71:
	leaq	.LC7(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %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
.LEHE6:
	jmp	.L75
.L72:
	leaq	80(%rsp), %rax
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	movq	%rbx, %rdi
	movq	%rax, 16(%rsp)
	leaq	96(%rsp), %rax
	movq	%rax, 80(%rsp)
	leaq	128(%rsp), %rax
	movq	%rsi, 120(%rsp)
	movq	16(%rsp), %rsi
	movq	%rax, 112(%rsp)
	leaq	112(%rsp), %rax
	movq	%rcx, 88(%rsp)
	movb	$0, 96(%rsp)
	movb	$0, 128(%rsp)
	movq	%rax, 32(%rsp)
.LEHB7:
	call	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	32(%rsp), %rsi
	movq	%rax, %rdi
	call	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	leaq	.LC8(%rip), %r13
	movq	80(%rsp), %rdx
	movl	$10, %r8d
	xorl	%ecx, %ecx
	movq	__isoc23_strtol@GOTPCREL(%rip), %rdi
	movq	%r13, %rsi
	call	_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
	movl	%eax, 0(%rbp)
	movq	112(%rsp), %rdx
	movl	$10, %r8d
	xorl	%ecx, %ecx
	movq	__isoc23_strtol@GOTPCREL(%rip), %rdi
	movq	%r13, %rsi
	call	_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
	movl	%eax, (%r12)
	leaq	_ZSt4cout(%rip), %r14
	leaq	.LC9(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	0(%rbp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%r12), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@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
.LEHE7:
	leaq	144(%rsp), %rax
	xorl	%edx, %edx
	movq	%rbx, %rdi
	movb	$0, 160(%rsp)
	movq	%rax, 24(%rsp)
	movq	24(%rsp), %rsi
	leaq	160(%rsp), %rax
	movq	%rax, 144(%rsp)
	movq	%rdx, 152(%rsp)
.LEHB8:
	call	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	leaq	.LC12(%rip), %r15
	movq	144(%rsp), %rdx
	movq	strtof@GOTPCREL(%rip), %rdi
	xorl	%ecx, %ecx
	movq	%r15, %rsi
	call	_ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
	movl	0(%rbp), %ebp
	imull	(%r12), %ebp
	leal	0(%rbp,%rbp,2), %ebp
	movslq	%ebp, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testq	%rax, %rax
	jne	.L76
	leaq	.LC13(%rip), %rsi
	movq	%r14, %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
.LEHE8:
	jmp	.L75
.L76:
	leaq	192(%rsp), %rax
	movb	$0, 192(%rsp)
	xorl	%r13d, %r13d
	movq	%rax, 176(%rsp)
	xorl	%eax, %eax
	movq	%rax, 184(%rsp)
	leaq	176(%rsp), %rax
	movq	%rax, 40(%rsp)
.L77:
	cmpl	%r13d, %ebp
	jle	.L93
	movq	40(%rsp), %rsi
	movq	%rbx, %rdi
.LEHB9:
	call	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	176(%rsp), %rdx
	movq	strtof@GOTPCREL(%rip), %rdi
	xorl	%ecx, %ecx
	movq	%r15, %rsi
	call	_ZN9__gnu_cxx6__stoaIffcJEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_
	movss	%xmm0, (%r12,%r13,4)
	incq	%r13
	jmp	.L77
.L93:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
	leaq	.LC14(%rip), %rsi
	movq	%r14, %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
.LEHE9:
	movq	40(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	24(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	32(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	16(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	728(%rsp), %rax
	subq	%fs:40, %rax
	je	.L85
	jmp	.L91
.L90:
	endbr64
	movq	%rax, %rbp
.L79:
	leaq	176(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L80
.L89:
	endbr64
	movq	%rax, %rbp
.L80:
	movq	24(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L81
.L88:
	endbr64
	movq	%rax, %rbp
.L81:
	movq	32(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	16(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L82
.L87:
	endbr64
	movq	%rax, %rbp
.L82:
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L83
.L86:
	endbr64
	movq	%rax, %rbp
.L83:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	728(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L91
	movq	%rbp, %rdi
.LEHB10:
	call	_Unwind_Resume@PLT
.LEHE10:
.L91:
	call	__stack_chk_fail@PLT
.L85:
	addq	$744, %rsp
	.cfi_def_cfa_offset 56
	movq	%r12, %rax
	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
.LFE4077:
	.section	.gcc_except_table,"a",@progbits
.LLSDA4077:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4077-.LLSDACSB4077
.LLSDACSB4077:
	.uleb128 .LEHB4-.LFB4077
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB5-.LFB4077
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L86-.LFB4077
	.uleb128 0
	.uleb128 .LEHB6-.LFB4077
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L87-.LFB4077
	.uleb128 0
	.uleb128 .LEHB7-.LFB4077
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L88-.LFB4077
	.uleb128 0
	.uleb128 .LEHB8-.LFB4077
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L89-.LFB4077
	.uleb128 0
	.uleb128 .LEHB9-.LFB4077
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L90-.LFB4077
	.uleb128 0
	.uleb128 .LEHB10-.LFB4077
	.uleb128 .LEHE10-.LEHB10
	.uleb128 0
	.uleb128 0
.LLSDACSE4077:
	.text
	.size	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, .-_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.section	.rodata.str1.1
.LC15:
	.string	"Start writing image file."
.LC16:
	.string	"Unable to write file."
.LC17:
	.string	"P3\n"
.LC18:
	.string	" "
.LC19:
	.string	"\n"
.LC20:
	.string	"255\n"
.LC21:
	.string	"Finish writing image file.\n"
	.text
	.globl	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.type	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, @function
_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
.LFB4079:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4079
	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
	movl	%esi, %ebp
	leaq	.LC15(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rcx, %rbx
	subq	$568, %rsp
	.cfi_def_cfa_offset 624
	movl	%edx, 20(%rsp)
	movq	%rdi, 24(%rsp)
	leaq	_ZSt4cout(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 552(%rsp)
	xorl	%eax, %eax
.LEHB11:
	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	40(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE11:
	movq	(%rbx), %rsi
	leaq	48(%rsp), %rdi
	movl	$16, %edx
.LEHB12:
	call	_ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	movq	40(%rsp), %rdx
	movq	8(%rsp), %rdi
	addq	-24(%rdx), %rdi
	testq	%rax, %rax
	jne	.L95
	movl	$4, %esi
	call	_ZNSt9basic_iosIcSt11char_traitsIcEE8setstateESt12_Ios_Iostate@PLT
	jmp	.L96
.L95:
	xorl	%esi, %esi
	call	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate@PLT
.L96:
	leaq	152(%rsp), %rdi
	call	_ZNKSt12__basic_fileIcE7is_openEv@PLT
	testb	%al, %al
	jne	.L97
	leaq	.LC16(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %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, %edi
	call	exit@PLT
.L97:
	movq	8(%rsp), %rdi
	leaq	.LC17(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	8(%rsp), %rdi
	movl	%ebp, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC18(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	20(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC19(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	8(%rsp), %rdi
	leaq	.LC20(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
.L98:
	movl	20(%rsp), %eax
	cmpl	%eax, %r15d
	jge	.L100
	movslq	%r14d, %rbx
	movq	24(%rsp), %rax
	xorl	%r13d, %r13d
	imulq	$12, %rbx, %rbx
	addq	%rax, %rbx
.L101:
	cmpl	%ebp, %r13d
	jge	.L110
	xorl	%r12d, %r12d
.L99:
	cvttss2sil	(%rbx,%r12,4), %esi
	movq	8(%rsp), %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC18(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	incq	%r12
	cmpq	$3, %r12
	jne	.L99
	incl	%r13d
	addq	$12, %rbx
	jmp	.L101
.L110:
	movq	8(%rsp), %rdi
	leaq	.LC19(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	incl	%r15d
	addl	%ebp, %r14d
	jmp	.L98
.L100:
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
	leaq	.LC21(%rip), %rsi
	leaq	_ZSt4cout(%rip), %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
.LEHE12:
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	552(%rsp), %rax
	subq	%fs:40, %rax
	je	.L104
	jmp	.L108
.L106:
	endbr64
	movq	%rax, %rbx
.L102:
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	552(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L108
	movq	%rbx, %rdi
.LEHB13:
	call	_Unwind_Resume@PLT
.LEHE13:
.L108:
	call	__stack_chk_fail@PLT
.L104:
	addq	$568, %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
.LFE4079:
	.section	.gcc_except_table
.LLSDA4079:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4079-.LLSDACSB4079
.LLSDACSB4079:
	.uleb128 .LEHB11-.LFB4079
	.uleb128 .LEHE11-.LEHB11
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB12-.LFB4079
	.uleb128 .LEHE12-.LEHB12
	.uleb128 .L106-.LFB4079
	.uleb128 0
	.uleb128 .LEHB13-.LFB4079
	.uleb128 .LEHE13-.LEHB13
	.uleb128 0
	.uleb128 0
.LLSDACSE4079:
	.text
	.size	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, .-_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.section	.rodata.str1.1
.LC22:
	.string	"Malloc for vector in colorToGrayCPU(std::string readPath, std::string writePath) fails."
	.text
	.globl	_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.type	_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, @function
_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_:
.LFB4080:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4080
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rsi, %r14
	movq	%rdi, %rsi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rbx
	movq	%rbx, %rdi
.LEHB14:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE14:
	leaq	4(%rsp), %rsi
	movq	%rsp, %rdi
	movq	%rbx, %rdx
.LEHB15:
	call	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.LEHE15:
	movq	%rbx, %rdi
	movq	%rax, %r12
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movl	(%rsp), %r13d
	movl	4(%rsp), %r15d
	movl	%r13d, %edi
	imull	%r15d, %edi
	leal	(%rdi,%rdi,2), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, %rbp
	testq	%rax, %rax
	je	.L112
	movsd	.LC23(%rip), %xmm2
	movsd	.LC24(%rip), %xmm3
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	movsd	.LC25(%rip), %xmm4
	jmp	.L113
.L112:
	leaq	.LC22(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
.LEHB16:
	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, %edi
	call	exit@PLT
.L130:
	incl	%esi
	addl	%r13d, %ecx
.L113:
	cmpl	%esi, %r15d
	jle	.L115
	leal	(%rcx,%rcx,2), %eax
	xorl	%edx, %edx
	cltq
	salq	$2, %rax
.L116:
	cmpl	%edx, %r13d
	jle	.L130
	cvtss2sd	(%r12,%rax), %xmm0
	cvtss2sd	4(%r12,%rax), %xmm1
	mulsd	%xmm2, %xmm0
	incl	%edx
	mulsd	%xmm3, %xmm1
	addsd	%xmm1, %xmm0
	cvtss2sd	8(%r12,%rax), %xmm1
	mulsd	%xmm4, %xmm1
	addsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 0(%rbp,%rax)
	movss	%xmm0, 4(%rbp,%rax)
	movss	%xmm0, 8(%rbp,%rax)
	addq	$12, %rax
	jmp	.L116
.L115:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE16:
	movq	%rbx, %rcx
	movl	%r15d, %edx
	movl	%r13d, %esi
	movq	%rbp, %rdi
.LEHB17:
	call	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.LEHE17:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L127
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r12, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	free@PLT
.L123:
	.cfi_restore_state
	endbr64
	jmp	.L129
.L124:
	endbr64
.L129:
	movq	%rax, %rbp
.L120:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L121
.L127:
	call	__stack_chk_fail@PLT
.L121:
	movq	%rbp, %rdi
.LEHB18:
	call	_Unwind_Resume@PLT
.LEHE18:
	.cfi_endproc
.LFE4080:
	.section	.gcc_except_table
.LLSDA4080:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4080-.LLSDACSB4080
.LLSDACSB4080:
	.uleb128 .LEHB14-.LFB4080
	.uleb128 .LEHE14-.LEHB14
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB15-.LFB4080
	.uleb128 .LEHE15-.LEHB15
	.uleb128 .L123-.LFB4080
	.uleb128 0
	.uleb128 .LEHB16-.LFB4080
	.uleb128 .LEHE16-.LEHB16
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB17-.LFB4080
	.uleb128 .LEHE17-.LEHB17
	.uleb128 .L124-.LFB4080
	.uleb128 0
	.uleb128 .LEHB18-.LFB4080
	.uleb128 .LEHE18-.LEHB18
	.uleb128 0
	.uleb128 0
.LLSDACSE4080:
	.text
	.size	_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, .-_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.section	.rodata.str1.1
.LC26:
	.string	"Malloc for vector in colorToGrayGPU(std::string readPath, std::string writePath) fails."
	.text
	.globl	_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.type	_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, @function
_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_:
.LFB4081:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4081
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %r15
	movq	%rdi, %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	72(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, (%rsp)
.LEHB19:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE19:
	movq	(%rsp), %rdx
	leaq	28(%rsp), %rsi
	leaq	24(%rsp), %rdi
.LEHB20:
	call	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.LEHE20:
	movq	(%rsp), %rdi
	movq	%rax, %r12
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movl	24(%rsp), %r13d
	movl	28(%rsp), %r14d
	movl	%r13d, %ebx
	imull	%r14d, %ebx
	leal	(%rbx,%rbx,2), %ebx
	sall	$2, %ebx
	movslq	%ebx, %rbx
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rax, %rbp
	testq	%rax, %rax
	jne	.L132
	leaq	.LC26(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
.LEHB21:
	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, %edi
	call	exit@PLT
.L132:
	leaq	32(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	32(%rsp), %rdi
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	leaq	40(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	40(%rsp), %rdi
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	cvtsi2sdl	%r14d, %xmm0
	mulsd	.LC27(%rip), %xmm0
	call	ceil@PLT
	movsd	%xmm0, 8(%rsp)
	cvtsi2sdl	%r13d, %xmm0
	mulsd	.LC27(%rip), %xmm0
	call	ceil@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	cvttsd2siq	%xmm0, %rax
	movsd	8(%rsp), %xmm1
	movl	$1, %esi
	movabsq	$68719476752, %rdx
	movl	%eax, 48(%rsp)
	cvttsd2siq	%xmm1, %rax
	movl	%eax, 52(%rsp)
	movq	48(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L133
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	movl	%r14d, %ecx
	movl	%r13d, %edx
	call	_Z41__device_stub__Z17colorToGrayKernelPfS_iiPfS_ii
.L133:
	movq	40(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdx
	movq	%rbp, %rdi
	call	cudaMemcpy@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	(%rsp), %rdi
	movq	%r15, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE21:
	movq	(%rsp), %rcx
	movl	%r14d, %edx
	movl	%r13d, %esi
	movq	%rbp, %rdi
.LEHB22:
	call	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.LEHE22:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L138
	jmp	.L141
.L139:
	endbr64
	jmp	.L144
.L140:
	endbr64
.L144:
	movq	%rax, %rbx
.L136:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L141
	movq	%rbx, %rdi
.LEHB23:
	call	_Unwind_Resume@PLT
.LEHE23:
.L141:
	call	__stack_chk_fail@PLT
.L138:
	addq	$120, %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
.LFE4081:
	.section	.gcc_except_table
.LLSDA4081:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4081-.LLSDACSB4081
.LLSDACSB4081:
	.uleb128 .LEHB19-.LFB4081
	.uleb128 .LEHE19-.LEHB19
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB20-.LFB4081
	.uleb128 .LEHE20-.LEHB20
	.uleb128 .L139-.LFB4081
	.uleb128 0
	.uleb128 .LEHB21-.LFB4081
	.uleb128 .LEHE21-.LEHB21
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB22-.LFB4081
	.uleb128 .LEHE22-.LEHB22
	.uleb128 .L140-.LFB4081
	.uleb128 0
	.uleb128 .LEHB23-.LFB4081
	.uleb128 .LEHE23-.LEHB23
	.uleb128 0
	.uleb128 0
.LLSDACSE4081:
	.text
	.size	_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, .-_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.globl	_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if
	.type	_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if, @function
_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if:
.LFB4083:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4083
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %r15
	movq	%rdi, %rsi
	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
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movss	%xmm0, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	88(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, (%rsp)
.LEHB24:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE24:
	movq	(%rsp), %rdx
	leaq	36(%rsp), %rsi
	leaq	32(%rsp), %rdi
.LEHB25:
	call	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.LEHE25:
	movq	(%rsp), %rdi
	movq	%rax, 8(%rsp)
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movl	32(%rsp), %r13d
	movl	36(%rsp), %r14d
	movl	%r13d, %ebx
	imull	%r14d, %ebx
	leal	(%rbx,%rbx,2), %ebx
	sall	$2, %ebx
	movslq	%ebx, %rbx
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testq	%rax, %rax
	jne	.L146
	leaq	.LC26(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
.LEHB26:
	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, %edi
	call	exit@PLT
.L146:
	movl	%ebp, %eax
	movss	16(%rsp), %xmm0
	andl	$1, %eax
	cmpl	$1, %eax
	adcl	$0, %ebp
	movl	%ebp, %edi
	call	_Z18genGaussianBlurMatif
	leaq	40(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%rax, 16(%rsp)
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	movq	40(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	leaq	48(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	48(%rsp), %rdi
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	%ebp, %edx
	leaq	56(%rsp), %rdi
	imull	%ebp, %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	movq	%rdx, %rsi
	movq	%rdx, 24(%rsp)
	call	cudaMalloc@PLT
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movl	$1, %ecx
	movq	56(%rsp), %rdi
	call	cudaMemcpy@PLT
	cvtsi2sdl	%r14d, %xmm0
	mulsd	.LC27(%rip), %xmm0
	call	ceil@PLT
	movsd	%xmm0, 24(%rsp)
	cvtsi2sdl	%r13d, %xmm0
	mulsd	.LC27(%rip), %xmm0
	call	ceil@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	cvttsd2siq	%xmm0, %rax
	movsd	24(%rsp), %xmm1
	movl	$1, %esi
	movabsq	$68719476752, %rdx
	movl	%eax, 64(%rsp)
	cvttsd2siq	%xmm1, %rax
	movl	%eax, 68(%rsp)
	movq	64(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L148
	movq	56(%rsp), %r8
	movq	48(%rsp), %rsi
	movl	%ebp, %r9d
	movl	%r14d, %ecx
	movq	40(%rsp), %rdi
	movl	%r13d, %edx
	call	_Z45__device_stub__Z18gaussianBlurKernelPfS_iiS_iPfS_iiS_i
.L148:
	movq	48(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdx
	movq	%r12, %rdi
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	(%rsp), %rdi
	movq	%r15, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE26:
	movq	(%rsp), %rcx
	movl	%r14d, %edx
	movl	%r13d, %esi
	movq	%r12, %rdi
.LEHB27:
	call	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.LEHE27:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	8(%rsp), %rdi
	call	free@PLT
	movq	16(%rsp), %rdi
	call	free@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L153
	jmp	.L156
.L154:
	endbr64
	jmp	.L159
.L155:
	endbr64
.L159:
	movq	%rax, %rbx
.L151:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L156
	movq	%rbx, %rdi
.LEHB28:
	call	_Unwind_Resume@PLT
.LEHE28:
.L156:
	call	__stack_chk_fail@PLT
.L153:
	addq	$136, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4083:
	.section	.gcc_except_table
.LLSDA4083:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4083-.LLSDACSB4083
.LLSDACSB4083:
	.uleb128 .LEHB24-.LFB4083
	.uleb128 .LEHE24-.LEHB24
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB25-.LFB4083
	.uleb128 .LEHE25-.LEHB25
	.uleb128 .L154-.LFB4083
	.uleb128 0
	.uleb128 .LEHB26-.LFB4083
	.uleb128 .LEHE26-.LEHB26
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB27-.LFB4083
	.uleb128 .LEHE27-.LEHB27
	.uleb128 .L155-.LFB4083
	.uleb128 0
	.uleb128 .LEHB28-.LFB4083
	.uleb128 .LEHE28-.LEHB28
	.uleb128 0
	.uleb128 0
.LLSDACSE4083:
	.text
	.size	_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if, .-_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if
	.section	.rodata._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.str1.1,"aMS",@progbits,1
.LC28:
	.string	"basic_string: construction from null is not valid"
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_,comdat
	.align 2
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_:
.LFB4461:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	jne	.L161
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L166
	leaq	.LC28(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L161:
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	%rsi, %rbp
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	0(%rbp,%rax), %r12
	cmpq	$15, %rax
	jbe	.L163
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, (%rbx)
	movq	(%rsp), %rax
	movq	%rax, 16(%rbx)
.L163:
	movq	(%rbx), %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	(%rbx), %rdx
	movq	%rax, 8(%rbx)
	movb	$0, (%rdx,%rax)
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L164
.L166:
	call	__stack_chk_fail@PLT
.L164:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4461:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	.set	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.section	.rodata.str1.1
.LC29:
	.string	"pineapple_pizza.ppm"
.LC30:
	.string	"pineapple_pizza_gray_cpu.ppm"
.LC31:
	.string	"pineapple_pizza_gray_gpu.ppm"
.LC32:
	.string	"pineapple_pizza_blur_gpu.ppm"
.LC33:
	.string	"pineapple_pizza_gray_blur_gpu.ppm"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4084:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4084
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC29(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$264, %rsp
	.cfi_def_cfa_offset 320
	movq	%fs:40, %rax
	movq	%rax, 248(%rsp)
	xorl	%eax, %eax
	leaq	23(%rsp), %rbx
	leaq	24(%rsp), %rax
	movq	%rax, %rdi
	movq	%rbx, %rdx
	movq	%rax, (%rsp)
.LEHB29:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE29:
	leaq	56(%rsp), %rax
	movq	%rbx, %rdx
	leaq	.LC30(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB30:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE30:
	leaq	88(%rsp), %r13
	movq	%rbx, %rdx
	leaq	.LC31(%rip), %rsi
	movq	%r13, %rdi
.LEHB31:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE31:
	leaq	120(%rsp), %r14
	movq	%rbx, %rdx
	leaq	.LC32(%rip), %rsi
	movq	%r14, %rdi
.LEHB32:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE32:
	leaq	152(%rsp), %r15
	movq	%rbx, %rdx
	leaq	.LC33(%rip), %rsi
	movq	%r15, %rdi
.LEHB33:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE33:
	leaq	216(%rsp), %rbp
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
.LEHB34:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE34:
	leaq	184(%rsp), %r12
	movq	(%rsp), %rsi
	movq	%r12, %rdi
.LEHB35:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE35:
	movq	%rbp, %rsi
	movq	%r12, %rdi
.LEHB36:
	call	_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
.LEHE36:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
.LEHB37:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE37:
	movq	(%rsp), %rsi
	movq	%r12, %rdi
.LEHB38:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE38:
	movq	%rbp, %rsi
	movq	%r12, %rdi
.LEHB39:
	call	_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
.LEHE39:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r14, %rsi
	movq	%rbp, %rdi
.LEHB40:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE40:
	movq	(%rsp), %rsi
	movq	%r12, %rdi
.LEHB41:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE41:
	movss	.LC34(%rip), %xmm0
	movl	$21, %edx
	movq	%rbp, %rsi
	movq	%r12, %rdi
.LEHB42:
	call	_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if
.LEHE42:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r15, %rsi
	movq	%rbp, %rdi
.LEHB43:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE43:
	movq	%r13, %rsi
	movq	%r12, %rdi
.LEHB44:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE44:
	movss	.LC34(%rip), %xmm0
	movl	$21, %edx
	movq	%rbp, %rsi
	movq	%r12, %rdi
.LEHB45:
	call	_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if
.LEHE45:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r15, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r14, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	248(%rsp), %rax
	subq	%fs:40, %rax
	je	.L182
	jmp	.L196
.L188:
	endbr64
	jmp	.L199
.L187:
	endbr64
	jmp	.L198
.L191:
	endbr64
	jmp	.L199
.L190:
	endbr64
	jmp	.L198
.L193:
	endbr64
	jmp	.L199
.L192:
	endbr64
	jmp	.L198
.L195:
	endbr64
.L199:
	movq	%rax, %rbx
.L175:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L176
.L194:
	endbr64
.L198:
	movq	%rax, %rbx
.L176:
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L170
.L189:
	endbr64
	movq	%rax, %rbx
.L170:
	movq	%r15, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L177
.L186:
	endbr64
	movq	%rax, %rbx
.L177:
	movq	%r14, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L178
.L185:
	endbr64
	movq	%rax, %rbx
.L178:
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L179
.L184:
	endbr64
	movq	%rax, %rbx
.L179:
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L180
.L183:
	endbr64
	movq	%rax, %rbx
.L180:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	248(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L196
	movq	%rbx, %rdi
.LEHB46:
	call	_Unwind_Resume@PLT
.LEHE46:
.L196:
	call	__stack_chk_fail@PLT
.L182:
	addq	$264, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %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
.LFE4084:
	.section	.gcc_except_table
.LLSDA4084:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4084-.LLSDACSB4084
.LLSDACSB4084:
	.uleb128 .LEHB29-.LFB4084
	.uleb128 .LEHE29-.LEHB29
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB30-.LFB4084
	.uleb128 .LEHE30-.LEHB30
	.uleb128 .L183-.LFB4084
	.uleb128 0
	.uleb128 .LEHB31-.LFB4084
	.uleb128 .LEHE31-.LEHB31
	.uleb128 .L184-.LFB4084
	.uleb128 0
	.uleb128 .LEHB32-.LFB4084
	.uleb128 .LEHE32-.LEHB32
	.uleb128 .L185-.LFB4084
	.uleb128 0
	.uleb128 .LEHB33-.LFB4084
	.uleb128 .LEHE33-.LEHB33
	.uleb128 .L186-.LFB4084
	.uleb128 0
	.uleb128 .LEHB34-.LFB4084
	.uleb128 .LEHE34-.LEHB34
	.uleb128 .L189-.LFB4084
	.uleb128 0
	.uleb128 .LEHB35-.LFB4084
	.uleb128 .LEHE35-.LEHB35
	.uleb128 .L187-.LFB4084
	.uleb128 0
	.uleb128 .LEHB36-.LFB4084
	.uleb128 .LEHE36-.LEHB36
	.uleb128 .L188-.LFB4084
	.uleb128 0
	.uleb128 .LEHB37-.LFB4084
	.uleb128 .LEHE37-.LEHB37
	.uleb128 .L189-.LFB4084
	.uleb128 0
	.uleb128 .LEHB38-.LFB4084
	.uleb128 .LEHE38-.LEHB38
	.uleb128 .L190-.LFB4084
	.uleb128 0
	.uleb128 .LEHB39-.LFB4084
	.uleb128 .LEHE39-.LEHB39
	.uleb128 .L191-.LFB4084
	.uleb128 0
	.uleb128 .LEHB40-.LFB4084
	.uleb128 .LEHE40-.LEHB40
	.uleb128 .L189-.LFB4084
	.uleb128 0
	.uleb128 .LEHB41-.LFB4084
	.uleb128 .LEHE41-.LEHB41
	.uleb128 .L192-.LFB4084
	.uleb128 0
	.uleb128 .LEHB42-.LFB4084
	.uleb128 .LEHE42-.LEHB42
	.uleb128 .L193-.LFB4084
	.uleb128 0
	.uleb128 .LEHB43-.LFB4084
	.uleb128 .LEHE43-.LEHB43
	.uleb128 .L189-.LFB4084
	.uleb128 0
	.uleb128 .LEHB44-.LFB4084
	.uleb128 .LEHE44-.LEHB44
	.uleb128 .L194-.LFB4084
	.uleb128 0
	.uleb128 .LEHB45-.LFB4084
	.uleb128 .LEHE45-.LEHB45
	.uleb128 .L195-.LFB4084
	.uleb128 0
	.uleb128 .LEHB46-.LFB4084
	.uleb128 .LEHE46-.LEHB46
	.uleb128 0
	.uleb128 0
.LLSDACSE4084:
	.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
.LC1:
	.long	1086918619
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.align 8
.LC23:
	.long	-1374389535
	.long	1070260551
	.align 8
.LC24:
	.long	1889785610
	.long	1072106045
	.align 8
.LC25:
	.long	515396076
	.long	1068624773
	.align 8
.LC27:
	.long	0
	.long	1068498944
	.section	.rodata.cst4
	.align 4
.LC34:
	.long	1088421888
	.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 <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>

#include <hip/hip_runtime.h>




float* readImage(int* width, int* height, std::string path) {
	std::ifstream reader;
	reader.open(path);
	if (!reader.is_open()) {
		std::cerr << "Unable to open file." << std::endl;
		exit(1);
	}

	// Read file content
	// Read magic number
	std::string magicNumber;
	reader >> magicNumber;
	if (magicNumber != "P3") {
		std::cerr << "The magic number is not P3 (The file is not an ASCII PPM file)." << std::endl;
		exit(1);
	}

	// Read width and height
	std::string widthStr, heightStr;
	reader >> widthStr >> heightStr;
	*width = stoi(widthStr);
	*height = stoi(heightStr);
	std::cout << "The image dimension is " << *width << " x " << *height << "." << std::endl;

	// Read range
	std::string rangeStr;
	float range;
	reader >> rangeStr;
	range = stof(rangeStr);

	// Read pixel values of the image, allocate a vector, and store the image's pixel values in the vector
	int n = *width * *height * 3;
	float* vec = (float*) malloc(n * sizeof(float));
	if (vec == NULL) {
		std::cout << "Malloc for vector in readImage(int* width, int* height, std::string path) fails." << std::endl;
		exit(1);
	}
	std::string pixelValStr;
	for (int i = 0; i < n; i++) {
		reader >> pixelValStr;
		vec[i] = stof(pixelValStr);
	}

	// Close the file
	reader.close();
	std::cout << "Finish reading image file." << std::endl;

	return vec;
}

void writeImage(float* vec, int width, int height, std::string path) {
	std::cout << "Start writing image file." << std::endl;

	std::ofstream writer;
	writer.open(path);
	if (!writer.is_open()) {
		std::cerr << "Unable to write file." << std::endl;
		exit(1);
	}

	writer << "P3\n";
	writer << width << " " << height << "\n";
	writer << "255\n";
	for (int row = 0; row < height; row++) {
		for (int col = 0; col < width; col++) {
			for (int c = 0; c < 3; c++) {
				int index = (row * width + col) * 3 + c;
				writer << (int) vec[index] << " ";
			}
		}
		writer << "\n";
	}

	writer.close();
	std::cout << "Finish writing image file.\n" << std::endl;
}

void colorToGrayCPU(std::string readPath, std::string writePath) {
	int width, height;
	float* inVec = readImage(&width, &height, readPath);
	float* outVec = (float*) malloc(width * height * 3 * sizeof(float));
	if (outVec == NULL) {
		std::cout << "Malloc for vector in colorToGrayCPU(std::string readPath, std::string writePath) fails." << std::endl;
		exit(1);
	}
	
	for (int row = 0; row < height; row++) {
		for (int col = 0; col < width; col++) {
			int index = (row * width + col) * 3;
			float r = inVec[index];
			float g = inVec[index + 1];
			float b = inVec[index + 2];

			float gray = 0.21 * r + 0.72 * g + 0.07 * b;
			outVec[index] = gray;
			outVec[index + 1] = gray;
			outVec[index + 2] = gray;
		}
	}
	writeImage(outVec, width, height, writePath);

	// Free allocated memories
	free(outVec);
	free(inVec);
}

__global__
void colorToGrayKernel(float* inVec, float* outVec, int width, int height) {
	int row = blockIdx.y * blockDim.y + threadIdx.y;
	int col = blockIdx.x * blockDim.x + threadIdx.x;

	if (row < height && col < width) {
		int index = (row * width + col) * 3;
		float r = inVec[index];
		float g = inVec[index + 1];
		float b = inVec[index + 2];

		float gray = 0.21 * r + 0.72 * g + 0.07 * b;
		outVec[index] = gray;
		outVec[index + 1] = gray;
		outVec[index + 2] = gray;
	}
}

__global__
void gaussianBlurKernel(float* inVec, float* outVec, int width, int height, float* blurMat, int blurSize) {
	int row = blockIdx.y * blockDim.y + threadIdx.y;
	int col = blockIdx.x * blockDim.x + threadIdx.x;

	if (row < height && col < width) {
		int halfBlurSize = blurSize / 2;
		int counter = 0;
		float r = 0;
		float g = 0;
		float b = 0;
		for (int x = -halfBlurSize; x <= halfBlurSize; x++) {
			for (int y = -halfBlurSize; y <= halfBlurSize; y++) {
				int curRow = fmaxf(0, fminf(row + x, height - 1));
				int curCol = fmaxf(0, fminf(col + y, width - 1));
				int curIndex = (curRow * width + curCol) * 3;

				r += inVec[curIndex] * blurMat[counter];
				g += inVec[curIndex + 1] * blurMat[counter];
				b += inVec[curIndex + 2] * blurMat[counter];

				counter++;
			}
		}
		int index = (row * width + col) * 3;
		outVec[index] = r;
		outVec[index + 1] = g;
		outVec[index + 2] = b;
	}
}

void colorToGrayGPU(std::string readPath, std::string writePath) {
	int width, height;
	float* inVec = readImage(&width, &height, readPath);
	int size = width * height * 3 * sizeof(float);
	float* outVec = (float*) malloc(size);
	if (outVec == NULL) {
		std::cout << "Malloc for vector in colorToGrayGPU(std::string readPath, std::string writePath) fails." << std::endl;
		exit(1);
	}

	float* d_inVec, *d_outVec;
	hipMalloc((void**) &d_inVec, size);
	hipMemcpy(d_inVec, inVec, size, hipMemcpyHostToDevice);
	hipMalloc((void**) &d_outVec, size);
	hipMemcpy(d_outVec, outVec, size, hipMemcpyHostToDevice);

	// Launch kernel
	dim3 dimGrid(ceil(width / 16.0), ceil(height / 16.0), 1);
	dim3 dimBlock(16, 16, 1);
	colorToGrayKernel<<<dimGrid, dimBlock>>>(d_inVec, d_outVec, width, height);

	hipMemcpy(outVec, d_outVec, size, hipMemcpyDeviceToHost);
	hipFree(d_inVec);
	hipFree(d_outVec);

	writeImage(outVec, width, height, writePath);

	// Free allocated memories
	free(outVec);
	free(inVec);
}

float* genGaussianBlurMat(int blurSize, float sigma) {
	const float PI = 3.14159265359;
	float* blurMat = (float*) malloc(blurSize * blurSize * sizeof(float));	// Essentially a Gaussian blur matrix flattened into a 1D vector
	int halfBlurSize = blurSize / 2;
	float sum = 0.0;
	int counter = 0;
	for (int x = -halfBlurSize; x <= halfBlurSize; x++) {
		for (int y = -halfBlurSize; y <= halfBlurSize; y++) {
			float g = 1.0 / (2 * PI * sigma * sigma) * exp(-(x * x + y * y) / (2 * sigma * sigma));
			blurMat[counter] = g;
			sum += g;
			counter++;
		}
	}

	// Normalize the weights
	counter = 0;
	for (int x = -halfBlurSize; x <= halfBlurSize; x++) {
		for (int y = -halfBlurSize; y <= halfBlurSize; y++) {
			blurMat[counter] /= sum;
			counter++;
		}
	}

	return blurMat;
}

void gaussianBlurGPU(std::string readPath, std::string writePath, int blurSize, float sigma) {
	int width, height;
	float* inVec = readImage(&width, &height, readPath);
	int size = width * height * 3 * sizeof(float);
	float* outVec = (float*) malloc(size);
	if (outVec == NULL) {
		std::cout << "Malloc for vector in colorToGrayGPU(std::string readPath, std::string writePath) fails." << std::endl;
		exit(1);
	}

	// If blurSize is even, treat it as if it were odd so they have the same halfBlurSize
	// For example, blurSize = 4 and blurSize = 5 both have the same halfBlurSize 2
	if (blurSize % 2 == 0) {
		blurSize++;
	}
	float* blurMat = genGaussianBlurMat(blurSize, sigma);

	float* d_inVec, *d_outVec, *d_blurMat;
	hipMalloc((void**) &d_inVec, size);
	hipMemcpy(d_inVec, inVec, size, hipMemcpyHostToDevice);
	hipMalloc((void**) &d_outVec, size);
	hipMemcpy(d_outVec, outVec, size, hipMemcpyHostToDevice);
	hipMalloc((void**) &d_blurMat, blurSize * blurSize * sizeof(float));
	hipMemcpy(d_blurMat, blurMat, blurSize * blurSize * sizeof(float), hipMemcpyHostToDevice);

	// Launch kernel
	dim3 dimGrid(ceil(width / 16.0), ceil(height / 16.0), 1);
	dim3 dimBlock(16, 16, 1);
	gaussianBlurKernel<<<dimGrid, dimBlock>>>(d_inVec, d_outVec, width, height, d_blurMat, blurSize);

	hipMemcpy(outVec, d_outVec, size, hipMemcpyDeviceToHost);
	hipFree(d_inVec);
	hipFree(d_outVec);
	hipFree(d_blurMat);

	writeImage(outVec, width, height, writePath);

	// Free allocated memories
	free(outVec);
	free(inVec);
	free(blurMat);
}

int main() {
	// TODO
	std::string readPath = "pineapple_pizza.ppm";
	std::string writePathGrayCPU = "pineapple_pizza_gray_cpu.ppm";
	std::string writePathGrayGPU = "pineapple_pizza_gray_gpu.ppm";
	std::string writePathBlurGPU = "pineapple_pizza_blur_gpu.ppm";
	std::string writePathGrayBlurGPU = "pineapple_pizza_gray_blur_gpu.ppm";

	colorToGrayCPU(readPath, writePathGrayCPU);
	colorToGrayGPU(readPath, writePathGrayGPU);
	gaussianBlurGPU(readPath, writePathBlurGPU, 21, 7.0);
	gaussianBlurGPU(writePathGrayGPU, writePathGrayBlurGPU, 21, 7.0);

	return 0;
}
	.text
	.file	"imageProcessing.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE # -- Begin function _Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.type	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,@function
_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: # @_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.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	$696, %rsp                      # imm = 0x2B8
	.cfi_def_cfa_offset 752
	.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	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	176(%rsp), %r12
	movq	%r12, %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev
.Ltmp0:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode
.Ltmp1:
# %bb.1:
	leaq	296(%rsp), %rdi
	callq	_ZNKSt12__basic_fileIcE7is_openEv
	testb	%al, %al
	je	.LBB0_63
# %bb.2:
	leaq	88(%rsp), %rax
	movq	%rax, -16(%rax)
	movq	$0, -8(%rax)
	movb	$0, (%rax)
.Ltmp7:
	leaq	176(%rsp), %rdi
	leaq	72(%rsp), %rsi
	callq	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
.Ltmp8:
# %bb.3:
	cmpq	$2, 80(%rsp)
	jne	.LBB0_61
# %bb.4:                                # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit
	movq	72(%rsp), %rax
	movzwl	(%rax), %eax
	cmpl	$13136, %eax                    # imm = 0x3350
	jne	.LBB0_61
# %bb.5:                                # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit.thread88
	leaq	160(%rsp), %rcx
	movq	%rcx, -16(%rcx)
	xorl	%eax, %eax
	movq	%rax, -8(%rcx)
	movb	%al, (%rcx)
	leaq	128(%rsp), %rcx
	movq	%rcx, -16(%rcx)
	movq	%rax, -8(%rcx)
	movb	%al, (%rcx)
.Ltmp14:
	leaq	176(%rsp), %rdi
	leaq	144(%rsp), %rsi
	callq	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
.Ltmp15:
# %bb.6:
.Ltmp16:
	leaq	112(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
.Ltmp17:
# %bb.7:
	movq	144(%rsp), %r12
	callq	__errno_location
	movq	%rax, %rbx
	movl	(%rax), %ebp
	movl	$0, (%rax)
	leaq	8(%rsp), %r13
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	$10, %edx
	callq	__isoc23_strtol
	cmpq	%r12, (%r13)
	je	.LBB0_65
# %bb.8:
	movslq	%eax, %rcx
	cmpq	%rax, %rcx
	jne	.LBB0_67
# %bb.9:
	movl	(%rbx), %ecx
	cmpl	$34, %ecx
	je	.LBB0_67
# %bb.10:
	testl	%ecx, %ecx
	jne	.LBB0_12
# %bb.11:
	movl	%ebp, (%rbx)
.LBB0_12:
	movl	%eax, (%r15)
	movq	112(%rsp), %r12
	movl	(%rbx), %ebp
	movl	$0, (%rbx)
	leaq	8(%rsp), %r13
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	$10, %edx
	callq	__isoc23_strtol
	cmpq	%r12, (%r13)
	je	.LBB0_69
# %bb.13:
	movabsq	$-4294967296, %rcx              # imm = 0xFFFFFFFF00000000
	leaq	-2147483648(%rax), %rdx
	cmpq	%rcx, %rdx
	jb	.LBB0_71
# %bb.14:
	movl	(%rbx), %ecx
	cmpl	$34, %ecx
	je	.LBB0_71
# %bb.15:
	testl	%ecx, %ecx
	jne	.LBB0_17
# %bb.16:
	movl	%ebp, (%rbx)
.LBB0_17:
	movl	%eax, (%r14)
.Ltmp18:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp19:
# %bb.18:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit39
	movl	(%r15), %esi
.Ltmp20:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp21:
# %bb.19:
.Ltmp22:
	movq	%rax, %r12
	movl	$.L.str.4, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp23:
# %bb.20:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit40
	movl	(%r14), %esi
.Ltmp24:
	movq	%r12, %rdi
	callq	_ZNSolsEi
.Ltmp25:
# %bb.21:
.Ltmp26:
	movq	%rax, %r12
	movl	$.L.str.5, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp27:
# %bb.22:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit41
	movq	(%r12), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp28:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp29:
# %bb.23:                               # %.noexc
.Ltmp30:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp31:
# %bb.24:                               # %.noexc82
.Ltmp32:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp33:
# %bb.25:                               # %_ZNSolsEPFRSoS_E.exit42
	leaq	24(%rsp), %rax
	movq	%rax, -16(%rax)
	movq	$0, -8(%rax)
	movb	$0, (%rax)
.Ltmp35:
	leaq	176(%rsp), %rdi
	leaq	8(%rsp), %rsi
	callq	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
.Ltmp36:
# %bb.26:
	movq	8(%rsp), %r12
	movl	(%rbx), %ebp
	movl	$0, (%rbx)
	leaq	40(%rsp), %r13
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	strtof
	cmpq	%r12, (%r13)
	je	.LBB0_73
# %bb.27:
	movl	(%rbx), %eax
	testl	%eax, %eax
	je	.LBB0_31
# %bb.28:
	cmpl	$34, %eax
	jne	.LBB0_32
# %bb.29:                               # %.critedge.i.i43
.Ltmp38:
	movl	$.L.str.23, %edi
	callq	_ZSt20__throw_out_of_rangePKc
.Ltmp39:
# %bb.30:
.LBB0_31:
	movl	%ebp, (%rbx)
.LBB0_32:
	movl	(%r15), %eax
	imull	(%r14), %eax
	leal	(%rax,%rax,2), %ebp
	movslq	%ebp, %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, (%rsp)                    # 8-byte Spill
	testq	%rax, %rax
	je	.LBB0_75
# %bb.33:
	leaq	56(%rsp), %rax
	movq	%rax, -16(%rax)
	movq	$0, -8(%rax)
	movb	$0, (%rax)
	testl	%ebp, %ebp
	jle	.LBB0_41
# %bb.34:                               # %.lr.ph.preheader
	movl	%ebp, %r14d
	xorl	%r15d, %r15d
	leaq	104(%rsp), %r13
.LBB0_35:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
.Ltmp40:
	leaq	176(%rsp), %rdi
	leaq	40(%rsp), %rsi
	callq	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
.Ltmp41:
# %bb.36:                               #   in Loop: Header=BB0_35 Depth=1
	movq	40(%rsp), %rbp
	movl	(%rbx), %r12d
	movl	$0, (%rbx)
	movq	%rbp, %rdi
	movq	%r13, %rsi
	callq	strtof
	cmpq	%rbp, 104(%rsp)
	je	.LBB0_57
# %bb.37:                               #   in Loop: Header=BB0_35 Depth=1
	movl	(%rbx), %eax
	testl	%eax, %eax
	je	.LBB0_39
# %bb.38:                               #   in Loop: Header=BB0_35 Depth=1
	cmpl	$34, %eax
	jne	.LBB0_40
	jmp	.LBB0_59
.LBB0_39:                               #   in Loop: Header=BB0_35 Depth=1
	movl	%r12d, (%rbx)
.LBB0_40:                               #   in Loop: Header=BB0_35 Depth=1
	movq	(%rsp), %rax                    # 8-byte Reload
	movss	%xmm0, (%rax,%r15,4)
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB0_35
.LBB0_41:                               # %._crit_edge
.Ltmp45:
	leaq	176(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp46:
# %bb.42:
.Ltmp47:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$26, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp48:
# %bb.43:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit53
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp49:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp50:
# %bb.44:                               # %.noexc84
.Ltmp51:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp52:
# %bb.45:                               # %.noexc85
.Ltmp53:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp54:
# %bb.46:                               # %_ZNSolsEPFRSoS_E.exit54
	movq	40(%rsp), %rdi
	leaq	56(%rsp), %rax
	cmpq	%rax, %rdi
	leaq	88(%rsp), %rbx
	je	.LBB0_48
# %bb.47:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB0_48:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movq	8(%rsp), %rdi
	leaq	24(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_50
# %bb.49:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i55
	callq	_ZdlPv
.LBB0_50:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit57
	movq	112(%rsp), %rdi
	leaq	128(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_52
# %bb.51:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i58
	callq	_ZdlPv
.LBB0_52:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit60
	movq	144(%rsp), %rdi
	leaq	160(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_54
# %bb.53:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i61
	callq	_ZdlPv
.LBB0_54:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit63
	movq	72(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	.LBB0_56
# %bb.55:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i64
	callq	_ZdlPv
.LBB0_56:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit66
	leaq	176(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	(%rsp), %rax                    # 8-byte Reload
	addq	$696, %rsp                      # imm = 0x2B8
	.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
.LBB0_57:
	.cfi_def_cfa_offset 752
.Ltmp56:
	movl	$.L.str.23, %edi
	callq	_ZSt24__throw_invalid_argumentPKc
.Ltmp57:
# %bb.58:
.LBB0_59:                               # %.critedge.i.i48
.Ltmp43:
	movl	$.L.str.23, %edi
	callq	_ZSt20__throw_out_of_rangePKc
.Ltmp44:
# %bb.60:
.LBB0_61:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit.thread
.Ltmp9:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.2, %esi
	movl	$63, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp10:
# %bb.62:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit31
.Ltmp11:
	movl	$_ZSt4cerr, %edi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp12:
	jmp	.LBB0_77
.LBB0_63:
.Ltmp2:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp3:
# %bb.64:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp4:
	movl	$_ZSt4cerr, %edi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp5:
	jmp	.LBB0_77
.LBB0_65:
.Ltmp74:
	movl	$.L.str.22, %edi
	callq	_ZSt24__throw_invalid_argumentPKc
.Ltmp75:
# %bb.66:
.LBB0_67:                               # %.critedge.i.i
.Ltmp72:
	movl	$.L.str.22, %edi
	callq	_ZSt20__throw_out_of_rangePKc
.Ltmp73:
# %bb.68:
.LBB0_69:
.Ltmp69:
	movl	$.L.str.22, %edi
	callq	_ZSt24__throw_invalid_argumentPKc
.Ltmp70:
# %bb.70:
.LBB0_71:                               # %.critedge.i.i34
.Ltmp67:
	movl	$.L.str.22, %edi
	callq	_ZSt20__throw_out_of_rangePKc
.Ltmp68:
# %bb.72:
.LBB0_73:
.Ltmp64:
	movl	$.L.str.23, %edi
	callq	_ZSt24__throw_invalid_argumentPKc
.Ltmp65:
# %bb.74:
.LBB0_75:
.Ltmp59:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$80, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp60:
# %bb.76:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit46
.Ltmp61:
	movl	$_ZSt4cout, %edi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp62:
.LBB0_77:                               # %_ZNSolsEPFRSoS_E.exit
	movl	$1, %edi
	callq	exit
.LBB0_78:
.Ltmp63:
	jmp	.LBB0_80
.LBB0_79:
.Ltmp37:
.LBB0_80:                               # %.body44
	movq	%rax, %r14
	jmp	.LBB0_97
.LBB0_81:
.Ltmp66:
	movq	%rax, %r14
	cmpl	$0, (%rbx)
	jne	.LBB0_97
# %bb.82:
	movl	%ebp, (%rbx)
	jmp	.LBB0_97
.LBB0_83:
.Ltmp6:
	movq	%rax, %r14
	jmp	.LBB0_105
.LBB0_84:
.Ltmp71:
	jmp	.LBB0_86
.LBB0_85:
.Ltmp76:
.LBB0_86:
	movq	%rax, %r14
	cmpl	$0, (%rbx)
	jne	.LBB0_99
# %bb.87:
	movl	%ebp, (%rbx)
	jmp	.LBB0_99
.LBB0_88:
.Ltmp13:
	movq	%rax, %r14
	jmp	.LBB0_103
.LBB0_89:
.Ltmp55:
	jmp	.LBB0_92
.LBB0_90:
.Ltmp34:
	movq	%rax, %r14
	jmp	.LBB0_99
.LBB0_91:
.Ltmp42:
.LBB0_92:                               # %.body50
	movq	%rax, %r14
	jmp	.LBB0_95
.LBB0_93:
.Ltmp58:
	movq	%rax, %r14
	cmpl	$0, (%rbx)
	jne	.LBB0_95
# %bb.94:
	movl	%r12d, (%rbx)
.LBB0_95:                               # %.body50
	movq	40(%rsp), %rdi
	leaq	56(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_97
# %bb.96:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i67
	callq	_ZdlPv
.LBB0_97:                               # %.body44
	movq	8(%rsp), %rdi
	leaq	24(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_99
# %bb.98:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i70
	callq	_ZdlPv
.LBB0_99:                               # %.body
	movq	112(%rsp), %rdi
	leaq	128(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_101
# %bb.100:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i73
	callq	_ZdlPv
.LBB0_101:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit75
	movq	144(%rsp), %rdi
	leaq	160(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_103
# %bb.102:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i76
	callq	_ZdlPv
.LBB0_103:
	movq	72(%rsp), %rdi
	leaq	88(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_105
# %bb.104:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i79
	callq	_ZdlPv
.LBB0_105:
	leaq	176(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end0:
	.size	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, .Lfunc_end0-_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table0:
.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 .Ltmp6-.Lfunc_begin0           #     jumps to .Ltmp6
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp7-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp8-.Ltmp7                  #   Call between .Ltmp7 and .Ltmp8
	.uleb128 .Ltmp13-.Lfunc_begin0          #     jumps to .Ltmp13
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp14-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp33-.Ltmp14                #   Call between .Ltmp14 and .Ltmp33
	.uleb128 .Ltmp34-.Lfunc_begin0          #     jumps to .Ltmp34
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp35-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp36-.Ltmp35                #   Call between .Ltmp35 and .Ltmp36
	.uleb128 .Ltmp37-.Lfunc_begin0          #     jumps to .Ltmp37
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp38-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp39-.Ltmp38                #   Call between .Ltmp38 and .Ltmp39
	.uleb128 .Ltmp66-.Lfunc_begin0          #     jumps to .Ltmp66
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp40-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp41-.Ltmp40                #   Call between .Ltmp40 and .Ltmp41
	.uleb128 .Ltmp42-.Lfunc_begin0          #     jumps to .Ltmp42
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp45-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp54-.Ltmp45                #   Call between .Ltmp45 and .Ltmp54
	.uleb128 .Ltmp55-.Lfunc_begin0          #     jumps to .Ltmp55
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp56-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp44-.Ltmp56                #   Call between .Ltmp56 and .Ltmp44
	.uleb128 .Ltmp58-.Lfunc_begin0          #     jumps to .Ltmp58
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 10 <<
	.uleb128 .Ltmp12-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp12
	.uleb128 .Ltmp13-.Lfunc_begin0          #     jumps to .Ltmp13
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp2-.Lfunc_begin0           # >> Call Site 11 <<
	.uleb128 .Ltmp5-.Ltmp2                  #   Call between .Ltmp2 and .Ltmp5
	.uleb128 .Ltmp6-.Lfunc_begin0           #     jumps to .Ltmp6
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp74-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Ltmp73-.Ltmp74                #   Call between .Ltmp74 and .Ltmp73
	.uleb128 .Ltmp76-.Lfunc_begin0          #     jumps to .Ltmp76
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp69-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Ltmp68-.Ltmp69                #   Call between .Ltmp69 and .Ltmp68
	.uleb128 .Ltmp71-.Lfunc_begin0          #     jumps to .Ltmp71
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp64-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp65-.Ltmp64                #   Call between .Ltmp64 and .Ltmp65
	.uleb128 .Ltmp66-.Lfunc_begin0          #     jumps to .Ltmp66
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp59-.Lfunc_begin0          # >> Call Site 15 <<
	.uleb128 .Ltmp62-.Ltmp59                #   Call between .Ltmp59 and .Ltmp62
	.uleb128 .Ltmp63-.Lfunc_begin0          #     jumps to .Ltmp63
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp62-.Lfunc_begin0          # >> Call Site 16 <<
	.uleb128 .Lfunc_end0-.Ltmp62            #   Call between .Ltmp62 and .Lfunc_end0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE # -- Begin function _Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.type	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,@function
_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: # @_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %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	$568, %rsp                      # imm = 0x238
	.cfi_def_cfa_offset 624
	.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	%rcx, %r15
	movl	%edx, %ebp
                                        # kill: def $esi killed $esi def $rsi
	movq	%rsi, 8(%rsp)                   # 8-byte Spill
	movq	%rdi, 48(%rsp)                  # 8-byte Spill
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$25, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leaq	56(%rsp), %r12
	movq	%r12, %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev
.Ltmp77:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode
.Ltmp78:
# %bb.1:
	leaq	168(%rsp), %rdi
	callq	_ZNKSt12__basic_fileIcE7is_openEv
	testb	%al, %al
	je	.LBB1_2
# %bb.5:
.Ltmp83:
	leaq	56(%rsp), %rdi
	movl	$.L.str.10, %esi
	movl	$3, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp84:
# %bb.6:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit25
.Ltmp85:
	leaq	56(%rsp), %rdi
	movq	8(%rsp), %rsi                   # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	callq	_ZNSolsEi
.Ltmp86:
# %bb.7:
.Ltmp87:
	movq	%rax, %r15
	movl	$.L.str.11, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp88:
# %bb.8:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit26
.Ltmp89:
	movq	%r15, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp90:
# %bb.9:
.Ltmp91:
	movl	$.L.str.12, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp92:
# %bb.10:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit27
.Ltmp93:
	leaq	56(%rsp), %rdi
	movl	$.L.str.13, %esi
	movl	$4, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp94:
# %bb.11:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit28.preheader
	testl	%ebp, %ebp
	jle	.LBB1_22
# %bb.12:                               # %.preheader35.lr.ph
	movl	%ebp, %eax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movq	8(%rsp), %rax                   # 8-byte Reload
	movl	%eax, %r13d
	leal	(%rax,%rax,2), %eax
	movl	%eax, 28(%rsp)                  # 4-byte Spill
	xorl	%eax, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	leaq	56(%rsp), %r15
	xorl	%ecx, %ecx
.LBB1_13:                               # %.preheader35
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_15 Depth 2
                                        #       Child Loop BB1_16 Depth 3
	movq	%rcx, 40(%rsp)                  # 8-byte Spill
	cmpl	$0, 8(%rsp)                     # 4-byte Folded Reload
	jle	.LBB1_20
# %bb.14:                               # %.preheader.lr.ph
                                        #   in Loop: Header=BB1_13 Depth=1
	movq	16(%rsp), %rax                  # 8-byte Reload
	movl	%eax, %ebp
	xorl	%ebx, %ebx
.LBB1_15:                               # %.preheader
                                        #   Parent Loop BB1_13 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB1_16 Depth 3
	movl	%ebp, %eax
	movq	48(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %r12
	xorl	%r14d, %r14d
.LBB1_16:                               #   Parent Loop BB1_13 Depth=1
                                        #     Parent Loop BB1_15 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cvttss2si	(%r12,%r14,4), %esi
.Ltmp95:
	movq	%r15, %rdi
	callq	_ZNSolsEi
.Ltmp96:
# %bb.17:                               #   in Loop: Header=BB1_16 Depth=3
.Ltmp97:
	movl	$.L.str.11, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp98:
# %bb.18:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit30
                                        #   in Loop: Header=BB1_16 Depth=3
	incq	%r14
	cmpq	$3, %r14
	jne	.LBB1_16
# %bb.19:                               #   in Loop: Header=BB1_15 Depth=2
	incq	%rbx
	addl	$3, %ebp
	cmpq	%r13, %rbx
	jne	.LBB1_15
.LBB1_20:                               # %._crit_edge
                                        #   in Loop: Header=BB1_13 Depth=1
.Ltmp100:
	movl	$.L.str.12, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp101:
	movq	40(%rsp), %rcx                  # 8-byte Reload
# %bb.21:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit29
                                        #   in Loop: Header=BB1_13 Depth=1
	incq	%rcx
	movq	16(%rsp), %rax                  # 8-byte Reload
	addl	28(%rsp), %eax                  # 4-byte Folded Reload
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	cmpq	32(%rsp), %rcx                  # 8-byte Folded Reload
	jne	.LBB1_13
.LBB1_22:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit28._crit_edge
.Ltmp103:
	leaq	56(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp104:
# %bb.23:
.Ltmp105:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.14, %esi
	movl	$27, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp106:
# %bb.24:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit31
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp107:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp108:
# %bb.25:                               # %.noexc
.Ltmp109:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp110:
# %bb.26:                               # %.noexc33
.Ltmp111:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp112:
# %bb.27:                               # %_ZNSolsEPFRSoS_E.exit32
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	64(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 56(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	304(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	addq	$568, %rsp                      # imm = 0x238
	.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
.LBB1_2:
	.cfi_def_cfa_offset 624
.Ltmp79:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.9, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp80:
# %bb.3:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp81:
	movl	$_ZSt4cerr, %edi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp82:
# %bb.4:                                # %_ZNSolsEPFRSoS_E.exit
	movl	$1, %edi
	callq	exit
.LBB1_28:
.Ltmp113:
	jmp	.LBB1_29
.LBB1_31:
.Ltmp102:
	jmp	.LBB1_29
.LBB1_30:
.Ltmp99:
.LBB1_29:
	movq	%rax, %rbx
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	64(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 56(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	304(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, .Lfunc_end1-_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp77-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp77
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp77-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp94-.Ltmp77                #   Call between .Ltmp77 and .Ltmp94
	.uleb128 .Ltmp113-.Lfunc_begin1         #     jumps to .Ltmp113
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp95-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp98-.Ltmp95                #   Call between .Ltmp95 and .Ltmp98
	.uleb128 .Ltmp99-.Lfunc_begin1          #     jumps to .Ltmp99
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp100-.Lfunc_begin1         # >> Call Site 4 <<
	.uleb128 .Ltmp101-.Ltmp100              #   Call between .Ltmp100 and .Ltmp101
	.uleb128 .Ltmp102-.Lfunc_begin1         #     jumps to .Ltmp102
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp103-.Lfunc_begin1         # >> Call Site 5 <<
	.uleb128 .Ltmp82-.Ltmp103               #   Call between .Ltmp103 and .Ltmp82
	.uleb128 .Ltmp113-.Lfunc_begin1         #     jumps to .Ltmp113
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp82-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Lfunc_end1-.Ltmp82            #   Call between .Ltmp82 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
.LCPI2_0:
	.quad	0x3fcae147ae147ae1              # double 0.20999999999999999
.LCPI2_1:
	.quad	0x3fe70a3d70a3d70a              # double 0.71999999999999997
.LCPI2_2:
	.quad	0x3fb1eb851eb851ec              # double 0.070000000000000007
	.text
	.globl	_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.type	_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_,@function
_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_: # @_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
.Lfunc_begin2:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception2
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r14
	leaq	56(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	(%rdi), %rsi
	movq	8(%rdi), %rdx
	addq	%rsi, %rdx
	leaq	40(%rsp), %rbx
	movq	%rbx, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp114:
	leaq	4(%rsp), %rdi
	movq	%rsp, %rsi
	movq	%rbx, %rdx
	callq	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp115:
# %bb.1:
	movq	%rax, %rbx
	movq	40(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_3
# %bb.2:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB2_3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movl	4(%rsp), %r12d
	movl	(%rsp), %r13d
	movl	%r13d, %eax
	imull	%r12d, %eax
	leal	(%rax,%rax,2), %eax
	movslq	%eax, %rdi
	shlq	$2, %rdi
	callq	malloc
	testq	%rax, %rax
	je	.LBB2_12
# %bb.4:                                # %.preheader45
	movq	%rax, %r15
	testl	%r13d, %r13d
	jle	.LBB2_8
# %bb.5:                                # %.preheader.lr.ph
	leal	(%r12,%r12,2), %eax
	xorl	%ecx, %ecx
	movsd	.LCPI2_0(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	.LCPI2_1(%rip), %xmm1           # xmm1 = mem[0],zero
	movsd	.LCPI2_2(%rip), %xmm2           # xmm2 = mem[0],zero
	xorl	%edx, %edx
.LBB2_6:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_14 Depth 2
	movq	%r12, %rsi
	movl	%ecx, %edi
	testl	%r12d, %r12d
	jle	.LBB2_7
.LBB2_14:                               #   Parent Loop BB2_6 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%edi, %r8d
	leal	1(%rdi), %r9d
	leal	2(%rdi), %r10d
	xorps	%xmm3, %xmm3
	cvtss2sd	(%rbx,%r8,4), %xmm3
	mulsd	%xmm0, %xmm3
	xorps	%xmm4, %xmm4
	cvtss2sd	(%rbx,%r9,4), %xmm4
	mulsd	%xmm1, %xmm4
	addsd	%xmm3, %xmm4
	xorps	%xmm3, %xmm3
	cvtss2sd	(%rbx,%r10,4), %xmm3
	mulsd	%xmm2, %xmm3
	addsd	%xmm4, %xmm3
	cvtsd2ss	%xmm3, %xmm3
	movss	%xmm3, (%r15,%r8,4)
	movss	%xmm3, (%r15,%r9,4)
	movss	%xmm3, (%r15,%r10,4)
	addl	$3, %edi
	decq	%rsi
	jne	.LBB2_14
.LBB2_7:                                # %._crit_edge
                                        #   in Loop: Header=BB2_6 Depth=1
	incq	%rdx
	addl	%eax, %ecx
	cmpq	%r13, %rdx
	jne	.LBB2_6
.LBB2_8:                                # %._crit_edge48
	leaq	24(%rsp), %rbp
	movq	%rbp, -16(%rbp)
	movq	(%r14), %rsi
	movq	8(%r14), %rdx
	addq	%rsi, %rdx
	leaq	8(%rsp), %r14
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp117:
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	movq	%r14, %rcx
	callq	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp118:
# %bb.9:
	movq	8(%rsp), %rdi
	cmpq	%rbp, %rdi
	je	.LBB2_11
# %bb.10:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i39
	callq	_ZdlPv
.LBB2_11:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit41
	movq	%r15, %rdi
	callq	free
	movq	%rbx, %rdi
	callq	free
	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
.LBB2_12:
	.cfi_def_cfa_offset 128
	movl	$_ZSt4cout, %edi
	movl	$.L.str.15, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	movl	$1, %edi
	callq	exit
.LBB2_15:
.Ltmp119:
	movq	%rax, %rbx
	movq	8(%rsp), %rdi
	cmpq	%rbp, %rdi
	jne	.LBB2_16
	jmp	.LBB2_17
.LBB2_13:
.Ltmp116:
	movq	%rax, %rbx
	movq	40(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_17
.LBB2_16:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i42
	callq	_ZdlPv
.LBB2_17:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit38
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, .Lfunc_end2-_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception2:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end2-.Lcst_begin2
.Lcst_begin2:
	.uleb128 .Lfunc_begin2-.Lfunc_begin2    # >> Call Site 1 <<
	.uleb128 .Ltmp114-.Lfunc_begin2         #   Call between .Lfunc_begin2 and .Ltmp114
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp114-.Lfunc_begin2         # >> Call Site 2 <<
	.uleb128 .Ltmp115-.Ltmp114              #   Call between .Ltmp114 and .Ltmp115
	.uleb128 .Ltmp116-.Lfunc_begin2         #     jumps to .Ltmp116
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp115-.Lfunc_begin2         # >> Call Site 3 <<
	.uleb128 .Ltmp117-.Ltmp115              #   Call between .Ltmp115 and .Ltmp117
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp117-.Lfunc_begin2         # >> Call Site 4 <<
	.uleb128 .Ltmp118-.Ltmp117              #   Call between .Ltmp117 and .Ltmp118
	.uleb128 .Ltmp119-.Lfunc_begin2         #     jumps to .Ltmp119
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp118-.Lfunc_begin2         # >> Call Site 5 <<
	.uleb128 .Lfunc_end2-.Ltmp118           #   Call between .Ltmp118 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z32__device_stub__colorToGrayKernelPfS_ii # -- Begin function _Z32__device_stub__colorToGrayKernelPfS_ii
	.type	_Z32__device_stub__colorToGrayKernelPfS_ii,@function
_Z32__device_stub__colorToGrayKernelPfS_ii: # @_Z32__device_stub__colorToGrayKernelPfS_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z17colorToGrayKernelPfS_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z32__device_stub__colorToGrayKernelPfS_ii, .Lfunc_end3-_Z32__device_stub__colorToGrayKernelPfS_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z33__device_stub__gaussianBlurKernelPfS_iiS_i # -- Begin function _Z33__device_stub__gaussianBlurKernelPfS_iiS_i
	.type	_Z33__device_stub__gaussianBlurKernelPfS_iiS_i,@function
_Z33__device_stub__gaussianBlurKernelPfS_iiS_i: # @_Z33__device_stub__gaussianBlurKernelPfS_iiS_i
	.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	$_Z18gaussianBlurKernelPfS_iiS_i, %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_end4:
	.size	_Z33__device_stub__gaussianBlurKernelPfS_iiS_i, .Lfunc_end4-_Z33__device_stub__gaussianBlurKernelPfS_iiS_i
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
.LCPI5_0:
	.quad	0x3fb0000000000000              # double 0.0625
	.text
	.globl	_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.type	_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_,@function
_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_: # @_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
.Lfunc_begin3:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception3
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r14
	leaq	88(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	(%rdi), %rsi
	movq	8(%rdi), %rdx
	addq	%rsi, %rdx
	leaq	72(%rsp), %rbx
	movq	%rbx, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp120:
	leaq	20(%rsp), %rdi
	leaq	16(%rsp), %rsi
	movq	%rbx, %rdx
	callq	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	movq	%rax, 24(%rsp)                  # 8-byte Spill
.Ltmp121:
# %bb.1:
	movq	72(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB5_3
# %bb.2:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB5_3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movl	20(%rsp), %ebp
	movl	16(%rsp), %r12d
	movl	%ebp, %eax
	imull	%r12d, %eax
	shll	$2, %eax
	leal	(%rax,%rax,2), %eax
	movslq	%eax, %r13
	movq	%r13, %rdi
	callq	malloc
	testq	%rax, %rax
	je	.LBB5_4
# %bb.6:
	movq	%rax, %r15
	leaq	32(%rsp), %rbx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	movq	(%rbx), %rdi
	movq	24(%rsp), %rsi                  # 8-byte Reload
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	8(%rsp), %rbx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	movq	(%rbx), %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	cvtsi2sd	%ebp, %xmm0
	mulsd	.LCPI5_0(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %rbx
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r12d, %xmm0
	mulsd	.LCPI5_0(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %rdi
	movl	%ebx, %eax
	shlq	$32, %rdi
	orq	%rax, %rdi
	movabsq	$68719476752, %rdx              # imm = 0x1000000010
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_8
# %bb.7:
	movq	32(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	%ebp, %edx
	movl	%r12d, %ecx
	callq	_Z32__device_stub__colorToGrayKernelPfS_ii
.LBB5_8:
	movq	8(%rsp), %rsi
	movq	%r15, %rdi
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	leaq	56(%rsp), %r13
	movq	%r13, -16(%r13)
	movq	(%r14), %rsi
	movq	8(%r14), %rdx
	addq	%rsi, %rdx
	leaq	40(%rsp), %rbx
	movq	%rbx, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp123:
	movq	%r15, %rdi
	movl	%ebp, %esi
	movl	%r12d, %edx
	movq	%rbx, %rcx
	callq	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp124:
# %bb.9:
	movq	40(%rsp), %rdi
	cmpq	%r13, %rdi
	je	.LBB5_11
# %bb.10:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i26
	callq	_ZdlPv
.LBB5_11:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit28
	movq	%r15, %rdi
	callq	free
	movq	24(%rsp), %rdi                  # 8-byte Reload
	callq	free
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB5_4:
	.cfi_def_cfa_offset 160
	movl	$_ZSt4cout, %edi
	movl	$.L.str.16, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	movl	$1, %edi
	callq	exit
.LBB5_12:
.Ltmp125:
	movq	%rax, %rbx
	movq	40(%rsp), %rdi
	cmpq	%r13, %rdi
	jne	.LBB5_13
	jmp	.LBB5_14
.LBB5_5:
.Ltmp122:
	movq	%rax, %rbx
	movq	72(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB5_14
.LBB5_13:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i29
	callq	_ZdlPv
.LBB5_14:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit25
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end5:
	.size	_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, .Lfunc_end5-_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table5:
.Lexception3:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end3-.Lcst_begin3
.Lcst_begin3:
	.uleb128 .Lfunc_begin3-.Lfunc_begin3    # >> Call Site 1 <<
	.uleb128 .Ltmp120-.Lfunc_begin3         #   Call between .Lfunc_begin3 and .Ltmp120
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp120-.Lfunc_begin3         # >> Call Site 2 <<
	.uleb128 .Ltmp121-.Ltmp120              #   Call between .Ltmp120 and .Ltmp121
	.uleb128 .Ltmp122-.Lfunc_begin3         #     jumps to .Ltmp122
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp121-.Lfunc_begin3         # >> Call Site 3 <<
	.uleb128 .Ltmp123-.Ltmp121              #   Call between .Ltmp121 and .Ltmp123
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp123-.Lfunc_begin3         # >> Call Site 4 <<
	.uleb128 .Ltmp124-.Ltmp123              #   Call between .Ltmp123 and .Ltmp124
	.uleb128 .Ltmp125-.Lfunc_begin3         #     jumps to .Ltmp125
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp124-.Lfunc_begin3         # >> Call Site 5 <<
	.uleb128 .Lfunc_end5-.Ltmp124           #   Call between .Ltmp124 and .Lfunc_end5
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end3:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z18genGaussianBlurMatif
.LCPI6_0:
	.long	0x40c90fdb                      # float 6.28318548
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI6_1:
	.quad	0x3ff0000000000000              # double 1
	.text
	.globl	_Z18genGaussianBlurMatif
	.type	_Z18genGaussianBlurMatif,@function
_Z18genGaussianBlurMatif:               # @_Z18genGaussianBlurMatif
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movl	%edi, %ebp
	imull	%edi, %edi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, %rbx
	cmpl	$-1, %ebp
	jl	.LBB6_10
# %bb.1:                                # %.preheader49.lr.ph
	movl	%ebp, %eax
	shrl	$31, %eax
	movl	%ebp, 16(%rsp)                  # 4-byte Spill
	addl	%ebp, %eax
	sarl	%eax
	movl	%eax, %edi
	negl	%edi
	movss	.LCPI6_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	12(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	mulss	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	movsd	.LCPI6_1(%rip), %xmm2           # xmm2 = mem[0],zero
	divsd	%xmm0, %xmm2
	movaps	%xmm1, %xmm3
	addss	%xmm1, %xmm3
	mulss	%xmm1, %xmm3
	movl	%eax, %ecx
	negl	%ecx
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	cmovsl	%eax, %ecx
	movq	%rcx, 32(%rsp)                  # 8-byte Spill
	leal	1(%rcx), %r13d
	xorps	%xmm1, %xmm1
	xorl	%ebp, %ebp
	movl	%edi, %r14d
	movq	%rdi, 40(%rsp)                  # 8-byte Spill
	movsd	%xmm2, 48(%rsp)                 # 8-byte Spill
	movss	%xmm3, 20(%rsp)                 # 4-byte Spill
.LBB6_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_3 Depth 2
	movl	%r14d, %r12d
	imull	%r14d, %r12d
	movslq	%ebp, %rbp
	movl	%edi, %r15d
.LBB6_3:                                #   Parent Loop BB6_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	%xmm1, 12(%rsp)                 # 4-byte Spill
	movl	%r15d, %eax
	imull	%r15d, %eax
	addl	%r12d, %eax
	negl	%eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	divss	%xmm3, %xmm0
	callq	expf
	movss	20(%rsp), %xmm3                 # 4-byte Reload
                                        # xmm3 = mem[0],zero,zero,zero
	movsd	48(%rsp), %xmm2                 # 8-byte Reload
                                        # xmm2 = mem[0],zero
	movss	12(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	cvtss2sd	%xmm0, %xmm0
	mulsd	%xmm2, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%rbx,%rbp,4)
	addss	%xmm0, %xmm1
	incq	%rbp
	incl	%r15d
	cmpl	%r15d, %r13d
	jne	.LBB6_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB6_2 Depth=1
	leal	1(%r14), %eax
	cmpl	32(%rsp), %r14d                 # 4-byte Folded Reload
	movl	%eax, %r14d
	movq	40(%rsp), %rdi                  # 8-byte Reload
	jne	.LBB6_2
# %bb.5:                                # %.preheader48
	cmpl	$-1, 16(%rsp)                   # 4-byte Folded Reload
	jl	.LBB6_10
# %bb.6:                                # %.preheader.lr.ph
	movq	24(%rsp), %rcx                  # 8-byte Reload
	movl	%ecx, %eax
	negl	%eax
	cmovsl	%ecx, %eax
	addl	%eax, %ecx
	incl	%ecx
	xorl	%edx, %edx
.LBB6_7:                                # %.lr.ph63.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_8 Depth 2
	movslq	%edx, %rdx
	movl	%ecx, %esi
.LBB6_8:                                # %.lr.ph63
                                        #   Parent Loop BB6_7 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rbx,%rdx,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	divss	%xmm1, %xmm0
	movss	%xmm0, (%rbx,%rdx,4)
	incq	%rdx
	decl	%esi
	jne	.LBB6_8
# %bb.9:                                # %._crit_edge64
                                        #   in Loop: Header=BB6_7 Depth=1
	leal	1(%rdi), %esi
	cmpl	%eax, %edi
	movl	%esi, %edi
	jne	.LBB6_7
.LBB6_10:                               # %._crit_edge69
	movq	%rbx, %rax
	addq	$56, %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_end6:
	.size	_Z18genGaussianBlurMatif, .Lfunc_end6-_Z18genGaussianBlurMatif
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if
.LCPI7_0:
	.quad	0x3fb0000000000000              # double 0.0625
	.text
	.globl	_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if
	.type	_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if,@function
_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if: # @_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if
.Lfunc_begin4:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception4
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movss	%xmm0, 16(%rsp)                 # 4-byte Spill
	movl	%edx, %ebx
	movq	%rsi, %r12
	leaq	120(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	(%rdi), %rsi
	movq	8(%rdi), %rdx
	addq	%rsi, %rdx
	leaq	104(%rsp), %r14
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp126:
	leaq	44(%rsp), %rdi
	leaq	40(%rsp), %rsi
	movq	%r14, %rdx
	callq	_Z9readImagePiS_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp127:
# %bb.1:
	movq	%rax, %r13
	movq	104(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB7_3
# %bb.2:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB7_3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movq	%r12, 64(%rsp)                  # 8-byte Spill
	movl	44(%rsp), %eax
	movl	40(%rsp), %ecx
	movl	%eax, 36(%rsp)                  # 4-byte Spill
                                        # kill: def $eax killed $eax def $rax
	movl	%ecx, 12(%rsp)                  # 4-byte Spill
	imull	%ecx, %eax
	shll	$2, %eax
	leal	(%rax,%rax,2), %eax
	movslq	%eax, %r14
	movq	%r14, %rdi
	callq	malloc
	testq	%rax, %rax
	je	.LBB7_4
# %bb.6:
	movq	%rax, %r15
	orl	$1, %ebx
	movl	%ebx, %edi
	movss	16(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	callq	_Z18genGaussianBlurMatif
	movq	%rax, %rbp
	leaq	56(%rsp), %r12
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	(%r12), %rdi
	movq	%r13, 16(%rsp)                  # 8-byte Spill
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %r12
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	movq	(%r12), %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	%ebx, %r12d
	imull	%r12d, %r12d
	shlq	$2, %r12
	leaq	48(%rsp), %r13
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movq	(%r13), %rdi
	movq	%rbp, %r13
	movq	%rbp, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	36(%rsp), %ebp                  # 4-byte Reload
	xorps	%xmm0, %xmm0
	cvtsi2sd	%ebp, %xmm0
	mulsd	.LCPI7_0(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %r12
	xorps	%xmm0, %xmm0
	cvtsi2sdl	12(%rsp), %xmm0         # 4-byte Folded Reload
	mulsd	.LCPI7_0(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %rdi
	movl	%r12d, %eax
	shlq	$32, %rdi
	orq	%rax, %rdi
	movabsq	$68719476752, %rdx              # imm = 0x1000000010
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_8
# %bb.7:
	movq	56(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	48(%rsp), %r8
	movl	%ebp, %edx
	movl	12(%rsp), %ecx                  # 4-byte Reload
	movl	%ebx, %r9d
	callq	_Z33__device_stub__gaussianBlurKernelPfS_iiS_i
.LBB7_8:
	movq	24(%rsp), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	56(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	48(%rsp), %rdi
	callq	hipFree
	leaq	88(%rsp), %r14
	movq	%r14, -16(%r14)
	movq	64(%rsp), %rax                  # 8-byte Reload
	movq	(%rax), %rsi
	movq	8(%rax), %rdx
	addq	%rsi, %rdx
	leaq	72(%rsp), %rbx
	movq	%rbx, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp129:
	movq	%r15, %rdi
	movl	%ebp, %esi
	movl	12(%rsp), %edx                  # 4-byte Reload
	movq	%rbx, %rcx
	callq	_Z10writeImagePfiiNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp130:
# %bb.9:
	movq	72(%rsp), %rdi
	cmpq	%r14, %rdi
	movq	16(%rsp), %rbx                  # 8-byte Reload
	je	.LBB7_11
# %bb.10:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i38
	callq	_ZdlPv
.LBB7_11:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit40
	movq	%r15, %rdi
	callq	free
	movq	%rbx, %rdi
	callq	free
	movq	%r13, %rdi
	callq	free
	addq	$136, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB7_4:
	.cfi_def_cfa_offset 192
	movl	$_ZSt4cout, %edi
	movl	$.L.str.16, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	movl	$1, %edi
	callq	exit
.LBB7_12:
.Ltmp131:
	movq	%rax, %rbx
	movq	72(%rsp), %rdi
	cmpq	%r14, %rdi
	jne	.LBB7_13
	jmp	.LBB7_14
.LBB7_5:
.Ltmp128:
	movq	%rax, %rbx
	movq	104(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB7_14
.LBB7_13:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i41
	callq	_ZdlPv
.LBB7_14:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit37
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end7:
	.size	_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if, .Lfunc_end7-_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table7:
.Lexception4:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end4-.Lcst_begin4
.Lcst_begin4:
	.uleb128 .Lfunc_begin4-.Lfunc_begin4    # >> Call Site 1 <<
	.uleb128 .Ltmp126-.Lfunc_begin4         #   Call between .Lfunc_begin4 and .Ltmp126
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp126-.Lfunc_begin4         # >> Call Site 2 <<
	.uleb128 .Ltmp127-.Ltmp126              #   Call between .Ltmp126 and .Ltmp127
	.uleb128 .Ltmp128-.Lfunc_begin4         #     jumps to .Ltmp128
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp127-.Lfunc_begin4         # >> Call Site 3 <<
	.uleb128 .Ltmp129-.Ltmp127              #   Call between .Ltmp127 and .Ltmp129
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp129-.Lfunc_begin4         # >> Call Site 4 <<
	.uleb128 .Ltmp130-.Ltmp129              #   Call between .Ltmp129 and .Ltmp130
	.uleb128 .Ltmp131-.Lfunc_begin4         #     jumps to .Ltmp131
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp130-.Lfunc_begin4         # >> Call Site 5 <<
	.uleb128 .Lfunc_end7-.Ltmp130           #   Call between .Ltmp130 and .Lfunc_end7
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end4:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI8_0:
	.long	0x40e00000                      # float 7
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin5:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception5
# %bb.0:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	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	$424, %rsp                      # imm = 0x1A8
	.cfi_def_cfa_offset 480
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	24(%rsp), %r15
	movq	%r15, -16(%r15)
	leaq	8(%rsp), %rdi
	movl	$.L.str.17, %esi
	movl	$.L.str.17+19, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	leaq	152(%rsp), %r12
	movq	%r12, -16(%r12)
.Ltmp132:
	leaq	136(%rsp), %rdi
	movl	$.L.str.18, %esi
	movl	$.L.str.18+28, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp133:
# %bb.1:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit25
	leaq	88(%rsp), %r13
	movq	%r13, -16(%r13)
.Ltmp135:
	leaq	72(%rsp), %rdi
	movl	$.L.str.19, %esi
	movl	$.L.str.19+28, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp136:
# %bb.2:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit26
	leaq	56(%rsp), %rax
	movq	%rax, -16(%rax)
.Ltmp138:
	leaq	40(%rsp), %rdi
	movl	$.L.str.20, %esi
	movl	$.L.str.20+28, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp139:
# %bb.3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit27
	leaq	120(%rsp), %rbp
	movq	%rbp, -16(%rbp)
.Ltmp141:
	leaq	104(%rsp), %rdi
	movl	$.L.str.21, %esi
	movl	$.L.str.21+33, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp142:
# %bb.4:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit28
	leaq	408(%rsp), %rbx
	movq	%rbx, -16(%rbx)
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rdx
	addq	%rsi, %rdx
.Ltmp144:
	leaq	392(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp145:
# %bb.5:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_.exit
	leaq	376(%rsp), %r14
	movq	%r14, -16(%r14)
	movq	136(%rsp), %rsi
	movq	144(%rsp), %rdx
	addq	%rsi, %rdx
.Ltmp146:
	leaq	360(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp147:
# %bb.6:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_.exit29
.Ltmp149:
	leaq	392(%rsp), %rdi
	leaq	360(%rsp), %rsi
	callq	_Z14colorToGrayCPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
.Ltmp150:
# %bb.7:
	movq	360(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB8_9
# %bb.8:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB8_9:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movq	392(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	.LBB8_11
# %bb.10:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i30
	callq	_ZdlPv
.LBB8_11:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit32
	leaq	344(%rsp), %rbx
	movq	%rbx, -16(%rbx)
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rdx
	addq	%rsi, %rdx
.Ltmp152:
	leaq	328(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp153:
# %bb.12:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_.exit33
	leaq	312(%rsp), %r14
	movq	%r14, -16(%r14)
	movq	72(%rsp), %rsi
	movq	80(%rsp), %rdx
	addq	%rsi, %rdx
.Ltmp154:
	leaq	296(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp155:
# %bb.13:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_.exit34
.Ltmp157:
	leaq	328(%rsp), %rdi
	leaq	296(%rsp), %rsi
	callq	_Z14colorToGrayGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
.Ltmp158:
# %bb.14:
	movq	296(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB8_16
# %bb.15:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i35
	callq	_ZdlPv
.LBB8_16:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit37
	movq	328(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	.LBB8_18
# %bb.17:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i38
	callq	_ZdlPv
.LBB8_18:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit40
	leaq	280(%rsp), %rbx
	movq	%rbx, -16(%rbx)
	movq	8(%rsp), %rsi
	movq	16(%rsp), %rdx
	addq	%rsi, %rdx
.Ltmp160:
	leaq	264(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp161:
# %bb.19:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_.exit41
	leaq	248(%rsp), %r14
	movq	%r14, -16(%r14)
	movq	40(%rsp), %rsi
	movq	48(%rsp), %rdx
	addq	%rsi, %rdx
.Ltmp162:
	leaq	232(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp163:
# %bb.20:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_.exit42
.Ltmp165:
	leaq	264(%rsp), %rdi
	leaq	232(%rsp), %rsi
	movss	.LCPI8_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movl	$21, %edx
	callq	_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if
.Ltmp166:
# %bb.21:
	movq	232(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB8_23
# %bb.22:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i43
	callq	_ZdlPv
.LBB8_23:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit45
	movq	264(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	.LBB8_25
# %bb.24:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i46
	callq	_ZdlPv
.LBB8_25:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit48
	leaq	216(%rsp), %rbx
	movq	%rbx, -16(%rbx)
	movq	72(%rsp), %rsi
	movq	80(%rsp), %rdx
	addq	%rsi, %rdx
.Ltmp168:
	leaq	200(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp169:
# %bb.26:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_.exit49
	leaq	184(%rsp), %r14
	movq	%r14, -16(%r14)
	movq	104(%rsp), %rsi
	movq	112(%rsp), %rdx
	addq	%rsi, %rdx
.Ltmp171:
	leaq	168(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp172:
# %bb.27:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_.exit50
.Ltmp174:
	leaq	200(%rsp), %rdi
	leaq	168(%rsp), %rsi
	movss	.LCPI8_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movl	$21, %edx
	callq	_Z15gaussianBlurGPUNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_if
.Ltmp175:
# %bb.28:
	movq	168(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB8_30
# %bb.29:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i51
	callq	_ZdlPv
.LBB8_30:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit53
	movq	200(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	.LBB8_32
# %bb.31:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i54
	callq	_ZdlPv
.LBB8_32:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit56
	movq	104(%rsp), %rdi
	cmpq	%rbp, %rdi
	leaq	56(%rsp), %rbx
	je	.LBB8_34
# %bb.33:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i57
	callq	_ZdlPv
.LBB8_34:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit59
	movq	40(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	.LBB8_36
# %bb.35:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i60
	callq	_ZdlPv
.LBB8_36:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit62
	movq	72(%rsp), %rdi
	cmpq	%r13, %rdi
	je	.LBB8_38
# %bb.37:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i63
	callq	_ZdlPv
.LBB8_38:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit65
	movq	136(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB8_40
# %bb.39:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i66
	callq	_ZdlPv
.LBB8_40:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit68
	movq	8(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB8_42
# %bb.41:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i69
	callq	_ZdlPv
.LBB8_42:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit71
	xorl	%eax, %eax
	addq	$424, %rsp                      # imm = 0x1A8
	.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
.LBB8_61:
	.cfi_def_cfa_offset 480
.Ltmp176:
	movq	%rax, (%rsp)                    # 8-byte Spill
	movq	168(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB8_63
# %bb.62:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i90
	callq	_ZdlPv
	jmp	.LBB8_63
.LBB8_60:
.Ltmp173:
	movq	%rax, (%rsp)                    # 8-byte Spill
.LBB8_63:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit92
	movq	200(%rsp), %rdi
	jmp	.LBB8_64
.LBB8_57:
.Ltmp167:
	movq	%rax, (%rsp)                    # 8-byte Spill
	movq	232(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB8_59
# %bb.58:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i84
	callq	_ZdlPv
	jmp	.LBB8_59
.LBB8_56:
.Ltmp164:
	movq	%rax, (%rsp)                    # 8-byte Spill
.LBB8_59:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit86
	movq	264(%rsp), %rdi
	jmp	.LBB8_64
.LBB8_53:
.Ltmp159:
	movq	%rax, (%rsp)                    # 8-byte Spill
	movq	296(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB8_55
# %bb.54:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i78
	callq	_ZdlPv
	jmp	.LBB8_55
.LBB8_52:
.Ltmp156:
	movq	%rax, (%rsp)                    # 8-byte Spill
.LBB8_55:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit80
	movq	328(%rsp), %rdi
	jmp	.LBB8_64
.LBB8_49:
.Ltmp151:
	movq	%rax, (%rsp)                    # 8-byte Spill
	movq	360(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB8_51
# %bb.50:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i72
	callq	_ZdlPv
	jmp	.LBB8_51
.LBB8_48:
.Ltmp148:
	movq	%rax, (%rsp)                    # 8-byte Spill
.LBB8_51:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit74
	movq	392(%rsp), %rdi
.LBB8_64:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit92
	cmpq	%rbx, %rdi
	je	.LBB8_66
# %bb.65:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i93
	callq	_ZdlPv
	jmp	.LBB8_66
.LBB8_46:
.Ltmp143:
	movq	%rax, (%rsp)                    # 8-byte Spill
	jmp	.LBB8_68
.LBB8_45:
.Ltmp140:
	movq	%rax, (%rsp)                    # 8-byte Spill
	jmp	.LBB8_70
.LBB8_44:
.Ltmp137:
	movq	%rax, (%rsp)                    # 8-byte Spill
	jmp	.LBB8_72
.LBB8_43:
.Ltmp134:
	movq	%rax, (%rsp)                    # 8-byte Spill
	jmp	.LBB8_74
.LBB8_47:
.Ltmp170:
	movq	%rax, (%rsp)                    # 8-byte Spill
.LBB8_66:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit77
	movq	104(%rsp), %rdi
	cmpq	%rbp, %rdi
	je	.LBB8_68
# %bb.67:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i96
	callq	_ZdlPv
.LBB8_68:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit98
	movq	40(%rsp), %rdi
	leaq	56(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB8_70
# %bb.69:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i99
	callq	_ZdlPv
.LBB8_70:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit101
	movq	72(%rsp), %rdi
	cmpq	%r13, %rdi
	je	.LBB8_72
# %bb.71:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i102
	callq	_ZdlPv
.LBB8_72:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit104
	movq	136(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB8_74
# %bb.73:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i105
	callq	_ZdlPv
.LBB8_74:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit107
	movq	8(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB8_76
# %bb.75:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i108
	callq	_ZdlPv
.LBB8_76:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit110
	movq	(%rsp), %rdi                    # 8-byte Reload
	callq	_Unwind_Resume@PLT
.Lfunc_end8:
	.size	main, .Lfunc_end8-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table8:
.Lexception5:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end5-.Lcst_begin5
.Lcst_begin5:
	.uleb128 .Lfunc_begin5-.Lfunc_begin5    # >> Call Site 1 <<
	.uleb128 .Ltmp132-.Lfunc_begin5         #   Call between .Lfunc_begin5 and .Ltmp132
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp132-.Lfunc_begin5         # >> Call Site 2 <<
	.uleb128 .Ltmp133-.Ltmp132              #   Call between .Ltmp132 and .Ltmp133
	.uleb128 .Ltmp134-.Lfunc_begin5         #     jumps to .Ltmp134
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp135-.Lfunc_begin5         # >> Call Site 3 <<
	.uleb128 .Ltmp136-.Ltmp135              #   Call between .Ltmp135 and .Ltmp136
	.uleb128 .Ltmp137-.Lfunc_begin5         #     jumps to .Ltmp137
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp138-.Lfunc_begin5         # >> Call Site 4 <<
	.uleb128 .Ltmp139-.Ltmp138              #   Call between .Ltmp138 and .Ltmp139
	.uleb128 .Ltmp140-.Lfunc_begin5         #     jumps to .Ltmp140
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp141-.Lfunc_begin5         # >> Call Site 5 <<
	.uleb128 .Ltmp142-.Ltmp141              #   Call between .Ltmp141 and .Ltmp142
	.uleb128 .Ltmp143-.Lfunc_begin5         #     jumps to .Ltmp143
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp144-.Lfunc_begin5         # >> Call Site 6 <<
	.uleb128 .Ltmp145-.Ltmp144              #   Call between .Ltmp144 and .Ltmp145
	.uleb128 .Ltmp170-.Lfunc_begin5         #     jumps to .Ltmp170
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp146-.Lfunc_begin5         # >> Call Site 7 <<
	.uleb128 .Ltmp147-.Ltmp146              #   Call between .Ltmp146 and .Ltmp147
	.uleb128 .Ltmp148-.Lfunc_begin5         #     jumps to .Ltmp148
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp149-.Lfunc_begin5         # >> Call Site 8 <<
	.uleb128 .Ltmp150-.Ltmp149              #   Call between .Ltmp149 and .Ltmp150
	.uleb128 .Ltmp151-.Lfunc_begin5         #     jumps to .Ltmp151
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp152-.Lfunc_begin5         # >> Call Site 9 <<
	.uleb128 .Ltmp153-.Ltmp152              #   Call between .Ltmp152 and .Ltmp153
	.uleb128 .Ltmp170-.Lfunc_begin5         #     jumps to .Ltmp170
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp154-.Lfunc_begin5         # >> Call Site 10 <<
	.uleb128 .Ltmp155-.Ltmp154              #   Call between .Ltmp154 and .Ltmp155
	.uleb128 .Ltmp156-.Lfunc_begin5         #     jumps to .Ltmp156
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp157-.Lfunc_begin5         # >> Call Site 11 <<
	.uleb128 .Ltmp158-.Ltmp157              #   Call between .Ltmp157 and .Ltmp158
	.uleb128 .Ltmp159-.Lfunc_begin5         #     jumps to .Ltmp159
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp160-.Lfunc_begin5         # >> Call Site 12 <<
	.uleb128 .Ltmp161-.Ltmp160              #   Call between .Ltmp160 and .Ltmp161
	.uleb128 .Ltmp170-.Lfunc_begin5         #     jumps to .Ltmp170
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp162-.Lfunc_begin5         # >> Call Site 13 <<
	.uleb128 .Ltmp163-.Ltmp162              #   Call between .Ltmp162 and .Ltmp163
	.uleb128 .Ltmp164-.Lfunc_begin5         #     jumps to .Ltmp164
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp165-.Lfunc_begin5         # >> Call Site 14 <<
	.uleb128 .Ltmp166-.Ltmp165              #   Call between .Ltmp165 and .Ltmp166
	.uleb128 .Ltmp167-.Lfunc_begin5         #     jumps to .Ltmp167
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp168-.Lfunc_begin5         # >> Call Site 15 <<
	.uleb128 .Ltmp169-.Ltmp168              #   Call between .Ltmp168 and .Ltmp169
	.uleb128 .Ltmp170-.Lfunc_begin5         #     jumps to .Ltmp170
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp171-.Lfunc_begin5         # >> Call Site 16 <<
	.uleb128 .Ltmp172-.Ltmp171              #   Call between .Ltmp171 and .Ltmp172
	.uleb128 .Ltmp173-.Lfunc_begin5         #     jumps to .Ltmp173
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp174-.Lfunc_begin5         # >> Call Site 17 <<
	.uleb128 .Ltmp175-.Ltmp174              #   Call between .Ltmp174 and .Ltmp175
	.uleb128 .Ltmp176-.Lfunc_begin5         #     jumps to .Ltmp176
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp175-.Lfunc_begin5         # >> Call Site 18 <<
	.uleb128 .Lfunc_end8-.Ltmp175           #   Call between .Ltmp175 and .Lfunc_end8
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end5:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB9_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB9_3
.LBB9_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB9_3:
	testq	%r14, %r14
	je	.LBB9_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB9_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB9_7
.LBB9_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB9_7:                                # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag, .Lfunc_end9-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB10_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB10_3
.LBB10_1:                               # %._crit_edge
	movq	(%rbx), %rax
.LBB10_3:
	testq	%r14, %r14
	je	.LBB10_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB10_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB10_7
.LBB10_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB10_7:                               # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end10:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end10-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.text
	.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	.LBB11_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB11_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z17colorToGrayKernelPfS_ii, %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	$_Z18gaussianBlurKernelPfS_iiS_i, %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_end11:
	.size	__hip_module_ctor, .Lfunc_end11-__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	.LBB12_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
.LBB12_2:
	retq
.Lfunc_end12:
	.size	__hip_module_dtor, .Lfunc_end12-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Unable to open file."
	.size	.L.str, 21

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"The magic number is not P3 (The file is not an ASCII PPM file)."
	.size	.L.str.2, 64

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"The image dimension is "
	.size	.L.str.3, 24

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

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

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Malloc for vector in readImage(int* width, int* height, std::string path) fails."
	.size	.L.str.6, 81

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Finish reading image file."
	.size	.L.str.7, 27

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Start writing image file."
	.size	.L.str.8, 26

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Unable to write file."
	.size	.L.str.9, 22

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"P3\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	"255\n"
	.size	.L.str.13, 5

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Finish writing image file.\n"
	.size	.L.str.14, 28

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"Malloc for vector in colorToGrayCPU(std::string readPath, std::string writePath) fails."
	.size	.L.str.15, 88

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

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

	.type	.L.str.16,@object               # @.str.16
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.16:
	.asciz	"Malloc for vector in colorToGrayGPU(std::string readPath, std::string writePath) fails."
	.size	.L.str.16, 88

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"pineapple_pizza.ppm"
	.size	.L.str.17, 20

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"pineapple_pizza_gray_cpu.ppm"
	.size	.L.str.18, 29

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"pineapple_pizza_gray_gpu.ppm"
	.size	.L.str.19, 29

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"pineapple_pizza_blur_gpu.ppm"
	.size	.L.str.20, 29

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"pineapple_pizza_gray_blur_gpu.ppm"
	.size	.L.str.21, 34

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"stoi"
	.size	.L.str.22, 5

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"stof"
	.size	.L.str.23, 5

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z17colorToGrayKernelPfS_ii"
	.size	.L__unnamed_1, 28

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z18gaussianBlurKernelPfS_iiS_i"
	.size	.L__unnamed_2, 32

	.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 __gxx_personality_v0
	.addrsig_sym _Z32__device_stub__colorToGrayKernelPfS_ii
	.addrsig_sym _Z33__device_stub__gaussianBlurKernelPfS_iiS_i
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZSt4cerr
	.addrsig_sym _ZSt4cout
	.addrsig_sym _Z17colorToGrayKernelPfS_ii
	.addrsig_sym _Z18gaussianBlurKernelPfS_iiS_i
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z17colorToGrayKernelPfS_ii ; -- Begin function _Z17colorToGrayKernelPfS_ii
	.globl	_Z17colorToGrayKernelPfS_ii
	.p2align	8
	.type	_Z17colorToGrayKernelPfS_ii,@function
_Z17colorToGrayKernelPfS_ii:            ; @_Z17colorToGrayKernelPfS_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b64 s[4:5], s[0:1], 0x10
	v_bfe_u32 v2, v0, 10, 10
	v_and_b32_e32 v3, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[0:1], null, s15, s3, v[2:3]
	v_mad_u64_u32 v[1:2], null, s14, s2, v[3:4]
	v_cmp_gt_i32_e32 vcc_lo, s5, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e64 s2, s4, v1
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, v0, s4, v[1:2]
	s_load_b128 s[0:3], s[0:1], 0x0
	v_lshl_add_u32 v0, v2, 1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_lshlrev_b64 v[3:4], 2, v[0:1]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v3
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v4, vcc_lo
	s_mov_b32 s0, 0x70a3d70a
	s_mov_b32 s1, 0x3fe70a3d
	v_add_co_u32 v3, vcc_lo, s2, v3
	global_load_b96 v[0:2], v[0:1], off
	v_add_co_ci_u32_e32 v4, vcc_lo, s3, v4, vcc_lo
	s_waitcnt vmcnt(0)
	v_cvt_f64_f32_e32 v[5:6], v1
	v_cvt_f64_f32_e32 v[0:1], v0
	v_cvt_f64_f32_e32 v[7:8], v2
	s_delay_alu instid0(VALU_DEP_3)
	v_mul_f64 v[5:6], v[5:6], s[0:1]
	s_mov_b32 s0, 0xae147ae1
	s_mov_b32 s1, 0x3fcae147
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[0:1], v[0:1], s[0:1], v[5:6]
	s_mov_b32 s0, 0x1eb851ec
	s_mov_b32 s1, 0x3fb1eb85
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[0:1], v[7:8], s[0:1], v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f32_f64_e32 v0, v[0:1]
	v_mov_b32_e32 v1, v0
	v_mov_b32_e32 v2, v0
	global_store_b96 v[3:4], v[0:2], off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17colorToGrayKernelPfS_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z17colorToGrayKernelPfS_ii, .Lfunc_end0-_Z17colorToGrayKernelPfS_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 324
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z18gaussianBlurKernelPfS_iiS_i ; -- Begin function _Z18gaussianBlurKernelPfS_iiS_i
	.globl	_Z18gaussianBlurKernelPfS_iiS_i
	.p2align	8
	.type	_Z18gaussianBlurKernelPfS_iiS_i,@function
_Z18gaussianBlurKernelPfS_iiS_i:        ; @_Z18gaussianBlurKernelPfS_iiS_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b64 s[8:9], s[0:1], 0x10
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	v_mad_u64_u32 v[3:4], null, s15, s3, v[1:2]
	v_mad_u64_u32 v[4:5], null, s14, s2, v[0:1]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, s9, v3
	v_cmp_gt_i32_e64 s2, s8, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB1_8
; %bb.1:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x20
	s_load_b128 s[4:7], s[0:1], 0x0
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0
	v_mov_b32_e32 v2, 0
	s_mov_b32 s2, 0
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s3, -1
	s_cbranch_scc1 .LBB1_7
; %bb.2:                                ; %.preheader.lr.ph
	s_load_b64 s[0:1], s[0:1], 0x18
	s_lshr_b32 s10, s3, 31
	s_add_i32 s9, s9, -1
	s_add_i32 s3, s3, s10
	s_add_i32 s10, s8, -1
	v_cvt_f32_i32_e32 v1, s9
	v_cvt_f32_i32_e32 v2, s10
	s_ashr_i32 s3, s3, 1
	v_mov_b32_e32 v0, 0
	s_abs_i32 s9, s3
	v_subrev_nc_u32_e32 v5, s3, v4
	v_dual_max_f32 v7, v2, v2 :: v_dual_max_f32 v6, v1, v1
	v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v2, 0
	s_add_i32 s12, s3, s9
	s_sub_i32 s13, 0, s3
	s_add_i32 s12, s12, 1
.LBB1_3:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_4 Depth 2
	v_dual_mov_b32 v9, v5 :: v_dual_add_nc_u32 v8, s13, v3
	s_ashr_i32 s3, s2, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_lshl_b64 s[10:11], s[2:3], 2
	v_cvt_f32_i32_e32 v8, v8
	s_waitcnt lgkmcnt(0)
	s_add_u32 s10, s0, s10
	s_addc_u32 s11, s1, s11
	s_mov_b32 s3, s12
	v_minmax_f32 v8, v8, v6, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_i32_f32_e32 v8, v8
	v_mul_lo_u32 v8, v8, s8
.LBB1_4:                                ;   Parent Loop BB1_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_2)
	v_cvt_f32_i32_e32 v10, v9
	s_load_b32 s14, s[10:11], 0x0
	s_add_u32 s10, s10, 4
	s_addc_u32 s11, s11, 0
	s_add_i32 s3, s3, -1
	v_minmax_f32 v10, v10, v7, 0
	s_cmp_eq_u32 s3, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_i32_f32_e32 v10, v10
	v_add_nc_u32_e32 v10, v8, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshl_add_u32 v10, v10, 1, v10
	v_ashrrev_i32_e32 v11, 31, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[10:11], 2, v[10:11]
	v_add_co_u32 v10, vcc_lo, s4, v10
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v11, vcc_lo, s5, v11, vcc_lo
	global_load_b96 v[10:12], v[10:11], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_fmac_f32 v0, s14, v10 :: v_dual_add_nc_u32 v9, 1, v9
	v_dual_fmac_f32 v1, s14, v11 :: v_dual_fmac_f32 v2, s14, v12
	s_cbranch_scc0 .LBB1_4
; %bb.5:                                ; %._crit_edge
                                        ;   in Loop: Header=BB1_3 Depth=1
	s_add_i32 s2, s12, s2
	s_add_i32 s3, s13, 1
	s_cmp_eq_u32 s13, s9
	s_cbranch_scc1 .LBB1_7
; %bb.6:                                ;   in Loop: Header=BB1_3 Depth=1
	s_mov_b32 s13, s3
	s_branch .LBB1_3
.LBB1_7:                                ; %._crit_edge82
	v_mad_u64_u32 v[5:6], null, v3, s8, v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshl_add_u32 v3, v5, 1, v5
	v_ashrrev_i32_e32 v4, 31, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	v_add_co_u32 v3, vcc_lo, s6, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v4, vcc_lo
	global_store_b96 v[3:4], v[0:2], off
.LBB1_8:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z18gaussianBlurKernelPfS_iiS_i
		.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 13
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z18gaussianBlurKernelPfS_iiS_i, .Lfunc_end1-_Z18gaussianBlurKernelPfS_iiS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 512
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z17colorToGrayKernelPfS_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z17colorToGrayKernelPfS_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     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:           _Z18gaussianBlurKernelPfS_iiS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z18gaussianBlurKernelPfS_iiS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
