#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#include<time.h>

#pragma pack (1)
//设置对齐方式

#define GauSize 5

typedef struct{
    short type;         //文件类型，必须为BM
    int size;           //整个位图文件的大小，以字节为单位
    short reserved1;    //保留，全0
    short reserved2;    //保留，全0
    int offset;         //位图数据的起始位置，字节为单位
}BMPHeader;

typedef struct 
{
    int size;       //BMP 信息头的大小，字节为单位
    int width;      //宽度，以像素为单位
    int height;     //高度，以像素为单位
    short planes;   // 一般为1
    short bitsPerPixel; //每个像素所用的位数
    unsigned compression; //压缩类型 0：不压缩   1：BI_RLE8压缩类型  2：BI_RLE4压缩类型
    unsigned imageSize;   //位图数据部分的大小，以字节为单位
    int xPelsPerMeter;    //水平分辨率，每米像素数，可置为0
    int yPelsPerMeter;    //同上
    int clrUsed;          //位图实际使用的颜色表中的颜色数，置为0都使用
    int clrImportant;     //位图显示时重要的颜色数，置为0都重要
}BMPInfoHeader;

// typedef struct {
//     unsigned char x,y,z; //bmp中24位位图数据存储的单个像素通道顺序是bgr ， 且每行必须为4的倍数， 不够用0填充
// }uchar3;

void loadBMPFile(uchar3 ** dst, int *width , int *height , const char *name){

    BMPHeader hdr;
    BMPInfoHeader infoHdr;
    int x,y;
    FILE *fd ;
    

    printf("Loading %s ...\n", name);
    if(sizeof(uchar3) !=3){
        printf("***** uchaar3 is not 3 bytes *****\n");
        return ;
    }
    if( !(fd = fopen(name, "rb"))){
        printf("***** fail to open %s *****\n", name);
        return ;
    }


    fread(&hdr , sizeof(hdr) , 1, fd);

    if(hdr.type != 0x4d42){
        printf("***** it is not a bmp file *****\n");
        return ;
    }

    fread(&infoHdr , sizeof(infoHdr) , 1, fd);

    if(infoHdr.bitsPerPixel !=24){
        printf("***** invalid color depth (24 bits needed) *****\n");
        printf("It is %hd\n" , infoHdr.bitsPerPixel);
        printf("size of short : %d\n",sizeof(short));
        printf("size of hdr is %d , infoHdr is %d\n" , sizeof(hdr) , sizeof(infoHdr));
        return;
    }
    printf("size of short : %d\n",sizeof(short));
    printf("size of hdr is %d , infoHdr is %d\n" , sizeof(hdr) , sizeof(infoHdr));
    if(infoHdr.compression){
        printf("***** cannot solve copressed image *****\n");
        return ;
    }


    *width = infoHdr.width;
    *height = infoHdr.height;
    //malloc space for image data 
    *dst = (uchar3 *)malloc(*width * *height * sizeof(uchar3));
    // cudaMallocManaged(dst , *width * *height * sizeof(uchar3));
    printf("image width: %u\n", infoHdr.width);
    printf("image height: %u\n", infoHdr.height);

    fseek(fd, hdr.offset - sizeof(hdr) - sizeof(infoHdr) , SEEK_CUR);

    for(y = 0 ; y < infoHdr.height ; y++){
        for(x = 0 ; x < infoHdr.width ; x++){
            (*dst)[ y * infoHdr.width + x ].z = fgetc(fd);
            (*dst)[ y * infoHdr.width + x ].y = fgetc(fd);
            (*dst)[ y * infoHdr.width + x ].x = fgetc(fd);

        }

        //pass filling bytes
        for(x = 0 ; x < (4 - (3*infoHdr.width)%4)%4 ; x++ ){
            fgetc(fd);
        }
    }

    printf("image file loaded successful! \n");

    fclose(fd);


}

void saveBMPFile(uchar3 *dst , int width , int height , const char *name){
    printf("in save bmp file\n");
    BMPHeader hdr; 
    BMPInfoHeader infoHdr;
     
    hdr.type = 0x4d42;
    hdr.reserved1 = 0;
    hdr.reserved2 = 0; 
    hdr.offset = 54;
    hdr.size = hdr.offset + 3 * height * (width + (4-(width*3)%4)%4 );

    infoHdr.size = 40;
    infoHdr.width = width;
    infoHdr.height = height;
    infoHdr.planes = 1;
    infoHdr.bitsPerPixel = 24;
    infoHdr.compression = 0;
    infoHdr.imageSize = hdr.size - hdr.offset;
    infoHdr.xPelsPerMeter = 0;
    infoHdr.yPelsPerMeter = 0;
    infoHdr.clrImportant = 0;
    infoHdr.clrUsed = 0;

    FILE *fd;
    if(! (fd=fopen(name,"wb"))){
        printf("***** fail to open dest file *****\n");
        return;
    }

    fwrite(&hdr , sizeof(hdr) , 1 , fd);
    fwrite(&infoHdr , sizeof(infoHdr) , 1 , fd);

    int x,y;
    for(y = 0; y < infoHdr.height ; y++){
        for(x = 0 ; x < infoHdr.width ; x++){
            fputc( dst[ y * infoHdr.width + x ].z , fd);
            fputc( dst[ y * infoHdr.width + x ].y , fd);
            fputc( dst[ y * infoHdr.width + x ].x , fd);
            // printf("save one pixel\n");

        }

        //pass filling bytes
        for(x = 0 ; x < (4 - (3*infoHdr.width)%4)%4 ; x++ ){
            fputc(0 , fd);
        }
    }

    printf("image file writed over\n");
    fclose(fd);
}


__global__ void genGauss(float *gauss , int size , float sig ){

    __shared__ float sum;
    sum=0;
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;
    int mid = size/2 ;
    float sigma = sig;
    if(x<size && y<size){
        gauss[y*size + x] = __expf(-0.5*((x - mid)*(x - mid)+(y - mid)*(y - mid)) / (sigma*sigma)) / (2 * 3.1415926 * sigma *sigma);
        atomicAdd(&sum , gauss[y*size + x]);
    }
    __syncthreads();
    if(x<size && y<size){
        gauss[y*size + x] = gauss[y*size + x] /sum;
    }
}
__device__ float cannyRgb2grayscale(uchar3 pix){
    return (pix.x*0.299 + pix.y*0.587 + pix.z*0.114);
}

__global__ void rgb2grayscale(uchar3 * pix , int width , int height , float * ping){
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;

    if(x < width && y < height){
        ping[index] = pix[index].x*0.299 + pix[index].y*0.587 + pix[index].z*0.114;
    }
}

__global__ void gaussBlur(float * ping, float * pang , int width , int height , float * gauss , int gaussSize){
    __shared__ float gau[GauSize][GauSize];
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;
    //load guass matrix
    if(threadIdx.x<GauSize && threadIdx.y<GauSize){
        gau[threadIdx.y][threadIdx.x] = gauss[ threadIdx.y * GauSize + threadIdx.x];
    }
    __syncthreads();
    //blur
    if(x<width && y<height ){
        float blurValue = 0.0f;
        int mid = GauSize/2 +1; 
        for(int i = mid-GauSize ; i <= GauSize-mid; i++){
            for(int j = mid-GauSize ; j <= GauSize-mid; j++){
                // blurValue += gau[i+mid-1][j+mid-1]*dst[(y+i)*width + x+j].x;
                if((i+y)<height && (i+y)>=0  &&  (j+x)<width && (j+x)>=0 )
                    blurValue += gau[i+mid-1][j+mid-1] * ping[index + i*width +j];
            }
        }
       

        // src[index].x = src[index].y = src[index].z = blurValue;
        pang[index] = blurValue;
    }
}

__global__ void calcGradient(float *pang,float *ping , float * dx , float *dy , int width , int height){
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;
    if(x<width-1 && y< height-1){
        dx[index] = pang[index + 1] - pang[index];
        dy[index] = pang[index + width] - pang[index];
        //ping is gradient now
        ping[index] = sqrtf(dx[index]*dx[index]+dy[index]*dy[index] );
    }
    if(x<width && y< height && (x==width-1 || y==height-1)){
        ping[index] = 0;
    }
    
}

__global__ void nonMaxRestrain(float *pang, float *ping , float *dx , float *dy , int width , int height){
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;
    if(x<width -2 && y<height -2   && x>0 &&y>0){

    if(pang[index] <= 0.0000000001f && pang[index] >= -0.0000000001f){
        ping[index] = 0.0f;
    }
    else{
        float dxAbs = abs(dx[index]);
        float dyAbs = abs(dy[index]);
        float weight = 0;
        float grad[4];
        if(dyAbs > dxAbs){
            weight = dxAbs/dyAbs;
            grad[1] = pang[index - width];
            grad[3] = pang[index + width];

            if(dx[index]*dy[index]>0){
                grad[0] = pang[index -width - 1];
                grad[2] = pang[index +width + 1];
            }
            else{
                grad[0] = pang[index -width + 1];
                grad[2] = pang[index +width - 1];
            }
        }else{
            weight = dyAbs / dxAbs;
            grad[1] = pang[index - 1];
            grad[3] = pang[index + 1];

            if(dx[index]*dy[index]>0){
                // grad[0] = pang[index +width - 1];
                // grad[2] = pang[index -width + 1];

                grad[0] = pang[index -width - 1];
                grad[2] = pang[index +width + 1];
            }
            else{
                // grad[0] = pang[index -width - 1];
                // grad[2] = pang[index +width + 1];

                grad[0] = pang[index -width + 1];
                grad[2] = pang[index +width - 1];
            }
        }
        //插值
        // float grad1 = weight * grad[0] + (1-weight) * grad[1];
        // float grad2 = weight * grad[2] + (1-weight) * grad[3];

        float grad1 = weight * grad[1] + (1-weight) * grad[0];
        float grad2 = weight * grad[3] + (1-weight) * grad[2];
        if(pang[index] > grad1 && pang[index] > grad2){
            ping[index] = pang[index];
        } else{
            ping[index] = 0.0f;
        }
    }

    }//x<width y<height
    // else{
    //     ping[index] = 0;
    // }

}

__global__ void findMaxGrad(float * ping , int width , int height , float * max){
    extern __shared__ float temp[];

    int tid = threadIdx.x;
    int idx = tid + blockDim.x * blockIdx.x;

    if(idx<width*height){
        temp[tid] = ping[idx];
    }else{
        temp[tid] = 0;
    }

    int prevSize = blockDim.x;
    for(int d = blockDim.x >>1 ; d>0; d >>= 1){
        __syncthreads();
        if(tid<d  ){
            temp[tid] = temp[tid]>temp[tid+d]?temp[tid]:temp[tid + d];
            //for arbitrary block size
            if(prevSize > d*2 && (tid+2*d)<prevSize   ){
                temp[tid] = temp[tid]>temp[tid+2*d]?temp[tid]:temp[tid + 2*d];

            }
            prevSize = d;
        }
    }

    if(tid==0)max[blockIdx.x] = temp[0];
}

__global__ void edgeTrace(float *ping , float *pang , float *maxptr , int width , int height , int iteration , float hsigma , float lsigma){
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;
    float max = *maxptr;
    float lhd = max * lsigma;
    float hhd = max * hsigma;

    for(int i =0 ; i<iteration ;i++){
    __syncthreads();
    if(x<width -1 && y<height -1   && x>0 && y>0){

        if(ping[index] < lhd)pang[index] = 0;
        else if(ping[index]>= hhd)pang[index]=1;
        else {
            if(ping[index-width-1]>=hhd || ping[index-width]>=hhd ||ping[index-width+1]>=hhd 
            || ping[index-1]>=hhd || ping[index+1]>=hhd
            || ping[index+width-1]>=hhd || ping[index+width]>=hhd ||ping[index+width+1]>=hhd){
                pang[index] = 1; 
                ping[index] = hhd;
            }else{
                pang[index] = 0;
                ping[index] = hhd;
            }
        }

    }//x, y
    }
}

__global__ void edgeTraceOptimized(float *ping , float *pang , float *maxptr , int width , int height , int iteration , float hsigma , float lsigma){
    __shared__ float tempPing[34][34] ;
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;
    float max = *maxptr;
    float lhd = max * lsigma;
    float hhd = max * hsigma;

    int tx = threadIdx.x+1;
    int ty = threadIdx.y+1;

    if(x<width && y < height)tempPing[threadIdx.y +1][threadIdx.x +1] = ping[index];
    if(threadIdx.x ==0 ){
        if(x>0 && x<width && y<height){
            tempPing[threadIdx.y +1][0] = ping[index - 1];
        }
        else{
            tempPing[threadIdx.y +1][0] = 0;
        } 
    }
    if(threadIdx.y ==0){
        if(y>0 && x<width && y<height){
            tempPing[0][threadIdx.x +1] = ping[index - width];
        }
        else {
            tempPing[0][threadIdx.x +1] = 0;
        }
    }
    if(threadIdx.x == 31){
        if(x<width-1 && y<height){
            tempPing[threadIdx.y +1][33] = ping[index+1];
        }
        else {
            tempPing[threadIdx.y +1][33] = 0;

        }
    }
    if(threadIdx.y ==31){
        if(y<height-1 && x<width){
            tempPing[33][threadIdx.x +1] = ping[index + width];
        }
        else{
            tempPing[33][threadIdx.x +1] = 0;
        }
    }

    if(threadIdx.x == 0 && threadIdx.y == 0){
        if(x>0 && y >0  && x<width && y<height)tempPing[0][0] = ping[index -width -1];
        else tempPing[0][0] = 0;
    }
    if(threadIdx.x == 31 && threadIdx.y == 0){
        if(y>0 && x < width-1  && y <height)tempPing[0][33] = ping[index - width +1];
        else tempPing[0][33] = 0;
    }
    if(threadIdx.x == 31 && threadIdx.y == 31){
        if(y<height-1 && x<width-1)tempPing[33][33] = ping[index + width +1];
        else tempPing[33][33] = 0;
    }
    if(threadIdx.x == 0 && threadIdx.y == 31){
        if(x>0 && y<height-1 && x<width)tempPing[33][0] = ping[index + width -1];
        else tempPing[33][0] = 0;
    }
    __syncthreads();

    for(int i =0 ; i<iteration ;i++){
    __syncthreads();

    if(x<width  && y<height){

        if(tempPing[ty][tx] < lhd)pang[index] = 0;
        else if(tempPing[ty][tx]>= hhd)pang[index]=1;
        else {
            if(tempPing[ty-1][tx-1]>=hhd || tempPing[ty-1][tx]>=hhd ||tempPing[ty-1][tx+1]>=hhd 
            || tempPing[ty][tx-1]>=hhd || tempPing[ty][tx+1]>=hhd
            || tempPing[ty+1][tx-1]>=hhd || tempPing[ty+1][tx]>=hhd ||tempPing[ty+1][tx+1]>=hhd){
                pang[index] = 1; 
                tempPing[ty][tx] = hhd;
            }else{
                pang[index] = 0;
                tempPing[ty][tx]= hhd;
            }
        }

    }//x, y
    }
}

__global__ void trans2Bmp(float *ping , uchar3* imagedata , int width ,int height , int rev){
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;

    if(x< width && y < height){
        // imagedata[index].x = imagedata[index].y = imagedata[index].z = (ping[index]<25?0:255);
        if(rev)imagedata[index].x = imagedata[index].y = imagedata[index].z = ping[index]*255;
        else imagedata[index].x = imagedata[index].y = imagedata[index].z =(1- ping[index])*255;
        // imagedata[index].x = imagedata[index].y = imagedata[index].z = ping[index];
    }
}

 
 void cookargument(int argc , char* argv[] , float *gaussSigma , float *hsigma , float *lsigma ,int *iteration , char** srcName , char** dstName , int *opti , int *rev){
    //init
    *gaussSigma = 1.2; //-gs
    *hsigma = 0.2;     //-hs
    *lsigma = 0.1;     //-ls
    *iteration = 10;   //-it
    *opti =1;          //-opt
    *rev = 1;          //-rev
                       //-src
                       //-dst
    //no argument
    if(argc ==1)return ;

    int status;

    for(int i=1 ; i<argc;i++){
        //set gaussSigma
        if(strcmp("-gs",argv[i])==0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%f" , gaussSigma);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }
            else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set hsigma
        if(strcmp("-hs" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%f" , hsigma);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set lsigma
        if(strcmp("-ls" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%f" , lsigma);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set iteration
        if(strcmp("-it" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%d" , iteration);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set src file name
        if(strcmp("-src" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                *srcName = argv[i];
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set dst file name
        if(strcmp("-dst" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                *dstName = argv[i];
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set opotimized or not
        if(strcmp("-opt" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%d" , opti);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set edge color 1 white 0 black
        if(strcmp("-rev" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%d" , rev);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //print help
        if(strcmp("-help" , argv[i]) == 0 ){
            printf("-src srcname : set src image file, must be 24 bit bmp file\n");
            printf("-dst dstname : set dst image file, must be 24 bit bmp file\n");
            printf("-gs  gaussSigma: set gaussSigma\n");
            printf("-ls  lowThreshold : set lowthreshold in canny\n");
            printf("-hs  highThreshold: set highthreshold in canny\n");
            printf("-it  iteration    : set iteration number of tracing edge\n");
            printf("-opt  1/0    : set ioptimimze tracing edge or not\n");
            printf("-rev  1/0    : set  edge color black(0)/white(1)\n");
            printf("-help :show info like this\n");
            
            exit(0);
        }

        
    }//for
    
    //test print
    // printf("gausssigma:%f\n", *gaussSigma);
    // printf("lsigma:%f\n", *lsigma);
    // printf("hsigma:%f\n", *hsigma);
    // printf("iteration:%d\n", *iteration);


    //check value
    if(*iteration <1){
        printf("*****invalid iteration*****\n");
        exit(1);
    }
    if(*lsigma > *hsigma || *lsigma < 0 || *hsigma >1){
        printf("*****invalid l/hsigma value*****\n");
        exit(1);
    }
    if(*gaussSigma<=0){
        printf("*****invalid gauss sigma value*****\n");
        exit(1);
    }
 }


int main(int argc , char* argv[]){
    clock_t start , end;
    start = clock();
    clock_t startCanny , endCanny;

    uchar3 *imagedataSrc , *imagedataDst;
    uchar3 *d_imagedataSrc ,*d_imagedataDst;
    float *d_gauss;
    float * d_ping, *d_pang;
    float *d_dx , *d_dy;
    float *d_max;
    // float gauss[GauSize][GauSize];
    int gaussSize = GauSize;
    int width , height;

    float gaussSigma =1.2;
    float hsigma = 0.15;
    float lsigma = 0.1;
    int iteration = 10;
    int optimized = 1;
    int  rev = 1;

    // const char srcName[] = "../data/src3.bmp";
    // const char dstName[] = "../data/out.bmp";
    char *srcName = NULL ;
    char *dstName = NULL ;

    cookargument(argc , argv , &gaussSigma , &hsigma , &lsigma ,&iteration , &srcName , &dstName , &optimized,&rev);    
    if(srcName ==NULL)srcName = "../data/src3.bmp";
    if(dstName ==NULL)dstName = "../data/out.bmp";
    //load bmp format image file
    loadBMPFile(&imagedataSrc , &width , &height , srcName );
    // height /= 4;
    cudaError_t cudaStatus = cudaMalloc((void**)&d_gauss , gaussSize*gaussSize*sizeof(float));
    if(cudaStatus!=cudaSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }
    // cudaMalloc(&d_imagedataDst , width*height*sizeof(uchar3));
    cudaStatus = cudaMalloc(&d_ping , width*height*sizeof(float));
    if(cudaStatus!=cudaSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }
    cudaStatus = cudaMalloc(&d_pang , width*height*sizeof(float));
    if(cudaStatus!=cudaSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }
    cudaStatus = cudaMalloc(&d_dx , width*height*sizeof(float));
    if(cudaStatus!=cudaSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }
    cudaStatus = cudaMalloc(&d_dy , width*height*sizeof(float));
    if(cudaStatus!=cudaSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }

    cudaStatus = cudaMalloc(&d_imagedataSrc , width*height*sizeof(uchar3));
    if(cudaStatus!=cudaSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }
    // imagedataDst = (uchar3*)malloc( width*height*sizeof(uchar3));

    
    cudaStatus = cudaMemcpy(d_imagedataSrc , imagedataSrc , width*height*sizeof(uchar3) , cudaMemcpyHostToDevice );
    if(cudaStatus!=cudaSuccess){
        printf("*****fail to copy memory*****\n");
        return 1;
    }
    dim3 numofBlock(32 , 32 , 1);
    dim3 threadsPerBlock((width+31)/32 , (height+31)/32, 1);
    int threadnum = numofBlock.x*numofBlock.y*numofBlock.z;
    int blocknum = (width*height+threadnum-1)/threadnum;
    cudaMalloc(&d_max , blocknum*sizeof(float));

    //main process in gpu
    startCanny = clock();
    //generate gaussian filter
    genGauss<<<1 ,numofBlock >>>(d_gauss , gaussSize ,gaussSigma);
    // cudaDeviceSynchronize();
    
    //calc image's grayscale value
    rgb2grayscale<<< threadsPerBlock, numofBlock>>>(d_imagedataSrc , width , height , d_ping );
    // cudaDeviceSynchronize();
    
    //use gaussian filter
    gaussBlur<<< threadsPerBlock, numofBlock>>>(d_ping , d_pang , width , height , d_gauss , gaussSize);
    // cudaDeviceSynchronize();
    
    //calc gradient of every pixel    
    calcGradient<<< threadsPerBlock, numofBlock>>>(d_pang ,d_ping , d_dx , d_dy , width , height);
    //non max gradient restrain
    nonMaxRestrain<<< threadsPerBlock, numofBlock>>>(d_ping , d_pang , d_dx , d_dy , width , height);
    //find max gradient of the whole image
    //local max    
    findMaxGrad<<<blocknum,threadnum  , threadnum*sizeof(float)>>>(d_pang , width , height , d_max);
    //global max
    findMaxGrad<<<1, blocknum , blocknum*sizeof(float)>>>(d_max , blocknum , 1 , d_max);
    // cudaDeviceSynchronize();
    // float max;
    // cudaMemcpy(&max , d_max , sizeof(float) , cudaMemcpyDeviceToHost );
    // printf("max is %f\n",max);
    // printf("blocknum is %d\n" , blocknum);
    
    //Tracing edges through the image and hysteresis thresholding
    if(!optimized)edgeTrace<<<threadsPerBlock, numofBlock>>>(d_pang ,d_ping , d_max , width , height , iteration , hsigma , lsigma);
    else edgeTraceOptimized<<<threadsPerBlock, numofBlock>>>(d_pang ,d_ping , d_max , width , height , iteration , hsigma , lsigma);
    
    //translate bit value to bmp file format
    trans2Bmp<<< threadsPerBlock, numofBlock>>>(d_ping , d_imagedataSrc , width , height,rev);
    //main process end

    cudaStatus = cudaDeviceSynchronize();
    if(cudaStatus != cudaSuccess){
        printf("*****kernel function down*****\n");
    }
    endCanny = clock();
    printf("------canny use %ld ms\n" , endCanny - startCanny);

    cudaStatus = cudaMemcpy(imagedataSrc , d_imagedataSrc , width*height*sizeof(uchar3) , cudaMemcpyDeviceToHost );
    if(cudaStatus!=cudaSuccess){
        printf("*****fail to copy memory from device*****\n");
        return 1;
    }

    // for(int i=0 ; i<width*height/1024;i++){
    // cudaStatus = cudaMemcpy(imagedataSrc+i*1024 , d_imagedataSrc+i*1024 , 1024*sizeof(uchar3) , cudaMemcpyDeviceToHost );
    // if(cudaStatus!=cudaSuccess){
    //     printf("*****fail to copy memory from device*****\n");
    //     return 1;
    // }
    // }
    // if((width*height)%1024!=0){
    //     cudaStatus = cudaMemcpy(imagedataSrc+i*1024 , d_imagedataSrc+i*1024 , ((width*height)%1024)*sizeof(uchar3) , cudaMemcpyDeviceToHost );
    //     if(cudaStatus!=cudaSuccess){
    //         printf("*****fail to copy memory from device*****\n");
    //         return 1;
    //     }  
    // }

    printf("before save bmlp file\n");
    printf("width:%d height:%d\n", width , height);
    saveBMPFile(imagedataSrc ,width , height , dstName);

    // cudaFree(d_imagedataDst);
    cudaFree(d_imagedataSrc);
    cudaFree(d_gauss);
    cudaFree(d_ping);
    cudaFree(d_pang);
    cudaFree(d_dx);
    cudaFree(d_dy);
    cudaFree(d_max);
    // free(imagedataDst);
    free(imagedataSrc);

    end =  clock();
    printf("------total use %ld ms\n" , end - start);
    return 0;
}


	.file	"tmpxft_00327bd4_00000000-6_canny.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2034:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2034:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Loading %s ...\n"
.LC1:
	.string	"rb"
.LC2:
	.string	"***** fail to open %s *****\n"
.LC3:
	.string	"***** it is not a bmp file *****\n"
.LC4:
	.string	"***** invalid color depth (24 bits needed) *****\n"
.LC5:
	.string	"It is %hd\n"
.LC6:
	.string	"size of short : %d\n"
.LC7:
	.string	"size of hdr is %d , infoHdr is %d\n"
.LC8:
	.string	"***** cannot solve copressed image *****\n"
.LC9:
	.string	"image width: %u\n"
.LC10:
	.string	"image height: %u\n"
.LC11:
	.string	"image file loaded successful! \n"
	.text
	.globl	_Z11loadBMPFilePP6uchar3PiS2_PKc
	.type	_Z11loadBMPFilePP6uchar3PiS2_PKc, @function
_Z11loadBMPFilePP6uchar3PiS2_PKc:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	movq	%rcx, %rdx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	leaq	.LC0(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	movl	$2, %edi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rbp, %rdi
	call	fopen@PLT
	testq	%rax, %rax
	jne	.L3
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%rbp, %rdx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L3:
	.cfi_restore_state
	movl	$14, %esi
	leaq	2(%rsp), %rdi
	movq	%rax, %r8
	movq	%rax, %rbx
	movl	$1, %ecx
	movl	$14, %edx
	call	__fread_chk@PLT
	cmpw	$19778, 2(%rsp)
	leaq	.LC3(%rip), %rsi
	jne	.L18
	leaq	16(%rsp), %rdi
	movq	%rbx, %r8
	movl	$1, %ecx
	movl	$40, %edx
	movl	$40, %esi
	leaq	.LC6(%rip), %r15
	leaq	.LC7(%rip), %rbp
	call	__fread_chk@PLT
	cmpw	$24, 30(%rsp)
	je	.L7
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movswl	30(%rsp), %edx
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%r15, %rsi
	movl	$2, %edx
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	$40, %ecx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$14, %edx
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L2
.L7:
	movl	$2, %edx
	movq	%r15, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	movl	$40, %ecx
	movq	%rbp, %rsi
	movl	$14, %edx
	movl	$2, %edi
	call	__printf_chk@PLT
	cmpl	$0, 32(%rsp)
	je	.L8
	leaq	.LC8(%rip), %rsi
.L18:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L8:
	movl	20(%rsp), %ebp
	movl	24(%rsp), %edi
	movl	%ebp, 0(%r13)
	movl	%edi, (%r14)
	imull	0(%r13), %edi
	movl	$4, %r13d
	movslq	%edi, %rdi
	leaq	(%rdi,%rdi,2), %rdi
	call	malloc@PLT
	movl	%ebp, %edx
	movl	$2, %edi
	xorl	%ebp, %ebp
	movq	%rax, (%r12)
	leaq	.LC9(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	24(%rsp), %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC10(%rip), %rsi
	call	__printf_chk@PLT
	movslq	12(%rsp), %rsi
	movl	$1, %edx
	movq	%rbx, %rdi
	subq	$54, %rsi
	call	fseek@PLT
.L9:
	cmpl	%ebp, 24(%rsp)
	jle	.L21
	xorl	%r14d, %r14d
.L13:
	cmpl	%r14d, 20(%rsp)
	jle	.L22
	movq	%rbx, %rdi
	call	fgetc@PLT
	movq	%rbx, %rdi
	movl	%eax, %edx
	movl	20(%rsp), %eax
	imull	%ebp, %eax
	addl	%r14d, %eax
	cltq
	leaq	(%rax,%rax,2), %rax
	addq	(%r12), %rax
	movb	%dl, 2(%rax)
	call	fgetc@PLT
	movq	%rbx, %rdi
	movl	%eax, %edx
	movl	20(%rsp), %eax
	imull	%ebp, %eax
	addl	%r14d, %eax
	cltq
	leaq	(%rax,%rax,2), %rax
	addq	(%r12), %rax
	movb	%dl, 1(%rax)
	call	fgetc@PLT
	movl	%eax, %edx
	movl	20(%rsp), %eax
	imull	%ebp, %eax
	addl	%r14d, %eax
	incl	%r14d
	cltq
	leaq	(%rax,%rax,2), %rax
	addq	(%r12), %rax
	movb	%dl, (%rax)
	jmp	.L13
.L22:
	xorl	%r14d, %r14d
.L11:
	imull	$3, 20(%rsp), %eax
	cltd
	idivl	%r13d
	negl	%edx
	andl	$3, %edx
	cmpl	%r14d, %edx
	jle	.L23
	movq	%rbx, %rdi
	incl	%r14d
	call	fgetc@PLT
	jmp	.L11
.L23:
	incl	%ebp
	jmp	.L9
.L21:
	movl	$2, %edi
	leaq	.LC11(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rdi
	call	fclose@PLT
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L15
.L19:
	call	__stack_chk_fail@PLT
.L15:
	addq	$72, %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
.LFE2027:
	.size	_Z11loadBMPFilePP6uchar3PiS2_PKc, .-_Z11loadBMPFilePP6uchar3PiS2_PKc
	.section	.rodata.str1.1
.LC12:
	.string	"in save bmp file\n"
.LC13:
	.string	"wb"
.LC14:
	.string	"***** fail to open dest file *****\n"
.LC15:
	.string	"image file writed over\n"
	.text
	.globl	_Z11saveBMPFileP6uchar3iiPKc
	.type	_Z11saveBMPFileP6uchar3iiPKc, @function
_Z11saveBMPFileP6uchar3iiPKc:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movl	%esi, %r12d
	leaq	.LC12(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
	movl	$2, %edi
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$27, %eax
	movl	$4, %ecx
	movq	%rbp, %rdi
	salq	$33, %rax
	leaq	.LC13(%rip), %rsi
	movw	$19778, 2(%rsp)
	movq	%rax, 8(%rsp)
	leal	(%r12,%r12,2), %eax
	cltd
	movl	$40, 16(%rsp)
	idivl	%ecx
	movl	%r12d, 20(%rsp)
	movl	%r13d, 24(%rsp)
	movq	$1572865, 28(%rsp)
	negl	%edx
	andl	$3, %edx
	leal	(%rdx,%r12), %eax
	imull	%r13d, %eax
	leal	(%rax,%rax,2), %eax
	leal	54(%rax), %edx
	movl	%eax, 36(%rsp)
	xorl	%eax, %eax
	movl	%edx, 4(%rsp)
	movq	%rax, 40(%rsp)
	movq	%rax, 48(%rsp)
	call	fopen@PLT
	testq	%rax, %rax
	jne	.L25
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
.L25:
	movq	%rax, %rbp
	leaq	2(%rsp), %rdi
	movq	%rax, %rcx
	movl	$1, %edx
	movl	$14, %esi
	xorl	%r12d, %r12d
	movl	$4, %r13d
	call	fwrite@PLT
	leaq	16(%rsp), %rdi
	movq	%rbp, %rcx
	movl	$1, %edx
	movl	$40, %esi
	call	fwrite@PLT
.L27:
	cmpl	%r12d, 24(%rsp)
	jle	.L35
	xorl	%r14d, %r14d
.L31:
	movl	20(%rsp), %eax
	cmpl	%r14d, %eax
	jle	.L36
	imull	%r12d, %eax
	movq	%rbp, %rsi
	addl	%r14d, %eax
	cltq
	leaq	(%rax,%rax,2), %rax
	movzbl	2(%rbx,%rax), %edi
	call	fputc@PLT
	movl	20(%rsp), %eax
	movq	%rbp, %rsi
	imull	%r12d, %eax
	addl	%r14d, %eax
	cltq
	leaq	(%rax,%rax,2), %rax
	movzbl	1(%rbx,%rax), %edi
	call	fputc@PLT
	movl	20(%rsp), %eax
	movq	%rbp, %rsi
	imull	%r12d, %eax
	addl	%r14d, %eax
	incl	%r14d
	cltq
	leaq	(%rax,%rax,2), %rax
	movzbl	(%rbx,%rax), %edi
	call	fputc@PLT
	jmp	.L31
.L36:
	xorl	%r14d, %r14d
.L29:
	imull	$3, 20(%rsp), %eax
	cltd
	idivl	%r13d
	negl	%edx
	andl	$3, %edx
	cmpl	%r14d, %edx
	jle	.L37
	movq	%rbp, %rsi
	xorl	%edi, %edi
	incl	%r14d
	call	fputc@PLT
	jmp	.L29
.L37:
	incl	%r12d
	jmp	.L27
.L35:
	movl	$2, %edi
	leaq	.LC15(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rdi
	call	fclose@PLT
.L24:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	addq	$64, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z11saveBMPFileP6uchar3iiPKc, .-_Z11saveBMPFileP6uchar3iiPKc
	.globl	_Z18cannyRgb2grayscale6uchar3
	.type	_Z18cannyRgb2grayscale6uchar3, @function
_Z18cannyRgb2grayscale6uchar3:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	%rdi, 8(%rsp)
	movl	$1, 28(%rsp)
	movl	28(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2029:
	.size	_Z18cannyRgb2grayscale6uchar3, .-_Z18cannyRgb2grayscale6uchar3
	.section	.rodata.str1.1
.LC19:
	.string	"-gs"
.LC20:
	.string	"%f"
.LC21:
	.string	"*****invalid argument format*****\n"
.LC22:
	.string	"-hs"
.LC23:
	.string	"-ls"
.LC24:
	.string	"-it"
.LC25:
	.string	"%d"
.LC26:
	.string	"-src"
.LC27:
	.string	"-dst"
.LC28:
	.string	"-opt"
.LC29:
	.string	"-rev"
.LC30:
	.string	"-help"
.LC31:
	.string	"-src srcname : set src image file, must be 24 bit bmp file\n"
.LC32:
	.string	"-dst dstname : set dst image file, must be 24 bit bmp file\n"
.LC33:
	.string	"-gs  gaussSigma: set gaussSigma\n"
.LC34:
	.string	"-ls  lowThreshold : set lowthreshold in canny\n"
.LC35:
	.string	"-hs  highThreshold: set highthreshold in canny\n"
.LC36:
	.string	"-it  iteration    : set iteration number of tracing edge\n"
.LC37:
	.string	"-opt  1/0    : set ioptimimze tracing edge or not\n"
.LC38:
	.string	"-rev  1/0    : set  edge color black(0)/white(1)\n"
.LC39:
	.string	"-help :show info like this\n"
.LC40:
	.string	"*****invalid iteration*****\n"
.LC43:
	.string	"*****invalid l/hsigma value*****\n"
.LC44:
	.string	"*****invalid gauss sigma value*****\n"
	.text
	.globl	_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_
	.type	_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_, @function
_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_:
.LFB2030:
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	$0x3f99999a, (%rdx)
	movq	96(%rsp), %rax
	movl	$0x3e4ccccd, (%rcx)
	movl	$0x3dcccccd, (%r8)
	movl	$10, (%r9)
	movl	$1, (%rax)
	movq	104(%rsp), %rax
	movq	%rdx, (%rsp)
	movl	$1, (%rax)
	cmpl	$1, %edi
	je	.L40
	movl	%edi, %r12d
	movq	%rsi, %rbp
	movq	%rcx, %r13
	movq	%r8, %r14
	movq	%r9, %r15
	movl	$1, %ebx
.L42:
	cmpl	%ebx, %r12d
	jle	.L67
	movslq	%ebx, %rax
	leaq	.LC19(%rip), %rdi
	movq	0(%rbp,%rax,8), %rsi
	leaq	0(,%rax,8), %rdx
	movq	%rdx, 8(%rsp)
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L43
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jge	.L44
	movq	8(%rsp), %rdx
	leaq	.LC20(%rip), %rsi
	xorl	%eax, %eax
	incl	%ebx
	movq	8(%rbp,%rdx), %rdi
	movq	(%rsp), %rdx
	call	__isoc23_sscanf@PLT
	incl	%eax
	cmpl	$1, %eax
	ja	.L43
.L44:
	leaq	.LC21(%rip), %rsi
	jmp	.L66
.L43:
	movslq	%ebx, %rax
	leaq	.LC22(%rip), %rdi
	movq	0(%rbp,%rax,8), %rsi
	leaq	0(,%rax,8), %rdx
	movq	%rdx, 8(%rsp)
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L45
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jge	.L44
	movq	8(%rsp), %rdx
	leaq	.LC20(%rip), %rsi
	xorl	%eax, %eax
	incl	%ebx
	movq	8(%rbp,%rdx), %rdi
	movq	%r13, %rdx
	call	__isoc23_sscanf@PLT
	incl	%eax
	cmpl	$1, %eax
	jbe	.L44
.L45:
	movslq	%ebx, %rax
	leaq	.LC23(%rip), %rdi
	movq	0(%rbp,%rax,8), %rsi
	leaq	0(,%rax,8), %rdx
	movq	%rdx, 8(%rsp)
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L46
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jge	.L44
	movq	8(%rsp), %rdx
	leaq	.LC20(%rip), %rsi
	xorl	%eax, %eax
	incl	%ebx
	movq	8(%rbp,%rdx), %rdi
	movq	%r14, %rdx
	call	__isoc23_sscanf@PLT
	incl	%eax
	cmpl	$1, %eax
	jbe	.L44
.L46:
	movslq	%ebx, %rax
	leaq	.LC24(%rip), %rdi
	movq	0(%rbp,%rax,8), %rsi
	leaq	0(,%rax,8), %rdx
	movq	%rdx, 8(%rsp)
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L47
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jge	.L44
	movq	8(%rsp), %rdx
	leaq	.LC25(%rip), %rsi
	xorl	%eax, %eax
	incl	%ebx
	movq	8(%rbp,%rdx), %rdi
	movq	%r15, %rdx
	call	__isoc23_sscanf@PLT
	incl	%eax
	cmpl	$1, %eax
	jbe	.L44
.L47:
	movslq	%ebx, %rax
	leaq	.LC26(%rip), %rdi
	movq	0(%rbp,%rax,8), %rsi
	leaq	0(,%rax,8), %rdx
	movq	%rdx, 8(%rsp)
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L48
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jge	.L44
	movq	8(%rsp), %rdx
	movq	80(%rsp), %rcx
	incl	%ebx
	movq	8(%rbp,%rdx), %rax
	movq	%rax, (%rcx)
.L48:
	movslq	%ebx, %rax
	leaq	.LC27(%rip), %rdi
	movq	0(%rbp,%rax,8), %rsi
	leaq	0(,%rax,8), %rdx
	movq	%rdx, 8(%rsp)
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L49
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jge	.L44
	movq	8(%rsp), %rdx
	movq	88(%rsp), %rcx
	incl	%ebx
	movq	8(%rbp,%rdx), %rax
	movq	%rax, (%rcx)
.L49:
	movslq	%ebx, %rax
	leaq	.LC28(%rip), %rdi
	movq	0(%rbp,%rax,8), %rsi
	leaq	0(,%rax,8), %rdx
	movq	%rdx, 8(%rsp)
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L50
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jge	.L44
	movq	8(%rsp), %rdx
	leaq	.LC25(%rip), %rsi
	xorl	%eax, %eax
	incl	%ebx
	movq	8(%rbp,%rdx), %rdi
	movq	96(%rsp), %rdx
	call	__isoc23_sscanf@PLT
	incl	%eax
	cmpl	$1, %eax
	jbe	.L44
.L50:
	movslq	%ebx, %rax
	leaq	.LC29(%rip), %rdi
	movq	0(%rbp,%rax,8), %rsi
	leaq	0(,%rax,8), %rdx
	movq	%rdx, 8(%rsp)
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L51
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jge	.L44
	movq	8(%rsp), %rdx
	leaq	.LC25(%rip), %rsi
	xorl	%eax, %eax
	incl	%ebx
	movq	8(%rbp,%rdx), %rdi
	movq	104(%rsp), %rdx
	call	__isoc23_sscanf@PLT
	incl	%eax
	cmpl	$1, %eax
	jbe	.L44
.L51:
	movslq	%ebx, %rax
	leaq	.LC30(%rip), %rdi
	movq	0(%rbp,%rax,8), %rsi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L52
	leaq	.LC31(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	.LC32(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC33(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC34(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC35(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC36(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC37(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC38(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$2, %edi
	leaq	.LC39(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%edi, %edi
.L65:
	call	exit@PLT
.L52:
	incl	%ebx
	jmp	.L42
.L67:
	cmpl	$0, (%r15)
	leaq	.LC40(%rip), %rsi
	jle	.L66
	movss	(%r14), %xmm2
	movss	0(%r13), %xmm1
	comiss	%xmm1, %xmm2
	ja	.L55
	xorps	%xmm0, %xmm0
	comiss	%xmm2, %xmm0
	ja	.L55
	comiss	.LC42(%rip), %xmm1
	jbe	.L63
.L55:
	leaq	.LC43(%rip), %rsi
	jmp	.L66
.L63:
	movq	(%rsp), %rax
	comiss	(%rax), %xmm0
	jb	.L40
	leaq	.LC44(%rip), %rsi
.L66:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	jmp	.L65
.L40:
	addq	$24, %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
.LFE2030:
	.size	_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_, .-_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_
	.globl	_Z29__device_stub__Z8genGaussPfifPfif
	.type	_Z29__device_stub__Z8genGaussPfifPfif, @function
_Z29__device_stub__Z8genGaussPfifPfif:
.LFB2056:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	32(%rsp), %rdi
	leaq	44(%rsp), %rsi
	movss	%xmm0, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L68
	pushq	24(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z8genGaussPfif(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 144
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L68:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L70
	call	__stack_chk_fail@PLT
.L70:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2056:
	.size	_Z29__device_stub__Z8genGaussPfifPfif, .-_Z29__device_stub__Z8genGaussPfifPfif
	.globl	_Z8genGaussPfif
	.type	_Z8genGaussPfif, @function
_Z8genGaussPfif:
.LFB2057:
	.cfi_startproc
	endbr64
	jmp	_Z29__device_stub__Z8genGaussPfifPfif
	.cfi_endproc
.LFE2057:
	.size	_Z8genGaussPfif, .-_Z8genGaussPfif
	.globl	_Z43__device_stub__Z13rgb2grayscaleP6uchar3iiPfP6uchar3iiPf
	.type	_Z43__device_stub__Z13rgb2grayscaleP6uchar3iiPfP6uchar3iiPf, @function
_Z43__device_stub__Z13rgb2grayscaleP6uchar3iiPfP6uchar3iiPf:
.LFB2058:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L73
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z13rgb2grayscaleP6uchar3iiPf(%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
.L73:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L75
	call	__stack_chk_fail@PLT
.L75:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2058:
	.size	_Z43__device_stub__Z13rgb2grayscaleP6uchar3iiPfP6uchar3iiPf, .-_Z43__device_stub__Z13rgb2grayscaleP6uchar3iiPfP6uchar3iiPf
	.globl	_Z13rgb2grayscaleP6uchar3iiPf
	.type	_Z13rgb2grayscaleP6uchar3iiPf, @function
_Z13rgb2grayscaleP6uchar3iiPf:
.LFB2059:
	.cfi_startproc
	endbr64
	jmp	_Z43__device_stub__Z13rgb2grayscaleP6uchar3iiPfP6uchar3iiPf
	.cfi_endproc
.LFE2059:
	.size	_Z13rgb2grayscaleP6uchar3iiPf, .-_Z13rgb2grayscaleP6uchar3iiPf
	.globl	_Z35__device_stub__Z9gaussBlurPfS_iiS_iPfS_iiS_i
	.type	_Z35__device_stub__Z9gaussBlurPfS_iiS_iPfS_iiS_i, @function
_Z35__device_stub__Z9gaussBlurPfS_iiS_iPfS_iiS_i:
.LFB2060:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movl	%edx, 28(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 24(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L78
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z9gaussBlurPfS_iiS_i(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L78:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L80
	call	__stack_chk_fail@PLT
.L80:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2060:
	.size	_Z35__device_stub__Z9gaussBlurPfS_iiS_iPfS_iiS_i, .-_Z35__device_stub__Z9gaussBlurPfS_iiS_iPfS_iiS_i
	.globl	_Z9gaussBlurPfS_iiS_i
	.type	_Z9gaussBlurPfS_iiS_i, @function
_Z9gaussBlurPfS_iiS_i:
.LFB2061:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z9gaussBlurPfS_iiS_iPfS_iiS_i
	.cfi_endproc
.LFE2061:
	.size	_Z9gaussBlurPfS_iiS_i, .-_Z9gaussBlurPfS_iiS_i
	.globl	_Z40__device_stub__Z12calcGradientPfS_S_S_iiPfS_S_S_ii
	.type	_Z40__device_stub__Z12calcGradientPfS_S_S_iiPfS_S_S_ii, @function
_Z40__device_stub__Z12calcGradientPfS_S_S_iiPfS_S_S_ii:
.LFB2062:
	.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
	movl	%r8d, 12(%rsp)
	movl	%r9d, 8(%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	12(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	8(%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	.L83
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z12calcGradientPfS_S_S_ii(%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
.L83:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L85
	call	__stack_chk_fail@PLT
.L85:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2062:
	.size	_Z40__device_stub__Z12calcGradientPfS_S_S_iiPfS_S_S_ii, .-_Z40__device_stub__Z12calcGradientPfS_S_S_iiPfS_S_S_ii
	.globl	_Z12calcGradientPfS_S_S_ii
	.type	_Z12calcGradientPfS_S_S_ii, @function
_Z12calcGradientPfS_S_S_ii:
.LFB2063:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z12calcGradientPfS_S_S_iiPfS_S_S_ii
	.cfi_endproc
.LFE2063:
	.size	_Z12calcGradientPfS_S_S_ii, .-_Z12calcGradientPfS_S_S_ii
	.globl	_Z42__device_stub__Z14nonMaxRestrainPfS_S_S_iiPfS_S_S_ii
	.type	_Z42__device_stub__Z14nonMaxRestrainPfS_S_S_iiPfS_S_S_ii, @function
_Z42__device_stub__Z14nonMaxRestrainPfS_S_S_iiPfS_S_S_ii:
.LFB2064:
	.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
	movl	%r8d, 12(%rsp)
	movl	%r9d, 8(%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	12(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	8(%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	.L88
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z14nonMaxRestrainPfS_S_S_ii(%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
.L88:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L90
	call	__stack_chk_fail@PLT
.L90:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2064:
	.size	_Z42__device_stub__Z14nonMaxRestrainPfS_S_S_iiPfS_S_S_ii, .-_Z42__device_stub__Z14nonMaxRestrainPfS_S_S_iiPfS_S_S_ii
	.globl	_Z14nonMaxRestrainPfS_S_S_ii
	.type	_Z14nonMaxRestrainPfS_S_S_ii, @function
_Z14nonMaxRestrainPfS_S_S_ii:
.LFB2065:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z14nonMaxRestrainPfS_S_S_iiPfS_S_S_ii
	.cfi_endproc
.LFE2065:
	.size	_Z14nonMaxRestrainPfS_S_S_ii, .-_Z14nonMaxRestrainPfS_S_S_ii
	.globl	_Z35__device_stub__Z11findMaxGradPfiiS_PfiiS_
	.type	_Z35__device_stub__Z11findMaxGradPfiiS_PfiiS_, @function
_Z35__device_stub__Z11findMaxGradPfiiS_PfiiS_:
.LFB2066:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L93
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z11findMaxGradPfiiS_(%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
.L93:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L95
	call	__stack_chk_fail@PLT
.L95:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2066:
	.size	_Z35__device_stub__Z11findMaxGradPfiiS_PfiiS_, .-_Z35__device_stub__Z11findMaxGradPfiiS_PfiiS_
	.globl	_Z11findMaxGradPfiiS_
	.type	_Z11findMaxGradPfiiS_, @function
_Z11findMaxGradPfiiS_:
.LFB2067:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z11findMaxGradPfiiS_PfiiS_
	.cfi_endproc
.LFE2067:
	.size	_Z11findMaxGradPfiiS_, .-_Z11findMaxGradPfiiS_
	.globl	_Z37__device_stub__Z9edgeTracePfS_S_iiiffPfS_S_iiiff
	.type	_Z37__device_stub__Z9edgeTracePfS_S_iiiffPfS_S_iiiff, @function
_Z37__device_stub__Z9edgeTracePfS_S_iiiffPfS_S_iiiff:
.LFB2068:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movss	%xmm0, 8(%rsp)
	movss	%xmm1, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L98
	pushq	64(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z9edgeTracePfS_S_iiiff(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 224
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L98:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L100
	call	__stack_chk_fail@PLT
.L100:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2068:
	.size	_Z37__device_stub__Z9edgeTracePfS_S_iiiffPfS_S_iiiff, .-_Z37__device_stub__Z9edgeTracePfS_S_iiiffPfS_S_iiiff
	.globl	_Z9edgeTracePfS_S_iiiff
	.type	_Z9edgeTracePfS_S_iiiff, @function
_Z9edgeTracePfS_S_iiiff:
.LFB2069:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z9edgeTracePfS_S_iiiffPfS_S_iiiff
	.cfi_endproc
.LFE2069:
	.size	_Z9edgeTracePfS_S_iiiff, .-_Z9edgeTracePfS_S_iiiff
	.globl	_Z47__device_stub__Z18edgeTraceOptimizedPfS_S_iiiffPfS_S_iiiff
	.type	_Z47__device_stub__Z18edgeTraceOptimizedPfS_S_iiiffPfS_S_iiiff, @function
_Z47__device_stub__Z18edgeTraceOptimizedPfS_S_iiiffPfS_S_iiiff:
.LFB2070:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movss	%xmm0, 8(%rsp)
	movss	%xmm1, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L103
	pushq	64(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z18edgeTraceOptimizedPfS_S_iiiff(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 224
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L103:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L105
	call	__stack_chk_fail@PLT
.L105:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2070:
	.size	_Z47__device_stub__Z18edgeTraceOptimizedPfS_S_iiiffPfS_S_iiiff, .-_Z47__device_stub__Z18edgeTraceOptimizedPfS_S_iiiffPfS_S_iiiff
	.globl	_Z18edgeTraceOptimizedPfS_S_iiiff
	.type	_Z18edgeTraceOptimizedPfS_S_iiiff, @function
_Z18edgeTraceOptimizedPfS_S_iiiff:
.LFB2071:
	.cfi_startproc
	endbr64
	jmp	_Z47__device_stub__Z18edgeTraceOptimizedPfS_S_iiiffPfS_S_iiiff
	.cfi_endproc
.LFE2071:
	.size	_Z18edgeTraceOptimizedPfS_S_iiiff, .-_Z18edgeTraceOptimizedPfS_S_iiiff
	.globl	_Z39__device_stub__Z9trans2BmpPfP6uchar3iiiPfP6uchar3iii
	.type	_Z39__device_stub__Z9trans2BmpPfP6uchar3iiiPfP6uchar3iii, @function
_Z39__device_stub__Z9trans2BmpPfP6uchar3iiiPfP6uchar3iii:
.LFB2072:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L108
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z9trans2BmpPfP6uchar3iii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L108:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L110
	call	__stack_chk_fail@PLT
.L110:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2072:
	.size	_Z39__device_stub__Z9trans2BmpPfP6uchar3iiiPfP6uchar3iii, .-_Z39__device_stub__Z9trans2BmpPfP6uchar3iiiPfP6uchar3iii
	.globl	_Z9trans2BmpPfP6uchar3iii
	.type	_Z9trans2BmpPfP6uchar3iii, @function
_Z9trans2BmpPfP6uchar3iii:
.LFB2073:
	.cfi_startproc
	endbr64
	jmp	_Z39__device_stub__Z9trans2BmpPfP6uchar3iiiPfP6uchar3iii
	.cfi_endproc
.LFE2073:
	.size	_Z9trans2BmpPfP6uchar3iii, .-_Z9trans2BmpPfP6uchar3iii
	.section	.rodata.str1.1
.LC46:
	.string	"../data/src3.bmp"
.LC47:
	.string	"../data/out.bmp"
.LC48:
	.string	"*****fail to malloc gpu memory*****\n"
.LC49:
	.string	"*****fail to copy memory*****\n"
.LC50:
	.string	"*****kernel function down*****\n"
.LC51:
	.string	"------canny use %ld ms\n"
.LC52:
	.string	"*****fail to copy memory from device*****\n"
.LC53:
	.string	"before save bmlp file\n"
.LC54:
	.string	"width:%d height:%d\n"
.LC55:
	.string	"------total use %ld ms\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2031:
	.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	$200, %rsp
	.cfi_def_cfa_offset 256
	movl	%edi, 8(%rsp)
	movq	%rsi, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	call	clock@PLT
	movl	$0x3f99999a, 32(%rsp)
	leaq	36(%rsp), %rcx
	leaq	32(%rsp), %rdx
	movq	%rax, %r14
	xorl	%eax, %eax
	movl	$0x3e19999a, 36(%rsp)
	movq	%rax, 120(%rsp)
	movq	%rax, 128(%rsp)
	leaq	52(%rsp), %rax
	movl	$0x3dcccccd, 40(%rsp)
	movl	$10, 44(%rsp)
	movl	$1, 48(%rsp)
	movl	$1, 52(%rsp)
	pushq	%rax
	.cfi_def_cfa_offset 264
	leaq	56(%rsp), %rax
	pushq	%rax
	.cfi_def_cfa_offset 272
	leaq	144(%rsp), %rax
	pushq	%rax
	.cfi_def_cfa_offset 280
	leaq	144(%rsp), %rax
	pushq	%rax
	.cfi_def_cfa_offset 288
	movq	32(%rsp), %rsi
	movl	40(%rsp), %edi
	leaq	76(%rsp), %r9
	leaq	72(%rsp), %r8
	call	_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_
	addq	$32, %rsp
	.cfi_def_cfa_offset 256
	cmpq	$0, 120(%rsp)
	jne	.L114
	leaq	.LC46(%rip), %rax
	movq	%rax, 120(%rsp)
.L114:
	cmpq	$0, 128(%rsp)
	jne	.L115
	leaq	.LC47(%rip), %rax
	movq	%rax, 128(%rsp)
.L115:
	movq	120(%rsp), %rcx
	leaq	24(%rsp), %rsi
	leaq	56(%rsp), %rdi
	leaq	28(%rsp), %rdx
	call	_Z11loadBMPFilePP6uchar3PiS2_PKc
	leaq	72(%rsp), %rdi
	movl	$100, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L116
.L118:
	leaq	.LC48(%rip), %rsi
	jmp	.L140
.L116:
	movl	24(%rsp), %ebx
	movl	28(%rsp), %ebp
	leaq	80(%rsp), %rdi
	movl	%ebx, %r12d
	imull	%ebp, %r12d
	movslq	%r12d, %r15
	leaq	0(,%r15,4), %r13
	movq	%r13, %rsi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	jne	.L118
	leaq	88(%rsp), %rdi
	movq	%r13, %rsi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	jne	.L118
	leaq	96(%rsp), %rdi
	movq	%r13, %rsi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	jne	.L118
	leaq	104(%rsp), %rdi
	movq	%r13, %rsi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	jne	.L118
	leaq	(%r15,%r15,2), %rax
	leaq	64(%rsp), %rdi
	movq	%rax, %rsi
	movq	%rax, 8(%rsp)
	call	cudaMalloc@PLT
	testl	%eax, %eax
	jne	.L118
	movq	56(%rsp), %rax
	movq	8(%rsp), %rdx
	movl	$1, %ecx
	movq	64(%rsp), %rdi
	movq	%rax, %rsi
	movq	%rax, (%rsp)
	call	cudaMemcpy@PLT
	testl	%eax, %eax
	je	.L119
	leaq	.LC49(%rip), %rsi
.L140:
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %eax
	jmp	.L113
.L119:
	leal	31(%rbx), %eax
	movl	$32, %ecx
	leaq	112(%rsp), %rdi
	addl	$1023, %r12d
	movl	$1, 156(%rsp)
	cltd
	idivl	%ecx
	movl	%eax, 148(%rsp)
	leal	31(%rbp), %eax
	cltd
	idivl	%ecx
	movl	$1024, %ecx
	movl	%eax, 152(%rsp)
	movl	%r12d, %eax
	cltd
	idivl	%ecx
	movslq	%eax, %r13
	movq	%r13, %r12
	salq	$2, %r13
	movq	%r13, %rsi
	call	cudaMalloc@PLT
	call	clock@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx
	movl	$1, 180(%rsp)
	movq	%rdi, 172(%rsp)
	movq	%rax, %r15
	movq	%rdx, 136(%rsp)
	movl	$1, 144(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L121
	movss	32(%rsp), %xmm0
	movq	72(%rsp), %rdi
	movl	$5, %esi
	call	_Z29__device_stub__Z8genGaussPfifPfif
.L121:
	movl	144(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	136(%rsp), %rdx
	movq	148(%rsp), %rdi
	movl	156(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L122
	movq	80(%rsp), %rcx
	movq	64(%rsp), %rdi
	movl	%ebp, %edx
	movl	%ebx, %esi
	call	_Z43__device_stub__Z13rgb2grayscaleP6uchar3iiPfP6uchar3iiPf
.L122:
	movl	144(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	136(%rsp), %rdx
	movq	148(%rsp), %rdi
	movl	156(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L123
	movq	72(%rsp), %r8
	movq	88(%rsp), %rsi
	movl	%ebp, %ecx
	movl	%ebx, %edx
	movq	80(%rsp), %rdi
	movl	$5, %r9d
	call	_Z35__device_stub__Z9gaussBlurPfS_iiS_iPfS_iiS_i
.L123:
	movl	144(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	136(%rsp), %rdx
	movq	148(%rsp), %rdi
	movl	156(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L124
	movq	104(%rsp), %rcx
	movq	96(%rsp), %rdx
	movl	%ebp, %r9d
	movl	%ebx, %r8d
	movq	80(%rsp), %rsi
	movq	88(%rsp), %rdi
	call	_Z40__device_stub__Z12calcGradientPfS_S_S_iiPfS_S_S_ii
.L124:
	movl	144(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	136(%rsp), %rdx
	movq	148(%rsp), %rdi
	movl	156(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L125
	movq	104(%rsp), %rcx
	movq	96(%rsp), %rdx
	movl	%ebp, %r9d
	movl	%ebx, %r8d
	movq	88(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z42__device_stub__Z14nonMaxRestrainPfS_S_S_iiPfS_S_S_ii
.L125:
	movl	%r12d, 160(%rsp)
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	movl	$1, %ecx
	movabsq	$4294967297, %rax
	salq	$10, %rdx
	movl	$4096, %r8d
	movl	$1, 180(%rsp)
	movq	%rax, 164(%rsp)
	movq	160(%rsp), %rdi
	movl	168(%rsp), %esi
	movq	%rdx, 172(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L126
	movq	112(%rsp), %rcx
	movq	88(%rsp), %rdi
	movl	%ebp, %edx
	movl	%ebx, %esi
	call	_Z35__device_stub__Z11findMaxGradPfiiS_PfiiS_
.L126:
	movabsq	$4294967297, %rdi
	xorl	%r9d, %r9d
	movq	%r13, %r8
	movl	$1, %esi
	movq	%rdi, 176(%rsp)
	movl	180(%rsp), %ecx
	movl	%r12d, 172(%rsp)
	movq	172(%rsp), %rdx
	movq	%rdi, 160(%rsp)
	movl	$1, 168(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L127
	movq	112(%rsp), %rdi
	movl	$1, %edx
	movl	%r12d, %esi
	movq	%rdi, %rcx
	call	_Z35__device_stub__Z11findMaxGradPfiiS_PfiiS_
.L127:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cmpl	$0, 48(%rsp)
	movq	136(%rsp), %rdx
	movl	144(%rsp), %ecx
	movq	148(%rsp), %rdi
	movl	156(%rsp), %esi
	jne	.L128
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L130
	movss	40(%rsp), %xmm1
	movl	44(%rsp), %r9d
	movl	%ebp, %r8d
	movl	%ebx, %ecx
	movss	36(%rsp), %xmm0
	movq	112(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	88(%rsp), %rdi
	call	_Z37__device_stub__Z9edgeTracePfS_S_iiiffPfS_S_iiiff
	jmp	.L130
.L128:
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L130
	movss	40(%rsp), %xmm1
	movl	44(%rsp), %r9d
	movl	%ebp, %r8d
	movl	%ebx, %ecx
	movss	36(%rsp), %xmm0
	movq	112(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	88(%rsp), %rdi
	call	_Z47__device_stub__Z18edgeTraceOptimizedPfS_S_iiiffPfS_S_iiiff
.L130:
	movl	144(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	136(%rsp), %rdx
	movq	148(%rsp), %rdi
	movl	156(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L132
	movl	52(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	%ebp, %ecx
	movl	%ebx, %edx
	movq	80(%rsp), %rdi
	call	_Z39__device_stub__Z9trans2BmpPfP6uchar3iiiPfP6uchar3iii
.L132:
	call	cudaDeviceSynchronize@PLT
	testl	%eax, %eax
	je	.L133
	leaq	.LC50(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L133:
	call	clock@PLT
	leaq	.LC51(%rip), %rsi
	movl	$2, %edi
	subq	%r15, %rax
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	64(%rsp), %rsi
	movq	8(%rsp), %rdx
	movl	$2, %ecx
	movq	(%rsp), %rdi
	call	cudaMemcpy@PLT
	leaq	.LC52(%rip), %rsi
	testl	%eax, %eax
	jne	.L140
	leaq	.LC53(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%ebp, %ecx
	movl	%ebx, %edx
	leaq	.LC54(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%rsp), %rdi
	movl	%ebp, %edx
	movl	%ebx, %esi
	movq	128(%rsp), %rcx
	call	_Z11saveBMPFileP6uchar3iiPKc
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	96(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	(%rsp), %rdi
	call	free@PLT
	call	clock@PLT
	leaq	.LC55(%rip), %rsi
	movl	$2, %edi
	subq	%r14, %rax
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
.L113:
	movq	184(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L135
	call	__stack_chk_fail@PLT
.L135:
	addq	$200, %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
.LFE2031:
	.size	main, .-main
	.section	.rodata.str1.1
.LC56:
	.string	"_Z9trans2BmpPfP6uchar3iii"
.LC57:
	.string	"_Z18edgeTraceOptimizedPfS_S_iiiff"
.LC58:
	.string	"_Z9edgeTracePfS_S_iiiff"
.LC59:
	.string	"_Z11findMaxGradPfiiS_"
.LC60:
	.string	"_Z14nonMaxRestrainPfS_S_S_ii"
.LC61:
	.string	"_Z12calcGradientPfS_S_S_ii"
.LC62:
	.string	"_Z9gaussBlurPfS_iiS_i"
.LC63:
	.string	"_Z13rgb2grayscaleP6uchar3iiPf"
.LC64:
	.string	"_Z8genGaussPfif"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2075:
	.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	.LC56(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z9trans2BmpPfP6uchar3iii(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC57(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z18edgeTraceOptimizedPfS_S_iiiff(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC58(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z9edgeTracePfS_S_iiiff(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC59(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z11findMaxGradPfiiS_(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC60(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z14nonMaxRestrainPfS_S_S_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC61(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z12calcGradientPfS_S_S_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC62(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z9gaussBlurPfS_iiS_i(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC63(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z13rgb2grayscaleP6uchar3iiPf(%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
	leaq	.LC64(%rip), %rdx
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	_Z8genGaussPfif(%rip), %rsi
	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
.LFE2075:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.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
.LC42:
	.long	1065353216
	.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<stdio.h>
#include<stdlib.h>
#include<string.h>

#include<time.h>

#pragma pack (1)
//设置对齐方式

#define GauSize 5

typedef struct{
    short type;         //文件类型，必须为BM
    int size;           //整个位图文件的大小，以字节为单位
    short reserved1;    //保留，全0
    short reserved2;    //保留，全0
    int offset;         //位图数据的起始位置，字节为单位
}BMPHeader;

typedef struct 
{
    int size;       //BMP 信息头的大小，字节为单位
    int width;      //宽度，以像素为单位
    int height;     //高度，以像素为单位
    short planes;   // 一般为1
    short bitsPerPixel; //每个像素所用的位数
    unsigned compression; //压缩类型 0：不压缩   1：BI_RLE8压缩类型  2：BI_RLE4压缩类型
    unsigned imageSize;   //位图数据部分的大小，以字节为单位
    int xPelsPerMeter;    //水平分辨率，每米像素数，可置为0
    int yPelsPerMeter;    //同上
    int clrUsed;          //位图实际使用的颜色表中的颜色数，置为0都使用
    int clrImportant;     //位图显示时重要的颜色数，置为0都重要
}BMPInfoHeader;

// typedef struct {
//     unsigned char x,y,z; //bmp中24位位图数据存储的单个像素通道顺序是bgr ， 且每行必须为4的倍数， 不够用0填充
// }uchar3;

void loadBMPFile(uchar3 ** dst, int *width , int *height , const char *name){

    BMPHeader hdr;
    BMPInfoHeader infoHdr;
    int x,y;
    FILE *fd ;
    

    printf("Loading %s ...\n", name);
    if(sizeof(uchar3) !=3){
        printf("***** uchaar3 is not 3 bytes *****\n");
        return ;
    }
    if( !(fd = fopen(name, "rb"))){
        printf("***** fail to open %s *****\n", name);
        return ;
    }


    fread(&hdr , sizeof(hdr) , 1, fd);

    if(hdr.type != 0x4d42){
        printf("***** it is not a bmp file *****\n");
        return ;
    }

    fread(&infoHdr , sizeof(infoHdr) , 1, fd);

    if(infoHdr.bitsPerPixel !=24){
        printf("***** invalid color depth (24 bits needed) *****\n");
        printf("It is %hd\n" , infoHdr.bitsPerPixel);
        printf("size of short : %d\n",sizeof(short));
        printf("size of hdr is %d , infoHdr is %d\n" , sizeof(hdr) , sizeof(infoHdr));
        return;
    }
    printf("size of short : %d\n",sizeof(short));
    printf("size of hdr is %d , infoHdr is %d\n" , sizeof(hdr) , sizeof(infoHdr));
    if(infoHdr.compression){
        printf("***** cannot solve copressed image *****\n");
        return ;
    }


    *width = infoHdr.width;
    *height = infoHdr.height;
    //malloc space for image data 
    *dst = (uchar3 *)malloc(*width * *height * sizeof(uchar3));
    // cudaMallocManaged(dst , *width * *height * sizeof(uchar3));
    printf("image width: %u\n", infoHdr.width);
    printf("image height: %u\n", infoHdr.height);

    fseek(fd, hdr.offset - sizeof(hdr) - sizeof(infoHdr) , SEEK_CUR);

    for(y = 0 ; y < infoHdr.height ; y++){
        for(x = 0 ; x < infoHdr.width ; x++){
            (*dst)[ y * infoHdr.width + x ].z = fgetc(fd);
            (*dst)[ y * infoHdr.width + x ].y = fgetc(fd);
            (*dst)[ y * infoHdr.width + x ].x = fgetc(fd);

        }

        //pass filling bytes
        for(x = 0 ; x < (4 - (3*infoHdr.width)%4)%4 ; x++ ){
            fgetc(fd);
        }
    }

    printf("image file loaded successful! \n");

    fclose(fd);


}

void saveBMPFile(uchar3 *dst , int width , int height , const char *name){
    printf("in save bmp file\n");
    BMPHeader hdr; 
    BMPInfoHeader infoHdr;
     
    hdr.type = 0x4d42;
    hdr.reserved1 = 0;
    hdr.reserved2 = 0; 
    hdr.offset = 54;
    hdr.size = hdr.offset + 3 * height * (width + (4-(width*3)%4)%4 );

    infoHdr.size = 40;
    infoHdr.width = width;
    infoHdr.height = height;
    infoHdr.planes = 1;
    infoHdr.bitsPerPixel = 24;
    infoHdr.compression = 0;
    infoHdr.imageSize = hdr.size - hdr.offset;
    infoHdr.xPelsPerMeter = 0;
    infoHdr.yPelsPerMeter = 0;
    infoHdr.clrImportant = 0;
    infoHdr.clrUsed = 0;

    FILE *fd;
    if(! (fd=fopen(name,"wb"))){
        printf("***** fail to open dest file *****\n");
        return;
    }

    fwrite(&hdr , sizeof(hdr) , 1 , fd);
    fwrite(&infoHdr , sizeof(infoHdr) , 1 , fd);

    int x,y;
    for(y = 0; y < infoHdr.height ; y++){
        for(x = 0 ; x < infoHdr.width ; x++){
            fputc( dst[ y * infoHdr.width + x ].z , fd);
            fputc( dst[ y * infoHdr.width + x ].y , fd);
            fputc( dst[ y * infoHdr.width + x ].x , fd);
            // printf("save one pixel\n");

        }

        //pass filling bytes
        for(x = 0 ; x < (4 - (3*infoHdr.width)%4)%4 ; x++ ){
            fputc(0 , fd);
        }
    }

    printf("image file writed over\n");
    fclose(fd);
}


__global__ void genGauss(float *gauss , int size , float sig ){

    __shared__ float sum;
    sum=0;
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;
    int mid = size/2 ;
    float sigma = sig;
    if(x<size && y<size){
        gauss[y*size + x] = __expf(-0.5*((x - mid)*(x - mid)+(y - mid)*(y - mid)) / (sigma*sigma)) / (2 * 3.1415926 * sigma *sigma);
        atomicAdd(&sum , gauss[y*size + x]);
    }
    __syncthreads();
    if(x<size && y<size){
        gauss[y*size + x] = gauss[y*size + x] /sum;
    }
}
__device__ float cannyRgb2grayscale(uchar3 pix){
    return (pix.x*0.299 + pix.y*0.587 + pix.z*0.114);
}

__global__ void rgb2grayscale(uchar3 * pix , int width , int height , float * ping){
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;

    if(x < width && y < height){
        ping[index] = pix[index].x*0.299 + pix[index].y*0.587 + pix[index].z*0.114;
    }
}

__global__ void gaussBlur(float * ping, float * pang , int width , int height , float * gauss , int gaussSize){
    __shared__ float gau[GauSize][GauSize];
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;
    //load guass matrix
    if(threadIdx.x<GauSize && threadIdx.y<GauSize){
        gau[threadIdx.y][threadIdx.x] = gauss[ threadIdx.y * GauSize + threadIdx.x];
    }
    __syncthreads();
    //blur
    if(x<width && y<height ){
        float blurValue = 0.0f;
        int mid = GauSize/2 +1; 
        for(int i = mid-GauSize ; i <= GauSize-mid; i++){
            for(int j = mid-GauSize ; j <= GauSize-mid; j++){
                // blurValue += gau[i+mid-1][j+mid-1]*dst[(y+i)*width + x+j].x;
                if((i+y)<height && (i+y)>=0  &&  (j+x)<width && (j+x)>=0 )
                    blurValue += gau[i+mid-1][j+mid-1] * ping[index + i*width +j];
            }
        }
       

        // src[index].x = src[index].y = src[index].z = blurValue;
        pang[index] = blurValue;
    }
}

__global__ void calcGradient(float *pang,float *ping , float * dx , float *dy , int width , int height){
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;
    if(x<width-1 && y< height-1){
        dx[index] = pang[index + 1] - pang[index];
        dy[index] = pang[index + width] - pang[index];
        //ping is gradient now
        ping[index] = sqrtf(dx[index]*dx[index]+dy[index]*dy[index] );
    }
    if(x<width && y< height && (x==width-1 || y==height-1)){
        ping[index] = 0;
    }
    
}

__global__ void nonMaxRestrain(float *pang, float *ping , float *dx , float *dy , int width , int height){
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;
    if(x<width -2 && y<height -2   && x>0 &&y>0){

    if(pang[index] <= 0.0000000001f && pang[index] >= -0.0000000001f){
        ping[index] = 0.0f;
    }
    else{
        float dxAbs = abs(dx[index]);
        float dyAbs = abs(dy[index]);
        float weight = 0;
        float grad[4];
        if(dyAbs > dxAbs){
            weight = dxAbs/dyAbs;
            grad[1] = pang[index - width];
            grad[3] = pang[index + width];

            if(dx[index]*dy[index]>0){
                grad[0] = pang[index -width - 1];
                grad[2] = pang[index +width + 1];
            }
            else{
                grad[0] = pang[index -width + 1];
                grad[2] = pang[index +width - 1];
            }
        }else{
            weight = dyAbs / dxAbs;
            grad[1] = pang[index - 1];
            grad[3] = pang[index + 1];

            if(dx[index]*dy[index]>0){
                // grad[0] = pang[index +width - 1];
                // grad[2] = pang[index -width + 1];

                grad[0] = pang[index -width - 1];
                grad[2] = pang[index +width + 1];
            }
            else{
                // grad[0] = pang[index -width - 1];
                // grad[2] = pang[index +width + 1];

                grad[0] = pang[index -width + 1];
                grad[2] = pang[index +width - 1];
            }
        }
        //插值
        // float grad1 = weight * grad[0] + (1-weight) * grad[1];
        // float grad2 = weight * grad[2] + (1-weight) * grad[3];

        float grad1 = weight * grad[1] + (1-weight) * grad[0];
        float grad2 = weight * grad[3] + (1-weight) * grad[2];
        if(pang[index] > grad1 && pang[index] > grad2){
            ping[index] = pang[index];
        } else{
            ping[index] = 0.0f;
        }
    }

    }//x<width y<height
    // else{
    //     ping[index] = 0;
    // }

}

__global__ void findMaxGrad(float * ping , int width , int height , float * max){
    extern __shared__ float temp[];

    int tid = threadIdx.x;
    int idx = tid + blockDim.x * blockIdx.x;

    if(idx<width*height){
        temp[tid] = ping[idx];
    }else{
        temp[tid] = 0;
    }

    int prevSize = blockDim.x;
    for(int d = blockDim.x >>1 ; d>0; d >>= 1){
        __syncthreads();
        if(tid<d  ){
            temp[tid] = temp[tid]>temp[tid+d]?temp[tid]:temp[tid + d];
            //for arbitrary block size
            if(prevSize > d*2 && (tid+2*d)<prevSize   ){
                temp[tid] = temp[tid]>temp[tid+2*d]?temp[tid]:temp[tid + 2*d];

            }
            prevSize = d;
        }
    }

    if(tid==0)max[blockIdx.x] = temp[0];
}

__global__ void edgeTrace(float *ping , float *pang , float *maxptr , int width , int height , int iteration , float hsigma , float lsigma){
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;
    float max = *maxptr;
    float lhd = max * lsigma;
    float hhd = max * hsigma;

    for(int i =0 ; i<iteration ;i++){
    __syncthreads();
    if(x<width -1 && y<height -1   && x>0 && y>0){

        if(ping[index] < lhd)pang[index] = 0;
        else if(ping[index]>= hhd)pang[index]=1;
        else {
            if(ping[index-width-1]>=hhd || ping[index-width]>=hhd ||ping[index-width+1]>=hhd 
            || ping[index-1]>=hhd || ping[index+1]>=hhd
            || ping[index+width-1]>=hhd || ping[index+width]>=hhd ||ping[index+width+1]>=hhd){
                pang[index] = 1; 
                ping[index] = hhd;
            }else{
                pang[index] = 0;
                ping[index] = hhd;
            }
        }

    }//x, y
    }
}

__global__ void edgeTraceOptimized(float *ping , float *pang , float *maxptr , int width , int height , int iteration , float hsigma , float lsigma){
    __shared__ float tempPing[34][34] ;
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;
    float max = *maxptr;
    float lhd = max * lsigma;
    float hhd = max * hsigma;

    int tx = threadIdx.x+1;
    int ty = threadIdx.y+1;

    if(x<width && y < height)tempPing[threadIdx.y +1][threadIdx.x +1] = ping[index];
    if(threadIdx.x ==0 ){
        if(x>0 && x<width && y<height){
            tempPing[threadIdx.y +1][0] = ping[index - 1];
        }
        else{
            tempPing[threadIdx.y +1][0] = 0;
        } 
    }
    if(threadIdx.y ==0){
        if(y>0 && x<width && y<height){
            tempPing[0][threadIdx.x +1] = ping[index - width];
        }
        else {
            tempPing[0][threadIdx.x +1] = 0;
        }
    }
    if(threadIdx.x == 31){
        if(x<width-1 && y<height){
            tempPing[threadIdx.y +1][33] = ping[index+1];
        }
        else {
            tempPing[threadIdx.y +1][33] = 0;

        }
    }
    if(threadIdx.y ==31){
        if(y<height-1 && x<width){
            tempPing[33][threadIdx.x +1] = ping[index + width];
        }
        else{
            tempPing[33][threadIdx.x +1] = 0;
        }
    }

    if(threadIdx.x == 0 && threadIdx.y == 0){
        if(x>0 && y >0  && x<width && y<height)tempPing[0][0] = ping[index -width -1];
        else tempPing[0][0] = 0;
    }
    if(threadIdx.x == 31 && threadIdx.y == 0){
        if(y>0 && x < width-1  && y <height)tempPing[0][33] = ping[index - width +1];
        else tempPing[0][33] = 0;
    }
    if(threadIdx.x == 31 && threadIdx.y == 31){
        if(y<height-1 && x<width-1)tempPing[33][33] = ping[index + width +1];
        else tempPing[33][33] = 0;
    }
    if(threadIdx.x == 0 && threadIdx.y == 31){
        if(x>0 && y<height-1 && x<width)tempPing[33][0] = ping[index + width -1];
        else tempPing[33][0] = 0;
    }
    __syncthreads();

    for(int i =0 ; i<iteration ;i++){
    __syncthreads();

    if(x<width  && y<height){

        if(tempPing[ty][tx] < lhd)pang[index] = 0;
        else if(tempPing[ty][tx]>= hhd)pang[index]=1;
        else {
            if(tempPing[ty-1][tx-1]>=hhd || tempPing[ty-1][tx]>=hhd ||tempPing[ty-1][tx+1]>=hhd 
            || tempPing[ty][tx-1]>=hhd || tempPing[ty][tx+1]>=hhd
            || tempPing[ty+1][tx-1]>=hhd || tempPing[ty+1][tx]>=hhd ||tempPing[ty+1][tx+1]>=hhd){
                pang[index] = 1; 
                tempPing[ty][tx] = hhd;
            }else{
                pang[index] = 0;
                tempPing[ty][tx]= hhd;
            }
        }

    }//x, y
    }
}

__global__ void trans2Bmp(float *ping , uchar3* imagedata , int width ,int height , int rev){
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;

    int index = y * width + x;

    if(x< width && y < height){
        // imagedata[index].x = imagedata[index].y = imagedata[index].z = (ping[index]<25?0:255);
        if(rev)imagedata[index].x = imagedata[index].y = imagedata[index].z = ping[index]*255;
        else imagedata[index].x = imagedata[index].y = imagedata[index].z =(1- ping[index])*255;
        // imagedata[index].x = imagedata[index].y = imagedata[index].z = ping[index];
    }
}

 
 void cookargument(int argc , char* argv[] , float *gaussSigma , float *hsigma , float *lsigma ,int *iteration , char** srcName , char** dstName , int *opti , int *rev){
    //init
    *gaussSigma = 1.2; //-gs
    *hsigma = 0.2;     //-hs
    *lsigma = 0.1;     //-ls
    *iteration = 10;   //-it
    *opti =1;          //-opt
    *rev = 1;          //-rev
                       //-src
                       //-dst
    //no argument
    if(argc ==1)return ;

    int status;

    for(int i=1 ; i<argc;i++){
        //set gaussSigma
        if(strcmp("-gs",argv[i])==0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%f" , gaussSigma);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }
            else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set hsigma
        if(strcmp("-hs" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%f" , hsigma);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set lsigma
        if(strcmp("-ls" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%f" , lsigma);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set iteration
        if(strcmp("-it" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%d" , iteration);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set src file name
        if(strcmp("-src" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                *srcName = argv[i];
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set dst file name
        if(strcmp("-dst" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                *dstName = argv[i];
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set opotimized or not
        if(strcmp("-opt" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%d" , opti);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //set edge color 1 white 0 black
        if(strcmp("-rev" , argv[i]) == 0){
            if(i<(argc-1)){
                i++;
                status = sscanf(argv[i] , "%d" , rev);
                if(status == 0 || status == EOF){
                    printf("*****invalid argument format*****\n");
                    exit(1);
                }
            }else{
                printf("*****invalid argument format*****\n");
                exit(1);
            }
        }
        //print help
        if(strcmp("-help" , argv[i]) == 0 ){
            printf("-src srcname : set src image file, must be 24 bit bmp file\n");
            printf("-dst dstname : set dst image file, must be 24 bit bmp file\n");
            printf("-gs  gaussSigma: set gaussSigma\n");
            printf("-ls  lowThreshold : set lowthreshold in canny\n");
            printf("-hs  highThreshold: set highthreshold in canny\n");
            printf("-it  iteration    : set iteration number of tracing edge\n");
            printf("-opt  1/0    : set ioptimimze tracing edge or not\n");
            printf("-rev  1/0    : set  edge color black(0)/white(1)\n");
            printf("-help :show info like this\n");
            
            exit(0);
        }

        
    }//for
    
    //test print
    // printf("gausssigma:%f\n", *gaussSigma);
    // printf("lsigma:%f\n", *lsigma);
    // printf("hsigma:%f\n", *hsigma);
    // printf("iteration:%d\n", *iteration);


    //check value
    if(*iteration <1){
        printf("*****invalid iteration*****\n");
        exit(1);
    }
    if(*lsigma > *hsigma || *lsigma < 0 || *hsigma >1){
        printf("*****invalid l/hsigma value*****\n");
        exit(1);
    }
    if(*gaussSigma<=0){
        printf("*****invalid gauss sigma value*****\n");
        exit(1);
    }
 }


int main(int argc , char* argv[]){
    clock_t start , end;
    start = clock();
    clock_t startCanny , endCanny;

    uchar3 *imagedataSrc , *imagedataDst;
    uchar3 *d_imagedataSrc ,*d_imagedataDst;
    float *d_gauss;
    float * d_ping, *d_pang;
    float *d_dx , *d_dy;
    float *d_max;
    // float gauss[GauSize][GauSize];
    int gaussSize = GauSize;
    int width , height;

    float gaussSigma =1.2;
    float hsigma = 0.15;
    float lsigma = 0.1;
    int iteration = 10;
    int optimized = 1;
    int  rev = 1;

    // const char srcName[] = "../data/src3.bmp";
    // const char dstName[] = "../data/out.bmp";
    char *srcName = NULL ;
    char *dstName = NULL ;

    cookargument(argc , argv , &gaussSigma , &hsigma , &lsigma ,&iteration , &srcName , &dstName , &optimized,&rev);    
    if(srcName ==NULL)srcName = "../data/src3.bmp";
    if(dstName ==NULL)dstName = "../data/out.bmp";
    //load bmp format image file
    loadBMPFile(&imagedataSrc , &width , &height , srcName );
    // height /= 4;
    hipError_t cudaStatus = hipMalloc((void**)&d_gauss , gaussSize*gaussSize*sizeof(float));
    if(cudaStatus!=hipSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }
    // cudaMalloc(&d_imagedataDst , width*height*sizeof(uchar3));
    cudaStatus = hipMalloc(&d_ping , width*height*sizeof(float));
    if(cudaStatus!=hipSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }
    cudaStatus = hipMalloc(&d_pang , width*height*sizeof(float));
    if(cudaStatus!=hipSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }
    cudaStatus = hipMalloc(&d_dx , width*height*sizeof(float));
    if(cudaStatus!=hipSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }
    cudaStatus = hipMalloc(&d_dy , width*height*sizeof(float));
    if(cudaStatus!=hipSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }

    cudaStatus = hipMalloc(&d_imagedataSrc , width*height*sizeof(uchar3));
    if(cudaStatus!=hipSuccess){
        printf("*****fail to malloc gpu memory*****\n");
        return 1;
    }
    // imagedataDst = (uchar3*)malloc( width*height*sizeof(uchar3));

    
    cudaStatus = hipMemcpy(d_imagedataSrc , imagedataSrc , width*height*sizeof(uchar3) , hipMemcpyHostToDevice );
    if(cudaStatus!=hipSuccess){
        printf("*****fail to copy memory*****\n");
        return 1;
    }
    dim3 numofBlock(32 , 32 , 1);
    dim3 threadsPerBlock((width+31)/32 , (height+31)/32, 1);
    int threadnum = numofBlock.x*numofBlock.y*numofBlock.z;
    int blocknum = (width*height+threadnum-1)/threadnum;
    hipMalloc(&d_max , blocknum*sizeof(float));

    //main process in gpu
    startCanny = clock();
    //generate gaussian filter
    genGauss<<<1 ,numofBlock >>>(d_gauss , gaussSize ,gaussSigma);
    // cudaDeviceSynchronize();
    
    //calc image's grayscale value
    rgb2grayscale<<< threadsPerBlock, numofBlock>>>(d_imagedataSrc , width , height , d_ping );
    // cudaDeviceSynchronize();
    
    //use gaussian filter
    gaussBlur<<< threadsPerBlock, numofBlock>>>(d_ping , d_pang , width , height , d_gauss , gaussSize);
    // cudaDeviceSynchronize();
    
    //calc gradient of every pixel    
    calcGradient<<< threadsPerBlock, numofBlock>>>(d_pang ,d_ping , d_dx , d_dy , width , height);
    //non max gradient restrain
    nonMaxRestrain<<< threadsPerBlock, numofBlock>>>(d_ping , d_pang , d_dx , d_dy , width , height);
    //find max gradient of the whole image
    //local max    
    findMaxGrad<<<blocknum,threadnum  , threadnum*sizeof(float)>>>(d_pang , width , height , d_max);
    //global max
    findMaxGrad<<<1, blocknum , blocknum*sizeof(float)>>>(d_max , blocknum , 1 , d_max);
    // cudaDeviceSynchronize();
    // float max;
    // cudaMemcpy(&max , d_max , sizeof(float) , cudaMemcpyDeviceToHost );
    // printf("max is %f\n",max);
    // printf("blocknum is %d\n" , blocknum);
    
    //Tracing edges through the image and hysteresis thresholding
    if(!optimized)edgeTrace<<<threadsPerBlock, numofBlock>>>(d_pang ,d_ping , d_max , width , height , iteration , hsigma , lsigma);
    else edgeTraceOptimized<<<threadsPerBlock, numofBlock>>>(d_pang ,d_ping , d_max , width , height , iteration , hsigma , lsigma);
    
    //translate bit value to bmp file format
    trans2Bmp<<< threadsPerBlock, numofBlock>>>(d_ping , d_imagedataSrc , width , height,rev);
    //main process end

    cudaStatus = hipDeviceSynchronize();
    if(cudaStatus != hipSuccess){
        printf("*****kernel function down*****\n");
    }
    endCanny = clock();
    printf("------canny use %ld ms\n" , endCanny - startCanny);

    cudaStatus = hipMemcpy(imagedataSrc , d_imagedataSrc , width*height*sizeof(uchar3) , hipMemcpyDeviceToHost );
    if(cudaStatus!=hipSuccess){
        printf("*****fail to copy memory from device*****\n");
        return 1;
    }

    // for(int i=0 ; i<width*height/1024;i++){
    // cudaStatus = cudaMemcpy(imagedataSrc+i*1024 , d_imagedataSrc+i*1024 , 1024*sizeof(uchar3) , cudaMemcpyDeviceToHost );
    // if(cudaStatus!=cudaSuccess){
    //     printf("*****fail to copy memory from device*****\n");
    //     return 1;
    // }
    // }
    // if((width*height)%1024!=0){
    //     cudaStatus = cudaMemcpy(imagedataSrc+i*1024 , d_imagedataSrc+i*1024 , ((width*height)%1024)*sizeof(uchar3) , cudaMemcpyDeviceToHost );
    //     if(cudaStatus!=cudaSuccess){
    //         printf("*****fail to copy memory from device*****\n");
    //         return 1;
    //     }  
    // }

    printf("before save bmlp file\n");
    printf("width:%d height:%d\n", width , height);
    saveBMPFile(imagedataSrc ,width , height , dstName);

    // cudaFree(d_imagedataDst);
    hipFree(d_imagedataSrc);
    hipFree(d_gauss);
    hipFree(d_ping);
    hipFree(d_pang);
    hipFree(d_dx);
    hipFree(d_dy);
    hipFree(d_max);
    // free(imagedataDst);
    free(imagedataSrc);

    end =  clock();
    printf("------total use %ld ms\n" , end - start);
    return 0;
}


	.text
	.file	"canny.hip"
	.globl	_Z11loadBMPFilePP15HIP_vector_typeIhLj3EEPiS3_PKc # -- Begin function _Z11loadBMPFilePP15HIP_vector_typeIhLj3EEPiS3_PKc
	.type	_Z11loadBMPFilePP15HIP_vector_typeIhLj3EEPiS3_PKc,@function
_Z11loadBMPFilePP15HIP_vector_typeIhLj3EEPiS3_PKc: # @_Z11loadBMPFilePP15HIP_vector_typeIhLj3EEPiS3_PKc
	.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	$88, %rsp
	.cfi_def_cfa_offset 144
	.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, %r13
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	$.L.str, %edi
	movq	%rcx, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.1, %esi
	movq	%r15, %rdi
	callq	fopen
	testq	%rax, %rax
	je	.LBB0_16
# %bb.1:
	movq	%rax, %r14
	leaq	34(%rsp), %r15
	movl	$14, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	movq	%rax, %rcx
	callq	fread
	movzwl	(%r15), %eax
	cmpl	$19778, %eax                    # imm = 0x4D42
	jne	.LBB0_2
# %bb.4:
	leaq	48(%rsp), %r15
	movl	$40, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	movq	%r14, %rcx
	callq	fread
	movswl	14(%r15), %ebp
	cmpl	$24, %ebp
	jne	.LBB0_17
# %bb.5:
	movl	$.L.str.6, %edi
	movl	$2, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.7, %edi
	movl	$14, %esi
	movl	$40, %edx
	xorl	%eax, %eax
	callq	printf
	cmpl	$0, 64(%rsp)
	je	.LBB0_7
# %bb.6:
	movl	$.Lstr.1, %edi
	jmp	.LBB0_3
.LBB0_16:
	movl	$.L.str.2, %edi
	movq	%r15, %rsi
	xorl	%eax, %eax
	addq	$88, %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
	jmp	printf                          # TAILCALL
.LBB0_2:
	.cfi_def_cfa_offset 144
	movl	$.Lstr.3, %edi
.LBB0_3:
	addq	$88, %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
	jmp	puts@PLT                        # TAILCALL
.LBB0_17:
	.cfi_def_cfa_offset 144
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	$.L.str.5, %edi
	movl	%ebp, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.6, %edi
	movl	$2, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.7, %edi
	movl	$14, %esi
	movl	$40, %edx
	xorl	%eax, %eax
	addq	$88, %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
	jmp	printf                          # TAILCALL
.LBB0_7:
	.cfi_def_cfa_offset 144
	movl	52(%rsp), %r15d
	movl	%r15d, (%r12)
	movslq	56(%rsp), %rbp
	movl	%ebp, (%r13)
	movslq	(%r12), %rax
	imulq	%rbp, %rax
	leaq	(%rax,%rax,2), %rdi
	callq	malloc
	movq	%rax, (%rbx)
	xorl	%r12d, %r12d
	movl	$.L.str.9, %edi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.10, %edi
	movl	%ebp, %esi
	xorl	%eax, %eax
	callq	printf
	movslq	44(%rsp), %rsi
	addq	$-54, %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	fseek
	testq	%rbp, %rbp
	jle	.LBB0_15
# %bb.8:                                # %.preheader38.lr.ph
	movl	%ebp, %eax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movl	%r15d, %eax
	andl	$3, %eax
	movl	%eax, 12(%rsp)                  # 4-byte Spill
	xorl	%r13d, %r13d
	movq	%r15, 16(%rsp)                  # 8-byte Spill
.LBB0_9:                                # %.preheader38
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_11 Depth 2
                                        #     Child Loop BB0_13 Depth 2
	testl	%r15d, %r15d
	jle	.LBB0_12
# %bb.10:                               #   in Loop: Header=BB0_9 Depth=1
	movl	%r12d, %eax
	leaq	(%rax,%rax,2), %r15
	movq	16(%rsp), %rbp                  # 8-byte Reload
.LBB0_11:                               #   Parent Loop BB0_9 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	callq	fgetc
	movq	(%rbx), %rcx
	movb	%al, 2(%rcx,%r15)
	movq	%r14, %rdi
	callq	fgetc
	movq	(%rbx), %rcx
	movb	%al, 1(%rcx,%r15)
	movq	%r14, %rdi
	callq	fgetc
	movq	(%rbx), %rcx
	movb	%al, (%rcx,%r15)
	addq	$3, %r15
	decq	%rbp
	jne	.LBB0_11
.LBB0_12:                               # %.preheader
                                        #   in Loop: Header=BB0_9 Depth=1
	movl	12(%rsp), %eax                  # 4-byte Reload
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB0_14
.LBB0_13:                               # %.lr.ph41
                                        #   Parent Loop BB0_9 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	callq	fgetc
	decl	%ebp
	jne	.LBB0_13
.LBB0_14:                               # %._crit_edge
                                        #   in Loop: Header=BB0_9 Depth=1
	incq	%r13
	movq	16(%rsp), %r15                  # 8-byte Reload
	addl	%r15d, %r12d
	cmpq	24(%rsp), %r13                  # 8-byte Folded Reload
	jne	.LBB0_9
.LBB0_15:                               # %._crit_edge43
	movl	$.Lstr, %edi
	callq	puts@PLT
	movq	%r14, %rdi
	addq	$88, %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
	jmp	fclose                          # TAILCALL
.Lfunc_end0:
	.size	_Z11loadBMPFilePP15HIP_vector_typeIhLj3EEPiS3_PKc, .Lfunc_end0-_Z11loadBMPFilePP15HIP_vector_typeIhLj3EEPiS3_PKc
	.cfi_endproc
                                        # -- End function
	.globl	_Z11saveBMPFileP15HIP_vector_typeIhLj3EEiiPKc # -- Begin function _Z11saveBMPFileP15HIP_vector_typeIhLj3EEiiPKc
	.type	_Z11saveBMPFileP15HIP_vector_typeIhLj3EEiiPKc,@function
_Z11saveBMPFileP15HIP_vector_typeIhLj3EEiiPKc: # @_Z11saveBMPFileP15HIP_vector_typeIhLj3EEiiPKc
	.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	$88, %rsp
	.cfi_def_cfa_offset 144
	.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, %r14
	movl	%edx, %ebp
	movl	%esi, %r15d
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	movw	$19778, 18(%rsp)                # imm = 0x4D42
	movabsq	$231928233984, %rax             # imm = 0x3600000000
	movq	%rax, 24(%rsp)
	movl	%r15d, %eax
	andl	$3, %eax
	addl	%r15d, %eax
	imull	%ebp, %eax
	leal	(%rax,%rax,2), %ecx
	leal	(%rax,%rax,2), %eax
	addl	$54, %eax
	movl	%eax, 20(%rsp)
	movl	$40, 48(%rsp)
	movl	%r15d, 52(%rsp)
	movl	%ebp, 56(%rsp)
	movq	$1572865, 60(%rsp)              # imm = 0x180001
	movl	%ecx, 68(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 72(%rsp)
	movl	$.L.str.13, %esi
	movq	%r14, %rdi
	callq	fopen
	testq	%rax, %rax
	je	.LBB1_10
# %bb.1:
	movq	%rax, %r14
	leaq	18(%rsp), %rdi
	movl	$14, %esi
	movl	$1, %edx
	movq	%rax, %rcx
	callq	fwrite
	leaq	48(%rsp), %r15
	movl	$40, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	movq	%r14, %rcx
	callq	fwrite
	movl	8(%r15), %eax
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	testl	%eax, %eax
	jle	.LBB1_9
# %bb.2:                                # %.preheader32.lr.ph
	movl	52(%rsp), %eax
	movl	%eax, %ecx
	andl	$3, %ecx
	movl	%ecx, 4(%rsp)                   # 4-byte Spill
	addq	$2, 8(%rsp)                     # 8-byte Folded Spill
	leaq	(%rax,%rax,2), %r13
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	movq	%rax, 32(%rsp)                  # 8-byte Spill
.LBB1_3:                                # %.preheader32
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_5 Depth 2
                                        #     Child Loop BB1_7 Depth 2
	testl	%eax, %eax
	jle	.LBB1_6
# %bb.4:                                # %.lr.ph
                                        #   in Loop: Header=BB1_3 Depth=1
	movl	%ebx, %eax
	leaq	(%rax,%rax,2), %r12
	addq	8(%rsp), %r12                   # 8-byte Folded Reload
	xorl	%ebp, %ebp
.LBB1_5:                                #   Parent Loop BB1_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%r12,%rbp), %edi
	movq	%r14, %rsi
	callq	fputc
	movzbl	-1(%r12,%rbp), %edi
	movq	%r14, %rsi
	callq	fputc
	movzbl	-2(%r12,%rbp), %edi
	movq	%r14, %rsi
	callq	fputc
	addq	$3, %rbp
	cmpq	%rbp, %r13
	jne	.LBB1_5
.LBB1_6:                                # %.preheader
                                        #   in Loop: Header=BB1_3 Depth=1
	movl	4(%rsp), %eax                   # 4-byte Reload
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_8
.LBB1_7:                                # %.lr.ph35
                                        #   Parent Loop BB1_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorl	%edi, %edi
	movq	%r14, %rsi
	callq	fputc
	decl	%ebp
	jne	.LBB1_7
.LBB1_8:                                # %._crit_edge
                                        #   in Loop: Header=BB1_3 Depth=1
	incq	%r15
	movq	32(%rsp), %rax                  # 8-byte Reload
	addl	%eax, %ebx
	cmpq	40(%rsp), %r15                  # 8-byte Folded Reload
	jne	.LBB1_3
.LBB1_9:                                # %._crit_edge37
	movl	$.Lstr.6, %edi
	callq	puts@PLT
	movq	%r14, %rdi
	addq	$88, %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
	jmp	fclose                          # TAILCALL
.LBB1_10:
	.cfi_def_cfa_offset 144
	movl	$.Lstr.5, %edi
	addq	$88, %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
	jmp	puts@PLT                        # TAILCALL
.Lfunc_end1:
	.size	_Z11saveBMPFileP15HIP_vector_typeIhLj3EEiiPKc, .Lfunc_end1-_Z11saveBMPFileP15HIP_vector_typeIhLj3EEiiPKc
	.cfi_endproc
                                        # -- End function
	.globl	_Z23__device_stub__genGaussPfif # -- Begin function _Z23__device_stub__genGaussPfif
	.type	_Z23__device_stub__genGaussPfif,@function
_Z23__device_stub__genGaussPfif:        # @_Z23__device_stub__genGaussPfif
	.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	$96, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rcx
	movl	%esi, (%rcx)
	movq	%rsp, %rdx
	movss	%xmm0, (%rdx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rdx, 16(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%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	$_Z8genGaussPfif, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$112, %rsp
	.cfi_adjust_cfa_offset -112
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z23__device_stub__genGaussPfif, .Lfunc_end2-_Z23__device_stub__genGaussPfif
	.cfi_endproc
                                        # -- End function
	.globl	_Z28__device_stub__rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf # -- Begin function _Z28__device_stub__rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
	.type	_Z28__device_stub__rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf,@function
_Z28__device_stub__rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf: # @_Z28__device_stub__rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
	.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	12(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	8(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	32(%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	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z28__device_stub__rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf, .Lfunc_end3-_Z28__device_stub__rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__gaussBlurPfS_iiS_i # -- Begin function _Z24__device_stub__gaussBlurPfS_iiS_i
	.type	_Z24__device_stub__gaussBlurPfS_iiS_i,@function
_Z24__device_stub__gaussBlurPfS_iiS_i:  # @_Z24__device_stub__gaussBlurPfS_iiS_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	20(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	16(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	40(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9gaussBlurPfS_iiS_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z24__device_stub__gaussBlurPfS_iiS_i, .Lfunc_end4-_Z24__device_stub__gaussBlurPfS_iiS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z27__device_stub__calcGradientPfS_S_S_ii # -- Begin function _Z27__device_stub__calcGradientPfS_S_S_ii
	.type	_Z27__device_stub__calcGradientPfS_S_S_ii,@function
_Z27__device_stub__calcGradientPfS_S_S_ii: # @_Z27__device_stub__calcGradientPfS_S_S_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$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	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	8(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z12calcGradientPfS_S_S_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z27__device_stub__calcGradientPfS_S_S_ii, .Lfunc_end5-_Z27__device_stub__calcGradientPfS_S_S_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__nonMaxRestrainPfS_S_S_ii # -- Begin function _Z29__device_stub__nonMaxRestrainPfS_S_S_ii
	.type	_Z29__device_stub__nonMaxRestrainPfS_S_S_ii,@function
_Z29__device_stub__nonMaxRestrainPfS_S_S_ii: # @_Z29__device_stub__nonMaxRestrainPfS_S_S_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$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	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	8(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z14nonMaxRestrainPfS_S_S_ii, %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_end6:
	.size	_Z29__device_stub__nonMaxRestrainPfS_S_S_ii, .Lfunc_end6-_Z29__device_stub__nonMaxRestrainPfS_S_S_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__findMaxGradPfiiS_ # -- Begin function _Z26__device_stub__findMaxGradPfiiS_
	.type	_Z26__device_stub__findMaxGradPfiiS_,@function
_Z26__device_stub__findMaxGradPfiiS_:   # @_Z26__device_stub__findMaxGradPfiiS_
	.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	12(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	8(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	32(%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	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11findMaxGradPfiiS_, %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_end7:
	.size	_Z26__device_stub__findMaxGradPfiiS_, .Lfunc_end7-_Z26__device_stub__findMaxGradPfiiS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__edgeTracePfS_S_iiiff # -- Begin function _Z24__device_stub__edgeTracePfS_S_iiiff
	.type	_Z24__device_stub__edgeTracePfS_S_iiiff,@function
_Z24__device_stub__edgeTracePfS_S_iiiff: # @_Z24__device_stub__edgeTracePfS_S_iiiff
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	8(%rsp), %r9
	movss	%xmm0, (%r9)
	leaq	4(%rsp), %r10
	movss	%xmm1, (%r10)
	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)
	movq	%r9, 48(%rbx)
	movq	%r10, 56(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9edgeTracePfS_S_iiiff, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_Z24__device_stub__edgeTracePfS_S_iiiff, .Lfunc_end8-_Z24__device_stub__edgeTracePfS_S_iiiff
	.cfi_endproc
                                        # -- End function
	.globl	_Z33__device_stub__edgeTraceOptimizedPfS_S_iiiff # -- Begin function _Z33__device_stub__edgeTraceOptimizedPfS_S_iiiff
	.type	_Z33__device_stub__edgeTraceOptimizedPfS_S_iiiff,@function
_Z33__device_stub__edgeTraceOptimizedPfS_S_iiiff: # @_Z33__device_stub__edgeTraceOptimizedPfS_S_iiiff
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	8(%rsp), %r9
	movss	%xmm0, (%r9)
	leaq	4(%rsp), %r10
	movss	%xmm1, (%r10)
	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)
	movq	%r9, 48(%rbx)
	movq	%r10, 56(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z18edgeTraceOptimizedPfS_S_iiiff, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_Z33__device_stub__edgeTraceOptimizedPfS_S_iiiff, .Lfunc_end9-_Z33__device_stub__edgeTraceOptimizedPfS_S_iiiff
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__trans2BmpPfP15HIP_vector_typeIhLj3EEiii # -- Begin function _Z24__device_stub__trans2BmpPfP15HIP_vector_typeIhLj3EEiii
	.type	_Z24__device_stub__trans2BmpPfP15HIP_vector_typeIhLj3EEiii,@function
_Z24__device_stub__trans2BmpPfP15HIP_vector_typeIhLj3EEiii: # @_Z24__device_stub__trans2BmpPfP15HIP_vector_typeIhLj3EEiii
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	4(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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	_Z24__device_stub__trans2BmpPfP15HIP_vector_typeIhLj3EEiii, .Lfunc_end10-_Z24__device_stub__trans2BmpPfP15HIP_vector_typeIhLj3EEiii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_
.LCPI11_0:
	.long	0x3f800000                      # float 1
	.text
	.globl	_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_
	.type	_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_,@function
_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_: # @_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r13
	movl	%edi, %ebp
	movq	120(%rsp), %rsi
	movq	112(%rsp), %rdi
	movq	%rdx, 32(%rsp)                  # 8-byte Spill
	movl	$1067030938, (%rdx)             # imm = 0x3F99999A
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	movl	$1045220557, (%rcx)             # imm = 0x3E4CCCCD
	movq	%r8, 16(%rsp)                   # 8-byte Spill
	movl	$1036831949, (%r8)              # imm = 0x3DCCCCCD
	movq	%r9, 8(%rsp)                    # 8-byte Spill
	movl	$10, (%r9)
	movl	$1, %eax
	movl	%eax, (%rdi)
	movl	%eax, (%rsi)
	cmpl	%eax, %ebp
	je	.LBB11_46
# %bb.1:                                # %.preheader
	cmpl	$2, %ebp
	jl	.LBB11_35
# %bb.2:                                # %.lr.ph
	leal	-1(%rbp), %r14d
	movl	$1, %r15d
.LBB11_3:                               # =>This Inner Loop Header: Depth=1
	movslq	%r15d, %r12
	movq	(%r13,%r12,8), %rbx
	movl	$.L.str.16, %edi
	movq	%rbx, %rsi
	callq	strcmp
	testl	%eax, %eax
	jne	.LBB11_7
# %bb.4:                                #   in Loop: Header=BB11_3 Depth=1
	cmpl	%r14d, %r15d
	jge	.LBB11_37
# %bb.5:                                #   in Loop: Header=BB11_3 Depth=1
	movq	8(%r13,%r12,8), %rdi
	movl	$.L.str.17, %esi
	movq	32(%rsp), %rdx                  # 8-byte Reload
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	incl	%eax
	cmpl	$2, %eax
	jb	.LBB11_37
# %bb.6:                                # %._crit_edge135
                                        #   in Loop: Header=BB11_3 Depth=1
	incl	%r15d
	incq	%r12
	movq	(%r13,%r12,8), %rbx
.LBB11_7:                               #   in Loop: Header=BB11_3 Depth=1
	movl	$.L.str.19, %edi
	movq	%rbx, %rsi
	callq	strcmp
	testl	%eax, %eax
	jne	.LBB11_11
# %bb.8:                                #   in Loop: Header=BB11_3 Depth=1
	cmpl	%r14d, %r15d
	jge	.LBB11_37
# %bb.9:                                #   in Loop: Header=BB11_3 Depth=1
	movslq	%r15d, %rbx
	movq	8(%r13,%rbx,8), %rdi
	movl	$.L.str.17, %esi
	movq	24(%rsp), %rdx                  # 8-byte Reload
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	incl	%eax
	cmpl	$2, %eax
	jb	.LBB11_37
# %bb.10:                               # %._crit_edge147
                                        #   in Loop: Header=BB11_3 Depth=1
	incl	%r15d
	incq	%rbx
	movq	(%r13,%rbx,8), %rbx
.LBB11_11:                              #   in Loop: Header=BB11_3 Depth=1
	movl	$.L.str.20, %edi
	movq	%rbx, %rsi
	callq	strcmp
	testl	%eax, %eax
	jne	.LBB11_15
# %bb.12:                               #   in Loop: Header=BB11_3 Depth=1
	cmpl	%r14d, %r15d
	jge	.LBB11_37
# %bb.13:                               #   in Loop: Header=BB11_3 Depth=1
	movslq	%r15d, %rbx
	movq	8(%r13,%rbx,8), %rdi
	movl	$.L.str.17, %esi
	movq	16(%rsp), %rdx                  # 8-byte Reload
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	incl	%eax
	cmpl	$2, %eax
	jb	.LBB11_37
# %bb.14:                               # %._crit_edge149
                                        #   in Loop: Header=BB11_3 Depth=1
	incl	%r15d
	incq	%rbx
	movq	(%r13,%rbx,8), %rbx
.LBB11_15:                              #   in Loop: Header=BB11_3 Depth=1
	movl	$.L.str.21, %edi
	movq	%rbx, %rsi
	callq	strcmp
	testl	%eax, %eax
	jne	.LBB11_19
# %bb.16:                               #   in Loop: Header=BB11_3 Depth=1
	cmpl	%r14d, %r15d
	jge	.LBB11_37
# %bb.17:                               #   in Loop: Header=BB11_3 Depth=1
	movslq	%r15d, %rbx
	movq	8(%r13,%rbx,8), %rdi
	movl	$.L.str.22, %esi
	movq	8(%rsp), %rdx                   # 8-byte Reload
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	incl	%eax
	cmpl	$2, %eax
	jb	.LBB11_37
# %bb.18:                               # %._crit_edge151
                                        #   in Loop: Header=BB11_3 Depth=1
	incl	%r15d
	incq	%rbx
	movq	(%r13,%rbx,8), %rbx
.LBB11_19:                              #   in Loop: Header=BB11_3 Depth=1
	movl	$.L.str.23, %edi
	movq	%rbx, %rsi
	callq	strcmp
	testl	%eax, %eax
	jne	.LBB11_22
# %bb.20:                               #   in Loop: Header=BB11_3 Depth=1
	cmpl	%r14d, %r15d
	jge	.LBB11_37
# %bb.21:                               #   in Loop: Header=BB11_3 Depth=1
	movslq	%r15d, %rax
	incl	%r15d
	movq	8(%r13,%rax,8), %rbx
	movq	96(%rsp), %rax
	movq	%rbx, (%rax)
.LBB11_22:                              # %._crit_edge140
                                        #   in Loop: Header=BB11_3 Depth=1
	movl	$.L.str.24, %edi
	movq	%rbx, %rsi
	callq	strcmp
	testl	%eax, %eax
	jne	.LBB11_25
# %bb.23:                               #   in Loop: Header=BB11_3 Depth=1
	cmpl	%r14d, %r15d
	jge	.LBB11_37
# %bb.24:                               #   in Loop: Header=BB11_3 Depth=1
	movslq	%r15d, %rax
	incl	%r15d
	movq	8(%r13,%rax,8), %rbx
	movq	104(%rsp), %rax
	movq	%rbx, (%rax)
.LBB11_25:                              # %._crit_edge143
                                        #   in Loop: Header=BB11_3 Depth=1
	movl	$.L.str.25, %edi
	movq	%rbx, %rsi
	callq	strcmp
	testl	%eax, %eax
	jne	.LBB11_29
# %bb.26:                               #   in Loop: Header=BB11_3 Depth=1
	cmpl	%r14d, %r15d
	jge	.LBB11_37
# %bb.27:                               #   in Loop: Header=BB11_3 Depth=1
	movslq	%r15d, %rbx
	movq	8(%r13,%rbx,8), %rdi
	movl	$.L.str.22, %esi
	movq	112(%rsp), %rdx
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	incl	%eax
	cmpl	$2, %eax
	jb	.LBB11_37
# %bb.28:                               # %._crit_edge153
                                        #   in Loop: Header=BB11_3 Depth=1
	incl	%r15d
	incq	%rbx
	movq	(%r13,%rbx,8), %rbx
.LBB11_29:                              #   in Loop: Header=BB11_3 Depth=1
	movl	$.L.str.26, %edi
	movq	%rbx, %rsi
	callq	strcmp
	testl	%eax, %eax
	jne	.LBB11_33
# %bb.30:                               #   in Loop: Header=BB11_3 Depth=1
	cmpl	%r14d, %r15d
	jge	.LBB11_37
# %bb.31:                               #   in Loop: Header=BB11_3 Depth=1
	movslq	%r15d, %rbx
	movq	8(%r13,%rbx,8), %rdi
	movl	$.L.str.22, %esi
	movq	120(%rsp), %rdx
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	incl	%eax
	cmpl	$2, %eax
	jb	.LBB11_37
# %bb.32:                               # %._crit_edge155
                                        #   in Loop: Header=BB11_3 Depth=1
	incl	%r15d
	incq	%rbx
	movq	(%r13,%rbx,8), %rbx
.LBB11_33:                              #   in Loop: Header=BB11_3 Depth=1
	movl	$.L.str.27, %edi
	movq	%rbx, %rsi
	callq	strcmp
	testl	%eax, %eax
	je	.LBB11_39
# %bb.34:                               #   in Loop: Header=BB11_3 Depth=1
	incl	%r15d
	cmpl	%ebp, %r15d
	jl	.LBB11_3
.LBB11_35:                              # %._crit_edge
	movq	8(%rsp), %rax                   # 8-byte Reload
	cmpl	$0, (%rax)
	jle	.LBB11_36
# %bb.40:
	movq	24(%rsp), %rax                  # 8-byte Reload
	movss	(%rax), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	ucomiss	.LCPI11_0(%rip), %xmm0
	ja	.LBB11_43
# %bb.41:
	movq	16(%rsp), %rax                  # 8-byte Reload
	movss	(%rax), %xmm1                   # xmm1 = mem[0],zero,zero,zero
	xorps	%xmm2, %xmm2
	ucomiss	%xmm1, %xmm2
	ja	.LBB11_43
# %bb.42:
	ucomiss	%xmm0, %xmm1
	ja	.LBB11_43
# %bb.44:
	xorps	%xmm0, %xmm0
	movq	32(%rsp), %rax                  # 8-byte Reload
	ucomiss	(%rax), %xmm0
	jae	.LBB11_45
.LBB11_46:
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB11_37:
	.cfi_def_cfa_offset 96
	movl	$.Lstr.32, %edi
.LBB11_38:
	callq	puts@PLT
	movl	$1, %edi
	callq	exit
.LBB11_39:
	movl	$.Lstr.18, %edi
	callq	puts@PLT
	movl	$.Lstr.19, %edi
	callq	puts@PLT
	movl	$.Lstr.20, %edi
	callq	puts@PLT
	movl	$.Lstr.21, %edi
	callq	puts@PLT
	movl	$.Lstr.22, %edi
	callq	puts@PLT
	movl	$.Lstr.23, %edi
	callq	puts@PLT
	movl	$.Lstr.24, %edi
	callq	puts@PLT
	movl	$.Lstr.25, %edi
	callq	puts@PLT
	movl	$.Lstr.26, %edi
	callq	puts@PLT
	xorl	%edi, %edi
	callq	exit
.LBB11_36:
	movl	$.Lstr.9, %edi
	jmp	.LBB11_38
.LBB11_43:
	movl	$.Lstr.8, %edi
	jmp	.LBB11_38
.LBB11_45:
	movl	$.Lstr.7, %edi
	jmp	.LBB11_38
.Lfunc_end11:
	.size	_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_, .Lfunc_end11-_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function 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	$168, %rsp
	.cfi_def_cfa_offset 224
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r14
	movl	%edi, %r15d
	callq	clock
	movq	%rax, %rbx
	leaq	92(%rsp), %rdx
	movl	$1067030938, (%rdx)             # imm = 0x3F99999A
	leaq	44(%rsp), %rcx
	movl	$1041865114, (%rcx)             # imm = 0x3E19999A
	leaq	40(%rsp), %r8
	movl	$1036831949, (%r8)              # imm = 0x3DCCCCCD
	leaq	36(%rsp), %r9
	movl	$10, (%r9)
	movl	$1, %ebp
	leaq	88(%rsp), %rax
	movl	%ebp, (%rax)
	leaq	84(%rsp), %r10
	movl	%ebp, (%r10)
	xorl	%esi, %esi
	leaq	160(%rsp), %r12
	movq	%rsi, (%r12)
	leaq	152(%rsp), %r13
	movq	%rsi, (%r13)
	movl	%r15d, %edi
	movq	%r14, %rsi
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	%r13
	.cfi_adjust_cfa_offset 8
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	callq	_Z12cookargumentiPPcPfS1_S1_PiS0_S0_S2_S2_
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movq	(%r12), %rax
	testq	%rax, %rax
	movl	$.L.str.40, %ecx
	cmovneq	%rax, %rcx
	movq	%rcx, (%r12)
	movq	(%r13), %rax
	testq	%rax, %rax
	movl	$.L.str.41, %r14d
	cmovneq	%rax, %r14
	movq	%r14, (%r13)
	leaq	144(%rsp), %rdi
	leaq	100(%rsp), %rsi
	leaq	96(%rsp), %rdx
	callq	_Z11loadBMPFilePP15HIP_vector_typeIhLj3EEPiS3_PKc
	leaq	72(%rsp), %rdi
	movl	$100, %esi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB12_6
# %bb.1:
	movq	%r14, 128(%rsp)                 # 8-byte Spill
	movq	%rbx, 136(%rsp)                 # 8-byte Spill
	movl	100(%rsp), %ebx
	movl	96(%rsp), %r14d
	movl	%r14d, %r12d
	imull	%ebx, %r12d
	movslq	%r12d, %r13
	leaq	(,%r13,4), %r15
	movq	%rsp, %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB12_6
# %bb.2:
	movq	%r12, 48(%rsp)                  # 8-byte Spill
	leaq	8(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB12_6
# %bb.3:
	leaq	64(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB12_6
# %bb.4:
	leaq	56(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB12_6
# %bb.5:
	leaq	(%r13,%r13,2), %r13
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB12_9
.LBB12_6:
	movl	$.Lstr.42, %edi
.LBB12_7:
	callq	puts@PLT
.LBB12_8:
	movl	%ebp, %eax
	addq	$168, %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
.LBB12_9:
	.cfi_def_cfa_offset 224
	movq	24(%rsp), %rdi
	movq	144(%rsp), %r15
	movl	$1, %ebp
	movq	%r15, %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	je	.LBB12_11
# %bb.10:
	movl	$.Lstr.36, %edi
	jmp	.LBB12_7
.LBB12_11:
	movq	%r13, 112(%rsp)                 # 8-byte Spill
	movq	%r15, 120(%rsp)                 # 8-byte Spill
	movabsq	$137438953504, %r12             # imm = 0x2000000020
	movq	%rbx, %r15
	leal	31(%rbx), %eax
	leal	62(%rbx), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$5, %ecx
	movq	%r14, %r13
	leal	31(%r14), %eax
	leal	62(%r14), %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	sarl	$5, %ebx
	shlq	$32, %rbx
	orq	%rcx, %rbx
	movq	48(%rsp), %rbp                  # 8-byte Reload
	leal	1023(%rbp), %eax
	addl	$2046, %ebp                     # imm = 0x7FE
	testl	%eax, %eax
	cmovnsl	%eax, %ebp
	movabsq	$4294967297, %r14               # imm = 0x100000001
	sarl	$10, %ebp
	movslq	%ebp, %rsi
	shlq	$2, %rsi
	leaq	16(%rsp), %rdi
	movq	%rsi, 104(%rsp)                 # 8-byte Spill
	callq	hipMalloc
	callq	clock
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB12_13
# %bb.12:
	movq	72(%rsp), %rdi
	movss	92(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movl	$5, %esi
	callq	_Z23__device_stub__genGaussPfif
.LBB12_13:
	movq	%rbx, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB12_15
# %bb.14:
	movq	24(%rsp), %rdi
	movq	(%rsp), %rcx
	movl	%r15d, %esi
	movl	%r13d, %edx
	callq	_Z28__device_stub__rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
.LBB12_15:
	movq	%rbx, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB12_17
# %bb.16:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movq	72(%rsp), %r8
	movl	%r15d, %edx
	movl	%r13d, %ecx
	movl	$5, %r9d
	callq	_Z24__device_stub__gaussBlurPfS_iiS_i
.LBB12_17:
	movq	%r14, %r12
	movq	%rbx, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB12_19
# %bb.18:
	movq	8(%rsp), %rdi
	movq	(%rsp), %rsi
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rcx
	movl	%r15d, %r8d
	movl	%r13d, %r9d
	callq	_Z27__device_stub__calcGradientPfS_S_S_ii
.LBB12_19:
	movq	%rbx, %r14
	movq	%rbx, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB12_21
# %bb.20:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rcx
	movl	%r15d, %r8d
	movl	%r13d, %r9d
	callq	_Z29__device_stub__nonMaxRestrainPfS_S_S_ii
.LBB12_21:
	movq	%rbp, %rbx
	movl	%ebp, %eax
	leaq	(%r12,%rax), %rbp
	decq	%rbp
	leaq	1023(%r12), %rdx
	movl	$4096, %r8d                     # imm = 0x1000
	movq	%rbp, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB12_23
# %bb.22:
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rcx
	movl	%r15d, %esi
	movl	%r13d, %edx
	callq	_Z26__device_stub__findMaxGradPfiiS_
.LBB12_23:
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	movq	104(%rsp), %r8                  # 8-byte Reload
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB12_25
# %bb.24:
	movq	16(%rsp), %rcx
	movq	%rcx, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_Z26__device_stub__findMaxGradPfiiS_
.LBB12_25:
	movl	88(%rsp), %ebp
	movq	%r14, %rdi
	movl	$1, %esi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%ebp, %ebp
	je	.LBB12_28
# %bb.26:
	testl	%eax, %eax
	jne	.LBB12_30
# %bb.27:
	movq	8(%rsp), %rdi
	movq	(%rsp), %rsi
	movq	16(%rsp), %rdx
	movl	36(%rsp), %r9d
	movss	44(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movss	40(%rsp), %xmm1                 # xmm1 = mem[0],zero,zero,zero
	movl	%r15d, %ecx
	movl	%r13d, %r8d
	callq	_Z33__device_stub__edgeTraceOptimizedPfS_S_iiiff
	jmp	.LBB12_30
.LBB12_28:
	testl	%eax, %eax
	jne	.LBB12_30
# %bb.29:
	movq	8(%rsp), %rdi
	movq	(%rsp), %rsi
	movq	16(%rsp), %rdx
	movl	36(%rsp), %r9d
	movss	44(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movss	40(%rsp), %xmm1                 # xmm1 = mem[0],zero,zero,zero
	movl	%r15d, %ecx
	movl	%r13d, %r8d
	callq	_Z24__device_stub__edgeTracePfS_S_iiiff
.LBB12_30:
	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	.LBB12_32
# %bb.31:
	movq	(%rsp), %rdi
	movq	24(%rsp), %rsi
	movl	84(%rsp), %r8d
	movl	%r15d, %edx
	movl	%r13d, %ecx
	callq	_Z24__device_stub__trans2BmpPfP15HIP_vector_typeIhLj3EEiii
.LBB12_32:
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	je	.LBB12_34
# %bb.33:
	movl	$.Lstr.33, %edi
	callq	puts@PLT
.LBB12_34:
	callq	clock
	subq	48(%rsp), %rax                  # 8-byte Folded Reload
	xorl	%ebp, %ebp
	movl	$.L.str.45, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %rsi
	movq	120(%rsp), %r12                 # 8-byte Reload
	movq	%r12, %rdi
	movq	112(%rsp), %rdx                 # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	je	.LBB12_36
# %bb.35:
	movl	$.Lstr.35, %edi
	callq	puts@PLT
	movl	$1, %ebp
	jmp	.LBB12_8
.LBB12_36:
	movl	$.Lstr.34, %edi
	callq	puts@PLT
	movl	$.L.str.48, %edi
	movl	%r15d, %esi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	printf
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	movq	128(%rsp), %rcx                 # 8-byte Reload
	callq	_Z11saveBMPFileP15HIP_vector_typeIhLj3EEiiPKc
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	72(%rsp), %rdi
	callq	hipFree
	movq	(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	64(%rsp), %rdi
	callq	hipFree
	movq	56(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	%r12, %rdi
	callq	free
	callq	clock
	subq	136(%rsp), %rax                 # 8-byte Folded Reload
	movl	$.L.str.49, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB12_8
.Lfunc_end12:
	.size	main, .Lfunc_end12-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	.LBB13_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB13_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8genGaussPfif, %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	$_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf, %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	$_Z9gaussBlurPfS_iiS_i, %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	$_Z12calcGradientPfS_S_S_ii, %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	$_Z14nonMaxRestrainPfS_S_S_ii, %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	$_Z11findMaxGradPfiiS_, %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	$_Z9edgeTracePfS_S_iiiff, %esi
	movl	$.L__unnamed_7, %edx
	movl	$.L__unnamed_7, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z18edgeTraceOptimizedPfS_S_iiiff, %esi
	movl	$.L__unnamed_8, %edx
	movl	$.L__unnamed_8, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii, %esi
	movl	$.L__unnamed_9, %edx
	movl	$.L__unnamed_9, %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_end13:
	.size	__hip_module_ctor, .Lfunc_end13-__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	.LBB14_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
.LBB14_2:
	retq
.Lfunc_end14:
	.size	__hip_module_dtor, .Lfunc_end14-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Loading %s ...\n"
	.size	.L.str, 16

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"***** fail to open %s *****\n"
	.size	.L.str.2, 29

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"It is %hd\n"
	.size	.L.str.5, 11

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"size of short : %d\n"
	.size	.L.str.6, 20

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"size of hdr is %d , infoHdr is %d\n"
	.size	.L.str.7, 35

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"image width: %u\n"
	.size	.L.str.9, 17

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"image height: %u\n"
	.size	.L.str.10, 18

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

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

	.type	_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf,@object # @_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
	.globl	_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
	.p2align	3, 0x0
_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf:
	.quad	_Z28__device_stub__rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
	.size	_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf, 8

	.type	_Z9gaussBlurPfS_iiS_i,@object   # @_Z9gaussBlurPfS_iiS_i
	.globl	_Z9gaussBlurPfS_iiS_i
	.p2align	3, 0x0
_Z9gaussBlurPfS_iiS_i:
	.quad	_Z24__device_stub__gaussBlurPfS_iiS_i
	.size	_Z9gaussBlurPfS_iiS_i, 8

	.type	_Z12calcGradientPfS_S_S_ii,@object # @_Z12calcGradientPfS_S_S_ii
	.globl	_Z12calcGradientPfS_S_S_ii
	.p2align	3, 0x0
_Z12calcGradientPfS_S_S_ii:
	.quad	_Z27__device_stub__calcGradientPfS_S_S_ii
	.size	_Z12calcGradientPfS_S_S_ii, 8

	.type	_Z14nonMaxRestrainPfS_S_S_ii,@object # @_Z14nonMaxRestrainPfS_S_S_ii
	.globl	_Z14nonMaxRestrainPfS_S_S_ii
	.p2align	3, 0x0
_Z14nonMaxRestrainPfS_S_S_ii:
	.quad	_Z29__device_stub__nonMaxRestrainPfS_S_S_ii
	.size	_Z14nonMaxRestrainPfS_S_S_ii, 8

	.type	_Z11findMaxGradPfiiS_,@object   # @_Z11findMaxGradPfiiS_
	.globl	_Z11findMaxGradPfiiS_
	.p2align	3, 0x0
_Z11findMaxGradPfiiS_:
	.quad	_Z26__device_stub__findMaxGradPfiiS_
	.size	_Z11findMaxGradPfiiS_, 8

	.type	_Z9edgeTracePfS_S_iiiff,@object # @_Z9edgeTracePfS_S_iiiff
	.globl	_Z9edgeTracePfS_S_iiiff
	.p2align	3, 0x0
_Z9edgeTracePfS_S_iiiff:
	.quad	_Z24__device_stub__edgeTracePfS_S_iiiff
	.size	_Z9edgeTracePfS_S_iiiff, 8

	.type	_Z18edgeTraceOptimizedPfS_S_iiiff,@object # @_Z18edgeTraceOptimizedPfS_S_iiiff
	.globl	_Z18edgeTraceOptimizedPfS_S_iiiff
	.p2align	3, 0x0
_Z18edgeTraceOptimizedPfS_S_iiiff:
	.quad	_Z33__device_stub__edgeTraceOptimizedPfS_S_iiiff
	.size	_Z18edgeTraceOptimizedPfS_S_iiiff, 8

	.type	_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii,@object # @_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii
	.globl	_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii
	.p2align	3, 0x0
_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii:
	.quad	_Z24__device_stub__trans2BmpPfP15HIP_vector_typeIhLj3EEiii
	.size	_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii, 8

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

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"%f"
	.size	.L.str.17, 3

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"-hs"
	.size	.L.str.19, 4

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"-ls"
	.size	.L.str.20, 4

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"-it"
	.size	.L.str.21, 4

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

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

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"-dst"
	.size	.L.str.24, 5

	.type	.L.str.25,@object               # @.str.25
.L.str.25:
	.asciz	"-opt"
	.size	.L.str.25, 5

	.type	.L.str.26,@object               # @.str.26
.L.str.26:
	.asciz	"-rev"
	.size	.L.str.26, 5

	.type	.L.str.27,@object               # @.str.27
.L.str.27:
	.asciz	"-help"
	.size	.L.str.27, 6

	.type	.L.str.40,@object               # @.str.40
.L.str.40:
	.asciz	"../data/src3.bmp"
	.size	.L.str.40, 17

	.type	.L.str.41,@object               # @.str.41
.L.str.41:
	.asciz	"../data/out.bmp"
	.size	.L.str.41, 16

	.type	.L.str.45,@object               # @.str.45
.L.str.45:
	.asciz	"------canny use %ld ms\n"
	.size	.L.str.45, 24

	.type	.L.str.48,@object               # @.str.48
.L.str.48:
	.asciz	"width:%d height:%d\n"
	.size	.L.str.48, 20

	.type	.L.str.49,@object               # @.str.49
.L.str.49:
	.asciz	"------total use %ld ms\n"
	.size	.L.str.49, 24

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z8genGaussPfif"
	.size	.L__unnamed_1, 16

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf"
	.size	.L__unnamed_2, 47

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z9gaussBlurPfS_iiS_i"
	.size	.L__unnamed_3, 22

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z12calcGradientPfS_S_S_ii"
	.size	.L__unnamed_4, 27

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z14nonMaxRestrainPfS_S_S_ii"
	.size	.L__unnamed_5, 29

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

	.type	.L__unnamed_7,@object           # @6
.L__unnamed_7:
	.asciz	"_Z9edgeTracePfS_S_iiiff"
	.size	.L__unnamed_7, 24

	.type	.L__unnamed_8,@object           # @7
.L__unnamed_8:
	.asciz	"_Z18edgeTraceOptimizedPfS_S_iiiff"
	.size	.L__unnamed_8, 34

	.type	.L__unnamed_9,@object           # @8
.L__unnamed_9:
	.asciz	"_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii"
	.size	.L__unnamed_9, 43

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

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"image file loaded successful! "
	.size	.Lstr, 31

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"***** cannot solve copressed image *****"
	.size	.Lstr.1, 41

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"***** invalid color depth (24 bits needed) *****"
	.size	.Lstr.2, 49

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"***** it is not a bmp file *****"
	.size	.Lstr.3, 33

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"in save bmp file"
	.size	.Lstr.4, 17

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"***** fail to open dest file *****"
	.size	.Lstr.5, 35

	.type	.Lstr.6,@object                 # @str.6
.Lstr.6:
	.asciz	"image file writed over"
	.size	.Lstr.6, 23

	.type	.Lstr.7,@object                 # @str.7
.Lstr.7:
	.asciz	"*****invalid gauss sigma value*****"
	.size	.Lstr.7, 36

	.type	.Lstr.8,@object                 # @str.8
.Lstr.8:
	.asciz	"*****invalid l/hsigma value*****"
	.size	.Lstr.8, 33

	.type	.Lstr.9,@object                 # @str.9
.Lstr.9:
	.asciz	"*****invalid iteration*****"
	.size	.Lstr.9, 28

	.type	.Lstr.18,@object                # @str.18
.Lstr.18:
	.asciz	"-src srcname : set src image file, must be 24 bit bmp file"
	.size	.Lstr.18, 59

	.type	.Lstr.19,@object                # @str.19
.Lstr.19:
	.asciz	"-dst dstname : set dst image file, must be 24 bit bmp file"
	.size	.Lstr.19, 59

	.type	.Lstr.20,@object                # @str.20
.Lstr.20:
	.asciz	"-gs  gaussSigma: set gaussSigma"
	.size	.Lstr.20, 32

	.type	.Lstr.21,@object                # @str.21
.Lstr.21:
	.asciz	"-ls  lowThreshold : set lowthreshold in canny"
	.size	.Lstr.21, 46

	.type	.Lstr.22,@object                # @str.22
.Lstr.22:
	.asciz	"-hs  highThreshold: set highthreshold in canny"
	.size	.Lstr.22, 47

	.type	.Lstr.23,@object                # @str.23
.Lstr.23:
	.asciz	"-it  iteration    : set iteration number of tracing edge"
	.size	.Lstr.23, 57

	.type	.Lstr.24,@object                # @str.24
.Lstr.24:
	.asciz	"-opt  1/0    : set ioptimimze tracing edge or not"
	.size	.Lstr.24, 50

	.type	.Lstr.25,@object                # @str.25
.Lstr.25:
	.asciz	"-rev  1/0    : set  edge color black(0)/white(1)"
	.size	.Lstr.25, 49

	.type	.Lstr.26,@object                # @str.26
.Lstr.26:
	.asciz	"-help :show info like this"
	.size	.Lstr.26, 27

	.type	.Lstr.32,@object                # @str.32
.Lstr.32:
	.asciz	"*****invalid argument format*****"
	.size	.Lstr.32, 34

	.type	.Lstr.33,@object                # @str.33
.Lstr.33:
	.asciz	"*****kernel function down*****"
	.size	.Lstr.33, 31

	.type	.Lstr.34,@object                # @str.34
.Lstr.34:
	.asciz	"before save bmlp file"
	.size	.Lstr.34, 22

	.type	.Lstr.35,@object                # @str.35
.Lstr.35:
	.asciz	"*****fail to copy memory from device*****"
	.size	.Lstr.35, 42

	.type	.Lstr.36,@object                # @str.36
.Lstr.36:
	.asciz	"*****fail to copy memory*****"
	.size	.Lstr.36, 30

	.type	.Lstr.42,@object                # @str.42
.Lstr.42:
	.asciz	"*****fail to malloc gpu memory*****"
	.size	.Lstr.42, 36

	.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 _Z23__device_stub__genGaussPfif
	.addrsig_sym _Z28__device_stub__rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
	.addrsig_sym _Z24__device_stub__gaussBlurPfS_iiS_i
	.addrsig_sym _Z27__device_stub__calcGradientPfS_S_S_ii
	.addrsig_sym _Z29__device_stub__nonMaxRestrainPfS_S_S_ii
	.addrsig_sym _Z26__device_stub__findMaxGradPfiiS_
	.addrsig_sym _Z24__device_stub__edgeTracePfS_S_iiiff
	.addrsig_sym _Z33__device_stub__edgeTraceOptimizedPfS_S_iiiff
	.addrsig_sym _Z24__device_stub__trans2BmpPfP15HIP_vector_typeIhLj3EEiii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z8genGaussPfif
	.addrsig_sym _Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
	.addrsig_sym _Z9gaussBlurPfS_iiS_i
	.addrsig_sym _Z12calcGradientPfS_S_S_ii
	.addrsig_sym _Z14nonMaxRestrainPfS_S_S_ii
	.addrsig_sym _Z11findMaxGradPfiiS_
	.addrsig_sym _Z9edgeTracePfS_S_iiiff
	.addrsig_sym _Z18edgeTraceOptimizedPfS_S_iiiff
	.addrsig_sym _Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z8genGaussPfif         ; -- Begin function _Z8genGaussPfif
	.globl	_Z8genGaussPfif
	.p2align	8
	.type	_Z8genGaussPfif,@function
_Z8genGaussPfif:                        ; @_Z8genGaussPfif
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x1c
	s_load_b128 s[4:7], s[0:1], 0x0
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v3, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s1, s2, 0xffff
	s_lshr_b32 s0, s2, 16
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[0:1], null, s14, s1, v[2:3]
	v_mad_u64_u32 v[1:2], null, s15, s0, v[3:4]
	v_mov_b32_e32 v3, 0
	ds_store_b32 v3, v3
	v_max_i32_e32 v2, v0, v1
	v_cmp_gt_i32_e64 s0, s6, v2
	s_delay_alu instid0(VALU_DEP_1)
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB0_5
; %bb.1:
	s_lshr_b32 s3, s6, 31
	s_mov_b32 s8, 0x4d12d84a
	s_add_i32 s3, s6, s3
	s_mov_b32 s9, 0x401921fb
	s_ashr_i32 s3, s3, 1
	s_mov_b32 s2, exec_lo
	v_subrev_nc_u32_e32 v2, s3, v0
	v_subrev_nc_u32_e32 v5, s3, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v2, v2, v2
	v_mad_u64_u32 v[3:4], null, v5, v5, v[2:3]
	v_mul_f32_e64 v4, s7, s7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cvt_f64_f32_e32 v[4:5], v4
	v_cvt_f64_i32_e32 v[2:3], v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[2:3], v[2:3], -0.5
	v_div_scale_f64 v[6:7], null, v[4:5], v[4:5], v[2:3]
	v_div_scale_f64 v[12:13], vcc_lo, v[2:3], v[4:5], v[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[8:9], v[6:7]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[10:11], v[12:13], v[8:9]
	v_fma_f64 v[6:7], -v[6:7], v[10:11], v[12:13]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[6:7], v[6:7], v[8:9], v[10:11]
	v_div_fixup_f64 v[2:3], v[6:7], v[4:5], v[2:3]
	v_cvt_f64_f32_e32 v[4:5], s7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f32_f64_e32 v6, v[2:3]
	v_mul_f64 v[2:3], v[4:5], s[8:9]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v6, 0x3fb8aa3b, v6
	v_mul_f64 v[2:3], v[2:3], v[4:5]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_exp_f32_e32 v6, v6
	s_waitcnt_depctr 0xfff
	v_cvt_f64_f32_e32 v[4:5], v6
	v_div_scale_f64 v[6:7], null, v[2:3], v[2:3], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[8:9], v[6:7]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	v_div_scale_f64 v[10:11], vcc_lo, v[4:5], v[2:3], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[12:13], v[10:11], v[8:9]
	v_fma_f64 v[6:7], -v[6:7], v[12:13], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[6:7], v[6:7], v[8:9], v[12:13]
	v_div_fixup_f64 v[2:3], v[6:7], v[2:3], v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cvt_f32_f64_e32 v2, v[2:3]
	v_mad_u64_u32 v[3:4], null, v1, s6, v[0:1]
	v_ashrrev_i32_e32 v4, 31, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	v_add_co_u32 v5, vcc_lo, s4, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v6, vcc_lo, s5, v4, vcc_lo
	v_bfrev_b32_e32 v3, 1
	global_store_b32 v[5:6], v2, off
.LBB0_2:                                ; %ComputeLoop
                                        ; =>This Inner Loop Header: Depth=1
	s_ctz_i32_b32 s3, s2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_readlane_b32 s7, v2, s3
	s_lshl_b32 s3, 1, s3
	s_and_not1_b32 s2, s2, s3
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_cmp_lg_u32 s2, 0
	v_add_f32_e32 v3, s7, v3
	s_cbranch_scc1 .LBB0_2
; %bb.3:                                ; %ComputeEnd
	v_mbcnt_lo_u32_b32 v2, exec_lo, 0
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v2
	s_xor_b32 s2, exec_lo, s2
	s_cbranch_execz .LBB0_5
; %bb.4:
	v_mov_b32_e32 v2, 0
	ds_add_f32 v2, v3
.LBB0_5:                                ; %Flow52
	s_or_b32 exec_lo, exec_lo, s1
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB0_7
; %bb.6:
	v_mad_u64_u32 v[2:3], null, v1, s6, v[0:1]
	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]
	v_mov_b32_e32 v3, 0
	ds_load_b32 v3, v3
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	global_load_b32 v2, v[0:1], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_div_scale_f32 v4, null, v3, v3, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v5, v4
	s_waitcnt_depctr 0xfff
	v_fma_f32 v6, -v4, v5, 1.0
	v_fmac_f32_e32 v5, v6, v5
	v_div_scale_f32 v6, vcc_lo, v2, v3, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v7, v6, v5
	v_fma_f32 v8, -v4, v7, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v7, v8, v5
	v_fma_f32 v4, -v4, v7, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f32 v4, v4, v5, v7
	v_div_fixup_f32 v2, v4, v3, v2
	global_store_b32 v[0:1], v2, off
.LBB0_7:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8genGaussPfif
		.amdhsa_group_segment_fixed_size 4
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.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 14
		.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	_Z8genGaussPfif, .Lfunc_end0-_Z8genGaussPfif
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 808
; NumSgprs: 18
; NumVgprs: 14
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 14
; 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	_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf ; -- Begin function _Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
	.globl	_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
	.p2align	8
	.type	_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf,@function
_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf: ; @_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b64 s[4:5], s[0:1], 0x8
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v3, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_mad_u64_u32 v[1:2], null, s15, s3, v[3:4]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, s4, v0
	v_cmp_gt_i32_e64 s2, s5, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB1_2
; %bb.1:
	s_load_b64 s[2:3], s[0:1], 0x0
	v_mad_u64_u32 v[2:3], null, v1, s4, v[0:1]
	s_load_b64 s[0:1], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_mad_i64_i32 v[0:1], null, v2, 3, s[2:3]
	s_mov_b32 s2, 0x39581062
	s_mov_b32 s3, 0x3fe2c8b4
	s_clause 0x1
	global_load_u16 v3, v[0:1], off
	global_load_u8 v5, v[0:1], off offset:2
	s_waitcnt vmcnt(1)
	v_bfe_u32 v0, v3, 8, 8
	v_and_b32_e32 v3, 0xff, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f64_u32_e32 v[0:1], v0
	v_and_b32_e32 v3, 0xffff, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cvt_f64_u32_e32 v[3:4], v3
	v_mul_f64 v[0:1], v[0:1], s[2:3]
	s_mov_b32 s2, 0xe5604189
	s_mov_b32 s3, 0x3fd322d0
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[0:1], v[3:4], s[2:3], v[0:1]
	s_waitcnt vmcnt(0)
	v_cvt_f64_u32_e32 v[3:4], v5
	s_mov_b32 s2, 0x9fbe76c9
	s_mov_b32 s3, 0x3fbd2f1a
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_fma_f64 v[0:1], v[3:4], s[2:3], v[0:1]
	v_ashrrev_i32_e32 v3, 31, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f32_f64_e32 v4, v[0:1]
	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, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v4, off
.LBB1_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 6
		.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	_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf, .Lfunc_end1-_Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 352
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; 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	_Z9gaussBlurPfS_iiS_i   ; -- Begin function _Z9gaussBlurPfS_iiS_i
	.globl	_Z9gaussBlurPfS_iiS_i
	.p2align	8
	.type	_Z9gaussBlurPfS_iiS_i,@function
_Z9gaussBlurPfS_iiS_i:                  ; @_Z9gaussBlurPfS_iiS_i
; %bb.0:
	s_load_b32 s2, s[0:1], 0x34
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v3, v0, 10, 10
	s_mov_b32 s3, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_u32_e32 v0, v2, v3
	v_cmpx_gt_u32_e32 5, v0
	s_cbranch_execz .LBB2_2
; %bb.1:
	s_load_b64 s[4:5], s[0:1], 0x18
	v_mul_u32_u24_e32 v0, 5, v3
	v_lshlrev_b32_e32 v1, 2, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_lshl_u32 v0, v0, v2, 2
	v_mad_u32_u24 v1, v3, 20, v1
	s_waitcnt lgkmcnt(0)
	global_load_b32 v0, v0, s[4:5]
	s_waitcnt vmcnt(0)
	ds_store_b32 v1, v0
.LBB2_2:
	s_or_b32 exec_lo, exec_lo, s3
	s_load_b64 s[8:9], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_mad_u64_u32 v[1:2], null, s15, s3, v[3:4]
	s_barrier
	buffer_gl0_inv
	v_cmp_gt_i32_e32 vcc_lo, s8, v0
	v_cmp_gt_i32_e64 s2, s9, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB2_12
; %bb.3:                                ; %.preheader.preheader
	s_load_b128 s[4:7], s[0:1], 0x0
	v_add_nc_u32_e32 v2, -2, v1
	v_add_nc_u32_e32 v4, -2, v0
	s_mov_b32 s1, -2
	s_mov_b32 s2, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_mul_lo_u32 v3, s8, v2
	v_mov_b32_e32 v2, 0
.LBB2_4:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB2_5 Depth 2
	v_add_nc_u32_e32 v5, s1, v1
	s_movk_i32 s10, 0xffec
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, s9, v5
	v_cmp_lt_i32_e64 s0, -1, v5
	v_mov_b32_e32 v5, v4
	s_and_b32 s3, vcc_lo, s0
.LBB2_5:                                ;   Parent Loop BB2_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s11, s3
	s_cbranch_execz .LBB2_9
; %bb.6:                                ;   in Loop: Header=BB2_5 Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e32 vcc_lo, s8, v5
	v_cmp_lt_i32_e64 s0, -1, v5
	s_and_b32 s12, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s0, s12
	s_cbranch_execz .LBB2_8
; %bb.7:                                ;   in Loop: Header=BB2_5 Depth=2
	s_add_i32 s12, s2, s10
	v_add_nc_u32_e32 v6, v3, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v7, 31, v6
	v_lshlrev_b64 v[6:7], 2, v[6:7]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v6, vcc_lo, s4, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v7, vcc_lo
	global_load_b32 v6, v[6:7], off
	v_mov_b32_e32 v7, s12
	ds_load_b32 v7, v7 offset:20
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fmac_f32_e32 v2, v7, v6
.LBB2_8:                                ; %Flow
                                        ;   in Loop: Header=BB2_5 Depth=2
	s_or_b32 exec_lo, exec_lo, s0
.LBB2_9:                                ;   in Loop: Header=BB2_5 Depth=2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s11
	v_add_nc_u32_e32 v5, 1, v5
	s_add_i32 s10, s10, 4
	s_cmp_eq_u32 s10, 0
	s_cbranch_scc0 .LBB2_5
; %bb.10:                               ;   in Loop: Header=BB2_4 Depth=1
	v_add_nc_u32_e32 v3, s8, v3
	s_add_i32 s1, s1, 1
	s_add_i32 s2, s2, 20
	s_cmp_eq_u32 s1, 3
	s_cbranch_scc0 .LBB2_4
; %bb.11:
	v_mad_u64_u32 v[3:4], null, v1, s8, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v4, 31, v3
	v_lshlrev_b64 v[0:1], 2, v[3:4]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_store_b32 v[0:1], v2, off
.LBB2_12:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9gaussBlurPfS_iiS_i
		.amdhsa_group_segment_fixed_size 100
		.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 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_end2:
	.size	_Z9gaussBlurPfS_iiS_i, .Lfunc_end2-_Z9gaussBlurPfS_iiS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 492
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 100 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
	.protected	_Z12calcGradientPfS_S_S_ii ; -- Begin function _Z12calcGradientPfS_S_S_ii
	.globl	_Z12calcGradientPfS_S_S_ii
	.p2align	8
	.type	_Z12calcGradientPfS_S_S_ii,@function
_Z12calcGradientPfS_S_S_ii:             ; @_Z12calcGradientPfS_S_S_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x34
	s_load_b64 s[2:3], s[0:1], 0x20
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v0, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s5, s4, 16
	s_and_b32 s4, s4, 0xffff
	s_add_i32 s12, s3, -1
	v_mad_u64_u32 v[2:3], null, s14, s4, v[1:2]
	v_mad_u64_u32 v[3:4], null, s15, s5, v[0:1]
	s_load_b256 s[4:11], s[0:1], 0x0
	s_add_i32 s1, s2, -1
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_cmp_gt_i32_e32 vcc_lo, s1, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[0:1], null, v3, s2, v[2:3]
	v_cmp_gt_i32_e64 s0, s12, v3
	s_and_b32 s0, vcc_lo, s0
	s_delay_alu instid0(VALU_DEP_2)
	v_ashrrev_i32_e32 v1, 31, v0
	s_and_saveexec_b32 s13, s0
	s_cbranch_execz .LBB3_2
; %bb.1:
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[4:5], 2, v[0:1]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v6, vcc_lo, s4, v4
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v5, vcc_lo
	s_ashr_i32 s5, s2, 31
	s_mov_b32 s4, s2
	v_add_co_u32 v10, vcc_lo, s8, v4
	global_load_b64 v[8:9], v[6:7], off
	s_lshl_b64 s[4:5], s[4:5], 2
	v_add_co_ci_u32_e32 v11, vcc_lo, s9, v5, vcc_lo
	s_waitcnt vmcnt(0)
	v_sub_f32_e32 v12, v9, v8
	v_add_co_u32 v8, vcc_lo, v6, s4
	v_add_co_ci_u32_e32 v9, vcc_lo, s5, v7, vcc_lo
	global_store_b32 v[10:11], v12, off
	s_clause 0x1
	global_load_b32 v8, v[8:9], off
	global_load_b32 v9, v[6:7], off
	v_add_co_u32 v6, vcc_lo, s10, v4
	v_add_co_ci_u32_e32 v7, vcc_lo, s11, v5, vcc_lo
	s_waitcnt vmcnt(0)
	v_sub_f32_e32 v8, v8, v9
	global_store_b32 v[6:7], v8, off
	global_load_b32 v6, v[10:11], off
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v6, v6, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v6, v8, v8
	v_mul_f32_e32 v7, 0x4f800000, v6
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v6, v6, v7, vcc_lo
	v_sqrt_f32_e32 v7, v6
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v8, -1, v7
	v_add_nc_u32_e32 v9, 1, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v10, -v8, v7, v6
	v_fma_f32 v11, -v9, v7, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s0, 0, v10
	v_cndmask_b32_e64 v7, v7, v8, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s0, 0, v11
	v_cndmask_b32_e64 v7, v7, v9, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v8, 0x37800000, v7
	v_cndmask_b32_e32 v7, v7, v8, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v6, 0x260
	s_delay_alu instid0(VALU_DEP_2)
	v_cndmask_b32_e32 v6, v7, v6, vcc_lo
	v_add_co_u32 v4, vcc_lo, s6, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v5, vcc_lo
	global_store_b32 v[4:5], v6, off
.LBB3_2:
	s_or_b32 exec_lo, exec_lo, s13
	v_cmp_gt_i32_e32 vcc_lo, s2, v2
	v_cmp_gt_i32_e64 s0, s3, v3
	v_cmp_eq_u32_e64 s1, s1, v2
	v_cmp_eq_u32_e64 s2, s12, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_and_b32 s0, vcc_lo, s0
	s_or_b32 s1, s1, s2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, s0, s1
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB3_4
; %bb.3:
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_mov_b32_e32 v2, 0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_store_b32 v[0:1], v2, off
.LBB3_4:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12calcGradientPfS_S_S_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 13
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end3:
	.size	_Z12calcGradientPfS_S_S_ii, .Lfunc_end3-_Z12calcGradientPfS_S_S_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 564
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z14nonMaxRestrainPfS_S_S_ii ; -- Begin function _Z14nonMaxRestrainPfS_S_S_ii
	.globl	_Z14nonMaxRestrainPfS_S_S_ii
	.p2align	8
	.type	_Z14nonMaxRestrainPfS_S_S_ii,@function
_Z14nonMaxRestrainPfS_S_S_ii:           ; @_Z14nonMaxRestrainPfS_S_S_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b64 s[12:13], s[0:1], 0x20
	v_and_b32_e32 v3, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[1:2], null, s14, s3, v[3:4]
	s_add_i32 s3, s12, -2
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_cmp_gt_i32_e32 vcc_lo, s3, v1
	s_and_saveexec_b32 s3, vcc_lo
	s_cbranch_execz .LBB4_21
; %bb.1:
	v_bfe_u32 v0, v0, 10, 10
	s_lshr_b32 s2, s2, 16
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[2:3], null, s15, s2, v[0:1]
	s_add_i32 s2, s13, -2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_min_i32_e32 v0, v1, v2
	v_cmp_gt_i32_e32 vcc_lo, s2, v2
	v_cmp_lt_i32_e64 s2, 0, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, vcc_lo
	s_and_b32 exec_lo, exec_lo, s2
	s_cbranch_execz .LBB4_21
; %bb.2:
	s_load_b256 s[4:11], s[0:1], 0x0
	v_mad_u64_u32 v[6:7], null, v2, s12, v[1:2]
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v7, 31, v6
	v_lshlrev_b64 v[0:1], 2, v[6:7]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v7, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v8, vcc_lo, s5, v1, vcc_lo
	global_load_b32 v11, v[7:8], off
	s_waitcnt vmcnt(0)
	v_cmp_nge_f32_e32 vcc_lo, 0x2edbe6ff, v11
	v_cmp_nle_f32_e64 s0, 0xaedbe6ff, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s0, vcc_lo, s0
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB4_20
; %bb.3:
	v_add_co_u32 v2, vcc_lo, s8, v0
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v1, vcc_lo
	v_add_co_u32 v4, vcc_lo, s10, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s11, v1, vcc_lo
	s_mov_b32 s2, exec_lo
	global_load_b32 v15, v[2:3], off
	global_load_b32 v16, v[4:5], off
                                        ; implicit-def: $vgpr14
                                        ; implicit-def: $vgpr12
                                        ; implicit-def: $vgpr2_vgpr3
                                        ; implicit-def: $vgpr13
                                        ; implicit-def: $vgpr4_vgpr5
	s_waitcnt vmcnt(1)
	v_and_b32_e32 v19, 0x7fffffff, v15
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v17, v15, v16
	v_and_b32_e32 v18, 0x7fffffff, v16
	v_cmpx_ngt_f32_e64 |v16|, |v15|
	s_xor_b32 s2, exec_lo, s2
	s_cbranch_execz .LBB4_9
; %bb.4:
	s_clause 0x1
	global_load_b32 v13, v[7:8], off offset:-4
	global_load_b32 v12, v[7:8], off offset:4
	v_div_scale_f32 v2, null, v19, v19, v18
	s_ashr_i32 s13, s12, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_lshl_b64 s[8:9], s[12:13], 2
	v_rcp_f32_e32 v3, v2
	v_add_co_u32 v7, s0, v7, s8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v8, s0, s9, v8, s0
	s_mov_b32 s0, exec_lo
	s_waitcnt_depctr 0xfff
	v_fma_f32 v4, -v2, v3, 1.0
	v_fmac_f32_e32 v3, v4, v3
	v_div_scale_f32 v4, vcc_lo, v18, v19, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v5, v4, v3
	v_fma_f32 v9, -v2, v5, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v5, v9, v3
	v_fma_f32 v2, -v2, v5, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f32 v2, v2, v3, v5
                                        ; implicit-def: $vgpr4_vgpr5
	v_div_fixup_f32 v14, v2, |v15|, |v16|
                                        ; implicit-def: $vgpr2_vgpr3
	v_cmpx_nlt_f32_e32 0, v17
	s_xor_b32 s0, exec_lo, s0
; %bb.5:
	v_subrev_nc_u32_e32 v2, s12, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, v2, 4
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	v_add_co_u32 v4, vcc_lo, v7, -4
                                        ; implicit-def: $vgpr6_vgpr7
	v_add_co_ci_u32_e32 v5, vcc_lo, -1, v8, vcc_lo
                                        ; implicit-def: $vgpr7
                                        ; implicit-def: $vgpr8
; %bb.6:                                ; %Flow119
	s_and_not1_saveexec_b32 s0, s0
; %bb.7:
	v_xad_u32 v2, s12, -1, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	v_add_co_u32 v4, vcc_lo, v7, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v8, vcc_lo
; %bb.8:                                ; %Flow120
	s_or_b32 exec_lo, exec_lo, s0
                                        ; implicit-def: $vgpr6_vgpr7
                                        ; implicit-def: $vgpr18
                                        ; implicit-def: $vgpr19
                                        ; implicit-def: $vgpr16
                                        ; implicit-def: $vgpr15
                                        ; implicit-def: $vgpr17
                                        ; implicit-def: $vgpr7
.LBB4_9:                                ; %Flow123
	s_and_not1_saveexec_b32 s0, s2
	s_cbranch_execz .LBB4_15
; %bb.10:
	v_subrev_nc_u32_e32 v2, s12, v6
	s_ashr_i32 s13, s12, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_lshl_b64 s[2:3], s[12:13], 2
	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 v9, vcc_lo, s4, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v10, vcc_lo, s5, v3, vcc_lo
	v_add_co_u32 v6, vcc_lo, v7, s2
	v_add_co_ci_u32_e32 v7, vcc_lo, s3, v8, vcc_lo
	v_div_scale_f32 v2, null, v18, v18, v19
	s_clause 0x1
	global_load_b32 v13, v[9:10], off
	global_load_b32 v12, v[6:7], off
	s_mov_b32 s2, exec_lo
	v_rcp_f32_e32 v3, v2
	s_waitcnt_depctr 0xfff
	v_fma_f32 v4, -v2, v3, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v3, v4, v3
	v_div_scale_f32 v4, vcc_lo, v19, v18, v19
	v_mul_f32_e32 v5, v4, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v8, -v2, v5, v4
	v_fmac_f32_e32 v5, v8, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v2, -v2, v5, v4
	v_div_fmas_f32 v2, v2, v3, v5
                                        ; implicit-def: $vgpr4_vgpr5
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fixup_f32 v14, v2, |v16|, |v15|
                                        ; implicit-def: $vgpr2_vgpr3
	v_cmpx_nlt_f32_e32 0, v17
	s_xor_b32 s2, exec_lo, s2
; %bb.11:
	v_add_co_u32 v2, vcc_lo, v9, 4
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v10, vcc_lo
	v_add_co_u32 v4, vcc_lo, v6, -4
	v_add_co_ci_u32_e32 v5, vcc_lo, -1, v7, vcc_lo
                                        ; implicit-def: $vgpr9
                                        ; implicit-def: $vgpr6
; %bb.12:                               ; %Flow121
	s_and_not1_saveexec_b32 s2, s2
; %bb.13:
	v_add_co_u32 v2, vcc_lo, v9, -4
	v_add_co_ci_u32_e32 v3, vcc_lo, -1, v10, vcc_lo
	v_add_co_u32 v4, vcc_lo, v6, 4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v7, vcc_lo
; %bb.14:                               ; %Flow122
	s_or_b32 exec_lo, exec_lo, s2
.LBB4_15:
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s0
	global_load_b32 v3, v[2:3], off
	v_sub_f32_e32 v2, 1.0, v14
	s_mov_b32 s2, exec_lo
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v3, v2, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v3, v13, v14
	v_cmp_ngt_f32_e64 s0, v11, v3
	v_cmpx_gt_f32_e32 v11, v3
	s_cbranch_execz .LBB4_17
; %bb.16:
	global_load_b32 v3, v[4:5], off
	s_and_not1_b32 s0, s0, exec_lo
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v2, v2, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v2, v12, v14
	v_cmp_ngt_f32_e32 vcc_lo, v11, v2
	s_and_b32 s3, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s0, s0, s3
.LBB4_17:                               ; %Flow
	s_or_b32 exec_lo, exec_lo, s2
	s_delay_alu instid0(VALU_DEP_2)
	s_and_saveexec_b32 s2, s0
; %bb.18:
	v_mov_b32_e32 v11, 0
; %bb.19:                               ; %Flow118
	s_or_b32 exec_lo, exec_lo, s2
	s_delay_alu instid0(VALU_DEP_1)
	v_mov_b32_e32 v2, v11
.LBB4_20:                               ; %Flow124
	s_or_b32 exec_lo, exec_lo, s1
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_store_b32 v[0:1], v2, off
.LBB4_21:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14nonMaxRestrainPfS_S_S_ii
		.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 20
		.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	_Z14nonMaxRestrainPfS_S_S_ii, .Lfunc_end4-_Z14nonMaxRestrainPfS_S_S_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1016
; NumSgprs: 18
; NumVgprs: 20
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 20
; 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	_Z11findMaxGradPfiiS_   ; -- Begin function _Z11findMaxGradPfiiS_
	.globl	_Z11findMaxGradPfiiS_
	.p2align	8
	.type	_Z11findMaxGradPfiiS_,@function
_Z11findMaxGradPfiiS_:                  ; @_Z11findMaxGradPfiiS_
; %bb.0:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x24
	s_load_b64 s[4:5], s[0:1], 0x8
	s_mov_b32 s2, s15
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s3, 0xffff
	s_mul_i32 s4, s5, s4
	v_mad_u64_u32 v[1:2], null, s2, s3, v[0:1]
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, s4, v1
	s_and_saveexec_b32 s4, vcc_lo
	s_cbranch_execz .LBB5_2
; %bb.1:
	s_load_b64 s[6:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v1, vcc_lo, s6, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v2, vcc_lo, s7, v2, vcc_lo
	global_load_b32 v2, v[1:2], off
.LBB5_2:
	s_or_b32 exec_lo, exec_lo, s4
	v_lshl_add_u32 v1, v0, 2, 0
	s_cmp_lt_u32 s3, 2
	s_waitcnt vmcnt(0)
	ds_store_b32 v1, v2
	s_cbranch_scc1 .LBB5_10
; %bb.3:                                ; %.lr.ph.preheader
	v_mov_b32_e32 v2, s3
.LBB5_4:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_lshr_b32 s4, s3, 1
	s_mov_b32 s5, exec_lo
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_cmpx_gt_u32_e64 s4, v0
	s_cbranch_execz .LBB5_9
; %bb.5:                                ;   in Loop: Header=BB5_4 Depth=1
	v_lshl_add_u32 v3, s4, 2, v1
	s_and_b32 s7, s3, 0xfffe
	s_mov_b32 s6, exec_lo
	ds_load_b32 v4, v1
	ds_load_b32 v3, v3
	s_waitcnt lgkmcnt(0)
	v_cmp_gt_f32_e32 vcc_lo, v4, v3
	v_cndmask_b32_e32 v3, v3, v4, vcc_lo
	ds_store_b32 v1, v3
	v_cmpx_lt_i32_e64 s7, v2
	s_cbranch_execz .LBB5_8
; %bb.6:                                ;   in Loop: Header=BB5_4 Depth=1
	v_add_nc_u32_e32 v4, s7, v0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_lt_u32_e32 vcc_lo, v4, v2
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB5_8
; %bb.7:                                ;   in Loop: Header=BB5_4 Depth=1
	v_lshl_add_u32 v2, s7, 2, v1
	ds_load_b32 v2, v2
	s_waitcnt lgkmcnt(0)
	v_cmp_gt_f32_e32 vcc_lo, v3, v2
	v_cndmask_b32_e32 v2, v2, v3, vcc_lo
	ds_store_b32 v1, v2
.LBB5_8:                                ; %Flow60
                                        ;   in Loop: Header=BB5_4 Depth=1
	s_or_b32 exec_lo, exec_lo, s6
	v_mov_b32_e32 v2, s4
.LBB5_9:                                ;   in Loop: Header=BB5_4 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	s_cmp_lt_u32 s3, 4
	s_mov_b32 s3, s4
	s_cbranch_scc0 .LBB5_4
.LBB5_10:                               ; %._crit_edge
	s_mov_b32 s3, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB5_12
; %bb.11:
	v_mov_b32_e32 v0, 0
	s_load_b64 s[0:1], s[0:1], 0x10
	s_mov_b32 s3, 0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_lshl_b64 s[2:3], s[2:3], 2
	ds_load_b32 v1, v0
	s_waitcnt lgkmcnt(0)
	s_add_u32 s0, s0, s2
	s_addc_u32 s1, s1, s3
	global_store_b32 v0, v1, s[0:1]
.LBB5_12:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11findMaxGradPfiiS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 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_end5:
	.size	_Z11findMaxGradPfiiS_, .Lfunc_end5-_Z11findMaxGradPfiiS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 416
; 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: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z9edgeTracePfS_S_iiiff ; -- Begin function _Z9edgeTracePfS_S_iiiff
	.globl	_Z9edgeTracePfS_S_iiiff
	.p2align	8
	.type	_Z9edgeTracePfS_S_iiiff,@function
_Z9edgeTracePfS_S_iiiff:                ; @_Z9edgeTracePfS_S_iiiff
; %bb.0:
	s_load_b128 s[4:7], s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s6, 1
	s_cbranch_scc1 .LBB6_30
; %bb.1:                                ; %.lr.ph
	s_clause 0x1
	s_load_b32 s8, s[0:1], 0x3c
	s_load_b64 s[2:3], s[0:1], 0x10
	v_bfe_u32 v1, v0, 10, 10
	v_dual_mov_b32 v11, 0 :: v_dual_and_b32 v0, 0x3ff, v0
	v_mov_b32_e32 v8, 1.0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s9, s8, 16
	s_and_b32 s8, s8, 0xffff
	v_mad_u64_u32 v[2:3], null, s15, s9, v[1:2]
	v_mad_u64_u32 v[3:4], null, s14, s8, v[0:1]
	s_load_b32 s14, s[0:1], 0x28
	s_load_b32 s2, s[2:3], 0x0
	s_load_b128 s[8:11], s[0:1], 0x0
	s_add_i32 s0, s4, -1
	s_add_i32 s1, s5, -1
	s_ashr_i32 s5, s4, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_4) | instid1(VALU_DEP_3)
	s_lshl_b64 s[12:13], s[4:5], 2
	v_mad_u64_u32 v[0:1], null, v2, s4, v[3:4]
	v_min_i32_e32 v6, v3, v2
	v_cmp_gt_i32_e32 vcc_lo, s0, v3
	v_cmp_gt_i32_e64 s0, s1, v2
	v_cmp_lt_i32_e64 s1, 0, v6
	v_ashrrev_i32_e32 v1, 31, v0
	v_subrev_nc_u32_e32 v4, s4, v0
	s_delay_alu instid0(VALU_DEP_4)
	s_and_b32 s0, s0, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instid1(SALU_CYCLE_1)
	s_and_b32 s4, s0, s1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[2:3], 2, v[0:1]
	v_ashrrev_i32_e32 v5, 31, v4
	s_waitcnt lgkmcnt(0)
	v_mul_f32_e64 v9, s2, s14
	v_mul_f32_e64 v10, s2, s7
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[4:5], 2, v[4:5]
	v_add_co_u32 v0, s2, s8, v2
	v_add_co_ci_u32_e64 v1, s2, s9, v3, s2
	v_add_co_u32 v2, s2, s10, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, s2, s11, v3, s2
	v_add_co_u32 v4, s2, s8, v4
	v_add_co_ci_u32_e64 v5, s2, s9, v5, s2
	v_add_co_u32 v6, s2, v0, s12
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v7, s2, s13, v1, s2
.LBB6_2:                                ; =>This Inner Loop Header: Depth=1
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s5, s4
	s_cbranch_execz .LBB6_29
; %bb.3:                                ;   in Loop: Header=BB6_2 Depth=1
	global_load_b32 v12, v[0:1], off
	s_mov_b32 s0, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_nlt_f32_e32 v12, v9
	s_xor_b32 s7, exec_lo, s0
	s_cbranch_execz .LBB6_27
; %bb.4:                                ;   in Loop: Header=BB6_2 Depth=1
	s_mov_b32 s0, exec_lo
	v_cmpx_ge_f32_e32 v12, v10
	s_xor_b32 s0, exec_lo, s0
	s_cbranch_execz .LBB6_6
; %bb.5:                                ;   in Loop: Header=BB6_2 Depth=1
	global_store_b32 v[2:3], v8, off
.LBB6_6:                                ; %Flow122
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_and_not1_saveexec_b32 s8, s0
	s_cbranch_execz .LBB6_26
; %bb.7:                                ;   in Loop: Header=BB6_2 Depth=1
	global_load_b32 v12, v[4:5], off offset:-4
	s_mov_b32 s0, 0
	s_mov_b32 s10, exec_lo
	s_waitcnt vmcnt(0)
	v_cmp_ge_f32_e64 s9, v12, v10
	v_cmpx_nge_f32_e32 v12, v10
	s_cbranch_execz .LBB6_21
; %bb.8:                                ;   in Loop: Header=BB6_2 Depth=1
	global_load_b32 v12, v[4:5], off
	s_mov_b32 s1, 0
	s_mov_b32 s11, exec_lo
	s_waitcnt vmcnt(0)
	v_cmp_ge_f32_e32 vcc_lo, v12, v10
	v_cmpx_nge_f32_e32 v12, v10
	s_cbranch_execz .LBB6_20
; %bb.9:                                ;   in Loop: Header=BB6_2 Depth=1
	global_load_b32 v12, v[4:5], off offset:4
	s_mov_b32 s2, 0
	s_mov_b32 s12, exec_lo
	s_waitcnt vmcnt(0)
	v_cmp_ge_f32_e64 s0, v12, v10
	v_cmpx_nge_f32_e32 v12, v10
	s_cbranch_execz .LBB6_19
; %bb.10:                               ;   in Loop: Header=BB6_2 Depth=1
	global_load_b32 v12, v[0:1], off offset:-4
	s_mov_b32 s3, 0
	s_mov_b32 s13, exec_lo
	s_waitcnt vmcnt(0)
	v_cmp_ge_f32_e64 s1, v12, v10
	v_cmpx_nge_f32_e32 v12, v10
	s_cbranch_execz .LBB6_18
; %bb.11:                               ;   in Loop: Header=BB6_2 Depth=1
	global_load_b32 v12, v[0:1], off offset:4
	s_mov_b32 s15, 0
	s_mov_b32 s14, exec_lo
	s_waitcnt vmcnt(0)
	v_cmp_ge_f32_e64 s2, v12, v10
	v_cmpx_nge_f32_e32 v12, v10
	s_cbranch_execz .LBB6_17
; %bb.12:                               ;   in Loop: Header=BB6_2 Depth=1
	global_load_b32 v12, v[6:7], off offset:-4
	s_mov_b32 s17, 0
	s_mov_b32 s16, exec_lo
	s_waitcnt vmcnt(0)
	v_cmp_ge_f32_e64 s15, v12, v10
	v_cmpx_nge_f32_e32 v12, v10
	s_cbranch_execz .LBB6_16
; %bb.13:                               ;   in Loop: Header=BB6_2 Depth=1
	global_load_b32 v12, v[6:7], off
	s_mov_b32 s18, 0
	s_mov_b32 s19, exec_lo
	s_waitcnt vmcnt(0)
	v_cmp_ge_f32_e64 s17, v12, v10
	v_cmpx_nge_f32_e32 v12, v10
	s_cbranch_execz .LBB6_15
; %bb.14:                               ;   in Loop: Header=BB6_2 Depth=1
	global_load_b32 v12, v[6:7], off offset:4
	s_and_not1_b32 s17, s17, exec_lo
	s_mov_b32 s18, exec_lo
	s_waitcnt vmcnt(0)
	v_cmp_ge_f32_e64 s3, v12, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s3, s3, exec_lo
	s_or_b32 s17, s17, s3
.LBB6_15:                               ; %Flow119
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s19
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s3, s15, exec_lo
	s_and_b32 s15, s17, exec_lo
	s_and_b32 s17, s18, exec_lo
	s_or_b32 s15, s3, s15
.LBB6_16:                               ; %Flow118
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s16
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s2, s2, exec_lo
	s_and_b32 s3, s15, exec_lo
	s_and_b32 s15, s17, exec_lo
	s_or_b32 s2, s2, s3
.LBB6_17:                               ; %Flow117
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s14
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s1, s1, exec_lo
	s_and_b32 s2, s2, exec_lo
	s_and_b32 s3, s15, exec_lo
	s_or_b32 s1, s1, s2
.LBB6_18:                               ; %Flow116
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s0, s0, exec_lo
	s_and_b32 s1, s1, exec_lo
	s_and_b32 s2, s3, exec_lo
	s_or_b32 s0, s0, s1
.LBB6_19:                               ; %Flow115
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s3, vcc_lo, exec_lo
	s_and_b32 s0, s0, exec_lo
	s_and_b32 s1, s2, exec_lo
	s_or_b32 vcc_lo, s3, s0
.LBB6_20:                               ; %Flow114
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s11
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s2, s9, exec_lo
	s_and_b32 s3, vcc_lo, exec_lo
	s_and_b32 s0, s1, exec_lo
	s_or_b32 s9, s2, s3
.LBB6_21:                               ; %Flow
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s10
	s_delay_alu instid0(VALU_DEP_2)
	s_and_saveexec_b32 s1, s9
	s_cbranch_execz .LBB6_23
; %bb.22:                               ;   in Loop: Header=BB6_2 Depth=1
	s_and_not1_b32 s0, s0, exec_lo
	global_store_b32 v[2:3], v8, off
	global_store_b32 v[0:1], v10, off
.LBB6_23:                               ; %Flow120
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB6_25
; %bb.24:                               ;   in Loop: Header=BB6_2 Depth=1
	global_store_b32 v[2:3], v11, off
	global_store_b32 v[0:1], v10, off
.LBB6_25:                               ; %Flow121
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
.LBB6_26:                               ; %Flow123
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s8
.LBB6_27:                               ; %Flow124
                                        ;   in Loop: Header=BB6_2 Depth=1
	s_and_not1_saveexec_b32 s0, s7
	s_cbranch_execz .LBB6_29
; %bb.28:                               ;   in Loop: Header=BB6_2 Depth=1
	global_store_b32 v[2:3], v11, off
.LBB6_29:                               ;   in Loop: Header=BB6_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	s_add_i32 s6, s6, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s6, 0
	s_cbranch_scc0 .LBB6_2
.LBB6_30:                               ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9edgeTracePfS_S_iiiff
		.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 13
		.amdhsa_next_free_sgpr 20
		.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	_Z9edgeTracePfS_S_iiiff, .Lfunc_end6-_Z9edgeTracePfS_S_iiiff
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 956
; NumSgprs: 22
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z18edgeTraceOptimizedPfS_S_iiiff ; -- Begin function _Z18edgeTraceOptimizedPfS_S_iiiff
	.globl	_Z18edgeTraceOptimizedPfS_S_iiiff
	.p2align	8
	.type	_Z18edgeTraceOptimizedPfS_S_iiiff,@function
_Z18edgeTraceOptimizedPfS_S_iiiff:      ; @_Z18edgeTraceOptimizedPfS_S_iiiff
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b128 s[8:11], s[0:1], 0x18
	v_and_b32_e32 v6, 0x3ff, v0
	v_bfe_u32 v0, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mad_u64_u32 v[3:4], null, s14, s2, v[6:7]
	v_mad_u64_u32 v[4:5], null, s15, s3, v[0:1]
	s_clause 0x1
	s_load_b128 s[12:15], s[0:1], 0x0
	s_load_b64 s[4:5], s[0:1], 0x10
	v_lshlrev_b32_e32 v5, 2, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_gt_i32_e32 vcc_lo, s8, v3
	v_mad_u64_u32 v[1:2], null, v4, s8, v[3:4]
	v_cmp_gt_i32_e64 s2, s9, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_and_b32 s6, vcc_lo, s2
	v_ashrrev_i32_e32 v2, 31, v1
	s_and_saveexec_b32 s7, s6
	s_cbranch_execz .LBB7_2
; %bb.1:
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[7:8], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v7, s3, s12, v7
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v8, s3, s13, v8, s3
	global_load_b32 v7, v[7:8], off
	v_mad_u32_u24 v8, 0x88, v0, v5
	s_waitcnt vmcnt(0)
	ds_store_b32 v8, v7 offset:140
.LBB7_2:
	s_or_b32 exec_lo, exec_lo, s7
	s_load_b32 s7, s[0:1], 0x28
	s_waitcnt lgkmcnt(0)
	s_load_b32 s16, s[4:5], 0x0
	v_cmp_ne_u32_e64 s0, 0, v6
	s_mov_b32 s3, exec_lo
	v_cmpx_eq_u32_e32 0, v6
	s_cbranch_execz .LBB7_6
; %bb.3:
	v_cmp_lt_i32_e64 s1, 0, v3
	v_mov_b32_e32 v7, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, s1, vcc_lo
	s_and_b32 s1, s1, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s4, s1
	s_cbranch_execz .LBB7_5
; %bb.4:
	v_lshlrev_b64 v[7:8], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v7, s1, s12, v7
	v_add_co_ci_u32_e64 v8, s1, s13, v8, s1
	global_load_b32 v7, v[7:8], off offset:-4
.LBB7_5:                                ; %.sink.split
	s_or_b32 exec_lo, exec_lo, s4
	v_mul_u32_u24_e32 v8, 0x88, v0
	s_waitcnt vmcnt(0)
	ds_store_b32 v8, v7 offset:136
.LBB7_6:                                ; %Flow263
	s_or_b32 exec_lo, exec_lo, s3
	v_cmp_ne_u32_e64 s4, 0, v0
	s_mov_b32 s3, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB7_10
; %bb.7:
	v_cmp_lt_i32_e64 s1, 0, v4
	v_mov_b32_e32 v7, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, vcc_lo, s1
	s_and_b32 s1, s2, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s5, s1
	s_cbranch_execz .LBB7_9
; %bb.8:
	v_subrev_nc_u32_e32 v7, s8, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v8, 31, v7
	v_lshlrev_b64 v[7:8], 2, v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v7, s1, s12, v7
	v_add_co_ci_u32_e64 v8, s1, s13, v8, s1
	global_load_b32 v7, v[7:8], off
.LBB7_9:                                ; %.sink.split181
	s_or_b32 exec_lo, exec_lo, s5
	s_waitcnt vmcnt(0)
	ds_store_b32 v5, v7 offset:4
.LBB7_10:                               ; %Flow261
	s_or_b32 exec_lo, exec_lo, s3
	v_cmp_ne_u32_e64 s3, 31, v6
	s_mov_b32 s5, exec_lo
	v_cmpx_eq_u32_e32 31, v6
	s_cbranch_execz .LBB7_14
; %bb.11:
	s_add_i32 s1, s8, -1
	v_mov_b32_e32 v7, 0
	v_cmp_gt_i32_e64 s1, s1, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, s1, s2
	s_and_saveexec_b32 s17, s1
	s_cbranch_execz .LBB7_13
; %bb.12:
	v_lshlrev_b64 v[7:8], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v7, s1, s12, v7
	v_add_co_ci_u32_e64 v8, s1, s13, v8, s1
	global_load_b32 v7, v[7:8], off offset:4
.LBB7_13:                               ; %.sink.split184
	s_or_b32 exec_lo, exec_lo, s17
	v_mul_u32_u24_e32 v8, 0x88, v0
	s_waitcnt vmcnt(0)
	ds_store_b32 v8, v7 offset:268
.LBB7_14:                               ; %Flow259
	s_or_b32 exec_lo, exec_lo, s5
	v_cmp_ne_u32_e64 s1, 31, v0
	s_mov_b32 s17, exec_lo
	v_cmpx_eq_u32_e32 31, v0
	s_cbranch_execz .LBB7_18
; %bb.15:
	s_add_i32 s5, s9, -1
	v_mov_b32_e32 v7, 0
	v_cmp_gt_i32_e64 s5, s5, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s5, vcc_lo, s5
	s_and_saveexec_b32 s18, s5
	s_cbranch_execz .LBB7_17
; %bb.16:
	v_add_nc_u32_e32 v7, s8, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v8, 31, v7
	v_lshlrev_b64 v[7:8], 2, v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v7, s5, s12, v7
	v_add_co_ci_u32_e64 v8, s5, s13, v8, s5
	global_load_b32 v7, v[7:8], off
.LBB7_17:                               ; %.sink.split187
	s_or_b32 exec_lo, exec_lo, s18
	s_waitcnt vmcnt(0)
	ds_store_b32 v5, v7 offset:4492
.LBB7_18:                               ; %Flow257
	s_or_b32 exec_lo, exec_lo, s17
	v_or_b32_e32 v6, v6, v0
	s_mov_b32 s17, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v6
	s_cbranch_execz .LBB7_22
; %bb.19:
	v_min_i32_e32 v6, v3, v4
	v_mov_b32_e32 v7, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_lt_i32_e64 s5, 0, v6
	v_mov_b32_e32 v6, 0
	s_and_b32 s5, vcc_lo, s5
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s5, s2, s5
	s_and_saveexec_b32 s18, s5
	s_cbranch_execz .LBB7_21
; %bb.20:
	v_xad_u32 v7, s8, -1, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v8, 31, v7
	v_lshlrev_b64 v[7:8], 2, v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v7, s5, s12, v7
	v_add_co_ci_u32_e64 v8, s5, s13, v8, s5
	global_load_b32 v7, v[7:8], off
.LBB7_21:                               ; %.sink.split190
	s_or_b32 exec_lo, exec_lo, s18
	s_waitcnt vmcnt(0)
	ds_store_b32 v6, v7
.LBB7_22:                               ; %Flow256
	s_or_b32 exec_lo, exec_lo, s17
	s_or_b32 s4, s3, s4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_xor_b32 s4, s4, -1
	s_and_saveexec_b32 s17, s4
	s_cbranch_execz .LBB7_26
; %bb.23:
	s_add_i32 s5, s8, -1
	v_cmp_lt_i32_e64 s4, 0, v4
	v_cmp_gt_i32_e64 s5, s5, v3
	v_dual_mov_b32 v6, 0 :: v_dual_mov_b32 v7, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s4, s4, s5
	s_and_b32 s2, s2, s4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s4, s2
	s_cbranch_execz .LBB7_25
; %bb.24:
	v_subrev_nc_u32_e32 v7, s8, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v8, 31, v7
	v_lshlrev_b64 v[7:8], 2, v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v7, s2, s12, v7
	v_add_co_ci_u32_e64 v8, s2, s13, v8, s2
	global_load_b32 v7, v[7:8], off offset:4
.LBB7_25:                               ; %.sink.split192
	s_or_b32 exec_lo, exec_lo, s4
	s_waitcnt vmcnt(0)
	ds_store_b32 v6, v7 offset:132
.LBB7_26:                               ; %Flow255
	s_or_b32 exec_lo, exec_lo, s17
	s_or_b32 s2, s3, s1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_xor_b32 s2, s2, -1
	s_and_saveexec_b32 s4, s2
	s_cbranch_execz .LBB7_30
; %bb.27:
	s_add_i32 s2, s9, -1
	s_add_i32 s3, s8, -1
	v_cmp_gt_i32_e64 s2, s2, v4
	v_cmp_gt_i32_e64 s3, s3, v3
	v_dual_mov_b32 v6, 0 :: v_dual_mov_b32 v7, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, s3
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB7_29
; %bb.28:
	v_add_nc_u32_e32 v7, s8, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v8, 31, v7
	v_lshlrev_b64 v[7:8], 2, v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v7, s2, s12, v7
	v_add_co_ci_u32_e64 v8, s2, s13, v8, s2
	global_load_b32 v7, v[7:8], off offset:4
.LBB7_29:                               ; %.sink.split194
	s_or_b32 exec_lo, exec_lo, s3
	s_waitcnt vmcnt(0)
	ds_store_b32 v6, v7 offset:4620
.LBB7_30:                               ; %Flow254
	s_or_b32 exec_lo, exec_lo, s4
	s_or_b32 s0, s0, s1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_xor_b32 s0, s0, -1
	s_and_saveexec_b32 s2, s0
	s_cbranch_execz .LBB7_34
; %bb.31:
	s_add_i32 s1, s9, -1
	v_cmp_gt_i32_e64 s0, 1, v3
	v_cmp_le_i32_e64 s1, s1, v4
	s_xor_b32 s3, vcc_lo, -1
	v_dual_mov_b32 v3, 0 :: v_dual_mov_b32 v4, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s0, s0, s1
	s_or_b32 s0, s0, s3
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_xor_b32 s1, s0, -1
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB7_33
; %bb.32:
	v_add_nc_u32_e32 v6, s8, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v7, 31, v6
	v_lshlrev_b64 v[6:7], 2, v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v6, vcc_lo, s12, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s13, v7, vcc_lo
	global_load_b32 v4, v[6:7], off offset:-4
.LBB7_33:                               ; %.sink.split196
	s_or_b32 exec_lo, exec_lo, s0
	s_waitcnt vmcnt(0)
	ds_store_b32 v3, v4 offset:4488
.LBB7_34:                               ; %Flow253
	s_or_b32 exec_lo, exec_lo, s2
	s_cmp_lt_i32 s10, 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB7_64
; %bb.35:                               ; %.lr.ph
	v_lshlrev_b64 v[6:7], 2, v[1:2]
	v_mad_u32_u24 v4, 0x88, v0, v5
	v_mul_f32_e64 v2, s16, s7
	v_mul_f32_e64 v3, s16, s11
	v_mov_b32_e32 v5, 1.0
	v_add_co_u32 v0, vcc_lo, s14, v6
	v_mov_b32_e32 v6, 0
	v_add_co_ci_u32_e32 v1, vcc_lo, s15, v7, vcc_lo
.LBB7_36:                               ; =>This Inner Loop Header: Depth=1
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s4, s6
	s_cbranch_execz .LBB7_63
; %bb.37:                               ;   in Loop: Header=BB7_36 Depth=1
	ds_load_b32 v7, v4 offset:140
	s_mov_b32 s0, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmpx_nlt_f32_e32 v7, v2
	s_xor_b32 s5, exec_lo, s0
	s_cbranch_execz .LBB7_61
; %bb.38:                               ;   in Loop: Header=BB7_36 Depth=1
	s_mov_b32 s0, exec_lo
	v_cmpx_ge_f32_e32 v7, v3
	s_xor_b32 s0, exec_lo, s0
	s_cbranch_execz .LBB7_40
; %bb.39:                               ;   in Loop: Header=BB7_36 Depth=1
	global_store_b32 v[0:1], v5, off
.LBB7_40:                               ; %Flow247
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_and_not1_saveexec_b32 s7, s0
	s_cbranch_execz .LBB7_60
; %bb.41:                               ;   in Loop: Header=BB7_36 Depth=1
	ds_load_b32 v7, v4
	s_mov_b32 s0, 0
	s_mov_b32 s9, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmp_ge_f32_e64 s8, v7, v3
	v_cmpx_nge_f32_e32 v7, v3
	s_cbranch_execz .LBB7_55
; %bb.42:                               ;   in Loop: Header=BB7_36 Depth=1
	ds_load_b32 v7, v4 offset:4
	s_mov_b32 s1, 0
	s_mov_b32 s11, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmp_ge_f32_e32 vcc_lo, v7, v3
	v_cmpx_nge_f32_e32 v7, v3
	s_cbranch_execz .LBB7_54
; %bb.43:                               ;   in Loop: Header=BB7_36 Depth=1
	ds_load_b32 v7, v4 offset:8
	s_mov_b32 s2, 0
	s_mov_b32 s12, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmp_ge_f32_e64 s0, v7, v3
	v_cmpx_nge_f32_e32 v7, v3
	s_cbranch_execz .LBB7_53
; %bb.44:                               ;   in Loop: Header=BB7_36 Depth=1
	ds_load_b32 v7, v4 offset:136
	s_mov_b32 s3, 0
	s_mov_b32 s13, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmp_ge_f32_e64 s1, v7, v3
	v_cmpx_nge_f32_e32 v7, v3
	s_cbranch_execz .LBB7_52
; %bb.45:                               ;   in Loop: Header=BB7_36 Depth=1
	ds_load_b32 v7, v4 offset:144
	s_mov_b32 s15, 0
	s_mov_b32 s14, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmp_ge_f32_e64 s2, v7, v3
	v_cmpx_nge_f32_e32 v7, v3
	s_cbranch_execz .LBB7_51
; %bb.46:                               ;   in Loop: Header=BB7_36 Depth=1
	ds_load_b32 v7, v4 offset:272
	s_mov_b32 s17, 0
	s_mov_b32 s16, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmp_ge_f32_e64 s15, v7, v3
	v_cmpx_nge_f32_e32 v7, v3
	s_cbranch_execz .LBB7_50
; %bb.47:                               ;   in Loop: Header=BB7_36 Depth=1
	ds_load_b32 v7, v4 offset:276
	s_mov_b32 s18, 0
	s_mov_b32 s19, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmp_ge_f32_e64 s17, v7, v3
	v_cmpx_nge_f32_e32 v7, v3
	s_cbranch_execz .LBB7_49
; %bb.48:                               ;   in Loop: Header=BB7_36 Depth=1
	ds_load_b32 v7, v4 offset:280
	s_and_not1_b32 s17, s17, exec_lo
	s_mov_b32 s18, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmp_ge_f32_e64 s3, v7, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s3, s3, exec_lo
	s_or_b32 s17, s17, s3
.LBB7_49:                               ; %Flow244
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_or_b32 exec_lo, exec_lo, s19
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s3, s15, exec_lo
	s_and_b32 s15, s17, exec_lo
	s_and_b32 s17, s18, exec_lo
	s_or_b32 s15, s3, s15
.LBB7_50:                               ; %Flow243
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_or_b32 exec_lo, exec_lo, s16
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s2, s2, exec_lo
	s_and_b32 s3, s15, exec_lo
	s_and_b32 s15, s17, exec_lo
	s_or_b32 s2, s2, s3
.LBB7_51:                               ; %Flow242
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_or_b32 exec_lo, exec_lo, s14
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s1, s1, exec_lo
	s_and_b32 s2, s2, exec_lo
	s_and_b32 s3, s15, exec_lo
	s_or_b32 s1, s1, s2
.LBB7_52:                               ; %Flow241
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s0, s0, exec_lo
	s_and_b32 s1, s1, exec_lo
	s_and_b32 s2, s3, exec_lo
	s_or_b32 s0, s0, s1
.LBB7_53:                               ; %Flow240
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s3, vcc_lo, exec_lo
	s_and_b32 s0, s0, exec_lo
	s_and_b32 s1, s2, exec_lo
	s_or_b32 vcc_lo, s3, s0
.LBB7_54:                               ; %Flow239
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_or_b32 exec_lo, exec_lo, s11
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s2, s8, exec_lo
	s_and_b32 s3, vcc_lo, exec_lo
	s_and_b32 s0, s1, exec_lo
	s_or_b32 s8, s2, s3
.LBB7_55:                               ; %Flow
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_or_b32 exec_lo, exec_lo, s9
	s_delay_alu instid0(VALU_DEP_2)
	s_and_saveexec_b32 s1, s8
	s_cbranch_execz .LBB7_57
; %bb.56:                               ;   in Loop: Header=BB7_36 Depth=1
	s_and_not1_b32 s0, s0, exec_lo
	global_store_b32 v[0:1], v5, off
	ds_store_b32 v4, v3 offset:140
.LBB7_57:                               ; %Flow245
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB7_59
; %bb.58:                               ;   in Loop: Header=BB7_36 Depth=1
	global_store_b32 v[0:1], v6, off
	ds_store_b32 v4, v3 offset:140
.LBB7_59:                               ; %Flow246
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
.LBB7_60:                               ; %Flow248
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s7
.LBB7_61:                               ; %Flow249
                                        ;   in Loop: Header=BB7_36 Depth=1
	s_and_not1_saveexec_b32 s0, s5
	s_cbranch_execz .LBB7_63
; %bb.62:                               ;   in Loop: Header=BB7_36 Depth=1
	global_store_b32 v[0:1], v6, off
.LBB7_63:                               ;   in Loop: Header=BB7_36 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
	s_add_i32 s10, s10, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s10, 0
	s_cbranch_scc0 .LBB7_36
.LBB7_64:                               ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z18edgeTraceOptimizedPfS_S_iiiff
		.amdhsa_group_segment_fixed_size 4624
		.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 9
		.amdhsa_next_free_sgpr 20
		.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_end7:
	.size	_Z18edgeTraceOptimizedPfS_S_iiiff, .Lfunc_end7-_Z18edgeTraceOptimizedPfS_S_iiiff
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1992
; NumSgprs: 22
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4624 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii ; -- Begin function _Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii
	.globl	_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii
	.p2align	8
	.type	_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii,@function
_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii: ; @_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b128 s[4:7], s[0:1], 0x10
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v0, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[2:3], null, s14, s2, v[1:2]
	v_mad_u64_u32 v[3:4], null, s15, s3, v[0:1]
	v_cmp_gt_i32_e32 vcc_lo, s4, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e64 s2, s5, v3
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB8_6
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x0
	v_mad_u64_u32 v[0:1], null, v3, s4, v[2:3]
	s_cmp_eq_u32 s6, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_lshlrev_b64 v[1:2], 2, v[0:1]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, s0, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v2, vcc_lo
	s_mov_b32 s0, 0
	global_load_b32 v1, v[1:2], off
	s_cbranch_scc1 .LBB8_3
; %bb.2:
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v2, 0x437f0000, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cvt_i32_f32_e32 v4, v2
	v_mad_i64_i32 v[2:3], null, v0, 3, s[2:3]
	v_lshlrev_b16 v5, 8, v4
	s_delay_alu instid0(VALU_DEP_1)
	v_or_b32_e32 v5, v4, v5
	s_clause 0x1
	global_store_b8 v[2:3], v4, off offset:2
	global_store_b16 v[2:3], v5, off
	s_branch .LBB8_4
.LBB8_3:
	s_mov_b32 s0, -1
.LBB8_4:                                ; %Flow
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s0
	s_cbranch_vccnz .LBB8_6
; %bb.5:
	s_waitcnt vmcnt(0)
	v_sub_f32_e32 v1, 1.0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v1, 0x437f0000, v1
	v_cvt_i32_f32_e32 v3, v1
	v_mad_i64_i32 v[1:2], null, v0, 3, s[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b16 v4, 8, v3
	v_or_b32_e32 v0, v3, v4
	s_clause 0x1
	global_store_b8 v[1:2], v3, off offset:2
	global_store_b16 v[1:2], v0, off
.LBB8_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii
		.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 6
		.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_end8:
	.size	_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii, .Lfunc_end8-_Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 340
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; 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
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 4
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8genGaussPfif
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z8genGaussPfif.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     14
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z13rgb2grayscaleP15HIP_vector_typeIhLj3EEiiPf.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 100
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9gaussBlurPfS_iiS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9gaussBlurPfS_iiS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .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:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z12calcGradientPfS_S_S_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z12calcGradientPfS_S_S_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .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:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14nonMaxRestrainPfS_S_S_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z14nonMaxRestrainPfS_S_S_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     20
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         144
        .size:           4
        .value_kind:     hidden_dynamic_lds_size
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11findMaxGradPfiiS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11findMaxGradPfiiS_.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
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9edgeTracePfS_S_iiiff
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z9edgeTracePfS_S_iiiff.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     by_value
      - .offset:         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: 4624
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z18edgeTraceOptimizedPfS_S_iiiff
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z18edgeTraceOptimizedPfS_S_iiiff.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .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:           _Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9trans2BmpPfP15HIP_vector_typeIhLj3EEiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
