#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cmath>


#define TILE_W 32 //Decrease to increment block count and decrement thread count
#define TILE_H 32 //Decrease to increment block count and decrement thread count
#define R 1
#define D ((R*2)+1)
#define S (D*D)


//For debug purposes
void printImageMatrix(unsigned char** image, int height, int width)
{
  for(int i = 0; i < height; i++)
    {
      for(int j = 0; j < width; j++)
        {
          std::cout << image[i][j] << " ";
        }
      std::cout << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << std::endl;
    }
}


unsigned char* char_flattenImage(unsigned char** image, int height, int width)
{
   unsigned char* image_1D = new unsigned char[height*width];
   for(int i = 0; i < height; i++)
      {
         for(int j = 0; j < width; j++)
	    {
	       image_1D[j + i*width] = image[i][j];
	    }
      }
   std::cout << "Char image flattened" << std::endl;
   return image_1D;
}

float* flattenImage(unsigned char** image, int height, int width)
{
   float* image_1D = new float[height*width];
   for(int i = 0; i < height; i++)
      {
         for(int j = 0; j < width; j++)
	    {
	       image_1D[j + i*width] = image[i][j];
	    }
      }
   std::cout << "Float image flattened" << std::endl;
   return image_1D;
}



void fileToMatrix(unsigned char** &image, char* fileName, int* height, int* width)
{
   std::ifstream imageFile(fileName);

   if(imageFile.is_open())
      {
	std::string line;
	getline(imageFile, line);
	std::istringstream iss(line);
	iss >> *(height) >> *(width);
	std::cout << "Height: " << *height << " ||-|| Width: " << *width << std::endl;

	image = new unsigned char*[*(height)];

	for(int i = 0; i < *(height); i++)
	   {
              image[i] = new unsigned char[*(width)];
           }	  

      	int h = 0;
      	int val;
        while(getline(imageFile, line))
           {
              int w = 0;
              std::istringstream iss(line);
              while(iss >> val)
                 {
                    image[h][w++] = val;
                 }
              h++;
           }
        std::cout << "Image saved to matrix..." << std::endl;
      }

    imageFile.close();      
}

void matrixToFile(char* fileName, unsigned char* image, int height, int width)
{
  std::ofstream outFile;
  outFile.open(fileName);
  outFile << height << " " << width << '\n';
  for(int i = 0; i < height*width; i++)
    {
	int x = i % width;
	int y = i / width;
	if(i != 0 && x == 0)
	   outFile << '\n';
        outFile << int(image[x + y*width]) << " ";
    }

  outFile.close();
}

void matrixToFile(char* fileName, float* image, int height, int width)
{
  std::ofstream outFile;
  outFile.open(fileName);
  outFile << height << " " << width << '\n';
  for(int i = 0; i < height*width; i++)
    {
	int x = i % width;
	int y = i / width;
	if(i != 0 && x == 0)
	   outFile << '\n';
        outFile << int(image[x + y*width]) << " ";
    }

  outFile.close();
}


void getMinAndMax(unsigned char** image, int height, int width, int* min, int* max)
{
   for(int i = 0; i < height; i++)
      {
         for(int j = 0; j < width; j++)
	    {
	       if(image[i][j] > *(max))
	          {
		     *max = image[i][j];
	          }
	       if(image[i][j] < *(min))
	          {
		     *min = image[i][j];
		  }
	    }
      }

   std::cout << "Min: " << *min << " ||-|| Max: " << *max << std::endl;
}

double getAverage(unsigned char** image, int height, int width)
{
	float sum = 0;

	for (int i = 0; i < height; i++)
	{
		for (int j = 0; j < width; j++)
		{
			sum += image[i][j];
		}
	}

	return sum / (width * height);
}


__global__ void linearScale(float* image, float* outImage, int* a, int* width, int* height, float* b)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   float u = image[index];
   outImage[index] = (*b) * (u + (*a));
}


__global__ void grayWorld(float* image, float* outImage, double* scalingValue, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   float u = image[index];
   outImage[index] = u * *scalingValue;
}

__global__ void reflection(float* image, float* outImage, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   int i = index / *width;
   int j = index - i * *width;

   int reflectedIndex = i * *width + (*width - j - 1);
   float u = image[reflectedIndex];
   outImage[index] = u;
}

__global__ void orderedDithering(float* image, float* outImage, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;
	
   int i = index / *width;
   int j = index - i * *width; 

   float u = image[index];

   if(i%2 == 0)
   {
   	if(j%2 == 0)
	{
 		if(u > 192)
			outImage[index] = 255;
		else
			outImage[index] = 0;
	}
	else
	{
		if(u > 64)
			outImage[index] = 255;
		else
			outImage[index] = 0;
	}
   }
   else
   {
	if(j%2 == 0)
		outImage[index] = 255;
	else
	{
		if(u > 128)
			outImage[index] = 255;
		else
			outImage[index] = 0;
	}
   }

}

__global__ void rotate90(float* result, float* image, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   int i = index / *width;
   int j = index - i * *width; 

   int rotatedIndex = (*width - j - 1) * *height + i;
   float u = image[index];
   result[rotatedIndex] = u;
}

__global__ void rotate180(float* result, float* image, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   int i = index / *width;
   int j = index - i * *width; 

   int rotatedIndex = (*height - i - 1) * *width + (*width - j - 1);
   float u = image[rotatedIndex];
   result[index] = u;
}


__global__ void medianFilter(unsigned char* image, unsigned char* outImage, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	
	
   if(im_y == 0 || im_y == (*height) - 1 || im_x == 0 || im_x == (*width) - 1)
   {
      outImage[im_y * (*width) + im_x] = 0;
      return;
   }

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   int image_index;
   
   __shared__ unsigned char window[S];
   int window_index = 0;

   for(int i = -1; i <= 1; i++)
   {
      for(int j = -1; j <= 1; j++)
      {
         image_index = index + (i * (*width)) + j;
	 window[window_index++] = image[image_index];
      }
   }

   int key, i ,j;

   for(i = 1; i < S; i++)
   {
      key = window[i];
      j = i - 1;

      while(j >= 0 && window[j] > key)
      {
         window[j + 1] = window[j];
	 j = j - 1;
      }

      window[j + 1] = key;
   }

   outImage[index] = window[S/2];
}


int main(int argc, char** argv)
{
   char* inFileName = argv[1], *outFileName;
   int writeOut = atoi(argv[2]);

   //IMAGE INIT
   int height, width, max = -1, min = 256;
   unsigned char** hostImage;

   fileToMatrix(hostImage, inFileName, &height, &width);
   getMinAndMax(hostImage, height, width, &min, &max);
   float* hostFlattened = flattenImage(hostImage, height, width);  
   unsigned char* char_hostFlattened = char_flattenImage(hostImage, height, width);


   //GPU INIT
   const int image_size = sizeof(float) * (height*width);

   const int charImage_size = sizeof(unsigned char) * (height*width);
   unsigned char* char_deviceImage;

   float* deviceImage;
   float* hostResult = new float[height*width];

   cudaEvent_t start, stop;
   cudaEventCreate(&start);
   cudaEventCreate(&stop);

   int BLOCK_H = (int)std::ceil((float)width / TILE_H);
   int BLOCK_W = (int)std::ceil((float)height / TILE_W);

   dim3 deviceBlocks(BLOCK_H, BLOCK_W);
   dim3 deviceThreads(TILE_H, TILE_W);

   int *height_d, *width_d;
   float time = 0;

   cudaMalloc(&height_d, sizeof(int));
   cudaMalloc(&width_d, sizeof(int));   

   cudaMemcpy(height_d, &height, sizeof(int), cudaMemcpyHostToDevice);         
   cudaMemcpy(width_d, &width, sizeof(int), cudaMemcpyHostToDevice);         

   cudaMalloc(&deviceImage, image_size);
   cudaMemcpy(deviceImage, hostFlattened, image_size, cudaMemcpyHostToDevice);


   //*************************LINSCALE******************************//
   
   int a = -1 * min, *d_a;

   float gmax = 255.0;
   float b = gmax / (max - min), *d_b;

   float* linearScaleResult;

   cudaMalloc(&linearScaleResult, image_size);  
   cudaMalloc(&d_a, sizeof(int));
   cudaMalloc(&d_b, sizeof(float));

   cudaMemcpy(d_a, &a, sizeof(int), cudaMemcpyHostToDevice);
   cudaMemcpy(d_b, &b, sizeof(float), cudaMemcpyHostToDevice);

   cudaEventRecord(start, 0);

   linearScale<<<deviceBlocks, deviceThreads>>>(deviceImage, linearScaleResult, d_a, width_d, height_d, d_b);

   cudaEventRecord(stop, 0);
   cudaEventSynchronize(stop);
   cudaEventElapsedTime(&time, start, stop);

   std::cout << "LinScale time: " << time/1000 << "sec" << std::endl;

   cudaMemcpy(hostResult, linearScaleResult, image_size, cudaMemcpyDeviceToHost);

   if(writeOut)
   {
      outFileName = "CUDA_linear_scale_.txt";
      matrixToFile(outFileName, hostResult, height, width);
   }

   cudaFree(d_a);
   cudaFree(d_b);
   cudaFree(linearScaleResult);

   //*************************LINSCALE******************************//


   //*************************GRAYWORLD******************************// 

   double average = getAverage(hostImage, height, width);
   double scalingValue = 127.5 / average, *d_scale;;
   float* grayWorldResult;

   cudaMalloc(&grayWorldResult, image_size);

   cudaMalloc((void**)&d_scale, sizeof(double));
   cudaMemcpy(d_scale, &scalingValue, sizeof(double), cudaMemcpyHostToDevice);

   cudaEventRecord(start, 0);
  
   grayWorld<<<deviceBlocks, deviceThreads>>>(deviceImage, grayWorldResult, d_scale, height_d, width_d);
   
   cudaEventRecord(stop, 0);
   cudaEventSynchronize(stop);
   cudaEventElapsedTime(&time, start, stop);
   
   cudaMemcpy(hostResult, grayWorldResult, image_size, cudaMemcpyDeviceToHost);

   std::cout << "GrayWorld time: " << time/1000 << "sec" << std::endl;

   if(writeOut)
   {
      outFileName = "CUDA_gray_world_.txt";
      matrixToFile(outFileName, hostResult, height, width);
   }

   cudaFree(grayWorldResult);
   cudaFree(d_scale);

   //*************************GRAYWORLD******************************// 
      
  //REFLECTION
  
   float* reflectionResult;
   cudaMalloc(&reflectionResult, image_size);

   cudaEventRecord(start, 0);

   reflection<<<deviceBlocks, deviceThreads>>>(deviceImage, reflectionResult, height_d, width_d);
   
   cudaEventRecord(stop, 0);
   cudaEventSynchronize(stop);
   cudaEventElapsedTime(&time, start, stop);
   
   cudaMemcpy(hostResult, reflectionResult, image_size, cudaMemcpyDeviceToHost);

   std::cout << "Reflection time: " << time/1000 << "sec" << std::endl;

   if(writeOut)
   {
      outFileName = "CUDA_reflection_.txt";
      matrixToFile(outFileName, hostResult, height, width);
   }

   cudaFree(reflectionResult);

   //ORDERED DITHERING
  
   float* orderedDitheringResult;
   cudaMalloc(&orderedDitheringResult, image_size);

   cudaEventRecord(start, 0);

   orderedDithering<<<deviceBlocks, deviceThreads>>>(deviceImage, orderedDitheringResult, height_d, width_d);
   
   cudaEventRecord(stop, 0);
   cudaEventSynchronize(stop);
   cudaEventElapsedTime(&time, start, stop);
   
   cudaMemcpy(hostResult, orderedDitheringResult, image_size, cudaMemcpyDeviceToHost);
     
   std::cout << "Ordered Dithering time: " << time/1000 << "sec" << std::endl;
    
   if(writeOut)
   {
      outFileName = "CUDA_dithering_.txt";
      matrixToFile(outFileName, hostResult, height, width);
   }
 
   cudaFree(orderedDitheringResult);

   //ROTATE90
   float* result90;
   
   cudaMalloc((void**)&result90, image_size);

   cudaEventRecord(start, 0);

   rotate90<<<deviceBlocks, deviceThreads>>>(result90, deviceImage, height_d, width_d);
   
   cudaEventRecord(stop, 0);
   cudaEventSynchronize(stop);
   cudaEventElapsedTime(&time, start, stop);
   
   cudaMemcpy(hostResult, result90, image_size, cudaMemcpyDeviceToHost);

   std::cout << "Rotation 90 time: " << time/1000 << "sec" << std::endl;

   if(writeOut)
   {
      outFileName = "CUDA_rotate_90_.txt";
      matrixToFile(outFileName, hostResult, width, height);
   }

   cudaFree(result90);
      
   //ROTATE180
   float* result180;
   
   cudaMalloc((void**)&result180, image_size);

   cudaEventRecord(start, 0);

   rotate180<<<deviceBlocks, deviceThreads>>>(result180, deviceImage, height_d, width_d);
   
   cudaEventRecord(stop, 0);
   cudaEventSynchronize(stop);
   cudaEventElapsedTime(&time, start, stop);
   
   cudaMemcpy(hostResult, result180, image_size, cudaMemcpyDeviceToHost);
   
   std::cout << "Rotation 180 time: " << time/1000 << "sec" << std::endl;

   if(writeOut)
   {
      outFileName = "CUDA_rotate_180_.txt";
      matrixToFile(outFileName, hostResult, height, width);
   }

   cudaFree(result180);
   cudaFree(deviceImage);
      
   //MEDFILTER


   unsigned char* outImage;
   unsigned char* charResult = new unsigned char[height*width];

   cudaMalloc(&outImage, charImage_size);	

   cudaMalloc(&char_deviceImage, charImage_size);
   cudaMemcpy(char_deviceImage, char_hostFlattened, charImage_size, cudaMemcpyHostToDevice);

   cudaEventRecord(start);
   medianFilter<<<deviceBlocks, deviceThreads>>>(char_deviceImage, outImage, height_d, width_d);
   cudaEventRecord(stop);

   cudaEventSynchronize(stop);
   cudaGetLastError();
   
   float elapsed = 0;
   cudaEventElapsedTime(&elapsed, start, stop);
   
   std::cout << "Median Filter Time: " << elapsed / 1000 << std::endl;
   cudaMemcpy(charResult, outImage, charImage_size, cudaMemcpyDeviceToHost);

   if(writeOut)
   {
      outFileName = "CUDA_median_filter_.txt";
      matrixToFile(outFileName, charResult, height, width);
   }

   cudaFree(char_deviceImage);
   cudaFree(outImage);
   cudaFree(height_d);
   cudaFree(width_d);

   return 0;
}

	.file	"tmpxft_0027de46_00000000-6_gpimprocess.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3835:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3835:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0, @function
_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0:
.LFB4608:
	.cfi_startproc
	jmp	cudaMalloc@PLT
	.cfi_endproc
.LFE4608:
	.size	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0, .-_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4609:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4609:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" "
.LC1:
	.string	"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
	.text
	.globl	_Z16printImageMatrixPPhii
	.type	_Z16printImageMatrixPPhii, @function
_Z16printImageMatrixPPhii:
.LFB3823:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	_ZSt4cout(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edx, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 64
.L5:
	cmpl	%ebx, %r12d
	jle	.L11
	xorl	%ebp, %ebp
.L7:
	cmpl	%ebp, %r14d
	jle	.L12
	movq	0(%r13,%rbx,8), %rax
	movq	%r15, %rdi
	movsbl	(%rax,%rbp), %esi
	incq	%rbp
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L7
.L12:
	leaq	.LC1(%rip), %rsi
	movq	%r15, %rdi
	incq	%rbx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L5
.L11:
	popq	%rax
	.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
.LFE3823:
	.size	_Z16printImageMatrixPPhii, .-_Z16printImageMatrixPPhii
	.section	.rodata.str1.1
.LC2:
	.string	"Char image flattened"
	.text
	.globl	_Z17char_flattenImagePPhii
	.type	_Z17char_flattenImagePPhii, @function
_Z17char_flattenImagePPhii:
.LFB3824:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r13
	movl	%esi, %edi
	imull	%edx, %edi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%edx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 48
	movslq	%edi, %rdi
	call	_Znam@PLT
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	%rax, %rbp
.L14:
	cmpl	%edx, %r12d
	jle	.L16
	movslq	%esi, %rcx
	xorl	%eax, %eax
	addq	%rbp, %rcx
.L17:
	cmpl	%eax, %ebx
	jle	.L19
	movq	0(%r13,%rdx,8), %rdi
	movb	(%rdi,%rax), %dil
	movb	%dil, (%rcx,%rax)
	incq	%rax
	jmp	.L17
.L19:
	incq	%rdx
	addl	%ebx, %esi
	jmp	.L14
.L16:
	leaq	.LC2(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	popq	%rdx
	.cfi_def_cfa_offset 40
	movq	%rbp, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3824:
	.size	_Z17char_flattenImagePPhii, .-_Z17char_flattenImagePPhii
	.section	.rodata.str1.1
.LC3:
	.string	"Float image flattened"
	.text
	.globl	_Z12flattenImagePPhii
	.type	_Z12flattenImagePPhii, @function
_Z12flattenImagePPhii:
.LFB3825:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693950, %rax
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r13
	movl	%esi, %edi
	imull	%edx, %edi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movslq	%edi, %rdi
	pushq	%rcx
	.cfi_def_cfa_offset 48
	cmpq	%rdi, %rax
	jb	.L21
	salq	$2, %rdi
	movl	%edx, %ebx
	movl	%esi, %r12d
	call	_Znam@PLT
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movq	%rax, %rbp
	jmp	.L22
.L21:
	call	__cxa_throw_bad_array_new_length@PLT
.L27:
	incq	%rdx
	addl	%ebx, %ecx
.L22:
	cmpl	%edx, %r12d
	jle	.L24
	movslq	%ecx, %rax
	leaq	0(%rbp,%rax,4), %rsi
	xorl	%eax, %eax
.L25:
	cmpl	%eax, %ebx
	jle	.L27
	movq	0(%r13,%rdx,8), %rdi
	movzbl	(%rdi,%rax), %edi
	cvtsi2ssl	%edi, %xmm0
	movss	%xmm0, (%rsi,%rax,4)
	incq	%rax
	jmp	.L25
.L24:
	leaq	.LC3(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	popq	%rdx
	.cfi_def_cfa_offset 40
	movq	%rbp, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3825:
	.size	_Z12flattenImagePPhii, .-_Z12flattenImagePPhii
	.section	.rodata.str1.1
.LC4:
	.string	"Min: "
.LC5:
	.string	" ||-|| Max: "
	.text
	.globl	_Z12getMinAndMaxPPhiiPiS1_
	.type	_Z12getMinAndMaxPPhiiPiS1_, @function
_Z12getMinAndMaxPPhiiPiS1_:
.LFB3830:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rcx, %rbp
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%r8, %rbx
	pushq	%r9
	.cfi_def_cfa_offset 32
.L29:
	cmpl	%eax, %esi
	jle	.L36
	xorl	%ecx, %ecx
.L33:
	cmpl	%ecx, %edx
	jle	.L37
	movq	(%rdi,%rax,8), %r8
	addq	%rcx, %r8
	movzbl	(%r8), %r9d
	cmpl	(%rbx), %r9d
	jle	.L30
	movl	%r9d, (%rbx)
.L30:
	movzbl	(%r8), %r8d
	cmpl	0(%rbp), %r8d
	jge	.L31
	movl	%r8d, 0(%rbp)
.L31:
	incq	%rcx
	jmp	.L33
.L37:
	incq	%rax
	jmp	.L29
.L36:
	leaq	.LC4(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	0(%rbp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%rbx), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	_ZNSolsEPFRSoS_E.isra.0
	.cfi_endproc
.LFE3830:
	.size	_Z12getMinAndMaxPPhiiPiS1_, .-_Z12getMinAndMaxPPhiiPiS1_
	.globl	_Z10getAveragePPhii
	.type	_Z10getAveragePPhii, @function
_Z10getAveragePPhii:
.LFB3831:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L39:
	cmpl	%eax, %esi
	jle	.L43
	xorl	%ecx, %ecx
.L41:
	cmpl	%ecx, %edx
	jle	.L44
	movq	(%rdi,%rax,8), %r8
	movzbl	(%r8,%rcx), %r8d
	incq	%rcx
	cvtsi2ssl	%r8d, %xmm1
	addss	%xmm1, %xmm0
	jmp	.L41
.L44:
	incq	%rax
	jmp	.L39
.L43:
	imull	%edx, %esi
	cvtsi2ssl	%esi, %xmm1
	divss	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	ret
	.cfi_endproc
.LFE3831:
	.size	_Z10getAveragePPhii, .-_Z10getAveragePPhii
	.globl	_Z43__device_stub__Z11linearScalePfS_PiS0_S0_S_PfS_PiS0_S0_S_
	.type	_Z43__device_stub__Z11linearScalePfS_PiS0_S0_S_PfS_PiS0_S0_S_, @function
_Z43__device_stub__Z11linearScalePfS_PiS0_S0_S_PfS_PiS0_S0_S_:
.LFB3857:
	.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	.L45
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z11linearScalePfS_PiS0_S0_S_(%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
.L45:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L47
	call	__stack_chk_fail@PLT
.L47:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3857:
	.size	_Z43__device_stub__Z11linearScalePfS_PiS0_S0_S_PfS_PiS0_S0_S_, .-_Z43__device_stub__Z11linearScalePfS_PiS0_S0_S_PfS_PiS0_S0_S_
	.globl	_Z11linearScalePfS_PiS0_S0_S_
	.type	_Z11linearScalePfS_PiS0_S0_S_, @function
_Z11linearScalePfS_PiS0_S0_S_:
.LFB3858:
	.cfi_startproc
	endbr64
	jmp	_Z43__device_stub__Z11linearScalePfS_PiS0_S0_S_PfS_PiS0_S0_S_
	.cfi_endproc
.LFE3858:
	.size	_Z11linearScalePfS_PiS0_S0_S_, .-_Z11linearScalePfS_PiS0_S0_S_
	.globl	_Z37__device_stub__Z9grayWorldPfS_PdPiS1_PfS_PdPiS1_
	.type	_Z37__device_stub__Z9grayWorldPfS_PdPiS1_PfS_PdPiS1_, @function
_Z37__device_stub__Z9grayWorldPfS_PdPiS1_PfS_PdPiS1_:
.LFB3859:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L50
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z9grayWorldPfS_PdPiS1_(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L50:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L52
	call	__stack_chk_fail@PLT
.L52:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3859:
	.size	_Z37__device_stub__Z9grayWorldPfS_PdPiS1_PfS_PdPiS1_, .-_Z37__device_stub__Z9grayWorldPfS_PdPiS1_PfS_PdPiS1_
	.globl	_Z9grayWorldPfS_PdPiS1_
	.type	_Z9grayWorldPfS_PdPiS1_, @function
_Z9grayWorldPfS_PdPiS1_:
.LFB3860:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z9grayWorldPfS_PdPiS1_PfS_PdPiS1_
	.cfi_endproc
.LFE3860:
	.size	_Z9grayWorldPfS_PdPiS1_, .-_Z9grayWorldPfS_PdPiS1_
	.globl	_Z37__device_stub__Z10reflectionPfS_PiS0_PfS_PiS0_
	.type	_Z37__device_stub__Z10reflectionPfS_PiS0_PfS_PiS0_, @function
_Z37__device_stub__Z10reflectionPfS_PiS0_PfS_PiS0_:
.LFB3861:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L55
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z10reflectionPfS_PiS0_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L55:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L57
	call	__stack_chk_fail@PLT
.L57:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3861:
	.size	_Z37__device_stub__Z10reflectionPfS_PiS0_PfS_PiS0_, .-_Z37__device_stub__Z10reflectionPfS_PiS0_PfS_PiS0_
	.globl	_Z10reflectionPfS_PiS0_
	.type	_Z10reflectionPfS_PiS0_, @function
_Z10reflectionPfS_PiS0_:
.LFB3862:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z10reflectionPfS_PiS0_PfS_PiS0_
	.cfi_endproc
.LFE3862:
	.size	_Z10reflectionPfS_PiS0_, .-_Z10reflectionPfS_PiS0_
	.globl	_Z43__device_stub__Z16orderedDitheringPfS_PiS0_PfS_PiS0_
	.type	_Z43__device_stub__Z16orderedDitheringPfS_PiS0_PfS_PiS0_, @function
_Z43__device_stub__Z16orderedDitheringPfS_PiS0_PfS_PiS0_:
.LFB3863:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L60
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z16orderedDitheringPfS_PiS0_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L60:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L62
	call	__stack_chk_fail@PLT
.L62:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3863:
	.size	_Z43__device_stub__Z16orderedDitheringPfS_PiS0_PfS_PiS0_, .-_Z43__device_stub__Z16orderedDitheringPfS_PiS0_PfS_PiS0_
	.globl	_Z16orderedDitheringPfS_PiS0_
	.type	_Z16orderedDitheringPfS_PiS0_, @function
_Z16orderedDitheringPfS_PiS0_:
.LFB3864:
	.cfi_startproc
	endbr64
	jmp	_Z43__device_stub__Z16orderedDitheringPfS_PiS0_PfS_PiS0_
	.cfi_endproc
.LFE3864:
	.size	_Z16orderedDitheringPfS_PiS0_, .-_Z16orderedDitheringPfS_PiS0_
	.globl	_Z34__device_stub__Z8rotate90PfS_PiS0_PfS_PiS0_
	.type	_Z34__device_stub__Z8rotate90PfS_PiS0_PfS_PiS0_, @function
_Z34__device_stub__Z8rotate90PfS_PiS0_PfS_PiS0_:
.LFB3865:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L65
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z8rotate90PfS_PiS0_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L65:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L67
	call	__stack_chk_fail@PLT
.L67:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3865:
	.size	_Z34__device_stub__Z8rotate90PfS_PiS0_PfS_PiS0_, .-_Z34__device_stub__Z8rotate90PfS_PiS0_PfS_PiS0_
	.globl	_Z8rotate90PfS_PiS0_
	.type	_Z8rotate90PfS_PiS0_, @function
_Z8rotate90PfS_PiS0_:
.LFB3866:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z8rotate90PfS_PiS0_PfS_PiS0_
	.cfi_endproc
.LFE3866:
	.size	_Z8rotate90PfS_PiS0_, .-_Z8rotate90PfS_PiS0_
	.globl	_Z35__device_stub__Z9rotate180PfS_PiS0_PfS_PiS0_
	.type	_Z35__device_stub__Z9rotate180PfS_PiS0_PfS_PiS0_, @function
_Z35__device_stub__Z9rotate180PfS_PiS0_PfS_PiS0_:
.LFB3867:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L70
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z9rotate180PfS_PiS0_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L70:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L72
	call	__stack_chk_fail@PLT
.L72:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3867:
	.size	_Z35__device_stub__Z9rotate180PfS_PiS0_PfS_PiS0_, .-_Z35__device_stub__Z9rotate180PfS_PiS0_PfS_PiS0_
	.globl	_Z9rotate180PfS_PiS0_
	.type	_Z9rotate180PfS_PiS0_, @function
_Z9rotate180PfS_PiS0_:
.LFB3868:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z9rotate180PfS_PiS0_PfS_PiS0_
	.cfi_endproc
.LFE3868:
	.size	_Z9rotate180PfS_PiS0_, .-_Z9rotate180PfS_PiS0_
	.globl	_Z39__device_stub__Z12medianFilterPhS_PiS0_PhS_PiS0_
	.type	_Z39__device_stub__Z12medianFilterPhS_PiS0_PhS_PiS0_, @function
_Z39__device_stub__Z12medianFilterPhS_PiS0_PhS_PiS0_:
.LFB3869:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L75
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z12medianFilterPhS_PiS0_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L75:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L77
	call	__stack_chk_fail@PLT
.L77:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3869:
	.size	_Z39__device_stub__Z12medianFilterPhS_PiS0_PhS_PiS0_, .-_Z39__device_stub__Z12medianFilterPhS_PiS0_PhS_PiS0_
	.globl	_Z12medianFilterPhS_PiS0_
	.type	_Z12medianFilterPhS_PiS0_, @function
_Z12medianFilterPhS_PiS0_:
.LFB3870:
	.cfi_startproc
	endbr64
	jmp	_Z39__device_stub__Z12medianFilterPhS_PiS0_PhS_PiS0_
	.cfi_endproc
.LFE3870:
	.size	_Z12medianFilterPhS_PiS0_, .-_Z12medianFilterPhS_PiS0_
	.section	.rodata.str1.1
.LC7:
	.string	"_Z12medianFilterPhS_PiS0_"
.LC8:
	.string	"_Z9rotate180PfS_PiS0_"
.LC9:
	.string	"_Z8rotate90PfS_PiS0_"
.LC10:
	.string	"_Z16orderedDitheringPfS_PiS0_"
.LC11:
	.string	"_Z10reflectionPfS_PiS0_"
.LC12:
	.string	"_Z9grayWorldPfS_PdPiS1_"
.LC13:
	.string	"_Z11linearScalePfS_PiS0_S0_S_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3872:
	.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	.LC7(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z12medianFilterPhS_PiS0_(%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	.LC8(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z9rotate180PfS_PiS0_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC9(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z8rotate90PfS_PiS0_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC10(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16orderedDitheringPfS_PiS0_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC11(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z10reflectionPfS_PiS0_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC12(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z9grayWorldPfS_PdPiS1_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC13(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11linearScalePfS_PiS0_S0_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3872:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC14:
	.string	"Height: "
.LC15:
	.string	" ||-|| Width: "
.LC16:
	.string	"Image saved to matrix..."
	.text
	.globl	_Z12fileToMatrixRPPhPcPiS3_
	.type	_Z12fileToMatrixRPPhPcPiS3_, @function
_Z12fileToMatrixRPPhPcPiS3_:
.LFB3826:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3826
	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
	movq	%rcx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdx, %rbx
	movl	$8, %edx
	subq	$1384, %rsp
	.cfi_def_cfa_offset 1440
	movq	%fs:40, %rax
	movq	%rax, 1368(%rsp)
	xorl	%eax, %eax
	leaq	848(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB0:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE0:
	leaq	968(%rsp), %rdi
	call	_ZNKSt12__basic_fileIcE7is_openEv@PLT
	testb	%al, %al
	je	.L83
	leaq	48(%rsp), %rax
	movq	8(%rsp), %rdi
	movb	$0, 64(%rsp)
	movq	%rax, 16(%rsp)
	leaq	64(%rsp), %rax
	movq	16(%rsp), %rsi
	movq	%rax, 48(%rsp)
	xorl	%eax, %eax
	movq	%rax, 56(%rsp)
.LEHB1:
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	leaq	80(%rsp), %rax
	movq	16(%rsp), %rsi
	movl	$8, %edx
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode@PLT
.LEHE1:
	movq	24(%rsp), %rdi
	movq	%rbx, %rsi
.LEHB2:
	call	_ZNSirsERi@PLT
	movq	%rax, %rdi
	movq	%r12, %rsi
	call	_ZNSirsERi@PLT
	leaq	_ZSt4cout(%rip), %r14
	leaq	.LC14(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%rbx), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC15(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%r12), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movabsq	$1152921504606846975, %rax
	movslq	(%rbx), %rdi
	cmpq	%rdi, %rax
	jb	.L84
	salq	$3, %rdi
	call	_Znam@PLT
	movq	%rax, 0(%rbp)
	xorl	%r13d, %r13d
	jmp	.L87
.L84:
	movq	1368(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L108
	call	__cxa_throw_bad_array_new_length@PLT
.L88:
	movq	0(%rbp), %rax
	movslq	(%r12), %rdi
	leaq	(%rax,%r13,8), %r15
	call	_Znam@PLT
	movq	%rax, (%r15)
	incq	%r13
.L87:
	cmpl	%r13d, (%rbx)
	jg	.L88
	xorl	%r12d, %r12d
	leaq	464(%rsp), %rbx
.L89:
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L111
	movq	16(%rsp), %rsi
	movl	$8, %edx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode@PLT
.LEHE2:
	xorl	%r13d, %r13d
	leaq	44(%rsp), %r15
.L90:
	movq	%r15, %rsi
	movq	%rbx, %rdi
.LEHB3:
	call	_ZNSirsERi@PLT
.LEHE3:
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L112
	movq	0(%rbp), %rax
	movl	44(%rsp), %edx
	movq	(%rax,%r12), %rax
	movb	%dl, (%rax,%r13)
	incq	%r13
	jmp	.L90
.L112:
	movq	%rbx, %rdi
	addq	$8, %r12
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	jmp	.L89
.L111:
	leaq	.LC16(%rip), %rsi
	movq	%r14, %rdi
.LEHB4:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.LEHE4:
	movq	24(%rsp), %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	movq	16(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
.L83:
	movq	8(%rsp), %rdi
.LEHB5:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE5:
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	1368(%rsp), %rax
	subq	%fs:40, %rax
	je	.L98
	jmp	.L108
.L102:
	endbr64
	movq	%rax, %rbp
.L93:
	movq	%rbx, %rdi
	movq	%rbp, %rbx
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	jmp	.L94
.L101:
	endbr64
	movq	%rax, %rbx
.L94:
	movq	24(%rsp), %rdi
	call	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	jmp	.L95
.L100:
	endbr64
	movq	%rax, %rbx
.L95:
	movq	16(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L96
.L103:
	endbr64
	movq	%rax, %rbx
.L96:
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	1368(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L108
	movq	%rbx, %rdi
.LEHB6:
	call	_Unwind_Resume@PLT
.LEHE6:
.L108:
	call	__stack_chk_fail@PLT
.L98:
	addq	$1384, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3826:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3826:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3826-.LLSDACSB3826
.LLSDACSB3826:
	.uleb128 .LEHB0-.LFB3826
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3826
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L100-.LFB3826
	.uleb128 0
	.uleb128 .LEHB2-.LFB3826
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L101-.LFB3826
	.uleb128 0
	.uleb128 .LEHB3-.LFB3826
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L102-.LFB3826
	.uleb128 0
	.uleb128 .LEHB4-.LFB3826
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L101-.LFB3826
	.uleb128 0
	.uleb128 .LEHB5-.LFB3826
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L103-.LFB3826
	.uleb128 0
	.uleb128 .LEHB6-.LFB3826
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE3826:
	.text
	.size	_Z12fileToMatrixRPPhPcPiS3_, .-_Z12fileToMatrixRPPhPcPiS3_
	.globl	_Z12matrixToFilePcPhii
	.type	_Z12matrixToFilePcPhii, @function
_Z12matrixToFilePcPhii:
.LFB3828:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3828
	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
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%ecx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$536, %rsp
	.cfi_def_cfa_offset 592
	movq	%fs:40, %rax
	movq	%rax, 520(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rbx
	movq	%rbx, %rdi
.LEHB7:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE7:
	movl	$16, %edx
	movq	%r14, %rsi
	movq	%rbx, %rdi
.LEHB8:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	movl	%r15d, %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC0(%rip), %r14
	movq	%rax, %rdi
	movq	%r14, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r12d, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	imull	%r12d, %r15d
	xorl	%ebp, %ebp
.L114:
	movl	%ebp, %ecx
	cmpl	%ebp, %r15d
	jle	.L130
	movl	%ecx, %eax
	cltd
	idivl	%r12d
	testl	%edx, %edx
	jne	.L118
	testl	%ecx, %ecx
	jne	.L115
.L118:
	movzbl	0(%r13,%rbp), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movq	%r14, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	incq	%rbp
	jmp	.L114
.L115:
	movl	$10, %esi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	jmp	.L118
.L130:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE8:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	je	.L122
	jmp	.L128
.L123:
	endbr64
	movq	%rax, %rbp
.L120:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L128
	movq	%rbp, %rdi
.LEHB9:
	call	_Unwind_Resume@PLT
.LEHE9:
.L128:
	call	__stack_chk_fail@PLT
.L122:
	addq	$536, %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
.LFE3828:
	.section	.gcc_except_table
.LLSDA3828:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3828-.LLSDACSB3828
.LLSDACSB3828:
	.uleb128 .LEHB7-.LFB3828
	.uleb128 .LEHE7-.LEHB7
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB8-.LFB3828
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L123-.LFB3828
	.uleb128 0
	.uleb128 .LEHB9-.LFB3828
	.uleb128 .LEHE9-.LEHB9
	.uleb128 0
	.uleb128 0
.LLSDACSE3828:
	.text
	.size	_Z12matrixToFilePcPhii, .-_Z12matrixToFilePcPhii
	.globl	_Z12matrixToFilePcPfii
	.type	_Z12matrixToFilePcPfii, @function
_Z12matrixToFilePcPfii:
.LFB3829:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3829
	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
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%ecx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$536, %rsp
	.cfi_def_cfa_offset 592
	movq	%fs:40, %rax
	movq	%rax, 520(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rbx
	movq	%rbx, %rdi
.LEHB10:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE10:
	movl	$16, %edx
	movq	%r14, %rsi
	movq	%rbx, %rdi
.LEHB11:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	movl	%r15d, %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC0(%rip), %r14
	movq	%rax, %rdi
	movq	%r14, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r12d, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movl	$10, %esi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	imull	%r12d, %r15d
	xorl	%ebp, %ebp
.L132:
	movl	%ebp, %ecx
	cmpl	%ebp, %r15d
	jle	.L148
	movl	%ecx, %eax
	cltd
	idivl	%r12d
	testl	%edx, %edx
	jne	.L136
	testl	%ecx, %ecx
	jne	.L133
.L136:
	cvttss2sil	0(%r13,%rbp,4), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movq	%r14, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	incq	%rbp
	jmp	.L132
.L133:
	movl	$10, %esi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	jmp	.L136
.L148:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE11:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	je	.L140
	jmp	.L146
.L141:
	endbr64
	movq	%rax, %rbp
.L138:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L146
	movq	%rbp, %rdi
.LEHB12:
	call	_Unwind_Resume@PLT
.LEHE12:
.L146:
	call	__stack_chk_fail@PLT
.L140:
	addq	$536, %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
.LFE3829:
	.section	.gcc_except_table
.LLSDA3829:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3829-.LLSDACSB3829
.LLSDACSB3829:
	.uleb128 .LEHB10-.LFB3829
	.uleb128 .LEHE10-.LEHB10
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB11-.LFB3829
	.uleb128 .LEHE11-.LEHB11
	.uleb128 .L141-.LFB3829
	.uleb128 0
	.uleb128 .LEHB12-.LFB3829
	.uleb128 .LEHE12-.LEHB12
	.uleb128 0
	.uleb128 0
.LLSDACSE3829:
	.text
	.size	_Z12matrixToFilePcPfii, .-_Z12matrixToFilePcPfii
	.section	.rodata.str1.1
.LC19:
	.string	"LinScale time: "
.LC21:
	.string	"sec"
.LC22:
	.string	"CUDA_linear_scale_.txt"
.LC24:
	.string	"GrayWorld time: "
.LC25:
	.string	"CUDA_gray_world_.txt"
.LC26:
	.string	"Reflection time: "
.LC27:
	.string	"CUDA_reflection_.txt"
.LC28:
	.string	"Ordered Dithering time: "
.LC29:
	.string	"CUDA_dithering_.txt"
.LC30:
	.string	"Rotation 90 time: "
.LC31:
	.string	"CUDA_rotate_90_.txt"
.LC32:
	.string	"Rotation 180 time: "
.LC33:
	.string	"CUDA_rotate_180_.txt"
.LC34:
	.string	"Median Filter Time: "
.LC35:
	.string	"CUDA_median_filter_.txt"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3832:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	8(%rsi), %rbx
	movq	16(%rsi), %rdi
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r15
	call	atoi@PLT
	movq	%rbx, %rsi
	leaq	64(%rsp), %rdi
	movq	%r14, %rcx
	movq	%r15, %rdx
	movl	%eax, %ebp
	movl	$-1, 40(%rsp)
	movl	$256, 44(%rsp)
	call	_Z12fileToMatrixRPPhPcPiS3_
	movq	64(%rsp), %rax
	movl	36(%rsp), %edx
	leaq	44(%rsp), %rcx
	movl	32(%rsp), %esi
	leaq	40(%rsp), %r8
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	_Z12getMinAndMaxPPhiiPiS1_
	movl	36(%rsp), %edx
	movl	32(%rsp), %esi
	movq	8(%rsp), %rdi
	call	_Z12flattenImagePPhii
	movl	36(%rsp), %edx
	movl	32(%rsp), %esi
	movq	8(%rsp), %rdi
	movq	%rax, %r13
	call	_Z17char_flattenImagePPhii
	movl	32(%rsp), %ebx
	imull	36(%rsp), %ebx
	movq	%rax, 16(%rsp)
	movabsq	$2305843009213693950, %rax
	movslq	%ebx, %r12
	sall	$2, %ebx
	cmpq	%r12, %rax
	jb	.L150
	leaq	0(,%r12,4), %rdi
	movslq	%ebx, %rbx
	call	_Znam@PLT
	leaq	88(%rsp), %rdi
	movq	%rax, (%rsp)
	call	cudaEventCreate@PLT
	leaq	96(%rsp), %rdi
	call	cudaEventCreate@PLT
	cvtsi2ssl	36(%rsp), %xmm0
	mulss	.LC17(%rip), %xmm0
	call	ceilf@PLT
	movss	%xmm0, 28(%rsp)
	cvtsi2ssl	32(%rsp), %xmm0
	mulss	.LC17(%rip), %xmm0
	call	ceilf@PLT
	movss	28(%rsp), %xmm1
	leaq	104(%rsp), %rdi
	movl	$4, %esi
	movl	$1, 216(%rsp)
	cvttss2sil	%xmm1, %eax
	movl	$0x00000000, 48(%rsp)
	movl	$1, 228(%rsp)
	movl	%eax, 208(%rsp)
	cvttss2sil	%xmm0, %eax
	movl	%eax, 212(%rsp)
	movabsq	$137438953504, %rax
	movq	%rax, 220(%rsp)
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	112(%rsp), %rdi
	movl	$4, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	104(%rsp), %rdi
	movl	$1, %ecx
	movq	%r15, %rsi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movq	%r14, %rsi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	leaq	80(%rsp), %rdi
	movq	%rbx, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	80(%rsp), %rdi
	movq	%rbx, %rdx
	movq	%r13, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	44(%rsp), %edx
	movss	.LC18(%rip), %xmm0
	movq	%rbx, %rsi
	leaq	136(%rsp), %rdi
	movl	%edx, %eax
	negl	%eax
	movl	%eax, 52(%rsp)
	movl	40(%rsp), %eax
	subl	%edx, %eax
	cvtsi2ssl	%eax, %xmm1
	divss	%xmm1, %xmm0
	movss	%xmm0, 56(%rsp)
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	120(%rsp), %rdi
	movl	$4, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	128(%rsp), %rdi
	movl	$4, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	120(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movl	$1, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$4, %edx
	movq	128(%rsp), %rdi
	leaq	56(%rsp), %rsi
	call	cudaMemcpy@PLT
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	228(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	220(%rsp), %rdx
	movq	208(%rsp), %rdi
	movl	216(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L151
	movq	128(%rsp), %r9
	movq	104(%rsp), %r8
	movq	112(%rsp), %rcx
	movq	120(%rsp), %rdx
	movq	136(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z43__device_stub__Z11linearScalePfS_PiS0_S0_S_PfS_PiS0_S0_S_
	jmp	.L151
.L150:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L191
	call	__cxa_throw_bad_array_new_length@PLT
.L151:
	movq	96(%rsp), %rdi
	xorl	%esi, %esi
	leaq	48(%rsp), %r14
	leaq	_ZSt4cout(%rip), %r15
	leaq	.LC21(%rip), %r13
	call	cudaEventRecord@PLT
	movq	96(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	leaq	.LC19(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	48(%rsp), %xmm0
	divss	.LC20(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	136(%rsp), %rsi
	movq	(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	testl	%ebp, %ebp
	je	.L154
	movl	36(%rsp), %ecx
	movl	32(%rsp), %edx
	leaq	.LC22(%rip), %rdi
	movq	(%rsp), %rsi
	call	_Z12matrixToFilePcPfii
.L154:
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	128(%rsp), %rdi
	call	cudaFree@PLT
	movq	136(%rsp), %rdi
	call	cudaFree@PLT
	movl	36(%rsp), %edx
	movl	32(%rsp), %esi
	movq	8(%rsp), %rdi
	call	_Z10getAveragePPhii
	leaq	160(%rsp), %rdi
	movq	%rbx, %rsi
	movaps	%xmm0, %xmm1
	movsd	.LC23(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, 144(%rsp)
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	152(%rsp), %rdi
	movl	$8, %esi
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movq	152(%rsp), %rdi
	movl	$8, %edx
	leaq	144(%rsp), %rsi
	call	cudaMemcpy@PLT
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	228(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	220(%rsp), %rdx
	movq	208(%rsp), %rdi
	movl	216(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L155
	movq	112(%rsp), %r8
	movq	104(%rsp), %rcx
	movq	152(%rsp), %rdx
	movq	160(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z37__device_stub__Z9grayWorldPfS_PdPiS1_PfS_PdPiS1_
.L155:
	movq	96(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	96(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	movq	160(%rsp), %rsi
	movq	(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	leaq	.LC24(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	48(%rsp), %xmm0
	divss	.LC20(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	testl	%ebp, %ebp
	je	.L156
	movl	36(%rsp), %ecx
	movl	32(%rsp), %edx
	leaq	.LC25(%rip), %rdi
	movq	(%rsp), %rsi
	call	_Z12matrixToFilePcPfii
.L156:
	movq	160(%rsp), %rdi
	call	cudaFree@PLT
	movq	152(%rsp), %rdi
	call	cudaFree@PLT
	leaq	168(%rsp), %rdi
	movq	%rbx, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	228(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	220(%rsp), %rdx
	movq	208(%rsp), %rdi
	movl	216(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L157
	movq	112(%rsp), %rcx
	movq	104(%rsp), %rdx
	movq	168(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z37__device_stub__Z10reflectionPfS_PiS0_PfS_PiS0_
.L157:
	movq	96(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	96(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	movq	168(%rsp), %rsi
	movq	(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	leaq	.LC26(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	48(%rsp), %xmm0
	divss	.LC20(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	testl	%ebp, %ebp
	je	.L158
	movl	36(%rsp), %ecx
	movl	32(%rsp), %edx
	leaq	.LC27(%rip), %rdi
	movq	(%rsp), %rsi
	call	_Z12matrixToFilePcPfii
.L158:
	movq	168(%rsp), %rdi
	call	cudaFree@PLT
	leaq	176(%rsp), %rdi
	movq	%rbx, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	228(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	220(%rsp), %rdx
	movq	208(%rsp), %rdi
	movl	216(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L159
	movq	112(%rsp), %rcx
	movq	104(%rsp), %rdx
	movq	176(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z43__device_stub__Z16orderedDitheringPfS_PiS0_PfS_PiS0_
.L159:
	movq	96(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	96(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	movq	176(%rsp), %rsi
	movq	(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	leaq	.LC28(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	48(%rsp), %xmm0
	divss	.LC20(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	testl	%ebp, %ebp
	je	.L160
	movl	36(%rsp), %ecx
	movl	32(%rsp), %edx
	leaq	.LC29(%rip), %rdi
	movq	(%rsp), %rsi
	call	_Z12matrixToFilePcPfii
.L160:
	movq	176(%rsp), %rdi
	call	cudaFree@PLT
	leaq	184(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	228(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	220(%rsp), %rdx
	movq	208(%rsp), %rdi
	movl	216(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L161
	movq	112(%rsp), %rcx
	movq	104(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	184(%rsp), %rdi
	call	_Z34__device_stub__Z8rotate90PfS_PiS0_PfS_PiS0_
.L161:
	movq	96(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	96(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	movq	184(%rsp), %rsi
	movq	(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	leaq	.LC30(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	48(%rsp), %xmm0
	divss	.LC20(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	testl	%ebp, %ebp
	je	.L162
	movl	32(%rsp), %ecx
	movl	36(%rsp), %edx
	leaq	.LC31(%rip), %rdi
	movq	(%rsp), %rsi
	call	_Z12matrixToFilePcPfii
.L162:
	movq	184(%rsp), %rdi
	call	cudaFree@PLT
	leaq	192(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	228(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	220(%rsp), %rdx
	movq	208(%rsp), %rdi
	movl	216(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L163
	movq	112(%rsp), %rcx
	movq	104(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	192(%rsp), %rdi
	call	_Z35__device_stub__Z9rotate180PfS_PiS0_PfS_PiS0_
.L163:
	movq	96(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	96(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	movq	192(%rsp), %rsi
	movq	(%rsp), %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	leaq	.LC32(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	48(%rsp), %xmm0
	divss	.LC20(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	testl	%ebp, %ebp
	je	.L164
	movl	36(%rsp), %ecx
	movl	32(%rsp), %edx
	leaq	.LC33(%rip), %rdi
	movq	(%rsp), %rsi
	call	_Z12matrixToFilePcPfii
.L164:
	movq	192(%rsp), %rdi
	call	cudaFree@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movl	32(%rsp), %edi
	imull	36(%rsp), %edi
	movslq	%edi, %rdi
	call	_Znam@PLT
	leaq	200(%rsp), %rdi
	movq	%r12, %rsi
	movq	%rax, %rbx
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	72(%rsp), %rdi
	movq	%r12, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movq	16(%rsp), %rsi
	movq	72(%rsp), %rdi
	movq	%r12, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	228(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	220(%rsp), %rdx
	movq	208(%rsp), %rdi
	movl	216(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L165
	movq	112(%rsp), %rcx
	movq	104(%rsp), %rdx
	movq	200(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z39__device_stub__Z12medianFilterPhS_PiS0_PhS_PiS0_
.L165:
	movq	96(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	96(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	call	cudaGetLastError@PLT
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	leaq	60(%rsp), %rdi
	movl	$0x00000000, 60(%rsp)
	call	cudaEventElapsedTime@PLT
	leaq	.LC34(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	60(%rsp), %xmm0
	divss	.LC20(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$2, %ecx
	movq	%r12, %rdx
	movq	%rbx, %rdi
	movq	200(%rsp), %rsi
	call	cudaMemcpy@PLT
	testl	%ebp, %ebp
	je	.L166
	movl	36(%rsp), %ecx
	movl	32(%rsp), %edx
	movq	%rbx, %rsi
	leaq	.LC35(%rip), %rdi
	call	_Z12matrixToFilePcPhii
.L166:
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	200(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	je	.L167
.L191:
	call	__stack_chk_fail@PLT
.L167:
	addq	$248, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3832:
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC17:
	.long	1023410176
	.align 4
.LC18:
	.long	1132396544
	.align 4
.LC20:
	.long	1148846080
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC23:
	.long	0
	.long	1080025088
	.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 <hip/hip_runtime.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cmath>


#define TILE_W 32 //Decrease to increment block count and decrement thread count
#define TILE_H 32 //Decrease to increment block count and decrement thread count
#define R 1
#define D ((R*2)+1)
#define S (D*D)


//For debug purposes
void printImageMatrix(unsigned char** image, int height, int width)
{
  for(int i = 0; i < height; i++)
    {
      for(int j = 0; j < width; j++)
        {
          std::cout << image[i][j] << " ";
        }
      std::cout << "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" << std::endl;
    }
}


unsigned char* char_flattenImage(unsigned char** image, int height, int width)
{
   unsigned char* image_1D = new unsigned char[height*width];
   for(int i = 0; i < height; i++)
      {
         for(int j = 0; j < width; j++)
	    {
	       image_1D[j + i*width] = image[i][j];
	    }
      }
   std::cout << "Char image flattened" << std::endl;
   return image_1D;
}

float* flattenImage(unsigned char** image, int height, int width)
{
   float* image_1D = new float[height*width];
   for(int i = 0; i < height; i++)
      {
         for(int j = 0; j < width; j++)
	    {
	       image_1D[j + i*width] = image[i][j];
	    }
      }
   std::cout << "Float image flattened" << std::endl;
   return image_1D;
}



void fileToMatrix(unsigned char** &image, char* fileName, int* height, int* width)
{
   std::ifstream imageFile(fileName);

   if(imageFile.is_open())
      {
	std::string line;
	getline(imageFile, line);
	std::istringstream iss(line);
	iss >> *(height) >> *(width);
	std::cout << "Height: " << *height << " ||-|| Width: " << *width << std::endl;

	image = new unsigned char*[*(height)];

	for(int i = 0; i < *(height); i++)
	   {
              image[i] = new unsigned char[*(width)];
           }	  

      	int h = 0;
      	int val;
        while(getline(imageFile, line))
           {
              int w = 0;
              std::istringstream iss(line);
              while(iss >> val)
                 {
                    image[h][w++] = val;
                 }
              h++;
           }
        std::cout << "Image saved to matrix..." << std::endl;
      }

    imageFile.close();      
}

void matrixToFile(char* fileName, unsigned char* image, int height, int width)
{
  std::ofstream outFile;
  outFile.open(fileName);
  outFile << height << " " << width << '\n';
  for(int i = 0; i < height*width; i++)
    {
	int x = i % width;
	int y = i / width;
	if(i != 0 && x == 0)
	   outFile << '\n';
        outFile << int(image[x + y*width]) << " ";
    }

  outFile.close();
}

void matrixToFile(char* fileName, float* image, int height, int width)
{
  std::ofstream outFile;
  outFile.open(fileName);
  outFile << height << " " << width << '\n';
  for(int i = 0; i < height*width; i++)
    {
	int x = i % width;
	int y = i / width;
	if(i != 0 && x == 0)
	   outFile << '\n';
        outFile << int(image[x + y*width]) << " ";
    }

  outFile.close();
}


void getMinAndMax(unsigned char** image, int height, int width, int* min, int* max)
{
   for(int i = 0; i < height; i++)
      {
         for(int j = 0; j < width; j++)
	    {
	       if(image[i][j] > *(max))
	          {
		     *max = image[i][j];
	          }
	       if(image[i][j] < *(min))
	          {
		     *min = image[i][j];
		  }
	    }
      }

   std::cout << "Min: " << *min << " ||-|| Max: " << *max << std::endl;
}

double getAverage(unsigned char** image, int height, int width)
{
	float sum = 0;

	for (int i = 0; i < height; i++)
	{
		for (int j = 0; j < width; j++)
		{
			sum += image[i][j];
		}
	}

	return sum / (width * height);
}


__global__ void linearScale(float* image, float* outImage, int* a, int* width, int* height, float* b)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   float u = image[index];
   outImage[index] = (*b) * (u + (*a));
}


__global__ void grayWorld(float* image, float* outImage, double* scalingValue, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   float u = image[index];
   outImage[index] = u * *scalingValue;
}

__global__ void reflection(float* image, float* outImage, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   int i = index / *width;
   int j = index - i * *width;

   int reflectedIndex = i * *width + (*width - j - 1);
   float u = image[reflectedIndex];
   outImage[index] = u;
}

__global__ void orderedDithering(float* image, float* outImage, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;
	
   int i = index / *width;
   int j = index - i * *width; 

   float u = image[index];

   if(i%2 == 0)
   {
   	if(j%2 == 0)
	{
 		if(u > 192)
			outImage[index] = 255;
		else
			outImage[index] = 0;
	}
	else
	{
		if(u > 64)
			outImage[index] = 255;
		else
			outImage[index] = 0;
	}
   }
   else
   {
	if(j%2 == 0)
		outImage[index] = 255;
	else
	{
		if(u > 128)
			outImage[index] = 255;
		else
			outImage[index] = 0;
	}
   }

}

__global__ void rotate90(float* result, float* image, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   int i = index / *width;
   int j = index - i * *width; 

   int rotatedIndex = (*width - j - 1) * *height + i;
   float u = image[index];
   result[rotatedIndex] = u;
}

__global__ void rotate180(float* result, float* image, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   int i = index / *width;
   int j = index - i * *width; 

   int rotatedIndex = (*height - i - 1) * *width + (*width - j - 1);
   float u = image[rotatedIndex];
   result[index] = u;
}


__global__ void medianFilter(unsigned char* image, unsigned char* outImage, int* height, int* width)
{
   int im_y = blockIdx.y * blockDim.y + threadIdx.y;
   int im_x = blockIdx.x * blockDim.x + threadIdx.x; 	
	
   if(im_y == 0 || im_y == (*height) - 1 || im_x == 0 || im_x == (*width) - 1)
   {
      outImage[im_y * (*width) + im_x] = 0;
      return;
   }

   int index = im_y * (*width) + im_x;

   if(index >= (*height) * (*width))
      return;

   int image_index;
   
   __shared__ unsigned char window[S];
   int window_index = 0;

   for(int i = -1; i <= 1; i++)
   {
      for(int j = -1; j <= 1; j++)
      {
         image_index = index + (i * (*width)) + j;
	 window[window_index++] = image[image_index];
      }
   }

   int key, i ,j;

   for(i = 1; i < S; i++)
   {
      key = window[i];
      j = i - 1;

      while(j >= 0 && window[j] > key)
      {
         window[j + 1] = window[j];
	 j = j - 1;
      }

      window[j + 1] = key;
   }

   outImage[index] = window[S/2];
}


int main(int argc, char** argv)
{
   char* inFileName = argv[1], *outFileName;
   int writeOut = atoi(argv[2]);

   //IMAGE INIT
   int height, width, max = -1, min = 256;
   unsigned char** hostImage;

   fileToMatrix(hostImage, inFileName, &height, &width);
   getMinAndMax(hostImage, height, width, &min, &max);
   float* hostFlattened = flattenImage(hostImage, height, width);  
   unsigned char* char_hostFlattened = char_flattenImage(hostImage, height, width);


   //GPU INIT
   const int image_size = sizeof(float) * (height*width);

   const int charImage_size = sizeof(unsigned char) * (height*width);
   unsigned char* char_deviceImage;

   float* deviceImage;
   float* hostResult = new float[height*width];

   hipEvent_t start, stop;
   hipEventCreate(&start);
   hipEventCreate(&stop);

   int BLOCK_H = (int)std::ceil((float)width / TILE_H);
   int BLOCK_W = (int)std::ceil((float)height / TILE_W);

   dim3 deviceBlocks(BLOCK_H, BLOCK_W);
   dim3 deviceThreads(TILE_H, TILE_W);

   int *height_d, *width_d;
   float time = 0;

   hipMalloc(&height_d, sizeof(int));
   hipMalloc(&width_d, sizeof(int));   

   hipMemcpy(height_d, &height, sizeof(int), hipMemcpyHostToDevice);         
   hipMemcpy(width_d, &width, sizeof(int), hipMemcpyHostToDevice);         

   hipMalloc(&deviceImage, image_size);
   hipMemcpy(deviceImage, hostFlattened, image_size, hipMemcpyHostToDevice);


   //*************************LINSCALE******************************//
   
   int a = -1 * min, *d_a;

   float gmax = 255.0;
   float b = gmax / (max - min), *d_b;

   float* linearScaleResult;

   hipMalloc(&linearScaleResult, image_size);  
   hipMalloc(&d_a, sizeof(int));
   hipMalloc(&d_b, sizeof(float));

   hipMemcpy(d_a, &a, sizeof(int), hipMemcpyHostToDevice);
   hipMemcpy(d_b, &b, sizeof(float), hipMemcpyHostToDevice);

   hipEventRecord(start, 0);

   linearScale<<<deviceBlocks, deviceThreads>>>(deviceImage, linearScaleResult, d_a, width_d, height_d, d_b);

   hipEventRecord(stop, 0);
   hipEventSynchronize(stop);
   hipEventElapsedTime(&time, start, stop);

   std::cout << "LinScale time: " << time/1000 << "sec" << std::endl;

   hipMemcpy(hostResult, linearScaleResult, image_size, hipMemcpyDeviceToHost);

   if(writeOut)
   {
      outFileName = "CUDA_linear_scale_.txt";
      matrixToFile(outFileName, hostResult, height, width);
   }

   hipFree(d_a);
   hipFree(d_b);
   hipFree(linearScaleResult);

   //*************************LINSCALE******************************//


   //*************************GRAYWORLD******************************// 

   double average = getAverage(hostImage, height, width);
   double scalingValue = 127.5 / average, *d_scale;;
   float* grayWorldResult;

   hipMalloc(&grayWorldResult, image_size);

   hipMalloc((void**)&d_scale, sizeof(double));
   hipMemcpy(d_scale, &scalingValue, sizeof(double), hipMemcpyHostToDevice);

   hipEventRecord(start, 0);
  
   grayWorld<<<deviceBlocks, deviceThreads>>>(deviceImage, grayWorldResult, d_scale, height_d, width_d);
   
   hipEventRecord(stop, 0);
   hipEventSynchronize(stop);
   hipEventElapsedTime(&time, start, stop);
   
   hipMemcpy(hostResult, grayWorldResult, image_size, hipMemcpyDeviceToHost);

   std::cout << "GrayWorld time: " << time/1000 << "sec" << std::endl;

   if(writeOut)
   {
      outFileName = "CUDA_gray_world_.txt";
      matrixToFile(outFileName, hostResult, height, width);
   }

   hipFree(grayWorldResult);
   hipFree(d_scale);

   //*************************GRAYWORLD******************************// 
      
  //REFLECTION
  
   float* reflectionResult;
   hipMalloc(&reflectionResult, image_size);

   hipEventRecord(start, 0);

   reflection<<<deviceBlocks, deviceThreads>>>(deviceImage, reflectionResult, height_d, width_d);
   
   hipEventRecord(stop, 0);
   hipEventSynchronize(stop);
   hipEventElapsedTime(&time, start, stop);
   
   hipMemcpy(hostResult, reflectionResult, image_size, hipMemcpyDeviceToHost);

   std::cout << "Reflection time: " << time/1000 << "sec" << std::endl;

   if(writeOut)
   {
      outFileName = "CUDA_reflection_.txt";
      matrixToFile(outFileName, hostResult, height, width);
   }

   hipFree(reflectionResult);

   //ORDERED DITHERING
  
   float* orderedDitheringResult;
   hipMalloc(&orderedDitheringResult, image_size);

   hipEventRecord(start, 0);

   orderedDithering<<<deviceBlocks, deviceThreads>>>(deviceImage, orderedDitheringResult, height_d, width_d);
   
   hipEventRecord(stop, 0);
   hipEventSynchronize(stop);
   hipEventElapsedTime(&time, start, stop);
   
   hipMemcpy(hostResult, orderedDitheringResult, image_size, hipMemcpyDeviceToHost);
     
   std::cout << "Ordered Dithering time: " << time/1000 << "sec" << std::endl;
    
   if(writeOut)
   {
      outFileName = "CUDA_dithering_.txt";
      matrixToFile(outFileName, hostResult, height, width);
   }
 
   hipFree(orderedDitheringResult);

   //ROTATE90
   float* result90;
   
   hipMalloc((void**)&result90, image_size);

   hipEventRecord(start, 0);

   rotate90<<<deviceBlocks, deviceThreads>>>(result90, deviceImage, height_d, width_d);
   
   hipEventRecord(stop, 0);
   hipEventSynchronize(stop);
   hipEventElapsedTime(&time, start, stop);
   
   hipMemcpy(hostResult, result90, image_size, hipMemcpyDeviceToHost);

   std::cout << "Rotation 90 time: " << time/1000 << "sec" << std::endl;

   if(writeOut)
   {
      outFileName = "CUDA_rotate_90_.txt";
      matrixToFile(outFileName, hostResult, width, height);
   }

   hipFree(result90);
      
   //ROTATE180
   float* result180;
   
   hipMalloc((void**)&result180, image_size);

   hipEventRecord(start, 0);

   rotate180<<<deviceBlocks, deviceThreads>>>(result180, deviceImage, height_d, width_d);
   
   hipEventRecord(stop, 0);
   hipEventSynchronize(stop);
   hipEventElapsedTime(&time, start, stop);
   
   hipMemcpy(hostResult, result180, image_size, hipMemcpyDeviceToHost);
   
   std::cout << "Rotation 180 time: " << time/1000 << "sec" << std::endl;

   if(writeOut)
   {
      outFileName = "CUDA_rotate_180_.txt";
      matrixToFile(outFileName, hostResult, height, width);
   }

   hipFree(result180);
   hipFree(deviceImage);
      
   //MEDFILTER


   unsigned char* outImage;
   unsigned char* charResult = new unsigned char[height*width];

   hipMalloc(&outImage, charImage_size);	

   hipMalloc(&char_deviceImage, charImage_size);
   hipMemcpy(char_deviceImage, char_hostFlattened, charImage_size, hipMemcpyHostToDevice);

   hipEventRecord(start);
   medianFilter<<<deviceBlocks, deviceThreads>>>(char_deviceImage, outImage, height_d, width_d);
   hipEventRecord(stop);

   hipEventSynchronize(stop);
   hipGetLastError();
   
   float elapsed = 0;
   hipEventElapsedTime(&elapsed, start, stop);
   
   std::cout << "Median Filter Time: " << elapsed / 1000 << std::endl;
   hipMemcpy(charResult, outImage, charImage_size, hipMemcpyDeviceToHost);

   if(writeOut)
   {
      outFileName = "CUDA_median_filter_.txt";
      matrixToFile(outFileName, charResult, height, width);
   }

   hipFree(char_deviceImage);
   hipFree(outImage);
   hipFree(height_d);
   hipFree(width_d);

   return 0;
}

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

                                        # End of file scope inline assembly
	.globl	_Z16printImageMatrixPPhii       # -- Begin function _Z16printImageMatrixPPhii
	.type	_Z16printImageMatrixPPhii,@function
_Z16printImageMatrixPPhii:              # @_Z16printImageMatrixPPhii
	.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	$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	%edx, 12(%rsp)                  # 4-byte Spill
	testl	%esi, %esi
	jle	.LBB0_7
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdi, %r14
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	12(%rsp), %ebp                  # 4-byte Reload
	xorl	%r13d, %r13d
	leaq	11(%rsp), %r15
.LBB0_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_4 Depth 2
	cmpl	$0, 12(%rsp)                    # 4-byte Folded Reload
	jle	.LBB0_6
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB0_2 Depth=1
	xorl	%ebx, %ebx
.LBB0_4:                                #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%r14,%r13,8), %rax
	movb	(%rax,%rbx), %al
	movb	%al, 11(%rsp)
	movq	_ZSt4cout(%rip), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, _ZSt4cout+16(%rcx)
	je	.LBB0_8
# %bb.5:                                #   in Loop: Header=BB0_4 Depth=2
	movl	$_ZSt4cout, %edi
	movl	$1, %edx
	movq	%r15, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%rax, %r12
	jmp	.LBB0_9
.LBB0_8:                                #   in Loop: Header=BB0_4 Depth=2
	movsbl	%al, %esi
	movl	$_ZSt4cout, %r12d
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.LBB0_9:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_h.exit
                                        #   in Loop: Header=BB0_4 Depth=2
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%r12, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%rbx
	cmpq	%rbx, %rbp
	jne	.LBB0_4
.LBB0_6:                                # %._crit_edge
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$75, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%r13
	cmpq	16(%rsp), %r13                  # 8-byte Folded Reload
	jne	.LBB0_2
.LBB0_7:                                # %._crit_edge11
	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
.Lfunc_end0:
	.size	_Z16printImageMatrixPPhii, .Lfunc_end0-_Z16printImageMatrixPPhii
	.cfi_endproc
                                        # -- End function
	.globl	_Z17char_flattenImagePPhii      # -- Begin function _Z17char_flattenImagePPhii
	.type	_Z17char_flattenImagePPhii,@function
_Z17char_flattenImagePPhii:             # @_Z17char_flattenImagePPhii
	.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
	pushq	%rax
	.cfi_def_cfa_offset 64
	.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	%edx, %ebp
	movl	%esi, %r12d
	movq	%rdi, %r14
	movl	%edx, %eax
	imull	%esi, %eax
	movslq	%eax, %rdi
	callq	_Znam
	movq	%rax, (%rsp)                    # 8-byte Spill
	testl	%r12d, %r12d
	jle	.LBB1_5
# %bb.1:                                # %.preheader.lr.ph
	movl	%ebp, %r15d
	movl	%r12d, %r12d
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
.LBB1_2:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	testl	%ebp, %ebp
	jle	.LBB1_4
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB1_2 Depth=1
	movl	%r13d, %edi
	addq	(%rsp), %rdi                    # 8-byte Folded Reload
	movq	(%r14,%rbx,8), %rsi
	movq	%r15, %rdx
	callq	memcpy@PLT
.LBB1_4:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	incq	%rbx
	addl	%ebp, %r13d
	cmpq	%rbx, %r12
	jne	.LBB1_2
.LBB1_5:                                # %._crit_edge19
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	(%rsp), %rax                    # 8-byte Reload
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z17char_flattenImagePPhii, .Lfunc_end1-_Z17char_flattenImagePPhii
	.cfi_endproc
                                        # -- End function
	.globl	_Z12flattenImagePPhii           # -- Begin function _Z12flattenImagePPhii
	.type	_Z12flattenImagePPhii,@function
_Z12flattenImagePPhii:                  # @_Z12flattenImagePPhii
	.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	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebp
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	%edx, %eax
	imull	%esi, %eax
	leaq	(,%rax,4), %rcx
	testl	%eax, %eax
	movq	$-1, %rdi
	cmovnsq	%rcx, %rdi
	callq	_Znam
	movq	%rax, %rbx
	testl	%r15d, %r15d
	jle	.LBB2_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%r15d, %eax
	movl	%ebp, %ecx
	xorl	%edx, %edx
	xorl	%esi, %esi
.LBB2_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_4 Depth 2
	testl	%ebp, %ebp
	jle	.LBB2_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	%edx, %edi
	leaq	(%rbx,%rdi,4), %rdi
	movq	(%r14,%rsi,8), %r8
	xorl	%r9d, %r9d
.LBB2_4:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%r8,%r9), %r10d
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r10d, %xmm0
	movss	%xmm0, (%rdi,%r9,4)
	incq	%r9
	cmpq	%r9, %rcx
	jne	.LBB2_4
.LBB2_5:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	incq	%rsi
	addl	%ebp, %edx
	cmpq	%rax, %rsi
	jne	.LBB2_2
.LBB2_6:                                # %._crit_edge19
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	%rbx, %rax
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.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	_Z12flattenImagePPhii, .Lfunc_end2-_Z12flattenImagePPhii
	.cfi_endproc
                                        # -- End function
	.globl	_Z12fileToMatrixRPPhPcPiS3_     # -- Begin function _Z12fileToMatrixRPPhPcPiS3_
	.type	_Z12fileToMatrixRPPhPcPiS3_,@function
_Z12fileToMatrixRPPhPcPiS3_:            # @_Z12fileToMatrixRPPhPcPiS3_
.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	$1336, %rsp                     # imm = 0x538
	.cfi_def_cfa_offset 1392
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rdi, %rbx
	leaq	48(%rsp), %r14
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
	leaq	168(%rsp), %rdi
	callq	_ZNKSt12__basic_fileIcE7is_openEv
	testb	%al, %al
	je	.LBB3_34
# %bb.1:
	leaq	32(%rsp), %rax
	movq	%rax, -16(%rax)
	movq	$0, -8(%rax)
	movb	$0, (%rax)
	movq	48(%rsp), %rax
	addq	-24(%rax), %r14
.Ltmp0:
	movq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp1:
# %bb.2:                                # %.noexc
.Ltmp2:
	movsbl	%al, %edx
	leaq	48(%rsp), %rdi
	leaq	16(%rsp), %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp3:
# %bb.3:                                # %_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit
.Ltmp5:
	leaq	568(%rsp), %rdi
	leaq	16(%rsp), %rsi
	movl	$8, %edx
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode
.Ltmp6:
# %bb.4:
.Ltmp8:
	leaq	568(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZNSirsERi
.Ltmp9:
# %bb.5:
.Ltmp10:
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_ZNSirsERi
.Ltmp11:
# %bb.6:
.Ltmp12:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$8, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp13:
# %bb.7:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movl	(%r12), %esi
.Ltmp14:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp15:
# %bb.8:
.Ltmp16:
	movq	%rax, %r13
	movl	$.L.str.5, %esi
	movl	$14, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp17:
# %bb.9:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit37
	movl	(%r15), %esi
.Ltmp18:
	movq	%r13, %rdi
	callq	_ZNSolsEi
.Ltmp19:
# %bb.10:
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
.Ltmp20:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp21:
# %bb.11:                               # %.noexc50
.Ltmp22:
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
.Ltmp23:
# %bb.12:                               # %.noexc51
.Ltmp24:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp25:
# %bb.13:                               # %_ZNSolsEPFRSoS_E.exit
	movslq	(%r12), %r14
	leaq	(,%r14,8), %rax
	testq	%r14, %r14
	movq	$-1, %rdi
	cmovnsq	%rax, %rdi
.Ltmp26:
	callq	_Znam
.Ltmp27:
# %bb.14:
	movl	%r14d, %r14d
	movq	%rax, (%rbx)
	testl	%r14d, %r14d
	jle	.LBB3_18
# %bb.15:                               # %.lr.ph
	movslq	(%r15), %r15
	xorl	%r12d, %r12d
.LBB3_16:                               # =>This Inner Loop Header: Depth=1
.Ltmp29:
	movq	%r15, %rdi
	callq	_Znam
.Ltmp30:
# %bb.17:                               #   in Loop: Header=BB3_16 Depth=1
	movq	(%rbx), %rcx
	movq	%rax, (%rcx,%r12,8)
	incq	%r12
	cmpq	%r12, %r14
	jne	.LBB3_16
.LBB3_18:                               # %._crit_edge
	xorl	%r14d, %r14d
	leaq	16(%rsp), %r12
	leaq	952(%rsp), %r13
	leaq	12(%rsp), %rbp
.LBB3_19:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_24 Depth 2
	movq	48(%rsp), %rax
	movq	-24(%rax), %rdi
	leaq	48(%rsp), %r15
	addq	%r15, %rdi
.Ltmp32:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp33:
# %bb.20:                               # %.noexc39
                                        #   in Loop: Header=BB3_19 Depth=1
.Ltmp34:
	movsbl	%al, %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp35:
# %bb.21:                               #   in Loop: Header=BB3_19 Depth=1
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB3_28
# %bb.22:                               #   in Loop: Header=BB3_19 Depth=1
.Ltmp49:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	$8, %edx
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEC1ERKNS_12basic_stringIcS2_S3_EESt13_Ios_Openmode
.Ltmp50:
# %bb.23:                               # %.preheader.preheader
                                        #   in Loop: Header=BB3_19 Depth=1
	xorl	%r15d, %r15d
.LBB3_24:                               # %.preheader
                                        #   Parent Loop BB3_19 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
.Ltmp52:
	movq	%r13, %rdi
	movq	%rbp, %rsi
	callq	_ZNSirsERi
.Ltmp53:
# %bb.25:                               #   in Loop: Header=BB3_24 Depth=2
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB3_27
# %bb.26:                               #   in Loop: Header=BB3_24 Depth=2
	movb	12(%rsp), %al
	movq	(%rbx), %rcx
	movq	(%rcx,%r14,8), %rcx
	movb	%al, (%rcx,%r15)
	incq	%r15
	jmp	.LBB3_24
.LBB3_27:                               #   in Loop: Header=BB3_19 Depth=1
	incq	%r14
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	movq	%r13, %rdi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	1072(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	jmp	.LBB3_19
.LBB3_28:
.Ltmp37:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$24, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp38:
# %bb.29:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit44
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp39:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp40:
# %bb.30:                               # %.noexc53
.Ltmp41:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp42:
# %bb.31:                               # %.noexc54
.Ltmp43:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp44:
# %bb.32:                               # %_ZNSolsEPFRSoS_E.exit46
	leaq	568(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	688(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	movq	16(%rsp), %rdi
	leaq	32(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB3_34
# %bb.33:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB3_34:
.Ltmp46:
	leaq	48(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp47:
# %bb.35:
	leaq	48(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	addq	$1336, %rsp                     # imm = 0x538
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB3_36:
	.cfi_def_cfa_offset 1392
.Ltmp7:
	jmp	.LBB3_39
.LBB3_37:
.Ltmp48:
	movq	%rax, %rbx
	jmp	.LBB3_50
.LBB3_38:
.Ltmp4:
.LBB3_39:
	movq	%rax, %rbx
	jmp	.LBB3_48
.LBB3_40:                               # %.loopexit.split-lp
.Ltmp45:
	jmp	.LBB3_45
.LBB3_41:
.Ltmp28:
	jmp	.LBB3_45
.LBB3_42:
.Ltmp31:
	jmp	.LBB3_45
.LBB3_43:
.Ltmp51:
	jmp	.LBB3_45
.LBB3_44:                               # %.loopexit
.Ltmp36:
.LBB3_45:
	movq	%rax, %rbx
	jmp	.LBB3_47
.LBB3_46:
.Ltmp54:
	movq	%rax, %rbx
	leaq	952(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	1072(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
.LBB3_47:
	leaq	568(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	688(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
.LBB3_48:
	leaq	32(%rsp), %rax
	movq	16(%rsp), %rdi
	cmpq	%rax, %rdi
	je	.LBB3_50
# %bb.49:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i47
	callq	_ZdlPv
.LBB3_50:
	leaq	48(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end3:
	.size	_Z12fileToMatrixRPPhPcPiS3_, .Lfunc_end3-_Z12fileToMatrixRPPhPcPiS3_
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table3:
.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 .Ltmp3-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp3
	.uleb128 .Ltmp4-.Lfunc_begin0           #     jumps to .Ltmp4
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp5-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp6-.Ltmp5                  #   Call between .Ltmp5 and .Ltmp6
	.uleb128 .Ltmp7-.Lfunc_begin0           #     jumps to .Ltmp7
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp27-.Ltmp8                 #   Call between .Ltmp8 and .Ltmp27
	.uleb128 .Ltmp28-.Lfunc_begin0          #     jumps to .Ltmp28
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp29-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp30-.Ltmp29                #   Call between .Ltmp29 and .Ltmp30
	.uleb128 .Ltmp31-.Lfunc_begin0          #     jumps to .Ltmp31
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp32-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp35-.Ltmp32                #   Call between .Ltmp32 and .Ltmp35
	.uleb128 .Ltmp36-.Lfunc_begin0          #     jumps to .Ltmp36
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp49-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp50-.Ltmp49                #   Call between .Ltmp49 and .Ltmp50
	.uleb128 .Ltmp51-.Lfunc_begin0          #     jumps to .Ltmp51
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp52-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp53-.Ltmp52                #   Call between .Ltmp52 and .Ltmp53
	.uleb128 .Ltmp54-.Lfunc_begin0          #     jumps to .Ltmp54
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp37-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp44-.Ltmp37                #   Call between .Ltmp37 and .Ltmp44
	.uleb128 .Ltmp45-.Lfunc_begin0          #     jumps to .Ltmp45
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp46-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp47-.Ltmp46                #   Call between .Ltmp46 and .Ltmp47
	.uleb128 .Ltmp48-.Lfunc_begin0          #     jumps to .Ltmp48
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp47-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Lfunc_end3-.Ltmp47            #   Call between .Ltmp47 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z12matrixToFilePcPhii          # -- Begin function _Z12matrixToFilePcPhii
	.type	_Z12matrixToFilePcPhii,@function
_Z12matrixToFilePcPhii:                 # @_Z12matrixToFilePcPhii
.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	$520, %rsp                      # imm = 0x208
	.cfi_def_cfa_offset 576
	.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, %ebx
	movl	%edx, %ebp
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	8(%rsp), %r12
	movq	%r12, %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev
.Ltmp55:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
.Ltmp56:
# %bb.1:
.Ltmp57:
	leaq	8(%rsp), %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp58:
# %bb.2:
.Ltmp59:
	movq	%rax, %r15
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp60:
# %bb.3:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp61:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ZNSolsEi
.Ltmp62:
# %bb.4:
	movb	$10, 7(%rsp)
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%rax,%rcx)
	je	.LBB4_6
# %bb.5:
.Ltmp63:
	leaq	7(%rsp), %rsi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp64:
	jmp	.LBB4_7
.LBB4_6:
.Ltmp65:
	movq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp66:
.LBB4_7:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c.exit
	imull	%ebx, %ebp
	testl	%ebp, %ebp
	jle	.LBB4_17
# %bb.8:                                # %.lr.ph.preheader
	movl	%ebp, %ebp
	xorl	%r15d, %r15d
	leaq	8(%rsp), %r12
	leaq	7(%rsp), %r13
.LBB4_9:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	%r15d, %eax
	cltd
	idivl	%ebx
	testq	%r15, %r15
	je	.LBB4_14
# %bb.10:                               # %.lr.ph
                                        #   in Loop: Header=BB4_9 Depth=1
	testl	%edx, %edx
	jne	.LBB4_14
# %bb.11:                               #   in Loop: Header=BB4_9 Depth=1
	movb	$10, 7(%rsp)
	movq	8(%rsp), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 24(%rsp,%rax)
	je	.LBB4_13
# %bb.12:                               #   in Loop: Header=BB4_9 Depth=1
.Ltmp67:
	movl	$1, %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp68:
	jmp	.LBB4_14
.LBB4_13:                               #   in Loop: Header=BB4_9 Depth=1
.Ltmp69:
	movq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp70:
.LBB4_14:                               #   in Loop: Header=BB4_9 Depth=1
	movzbl	(%r14,%r15), %esi
.Ltmp71:
	movq	%r12, %rdi
	callq	_ZNSolsEi
.Ltmp72:
# %bb.15:                               #   in Loop: Header=BB4_9 Depth=1
.Ltmp73:
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp74:
# %bb.16:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit29
                                        #   in Loop: Header=BB4_9 Depth=1
	incq	%r15
	cmpq	%r15, %rbp
	jne	.LBB4_9
.LBB4_17:                               # %._crit_edge
.Ltmp76:
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp77:
# %bb.18:
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	16(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 8(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	256(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	addq	$520, %rsp                      # imm = 0x208
	.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
.LBB4_19:
	.cfi_def_cfa_offset 576
.Ltmp78:
	jmp	.LBB4_20
.LBB4_21:
.Ltmp75:
.LBB4_20:
	movq	%rax, %rbx
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end4:
	.size	_Z12matrixToFilePcPhii, .Lfunc_end4-_Z12matrixToFilePcPhii
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table4:
.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 .Ltmp55-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp55
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp55-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp66-.Ltmp55                #   Call between .Ltmp55 and .Ltmp66
	.uleb128 .Ltmp78-.Lfunc_begin1          #     jumps to .Ltmp78
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp67-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp74-.Ltmp67                #   Call between .Ltmp67 and .Ltmp74
	.uleb128 .Ltmp75-.Lfunc_begin1          #     jumps to .Ltmp75
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp76-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp77-.Ltmp76                #   Call between .Ltmp76 and .Ltmp77
	.uleb128 .Ltmp78-.Lfunc_begin1          #     jumps to .Ltmp78
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp77-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Lfunc_end4-.Ltmp77            #   Call between .Ltmp77 and .Lfunc_end4
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z12matrixToFilePcPfii          # -- Begin function _Z12matrixToFilePcPfii
	.type	_Z12matrixToFilePcPfii,@function
_Z12matrixToFilePcPfii:                 # @_Z12matrixToFilePcPfii
.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	$520, %rsp                      # imm = 0x208
	.cfi_def_cfa_offset 576
	.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, %ebx
	movl	%edx, %ebp
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	8(%rsp), %r12
	movq	%r12, %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev
.Ltmp79:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
.Ltmp80:
# %bb.1:
.Ltmp81:
	leaq	8(%rsp), %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp82:
# %bb.2:
.Ltmp83:
	movq	%rax, %r15
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp84:
# %bb.3:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp85:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ZNSolsEi
.Ltmp86:
# %bb.4:
	movb	$10, 7(%rsp)
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%rax,%rcx)
	je	.LBB5_6
# %bb.5:
.Ltmp87:
	leaq	7(%rsp), %rsi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp88:
	jmp	.LBB5_7
.LBB5_6:
.Ltmp89:
	movq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp90:
.LBB5_7:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c.exit
	imull	%ebx, %ebp
	testl	%ebp, %ebp
	jle	.LBB5_17
# %bb.8:                                # %.lr.ph.preheader
	movl	%ebp, %ebp
	xorl	%r15d, %r15d
	leaq	8(%rsp), %r12
	leaq	7(%rsp), %r13
.LBB5_9:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	%r15d, %eax
	cltd
	idivl	%ebx
	testq	%r15, %r15
	je	.LBB5_14
# %bb.10:                               # %.lr.ph
                                        #   in Loop: Header=BB5_9 Depth=1
	testl	%edx, %edx
	jne	.LBB5_14
# %bb.11:                               #   in Loop: Header=BB5_9 Depth=1
	movb	$10, 7(%rsp)
	movq	8(%rsp), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 24(%rsp,%rax)
	je	.LBB5_13
# %bb.12:                               #   in Loop: Header=BB5_9 Depth=1
.Ltmp91:
	movl	$1, %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp92:
	jmp	.LBB5_14
.LBB5_13:                               #   in Loop: Header=BB5_9 Depth=1
.Ltmp93:
	movq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNSo3putEc
.Ltmp94:
.LBB5_14:                               #   in Loop: Header=BB5_9 Depth=1
	cvttss2si	(%r14,%r15,4), %esi
.Ltmp95:
	movq	%r12, %rdi
	callq	_ZNSolsEi
.Ltmp96:
# %bb.15:                               #   in Loop: Header=BB5_9 Depth=1
.Ltmp97:
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp98:
# %bb.16:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit29
                                        #   in Loop: Header=BB5_9 Depth=1
	incq	%r15
	cmpq	%r15, %rbp
	jne	.LBB5_9
.LBB5_17:                               # %._crit_edge
.Ltmp100:
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp101:
# %bb.18:
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	16(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 8(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	256(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	addq	$520, %rsp                      # imm = 0x208
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB5_19:
	.cfi_def_cfa_offset 576
.Ltmp102:
	jmp	.LBB5_20
.LBB5_21:
.Ltmp99:
.LBB5_20:
	movq	%rax, %rbx
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end5:
	.size	_Z12matrixToFilePcPfii, .Lfunc_end5-_Z12matrixToFilePcPfii
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table5:
.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 .Ltmp79-.Lfunc_begin2          #   Call between .Lfunc_begin2 and .Ltmp79
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp79-.Lfunc_begin2          # >> Call Site 2 <<
	.uleb128 .Ltmp90-.Ltmp79                #   Call between .Ltmp79 and .Ltmp90
	.uleb128 .Ltmp102-.Lfunc_begin2         #     jumps to .Ltmp102
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp91-.Lfunc_begin2          # >> Call Site 3 <<
	.uleb128 .Ltmp98-.Ltmp91                #   Call between .Ltmp91 and .Ltmp98
	.uleb128 .Ltmp99-.Lfunc_begin2          #     jumps to .Ltmp99
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp100-.Lfunc_begin2         # >> Call Site 4 <<
	.uleb128 .Ltmp101-.Ltmp100              #   Call between .Ltmp100 and .Ltmp101
	.uleb128 .Ltmp102-.Lfunc_begin2         #     jumps to .Ltmp102
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp101-.Lfunc_begin2         # >> Call Site 5 <<
	.uleb128 .Lfunc_end5-.Ltmp101           #   Call between .Ltmp101 and .Lfunc_end5
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z12getMinAndMaxPPhiiPiS1_      # -- Begin function _Z12getMinAndMaxPPhiiPiS1_
	.type	_Z12getMinAndMaxPPhiiPiS1_,@function
_Z12getMinAndMaxPPhiiPiS1_:             # @_Z12getMinAndMaxPPhiiPiS1_
	.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
	movq	%r8, %rbx
	movq	%rcx, %r14
	testl	%esi, %esi
	jle	.LBB6_10
# %bb.1:                                # %.preheader.lr.ph
	movl	%esi, %eax
	movl	%edx, %ecx
	xorl	%esi, %esi
.LBB6_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_4 Depth 2
	testl	%edx, %edx
	jle	.LBB6_9
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB6_2 Depth=1
	movq	(%rdi,%rsi,8), %r8
	xorl	%r9d, %r9d
.LBB6_4:                                #   Parent Loop BB6_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%r8,%r9), %r10d
	cmpl	%r10d, (%rbx)
	jge	.LBB6_6
# %bb.5:                                #   in Loop: Header=BB6_4 Depth=2
	movl	%r10d, (%rbx)
	movzbl	(%r8,%r9), %r10d
.LBB6_6:                                #   in Loop: Header=BB6_4 Depth=2
	cmpl	%r10d, (%r14)
	jle	.LBB6_8
# %bb.7:                                #   in Loop: Header=BB6_4 Depth=2
	movl	%r10d, (%r14)
.LBB6_8:                                #   in Loop: Header=BB6_4 Depth=2
	incq	%r9
	cmpq	%r9, %rcx
	jne	.LBB6_4
.LBB6_9:                                # %._crit_edge
                                        #   in Loop: Header=BB6_2 Depth=1
	incq	%rsi
	cmpq	%rax, %rsi
	jne	.LBB6_2
.LBB6_10:                               # %._crit_edge28
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$5, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	(%r14), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movl	$.L.str.8, %esi
	movl	$12, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZNSo5flushEv                   # TAILCALL
.Lfunc_end6:
	.size	_Z12getMinAndMaxPPhiiPiS1_, .Lfunc_end6-_Z12getMinAndMaxPPhiiPiS1_
	.cfi_endproc
                                        # -- End function
	.globl	_Z10getAveragePPhii             # -- Begin function _Z10getAveragePPhii
	.type	_Z10getAveragePPhii,@function
_Z10getAveragePPhii:                    # @_Z10getAveragePPhii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB7_1
# %bb.3:                                # %.preheader.lr.ph
	movl	%esi, %eax
	movl	%edx, %ecx
	xorps	%xmm0, %xmm0
	xorl	%r8d, %r8d
.LBB7_4:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_6 Depth 2
	testl	%edx, %edx
	jle	.LBB7_7
# %bb.5:                                # %.lr.ph
                                        #   in Loop: Header=BB7_4 Depth=1
	movq	(%rdi,%r8,8), %r9
	xorl	%r10d, %r10d
.LBB7_6:                                #   Parent Loop BB7_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%r9,%r10), %r11d
	xorps	%xmm1, %xmm1
	cvtsi2ss	%r11d, %xmm1
	addss	%xmm1, %xmm0
	incq	%r10
	cmpq	%r10, %rcx
	jne	.LBB7_6
.LBB7_7:                                # %._crit_edge
                                        #   in Loop: Header=BB7_4 Depth=1
	incq	%r8
	cmpq	%rax, %r8
	jne	.LBB7_4
	jmp	.LBB7_2
.LBB7_1:
	xorps	%xmm0, %xmm0
.LBB7_2:                                # %._crit_edge19
	imull	%esi, %edx
	xorps	%xmm1, %xmm1
	cvtsi2ss	%edx, %xmm1
	divss	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	retq
.Lfunc_end7:
	.size	_Z10getAveragePPhii, .Lfunc_end7-_Z10getAveragePPhii
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__linearScalePfS_PiS0_S0_S_ # -- Begin function _Z26__device_stub__linearScalePfS_PiS0_S0_S_
	.type	_Z26__device_stub__linearScalePfS_PiS0_S0_S_,@function
_Z26__device_stub__linearScalePfS_PiS0_S0_S_: # @_Z26__device_stub__linearScalePfS_PiS0_S0_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$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	$_Z11linearScalePfS_PiS0_S0_S_, %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_end8:
	.size	_Z26__device_stub__linearScalePfS_PiS0_S0_S_, .Lfunc_end8-_Z26__device_stub__linearScalePfS_PiS0_S0_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__grayWorldPfS_PdPiS1_ # -- Begin function _Z24__device_stub__grayWorldPfS_PdPiS1_
	.type	_Z24__device_stub__grayWorldPfS_PdPiS1_,@function
_Z24__device_stub__grayWorldPfS_PdPiS1_: # @_Z24__device_stub__grayWorldPfS_PdPiS1_
	.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	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9grayWorldPfS_PdPiS1_, %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_end9:
	.size	_Z24__device_stub__grayWorldPfS_PdPiS1_, .Lfunc_end9-_Z24__device_stub__grayWorldPfS_PdPiS1_
	.cfi_endproc
                                        # -- End function
	.globl	_Z25__device_stub__reflectionPfS_PiS0_ # -- Begin function _Z25__device_stub__reflectionPfS_PiS0_
	.type	_Z25__device_stub__reflectionPfS_PiS0_,@function
_Z25__device_stub__reflectionPfS_PiS0_: # @_Z25__device_stub__reflectionPfS_PiS0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z10reflectionPfS_PiS0_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end10:
	.size	_Z25__device_stub__reflectionPfS_PiS0_, .Lfunc_end10-_Z25__device_stub__reflectionPfS_PiS0_
	.cfi_endproc
                                        # -- End function
	.globl	_Z31__device_stub__orderedDitheringPfS_PiS0_ # -- Begin function _Z31__device_stub__orderedDitheringPfS_PiS0_
	.type	_Z31__device_stub__orderedDitheringPfS_PiS0_,@function
_Z31__device_stub__orderedDitheringPfS_PiS0_: # @_Z31__device_stub__orderedDitheringPfS_PiS0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z16orderedDitheringPfS_PiS0_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_Z31__device_stub__orderedDitheringPfS_PiS0_, .Lfunc_end11-_Z31__device_stub__orderedDitheringPfS_PiS0_
	.cfi_endproc
                                        # -- End function
	.globl	_Z23__device_stub__rotate90PfS_PiS0_ # -- Begin function _Z23__device_stub__rotate90PfS_PiS0_
	.type	_Z23__device_stub__rotate90PfS_PiS0_,@function
_Z23__device_stub__rotate90PfS_PiS0_:   # @_Z23__device_stub__rotate90PfS_PiS0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z8rotate90PfS_PiS0_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end12:
	.size	_Z23__device_stub__rotate90PfS_PiS0_, .Lfunc_end12-_Z23__device_stub__rotate90PfS_PiS0_
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__rotate180PfS_PiS0_ # -- Begin function _Z24__device_stub__rotate180PfS_PiS0_
	.type	_Z24__device_stub__rotate180PfS_PiS0_,@function
_Z24__device_stub__rotate180PfS_PiS0_:  # @_Z24__device_stub__rotate180PfS_PiS0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z9rotate180PfS_PiS0_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end13:
	.size	_Z24__device_stub__rotate180PfS_PiS0_, .Lfunc_end13-_Z24__device_stub__rotate180PfS_PiS0_
	.cfi_endproc
                                        # -- End function
	.globl	_Z27__device_stub__medianFilterPhS_PiS0_ # -- Begin function _Z27__device_stub__medianFilterPhS_PiS0_
	.type	_Z27__device_stub__medianFilterPhS_PiS0_,@function
_Z27__device_stub__medianFilterPhS_PiS0_: # @_Z27__device_stub__medianFilterPhS_PiS0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z12medianFilterPhS_PiS0_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end14:
	.size	_Z27__device_stub__medianFilterPhS_PiS0_, .Lfunc_end14-_Z27__device_stub__medianFilterPhS_PiS0_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI15_0:
	.long	0x3d000000                      # float 0.03125
.LCPI15_1:
	.long	0x437f0000                      # float 255
.LCPI15_2:
	.long	0x447a0000                      # float 1000
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI15_3:
	.quad	0x405fe00000000000              # double 127.5
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$232, %rsp
	.cfi_def_cfa_offset 288
	.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	8(%rsi), %r15
	movq	16(%rsi), %rdi
	callq	atoi
	movl	%eax, 28(%rsp)                  # 4-byte Spill
	leaq	148(%rsp), %rbx
	movl	$-1, (%rbx)
	leaq	144(%rsp), %r14
	movl	$256, (%r14)                    # imm = 0x100
	leaq	224(%rsp), %r13
	leaq	24(%rsp), %rbp
	leaq	20(%rsp), %r12
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%rbp, %rdx
	movq	%r12, %rcx
	callq	_Z12fileToMatrixRPPhPcPiS3_
	movq	(%r13), %r15
	movl	(%rbp), %esi
	movl	(%r12), %edx
	movq	%r15, %rdi
	movq	%r14, %rcx
	movq	%rbx, %r8
	callq	_Z12getMinAndMaxPPhiiPiS1_
	movl	(%rbp), %esi
	movl	(%r12), %edx
	movq	%r15, %rdi
	callq	_Z12flattenImagePPhii
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	movl	(%rbp), %esi
	movl	(%r12), %edx
	movq	%r15, %rdi
	callq	_Z17char_flattenImagePPhii
	movq	%rax, 192(%rsp)                 # 8-byte Spill
	movslq	(%rbp), %rax
	movslq	(%r12), %rcx
	imulq	%rax, %rcx
	leal	(,%rcx,4), %eax
	movl	%eax, 136(%rsp)                 # 4-byte Spill
	leaq	(,%rcx,4), %rax
	movq	%rcx, 200(%rsp)                 # 8-byte Spill
	testl	%ecx, %ecx
	movq	$-1, %rdi
	cmovnsq	%rax, %rdi
	callq	_Znam
	movq	%rax, 184(%rsp)                 # 8-byte Spill
	leaq	32(%rsp), %rdi
	callq	hipEventCreate
	leaq	8(%rsp), %rdi
	callq	hipEventCreate
	cvtsi2ssl	(%r12), %xmm0
	mulss	.LCPI15_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %ebx
	xorps	%xmm0, %xmm0
	cvtsi2ssl	(%rbp), %xmm0
	mulss	.LCPI15_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %r14d
	shlq	$32, %r14
	orq	%rbx, %r14
	movl	$0, 44(%rsp)
	leaq	56(%rsp), %rbx
	movl	$4, %esi
	movq	%rbx, %rdi
	callq	hipMalloc
	leaq	48(%rsp), %r13
	movl	$4, %esi
	movq	%r13, %rdi
	callq	hipMalloc
	movq	(%rbx), %rdi
	movl	$4, %edx
	movq	%rbp, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r13), %rdi
	movl	$4, %edx
	movq	%r12, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movslq	136(%rsp), %r12                 # 4-byte Folded Reload
	leaq	64(%rsp), %rbx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movq	(%rbx), %rdi
	movq	72(%rsp), %rsi                  # 8-byte Reload
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	144(%rsp), %rax
	movl	(%rax), %eax
	leaq	148(%rsp), %rcx
	movl	(%rcx), %ecx
	subl	%eax, %ecx
	negl	%eax
	leaq	212(%rsp), %rbx
	movl	%eax, (%rbx)
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ecx, %xmm0
	movss	.LCPI15_1(%rip), %xmm1          # xmm1 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm1
	leaq	140(%rsp), %rax
	movss	%xmm1, (%rax)
	leaq	128(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	leaq	168(%rsp), %r13
	movl	$4, %esi
	movq	%r13, %rdi
	callq	hipMalloc
	leaq	160(%rsp), %rbp
	movl	$4, %esi
	movq	%rbp, %rdi
	callq	hipMalloc
	movq	(%r13), %rdi
	movl	$4, %edx
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rbp), %rdi
	movl	$4, %edx
	leaq	140(%rsp), %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%r14, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB15_2
# %bb.1:
	movq	64(%rsp), %rdi
	movq	128(%rsp), %rsi
	movq	168(%rsp), %rdx
	movq	48(%rsp), %rcx
	movq	56(%rsp), %r8
	movq	160(%rsp), %r9
	callq	_Z26__device_stub__linearScalePfS_PiS0_S0_S_
.LBB15_2:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	movq	32(%rsp), %rsi
	movq	8(%rsp), %rdx
	leaq	44(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movss	(%rbx), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI15_2(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.10, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	128(%rsp), %rsi
	movq	184(%rsp), %rbx                 # 8-byte Reload
	movq	%rbx, %rdi
	movq	%r12, %rbp
	movq	%r12, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	cmpl	$0, 28(%rsp)                    # 4-byte Folded Reload
	movq	%rbx, %r12
	je	.LBB15_4
# %bb.3:
	movl	24(%rsp), %edx
	movl	20(%rsp), %ecx
	movl	$.L.str.11, %edi
	movq	%r12, %rsi
	callq	_Z12matrixToFilePcPfii
.LBB15_4:
	movq	168(%rsp), %rdi
	callq	hipFree
	movq	160(%rsp), %rdi
	callq	hipFree
	movq	128(%rsp), %rdi
	callq	hipFree
	movl	24(%rsp), %eax
	movl	20(%rsp), %ecx
	testl	%eax, %eax
	movq	%r14, 72(%rsp)                  # 8-byte Spill
	xorps	%xmm0, %xmm0
	jle	.LBB15_10
# %bb.5:                                # %.preheader.lr.ph.i
	xorl	%edx, %edx
.LBB15_6:                               # %.preheader.i
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB15_8 Depth 2
	testl	%ecx, %ecx
	jle	.LBB15_9
# %bb.7:                                # %.lr.ph.i
                                        #   in Loop: Header=BB15_6 Depth=1
	movq	(%r15,%rdx,8), %rsi
	xorl	%edi, %edi
.LBB15_8:                               #   Parent Loop BB15_6 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%rsi,%rdi), %r8d
	xorps	%xmm1, %xmm1
	cvtsi2ss	%r8d, %xmm1
	addss	%xmm1, %xmm0
	incq	%rdi
	cmpq	%rdi, %rcx
	jne	.LBB15_8
.LBB15_9:                               # %._crit_edge.i
                                        #   in Loop: Header=BB15_6 Depth=1
	incq	%rdx
	cmpq	%rax, %rdx
	jne	.LBB15_6
.LBB15_10:                              # %_Z10getAveragePPhii.exit
	imull	%ecx, %eax
	xorps	%xmm1, %xmm1
	cvtsi2ss	%eax, %xmm1
	divss	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	movsd	.LCPI15_3(%rip), %xmm1          # xmm1 = mem[0],zero
	divsd	%xmm0, %xmm1
	leaq	216(%rsp), %rbx
	movsd	%xmm1, (%rbx)
	leaq	120(%rsp), %rdi
	movq	%rbp, %r15
	movq	%rbp, %rsi
	callq	hipMalloc
	leaq	152(%rsp), %r14
	movl	$8, %esi
	movq	%r14, %rdi
	callq	hipMalloc
	movq	(%r14), %rdi
	movl	$8, %edx
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	72(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB15_12
# %bb.11:
	movq	64(%rsp), %rdi
	movq	120(%rsp), %rsi
	movq	152(%rsp), %rdx
	movq	56(%rsp), %rcx
	movq	48(%rsp), %r8
	callq	_Z24__device_stub__grayWorldPfS_PdPiS1_
.LBB15_12:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	movq	32(%rsp), %rsi
	movq	8(%rsp), %rdx
	leaq	44(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	movq	120(%rsp), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movss	(%rbx), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI15_2(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.10, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	cmpl	$0, 28(%rsp)                    # 4-byte Folded Reload
	movq	200(%rsp), %r15                 # 8-byte Reload
	je	.LBB15_14
# %bb.13:
	movl	24(%rsp), %edx
	movl	20(%rsp), %ecx
	movl	$.L.str.13, %edi
	movq	%r12, %rsi
	callq	_Z12matrixToFilePcPfii
.LBB15_14:
	movq	120(%rsp), %rdi
	callq	hipFree
	movq	152(%rsp), %rdi
	callq	hipFree
	leaq	112(%rsp), %rdi
	movq	%rbp, %r13
	movq	%rbp, %rsi
	callq	hipMalloc
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%r14, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB15_16
# %bb.15:
	movq	64(%rsp), %rdi
	movq	112(%rsp), %rsi
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rcx
	callq	_Z25__device_stub__reflectionPfS_PiS0_
.LBB15_16:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	movq	32(%rsp), %rsi
	movq	8(%rsp), %rdx
	leaq	44(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	movq	112(%rsp), %rsi
	movq	%r12, %rdi
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$_ZSt4cout, %edi
	movl	$.L.str.14, %esi
	movl	$17, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movss	(%rbx), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI15_2(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.10, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	cmpl	$0, 28(%rsp)                    # 4-byte Folded Reload
	je	.LBB15_18
# %bb.17:
	movl	24(%rsp), %edx
	movl	20(%rsp), %ecx
	movl	$.L.str.15, %edi
	movq	%r12, %rsi
	callq	_Z12matrixToFilePcPfii
.LBB15_18:
	movq	112(%rsp), %rdi
	callq	hipFree
	leaq	104(%rsp), %rdi
	movq	%rbp, %r13
	movq	%rbp, %rsi
	callq	hipMalloc
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%r14, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB15_20
# %bb.19:
	movq	64(%rsp), %rdi
	movq	104(%rsp), %rsi
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rcx
	callq	_Z31__device_stub__orderedDitheringPfS_PiS0_
.LBB15_20:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	movq	32(%rsp), %rsi
	movq	8(%rsp), %rdx
	leaq	44(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	movq	104(%rsp), %rsi
	movq	%r12, %rdi
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$_ZSt4cout, %edi
	movl	$.L.str.16, %esi
	movl	$24, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movss	(%rbx), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI15_2(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.10, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	cmpl	$0, 28(%rsp)                    # 4-byte Folded Reload
	je	.LBB15_22
# %bb.21:
	movl	24(%rsp), %edx
	movl	20(%rsp), %ecx
	movl	$.L.str.17, %edi
	movq	%r12, %rsi
	callq	_Z12matrixToFilePcPfii
.LBB15_22:
	movq	104(%rsp), %rdi
	callq	hipFree
	leaq	96(%rsp), %rdi
	movq	%rbp, %r13
	movq	%rbp, %rsi
	callq	hipMalloc
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%r14, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB15_24
# %bb.23:
	movq	96(%rsp), %rdi
	movq	64(%rsp), %rsi
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rcx
	callq	_Z23__device_stub__rotate90PfS_PiS0_
.LBB15_24:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	movq	32(%rsp), %rsi
	movq	8(%rsp), %rdx
	leaq	44(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	movq	96(%rsp), %rsi
	movq	%r12, %rdi
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$_ZSt4cout, %edi
	movl	$.L.str.18, %esi
	movl	$18, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movss	(%rbx), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI15_2(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.10, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	cmpl	$0, 28(%rsp)                    # 4-byte Folded Reload
	je	.LBB15_26
# %bb.25:
	movl	20(%rsp), %edx
	movl	24(%rsp), %ecx
	movl	$.L.str.19, %edi
	movq	%r12, %rsi
	callq	_Z12matrixToFilePcPfii
.LBB15_26:
	movq	96(%rsp), %rdi
	callq	hipFree
	leaq	88(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%r14, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB15_28
# %bb.27:
	movq	88(%rsp), %rdi
	movq	64(%rsp), %rsi
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rcx
	callq	_Z24__device_stub__rotate180PfS_PiS0_
.LBB15_28:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	movq	32(%rsp), %rsi
	movq	8(%rsp), %rdx
	leaq	44(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	movq	88(%rsp), %rsi
	movq	%r12, %rdi
	movq	%rbp, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$_ZSt4cout, %edi
	movl	$.L.str.20, %esi
	movl	$19, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movss	(%rbx), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI15_2(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.10, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	cmpl	$0, 28(%rsp)                    # 4-byte Folded Reload
	je	.LBB15_30
# %bb.29:
	movl	24(%rsp), %edx
	movl	20(%rsp), %ecx
	movl	$.L.str.21, %edi
	movq	%r12, %rsi
	callq	_Z12matrixToFilePcPfii
.LBB15_30:
	movq	88(%rsp), %rdi
	callq	hipFree
	movq	64(%rsp), %rdi
	callq	hipFree
	movslq	24(%rsp), %rax
	movslq	20(%rsp), %rdi
	imulq	%rax, %rdi
	callq	_Znam
	movq	%rax, %rbx
	leaq	80(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	leaq	176(%rsp), %r14
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	movq	(%r14), %rdi
	movq	192(%rsp), %rsi                 # 8-byte Reload
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB15_32
# %bb.31:
	movq	176(%rsp), %rdi
	movq	80(%rsp), %rsi
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rcx
	callq	_Z27__device_stub__medianFilterPhS_PiS0_
.LBB15_32:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	callq	hipGetLastError
	leaq	208(%rsp), %r14
	movl	$0, (%r14)
	movq	32(%rsp), %rsi
	movq	8(%rsp), %rdx
	movq	%r14, %rdi
	callq	hipEventElapsedTime
	movl	$_ZSt4cout, %edi
	movl	$.L.str.22, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movss	(%r14), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI15_2(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	80(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	cmpl	$0, 28(%rsp)                    # 4-byte Folded Reload
	je	.LBB15_34
# %bb.33:
	movl	24(%rsp), %edx
	movl	20(%rsp), %ecx
	movl	$.L.str.23, %edi
	movq	%rbx, %rsi
	callq	_Z12matrixToFilePcPhii
.LBB15_34:
	movq	176(%rsp), %rdi
	callq	hipFree
	movq	80(%rsp), %rdi
	callq	hipFree
	movq	56(%rsp), %rdi
	callq	hipFree
	movq	48(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$232, %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_end15:
	.size	main, .Lfunc_end15-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB16_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB16_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z11linearScalePfS_PiS0_S0_S_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9grayWorldPfS_PdPiS1_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z10reflectionPfS_PiS0_, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z16orderedDitheringPfS_PiS0_, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8rotate90PfS_PiS0_, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9rotate180PfS_PiS0_, %esi
	movl	$.L__unnamed_6, %edx
	movl	$.L__unnamed_6, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z12medianFilterPhS_PiS0_, %esi
	movl	$.L__unnamed_7, %edx
	movl	$.L__unnamed_7, %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_end16:
	.size	__hip_module_ctor, .Lfunc_end16-__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	.LBB17_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
.LBB17_2:
	retq
.Lfunc_end17:
	.size	__hip_module_dtor, .Lfunc_end17-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	" "
	.size	.L.str, 2

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Char image flattened"
	.size	.L.str.2, 21

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Float image flattened"
	.size	.L.str.3, 22

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	" ||-|| Width: "
	.size	.L.str.5, 15

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Image saved to matrix..."
	.size	.L.str.6, 25

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

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	" ||-|| Max: "
	.size	.L.str.8, 13

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

	.type	_Z9grayWorldPfS_PdPiS1_,@object # @_Z9grayWorldPfS_PdPiS1_
	.globl	_Z9grayWorldPfS_PdPiS1_
	.p2align	3, 0x0
_Z9grayWorldPfS_PdPiS1_:
	.quad	_Z24__device_stub__grayWorldPfS_PdPiS1_
	.size	_Z9grayWorldPfS_PdPiS1_, 8

	.type	_Z10reflectionPfS_PiS0_,@object # @_Z10reflectionPfS_PiS0_
	.globl	_Z10reflectionPfS_PiS0_
	.p2align	3, 0x0
_Z10reflectionPfS_PiS0_:
	.quad	_Z25__device_stub__reflectionPfS_PiS0_
	.size	_Z10reflectionPfS_PiS0_, 8

	.type	_Z16orderedDitheringPfS_PiS0_,@object # @_Z16orderedDitheringPfS_PiS0_
	.globl	_Z16orderedDitheringPfS_PiS0_
	.p2align	3, 0x0
_Z16orderedDitheringPfS_PiS0_:
	.quad	_Z31__device_stub__orderedDitheringPfS_PiS0_
	.size	_Z16orderedDitheringPfS_PiS0_, 8

	.type	_Z8rotate90PfS_PiS0_,@object    # @_Z8rotate90PfS_PiS0_
	.globl	_Z8rotate90PfS_PiS0_
	.p2align	3, 0x0
_Z8rotate90PfS_PiS0_:
	.quad	_Z23__device_stub__rotate90PfS_PiS0_
	.size	_Z8rotate90PfS_PiS0_, 8

	.type	_Z9rotate180PfS_PiS0_,@object   # @_Z9rotate180PfS_PiS0_
	.globl	_Z9rotate180PfS_PiS0_
	.p2align	3, 0x0
_Z9rotate180PfS_PiS0_:
	.quad	_Z24__device_stub__rotate180PfS_PiS0_
	.size	_Z9rotate180PfS_PiS0_, 8

	.type	_Z12medianFilterPhS_PiS0_,@object # @_Z12medianFilterPhS_PiS0_
	.globl	_Z12medianFilterPhS_PiS0_
	.p2align	3, 0x0
_Z12medianFilterPhS_PiS0_:
	.quad	_Z27__device_stub__medianFilterPhS_PiS0_
	.size	_Z12medianFilterPhS_PiS0_, 8

	.type	.L.str.9,@object                # @.str.9
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.9:
	.asciz	"LinScale time: "
	.size	.L.str.9, 16

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

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"CUDA_linear_scale_.txt"
	.size	.L.str.11, 23

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"GrayWorld time: "
	.size	.L.str.12, 17

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"CUDA_gray_world_.txt"
	.size	.L.str.13, 21

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Reflection time: "
	.size	.L.str.14, 18

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"CUDA_reflection_.txt"
	.size	.L.str.15, 21

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"Ordered Dithering time: "
	.size	.L.str.16, 25

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"CUDA_dithering_.txt"
	.size	.L.str.17, 20

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"Rotation 90 time: "
	.size	.L.str.18, 19

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"CUDA_rotate_90_.txt"
	.size	.L.str.19, 20

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"Rotation 180 time: "
	.size	.L.str.20, 20

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"CUDA_rotate_180_.txt"
	.size	.L.str.21, 21

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"Median Filter Time: "
	.size	.L.str.22, 21

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"CUDA_median_filter_.txt"
	.size	.L.str.23, 24

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z11linearScalePfS_PiS0_S0_S_"
	.size	.L__unnamed_1, 30

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z9grayWorldPfS_PdPiS1_"
	.size	.L__unnamed_2, 24

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z10reflectionPfS_PiS0_"
	.size	.L__unnamed_3, 24

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z16orderedDitheringPfS_PiS0_"
	.size	.L__unnamed_4, 30

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z8rotate90PfS_PiS0_"
	.size	.L__unnamed_5, 21

	.type	.L__unnamed_6,@object           # @5
.L__unnamed_6:
	.asciz	"_Z9rotate180PfS_PiS0_"
	.size	.L__unnamed_6, 22

	.type	.L__unnamed_7,@object           # @6
.L__unnamed_7:
	.asciz	"_Z12medianFilterPhS_PiS0_"
	.size	.L__unnamed_7, 26

	.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 _Z26__device_stub__linearScalePfS_PiS0_S0_S_
	.addrsig_sym _Z24__device_stub__grayWorldPfS_PdPiS1_
	.addrsig_sym _Z25__device_stub__reflectionPfS_PiS0_
	.addrsig_sym _Z31__device_stub__orderedDitheringPfS_PiS0_
	.addrsig_sym _Z23__device_stub__rotate90PfS_PiS0_
	.addrsig_sym _Z24__device_stub__rotate180PfS_PiS0_
	.addrsig_sym _Z27__device_stub__medianFilterPhS_PiS0_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZSt4cout
	.addrsig_sym _Z11linearScalePfS_PiS0_S0_S_
	.addrsig_sym _Z9grayWorldPfS_PdPiS1_
	.addrsig_sym _Z10reflectionPfS_PiS0_
	.addrsig_sym _Z16orderedDitheringPfS_PiS0_
	.addrsig_sym _Z8rotate90PfS_PiS0_
	.addrsig_sym _Z9rotate180PfS_PiS0_
	.addrsig_sym _Z12medianFilterPhS_PiS0_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z11linearScalePfS_PiS0_S0_S_ ; -- Begin function _Z11linearScalePfS_PiS0_S0_S_
	.globl	_Z11linearScalePfS_PiS0_S0_S_
	.p2align	8
	.type	_Z11linearScalePfS_PiS0_S0_S_,@function
_Z11linearScalePfS_PiS0_S0_S_:          ; @_Z11linearScalePfS_PiS0_S0_S_
; %bb.0:
	s_clause 0x2
	s_load_b256 s[4:11], s[0:1], 0x0
	s_load_b32 s12, s[0:1], 0x3c
	s_load_b128 s[0:3], s[0:1], 0x20
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_load_b32 s10, s[10:11], 0x0
	s_lshr_b32 s11, s12, 16
	s_load_b32 s0, s[0:1], 0x0
	v_mad_u64_u32 v[2:3], null, s15, s11, v[1:2]
	s_and_b32 s1, s12, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_mul_i32 s14, s14, s1
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v1, v2, s10
	s_mul_i32 s0, s0, s10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v0, s14, v0, v1
	v_cmp_gt_i32_e32 vcc_lo, s0, v0
	s_and_saveexec_b32 s0, vcc_lo
	s_cbranch_execz .LBB0_2
; %bb.1:
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v2, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v1, vcc_lo
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_load_b32 v2, v[2:3], off
	s_load_b32 s0, s[8:9], 0x0
	s_load_b32 s1, s[2:3], 0x0
	s_waitcnt lgkmcnt(0)
	v_cvt_f32_i32_e32 v3, s0
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v2, v2, v3
	v_mul_f32_e32 v2, s1, v2
	global_store_b32 v[0:1], v2, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11linearScalePfS_PiS0_S0_S_
		.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 4
		.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	_Z11linearScalePfS_PiS0_S0_S_, .Lfunc_end0-_Z11linearScalePfS_PiS0_S0_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 244
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; Occupancy: 16
; WaveLimiterHint : 1
; 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	_Z9grayWorldPfS_PdPiS1_ ; -- Begin function _Z9grayWorldPfS_PdPiS1_
	.globl	_Z9grayWorldPfS_PdPiS1_
	.p2align	8
	.type	_Z9grayWorldPfS_PdPiS1_,@function
_Z9grayWorldPfS_PdPiS1_:                ; @_Z9grayWorldPfS_PdPiS1_
; %bb.0:
	s_clause 0x2
	s_load_b64 s[8:9], s[0:1], 0x20
	s_load_b32 s10, s[0:1], 0x34
	s_load_b256 s[0:7], s[0:1], 0x0
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_load_b32 s8, s[8:9], 0x0
	s_lshr_b32 s9, s10, 16
	s_load_b32 s6, s[6:7], 0x0
	v_mad_u64_u32 v[2:3], null, s15, s9, v[1:2]
	s_and_b32 s7, s10, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_mul_i32 s14, s14, s7
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v1, v2, s8
	s_mul_i32 s6, s6, s8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v0, s14, v0, v1
	v_cmp_gt_i32_e32 vcc_lo, s6, v0
	s_and_saveexec_b32 s6, vcc_lo
	s_cbranch_execz .LBB1_2
; %bb.1:
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v2, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v1, vcc_lo
	s_load_b64 s[0:1], s[4:5], 0x0
	v_add_co_u32 v0, vcc_lo, s2, v0
	global_load_b32 v2, v[2:3], off
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	s_waitcnt vmcnt(0)
	v_cvt_f64_f32_e32 v[2:3], v2
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[2:3], s[0:1], v[2:3]
	v_cvt_f32_f64_e32 v2, v[2:3]
	global_store_b32 v[0:1], v2, off
.LBB1_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9grayWorldPfS_PdPiS1_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 4
		.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	_Z9grayWorldPfS_PdPiS1_, .Lfunc_end1-_Z9grayWorldPfS_PdPiS1_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 240
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; Occupancy: 16
; WaveLimiterHint : 1
; 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	_Z10reflectionPfS_PiS0_ ; -- Begin function _Z10reflectionPfS_PiS0_
	.globl	_Z10reflectionPfS_PiS0_
	.p2align	8
	.type	_Z10reflectionPfS_PiS0_,@function
_Z10reflectionPfS_PiS0_:                ; @_Z10reflectionPfS_PiS0_
; %bb.0:
	s_clause 0x1
	s_load_b256 s[4:11], s[0:1], 0x0
	s_load_b32 s1, s[0:1], 0x2c
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_load_b32 s0, s[10:11], 0x0
	s_lshr_b32 s2, s1, 16
	s_load_b32 s3, s[8:9], 0x0
	v_mad_u64_u32 v[2:3], null, s15, s2, v[1:2]
	s_and_b32 s1, s1, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	s_mul_i32 s14, s14, s1
	s_mov_b32 s1, exec_lo
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v1, v2, s0
	s_mul_i32 s3, s3, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v0, s14, v0, v1
	v_cmpx_gt_i32_e64 s3, v0
	s_cbranch_execz .LBB2_2
; %bb.1:
	s_ashr_i32 s1, s0, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s2, s0, s1
	s_xor_b32 s1, s2, s1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cvt_f32_u32_e32 v1, s1
	s_sub_i32 s2, 0, s1
	v_rcp_iflag_f32_e32 v1, v1
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v1, 0x4f7ffffe, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cvt_u32_f32_e32 v2, v1
	v_ashrrev_i32_e32 v1, 31, v0
	v_mul_lo_u32 v3, s2, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v4, v0, v1
	v_xor_b32_e32 v4, v4, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_u32 v3, v2, v3
	v_add_nc_u32_e32 v2, v2, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_u32 v2, v4, v2
	v_mul_lo_u32 v2, v2, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v2, v4, v2
	v_subrev_nc_u32_e32 v3, s1, v2
	v_cmp_le_u32_e32 vcc_lo, s1, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v2, v2, v3, vcc_lo
	v_subrev_nc_u32_e32 v3, s1, v2
	v_cmp_le_u32_e32 vcc_lo, s1, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_cndmask_b32 v2, v2, v3 :: v_dual_add_nc_u32 v3, s0, v0
	v_xor_b32_e32 v2, v2, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v2, v2, v1
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_sub_nc_u32_e32 v3, v3, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xad_u32 v2, v2, -1, v3
	v_ashrrev_i32_e32 v3, 31, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	v_add_co_u32 v2, vcc_lo, s4, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_load_b32 v2, v[2:3], off
	s_waitcnt vmcnt(0)
	global_store_b32 v[0:1], v2, off
.LBB2_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z10reflectionPfS_PiS0_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 5
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z10reflectionPfS_PiS0_, .Lfunc_end2-_Z10reflectionPfS_PiS0_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 396
; NumSgprs: 18
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 5
; 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	_Z16orderedDitheringPfS_PiS0_ ; -- Begin function _Z16orderedDitheringPfS_PiS0_
	.globl	_Z16orderedDitheringPfS_PiS0_
	.p2align	8
	.type	_Z16orderedDitheringPfS_PiS0_,@function
_Z16orderedDitheringPfS_PiS0_:          ; @_Z16orderedDitheringPfS_PiS0_
; %bb.0:
	s_clause 0x1
	s_load_b256 s[4:11], s[0:1], 0x0
	s_load_b32 s1, s[0:1], 0x2c
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_load_b32 s0, s[10:11], 0x0
	s_lshr_b32 s2, s1, 16
	s_load_b32 s3, s[8:9], 0x0
	v_mad_u64_u32 v[2:3], null, s15, s2, v[1:2]
	s_and_b32 s1, s1, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	s_mul_i32 s14, s14, s1
	s_mov_b32 s1, exec_lo
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v1, v2, s0
	s_mul_i32 s3, s3, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v0, s14, v0, v1
	v_cmpx_gt_i32_e64 s3, v0
	s_cbranch_execz .LBB3_23
; %bb.1:
	v_ashrrev_i32_e32 v1, 31, v0
	s_ashr_i32 s1, s0, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s2, s0, s1
	s_xor_b32 s2, s2, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[2:3], 2, v[0:1]
	s_sub_i32 s3, 0, s2
	v_add_nc_u32_e32 v7, v0, v1
	v_add_co_u32 v4, vcc_lo, s4, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v3, vcc_lo
	v_xor_b32_e32 v7, v7, v1
	v_xor_b32_e32 v1, s1, v1
	s_mov_b32 s1, exec_lo
	global_load_b32 v4, v[4:5], off
	v_cvt_f32_u32_e32 v5, s2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_iflag_f32_e32 v5, v5
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v5, 0x4f7ffffe, v5
	v_cvt_u32_f32_e32 v5, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v6, s3, v5
	v_mul_hi_u32 v6, v5, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v5, v5, v6
	v_mul_hi_u32 v5, v7, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v6, v5, s2
	v_sub_nc_u32_e32 v6, v7, v6
	v_add_nc_u32_e32 v7, 1, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v8, s2, v6
	v_cmp_le_u32_e32 vcc_lo, s2, v6
	v_dual_cndmask_b32 v6, v6, v8 :: v_dual_cndmask_b32 v5, v5, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_le_u32_e32 vcc_lo, s2, v6
	v_add_nc_u32_e32 v7, 1, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v5, v5, v7, vcc_lo
	v_xor_b32_e32 v5, v5, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v1, v5, v1
	v_and_b32_e32 v1, 1, v1
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 1, v1
	s_xor_b32 s1, exec_lo, s1
	s_cbranch_execz .LBB3_11
; %bb.2:
	v_subrev_nc_u32_e32 v0, s0, v0
	s_mov_b32 s0, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v0, 1, v0
	v_cmpx_eq_u32_e32 1, v0
	s_xor_b32 s2, exec_lo, s0
	s_cbranch_execz .LBB3_8
; %bb.3:
	v_add_co_u32 v0, s0, s6, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v1, s0, s7, v3, s0
	s_mov_b32 s0, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_nlt_f32_e32 0x43000000, v4
	s_xor_b32 s0, exec_lo, s0
	s_cbranch_execz .LBB3_5
; %bb.4:
	v_mov_b32_e32 v2, 0
	global_store_b32 v[0:1], v2, off
                                        ; implicit-def: $vgpr0_vgpr1
.LBB3_5:                                ; %Flow
	s_and_not1_saveexec_b32 s0, s0
	s_cbranch_execz .LBB3_7
; %bb.6:
	v_mov_b32_e32 v2, 0x437f0000
	global_store_b32 v[0:1], v2, off
.LBB3_7:                                ; %Flow50
	s_or_b32 exec_lo, exec_lo, s0
                                        ; implicit-def: $vgpr2_vgpr3
.LBB3_8:                                ; %Flow51
	s_and_not1_saveexec_b32 s0, s2
	s_cbranch_execz .LBB3_10
; %bb.9:
	v_add_co_u32 v0, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v3, vcc_lo
	v_mov_b32_e32 v2, 0x437f0000
	global_store_b32 v[0:1], v2, off
.LBB3_10:                               ; %Flow52
	s_or_b32 exec_lo, exec_lo, s0
                                        ; implicit-def: $vgpr0
                                        ; implicit-def: $vgpr2_vgpr3
                                        ; implicit-def: $vgpr4
.LBB3_11:                               ; %Flow59
	s_and_not1_saveexec_b32 s0, s1
	s_cbranch_execz .LBB3_23
; %bb.12:
	v_and_b32_e32 v0, 1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_eq_u32_e32 vcc_lo, 1, v0
	v_add_co_u32 v0, s0, s6, v2
	v_add_co_ci_u32_e64 v1, s0, s7, v3, s0
	s_and_saveexec_b32 s0, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s0, exec_lo, s0
	s_cbranch_execz .LBB3_18
; %bb.13:
	s_mov_b32 s1, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_nlt_f32_e32 0x42800000, v4
	s_xor_b32 s1, exec_lo, s1
	s_cbranch_execz .LBB3_15
; %bb.14:
	v_mov_b32_e32 v2, 0
	global_store_b32 v[0:1], v2, off
                                        ; implicit-def: $vgpr0_vgpr1
.LBB3_15:                               ; %Flow53
	s_and_not1_saveexec_b32 s1, s1
	s_cbranch_execz .LBB3_17
; %bb.16:
	v_mov_b32_e32 v2, 0x437f0000
	global_store_b32 v[0:1], v2, off
.LBB3_17:                               ; %Flow54
	s_or_b32 exec_lo, exec_lo, s1
                                        ; implicit-def: $vgpr0_vgpr1
                                        ; implicit-def: $vgpr4
.LBB3_18:                               ; %Flow57
	s_and_not1_saveexec_b32 s0, s0
	s_cbranch_execz .LBB3_23
; %bb.19:
	s_mov_b32 s0, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_nlt_f32_e32 0x43400000, v4
	s_xor_b32 s0, exec_lo, s0
	s_cbranch_execz .LBB3_21
; %bb.20:
	v_mov_b32_e32 v2, 0
	global_store_b32 v[0:1], v2, off
                                        ; implicit-def: $vgpr0_vgpr1
.LBB3_21:                               ; %Flow55
	s_and_not1_saveexec_b32 s0, s0
	s_cbranch_execz .LBB3_23
; %bb.22:
	v_mov_b32_e32 v2, 0x437f0000
	global_store_b32 v[0:1], v2, off
.LBB3_23:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z16orderedDitheringPfS_PiS0_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end3:
	.size	_Z16orderedDitheringPfS_PiS0_, .Lfunc_end3-_Z16orderedDitheringPfS_PiS0_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 708
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 1
; 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	_Z8rotate90PfS_PiS0_    ; -- Begin function _Z8rotate90PfS_PiS0_
	.globl	_Z8rotate90PfS_PiS0_
	.p2align	8
	.type	_Z8rotate90PfS_PiS0_,@function
_Z8rotate90PfS_PiS0_:                   ; @_Z8rotate90PfS_PiS0_
; %bb.0:
	s_clause 0x1
	s_load_b256 s[4:11], s[0:1], 0x0
	s_load_b32 s2, s[0:1], 0x2c
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_load_b32 s0, s[10:11], 0x0
	s_lshr_b32 s3, s2, 16
	s_load_b32 s1, s[8:9], 0x0
	v_mad_u64_u32 v[2:3], null, s15, s3, v[1:2]
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_mul_i32 s14, s14, s2
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v1, v2, s0
	s_mul_i32 s2, s1, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v0, s14, v0, v1
	v_cmp_gt_i32_e32 vcc_lo, s2, v0
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB4_2
; %bb.1:
	v_ashrrev_i32_e32 v1, 31, v0
	s_ashr_i32 s2, s0, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s3, s0, s2
	s_xor_b32 s3, s3, s2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[2:3], 2, v[0:1]
	v_add_nc_u32_e32 v5, v0, v1
	v_not_b32_e32 v0, v0
	v_add_co_u32 v2, vcc_lo, s6, v2
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v3, vcc_lo, s7, v3, vcc_lo
	s_sub_i32 s6, 0, s3
	v_xor_b32_e32 v5, v5, v1
	v_xor_b32_e32 v1, s2, v1
	global_load_b32 v4, v[2:3], off
	v_cvt_f32_u32_e32 v2, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_iflag_f32_e32 v2, v2
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v2, 0x4f7ffffe, v2
	v_cvt_u32_f32_e32 v2, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v3, s6, v2
	v_mul_hi_u32 v3, v2, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v2, v2, v3
	v_mul_hi_u32 v2, v5, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v3, v2, s3
	v_sub_nc_u32_e32 v3, v5, v3
	v_add_nc_u32_e32 v5, 1, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v6, s3, v3
	v_cmp_le_u32_e32 vcc_lo, s3, v3
	v_dual_cndmask_b32 v3, v3, v6 :: v_dual_cndmask_b32 v2, v2, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_le_u32_e32 vcc_lo, s3, v3
	v_add_nc_u32_e32 v5, 1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v2, v2, v5, vcc_lo
	v_xor_b32_e32 v2, v2, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v1, v2, v1
	v_mul_lo_u32 v2, v1, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v0, s0, v0, v2
	v_mad_u64_u32 v[2:3], null, v0, s1, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[0:1], 2, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	s_waitcnt vmcnt(0)
	global_store_b32 v[0:1], v4, off
.LBB4_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8rotate90PfS_PiS0_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 7
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end4:
	.size	_Z8rotate90PfS_PiS0_, .Lfunc_end4-_Z8rotate90PfS_PiS0_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 420
; NumSgprs: 18
; NumVgprs: 7
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 7
; Occupancy: 16
; WaveLimiterHint : 1
; 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	_Z9rotate180PfS_PiS0_   ; -- Begin function _Z9rotate180PfS_PiS0_
	.globl	_Z9rotate180PfS_PiS0_
	.p2align	8
	.type	_Z9rotate180PfS_PiS0_,@function
_Z9rotate180PfS_PiS0_:                  ; @_Z9rotate180PfS_PiS0_
; %bb.0:
	s_clause 0x1
	s_load_b256 s[4:11], s[0:1], 0x0
	s_load_b32 s0, s[0:1], 0x2c
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_load_b32 s1, s[10:11], 0x0
	s_lshr_b32 s2, s0, 16
	s_load_b32 s3, s[8:9], 0x0
	v_mad_u64_u32 v[2:3], null, s15, s2, v[1:2]
	s_and_b32 s0, s0, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_mul_i32 s14, s14, s0
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v1, v2, s1
	s_mul_i32 s0, s3, s1
	s_mov_b32 s1, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v0, s14, v0, v1
	v_cmpx_gt_i32_e64 s0, v0
	s_cbranch_execz .LBB5_2
; %bb.1:
	v_xad_u32 v1, v0, -1, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, s6, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s7, v2, vcc_lo
	global_load_b32 v2, v[1:2], off
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v0, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	s_waitcnt vmcnt(0)
	global_store_b32 v[0:1], v2, off
.LBB5_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9rotate180PfS_PiS0_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 4
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end5:
	.size	_Z9rotate180PfS_PiS0_, .Lfunc_end5-_Z9rotate180PfS_PiS0_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 232
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; Occupancy: 16
; WaveLimiterHint : 1
; 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	_Z12medianFilterPhS_PiS0_ ; -- Begin function _Z12medianFilterPhS_PiS0_
	.globl	_Z12medianFilterPhS_PiS0_
	.p2align	8
	.type	_Z12medianFilterPhS_PiS0_,@function
_Z12medianFilterPhS_PiS0_:              ; @_Z12medianFilterPhS_PiS0_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b256 s[4:11], s[0:1], 0x0
	v_bfe_u32 v3, v0, 10, 10
	s_mov_b32 s1, 0
                                        ; implicit-def: $sgpr3
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s0, s2, 16
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[1:2], null, s15, s0, v[3:4]
	v_and_b32_e32 v4, 0x3ff, v0
	s_and_b32 s0, s2, 0xffff
	s_mov_b32 s2, exec_lo
	s_mul_i32 s14, s14, s0
	s_mov_b32 s0, 0
	v_add_nc_u32_e32 v0, s14, v4
                                        ; implicit-def: $vgpr3
                                        ; implicit-def: $vgpr2
	s_delay_alu instid0(VALU_DEP_3)
	v_cmpx_ne_u32_e32 0, v1
	s_xor_b32 s2, exec_lo, s2
	s_cbranch_execz .LBB6_18
; %bb.1:
	s_load_b32 s8, s[8:9], 0x0
	s_load_b32 s3, s[10:11], 0x0
	v_cmp_ne_u32_e32 vcc_lo, 0, v0
	s_mov_b32 s9, -1
	s_mov_b32 s12, 0
                                        ; implicit-def: $vgpr3
                                        ; implicit-def: $vgpr2
	s_waitcnt lgkmcnt(0)
	s_add_i32 s0, s8, -1
	s_add_i32 s1, s3, -1
	v_cmp_ne_u32_e64 s0, s0, v1
	v_cmp_ne_u32_e64 s1, s1, v0
	s_delay_alu instid0(VALU_DEP_2)
	s_and_b32 s0, vcc_lo, s0
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, s0, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB6_17
; %bb.2:
	v_mad_u64_u32 v[2:3], null, s3, v1, v[0:1]
	s_mul_i32 s1, s3, s8
	s_mov_b32 s8, 0
                                        ; implicit-def: $vgpr3
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_gt_i32_e32 vcc_lo, s1, v2
	s_and_saveexec_b32 s1, vcc_lo
	s_cbranch_execz .LBB6_16
; %bb.3:                                ; %.preheader53.preheader
	v_add_nc_u32_e32 v3, -1, v1
	s_mov_b32 s8, -1
	s_mov_b32 s9, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[5:6], null, s3, v3, v[4:5]
	v_add3_u32 v5, v5, s14, -1
.LBB6_4:                                ; %.preheader53
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB6_5 Depth 2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v4, 31, v5
	v_add_co_u32 v3, vcc_lo, s4, v5
	s_mov_b32 s12, 0
	v_add_co_ci_u32_e32 v4, vcc_lo, s5, v4, vcc_lo
.LBB6_5:                                ;   Parent Loop BB6_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_u8 v6, v[3:4], off
	s_add_i32 s13, s9, s12
	v_add_co_u32 v3, vcc_lo, v3, 1
	v_mov_b32_e32 v7, s13
	v_add_co_ci_u32_e32 v4, vcc_lo, 0, v4, vcc_lo
	s_add_i32 s12, s12, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s12, 3
	s_waitcnt vmcnt(0)
	ds_store_b8 v7, v6
	s_cbranch_scc0 .LBB6_5
; %bb.6:                                ;   in Loop: Header=BB6_4 Depth=1
	v_add_nc_u32_e32 v5, s3, v5
	s_add_i32 s8, s8, 1
	s_add_i32 s9, s9, s12
	s_cmp_lg_u32 s8, 2
	s_cbranch_scc1 .LBB6_4
; %bb.7:                                ; %.preheader.preheader
	s_mov_b32 s4, 1
	s_mov_b32 s5, 2
.LBB6_8:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB6_9 Depth 2
	v_mov_b32_e32 v3, s4
	s_mov_b32 s12, s5
	ds_load_u8 v3, v3
	s_waitcnt lgkmcnt(0)
	v_and_b32_e32 v4, 0xff, v3
.LBB6_9:                                ;   Parent Loop BB6_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_add_i32 s9, s12, -2
	s_mov_b32 s8, s12
	v_mov_b32_e32 v5, s9
	s_mov_b32 s13, -1
	s_mov_b32 s14, -1
                                        ; implicit-def: $sgpr12
                                        ; implicit-def: $sgpr9
	ds_load_u8 v5, v5
	s_waitcnt lgkmcnt(0)
	v_and_b32_e32 v6, 0xff, v5
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_le_u32_e32 vcc_lo, v6, v4
	s_cbranch_vccnz .LBB6_11
; %bb.10:                               ;   in Loop: Header=BB6_9 Depth=2
	s_add_i32 s12, s8, -1
	s_mov_b32 s9, 0
	v_mov_b32_e32 v6, s12
	s_cmp_lt_i32 s12, 2
	s_mov_b32 s13, 0
	s_cselect_b32 s14, -1, 0
	ds_store_b8 v6, v5
.LBB6_11:                               ; %Flow
                                        ;   in Loop: Header=BB6_9 Depth=2
	s_and_not1_b32 vcc_lo, exec_lo, s14
	s_cbranch_vccnz .LBB6_9
; %bb.12:                               ; %loop.exit.guard
                                        ;   in Loop: Header=BB6_8 Depth=1
	s_and_b32 vcc_lo, exec_lo, s13
	s_cbranch_vccz .LBB6_14
; %bb.13:                               ; %..critedge_crit_edge
                                        ;   in Loop: Header=BB6_8 Depth=1
	s_add_i32 s9, s8, -1
.LBB6_14:                               ; %.critedge
                                        ;   in Loop: Header=BB6_8 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v4, s9
	s_add_i32 s4, s4, 1
	s_add_i32 s5, s5, 1
	s_cmp_lg_u32 s4, 9
	ds_store_b8 v4, v3
	s_cbranch_scc1 .LBB6_8
; %bb.15:
	v_mov_b32_e32 v3, 0
	s_mov_b32 s8, exec_lo
	ds_load_u8 v3, v3 offset:4
.LBB6_16:                               ; %Flow100
	s_or_b32 exec_lo, exec_lo, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s12, s8, exec_lo
	s_xor_b32 s9, exec_lo, -1
.LBB6_17:                               ; %Flow99
	s_or_b32 exec_lo, exec_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s0, s12, exec_lo
	s_and_b32 s1, s9, exec_lo
.LBB6_18:                               ; %Flow98
	s_or_saveexec_b32 s2, s2
	v_mov_b32_e32 v4, s3
	s_xor_b32 exec_lo, exec_lo, s2
	s_cbranch_execz .LBB6_20
; %bb.19:                               ; %._crit_edge
	s_load_b32 s3, s[10:11], 0x0
	s_or_b32 s1, s1, exec_lo
                                        ; implicit-def: $vgpr2
	s_waitcnt lgkmcnt(0)
	v_mov_b32_e32 v4, s3
.LBB6_20:                               ; %Flow101
	s_or_b32 exec_lo, exec_lo, s2
	s_and_saveexec_b32 s2, s1
	s_cbranch_execz .LBB6_22
; %bb.21:
	s_waitcnt lgkmcnt(0)
	v_mad_u64_u32 v[2:3], null, v4, v1, v[0:1]
	v_mov_b32_e32 v3, 0
	s_or_b32 s0, s0, exec_lo
.LBB6_22:                               ; %Flow102
	s_or_b32 exec_lo, exec_lo, s2
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB6_24
; %bb.23:                               ; %.sink.split
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v1, 31, v2
	v_add_co_u32 v0, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	s_waitcnt lgkmcnt(0)
	global_store_b8 v[0:1], v3, off
.LBB6_24:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12medianFilterPhS_PiS0_
		.amdhsa_group_segment_fixed_size 9
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 8
		.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_end6:
	.size	_Z12medianFilterPhS_PiS0_, .Lfunc_end6-_Z12medianFilterPhS_PiS0_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 692
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 9 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; 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
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z11linearScalePfS_PiS0_S0_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11linearScalePfS_PiS0_S0_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9grayWorldPfS_PdPiS1_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9grayWorldPfS_PdPiS1_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z10reflectionPfS_PiS0_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z10reflectionPfS_PiS0_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     5
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z16orderedDitheringPfS_PiS0_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z16orderedDitheringPfS_PiS0_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8rotate90PfS_PiS0_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z8rotate90PfS_PiS0_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     7
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9rotate180PfS_PiS0_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9rotate180PfS_PiS0_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 9
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z12medianFilterPhS_PiS0_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z12medianFilterPhS_PiS0_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
