#include <string>
#include <stdio.h>
#include <fstream>
#include <sstream>
#include <iterator>
#include <iostream>
#include <chrono>
#include <ctime>
#include <cmath>
#include <cuda.h>
#include <iomanip>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>


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


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



//================== Definition =================================//
// Define Global variables
int width, height,temp_width, temp_height, conv_im_width,conv_im_height,kernel_size;

// Define struct to save RGB image
struct pixel{
    unsigned char red, green, blue;
};

//================== PPM file read function =====================//
pixel * read_ppmfile(const std::string filename){
    std::ifstream ppmFile;
    std::string buffer;
    std::string inputfilename = "../" + filename + ".ppm";

    //open file and save into stream
    ppmFile.open(inputfilename, std::ifstream::binary);
    if(ppmFile.fail()){
        std::cout << "Could not open the file!" << std::endl;
    }

    //check PPM header
    if(std::getline(ppmFile, buffer)){
        if(buffer != "P6"){
            std::cout << "invaild PPM file"<<std::endl;
        }
    }                          
    else{
        std::cout << "Cannot read the PPM type!" << std::endl;
    }

    //skip comments
    while(std::getline(ppmFile, buffer)){
        if(buffer[0] == '#')
            continue;
        else
            break;
    }

    //read image size
    std::stringstream iss;
    iss.str(buffer);
    iss>>width;
    iss>>height;

    //read maximum value in the PPM file
    int max_value;
    if(std::getline(ppmFile,buffer)){
        iss.clear();
        iss.str(buffer);
        iss>>max_value;
        if(max_value <= 0)
            std::cout << "Invaild maximum value!" << std::endl;
    }

    //read RGB of image
    pixel* image;

    //allocate space for RGB of image
    image = (pixel*)malloc(width * height * sizeof(pixel));

    //read RGB from stream into string

        //read from istream into string
        std::string ppm_rgb ((std::istreambuf_iterator<char>(ppmFile)), std::istreambuf_iterator<char>());

        //saving RGB value of pixels into RGB struct
        if(ppm_rgb.size() / 3 != height * width)
            std::cout << "Invaild pixel RGB number!" << std::endl;
        for(int i = 0; i < height * width; i ++){
            image[i].red = ppm_rgb[3*i];
            image[i].green = ppm_rgb[3*i + 1];
            image[i].blue = ppm_rgb[3*i + 2];
        }
    ppmFile.close();

    return image;
}

//================== PPM file output function =======================//
void write_ppmFile(pixel* image, std::string filename, int image_x, int image_y){
    std::ofstream PPMout;
    std::string outname = "../" + filename + ".ppm";
    PPMout.open(outname, std::ofstream::binary);
    PPMout << "P6" <<std::endl
           << "# File after convolution" << std::endl
           << image_x << " " << image_y << std::endl
           << "255" << std::endl;
    for(int i(0); i < image_x * image_y; i++){
        PPMout << image[i].red << image[i].green << image[i].blue;
    }
    PPMout.close();
}

//================= Guassian Kernel creating funciton ===============//
float * Gaussian_Kernel(int sigma){
    float const pi = 3.1415926;
    int k;
    k = 6 * sigma;
    if(k % 2 == 0) k++;
    kernel_size = k;
    float sum = 0;

    //allocate space for gaussian kernel
    float* K = (float*)malloc(k * sizeof(float));
    for(int i(0); i < k; i++){
        K[i] = exp(-(i - (k-1)/2)*(i - (k-1)/2)/(2 * sigma * sigma)) / sqrt(2 * sigma * sigma * pi);
        sum += K[i];
    }

    //nomalize kernel so that the brightness of image won't be changed
    for(int i(0); i < k; i++)
        K[i] = K[i] / sum;

    return K;
}

//=================== CPU - Applying Gaussian Kernel to image =======//
pixel * Gaussian_Blur(float * Kernel, pixel * image){
    temp_width = width - kernel_size + 1;
    temp_height = height;
    conv_im_width = temp_width;
    conv_im_height = height - kernel_size + 1;

    pixel* temp = (pixel*)malloc(temp_width * temp_height * sizeof(pixel));
    pixel* output = (pixel*)malloc(conv_im_width * conv_im_height * sizeof(pixel));
    // 2D Gaussian Blur can be separated into two 1D convolution horizontally and vertically

        // horizontal convolution
        // image height scan
        for(int i_height(0);i_height < temp_height; i_height++){
            //image width scan
            for(int i_width(0); i_width < temp_width; i_width++){
                float sum_red(0);
                float sum_green(0);
                float sum_blue(0);

                for(int k_width(0); k_width < kernel_size; k_width++){
                    sum_red += Kernel[k_width] * (int)image[i_height * width + i_width + k_width].red;
                    sum_green += Kernel[k_width] * (int)image[i_height * width + i_width + k_width].green;
                    sum_blue += Kernel[k_width] * (int)image[i_height * width + i_width + k_width].blue;
                }
                temp[i_height * temp_width + i_width].red = (unsigned char)(int)sum_red;
                temp[i_height * temp_width + i_width].green = (unsigned char)(int)sum_green;
                temp[i_height * temp_width + i_width].blue = (unsigned char)(int)sum_blue;

            }
        }
        //vertical convolution
        //image width scann
        for(int i_height(0); i_height < conv_im_height; i_height++){
            //image height scann
            for(int i_width(0); i_width < conv_im_width; i_width++){
                float sum_red(0);
                float sum_green(0);
                float sum_blue(0);
                for(int k_height(0); k_height < kernel_size; k_height ++){
                    sum_red += Kernel[k_height] * (int)temp[(i_height + k_height) * conv_im_width + i_width].red;
                    sum_green += Kernel[k_height] * (int)temp[(i_height + k_height) * conv_im_width + i_width].green;
                    sum_blue += Kernel[k_height] * (int)temp[(i_height + k_height) * conv_im_width + i_width].blue;
                }
                output[i_height * conv_im_width + i_width].red = (unsigned char)(int)sum_red;
                output[i_height * conv_im_width + i_width].green = (unsigned char)(int)sum_green;
                output[i_height * conv_im_width + i_width].blue = (unsigned char)(int)sum_blue;
            }
        }

    return output;
}

//============================= GPU Xdim Kernel =======================//
__global__
void Convolution_image_x(unsigned char * D_Input_Image, float * D_Kernel, unsigned char * D_Output_Image, size_t t_kernel_size, size_t t_width, size_t t_height){
    size_t i = blockIdx.x * blockDim.x + threadIdx.x;
    size_t j = blockIdx.y * blockDim.y + threadIdx.y;
    if(i >= t_width || j >= t_height) return;
    float sum[3] = {0};
    int k;
    for(k = 0; k < t_kernel_size; k++){
        sum[0] += D_Kernel[k] * (int)D_Input_Image[(j * (t_width + t_kernel_size - 1) + i + k) * 3];
        sum[1] += D_Kernel[k] * (int)D_Input_Image[(j * (t_width + t_kernel_size - 1) + i + k) * 3 + 1];
        sum[2] += D_Kernel[k] * (int)D_Input_Image[(j * (t_width + t_kernel_size - 1) + i + k) * 3 + 2];
    }
    D_Output_Image[(j * t_width + i) * 3] = (unsigned char)(int)sum[0];
    D_Output_Image[(j * t_width + i) * 3 + 1] = (unsigned char)(int)sum[1];
    D_Output_Image[(j * t_width + i) * 3 + 2] = (unsigned char)(int)sum[2];
}
//============================= GPU Ydim Kenrel =======================//
__global__
void Convolution_image_y(unsigned char * D_Input_Image, float * D_Kernel, unsigned char * D_Output_Image, size_t i_kernel_size, size_t i_width, size_t i_height){
    size_t i = blockIdx.x * blockDim.x + threadIdx.x;
    size_t j = blockIdx.y * blockDim.y + threadIdx.y;
    if(i >= i_width || j >= i_height) return;
    float sum[3] = {0};
    int k;
    for(k = 0; k < i_kernel_size; k++){
        sum[0] += D_Kernel[k] * (int)D_Input_Image[((j+k) * i_width  + i ) * 3];
        sum[1] += D_Kernel[k] * (int)D_Input_Image[((j+k) * i_width + i ) * 3 + 1];
        sum[2] += D_Kernel[k] * (int)D_Input_Image[((j+k) * i_width + i ) * 3 + 2];
    }
    D_Output_Image[(j * i_width + i) * 3] = (unsigned char)(int)sum[0];
    D_Output_Image[(j * i_width + i) * 3 + 1] = (unsigned char)(int)sum[1];
    D_Output_Image[(j * i_width + i) * 3 + 2] = (unsigned char)(int)sum[2];
}


//================= Main Fucntion ================================//
int main(int argc, char* argv[]){
    if(argc != 3)
        return 1;
    //std::string filename("..//hereford_512.ppm")
    std::string filename(argv[1]);
    int sigma = atoi(argv[2]);

    //CPU version
    //set begin timer
    auto t_start = std::chrono::high_resolution_clock::now();

    //begin compute
    pixel* input = read_ppmfile(filename);
    float* H_Kernel = Gaussian_Kernel(sigma);
    pixel* output = Gaussian_Blur(H_Kernel, input);
    write_ppmFile(output, filename + "_CPUOutput", conv_im_width, conv_im_height);

    //Set End Timer
    auto t_end = std::chrono::high_resolution_clock::now();

    std::cout << std::fixed << std::setprecision(2) << "CPU time used: "
              << std::chrono::duration<double, std::milli>(t_end - t_start).count() / 1000
              << "s\n";

    //GPU Version
    int dev = 0;
    cudaDeviceProp deviceProp;
    HANDLE_ERROR((cudaGetDeviceProperties(&deviceProp, dev)));
    //Set Begin Timer
    cudaEvent_t D_start, D_stop;
    cudaEventCreate(&D_start);
    cudaEventCreate(&D_stop);
    
    //Copy Data to a Device
    int Device_count(0);
    HANDLE_ERROR(cudaGetDeviceCount(&Device_count));
    if(Device_count < 1)
        std::cout<< "There is not enough device to run CUDA" << '\n';

    float* D_Kernel;
    unsigned char* D_Input_Image;
    unsigned char* D_Temp_Image;   
    unsigned char* D_Output_Image;
    unsigned char* H_Output_Image;
    unsigned char* H_Input_Image;
    
    //Copy Kernel from Host to Device
    HANDLE_ERROR(cudaMalloc(&D_Kernel, kernel_size * sizeof(float)));
    HANDLE_ERROR(cudaMemcpy(D_Kernel, H_Kernel, kernel_size * sizeof(float), cudaMemcpyHostToDevice));

    //Copy Original Image from Host to Device
    H_Input_Image = (unsigned char *)malloc( 3 * width * height * sizeof(unsigned char));
   
    for(int i = 0; i < width * height; i++){
        H_Input_Image[3 * i] = input[i].red;
        H_Input_Image[3 * i + 1] = input[i].green;
        H_Input_Image[3 * i + 2] = input[i].blue;
    }
    HANDLE_ERROR(cudaMalloc(&D_Input_Image, 3 * width * height * sizeof(unsigned char)));
    HANDLE_ERROR(cudaMemcpy(D_Input_Image, H_Input_Image, 3 * width * height, cudaMemcpyHostToDevice));
      
    //Allocate Space in Device for Images After X Convolution and Y Convolution 
    HANDLE_ERROR(cudaMalloc(&D_Temp_Image, 3 * temp_width * temp_height * sizeof(unsigned char)));
    HANDLE_ERROR(cudaMalloc(&D_Output_Image, 3 * conv_im_width * conv_im_height * sizeof(unsigned char)));

    //Run Kernel
    HANDLE_ERROR(cudaEventRecord(D_start));
    dim3 threads(sqrt(deviceProp.maxThreadsDim[0]), sqrt(deviceProp.maxThreadsDim[0]));
    dim3 blocks(width/threads.x + 1, height/threads.y + 1);
    Convolution_image_x<<<blocks, threads>>>(D_Input_Image, D_Kernel, D_Temp_Image, kernel_size, temp_width, temp_height);
    Convolution_image_y<<<blocks, threads>>>(D_Temp_Image, D_Kernel, D_Output_Image, kernel_size, conv_im_width, conv_im_height);
    HANDLE_ERROR(cudaEventRecord(D_stop));
    HANDLE_ERROR(cudaEventSynchronize(D_stop));
    
    //Copy Image from Device to Host
    H_Output_Image = (unsigned char*)malloc(3 * conv_im_height * conv_im_width * sizeof(unsigned char));
    HANDLE_ERROR(cudaMemcpy(H_Output_Image, D_Output_Image, 3 * conv_im_width * conv_im_height, cudaMemcpyDeviceToHost));


    //Export the image into file temp_width * temp_height conv_im_height * conv_im_height;
    pixel* H_output_GPU = (pixel*)malloc(conv_im_width * conv_im_height * sizeof(pixel));

    for(int i = 0; i < conv_im_width * conv_im_height; i++){
        H_output_GPU[i].red = H_Output_Image[3 * i];
        H_output_GPU[i].green = H_Output_Image[3 * i + 1];
        H_output_GPU[i].blue = H_Output_Image[3 * i + 2];
    }
    write_ppmFile(H_output_GPU, filename + "_GPUOutput" , conv_im_width, conv_im_height);
    //Set End Timer
    float milliseconds = 0;
    HANDLE_ERROR(cudaEventElapsedTime(&milliseconds, D_start, D_stop));
    HANDLE_ERROR(cudaEventDestroy(D_start));
    HANDLE_ERROR(cudaEventDestroy(D_stop));

    std::cout <<  std::fixed << std::setprecision(2) << "GPU time used: "
                  << milliseconds / 1000 << "s\n"
                  << "Generate Successfully." << '\n';
    
    free(input);
    free(H_Kernel);
    free(output);
    free(H_output_GPU);
    free(H_Output_Image);
    free(H_Kernel);
    HANDLE_ERROR(cudaFree(D_Kernel));
    HANDLE_ERROR(cudaFree(D_Input_Image));
    HANDLE_ERROR(cudaFree(D_Output_Image));
    HANDLE_ERROR(cudaFree(D_Temp_Image));
 
    return 0;
}
	.file	"tmpxft_002741af_00000000-6_main.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.section	.text._ZSt5fixedRSt8ios_base,"axG",@progbits,_ZSt5fixedRSt8ios_base,comdat
	.weak	_ZSt5fixedRSt8ios_base
	.type	_ZSt5fixedRSt8ios_base, @function
_ZSt5fixedRSt8ios_base:
.LFB3285:
	.cfi_startproc
	endbr64
	movl	24(%rdi), %edx
	movq	%rdi, %rax
	andl	$-261, %edx
	orl	$4, %edx
	movl	%edx, 24(%rdi)
	ret
	.cfi_endproc
.LFE3285:
	.size	_ZSt5fixedRSt8ios_base, .-_ZSt5fixedRSt8ios_base
	.text
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4134:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4134:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"in"
.LC1:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/Sonic-Wu/GPU_Computing/master/GaussianBlur/main.cu"
.LC2:
	.string	"at line"
	.text
	.type	_ZL11HandleError9cudaErrorPKci.constprop.0, @function
_ZL11HandleError9cudaErrorPKci.constprop.0:
.LFB5023:
	.cfi_startproc
	testl	%edi, %edi
	je	.L3
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%esi, %ebx
	call	cudaGetErrorString@PLT
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %esi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 8
	movq	%rax, %rdi
	jmp	_ZNSolsEi@PLT
.L3:
	ret
	.cfi_endproc
.LFE5023:
	.size	_ZL11HandleError9cudaErrorPKci.constprop.0, .-_ZL11HandleError9cudaErrorPKci.constprop.0
	.align 2
	.type	_ZNSt15basic_streambufIcSt11char_traitsIcEE6sbumpcEv.isra.0, @function
_ZNSt15basic_streambufIcSt11char_traitsIcEE6sbumpcEv.isra.0:
.LFB5025:
	.cfi_startproc
	movq	16(%rdi), %rax
	cmpq	24(%rdi), %rax
	jnb	.L10
	incq	%rax
	movq	%rax, 16(%rdi)
	ret
.L10:
	movq	(%rdi), %rax
	jmp	*80(%rax)
	.cfi_endproc
.LFE5025:
	.size	_ZNSt15basic_streambufIcSt11char_traitsIcEE6sbumpcEv.isra.0, .-_ZNSt15basic_streambufIcSt11char_traitsIcEE6sbumpcEv.isra.0
	.section	.rodata.str1.1
.LC3:
	.string	"basic_string::append"
	.text
	.align 2
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0:
.LFB5027:
	.cfi_startproc
	movabsq	$4611686018427387903, %rax
	subq	8(%rdi), %rax
	cmpq	%rdx, %rax
	jnb	.L14
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	.LC3(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L14:
	.cfi_def_cfa_offset 8
	jmp	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKcm@PLT
	.cfi_endproc
.LFE5027:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0
	.globl	_Z15Gaussian_Kerneli
	.type	_Z15Gaussian_Kerneli, @function
_Z15Gaussian_Kerneli:
.LFB4126:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	imull	$6, %edi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leal	1(%r14), %ebp
	sarl	%r14d
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edi, %ebx
	movslq	%ebp, %rdi
	imull	%ebx, %ebx
	salq	$2, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%ebp, kernel_size(%rip)
	call	malloc@PLT
	addl	%ebx, %ebx
	xorps	%xmm2, %xmm2
	movq	%rax, %r12
.L19:
	cmpl	%r13d, %ebp
	jle	.L24
	movl	%r13d, %edx
	movl	%r14d, %eax
	movss	%xmm2, 12(%rsp)
	subl	%r13d, %eax
	subl	%r14d, %edx
	imull	%edx, %eax
	cltd
	idivl	%ebx
	cvtsi2sdl	%eax, %xmm0
	call	exp@PLT
	movsd	%xmm0, (%rsp)
	cvtsi2ssl	%ebx, %xmm0
	mulss	.LC5(%rip), %xmm0
	call	sqrtf@PLT
	movsd	(%rsp), %xmm1
	movss	12(%rsp), %xmm2
	cvtss2sd	%xmm0, %xmm0
	divsd	%xmm0, %xmm1
	cvtsd2ss	%xmm1, %xmm0
	movss	%xmm0, (%r12,%r13,4)
	addss	%xmm0, %xmm2
	incq	%r13
	jmp	.L19
.L24:
	xorl	%eax, %eax
.L21:
	cmpl	%eax, %ebp
	jle	.L25
	movss	(%r12,%rax,4), %xmm0
	divss	%xmm2, %xmm0
	movss	%xmm0, (%r12,%rax,4)
	incq	%rax
	jmp	.L21
.L25:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%r12, %rax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4126:
	.size	_Z15Gaussian_Kerneli, .-_Z15Gaussian_Kerneli
	.globl	_Z13Gaussian_BlurPfP5pixel
	.type	_Z13Gaussian_BlurPfP5pixel, @function
_Z13Gaussian_BlurPfP5pixel:
.LFB4127:
	.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
	movq	%rdi, %r13
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	width(%rip), %r15d
	movl	kernel_size(%rip), %r12d
	movl	height(%rip), %r14d
	movq	%rsi, 24(%rsp)
	movl	%r15d, %eax
	subl	%r12d, %eax
	movl	%r14d, %ebp
	movl	%r14d, temp_height(%rip)
	leal	1(%rax), %ebx
	subl	%r12d, %ebp
	movl	%eax, 12(%rsp)
	movl	%ebx, %edi
	incl	%ebp
	movl	%ebx, temp_width(%rip)
	imull	%r14d, %edi
	movl	%ebx, conv_im_width(%rip)
	movl	%ebp, conv_im_height(%rip)
	movslq	%edi, %rdi
	leaq	(%rdi,%rdi,2), %rdi
	call	malloc@PLT
	movl	%ebx, %edi
	imull	%ebp, %edi
	movq	%rax, 16(%rsp)
	movslq	%edi, %rdi
	leaq	(%rdi,%rdi,2), %rdi
	call	malloc@PLT
	xorl	%r10d, %r10d
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	movq	%rax, %rcx
.L27:
	cmpl	%r9d, %r14d
	jg	.L31
	movslq	12(%rsp), %r9
	movq	16(%rsp), %r10
	xorl	%r11d, %r11d
	xorl	%r14d, %r14d
	incq	%r9
	leaq	(%r9,%r9,2), %r9
	jmp	.L32
.L31:
	movq	16(%rsp), %rax
	movslq	%r8d, %rdx
	xorl	%esi, %esi
	leaq	(%rdx,%rdx,2), %rdx
	addq	%rax, %rdx
.L33:
	cmpl	%esi, %ebx
	jle	.L29
	leal	(%rsi,%r10), %eax
	movq	24(%rsp), %rdi
	xorps	%xmm2, %xmm2
	cltq
	movaps	%xmm2, %xmm1
	movaps	%xmm2, %xmm0
	leaq	(%rax,%rax,2), %rax
	addq	%rdi, %rax
	xorl	%edi, %edi
.L30:
	cmpl	%edi, %r12d
	jle	.L40
	movzbl	(%rax), %r11d
	movss	0(%r13,%rdi,4), %xmm4
	addq	$3, %rax
	incq	%rdi
	cvtsi2ssl	%r11d, %xmm3
	movzbl	-2(%rax), %r11d
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm0
	cvtsi2ssl	%r11d, %xmm3
	movzbl	-1(%rax), %r11d
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm1
	cvtsi2ssl	%r11d, %xmm3
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm2
	jmp	.L30
.L40:
	cvttss2sil	%xmm0, %eax
	incl	%esi
	addq	$3, %rdx
	movb	%al, -3(%rdx)
	cvttss2sil	%xmm1, %eax
	movb	%al, -2(%rdx)
	cvttss2sil	%xmm2, %eax
	movb	%al, -1(%rdx)
	jmp	.L33
.L29:
	incl	%r9d
	addl	%ebx, %r8d
	addl	%r15d, %r10d
	jmp	.L27
.L41:
	incl	%r14d
	addq	%r9, %r10
	addl	%ebx, %r11d
.L32:
	cmpl	%r14d, %ebp
	jle	.L26
	movslq	%r11d, %rax
	movq	%r10, %r8
	xorl	%edi, %edi
	leaq	(%rax,%rax,2), %rax
	addq	%rcx, %rax
.L37:
	cmpl	%edi, %ebx
	jle	.L41
	xorps	%xmm0, %xmm0
	movq	%r8, %rdx
	xorl	%esi, %esi
	movaps	%xmm0, %xmm1
	movaps	%xmm0, %xmm2
.L35:
	cmpl	%esi, %r12d
	jle	.L42
	movzbl	(%rdx), %r15d
	movss	0(%r13,%rsi,4), %xmm4
	incq	%rsi
	cvtsi2ssl	%r15d, %xmm3
	movzbl	1(%rdx), %r15d
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm2
	cvtsi2ssl	%r15d, %xmm3
	movzbl	2(%rdx), %r15d
	addq	%r9, %rdx
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm1
	cvtsi2ssl	%r15d, %xmm3
	mulss	%xmm4, %xmm3
	addss	%xmm3, %xmm0
	jmp	.L35
.L42:
	cvttss2sil	%xmm2, %edx
	incl	%edi
	addq	$3, %rax
	addq	$3, %r8
	movb	%dl, -3(%rax)
	cvttss2sil	%xmm1, %edx
	movb	%dl, -2(%rax)
	cvttss2sil	%xmm0, %edx
	movb	%dl, -1(%rax)
	jmp	.L37
.L26:
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	movq	%rcx, %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
.LFE4127:
	.size	_Z13Gaussian_BlurPfP5pixel, .-_Z13Gaussian_BlurPfP5pixel
	.globl	_Z46__device_stub__Z19Convolution_image_xPhPfS_mmmPhPfS_mmm
	.type	_Z46__device_stub__Z19Convolution_image_xPhPfS_mmmPhPfS_mmm, @function
_Z46__device_stub__Z19Convolution_image_xPhPfS_mmmPhPfS_mmm:
.LFB4156:
	.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
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%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	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%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	.L43
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z19Convolution_image_xPhPfS_mmm(%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
.L43:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4156:
	.size	_Z46__device_stub__Z19Convolution_image_xPhPfS_mmmPhPfS_mmm, .-_Z46__device_stub__Z19Convolution_image_xPhPfS_mmmPhPfS_mmm
	.globl	_Z19Convolution_image_xPhPfS_mmm
	.type	_Z19Convolution_image_xPhPfS_mmm, @function
_Z19Convolution_image_xPhPfS_mmm:
.LFB4157:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z19Convolution_image_xPhPfS_mmmPhPfS_mmm
	.cfi_endproc
.LFE4157:
	.size	_Z19Convolution_image_xPhPfS_mmm, .-_Z19Convolution_image_xPhPfS_mmm
	.globl	_Z46__device_stub__Z19Convolution_image_yPhPfS_mmmPhPfS_mmm
	.type	_Z46__device_stub__Z19Convolution_image_yPhPfS_mmmPhPfS_mmm, @function
_Z46__device_stub__Z19Convolution_image_yPhPfS_mmmPhPfS_mmm:
.LFB4158:
	.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
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%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	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%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	.L48
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z19Convolution_image_yPhPfS_mmm(%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
.L48:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4158:
	.size	_Z46__device_stub__Z19Convolution_image_yPhPfS_mmmPhPfS_mmm, .-_Z46__device_stub__Z19Convolution_image_yPhPfS_mmmPhPfS_mmm
	.globl	_Z19Convolution_image_yPhPfS_mmm
	.type	_Z19Convolution_image_yPhPfS_mmm, @function
_Z19Convolution_image_yPhPfS_mmm:
.LFB4159:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z19Convolution_image_yPhPfS_mmmPhPfS_mmm
	.cfi_endproc
.LFE4159:
	.size	_Z19Convolution_image_yPhPfS_mmm, .-_Z19Convolution_image_yPhPfS_mmm
	.section	.rodata.str1.1
.LC6:
	.string	"_Z19Convolution_image_yPhPfS_mmm"
.LC7:
	.string	"_Z19Convolution_image_xPhPfS_mmm"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4161:
	.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	.LC6(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z19Convolution_image_yPhPfS_mmm(%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	.LC7(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z19Convolution_image_xPhPfS_mmm(%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
.LFE4161:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_,"axG",@progbits,_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_,comdat
	.weak	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_
	.type	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_, @function
_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_:
.LFB4515:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4515
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	8(%rdx), %r13
	movq	(%rdx), %r14
	call	strlen@PLT
	movb	$0, 16(%rbx)
	movq	%rbx, %rdi
	movq	%rax, %r12
	leaq	16(%rbx), %rax
	movq	%rax, (%rbx)
	xorl	%eax, %eax
	leaq	0(%r13,%r12), %rsi
	movq	%rax, 8(%rbx)
.LEHB0:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm@PLT
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0
	movq	%r13, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0
.LEHE0:
	movq	%rbx, %rax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L58:
	.cfi_restore_state
	endbr64
	movq	%rax, %rbp
.L57:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
.LEHB1:
	call	_Unwind_Resume@PLT
.LEHE1:
	.cfi_endproc
.LFE4515:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_,"aG",@progbits,_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_,comdat
.LLSDA4515:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4515-.LLSDACSB4515
.LLSDACSB4515:
	.uleb128 .LEHB0-.LFB4515
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L58-.LFB4515
	.uleb128 0
	.uleb128 .LEHB1-.LFB4515
	.uleb128 .LEHE1-.LEHB1
	.uleb128 0
	.uleb128 0
.LLSDACSE4515:
	.section	.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_,"axG",@progbits,_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_,comdat
	.size	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_, .-_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_
	.section	.rodata.str1.1
.LC8:
	.string	"../"
.LC9:
	.string	".ppm"
.LC10:
	.string	"P6"
.LC11:
	.string	"# File after convolution"
.LC12:
	.string	" "
.LC13:
	.string	"255"
	.text
	.globl	_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii
	.type	_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii, @function
_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii:
.LFB4125:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4125
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edx, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%ecx, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	subq	$600, %rsp
	.cfi_def_cfa_offset 656
	movq	%fs:40, %rax
	movq	%rax, 584(%rsp)
	xorl	%eax, %eax
	leaq	72(%rsp), %rbp
	leaq	40(%rsp), %r13
	movq	%rbp, %rdi
.LEHB2:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE2:
	movq	%r12, %rdx
	leaq	.LC8(%rip), %rsi
	movq	%r13, %rdi
.LEHB3:
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_
.LEHE3:
	leaq	.LC9(%rip), %rsi
	movq	%r13, %rdi
.LEHB4:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc@PLT
.LEHE4:
	leaq	8(%rsp), %r12
	movq	%rax, %rsi
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_@PLT
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rsi
	leaq	80(%rsp), %rdi
	movl	$20, %edx
.LEHB5:
	call	_ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	movq	72(%rsp), %rdx
	movq	-24(%rdx), %rdi
	addq	%rbp, %rdi
	testq	%rax, %rax
	jne	.L62
	movl	$4, %esi
	call	_ZNSt9basic_iosIcSt11char_traitsIcEE8setstateESt12_Ios_Iostate@PLT
	jmp	.L63
.L62:
	xorl	%esi, %esi
	call	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate@PLT
.L63:
	leaq	.LC10(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@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@PLT
	movq	%rax, %rdi
	movl	%r15d, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r14d, %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	%rax, %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	imull	%r14d, %r15d
	xorl	%r13d, %r13d
.L64:
	cmpl	%r13d, %r15d
	jle	.L77
	movsbl	(%rbx), %esi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movsbl	1(%rbx), %esi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movsbl	2(%rbx), %esi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	incl	%r13d
	addq	$3, %rbx
	jmp	.L64
.L77:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE5:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	584(%rsp), %rax
	subq	%fs:40, %rax
	je	.L70
	jmp	.L74
.L71:
	endbr64
	movq	%rax, %rbx
.L66:
	movq	%r13, %rdi
	jmp	.L76
.L73:
	endbr64
	movq	%rax, %rbx
.L68:
	movq	%r12, %rdi
.L76:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L67
.L72:
	endbr64
	movq	%rax, %rbx
.L67:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	584(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L74
	movq	%rbx, %rdi
.LEHB6:
	call	_Unwind_Resume@PLT
.LEHE6:
.L74:
	call	__stack_chk_fail@PLT
.L70:
	addq	$600, %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
.LFE4125:
	.section	.gcc_except_table,"a",@progbits
.LLSDA4125:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4125-.LLSDACSB4125
.LLSDACSB4125:
	.uleb128 .LEHB2-.LFB4125
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB3-.LFB4125
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L72-.LFB4125
	.uleb128 0
	.uleb128 .LEHB4-.LFB4125
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L71-.LFB4125
	.uleb128 0
	.uleb128 .LEHB5-.LFB4125
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L73-.LFB4125
	.uleb128 0
	.uleb128 .LEHB6-.LFB4125
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE4125:
	.text
	.size	_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii, .-_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii
	.section	.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_,"axG",@progbits,_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_,comdat
	.weak	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_
	.type	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_, @function
_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_:
.LFB4564:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4564
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
	movq	%rdx, %rdi
	call	strlen@PLT
	movq	8(%r13), %r14
	movq	0(%r13), %r13
	movq	%rbx, %rdi
	movq	%rax, %r12
	leaq	16(%rbx), %rax
	movb	$0, 16(%rbx)
	movq	%rax, (%rbx)
	xorl	%eax, %eax
	leaq	(%r12,%r14), %rsi
	movq	%rax, 8(%rbx)
.LEHB7:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm@PLT
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0
.LEHE7:
	movq	%rbx, %rax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L81:
	.cfi_restore_state
	endbr64
	movq	%rax, %rbp
.L80:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
.LEHB8:
	call	_Unwind_Resume@PLT
.LEHE8:
	.cfi_endproc
.LFE4564:
	.section	.gcc_except_table
.LLSDA4564:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4564-.LLSDACSB4564
.LLSDACSB4564:
	.uleb128 .LEHB7-.LFB4564
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L81-.LFB4564
	.uleb128 0
	.uleb128 .LEHB8-.LFB4564
	.uleb128 .LEHE8-.LEHB8
	.uleb128 0
	.uleb128 0
.LLSDACSE4564:
	.section	.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_,"axG",@progbits,_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_,comdat
	.size	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_, .-_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_
	.section	.text._ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv,"axG",@progbits,_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv,comdat
	.align 2
	.weak	_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv
	.type	_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv, @function
_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv:
.LFB4964:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	8(%rdi), %eax
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	cmpl	$-1, %eax
	jne	.L84
	testq	%rdi, %rdi
	je	.L84
	call	_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv@PLT
	cmpl	$-1, %eax
	jne	.L84
	xorl	%edx, %edx
	movq	%rdx, (%rbx)
.L84:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4964:
	.size	_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv, .-_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv
	.section	.rodata.str1.1
.LC14:
	.string	"Could not open the file!"
.LC15:
	.string	"invaild PPM file"
.LC16:
	.string	"Cannot read the PPM type!"
.LC17:
	.string	"Invaild maximum value!"
.LC18:
	.string	"Invaild pixel RGB number!"
	.text
	.globl	_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.type	_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, @function
_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
.LFB4123:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4123
	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
	movq	%rdi, %rbx
	subq	$1128, %rsp
	.cfi_def_cfa_offset 1184
	movq	%fs:40, %rax
	movq	%rax, 1112(%rsp)
	xorl	%eax, %eax
	leaq	592(%rsp), %rbp
	movq	%rbp, %rdi
.LEHB9:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE9:
	leaq	120(%rsp), %rax
	xorl	%esi, %esi
	movq	%rbx, %rdx
	movq	%rax, 104(%rsp)
	leaq	200(%rsp), %rax
	movq	%rax, (%rsp)
	movq	(%rsp), %rdi
	leaq	104(%rsp), %rax
	movq	%rsi, 112(%rsp)
	leaq	.LC8(%rip), %rsi
	movb	$0, 120(%rsp)
	movq	%rax, 8(%rsp)
.LEHB10:
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_
.LEHE10:
	movq	(%rsp), %rdi
	leaq	.LC9(%rip), %rsi
.LEHB11:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc@PLT
.LEHE11:
	movq	%rax, %rsi
	leaq	136(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_@PLT
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	136(%rsp), %rsi
	movl	$12, %edx
	leaq	608(%rsp), %rdi
.LEHB12:
	call	_ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	movq	592(%rsp), %rdx
	movq	-24(%rdx), %rdi
	addq	%rbp, %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:
	testb	$5, 880(%rsp)
	je	.L97
	leaq	.LC14(%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@PLT
.L97:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L98
	cmpq	$2, 112(%rsp)
	jne	.L99
	movq	104(%rsp), %rdi
	movl	$2, %edx
	leaq	.LC10(%rip), %rsi
	call	memcmp@PLT
	testl	%eax, %eax
	je	.L101
.L99:
	leaq	.LC15(%rip), %rsi
	jmp	.L142
.L98:
	leaq	.LC16(%rip), %rsi
.L142:
	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@PLT
	jmp	.L101
.L144:
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L102
	movq	104(%rsp), %rax
	cmpb	$35, (%rax)
	jne	.L102
.L101:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	jmp	.L144
.L102:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev@PLT
.LEHE12:
	leaq	224(%rsp), %rbx
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
.LEHB13:
	call	_ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEE3strERKNS_12basic_stringIcS2_S3_EE@PLT
	movq	(%rsp), %rdi
	leaq	width(%rip), %rsi
	call	_ZNSirsERi@PLT
	movq	(%rsp), %rdi
	leaq	height(%rip), %rsi
	call	_ZNSirsERi@PLT
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L104
	leaq	328(%rsp), %rdi
	xorl	%esi, %esi
	call	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate@PLT
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEE3strERKNS_12basic_stringIcS2_S3_EE@PLT
	movq	(%rsp), %rdi
	leaq	60(%rsp), %rsi
	call	_ZNSirsERi@PLT
	cmpl	$0, 60(%rsp)
	jg	.L104
	leaq	.LC17(%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@PLT
.L104:
	movl	width(%rip), %edi
	imull	height(%rip), %edi
	xorl	%ebx, %ebx
	movslq	%edi, %rdi
	leaq	(%rdi,%rdi,2), %rdi
	call	malloc@PLT
	leaq	184(%rsp), %rdx
	xorl	%ecx, %ecx
	movl	$-1, 80(%rsp)
	movq	%rax, %r12
	movq	592(%rsp), %rax
	movq	%rcx, 88(%rsp)
	movl	$-1, 96(%rsp)
	movq	-24(%rax), %rax
	movq	%rdx, 168(%rsp)
	xorl	%edx, %edx
	movq	%rdx, 176(%rsp)
	movq	824(%rsp,%rax), %rax
	movq	$15, 64(%rsp)
	movq	%rax, 72(%rsp)
	leaq	72(%rsp), %rax
	movq	%rax, 16(%rsp)
.L108:
	movq	16(%rsp), %rdi
	call	_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv
	incl	%eax
	leaq	88(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 32(%rsp)
	sete	%r13b
	call	_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv
	incl	%eax
	sete	%al
	cmpb	%al, %r13b
	jne	.L105
.L107:
	leaq	64(%rsp), %r15
	jmp	.L106
.L105:
	cmpq	64(%rsp), %rbx
	jnb	.L107
	movq	16(%rsp), %rdi
	call	_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv
	movq	72(%rsp), %rdi
	incq	%rbx
	movb	%al, 183(%rsp,%rbx)
	call	_ZNSt15basic_streambufIcSt11char_traitsIcEE6sbumpcEv.isra.0
.LEHE13:
	movl	$-1, 80(%rsp)
	jmp	.L108
.L147:
	movq	32(%rsp), %rdi
	incl	%eax
	sete	%r13b
.LEHB14:
	call	_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv
	incl	%eax
	sete	%al
	cmpb	%al, %r13b
	je	.L145
	cmpq	%rbx, 64(%rsp)
	leaq	1(%rbx), %r13
	je	.L146
.L109:
	movq	16(%rsp), %rdi
	call	_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv
	movq	168(%rsp), %rdx
	movq	72(%rsp), %rdi
	movb	%al, (%rdx,%rbx)
	call	_ZNSt15basic_streambufIcSt11char_traitsIcEE6sbumpcEv.isra.0
	movl	$-1, 80(%rsp)
	movq	%r13, %rbx
.L106:
	movq	16(%rsp), %rdi
	call	_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv
	jmp	.L147
.L146:
	leaq	168(%rsp), %r14
	movq	%rbx, %rdx
	movq	%r15, %rsi
	movq	%r13, 64(%rsp)
	movq	%r14, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
.LEHE14:
	movq	168(%rsp), %rsi
	movq	%rax, %rdi
	movq	%rbx, %rdx
	movq	%rax, 40(%rsp)
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_S_copyEPcPKcm@PLT
	movq	%r14, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	40(%rsp), %rax
	movq	%rax, 168(%rsp)
	movq	64(%rsp), %rax
	movq	%rax, 184(%rsp)
	jmp	.L109
.L145:
	movq	168(%rsp), %rax
	movq	%rbx, 176(%rsp)
	movl	$3, %ecx
	xorl	%edx, %edx
	movb	$0, (%rax,%rbx)
	movq	176(%rsp), %rax
	divq	%rcx
	movl	height(%rip), %edx
	imull	width(%rip), %edx
	movslq	%edx, %rdx
	cmpq	%rdx, %rax
	je	.L112
	jmp	.L148
.L128:
	endbr64
	jmp	.L143
.L148:
	leaq	.LC18(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
.LEHB15:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
.L112:
	movl	height(%rip), %ecx
	imull	width(%rip), %ecx
	xorl	%eax, %eax
	xorl	%edx, %edx
	movq	168(%rsp), %rsi
.L115:
	cmpl	%edx, %ecx
	jle	.L149
	movb	(%rsi,%rax), %dil
	incl	%edx
	movb	%dil, (%r12,%rax)
	movb	1(%rsi,%rax), %dil
	movb	%dil, 1(%r12,%rax)
	movb	2(%rsi,%rax), %dil
	movb	%dil, 2(%r12,%rax)
	addq	$3, %rax
	jmp	.L115
.L149:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE15:
	leaq	168(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	movq	24(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	1112(%rsp), %rax
	subq	%fs:40, %rax
	je	.L122
	jmp	.L136
.L123:
	endbr64
	movq	%rax, %rbx
.L117:
	movq	(%rsp), %rdi
	jmp	.L140
.L127:
	endbr64
.L143:
	movq	%rax, %rbx
.L119:
	leaq	168(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L114
.L126:
	endbr64
	movq	%rax, %rbx
.L114:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	jmp	.L120
.L125:
	endbr64
	movq	%rax, %rbx
.L120:
	movq	24(%rsp), %rdi
.L140:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L118
.L124:
	endbr64
	movq	%rax, %rbx
.L118:
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	1112(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L136
	movq	%rbx, %rdi
.LEHB16:
	call	_Unwind_Resume@PLT
.LEHE16:
.L136:
	call	__stack_chk_fail@PLT
.L122:
	addq	$1128, %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
.LFE4123:
	.section	.gcc_except_table
.LLSDA4123:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4123-.LLSDACSB4123
.LLSDACSB4123:
	.uleb128 .LEHB9-.LFB4123
	.uleb128 .LEHE9-.LEHB9
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB10-.LFB4123
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L124-.LFB4123
	.uleb128 0
	.uleb128 .LEHB11-.LFB4123
	.uleb128 .LEHE11-.LEHB11
	.uleb128 .L123-.LFB4123
	.uleb128 0
	.uleb128 .LEHB12-.LFB4123
	.uleb128 .LEHE12-.LEHB12
	.uleb128 .L125-.LFB4123
	.uleb128 0
	.uleb128 .LEHB13-.LFB4123
	.uleb128 .LEHE13-.LEHB13
	.uleb128 .L126-.LFB4123
	.uleb128 0
	.uleb128 .LEHB14-.LFB4123
	.uleb128 .LEHE14-.LEHB14
	.uleb128 .L128-.LFB4123
	.uleb128 0
	.uleb128 .LEHB15-.LFB4123
	.uleb128 .LEHE15-.LEHB15
	.uleb128 .L127-.LFB4123
	.uleb128 0
	.uleb128 .LEHB16-.LFB4123
	.uleb128 .LEHE16-.LEHB16
	.uleb128 0
	.uleb128 0
.LLSDACSE4123:
	.text
	.size	_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, .-_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.section	.rodata.str1.1
.LC19:
	.string	"basic_string: construction from null is not valid"
.LC20:
	.string	"_CPUOutput"
.LC21:
	.string	"CPU time used: "
.LC24:
	.string	"s\n"
.LC25:
	.string	"There is not enough device to run CUDA"
.LC26:
	.string	"_GPUOutput"
.LC27:
	.string	"GPU time used: "
.LC29:
	.string	"Generate Successfully."
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4128:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4128
	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
	subq	$1240, %rsp
	.cfi_def_cfa_offset 1296
	movq	%fs:40, %rax
	movq	%rax, 1224(%rsp)
	xorl	%eax, %eax
	movl	$1, %eax
	cmpl	$3, %edi
	jne	.L150
	leaq	128(%rsp), %rax
	movq	8(%rsi), %rbp
	movq	%rsi, %rbx
	movq	%rax, 8(%rsp)
	leaq	144(%rsp), %rax
	movq	%rax, 128(%rsp)
	testq	%rbp, %rbp
	jne	.L152
	movq	1224(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L185
	leaq	.LC19(%rip), %rdi
.LEHB17:
	call	_ZSt19__throw_logic_errorPKc@PLT
.L152:
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rax, 112(%rsp)
	leaq	0(%rbp,%rax), %r12
	cmpq	$15, %rax
	jbe	.L154
	movq	8(%rsp), %rdi
	leaq	112(%rsp), %rsi
	xorl	%edx, %edx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
.LEHE17:
	movq	%rax, 128(%rsp)
	movq	112(%rsp), %rax
	movq	%rax, 144(%rsp)
.L154:
	movq	128(%rsp), %rdi
	movq	%rbp, %rsi
	movq	%r12, %rdx
	leaq	192(%rsp), %r15
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	112(%rsp), %rax
	movq	128(%rsp), %rdx
	movq	%rax, 136(%rsp)
	movb	$0, (%rdx,%rax)
	movq	16(%rbx), %rdi
	call	atoi@PLT
	movl	%eax, %ebx
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	8(%rsp), %rsi
	movq	%r15, %rdi
	movq	%rax, %rbp
.LEHB18:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE18:
	movq	%r15, %rdi
.LEHB19:
	call	_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.LEHE19:
	movq	%r15, %rdi
	movq	%rax, %r12
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movl	%ebx, %edi
	call	_Z15Gaussian_Kerneli
	movq	%r12, %rsi
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	call	_Z13Gaussian_BlurPfP5pixel
	movq	8(%rsp), %rsi
	movq	%r15, %rdi
	leaq	.LC20(%rip), %rdx
	movq	%rax, 16(%rsp)
	movl	conv_im_height(%rip), %r14d
	movl	conv_im_width(%rip), %ebx
.LEHB20:
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_
.LEHE20:
	movq	16(%rsp), %rdi
	movl	%r14d, %ecx
	movl	%ebx, %edx
	movq	%r15, %rsi
.LEHB21:
	call	_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii
.LEHE21:
	movq	%r15, %rdi
	leaq	_ZSt4cout(%rip), %r14
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	leaq	_ZSt5fixedRSt8ios_base(%rip), %rsi
	movq	%r14, %rdi
	movq	%rax, %rbx
.LEHB22:
	call	_ZNSolsEPFRSt8ios_baseS0_E@PLT
	movq	%rax, %rdi
	movq	(%rax), %rax
	leaq	.LC21(%rip), %rsi
	movq	-24(%rax), %rax
	movq	$2, 8(%rdi,%rax)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	subq	%rbp, %rbx
	movq	%rax, %rdi
	cvtsi2sdq	%rbx, %xmm0
	divsd	.LC22(%rip), %xmm0
	divsd	.LC23(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC24(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movl	%eax, %edi
	movl	$261, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	leaq	48(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	56(%rsp), %rdi
	call	cudaEventCreate@PLT
	xorl	%eax, %eax
	leaq	40(%rsp), %rdi
	movl	%eax, 40(%rsp)
	call	cudaGetDeviceCount@PLT
	movl	%eax, %edi
	movl	$269, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	cmpl	$0, 40(%rsp)
	jle	.L155
.L157:
	movslq	kernel_size(%rip), %rsi
	leaq	64(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$281, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	jmp	.L187
.L155:
	leaq	.LC25(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	jmp	.L157
.L187:
	movslq	kernel_size(%rip), %rdx
	movq	(%rsp), %rsi
	movl	$1, %ecx
	movq	64(%rsp), %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$282, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movl	width(%rip), %r14d
	imull	height(%rip), %r14d
	leal	(%r14,%r14,2), %ebp
	movslq	%ebp, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	xorl	%edx, %edx
	movq	%rax, %rbx
	xorl	%eax, %eax
.L158:
	cmpl	%edx, %r14d
	jle	.L188
	movb	(%r12,%rax), %cl
	incl	%edx
	movb	%cl, (%rbx,%rax)
	movb	1(%r12,%rax), %cl
	movb	%cl, 1(%rbx,%rax)
	movb	2(%r12,%rax), %cl
	movb	%cl, 2(%rbx,%rax)
	addq	$3, %rax
	jmp	.L158
.L188:
	leaq	72(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$292, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movl	width(%rip), %edx
	movq	72(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	imull	height(%rip), %edx
	leal	(%rdx,%rdx,2), %edx
	movslq	%edx, %rdx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$293, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movl	temp_width(%rip), %esi
	imull	temp_height(%rip), %esi
	leaq	80(%rsp), %rdi
	leal	(%rsi,%rsi,2), %esi
	movslq	%esi, %rsi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$296, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movl	conv_im_width(%rip), %esi
	imull	conv_im_height(%rip), %esi
	leaq	88(%rsp), %rdi
	leal	(%rsi,%rsi,2), %esi
	movslq	%esi, %rsi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$297, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	48(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	%eax, %edi
	movl	$300, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	cvtsi2sdl	516(%rsp), %xmm1
	movaps	%xmm1, %xmm0
	movq	%xmm1, %rbp
	call	sqrt@PLT
	cvttsd2siq	%xmm0, %r14
	movq	%rbp, %xmm0
	call	sqrt@PLT
	movl	height(%rip), %eax
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	cvttsd2siq	%xmm0, %rsi
	xorl	%r8d, %r8d
	movl	$1, 108(%rsp)
	movl	$1, 120(%rsp)
	divl	%r14d
	movl	%r14d, 104(%rsp)
	movl	%esi, 100(%rsp)
	xorl	%edx, %edx
	leal	1(%rax), %ecx
	movl	width(%rip), %eax
	movl	%ecx, 116(%rsp)
	movl	$1, %ecx
	divl	%esi
	movq	100(%rsp), %rdx
	movl	$1, %esi
	incl	%eax
	movl	%eax, 112(%rsp)
	movq	112(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L160
.L162:
	movl	108(%rsp), %ecx
	movq	100(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	112(%rsp), %rdi
	movl	120(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L163
	jmp	.L165
.L160:
	movslq	kernel_size(%rip), %rcx
	movslq	temp_height(%rip), %r9
	movslq	temp_width(%rip), %r8
	movq	80(%rsp), %rdx
	movq	64(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z46__device_stub__Z19Convolution_image_xPhPfS_mmmPhPfS_mmm
	jmp	.L162
.L163:
	movslq	kernel_size(%rip), %rcx
	movslq	conv_im_height(%rip), %r9
	movslq	conv_im_width(%rip), %r8
	movq	88(%rsp), %rdx
	movq	64(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z46__device_stub__Z19Convolution_image_yPhPfS_mmmPhPfS_mmm
.L165:
	movq	56(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	%eax, %edi
	movl	$305, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	56(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movl	%eax, %edi
	movl	$306, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movl	conv_im_height(%rip), %ebp
	imull	conv_im_width(%rip), %ebp
	leal	0(%rbp,%rbp,2), %ebp
	movslq	%ebp, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	88(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbp, %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$310, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movl	conv_im_width(%rip), %r14d
	movl	conv_im_height(%rip), %r15d
	movl	%r14d, %r13d
	imull	%r15d, %r13d
	movslq	%r13d, %rdi
	leaq	(%rdi,%rdi,2), %rdi
	call	malloc@PLT
	xorl	%edx, %edx
	movq	%rax, %rbp
	xorl	%eax, %eax
.L166:
	cmpl	%edx, %r13d
	jle	.L189
	movb	(%rbx,%rax), %sil
	incl	%edx
	movb	%sil, 0(%rbp,%rax)
	movb	1(%rbx,%rax), %sil
	movb	%sil, 1(%rbp,%rax)
	movb	2(%rbx,%rax), %sil
	movb	%sil, 2(%rbp,%rax)
	addq	$3, %rax
	jmp	.L166
.L189:
	leaq	160(%rsp), %rax
	leaq	.LC26(%rip), %rdx
	movq	%rax, %r13
	leaq	128(%rsp), %rax
	movq	%rax, %rsi
	movq	%r13, %rdi
	movq	%rax, 24(%rsp)
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_
.LEHE22:
	movl	%r15d, %ecx
	movl	%r14d, %edx
	movq	%r13, %rsi
	movq	%rbp, %rdi
.LEHB23:
	call	_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii
.LEHE23:
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rsi
	leaq	44(%rsp), %rdi
	movl	$0x00000000, 44(%rsp)
.LEHB24:
	call	cudaEventElapsedTime@PLT
	movl	%eax, %edi
	movl	$324, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	48(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movl	%eax, %edi
	movl	$325, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	56(%rsp), %rdi
	call	cudaEventDestroy@PLT
	movl	%eax, %edi
	movl	$326, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	leaq	_ZSt5fixedRSt8ios_base(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEPFRSt8ios_baseS0_E@PLT
	movq	%rax, %rdi
	movq	(%rax), %rax
	leaq	.LC27(%rip), %rsi
	movq	-24(%rax), %rax
	movq	$2, 8(%rdi,%rax)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movss	44(%rsp), %xmm0
	divss	.LC28(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC24(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC29(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	(%rsp), %rdi
	call	free@PLT
	movq	16(%rsp), %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	(%rsp), %rdi
	call	free@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %edi
	movl	$338, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %edi
	movl	$339, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %edi
	movl	$340, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %edi
	movl	$341, %esi
	call	_ZL11HandleError9cudaErrorPKci.constprop.0
.LEHE24:
	movq	24(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	xorl	%eax, %eax
	jmp	.L150
.L175:
	endbr64
	jmp	.L186
.L177:
	endbr64
.L186:
	movq	%rax, %rbx
.L170:
	movq	%r15, %rdi
	jmp	.L183
.L178:
	endbr64
	movq	%rax, %rbx
.L171:
	movq	%r13, %rdi
.L183:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L169
.L176:
	endbr64
	movq	%rax, %rbx
.L169:
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	1224(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L185
	movq	%rbx, %rdi
.LEHB25:
	call	_Unwind_Resume@PLT
.LEHE25:
.L150:
	movq	1224(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L173
.L185:
	call	__stack_chk_fail@PLT
.L173:
	addq	$1240, %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
.LFE4128:
	.section	.gcc_except_table
.LLSDA4128:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4128-.LLSDACSB4128
.LLSDACSB4128:
	.uleb128 .LEHB17-.LFB4128
	.uleb128 .LEHE17-.LEHB17
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB18-.LFB4128
	.uleb128 .LEHE18-.LEHB18
	.uleb128 .L176-.LFB4128
	.uleb128 0
	.uleb128 .LEHB19-.LFB4128
	.uleb128 .LEHE19-.LEHB19
	.uleb128 .L175-.LFB4128
	.uleb128 0
	.uleb128 .LEHB20-.LFB4128
	.uleb128 .LEHE20-.LEHB20
	.uleb128 .L176-.LFB4128
	.uleb128 0
	.uleb128 .LEHB21-.LFB4128
	.uleb128 .LEHE21-.LEHB21
	.uleb128 .L177-.LFB4128
	.uleb128 0
	.uleb128 .LEHB22-.LFB4128
	.uleb128 .LEHE22-.LEHB22
	.uleb128 .L176-.LFB4128
	.uleb128 0
	.uleb128 .LEHB23-.LFB4128
	.uleb128 .LEHE23-.LEHB23
	.uleb128 .L178-.LFB4128
	.uleb128 0
	.uleb128 .LEHB24-.LFB4128
	.uleb128 .LEHE24-.LEHB24
	.uleb128 .L176-.LFB4128
	.uleb128 0
	.uleb128 .LEHB25-.LFB4128
	.uleb128 .LEHE25-.LEHB25
	.uleb128 0
	.uleb128 0
.LLSDACSE4128:
	.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
	.globl	kernel_size
	.bss
	.align 4
	.type	kernel_size, @object
	.size	kernel_size, 4
kernel_size:
	.zero	4
	.globl	conv_im_height
	.align 4
	.type	conv_im_height, @object
	.size	conv_im_height, 4
conv_im_height:
	.zero	4
	.globl	conv_im_width
	.align 4
	.type	conv_im_width, @object
	.size	conv_im_width, 4
conv_im_width:
	.zero	4
	.globl	temp_height
	.align 4
	.type	temp_height, @object
	.size	temp_height, 4
temp_height:
	.zero	4
	.globl	temp_width
	.align 4
	.type	temp_width, @object
	.size	temp_width, 4
temp_width:
	.zero	4
	.globl	height
	.align 4
	.type	height, @object
	.size	height, 4
height:
	.zero	4
	.globl	width
	.align 4
	.type	width, @object
	.size	width, 4
width:
	.zero	4
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC5:
	.long	1078530010
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC22:
	.long	0
	.long	1093567616
	.align 8
.LC23:
	.long	0
	.long	1083129856
	.section	.rodata.cst4
	.align 4
.LC28:
	.long	1148846080
	.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 <string>
#include <stdio.h>
#include <fstream>
#include <sstream>
#include <iterator>
#include <iostream>
#include <chrono>
#include <ctime>
#include <cmath>
#include <hip/hip_runtime.h>
#include <iomanip>




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


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



//================== Definition =================================//
// Define Global variables
int width, height,temp_width, temp_height, conv_im_width,conv_im_height,kernel_size;

// Define struct to save RGB image
struct pixel{
    unsigned char red, green, blue;
};

//================== PPM file read function =====================//
pixel * read_ppmfile(const std::string filename){
    std::ifstream ppmFile;
    std::string buffer;
    std::string inputfilename = "../" + filename + ".ppm";

    //open file and save into stream
    ppmFile.open(inputfilename, std::ifstream::binary);
    if(ppmFile.fail()){
        std::cout << "Could not open the file!" << std::endl;
    }

    //check PPM header
    if(std::getline(ppmFile, buffer)){
        if(buffer != "P6"){
            std::cout << "invaild PPM file"<<std::endl;
        }
    }                          
    else{
        std::cout << "Cannot read the PPM type!" << std::endl;
    }

    //skip comments
    while(std::getline(ppmFile, buffer)){
        if(buffer[0] == '#')
            continue;
        else
            break;
    }

    //read image size
    std::stringstream iss;
    iss.str(buffer);
    iss>>width;
    iss>>height;

    //read maximum value in the PPM file
    int max_value;
    if(std::getline(ppmFile,buffer)){
        iss.clear();
        iss.str(buffer);
        iss>>max_value;
        if(max_value <= 0)
            std::cout << "Invaild maximum value!" << std::endl;
    }

    //read RGB of image
    pixel* image;

    //allocate space for RGB of image
    image = (pixel*)malloc(width * height * sizeof(pixel));

    //read RGB from stream into string

        //read from istream into string
        std::string ppm_rgb ((std::istreambuf_iterator<char>(ppmFile)), std::istreambuf_iterator<char>());

        //saving RGB value of pixels into RGB struct
        if(ppm_rgb.size() / 3 != height * width)
            std::cout << "Invaild pixel RGB number!" << std::endl;
        for(int i = 0; i < height * width; i ++){
            image[i].red = ppm_rgb[3*i];
            image[i].green = ppm_rgb[3*i + 1];
            image[i].blue = ppm_rgb[3*i + 2];
        }
    ppmFile.close();

    return image;
}

//================== PPM file output function =======================//
void write_ppmFile(pixel* image, std::string filename, int image_x, int image_y){
    std::ofstream PPMout;
    std::string outname = "../" + filename + ".ppm";
    PPMout.open(outname, std::ofstream::binary);
    PPMout << "P6" <<std::endl
           << "# File after convolution" << std::endl
           << image_x << " " << image_y << std::endl
           << "255" << std::endl;
    for(int i(0); i < image_x * image_y; i++){
        PPMout << image[i].red << image[i].green << image[i].blue;
    }
    PPMout.close();
}

//================= Guassian Kernel creating funciton ===============//
float * Gaussian_Kernel(int sigma){
    float const pi = 3.1415926;
    int k;
    k = 6 * sigma;
    if(k % 2 == 0) k++;
    kernel_size = k;
    float sum = 0;

    //allocate space for gaussian kernel
    float* K = (float*)malloc(k * sizeof(float));
    for(int i(0); i < k; i++){
        K[i] = exp(-(i - (k-1)/2)*(i - (k-1)/2)/(2 * sigma * sigma)) / sqrt(2 * sigma * sigma * pi);
        sum += K[i];
    }

    //nomalize kernel so that the brightness of image won't be changed
    for(int i(0); i < k; i++)
        K[i] = K[i] / sum;

    return K;
}

//=================== CPU - Applying Gaussian Kernel to image =======//
pixel * Gaussian_Blur(float * Kernel, pixel * image){
    temp_width = width - kernel_size + 1;
    temp_height = height;
    conv_im_width = temp_width;
    conv_im_height = height - kernel_size + 1;

    pixel* temp = (pixel*)malloc(temp_width * temp_height * sizeof(pixel));
    pixel* output = (pixel*)malloc(conv_im_width * conv_im_height * sizeof(pixel));
    // 2D Gaussian Blur can be separated into two 1D convolution horizontally and vertically

        // horizontal convolution
        // image height scan
        for(int i_height(0);i_height < temp_height; i_height++){
            //image width scan
            for(int i_width(0); i_width < temp_width; i_width++){
                float sum_red(0);
                float sum_green(0);
                float sum_blue(0);

                for(int k_width(0); k_width < kernel_size; k_width++){
                    sum_red += Kernel[k_width] * (int)image[i_height * width + i_width + k_width].red;
                    sum_green += Kernel[k_width] * (int)image[i_height * width + i_width + k_width].green;
                    sum_blue += Kernel[k_width] * (int)image[i_height * width + i_width + k_width].blue;
                }
                temp[i_height * temp_width + i_width].red = (unsigned char)(int)sum_red;
                temp[i_height * temp_width + i_width].green = (unsigned char)(int)sum_green;
                temp[i_height * temp_width + i_width].blue = (unsigned char)(int)sum_blue;

            }
        }
        //vertical convolution
        //image width scann
        for(int i_height(0); i_height < conv_im_height; i_height++){
            //image height scann
            for(int i_width(0); i_width < conv_im_width; i_width++){
                float sum_red(0);
                float sum_green(0);
                float sum_blue(0);
                for(int k_height(0); k_height < kernel_size; k_height ++){
                    sum_red += Kernel[k_height] * (int)temp[(i_height + k_height) * conv_im_width + i_width].red;
                    sum_green += Kernel[k_height] * (int)temp[(i_height + k_height) * conv_im_width + i_width].green;
                    sum_blue += Kernel[k_height] * (int)temp[(i_height + k_height) * conv_im_width + i_width].blue;
                }
                output[i_height * conv_im_width + i_width].red = (unsigned char)(int)sum_red;
                output[i_height * conv_im_width + i_width].green = (unsigned char)(int)sum_green;
                output[i_height * conv_im_width + i_width].blue = (unsigned char)(int)sum_blue;
            }
        }

    return output;
}

//============================= GPU Xdim Kernel =======================//
__global__
void Convolution_image_x(unsigned char * D_Input_Image, float * D_Kernel, unsigned char * D_Output_Image, size_t t_kernel_size, size_t t_width, size_t t_height){
    size_t i = blockIdx.x * blockDim.x + threadIdx.x;
    size_t j = blockIdx.y * blockDim.y + threadIdx.y;
    if(i >= t_width || j >= t_height) return;
    float sum[3] = {0};
    int k;
    for(k = 0; k < t_kernel_size; k++){
        sum[0] += D_Kernel[k] * (int)D_Input_Image[(j * (t_width + t_kernel_size - 1) + i + k) * 3];
        sum[1] += D_Kernel[k] * (int)D_Input_Image[(j * (t_width + t_kernel_size - 1) + i + k) * 3 + 1];
        sum[2] += D_Kernel[k] * (int)D_Input_Image[(j * (t_width + t_kernel_size - 1) + i + k) * 3 + 2];
    }
    D_Output_Image[(j * t_width + i) * 3] = (unsigned char)(int)sum[0];
    D_Output_Image[(j * t_width + i) * 3 + 1] = (unsigned char)(int)sum[1];
    D_Output_Image[(j * t_width + i) * 3 + 2] = (unsigned char)(int)sum[2];
}
//============================= GPU Ydim Kenrel =======================//
__global__
void Convolution_image_y(unsigned char * D_Input_Image, float * D_Kernel, unsigned char * D_Output_Image, size_t i_kernel_size, size_t i_width, size_t i_height){
    size_t i = blockIdx.x * blockDim.x + threadIdx.x;
    size_t j = blockIdx.y * blockDim.y + threadIdx.y;
    if(i >= i_width || j >= i_height) return;
    float sum[3] = {0};
    int k;
    for(k = 0; k < i_kernel_size; k++){
        sum[0] += D_Kernel[k] * (int)D_Input_Image[((j+k) * i_width  + i ) * 3];
        sum[1] += D_Kernel[k] * (int)D_Input_Image[((j+k) * i_width + i ) * 3 + 1];
        sum[2] += D_Kernel[k] * (int)D_Input_Image[((j+k) * i_width + i ) * 3 + 2];
    }
    D_Output_Image[(j * i_width + i) * 3] = (unsigned char)(int)sum[0];
    D_Output_Image[(j * i_width + i) * 3 + 1] = (unsigned char)(int)sum[1];
    D_Output_Image[(j * i_width + i) * 3 + 2] = (unsigned char)(int)sum[2];
}


//================= Main Fucntion ================================//
int main(int argc, char* argv[]){
    if(argc != 3)
        return 1;
    //std::string filename("..//hereford_512.ppm")
    std::string filename(argv[1]);
    int sigma = atoi(argv[2]);

    //CPU version
    //set begin timer
    auto t_start = std::chrono::high_resolution_clock::now();

    //begin compute
    pixel* input = read_ppmfile(filename);
    float* H_Kernel = Gaussian_Kernel(sigma);
    pixel* output = Gaussian_Blur(H_Kernel, input);
    write_ppmFile(output, filename + "_CPUOutput", conv_im_width, conv_im_height);

    //Set End Timer
    auto t_end = std::chrono::high_resolution_clock::now();

    std::cout << std::fixed << std::setprecision(2) << "CPU time used: "
              << std::chrono::duration<double, std::milli>(t_end - t_start).count() / 1000
              << "s\n";

    //GPU Version
    int dev = 0;
    hipDeviceProp_t deviceProp;
    HANDLE_ERROR((hipGetDeviceProperties(&deviceProp, dev)));
    //Set Begin Timer
    hipEvent_t D_start, D_stop;
    hipEventCreate(&D_start);
    hipEventCreate(&D_stop);
    
    //Copy Data to a Device
    int Device_count(0);
    HANDLE_ERROR(hipGetDeviceCount(&Device_count));
    if(Device_count < 1)
        std::cout<< "There is not enough device to run CUDA" << '\n';

    float* D_Kernel;
    unsigned char* D_Input_Image;
    unsigned char* D_Temp_Image;   
    unsigned char* D_Output_Image;
    unsigned char* H_Output_Image;
    unsigned char* H_Input_Image;
    
    //Copy Kernel from Host to Device
    HANDLE_ERROR(hipMalloc(&D_Kernel, kernel_size * sizeof(float)));
    HANDLE_ERROR(hipMemcpy(D_Kernel, H_Kernel, kernel_size * sizeof(float), hipMemcpyHostToDevice));

    //Copy Original Image from Host to Device
    H_Input_Image = (unsigned char *)malloc( 3 * width * height * sizeof(unsigned char));
   
    for(int i = 0; i < width * height; i++){
        H_Input_Image[3 * i] = input[i].red;
        H_Input_Image[3 * i + 1] = input[i].green;
        H_Input_Image[3 * i + 2] = input[i].blue;
    }
    HANDLE_ERROR(hipMalloc(&D_Input_Image, 3 * width * height * sizeof(unsigned char)));
    HANDLE_ERROR(hipMemcpy(D_Input_Image, H_Input_Image, 3 * width * height, hipMemcpyHostToDevice));
      
    //Allocate Space in Device for Images After X Convolution and Y Convolution 
    HANDLE_ERROR(hipMalloc(&D_Temp_Image, 3 * temp_width * temp_height * sizeof(unsigned char)));
    HANDLE_ERROR(hipMalloc(&D_Output_Image, 3 * conv_im_width * conv_im_height * sizeof(unsigned char)));

    //Run Kernel
    HANDLE_ERROR(hipEventRecord(D_start));
    dim3 threads(sqrt(deviceProp.maxThreadsDim[0]), sqrt(deviceProp.maxThreadsDim[0]));
    dim3 blocks(width/threads.x + 1, height/threads.y + 1);
    Convolution_image_x<<<blocks, threads>>>(D_Input_Image, D_Kernel, D_Temp_Image, kernel_size, temp_width, temp_height);
    Convolution_image_y<<<blocks, threads>>>(D_Temp_Image, D_Kernel, D_Output_Image, kernel_size, conv_im_width, conv_im_height);
    HANDLE_ERROR(hipEventRecord(D_stop));
    HANDLE_ERROR(hipEventSynchronize(D_stop));
    
    //Copy Image from Device to Host
    H_Output_Image = (unsigned char*)malloc(3 * conv_im_height * conv_im_width * sizeof(unsigned char));
    HANDLE_ERROR(hipMemcpy(H_Output_Image, D_Output_Image, 3 * conv_im_width * conv_im_height, hipMemcpyDeviceToHost));


    //Export the image into file temp_width * temp_height conv_im_height * conv_im_height;
    pixel* H_output_GPU = (pixel*)malloc(conv_im_width * conv_im_height * sizeof(pixel));

    for(int i = 0; i < conv_im_width * conv_im_height; i++){
        H_output_GPU[i].red = H_Output_Image[3 * i];
        H_output_GPU[i].green = H_Output_Image[3 * i + 1];
        H_output_GPU[i].blue = H_Output_Image[3 * i + 2];
    }
    write_ppmFile(H_output_GPU, filename + "_GPUOutput" , conv_im_width, conv_im_height);
    //Set End Timer
    float milliseconds = 0;
    HANDLE_ERROR(hipEventElapsedTime(&milliseconds, D_start, D_stop));
    HANDLE_ERROR(hipEventDestroy(D_start));
    HANDLE_ERROR(hipEventDestroy(D_stop));

    std::cout <<  std::fixed << std::setprecision(2) << "GPU time used: "
                  << milliseconds / 1000 << "s\n"
                  << "Generate Successfully." << '\n';
    
    free(input);
    free(H_Kernel);
    free(output);
    free(H_output_GPU);
    free(H_Output_Image);
    free(H_Kernel);
    HANDLE_ERROR(hipFree(D_Kernel));
    HANDLE_ERROR(hipFree(D_Input_Image));
    HANDLE_ERROR(hipFree(D_Output_Image));
    HANDLE_ERROR(hipFree(D_Temp_Image));
 
    return 0;
}
	.text
	.file	"main.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE # -- Begin function _Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.type	_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,@function
_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: # @_Z12read_ppmfileNSt7__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	$1016, %rsp                     # imm = 0x3F8
	.cfi_def_cfa_offset 1072
	.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	%rdi, %r14
	leaq	496(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev
	leaq	24(%rsp), %r13
	movq	%r13, -16(%r13)
	xorl	%eax, %eax
	movq	%rax, -8(%r13)
	movb	%al, (%r13)
	movq	(%r14), %rbx
	movq	8(%r14), %r14
	leaq	120(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	%rax, -8(%r15)
	movb	%al, (%r15)
	leaq	3(%r14), %rsi
.Ltmp0:
	leaq	104(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm
.Ltmp1:
# %bb.1:
.Ltmp2:
	leaq	104(%rsp), %rdi
	movl	$.L.str, %esi
	movl	$3, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp3:
# %bb.2:
.Ltmp4:
	leaq	104(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp5:
# %bb.3:                                # %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_.exit
.Ltmp7:
	leaq	104(%rsp), %rdi
	movl	$.L.str.1, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp8:
# %bb.4:                                # %.noexc
	movq	%rax, %r14
	leaq	56(%rsp), %rbx
	movq	%rbx, -16(%rbx)
	movq	(%rax), %rsi
	movq	%rax, %r12
	addq	$16, %r12
	cmpq	%r12, %rsi
	je	.LBB0_6
# %bb.5:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	movq	%rsi, 40(%rsp)
	movq	16(%r14), %rax
	movq	%rax, 56(%rsp)
	movq	8(%r14), %rbp
	jmp	.LBB0_7
.LBB0_6:
	movq	8(%r14), %rbp
	leaq	1(%rbp), %rdx
	movq	%rbx, %rdi
	callq	memcpy@PLT
.LBB0_7:
	movq	%rbp, 48(%rsp)
	movq	%r12, (%r14)
	movq	$0, 8(%r14)
	movb	$0, 16(%r14)
	movq	104(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB0_9
# %bb.8:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i29
	callq	_ZdlPv
.LBB0_9:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
.Ltmp10:
	leaq	496(%rsp), %rdi
	leaq	40(%rsp), %rsi
	movl	$4, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode
.Ltmp11:
# %bb.10:
	movq	496(%rsp), %rax
	movq	-24(%rax), %rax
	testb	$5, 528(%rsp,%rax)
	je	.LBB0_16
# %bb.11:
.Ltmp12:
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$24, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp13:
# %bb.12:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %r14
.Ltmp14:
	movq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp15:
# %bb.13:                               # %.noexc83
.Ltmp16:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp17:
# %bb.14:                               # %.noexc84
.Ltmp18:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp19:
# %bb.15:                               # %.noexc84._ZNSolsEPFRSoS_E.exit_crit_edge
	movq	496(%rsp), %rax
	movq	-24(%rax), %rax
.LBB0_16:                               # %_ZNSolsEPFRSoS_E.exit
	leaq	(%rsp,%rax), %rdi
	addq	$496, %rdi                      # imm = 0x1F0
.Ltmp20:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp21:
# %bb.17:                               # %.noexc35
.Ltmp22:
	movsbl	%al, %edx
	leaq	496(%rsp), %r14
	leaq	8(%rsp), %rsi
	movq	%r14, %rdi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp23:
# %bb.18:
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	je	.LBB0_20
# %bb.19:
	movl	$25, %edx
	movl	$.L.str.5, %esi
	jmp	.LBB0_22
.LBB0_20:
	movl	$16, %edx
	movl	$.L.str.4, %esi
	cmpq	$2, 16(%rsp)
	jne	.LBB0_22
# %bb.21:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit
	movq	8(%rsp), %rax
	movzwl	(%rax), %eax
	cmpl	$13904, %eax                    # imm = 0x3650
	je	.LBB0_26
.LBB0_22:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit.thread.invoke
.Ltmp24:
	movl	$_ZSt4cout, %r15d
	movl	$_ZSt4cout, %edi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp25:
# %bb.23:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit38.invoke
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %r15
.Ltmp26:
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp27:
# %bb.24:                               # %.noexc86.invoke
.Ltmp28:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp29:
# %bb.25:                               # %.noexc87.invoke
.Ltmp30:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp31:
.LBB0_26:                               # %_ZNSolsEPFRSoS_E.exit40.preheader
	leaq	8(%rsp), %r15
.LBB0_27:                               # %_ZNSolsEPFRSoS_E.exit40
                                        # =>This Inner Loop Header: Depth=1
	movq	496(%rsp), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp33:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp34:
# %bb.28:                               # %.noexc45
                                        #   in Loop: Header=BB0_27 Depth=1
.Ltmp35:
	movsbl	%al, %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp36:
# %bb.29:                               #   in Loop: Header=BB0_27 Depth=1
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB0_31
# %bb.30:                               #   in Loop: Header=BB0_27 Depth=1
	movq	8(%rsp), %rax
	cmpb	$35, (%rax)
	je	.LBB0_27
.LBB0_31:
.Ltmp38:
	leaq	104(%rsp), %rdi
	callq	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev
.Ltmp39:
# %bb.32:
	leaq	128(%rsp), %r15
.Ltmp41:
	leaq	8(%rsp), %rsi
	movq	%r15, %rdi
	callq	_ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEE3strERKNS_12basic_stringIcS2_S3_EE
.Ltmp42:
# %bb.33:                               # %_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strERKNS_12basic_stringIcS2_S3_EE.exit
.Ltmp43:
	leaq	104(%rsp), %rdi
	movl	$width, %esi
	callq	_ZNSirsERi
.Ltmp44:
# %bb.34:
.Ltmp45:
	leaq	104(%rsp), %r12
	movl	$height, %esi
	movq	%r12, %rdi
	callq	_ZNSirsERi
.Ltmp46:
# %bb.35:
	movq	496(%rsp), %rax
	addq	-24(%rax), %r14
.Ltmp48:
	movq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp49:
# %bb.36:                               # %.noexc50
.Ltmp50:
	movsbl	%al, %edx
	leaq	496(%rsp), %rdi
	leaq	8(%rsp), %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp51:
# %bb.37:
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB0_46
# %bb.38:
	movq	104(%rsp), %rax
	addq	-24(%rax), %r12
.Ltmp52:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp53:
# %bb.39:
.Ltmp54:
	leaq	8(%rsp), %rsi
	movq	%r15, %rdi
	callq	_ZNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEE3strERKNS_12basic_stringIcS2_S3_EE
.Ltmp55:
# %bb.40:                               # %_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strERKNS_12basic_stringIcS2_S3_EE.exit55
.Ltmp56:
	leaq	104(%rsp), %rdi
	leaq	4(%rsp), %rsi
	callq	_ZNSirsERi
.Ltmp57:
# %bb.41:
	cmpl	$0, 4(%rsp)
	jg	.LBB0_46
# %bb.42:
.Ltmp58:
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$22, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp59:
# %bb.43:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit57
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %r14
.Ltmp60:
	movq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp61:
# %bb.44:                               # %.noexc94
.Ltmp62:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp63:
# %bb.45:                               # %.noexc95
.Ltmp64:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp65:
.LBB0_46:                               # %_ZNSolsEPFRSoS_E.exit59
	movslq	width(%rip), %rax
	movslq	height(%rip), %rcx
	imulq	%rax, %rcx
	leaq	(%rcx,%rcx,2), %rdi
	callq	malloc
	movq	%rax, %r14
	movq	496(%rsp), %rax
	movq	-24(%rax), %rax
	movq	728(%rsp,%rax), %rsi
	leaq	88(%rsp), %r12
	movq	%r12, -16(%r12)
	movq	$0, -8(%r12)
.Ltmp67:
	leaq	72(%rsp), %rdi
	movl	$-1, %edx
	xorl	%ecx, %ecx
	movl	$-1, %r8d
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag
.Ltmp68:
# %bb.47:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ISt19istreambuf_iteratorIcS2_EvEET_S8_RKS3_.exit
	movabsq	$-6148914691236517205, %rax     # imm = 0xAAAAAAAAAAAAAAAB
	mulq	80(%rsp)
	shrq	%rdx
	movslq	height(%rip), %rax
	movslq	width(%rip), %rcx
	imulq	%rax, %rcx
	cmpq	%rcx, %rdx
	je	.LBB0_53
# %bb.48:
.Ltmp70:
	movl	$_ZSt4cout, %r15d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$25, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp71:
# %bb.49:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit62
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %r15
.Ltmp72:
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp73:
# %bb.50:                               # %.noexc98
.Ltmp74:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp75:
# %bb.51:                               # %.noexc99
.Ltmp76:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp77:
# %bb.52:                               # %.noexc99._ZNSolsEPFRSoS_E.exit64_crit_edge
	movl	width(%rip), %ecx
	imull	height(%rip), %ecx
.LBB0_53:                               # %_ZNSolsEPFRSoS_E.exit64
	testl	%ecx, %ecx
	jle	.LBB0_56
# %bb.54:                               # %.lr.ph
	movq	72(%rsp), %rax
	movl	%ecx, %ecx
	leaq	(%rcx,%rcx,2), %rcx
	xorl	%edx, %edx
.LBB0_55:                               # =>This Inner Loop Header: Depth=1
	movb	(%rax,%rdx), %sil
	movb	%sil, (%r14,%rdx)
	movb	1(%rax,%rdx), %sil
	movb	%sil, 1(%r14,%rdx)
	movb	2(%rax,%rdx), %sil
	movb	%sil, 2(%r14,%rdx)
	addq	$3, %rdx
	cmpq	%rdx, %rcx
	jne	.LBB0_55
.LBB0_56:                               # %._crit_edge
.Ltmp78:
	leaq	496(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp79:
# %bb.57:
	movq	72(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB0_59
# %bb.58:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i68
	callq	_ZdlPv
.LBB0_59:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit70
	leaq	104(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	232(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	movq	40(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	.LBB0_61
# %bb.60:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i71
	callq	_ZdlPv
.LBB0_61:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit73
	movq	8(%rsp), %rdi
	cmpq	%r13, %rdi
	je	.LBB0_63
# %bb.62:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i74
	callq	_ZdlPv
.LBB0_63:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit76
	leaq	496(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%r14, %rax
	addq	$1016, %rsp                     # imm = 0x3F8
	.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_64:
	.cfi_def_cfa_offset 1072
.Ltmp69:
	jmp	.LBB0_73
.LBB0_65:
.Ltmp40:
	jmp	.LBB0_77
.LBB0_66:
.Ltmp9:
	jmp	.LBB0_71
.LBB0_67:
.Ltmp80:
	movq	%rax, %r14
	movq	72(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB0_74
# %bb.68:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i65
	callq	_ZdlPv
	jmp	.LBB0_74
.LBB0_69:
.Ltmp47:
	jmp	.LBB0_73
.LBB0_70:
.Ltmp6:
.LBB0_71:
	movq	%rax, %r14
	movq	104(%rsp), %rdi
	cmpq	%r15, %rdi
	jne	.LBB0_79
	jmp	.LBB0_80
.LBB0_72:
.Ltmp66:
.LBB0_73:
	movq	%rax, %r14
.LBB0_74:
	leaq	104(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	232(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	jmp	.LBB0_78
.LBB0_75:                               # %.loopexit.split-lp
.Ltmp32:
	jmp	.LBB0_77
.LBB0_76:                               # %.loopexit
.Ltmp37:
.LBB0_77:
	movq	%rax, %r14
.LBB0_78:
	movq	40(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	.LBB0_80
.LBB0_79:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i77
	callq	_ZdlPv
.LBB0_80:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit79
	movq	8(%rsp), %rdi
	cmpq	%r13, %rdi
	je	.LBB0_82
# %bb.81:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i80
	callq	_ZdlPv
.LBB0_82:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit82
	leaq	496(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end0:
	.size	_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, .Lfunc_end0-_Z12read_ppmfileNSt7__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 .Ltmp5-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp5
	.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 .Ltmp9-.Lfunc_begin0           #     jumps to .Ltmp9
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp10-.Ltmp8                 #   Call between .Ltmp8 and .Ltmp10
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp10-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp31-.Ltmp10                #   Call between .Ltmp10 and .Ltmp31
	.uleb128 .Ltmp32-.Lfunc_begin0          #     jumps to .Ltmp32
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp33-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp36-.Ltmp33                #   Call between .Ltmp33 and .Ltmp36
	.uleb128 .Ltmp37-.Lfunc_begin0          #     jumps to .Ltmp37
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp38-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp39-.Ltmp38                #   Call between .Ltmp38 and .Ltmp39
	.uleb128 .Ltmp40-.Lfunc_begin0          #     jumps to .Ltmp40
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp41-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp46-.Ltmp41                #   Call between .Ltmp41 and .Ltmp46
	.uleb128 .Ltmp47-.Lfunc_begin0          #     jumps to .Ltmp47
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp48-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp65-.Ltmp48                #   Call between .Ltmp48 and .Ltmp65
	.uleb128 .Ltmp66-.Lfunc_begin0          #     jumps to .Ltmp66
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp67-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp68-.Ltmp67                #   Call between .Ltmp67 and .Ltmp68
	.uleb128 .Ltmp69-.Lfunc_begin0          #     jumps to .Ltmp69
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp70-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp79-.Ltmp70                #   Call between .Ltmp70 and .Ltmp79
	.uleb128 .Ltmp80-.Lfunc_begin0          #     jumps to .Ltmp80
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp79-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Lfunc_end0-.Ltmp79            #   Call between .Ltmp79 and .Lfunc_end0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii # -- Begin function _Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii
	.type	_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii,@function
_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii: # @_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii
.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	$584, %rsp                      # imm = 0x248
	.cfi_def_cfa_offset 640
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%ecx, 4(%rsp)                   # 4-byte Spill
	movl	%edx, %ebp
	movq	%rsi, %r12
	movq	%rdi, %rbx
	leaq	72(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev
	movq	(%r12), %r14
	movq	8(%r12), %r12
	leaq	24(%rsp), %r13
	movq	%r13, -16(%r13)
	movq	$0, -8(%r13)
	movb	$0, (%r13)
	leaq	3(%r12), %rsi
.Ltmp81:
	leaq	8(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm
.Ltmp82:
# %bb.1:
.Ltmp83:
	leaq	8(%rsp), %rdi
	movl	$.L.str, %esi
	movl	$3, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp84:
# %bb.2:
.Ltmp85:
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp86:
# %bb.3:                                # %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_.exit
.Ltmp88:
	leaq	8(%rsp), %rdi
	movl	$.L.str.1, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp89:
# %bb.4:                                # %.noexc
	movq	%rax, %r12
	leaq	56(%rsp), %rdi
	movq	%rdi, -16(%rdi)
	movq	(%rax), %rsi
	movq	%rax, %r14
	addq	$16, %r14
	cmpq	%r14, %rsi
	je	.LBB1_5
# %bb.7:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	movq	%rsi, 40(%rsp)
	movq	16(%r12), %rax
	movq	%rax, 56(%rsp)
	movq	8(%r12), %r15
	jmp	.LBB1_8
.LBB1_5:
	movq	8(%r12), %r15
	leaq	1(%r15), %rdx
	callq	memcpy@PLT
.LBB1_8:
	movq	%r15, 48(%rsp)
	movq	%r14, (%r12)
	movq	$0, 8(%r12)
	movb	$0, 16(%r12)
	movq	8(%rsp), %rdi
	cmpq	%r13, %rdi
	je	.LBB1_10
# %bb.9:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i21
	callq	_ZdlPv
.LBB1_10:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
.Ltmp91:
	leaq	72(%rsp), %rdi
	leaq	40(%rsp), %rsi
	movl	$4, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode
.Ltmp92:
	movl	%ebp, %r14d
	movl	4(%rsp), %ebp                   # 4-byte Reload
# %bb.11:
.Ltmp93:
	leaq	72(%rsp), %r12
	movl	$.L.str.3, %esi
	movl	$2, %edx
	movq	%r12, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp94:
# %bb.12:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	72(%rsp), %rax
	addq	-24(%rax), %r12
.Ltmp95:
	movq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp96:
# %bb.13:                               # %.noexc57
.Ltmp97:
	movsbl	%al, %esi
	leaq	72(%rsp), %r12
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp98:
# %bb.14:                               # %.noexc58
.Ltmp99:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp100:
# %bb.15:                               # %_ZNSolsEPFRSoS_E.exit
.Ltmp101:
	movq	%rax, %r13
	movl	$.L.str.8, %esi
	movl	$24, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp102:
# %bb.16:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit25
	movq	(%r13), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp103:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp104:
# %bb.17:                               # %.noexc60
.Ltmp105:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp106:
# %bb.18:                               # %.noexc61
.Ltmp107:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp108:
# %bb.19:                               # %_ZNSolsEPFRSoS_E.exit27
.Ltmp109:
	movq	%rax, %rdi
	movl	%r14d, %esi
	callq	_ZNSolsEi
.Ltmp110:
# %bb.20:
.Ltmp111:
	movq	%rax, %r13
	movl	$.L.str.9, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp112:
# %bb.21:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit29
.Ltmp113:
	movq	%r13, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp114:
# %bb.22:
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp115:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp116:
# %bb.23:                               # %.noexc64
.Ltmp117:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp118:
# %bb.24:                               # %.noexc65
.Ltmp119:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp120:
# %bb.25:                               # %_ZNSolsEPFRSoS_E.exit31
.Ltmp121:
	movq	%rax, %r13
	movl	$.L.str.10, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp122:
# %bb.26:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit33
	movq	(%r13), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp123:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp124:
# %bb.27:                               # %.noexc68
.Ltmp125:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp126:
# %bb.28:                               # %.noexc69
.Ltmp127:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp128:
# %bb.29:                               # %_ZNSolsEPFRSoS_E.exit35.preheader
	imull	%r14d, %ebp
	testl	%ebp, %ebp
	jle	.LBB1_45
# %bb.30:                               # %.lr.ph.preheader
	movl	%ebp, %eax
	leaq	(%rax,%rax,2), %rbp
	xorl	%r14d, %r14d
	leaq	8(%rsp), %r15
.LBB1_31:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movb	(%rbx,%r14), %al
	movb	%al, 8(%rsp)
	movq	72(%rsp), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 88(%rsp,%rcx)
	je	.LBB1_36
# %bb.32:                               #   in Loop: Header=BB1_31 Depth=1
.Ltmp129:
	movl	$1, %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp130:
# %bb.33:                               #   in Loop: Header=BB1_31 Depth=1
	movq	%rax, %r13
	jmp	.LBB1_37
.LBB1_36:                               #   in Loop: Header=BB1_31 Depth=1
.Ltmp131:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp132:
	movq	%r12, %r13
.LBB1_37:                               #   in Loop: Header=BB1_31 Depth=1
	movb	1(%rbx,%r14), %al
	movb	%al, 8(%rsp)
	movq	(%r13), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%r13,%rcx)
	je	.LBB1_40
# %bb.38:                               #   in Loop: Header=BB1_31 Depth=1
.Ltmp133:
	movl	$1, %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp134:
# %bb.39:                               #   in Loop: Header=BB1_31 Depth=1
	movq	%rax, %r13
	jmp	.LBB1_41
.LBB1_40:                               #   in Loop: Header=BB1_31 Depth=1
.Ltmp135:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp136:
.LBB1_41:                               #   in Loop: Header=BB1_31 Depth=1
	movb	2(%rbx,%r14), %al
	movb	%al, 8(%rsp)
	movq	(%r13), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%r13,%rcx)
	je	.LBB1_43
# %bb.42:                               #   in Loop: Header=BB1_31 Depth=1
.Ltmp137:
	movl	$1, %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp138:
	jmp	.LBB1_44
.LBB1_43:                               #   in Loop: Header=BB1_31 Depth=1
.Ltmp139:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp140:
.LBB1_44:                               # %_ZNSolsEPFRSoS_E.exit35
                                        #   in Loop: Header=BB1_31 Depth=1
	addq	$3, %r14
	cmpq	%r14, %rbp
	jne	.LBB1_31
.LBB1_45:                               # %_ZNSolsEPFRSoS_E.exit35._crit_edge
.Ltmp142:
	leaq	72(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp143:
# %bb.46:
	movq	40(%rsp), %rdi
	leaq	56(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB1_48
# %bb.47:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i51
	callq	_ZdlPv
.LBB1_48:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit53
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	80(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 72(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	320(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	addq	$584, %rsp                      # imm = 0x248
	.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_34:
	.cfi_def_cfa_offset 640
.Ltmp90:
	jmp	.LBB1_35
.LBB1_6:
.Ltmp87:
.LBB1_35:
	movq	%rax, %rbx
	movq	8(%rsp), %rdi
	cmpq	%r13, %rdi
	jne	.LBB1_51
	jmp	.LBB1_52
.LBB1_49:
.Ltmp144:
	jmp	.LBB1_50
.LBB1_53:
.Ltmp141:
.LBB1_50:
	movq	%rax, %rbx
	movq	40(%rsp), %rdi
	leaq	56(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB1_52
.LBB1_51:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i54
	callq	_ZdlPv
.LBB1_52:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit56
	leaq	72(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii, .Lfunc_end1-_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii
	.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 .Ltmp81-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp81
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp81-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp86-.Ltmp81                #   Call between .Ltmp81 and .Ltmp86
	.uleb128 .Ltmp87-.Lfunc_begin1          #     jumps to .Ltmp87
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp88-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp89-.Ltmp88                #   Call between .Ltmp88 and .Ltmp89
	.uleb128 .Ltmp90-.Lfunc_begin1          #     jumps to .Ltmp90
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp89-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp91-.Ltmp89                #   Call between .Ltmp89 and .Ltmp91
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp91-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp128-.Ltmp91               #   Call between .Ltmp91 and .Ltmp128
	.uleb128 .Ltmp144-.Lfunc_begin1         #     jumps to .Ltmp144
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp129-.Lfunc_begin1         # >> Call Site 6 <<
	.uleb128 .Ltmp140-.Ltmp129              #   Call between .Ltmp129 and .Ltmp140
	.uleb128 .Ltmp141-.Lfunc_begin1         #     jumps to .Ltmp141
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp142-.Lfunc_begin1         # >> Call Site 7 <<
	.uleb128 .Ltmp143-.Ltmp142              #   Call between .Ltmp142 and .Ltmp143
	.uleb128 .Ltmp144-.Lfunc_begin1         #     jumps to .Ltmp144
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp143-.Lfunc_begin1         # >> Call Site 8 <<
	.uleb128 .Lfunc_end1-.Ltmp143           #   Call between .Ltmp143 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z15Gaussian_Kerneli
.LCPI2_0:
	.long	0x40490fda                      # float 3.1415925
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI2_1:
	.quad	0x0000000000000000              # double 0
	.text
	.globl	_Z15Gaussian_Kerneli
	.type	_Z15Gaussian_Kerneli,@function
_Z15Gaussian_Kerneli:                   # @_Z15Gaussian_Kerneli
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edi, %r14d
	leal	(%r14,%r14), %r15d
	leal	(%r15,%r15,2), %eax
	incl	%eax
	movl	%eax, kernel_size(%rip)
	movslq	%eax, %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, %rbx
	testl	%r14d, %r14d
	js	.LBB2_8
# %bb.1:                                # %.lr.ph
	leal	(%r15,%r15,2), %r15d
	leal	(%r14,%r14,2), %r12d
	negl	%r12d
	movl	%r14d, %ebp
	imull	%r14d, %ebp
	addl	%ebp, %ebp
	cvtsi2ss	%ebp, %xmm0
	mulss	.LCPI2_0(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	orl	$1, %r15d
	xorps	%xmm1, %xmm1
	xorl	%r13d, %r13d
	movsd	%xmm0, 16(%rsp)                 # 8-byte Spill
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 32(%rsp)                 # 8-byte Spill
.LBB2_2:                                # =>This Inner Loop Header: Depth=1
	movss	%xmm1, 12(%rsp)                 # 4-byte Spill
	leal	(%r12,%r13), %eax
	imull	%eax, %eax
	negl	%eax
	cltd
	idivl	%ebp
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	callq	exp
	movapd	%xmm0, %xmm1
	movsd	16(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	ucomisd	.LCPI2_1(%rip), %xmm0
	movsd	32(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	jae	.LBB2_4
# %bb.3:                                # %call.sqrt
                                        #   in Loop: Header=BB2_2 Depth=1
	movsd	16(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movsd	%xmm1, 24(%rsp)                 # 8-byte Spill
	callq	sqrt
	movsd	24(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
.LBB2_4:                                # %.split
                                        #   in Loop: Header=BB2_2 Depth=1
	divsd	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm1, %xmm0
	movss	%xmm0, (%rbx,%r13,4)
	movss	12(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm1
	incq	%r13
	cmpq	%r13, %r15
	jne	.LBB2_2
# %bb.5:                                # %.preheader
	testl	%r14d, %r14d
	js	.LBB2_8
# %bb.6:                                # %.lr.ph38.preheader
	xorl	%eax, %eax
.LBB2_7:                                # %.lr.ph38
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rbx,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	divss	%xmm1, %xmm0
	movss	%xmm0, (%rbx,%rax,4)
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB2_7
.LBB2_8:                                # %._crit_edge
	movq	%rbx, %rax
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z15Gaussian_Kerneli, .Lfunc_end2-_Z15Gaussian_Kerneli
	.cfi_endproc
                                        # -- End function
	.globl	_Z13Gaussian_BlurPfP5pixel      # -- Begin function _Z13Gaussian_BlurPfP5pixel
	.type	_Z13Gaussian_BlurPfP5pixel,@function
_Z13Gaussian_BlurPfP5pixel:             # @_Z13Gaussian_BlurPfP5pixel
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movslq	width(%rip), %r13
	movslq	kernel_size(%rip), %rax
	movl	%eax, %r12d
	movq	%r13, 24(%rsp)                  # 8-byte Spill
	subq	%rax, %r13
	movq	%r13, 16(%rsp)                  # 8-byte Spill
	incq	%r13
	movl	%r13d, temp_width(%rip)
	movl	height(%rip), %ebp
	movl	%ebp, temp_height(%rip)
	movl	%r13d, conv_im_width(%rip)
	movl	%ebp, %ecx
	subl	%eax, %ecx
	movq	%rcx, 32(%rsp)                  # 8-byte Spill
	leal	1(%rcx), %eax
	movl	%eax, (%rsp)                    # 4-byte Spill
	movl	%eax, conv_im_height(%rip)
	movl	%r13d, %eax
	imull	%ebp, %eax
	cltq
	leaq	(%rax,%rax,2), %rdi
	callq	malloc
	movq	%rax, %r14
	movl	(%rsp), %eax                    # 4-byte Reload
	imull	%r13d, %eax
	cltq
	leaq	(%rax,%rax,2), %rdi
	callq	malloc
	movq	%r13, 8(%rsp)                   # 8-byte Spill
	movl	%r13d, %ecx
	testl	%ebp, %ebp
	jle	.LBB3_8
# %bb.1:                                # %.preheader94.lr.ph
	addq	$2, %r15
	movq	24(%rsp), %rdx                  # 8-byte Reload
	leaq	(%rdx,%rdx,2), %rdx
	movq	%rdx, (%rsp)                    # 8-byte Spill
	leaq	(%r12,%r12,2), %rsi
	xorl	%edi, %edi
.LBB3_2:                                # %.preheader94
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
                                        #       Child Loop BB3_15 Depth 3
	cmpl	$0, 16(%rsp)                    # 4-byte Folded Reload
	js	.LBB3_7
# %bb.3:                                # %.preheader93.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movq	%rdi, %r8
	imulq	8(%rsp), %r8                    # 8-byte Folded Reload
	movq	%r15, %r9
	xorl	%r10d, %r10d
.LBB3_4:                                # %.preheader93
                                        #   Parent Loop BB3_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_15 Depth 3
	testl	%r12d, %r12d
	jle	.LBB3_5
# %bb.14:                               # %.lr.ph
                                        #   in Loop: Header=BB3_4 Depth=2
	xorps	%xmm0, %xmm0
	movq	%rbx, %r11
	xorl	%r13d, %r13d
	xorps	%xmm1, %xmm1
	xorps	%xmm2, %xmm2
.LBB3_15:                               #   Parent Loop BB3_2 Depth=1
                                        #     Parent Loop BB3_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%r11), %xmm3                   # xmm3 = mem[0],zero,zero,zero
	movzbl	-2(%r9,%r13), %edx
	xorps	%xmm4, %xmm4
	cvtsi2ss	%edx, %xmm4
	mulss	%xmm3, %xmm4
	movzbl	-1(%r9,%r13), %edx
	xorps	%xmm5, %xmm5
	cvtsi2ss	%edx, %xmm5
	addss	%xmm4, %xmm2
	mulss	%xmm3, %xmm5
	addss	%xmm5, %xmm1
	movzbl	(%r9,%r13), %edx
	xorps	%xmm4, %xmm4
	cvtsi2ss	%edx, %xmm4
	mulss	%xmm3, %xmm4
	addss	%xmm4, %xmm0
	addq	$3, %r13
	addq	$4, %r11
	cmpq	%r13, %rsi
	jne	.LBB3_15
	jmp	.LBB3_6
.LBB3_5:                                #   in Loop: Header=BB3_4 Depth=2
	xorps	%xmm2, %xmm2
	xorps	%xmm1, %xmm1
	xorps	%xmm0, %xmm0
.LBB3_6:                                # %._crit_edge
                                        #   in Loop: Header=BB3_4 Depth=2
	cvttss2si	%xmm2, %r11d
	leaq	(%r10,%r8), %r13
	leaq	(%r13,%r13,2), %r13
	cvttss2si	%xmm1, %edx
	movb	%r11b, (%r14,%r13)
	movb	%dl, 1(%r14,%r13)
	cvttss2si	%xmm0, %edx
	movb	%dl, 2(%r14,%r13)
	incq	%r10
	addq	$3, %r9
	cmpq	%rcx, %r10
	jne	.LBB3_4
.LBB3_7:                                # %._crit_edge103
                                        #   in Loop: Header=BB3_2 Depth=1
	incq	%rdi
	addq	(%rsp), %r15                    # 8-byte Folded Reload
	cmpq	%rbp, %rdi
	jne	.LBB3_2
.LBB3_8:                                # %.preheader92
	cmpl	$0, 32(%rsp)                    # 4-byte Folded Reload
	js	.LBB3_17
# %bb.9:                                # %.preheader91.lr.ph
	movslq	8(%rsp), %rdx                   # 4-byte Folded Reload
	subl	%r12d, %ebp
	incl	%ebp
	addq	$2, %r14
	leaq	(%rdx,%rdx,2), %rsi
	xorl	%edi, %edi
.LBB3_10:                               # %.preheader91
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_12 Depth 2
                                        #       Child Loop BB3_19 Depth 3
	cmpl	$0, 16(%rsp)                    # 4-byte Folded Reload
	js	.LBB3_16
# %bb.11:                               # %.preheader.lr.ph
                                        #   in Loop: Header=BB3_10 Depth=1
	movq	%rdi, %r8
	imulq	%rdx, %r8
	movq	%r14, %r9
	xorl	%r10d, %r10d
.LBB3_12:                               # %.preheader
                                        #   Parent Loop BB3_10 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_19 Depth 3
	testl	%r12d, %r12d
	jle	.LBB3_13
# %bb.18:                               # %.lr.ph109.preheader
                                        #   in Loop: Header=BB3_12 Depth=2
	xorps	%xmm0, %xmm0
	movq	%r9, %r11
	xorl	%r15d, %r15d
	xorps	%xmm1, %xmm1
	xorps	%xmm2, %xmm2
.LBB3_19:                               # %.lr.ph109
                                        #   Parent Loop BB3_10 Depth=1
                                        #     Parent Loop BB3_12 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%rbx,%r15,4), %xmm3            # xmm3 = mem[0],zero,zero,zero
	movzbl	-2(%r11), %r13d
	xorps	%xmm4, %xmm4
	cvtsi2ss	%r13d, %xmm4
	mulss	%xmm3, %xmm4
	movzbl	-1(%r11), %r13d
	xorps	%xmm5, %xmm5
	cvtsi2ss	%r13d, %xmm5
	addss	%xmm4, %xmm2
	mulss	%xmm3, %xmm5
	addss	%xmm5, %xmm1
	movzbl	(%r11), %r13d
	xorps	%xmm4, %xmm4
	cvtsi2ss	%r13d, %xmm4
	mulss	%xmm3, %xmm4
	addss	%xmm4, %xmm0
	incq	%r15
	addq	%rsi, %r11
	cmpq	%r15, %r12
	jne	.LBB3_19
	jmp	.LBB3_20
.LBB3_13:                               #   in Loop: Header=BB3_12 Depth=2
	xorps	%xmm2, %xmm2
	xorps	%xmm1, %xmm1
	xorps	%xmm0, %xmm0
.LBB3_20:                               # %._crit_edge110
                                        #   in Loop: Header=BB3_12 Depth=2
	cvttss2si	%xmm2, %r11d
	leaq	(%r10,%r8), %r15
	leaq	(%r15,%r15,2), %r15
	cvttss2si	%xmm1, %r13d
	movb	%r11b, (%rax,%r15)
	movb	%r13b, 1(%rax,%r15)
	cvttss2si	%xmm0, %r11d
	movb	%r11b, 2(%rax,%r15)
	incq	%r10
	addq	$3, %r9
	cmpq	%rcx, %r10
	jne	.LBB3_12
.LBB3_16:                               # %._crit_edge116
                                        #   in Loop: Header=BB3_10 Depth=1
	incq	%rdi
	addq	%rsi, %r14
	cmpq	%rbp, %rdi
	jne	.LBB3_10
.LBB3_17:                               # %._crit_edge119
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z13Gaussian_BlurPfP5pixel, .Lfunc_end3-_Z13Gaussian_BlurPfP5pixel
	.cfi_endproc
                                        # -- End function
	.globl	_Z34__device_stub__Convolution_image_xPhPfS_mmm # -- Begin function _Z34__device_stub__Convolution_image_xPhPfS_mmm
	.type	_Z34__device_stub__Convolution_image_xPhPfS_mmm,@function
_Z34__device_stub__Convolution_image_xPhPfS_mmm: # @_Z34__device_stub__Convolution_image_xPhPfS_mmm
	.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	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%rsp), %r8
	movq	%r9, (%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	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z19Convolution_image_xPhPfS_mmm, %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	_Z34__device_stub__Convolution_image_xPhPfS_mmm, .Lfunc_end4-_Z34__device_stub__Convolution_image_xPhPfS_mmm
	.cfi_endproc
                                        # -- End function
	.globl	_Z34__device_stub__Convolution_image_yPhPfS_mmm # -- Begin function _Z34__device_stub__Convolution_image_yPhPfS_mmm
	.type	_Z34__device_stub__Convolution_image_yPhPfS_mmm,@function
_Z34__device_stub__Convolution_image_yPhPfS_mmm: # @_Z34__device_stub__Convolution_image_yPhPfS_mmm
	.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	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%rsp), %r8
	movq	%r9, (%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	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z19Convolution_image_yPhPfS_mmm, %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_end5:
	.size	_Z34__device_stub__Convolution_image_yPhPfS_mmm, .Lfunc_end5-_Z34__device_stub__Convolution_image_yPhPfS_mmm
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI6_0:
	.quad	0x412e848000000000              # double 1.0E+6
.LCPI6_1:
	.quad	0x408f400000000000              # double 1000
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI6_2:
	.long	0x447a0000                      # float 1000
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.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	$1688, %rsp                     # imm = 0x698
	.cfi_def_cfa_offset 1744
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$1, %eax
	cmpl	$3, %edi
	jne	.LBB6_108
# %bb.1:
	movq	%rsi, %rbx
	movq	8(%rsi), %rsi
	leaq	152(%rsp), %r14
	leaq	216(%rsp), %rdx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	movq	16(%rbx), %rdi
	callq	atoi
	movl	%eax, %ebp
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r12
	leaq	200(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	(%r14), %rsi
	movq	8(%r14), %rdx
	addq	%rsi, %rdx
.Ltmp145:
	leaq	184(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp146:
# %bb.2:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_.exit
.Ltmp148:
	leaq	184(%rsp), %rdi
	callq	_Z12read_ppmfileNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp149:
# %bb.3:
	movq	%rax, %rbx
	movq	184(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB6_5
# %bb.4:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB6_5:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movl	%ebp, %edi
	callq	_Z15Gaussian_Kerneli
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_Z13Gaussian_BlurPfP5pixel
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	movq	152(%rsp), %r13
	movq	160(%rsp), %rbp
	leaq	136(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	$0, -8(%r15)
	movb	$0, (%r15)
	leaq	10(%rbp), %rsi
.Ltmp151:
	leaq	120(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm
.Ltmp152:
# %bb.6:
.Ltmp153:
	leaq	120(%rsp), %rdi
	movq	%r13, %rsi
	movq	%rbp, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp154:
# %bb.7:
.Ltmp155:
	leaq	120(%rsp), %rdi
	movl	$.L.str.11, %esi
	movl	$10, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp156:
# %bb.8:                                # %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_.exit
	movl	conv_im_width(%rip), %edx
	movl	conv_im_height(%rip), %ecx
.Ltmp158:
	leaq	120(%rsp), %rsi
	movq	80(%rsp), %rdi                  # 8-byte Reload
	callq	_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii
.Ltmp159:
# %bb.9:
	movq	120(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB6_11
# %bb.10:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i89
	callq	_ZdlPv
.LBB6_11:
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r13
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rcx
	movl	$-261, %edx                     # imm = 0xFEFB
	andl	_ZSt4cout+24(%rcx), %edx
	orl	$4, %edx
	movl	%edx, _ZSt4cout+24(%rcx)
	movq	-24(%rax), %rax
	movq	$2, _ZSt4cout+8(%rax)
.Ltmp161:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp162:
# %bb.12:
	subq	%r12, %r13
	cvtsi2sd	%r13, %xmm0
	divsd	.LCPI6_0(%rip), %xmm0
	divsd	.LCPI6_1(%rip), %xmm0
.Ltmp164:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp165:
# %bb.13:                               # %_ZNSolsEd.exit
.Ltmp166:
	movl	$.L.str.13, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp167:
# %bb.14:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit92
.Ltmp169:
	leaq	216(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipGetDevicePropertiesR0600
.Ltmp170:
# %bb.15:
.Ltmp171:
	movl	%eax, %edi
	movl	$261, %esi                      # imm = 0x105
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp172:
# %bb.16:
.Ltmp174:
	leaq	56(%rsp), %rdi
	callq	hipEventCreate
.Ltmp175:
# %bb.17:
.Ltmp176:
	leaq	24(%rsp), %rdi
	callq	hipEventCreate
.Ltmp177:
# %bb.18:
	leaq	68(%rsp), %rdi
	movl	$0, (%rdi)
.Ltmp179:
	callq	hipGetDeviceCount
.Ltmp180:
# %bb.19:
.Ltmp181:
	movl	%eax, %edi
	movl	$269, %esi                      # imm = 0x10D
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp182:
# %bb.20:
	cmpl	$0, 68(%rsp)
	jg	.LBB6_24
# %bb.21:
.Ltmp183:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.15, %esi
	movl	$38, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp184:
# %bb.22:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit93
	movb	$10, 16(%rsp)
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	cmpq	$0, _ZSt4cout+16(%rax)
	je	.LBB6_47
# %bb.23:
.Ltmp185:
	leaq	16(%rsp), %rsi
	movl	$_ZSt4cout, %edi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp186:
	jmp	.LBB6_24
.LBB6_47:
.Ltmp187:
	movl	$_ZSt4cout, %edi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp188:
.LBB6_24:
	movslq	kernel_size(%rip), %rsi
	shlq	$2, %rsi
.Ltmp190:
	leaq	16(%rsp), %rdi
	callq	hipMalloc
.Ltmp191:
# %bb.25:                               # %_ZL9hipMallocIfE10hipError_tPPT_m.exit
.Ltmp192:
	movl	%eax, %edi
	movl	$281, %esi                      # imm = 0x119
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp193:
# %bb.26:
	movq	16(%rsp), %rdi
	movslq	kernel_size(%rip), %rdx
	shlq	$2, %rdx
.Ltmp194:
	movq	72(%rsp), %rsi                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp195:
# %bb.27:
.Ltmp196:
	movl	%eax, %edi
	movl	$282, %esi                      # imm = 0x11A
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp197:
# %bb.28:
	movl	height(%rip), %r14d
	imull	width(%rip), %r14d
	leal	(%r14,%r14,2), %eax
	movslq	%eax, %r13
	movq	%r13, %rdi
	callq	malloc
	movq	%rax, %r12
	testl	%r14d, %r14d
	jle	.LBB6_31
# %bb.29:                               # %.lr.ph.preheader
	movl	%r14d, %eax
	leaq	(%rax,%rax,2), %rax
	xorl	%ecx, %ecx
.LBB6_30:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movb	(%rbx,%rcx), %dl
	movb	%dl, (%r12,%rcx)
	movb	1(%rbx,%rcx), %dl
	movb	%dl, 1(%r12,%rcx)
	movb	2(%rbx,%rcx), %dl
	movb	%dl, 2(%r12,%rcx)
	addq	$3, %rcx
	cmpq	%rcx, %rax
	jne	.LBB6_30
.LBB6_31:                               # %._crit_edge
.Ltmp198:
	leaq	48(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
.Ltmp199:
# %bb.32:                               # %_ZL9hipMallocIhE10hipError_tPPT_m.exit
.Ltmp200:
	movl	%eax, %edi
	movl	$292, %esi                      # imm = 0x124
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp201:
# %bb.33:
	movq	48(%rsp), %rdi
	movslq	width(%rip), %rax
	movslq	height(%rip), %rcx
	imulq	%rax, %rcx
	leaq	(%rcx,%rcx,2), %rdx
.Ltmp202:
	movq	%r12, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp203:
# %bb.34:
.Ltmp204:
	movl	%eax, %edi
	movl	$293, %esi                      # imm = 0x125
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp205:
# %bb.35:
	movslq	temp_width(%rip), %rax
	movslq	temp_height(%rip), %rcx
	imulq	%rax, %rcx
	leaq	(%rcx,%rcx,2), %rsi
.Ltmp206:
	leaq	40(%rsp), %rdi
	callq	hipMalloc
.Ltmp207:
# %bb.36:                               # %_ZL9hipMallocIhE10hipError_tPPT_m.exit104
.Ltmp208:
	movl	%eax, %edi
	movl	$296, %esi                      # imm = 0x128
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp209:
# %bb.37:
	movslq	conv_im_width(%rip), %rax
	movslq	conv_im_height(%rip), %rcx
	imulq	%rax, %rcx
	leaq	(%rcx,%rcx,2), %rsi
.Ltmp210:
	leaq	32(%rsp), %rdi
	callq	hipMalloc
.Ltmp211:
# %bb.38:                               # %_ZL9hipMallocIhE10hipError_tPPT_m.exit106
.Ltmp212:
	movl	%eax, %edi
	movl	$297, %esi                      # imm = 0x129
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp213:
# %bb.39:
	movq	56(%rsp), %rdi
.Ltmp214:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp215:
# %bb.40:
.Ltmp216:
	movl	%eax, %edi
	movl	$300, %esi                      # imm = 0x12C
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp217:
# %bb.41:
	cvtsi2sdl	540(%rsp), %xmm0
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jb	.LBB6_57
# %bb.42:
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB6_58
.LBB6_57:                               # %call.sqrt
	callq	sqrt
	xorpd	%xmm1, %xmm1
.LBB6_58:                               # %.split
	cvttsd2si	%xmm0, %r14
	xorps	%xmm0, %xmm0
	cvtsi2sdl	540(%rsp), %xmm0
	ucomisd	%xmm1, %xmm0
	jb	.LBB6_60
# %bb.59:
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB6_61
.LBB6_60:                               # %call.sqrt185
	callq	sqrt
.LBB6_61:                               # %.split.split
	cvttsd2si	%xmm0, %r12
	movl	%r14d, %esi
	movl	width(%rip), %eax
	xorl	%edx, %edx
	divl	%r14d
	movl	%eax, %ecx
	movl	height(%rip), %eax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %r13d
	shlq	$32, %r12
	orq	%rsi, %r12
	incl	%ecx
	incl	%r13d
	shlq	$32, %r13
	orq	%rcx, %r13
.Ltmp219:
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp220:
# %bb.62:
	testl	%eax, %eax
	jne	.LBB6_64
# %bb.63:
	movq	48(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	40(%rsp), %rdx
	movslq	kernel_size(%rip), %rcx
	movslq	temp_width(%rip), %r8
	movslq	temp_height(%rip), %r9
.Ltmp221:
	callq	_Z34__device_stub__Convolution_image_xPhPfS_mmm
.Ltmp222:
.LBB6_64:
.Ltmp223:
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp224:
# %bb.65:
	testl	%eax, %eax
	jne	.LBB6_67
# %bb.66:
	movq	40(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	32(%rsp), %rdx
	movslq	kernel_size(%rip), %rcx
	movslq	conv_im_width(%rip), %r8
	movslq	conv_im_height(%rip), %r9
.Ltmp225:
	callq	_Z34__device_stub__Convolution_image_yPhPfS_mmm
.Ltmp226:
.LBB6_67:
	movq	24(%rsp), %rdi
.Ltmp227:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp228:
# %bb.68:
.Ltmp229:
	movl	%eax, %edi
	movl	$305, %esi                      # imm = 0x131
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp230:
# %bb.69:
	movq	24(%rsp), %rdi
.Ltmp231:
	callq	hipEventSynchronize
.Ltmp232:
# %bb.70:
.Ltmp233:
	movl	%eax, %edi
	movl	$306, %esi                      # imm = 0x132
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp234:
# %bb.71:
	movl	conv_im_height(%rip), %eax
	imull	conv_im_width(%rip), %eax
	leal	(%rax,%rax,2), %eax
	movslq	%eax, %r15
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %r12
	movq	32(%rsp), %rsi
.Ltmp235:
	movq	%rax, %rdi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp236:
# %bb.72:
.Ltmp237:
	movl	%eax, %edi
	movl	$310, %esi                      # imm = 0x136
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp238:
# %bb.73:
	movslq	conv_im_width(%rip), %rax
	movslq	conv_im_height(%rip), %r14
	imulq	%rax, %r14
	leaq	(%r14,%r14,2), %rdi
	callq	malloc
	movq	%rax, %r13
	testl	%r14d, %r14d
	jle	.LBB6_76
# %bb.74:                               # %.lr.ph152.preheader
	movl	%r14d, %eax
	leaq	(%rax,%rax,2), %rax
	xorl	%ecx, %ecx
.LBB6_75:                               # %.lr.ph152
                                        # =>This Inner Loop Header: Depth=1
	movb	(%r12,%rcx), %dl
	movb	%dl, (%r13,%rcx)
	movb	1(%r12,%rcx), %dl
	movb	%dl, 1(%r13,%rcx)
	movb	2(%r12,%rcx), %dl
	movb	%dl, 2(%r13,%rcx)
	addq	$3, %rcx
	cmpq	%rcx, %rax
	jne	.LBB6_75
.LBB6_76:                               # %._crit_edge153
	movq	152(%rsp), %rbp
	movq	160(%rsp), %r15
	leaq	104(%rsp), %r14
	movq	%r14, -16(%r14)
	movq	$0, -8(%r14)
	movb	$0, (%r14)
	leaq	10(%r15), %rsi
.Ltmp240:
	leaq	88(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm
.Ltmp241:
# %bb.77:
.Ltmp242:
	leaq	88(%rsp), %rdi
	movq	%rbp, %rsi
	movq	%r15, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp243:
# %bb.78:
.Ltmp244:
	leaq	88(%rsp), %rdi
	movl	$.L.str.16, %esi
	movl	$10, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp245:
# %bb.79:                               # %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_.exit112
	movl	conv_im_width(%rip), %edx
	movl	conv_im_height(%rip), %ecx
.Ltmp247:
	leaq	88(%rsp), %rsi
	movq	%r13, %rdi
	callq	_Z13write_ppmFileP5pixelNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii
.Ltmp248:
# %bb.80:
	movq	88(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB6_82
# %bb.81:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i113
	callq	_ZdlPv
.LBB6_82:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit115
	leaq	64(%rsp), %rdi
	movl	$0, (%rdi)
	movq	56(%rsp), %rsi
	movq	24(%rsp), %rdx
.Ltmp250:
	callq	hipEventElapsedTime
.Ltmp251:
# %bb.83:
.Ltmp252:
	movl	%eax, %edi
	movl	$324, %esi                      # imm = 0x144
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp253:
# %bb.84:
	movq	56(%rsp), %rdi
.Ltmp254:
	callq	hipEventDestroy
.Ltmp255:
# %bb.85:
.Ltmp256:
	movl	%eax, %edi
	movl	$325, %esi                      # imm = 0x145
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp257:
# %bb.86:
	movq	24(%rsp), %rdi
.Ltmp258:
	callq	hipEventDestroy
.Ltmp259:
# %bb.87:
.Ltmp260:
	movl	%eax, %edi
	movl	$326, %esi                      # imm = 0x146
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp261:
# %bb.88:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rcx
	movl	$-261, %edx                     # imm = 0xFEFB
	andl	_ZSt4cout+24(%rcx), %edx
	orl	$4, %edx
	movl	%edx, _ZSt4cout+24(%rcx)
	movq	-24(%rax), %rax
	movq	$2, _ZSt4cout+8(%rax)
.Ltmp262:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.17, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp263:
# %bb.89:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit119
	movss	64(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI6_2(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
.Ltmp264:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp265:
# %bb.90:                               # %_ZNSolsEf.exit
.Ltmp266:
	movq	%rax, %rbp
	movl	$.L.str.13, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp267:
# %bb.91:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit122
.Ltmp268:
	movl	$.L.str.18, %esi
	movl	$22, %edx
	movq	%rbp, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp269:
# %bb.92:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit124
	movb	$10, 15(%rsp)
	movq	(%rbp), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 16(%rbp,%rax)
	je	.LBB6_96
# %bb.93:
.Ltmp270:
	leaq	15(%rsp), %rsi
	movl	$1, %edx
	movq	%rbp, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp271:
	jmp	.LBB6_97
.LBB6_96:
.Ltmp272:
	movq	%rbp, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp273:
.LBB6_97:
	movq	%rbx, %rdi
	callq	free
	movq	72(%rsp), %rbx                  # 8-byte Reload
	movq	%rbx, %rdi
	callq	free
	movq	80(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	%r13, %rdi
	callq	free
	movq	%r12, %rdi
	callq	free
	movq	%rbx, %rdi
	callq	free
	movq	16(%rsp), %rdi
.Ltmp274:
	callq	hipFree
.Ltmp275:
# %bb.98:
.Ltmp276:
	movl	%eax, %edi
	movl	$338, %esi                      # imm = 0x152
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp277:
# %bb.99:
	movq	48(%rsp), %rdi
.Ltmp278:
	callq	hipFree
.Ltmp279:
# %bb.100:
.Ltmp280:
	movl	%eax, %edi
	movl	$339, %esi                      # imm = 0x153
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp281:
# %bb.101:
	movq	32(%rsp), %rdi
.Ltmp282:
	callq	hipFree
.Ltmp283:
# %bb.102:
.Ltmp284:
	movl	%eax, %edi
	movl	$340, %esi                      # imm = 0x154
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp285:
# %bb.103:
	movq	40(%rsp), %rdi
.Ltmp286:
	callq	hipFree
.Ltmp287:
# %bb.104:
.Ltmp288:
	movl	%eax, %edi
	movl	$341, %esi                      # imm = 0x155
	callq	_ZL11HandleError10hipError_tPKci
.Ltmp289:
# %bb.105:
	leaq	168(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB6_107
# %bb.106:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i130
	callq	_ZdlPv
.LBB6_107:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit132
	xorl	%eax, %eax
.LBB6_108:
	addq	$1688, %rsp                     # imm = 0x698
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB6_109:
	.cfi_def_cfa_offset 1744
.Ltmp249:
	jmp	.LBB6_95
.LBB6_51:
.Ltmp163:
	jmp	.LBB6_111
.LBB6_50:
.Ltmp160:
	jmp	.LBB6_44
.LBB6_49:
.Ltmp150:
	movq	%rax, %rbx
	movq	184(%rsp), %rdi
	jmp	.LBB6_45
.LBB6_48:
.Ltmp147:
	jmp	.LBB6_111
.LBB6_54:
.Ltmp178:
	jmp	.LBB6_111
.LBB6_53:
.Ltmp173:
	jmp	.LBB6_111
.LBB6_52:
.Ltmp168:
	jmp	.LBB6_111
.LBB6_55:
.Ltmp189:
	jmp	.LBB6_111
.LBB6_94:
.Ltmp246:
.LBB6_95:
	movq	%rax, %rbx
	movq	88(%rsp), %rdi
	cmpq	%r14, %rdi
	jne	.LBB6_46
	jmp	.LBB6_112
.LBB6_43:
.Ltmp157:
.LBB6_44:
	movq	%rax, %rbx
	movq	120(%rsp), %rdi
.LBB6_45:
	cmpq	%r15, %rdi
	je	.LBB6_112
.LBB6_46:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i.i.i
	callq	_ZdlPv
	jmp	.LBB6_112
.LBB6_115:
.Ltmp239:
	jmp	.LBB6_111
.LBB6_56:
.Ltmp218:
	jmp	.LBB6_111
.LBB6_110:
.Ltmp290:
.LBB6_111:                              # %.body110
	movq	%rax, %rbx
.LBB6_112:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit97
	leaq	168(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB6_114
# %bb.113:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i136
	callq	_ZdlPv
.LBB6_114:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit138
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end6:
	.size	main, .Lfunc_end6-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table6:
.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 .Ltmp145-.Lfunc_begin2         #   Call between .Lfunc_begin2 and .Ltmp145
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp145-.Lfunc_begin2         # >> Call Site 2 <<
	.uleb128 .Ltmp146-.Ltmp145              #   Call between .Ltmp145 and .Ltmp146
	.uleb128 .Ltmp147-.Lfunc_begin2         #     jumps to .Ltmp147
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp148-.Lfunc_begin2         # >> Call Site 3 <<
	.uleb128 .Ltmp149-.Ltmp148              #   Call between .Ltmp148 and .Ltmp149
	.uleb128 .Ltmp150-.Lfunc_begin2         #     jumps to .Ltmp150
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp151-.Lfunc_begin2         # >> Call Site 4 <<
	.uleb128 .Ltmp156-.Ltmp151              #   Call between .Ltmp151 and .Ltmp156
	.uleb128 .Ltmp157-.Lfunc_begin2         #     jumps to .Ltmp157
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp158-.Lfunc_begin2         # >> Call Site 5 <<
	.uleb128 .Ltmp159-.Ltmp158              #   Call between .Ltmp158 and .Ltmp159
	.uleb128 .Ltmp160-.Lfunc_begin2         #     jumps to .Ltmp160
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp161-.Lfunc_begin2         # >> Call Site 6 <<
	.uleb128 .Ltmp162-.Ltmp161              #   Call between .Ltmp161 and .Ltmp162
	.uleb128 .Ltmp163-.Lfunc_begin2         #     jumps to .Ltmp163
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp164-.Lfunc_begin2         # >> Call Site 7 <<
	.uleb128 .Ltmp167-.Ltmp164              #   Call between .Ltmp164 and .Ltmp167
	.uleb128 .Ltmp168-.Lfunc_begin2         #     jumps to .Ltmp168
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp169-.Lfunc_begin2         # >> Call Site 8 <<
	.uleb128 .Ltmp172-.Ltmp169              #   Call between .Ltmp169 and .Ltmp172
	.uleb128 .Ltmp173-.Lfunc_begin2         #     jumps to .Ltmp173
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp174-.Lfunc_begin2         # >> Call Site 9 <<
	.uleb128 .Ltmp177-.Ltmp174              #   Call between .Ltmp174 and .Ltmp177
	.uleb128 .Ltmp178-.Lfunc_begin2         #     jumps to .Ltmp178
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp179-.Lfunc_begin2         # >> Call Site 10 <<
	.uleb128 .Ltmp188-.Ltmp179              #   Call between .Ltmp179 and .Ltmp188
	.uleb128 .Ltmp189-.Lfunc_begin2         #     jumps to .Ltmp189
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp190-.Lfunc_begin2         # >> Call Site 11 <<
	.uleb128 .Ltmp217-.Ltmp190              #   Call between .Ltmp190 and .Ltmp217
	.uleb128 .Ltmp218-.Lfunc_begin2         #     jumps to .Ltmp218
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp219-.Lfunc_begin2         # >> Call Site 12 <<
	.uleb128 .Ltmp238-.Ltmp219              #   Call between .Ltmp219 and .Ltmp238
	.uleb128 .Ltmp239-.Lfunc_begin2         #     jumps to .Ltmp239
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp240-.Lfunc_begin2         # >> Call Site 13 <<
	.uleb128 .Ltmp245-.Ltmp240              #   Call between .Ltmp240 and .Ltmp245
	.uleb128 .Ltmp246-.Lfunc_begin2         #     jumps to .Ltmp246
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp247-.Lfunc_begin2         # >> Call Site 14 <<
	.uleb128 .Ltmp248-.Ltmp247              #   Call between .Ltmp247 and .Ltmp248
	.uleb128 .Ltmp249-.Lfunc_begin2         #     jumps to .Ltmp249
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp250-.Lfunc_begin2         # >> Call Site 15 <<
	.uleb128 .Ltmp289-.Ltmp250              #   Call between .Ltmp250 and .Ltmp289
	.uleb128 .Ltmp290-.Lfunc_begin2         #     jumps to .Ltmp290
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp289-.Lfunc_begin2         # >> Call Site 16 <<
	.uleb128 .Lfunc_end6-.Ltmp289           #   Call between .Ltmp289 and .Lfunc_end6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_ # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	je	.LBB7_1
# %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	strlen
	leaq	(%rax,%rbx), %rdx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # TAILCALL
.LBB7_1:
	.cfi_def_cfa_offset 32
	movl	$.L.str.22, %edi
	callq	_ZSt19__throw_logic_errorPKc
.Lfunc_end7:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .Lfunc_end7-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.cfi_endproc
                                        # -- End function
	.text
	.type	_ZL11HandleError10hipError_tPKci,@function # -- Begin function _ZL11HandleError10hipError_tPKci
_ZL11HandleError10hipError_tPKci:       # @_ZL11HandleError10hipError_tPKci
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	je	.LBB8_5
# %bb.1:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	%esi, %ebx
	callq	hipGetErrorString
	testq	%rax, %rax
	je	.LBB8_2
# %bb.3:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB8_4
.LBB8_5:
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	retq
.LBB8_2:
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.LBB8_4:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movl	$_ZSt4cout, %edi
	movl	$.L.str.19, %esi
	movl	$2, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$.L.str.14, %esi
	movl	$113, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$.L.str.20, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebx, %esi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZNSolsEi                       # TAILCALL
.Lfunc_end8:
	.size	_ZL11HandleError10hipError_tPKci, .Lfunc_end8-_ZL11HandleError10hipError_tPKci
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag
.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r8d, %ebx
	movq	%rcx, %r15
	movl	%edx, %r13d
	movq	%rsi, %r12
	movq	$15, 8(%rsp)
	movq	%rdi, (%rsp)                    # 8-byte Spill
	leaq	16(%rdi), %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	xorl	%r14d, %r14d
.LBB9_1:                                # %_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv.exit
                                        # =>This Inner Loop Header: Depth=1
	testq	%r12, %r12
	je	.LBB9_2
# %bb.3:                                # %_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv.exit
                                        #   in Loop: Header=BB9_1 Depth=1
	cmpl	$-1, %r13d
	jne	.LBB9_2
# %bb.4:                                #   in Loop: Header=BB9_1 Depth=1
	movq	16(%r12), %rax
	cmpq	24(%r12), %rax
	jae	.LBB9_6
# %bb.5:                                # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.thread.i28
                                        #   in Loop: Header=BB9_1 Depth=1
	movzbl	(%rax), %ebp
	jmp	.LBB9_8
.LBB9_2:                                #   in Loop: Header=BB9_1 Depth=1
	movl	%r13d, %ebp
.LBB9_8:                                # %_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv.exit29
                                        #   in Loop: Header=BB9_1 Depth=1
	testq	%r15, %r15
	je	.LBB9_9
# %bb.10:                               # %_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv.exit29
                                        #   in Loop: Header=BB9_1 Depth=1
	cmpl	$-1, %ebx
	jne	.LBB9_9
# %bb.11:                               #   in Loop: Header=BB9_1 Depth=1
	movq	16(%r15), %rax
	cmpq	24(%r15), %rax
	jae	.LBB9_13
# %bb.12:                               # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.thread.i
                                        #   in Loop: Header=BB9_1 Depth=1
	movzbl	(%rax), %eax
	jmp	.LBB9_15
.LBB9_9:                                #   in Loop: Header=BB9_1 Depth=1
	movl	%ebx, %eax
.LBB9_15:                               # %_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv.exit
                                        #   in Loop: Header=BB9_1 Depth=1
	cmpl	$-1, %ebp
	sete	%cl
	cmpl	$-1, %eax
	sete	%al
	cmpb	%al, %cl
	je	.LBB9_27
# %bb.16:                               # %_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv.exit
                                        #   in Loop: Header=BB9_1 Depth=1
	cmpq	$15, %r14
	jae	.LBB9_27
# %bb.17:                               #   in Loop: Header=BB9_1 Depth=1
	testq	%r12, %r12
	je	.LBB9_23
# %bb.18:                               #   in Loop: Header=BB9_1 Depth=1
	cmpl	$-1, %r13d
	jne	.LBB9_23
# %bb.19:                               #   in Loop: Header=BB9_1 Depth=1
	movq	16(%r12), %rax
	cmpq	24(%r12), %rax
	jae	.LBB9_21
# %bb.20:                               # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.thread.i34
                                        #   in Loop: Header=BB9_1 Depth=1
	movzbl	(%rax), %r13d
.LBB9_23:                               # %_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE6_M_getEv.exit35
                                        #   in Loop: Header=BB9_1 Depth=1
	movq	(%rsp), %rax                    # 8-byte Reload
	movb	%r13b, 16(%rax,%r14)
	movq	16(%r12), %rax
	cmpq	24(%r12), %rax
	jae	.LBB9_26
# %bb.24:                               #   in Loop: Header=BB9_1 Depth=1
	incq	%rax
	movq	%rax, 16(%r12)
.LBB9_25:                               # %_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv.exit.backedge
                                        #   in Loop: Header=BB9_1 Depth=1
	incq	%r14
	movl	$-1, %r13d
	jmp	.LBB9_1
.LBB9_26:                               #   in Loop: Header=BB9_1 Depth=1
	movq	(%r12), %rax
	movq	%r12, %rdi
	callq	*80(%rax)
	jmp	.LBB9_25
.LBB9_6:                                # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.i27
                                        #   in Loop: Header=BB9_1 Depth=1
	movq	(%r12), %rax
	movq	%r12, %rdi
	callq	*72(%rax)
	movl	%eax, %ebp
	cmpl	$-1, %eax
	jne	.LBB9_8
# %bb.7:                                #   in Loop: Header=BB9_1 Depth=1
	xorl	%r12d, %r12d
	jmp	.LBB9_8
.LBB9_13:                               # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.i
                                        #   in Loop: Header=BB9_1 Depth=1
	movq	(%r15), %rax
	movq	%r15, %rdi
	callq	*72(%rax)
	cmpl	$-1, %eax
	jne	.LBB9_15
# %bb.14:                               #   in Loop: Header=BB9_1 Depth=1
	xorl	%r15d, %r15d
	jmp	.LBB9_15
.LBB9_21:                               # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.i33
                                        #   in Loop: Header=BB9_1 Depth=1
	movq	(%r12), %rax
	movq	%r12, %rdi
	callq	*72(%rax)
	movl	%eax, %r13d
	cmpl	$-1, %eax
	jne	.LBB9_23
# %bb.22:                               #   in Loop: Header=BB9_1 Depth=1
	xorl	%r12d, %r12d
	jmp	.LBB9_23
.LBB9_43:                               #   in Loop: Header=BB9_27 Depth=1
	cmpq	8(%rsp), %r14
	jne	.LBB9_44
# %bb.45:                               #   in Loop: Header=BB9_27 Depth=1
	leaq	1(%r14), %rax
	leaq	8(%rsp), %rsi
	movq	%rax, (%rsi)
.Ltmp295:
	movq	(%rsp), %rdi                    # 8-byte Reload
	movq	%r14, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
.Ltmp296:
# %bb.46:                               #   in Loop: Header=BB9_27 Depth=1
	movq	%rax, %rbp
	testq	%r14, %r14
	je	.LBB9_50
# %bb.47:                               #   in Loop: Header=BB9_27 Depth=1
	movq	(%rsp), %rax                    # 8-byte Reload
	movq	(%rax), %rsi
	cmpq	$1, %r14
	jne	.LBB9_49
# %bb.48:                               #   in Loop: Header=BB9_27 Depth=1
	movb	(%rsi), %al
	movb	%al, (%rbp)
	jmp	.LBB9_50
.LBB9_44:                               # %._crit_edge
                                        #   in Loop: Header=BB9_27 Depth=1
	movq	(%rsp), %rax                    # 8-byte Reload
	movq	(%rax), %rbp
	jmp	.LBB9_53
.LBB9_49:                               #   in Loop: Header=BB9_27 Depth=1
	movq	%rbp, %rdi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB9_50:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_S_copyEPcPKcm.exit
                                        #   in Loop: Header=BB9_27 Depth=1
	movq	(%rsp), %rax                    # 8-byte Reload
	movq	(%rax), %rdi
	cmpq	16(%rsp), %rdi                  # 8-byte Folded Reload
	je	.LBB9_52
# %bb.51:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i
                                        #   in Loop: Header=BB9_27 Depth=1
	callq	_ZdlPv
.LBB9_52:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv.exit
                                        #   in Loop: Header=BB9_27 Depth=1
	movq	(%rsp), %rcx                    # 8-byte Reload
	movq	%rbp, (%rcx)
	movq	8(%rsp), %rax
	movq	%rax, 16(%rcx)
.LBB9_53:                               #   in Loop: Header=BB9_27 Depth=1
	testq	%r12, %r12
	je	.LBB9_60
# %bb.54:                               #   in Loop: Header=BB9_27 Depth=1
	cmpl	$-1, %r13d
	jne	.LBB9_60
# %bb.55:                               #   in Loop: Header=BB9_27 Depth=1
	movq	16(%r12), %rax
	cmpq	24(%r12), %rax
	jae	.LBB9_57
# %bb.56:                               # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.thread.i54
                                        #   in Loop: Header=BB9_27 Depth=1
	movzbl	(%rax), %r13d
.LBB9_60:                               #   in Loop: Header=BB9_27 Depth=1
	movb	%r13b, (%rbp,%r14)
	movq	16(%r12), %rax
	cmpq	24(%r12), %rax
	jae	.LBB9_62
# %bb.61:                               #   in Loop: Header=BB9_27 Depth=1
	incq	%rax
	movq	%rax, 16(%r12)
.LBB9_63:                               # %_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv.exit18.backedge
                                        #   in Loop: Header=BB9_27 Depth=1
	incq	%r14
	movl	$-1, %r13d
	jmp	.LBB9_27
.LBB9_62:                               #   in Loop: Header=BB9_27 Depth=1
	movq	(%r12), %rax
.Ltmp301:
	movq	%r12, %rdi
	callq	*80(%rax)
.Ltmp302:
	jmp	.LBB9_63
.LBB9_32:                               # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.i46
                                        #   in Loop: Header=BB9_27 Depth=1
	movq	(%r12), %rax
.Ltmp291:
	movq	%r12, %rdi
	callq	*72(%rax)
.Ltmp292:
# %bb.33:                               # %.noexc48
                                        #   in Loop: Header=BB9_27 Depth=1
	movl	%eax, %ebp
	cmpl	$-1, %eax
	jne	.LBB9_35
# %bb.34:                               #   in Loop: Header=BB9_27 Depth=1
	xorl	%r12d, %r12d
	jmp	.LBB9_35
.LBB9_38:                               # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.i39
                                        #   in Loop: Header=BB9_27 Depth=1
	movq	(%r15), %rax
.Ltmp293:
	movq	%r15, %rdi
	callq	*72(%rax)
.Ltmp294:
# %bb.39:                               # %.noexc41
                                        #   in Loop: Header=BB9_27 Depth=1
	cmpl	$-1, %eax
	jne	.LBB9_65
# %bb.40:                               #   in Loop: Header=BB9_27 Depth=1
	cmpl	$-1, %ebp
	je	.LBB9_66
# %bb.41:                               #   in Loop: Header=BB9_27 Depth=1
	xorl	%r15d, %r15d
	jmp	.LBB9_43
.LBB9_57:                               # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.i53
                                        #   in Loop: Header=BB9_27 Depth=1
	movq	(%r12), %rax
.Ltmp298:
	movq	%r12, %rdi
	callq	*72(%rax)
.Ltmp299:
# %bb.58:                               # %.noexc55
                                        #   in Loop: Header=BB9_27 Depth=1
	movl	%eax, %r13d
	cmpl	$-1, %eax
	jne	.LBB9_60
# %bb.59:                               #   in Loop: Header=BB9_27 Depth=1
	xorl	%r12d, %r12d
	jmp	.LBB9_60
.LBB9_27:                               # %_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv.exit18
                                        # =>This Inner Loop Header: Depth=1
	testq	%r12, %r12
	je	.LBB9_28
# %bb.29:                               # %_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv.exit18
                                        #   in Loop: Header=BB9_27 Depth=1
	cmpl	$-1, %r13d
	jne	.LBB9_28
# %bb.30:                               #   in Loop: Header=BB9_27 Depth=1
	movq	16(%r12), %rax
	cmpq	24(%r12), %rax
	jae	.LBB9_32
# %bb.31:                               # %_ZNSt15basic_streambufIcSt11char_traitsIcEE5sgetcEv.exit.thread.i47
                                        #   in Loop: Header=BB9_27 Depth=1
	movzbl	(%rax), %ebp
	jmp	.LBB9_35
.LBB9_28:                               #   in Loop: Header=BB9_27 Depth=1
	movl	%r13d, %ebp
.LBB9_35:                               # %.noexc
                                        #   in Loop: Header=BB9_27 Depth=1
	testq	%r15, %r15
	je	.LBB9_42
# %bb.36:                               # %.noexc
                                        #   in Loop: Header=BB9_27 Depth=1
	cmpl	$-1, %ebx
	jne	.LBB9_42
# %bb.37:                               #   in Loop: Header=BB9_27 Depth=1
	movq	16(%r15), %rax
	cmpq	24(%r15), %rax
	jae	.LBB9_38
.LBB9_65:                               # %.thr_comm
                                        #   in Loop: Header=BB9_27 Depth=1
	cmpl	$-1, %ebp
	je	.LBB9_43
	jmp	.LBB9_66
.LBB9_42:                               #   in Loop: Header=BB9_27 Depth=1
	cmpl	$-1, %ebp
	sete	%al
	cmpl	$-1, %ebx
	sete	%cl
	cmpb	%al, %cl
	jne	.LBB9_43
.LBB9_66:                               # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movq	%r14, 8(%rax)
	movq	(%rax), %rax
	movb	$0, (%rax,%r14)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB9_64:
	.cfi_def_cfa_offset 80
.Ltmp300:
	jmp	.LBB9_68
.LBB9_67:
.Ltmp303:
	jmp	.LBB9_68
.LBB9_71:
.Ltmp297:
.LBB9_68:
	movq	%rax, %r14
	movq	(%rsp), %rax                    # 8-byte Reload
	movq	(%rax), %rdi
	cmpq	16(%rsp), %rdi                  # 8-byte Folded Reload
	je	.LBB9_70
# %bb.69:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i20
	callq	_ZdlPv
.LBB9_70:                               # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tagEN6_GuardD2Ev.exit22
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end9:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag, .Lfunc_end9-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag
	.cfi_endproc
	.section	.gcc_except_table._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag,"aG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructISt19istreambuf_iteratorIcS2_EEEvT_S8_St18input_iterator_tag,comdat
	.p2align	2, 0x0
GCC_except_table9:
.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 .Ltmp295-.Lfunc_begin3         #   Call between .Lfunc_begin3 and .Ltmp295
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp295-.Lfunc_begin3         # >> Call Site 2 <<
	.uleb128 .Ltmp296-.Ltmp295              #   Call between .Ltmp295 and .Ltmp296
	.uleb128 .Ltmp297-.Lfunc_begin3         #     jumps to .Ltmp297
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp296-.Lfunc_begin3         # >> Call Site 3 <<
	.uleb128 .Ltmp301-.Ltmp296              #   Call between .Ltmp296 and .Ltmp301
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp301-.Lfunc_begin3         # >> Call Site 4 <<
	.uleb128 .Ltmp294-.Ltmp301              #   Call between .Ltmp301 and .Ltmp294
	.uleb128 .Ltmp303-.Lfunc_begin3         #     jumps to .Ltmp303
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp298-.Lfunc_begin3         # >> Call Site 5 <<
	.uleb128 .Ltmp299-.Ltmp298              #   Call between .Ltmp298 and .Ltmp299
	.uleb128 .Ltmp300-.Lfunc_begin3         #     jumps to .Ltmp300
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp299-.Lfunc_begin3         # >> Call Site 6 <<
	.uleb128 .Lfunc_end9-.Ltmp299           #   Call between .Ltmp299 and .Lfunc_end9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end3:
	.p2align	2, 0x0
                                        # -- 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
	.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	.LBB11_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	.LBB11_3
.LBB11_1:                               # %._crit_edge
	movq	(%rbx), %rax
.LBB11_3:
	testq	%r14, %r14
	je	.LBB11_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB11_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB11_7
.LBB11_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB11_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_end11:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag, .Lfunc_end11-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_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	.LBB12_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB12_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z19Convolution_image_xPhPfS_mmm, %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	$_Z19Convolution_image_yPhPfS_mmm, %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_end12:
	.size	__hip_module_ctor, .Lfunc_end12-__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	.LBB13_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
.LBB13_2:
	retq
.Lfunc_end13:
	.size	__hip_module_dtor, .Lfunc_end13-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	width,@object                   # @width
	.bss
	.globl	width
	.p2align	2, 0x0
width:
	.long	0                               # 0x0
	.size	width, 4

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

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

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

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

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

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"../"
	.size	.L.str, 4

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Could not open the file!"
	.size	.L.str.2, 25

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"invaild PPM file"
	.size	.L.str.4, 17

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Cannot read the PPM type!"
	.size	.L.str.5, 26

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Invaild maximum value!"
	.size	.L.str.6, 23

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Invaild pixel RGB number!"
	.size	.L.str.7, 26

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"# File after convolution"
	.size	.L.str.8, 25

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

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

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

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

	.type	.L.str.11,@object               # @.str.11
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.11:
	.asciz	"_CPUOutput"
	.size	.L.str.11, 11

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"CPU time used: "
	.size	.L.str.12, 16

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"s\n"
	.size	.L.str.13, 3

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/Sonic-Wu/GPU_Computing/master/GaussianBlur/main.hip"
	.size	.L.str.14, 114

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"There is not enough device to run CUDA"
	.size	.L.str.15, 39

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

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"GPU time used: "
	.size	.L.str.17, 16

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"Generate Successfully."
	.size	.L.str.18, 23

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

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"at line"
	.size	.L.str.20, 8

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"basic_string: construction from null is not valid"
	.size	.L.str.22, 50

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

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z19Convolution_image_yPhPfS_mmm"
	.size	.L__unnamed_2, 33

	.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 _Z34__device_stub__Convolution_image_xPhPfS_mmm
	.addrsig_sym _Z34__device_stub__Convolution_image_yPhPfS_mmm
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym width
	.addrsig_sym height
	.addrsig_sym _ZSt4cout
	.addrsig_sym _Z19Convolution_image_xPhPfS_mmm
	.addrsig_sym _Z19Convolution_image_yPhPfS_mmm
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z19Convolution_image_xPhPfS_mmm ; -- Begin function _Z19Convolution_image_xPhPfS_mmm
	.globl	_Z19Convolution_image_xPhPfS_mmm
	.p2align	8
	.type	_Z19Convolution_image_xPhPfS_mmm,@function
_Z19Convolution_image_xPhPfS_mmm:       ; @_Z19Convolution_image_xPhPfS_mmm
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b128 s[8:11], s[0:1], 0x20
	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[4:5], null, s15, s3, v[1:2]
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mad_u64_u32 v[2:3], null, s14, s2, v[0:1]
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v0, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_u64_e32 vcc_lo, s[8:9], v[2:3]
	v_cmp_gt_u64_e64 s2, s[10:11], v[0:1]
	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 .LBB0_6
; %bb.1:                                ; %.preheader
	s_load_b256 s[0:7], s[0:1], 0x0
	v_dual_mov_b32 v5, 0 :: v_dual_mov_b32 v4, 0
	s_mov_b64 s[10:11], 0
	s_waitcnt lgkmcnt(0)
	s_cmp_eq_u64 s[6:7], 0
	s_cbranch_scc1 .LBB0_5
; %bb.2:                                ; %.lr.ph
	s_add_u32 s12, s6, s8
	s_addc_u32 s13, s7, s9
	s_add_u32 s12, s12, -1
	v_mad_u64_u32 v[6:7], null, v2, 3, 0
	v_mad_u64_u32 v[4:5], null, s12, v0, 0
	s_addc_u32 s12, s13, -1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v1, v5
	v_mad_u64_u32 v[8:9], null, v4, 3, v[6:7]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[4:5], null, s12, v0, v[1:2]
	v_mov_b32_e32 v1, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[5:6], null, v4, 3, v[1:2]
	v_dual_mov_b32 v6, 0 :: v_dual_mov_b32 v1, 0
	v_mov_b32_e32 v4, v5
	v_add_co_u32 v5, vcc_lo, v8, s0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, s1, v4, vcc_lo
	v_add_co_u32 v4, vcc_lo, v5, 1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v7, vcc_lo
	v_mov_b32_e32 v7, 0
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	s_clause 0x1
	global_load_u16 v8, v[4:5], off offset:-1
	global_load_u8 v9, v[4:5], off offset:1
	s_load_b32 s0, s[2:3], 0x0
	s_add_u32 s10, s10, 1
	s_addc_u32 s11, s11, 0
	v_add_co_u32 v4, vcc_lo, v4, 3
	v_cmp_lt_u64_e64 s1, s[10:11], s[6:7]
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_add_u32 s2, s2, 4
	s_addc_u32 s3, s3, 0
	s_delay_alu instid0(VALU_DEP_2)
	s_and_b32 vcc_lo, exec_lo, s1
	s_waitcnt vmcnt(1)
	v_cvt_f32_ubyte0_e32 v10, v8
	v_cvt_f32_ubyte1_e32 v8, v8
	s_waitcnt vmcnt(0)
	v_cvt_f32_ubyte0_e32 v9, v9
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v7, s0, v10 :: v_dual_fmac_f32 v6, s0, v8
	v_fmac_f32_e32 v1, s0, v9
	s_cbranch_vccnz .LBB0_3
; %bb.4:                                ; %._crit_edge.loopexit
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cvt_i32_f32_e32 v4, v7
	v_cvt_i32_f32_e32 v5, v6
	s_delay_alu instid0(VALU_DEP_3)
	v_cvt_i32_f32_e32 v1, v1
.LBB0_5:                                ; %._crit_edge
	v_mad_u64_u32 v[6:7], null, v0, s8, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v2, v7
	v_mad_u64_u32 v[7:8], null, v6, 3, s[4:5]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[9:10], null, v0, s9, v[2:3]
	v_mov_b32_e32 v0, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, v9, 3, v[0:1]
	v_and_b32_e32 v3, 0xff, v4
	v_lshlrev_b16 v0, 8, v5
	v_or_b32_e32 v0, v3, v0
	s_delay_alu instid0(VALU_DEP_4)
	v_mov_b32_e32 v8, v2
	s_clause 0x1
	global_store_b8 v[7:8], v1, off offset:2
	global_store_b16 v[7:8], v0, off
.LBB0_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19Convolution_image_xPhPfS_mmm
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 11
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z19Convolution_image_xPhPfS_mmm, .Lfunc_end0-_Z19Convolution_image_xPhPfS_mmm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 520
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z19Convolution_image_yPhPfS_mmm ; -- Begin function _Z19Convolution_image_yPhPfS_mmm
	.globl	_Z19Convolution_image_yPhPfS_mmm
	.p2align	8
	.type	_Z19Convolution_image_yPhPfS_mmm,@function
_Z19Convolution_image_yPhPfS_mmm:       ; @_Z19Convolution_image_yPhPfS_mmm
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b128 s[8:11], s[0:1], 0x20
	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[4:5], null, s15, s3, v[1:2]
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mad_u64_u32 v[2:3], null, s14, s2, v[0:1]
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v0, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_u64_e32 vcc_lo, s[8:9], v[2:3]
	v_cmp_gt_u64_e64 s2, s[10:11], v[0:1]
	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_6
; %bb.1:                                ; %.preheader
	s_load_b256 s[0:7], s[0:1], 0x0
	v_dual_mov_b32 v5, 0 :: v_dual_mov_b32 v4, 0
	s_mov_b64 s[10:11], 0
	s_waitcnt lgkmcnt(0)
	s_cmp_eq_u64 s[6:7], 0
	s_cbranch_scc1 .LBB1_5
; %bb.2:                                ; %.lr.ph.preheader
	v_mad_u64_u32 v[4:5], null, s8, v0, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v1, v5
	v_mad_u64_u32 v[5:6], null, v4, 3, s[0:1]
	s_mul_i32 s0, s9, 3
	s_mul_hi_u32 s1, s8, 3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[7:8], null, s9, v0, v[1:2]
	s_add_i32 s0, s1, s0
	s_mul_i32 s1, s8, 3
	v_dual_mov_b32 v1, v6 :: v_dual_mov_b32 v6, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, v5, 1
	v_mad_u64_u32 v[8:9], null, v7, 3, v[1:2]
	v_mov_b32_e32 v1, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v7, v8
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v7, vcc_lo
	v_mov_b32_e32 v7, 0
.LBB1_3:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_clause 0x1
	global_load_u16 v8, v[4:5], off offset:-1
	global_load_u8 v9, v[4:5], off offset:1
	s_load_b32 s12, s[2:3], 0x0
	s_add_u32 s10, s10, 1
	s_addc_u32 s11, s11, 0
	v_add_co_u32 v4, vcc_lo, v4, s1
	v_cmp_lt_u64_e64 s13, s[10:11], s[6:7]
	v_add_co_ci_u32_e32 v5, vcc_lo, s0, v5, vcc_lo
	s_add_u32 s2, s2, 4
	s_addc_u32 s3, s3, 0
	s_delay_alu instid0(VALU_DEP_2)
	s_and_b32 vcc_lo, exec_lo, s13
	s_waitcnt vmcnt(1)
	v_cvt_f32_ubyte0_e32 v10, v8
	v_cvt_f32_ubyte1_e32 v8, v8
	s_waitcnt vmcnt(0)
	v_cvt_f32_ubyte0_e32 v9, v9
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v7, s12, v10 :: v_dual_fmac_f32 v6, s12, v8
	v_fmac_f32_e32 v1, s12, v9
	s_cbranch_vccnz .LBB1_3
; %bb.4:                                ; %._crit_edge.loopexit
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cvt_i32_f32_e32 v4, v7
	v_cvt_i32_f32_e32 v5, v6
	s_delay_alu instid0(VALU_DEP_3)
	v_cvt_i32_f32_e32 v1, v1
.LBB1_5:                                ; %._crit_edge
	v_mad_u64_u32 v[6:7], null, v0, s8, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v2, v7
	v_mad_u64_u32 v[7:8], null, v6, 3, s[4:5]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[9:10], null, v0, s9, v[2:3]
	v_mov_b32_e32 v0, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, v9, 3, v[0:1]
	v_and_b32_e32 v3, 0xff, v4
	v_lshlrev_b16 v0, 8, v5
	v_or_b32_e32 v0, v3, v0
	s_delay_alu instid0(VALU_DEP_4)
	v_mov_b32_e32 v8, v2
	s_clause 0x1
	global_store_b8 v[7:8], v1, off offset:2
	global_store_b16 v[7:8], v0, off
.LBB1_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19Convolution_image_yPhPfS_mmm
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 11
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z19Convolution_image_yPhPfS_mmm, .Lfunc_end1-_Z19Convolution_image_yPhPfS_mmm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 496
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
