#include <stdio.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <curand_kernel.h>
#include <stdlib.h>
#include <math.h>
#include <sys/time.h>
#include <time.h>
#include <string.h>

#define PI 3.1415926536
#define e 2.718281828459

#define N 64*64
#define THREADS_PER_BLOCK 64

struct timeval tic(){
    struct timeval tv;
    gettimeofday(&tv,NULL);
    return tv;
}

typedef struct Patches
{
    int index;
    float central;
    float* patchArray;
}Patch;

double toc(struct timeval begin){
    struct timeval end;
    gettimeofday(&end,NULL);
    double stime = ((double)(end.tv_sec-begin.tv_sec)*1000)+((double)(end.tv_usec-begin.tv_usec)/1000);
    stime = stime / 1000;
    return (stime);
}

float* readFile(int n, int m, char *file_path){
    FILE* ptrFile = fopen(file_path, "r");

    float *I = (float*)malloc(n*m*sizeof(float));

    if (!ptrFile){
        printf("Error Reading File\n");
        exit (0);
    }

    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            fscanf(ptrFile,"%f,", &I[n*i+j]);
        }
    }

    fclose(ptrFile);

    return I;
}

void toTXT(float* array,char *output, int n, int m){
    FILE *fp;

    fp=fopen(output,"w");

    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            if(j<m-1){
                fprintf(fp,"%lf,",array[n*i+j]);
            }else if(j==m-1){
                fprintf(fp,"%lf",array[n*i+j]);
            }
        }
        fprintf(fp,"\n",array[n*i]);
    }
    fclose(fp);
    printf("File %s saved.\n", output);
}

__global__ void normalization(float* A, float* B, float min, float max){
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if(i<N)
        B[i] = (A[i] - min) / max;
}

float AWGN_generator()     //https://www.embeddedrelated.com/showcode/311.php
{/* Generates additive white Gaussian Noise samples with zero mean and a standard deviation of 1. */
  float dev = 0.03162; //var = 0.01
  float temp1;
  float temp2;
  float result;
  int p = 1;

  while( p > 0 )
  {
	temp2 = ( rand() / ( (float)RAND_MAX ) ); /*  rand() function generates an
                                                       integer between 0 and  RAND_MAX,
                                                       which is defined in stdlib.h.
                                                   */

    if ( temp2 == 0 )
    {// temp2 is >= (RAND_MAX / 2)
        p = 1;
    }// end if
    else
    {// temp2 is < (RAND_MAX / 2)
        p = -1;
    }// end else

  }// end while()

  temp1 = cos( ( 2.0 * (float)PI ) * rand() / ( (float)RAND_MAX ) );
  result = sqrt( -2.0 * log( temp2 ) ) * temp1;

  return result * dev;	// return the generated random sample to the caller

}// end AWGN_generator()

Patch* makePatches(float* J, int n, int m, Patch* allPatches, int patchSizeH, int patchSizeW){
    int mdW = (patchSizeW - 1)/2;
    int mdH = (patchSizeH - 1)/2;
    
    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){

            for(int w=0; w<patchSizeW; w++){
                for(int h=0; h<patchSizeH; h++){
                    allPatches[n*j+i].patchArray[patchSizeH*w+h] = 0;
                }
            }

            allPatches[n*j+i].central = J[n*j+i];
            allPatches[n*j+i].index = n*j+i;

            if(i==0 && j==0){
                for(int w=mdW; w<patchSizeW; w++){
                    for(int h=mdH; h<patchSizeH; h++){
                        allPatches[n*j+i].patchArray[patchSizeH*w+h] = J[(n*j+i)-(mdW-w)*n-(mdH-h)];
                    }
                } 
            }else if(i>0 && j==0){
                for(int h=0; h<patchSizeH-1; h++){
                    for(int w=0; w<patchSizeW; w++){
                        allPatches[n*j+i].patchArray[patchSizeH*w+h] = allPatches[n*j+(i-1)].patchArray[patchSizeH*w+(h+1)];
                    }
                }
               

                for(int w=mdW; w<patchSizeW; w++){
                    if((n-1-i) >= mdH){
                        allPatches[n*j+i].patchArray[patchSizeH*w+(patchSizeH-1)] = J[(n*j+i)-(mdW-w)*n+mdH];
                    }else if((n-1-i) < mdH){
                        allPatches[n*j+i].patchArray[patchSizeH*w+(patchSizeH-1)] = 0;
                    }
                }
            }else if(j>0){
                for(int w=0; w<patchSizeW-1; w++){
                    for(int h=0; h<patchSizeH; h++){
                        allPatches[n*j+i].patchArray[patchSizeH*w+h] = allPatches[n*(j-1)+i].patchArray[patchSizeH*(w+1)+h];
                    }
                }

                int a,b;
                if(i>=mdH && (n-1-i)>=mdH){
                    a = 0;
                    b = patchSizeH;
                }else if(i<mdH && (n-1-i)>=mdH){
                    a = mdH - i;
                    b = patchSizeH;
                }else if(i<mdH && (n-1-i)<mdH){
                    a = mdH - i;
                    b = mdH + (n-i);
                }else if(i>=mdH && (n-1-i)<mdH){
                    a = 0;
                    b = mdH + (n-i);
                }

                for(int h=a; h<b; h++){
                    if((m-1-j) >= mdW){
                        allPatches[n*j+i].patchArray[patchSizeH*(patchSizeW-1)+h] = J[(n*j+i)+mdW*n-(mdH-h)];
                    }else if((m-1-j) < mdW){
                        allPatches[n*j+i].patchArray[patchSizeH*(patchSizeW-1)+h] = 0;
                    }
                }
            }
        }
    }
    return allPatches;
}

float* computeG_a(int patchSizeH, int patchSizeW, float patchSigma){
    float* gauss = (float*)malloc(patchSizeH*patchSizeW*sizeof(float));
    
    for (int i = 0; i < patchSizeH; i++) {
        for (int j = 0; j < patchSizeW; j++) {
            float y = i - (patchSizeH - 1) / 2.0;
            float x = j - (patchSizeW - 1) / 2.0;
            gauss[patchSizeW*i+j] = (1/2.0) * exp(-(x * x + y * y) / (2.0 * PI * patchSigma * patchSigma));
        }
    }    
    return gauss;
}

__global__ void dist(float *W,float *p_i, float *P, float *V, int pSize, float filtSigma){
    float d = 0;
    int k = blockIdx.x * blockDim.x + threadIdx.x;

    if(k<N){
        for (int i = 0; i < pSize; i++) {
            d += V[i] * pow(p_i[i] - P[pSize*k+i],2);
        }
        d = sqrt(d);
        W[k] = exp(-pow(d,2) / filtSigma);
        d=0;
    }   
}

__global__ void dim(float *w, float *z){
    int i = blockIdx.x * blockDim.x + threadIdx.x;

    if(i<N){
        w[i] = w[i] / *z;
    }
}

int main(int argc, char *argv[]){
    int n = atoi(argv[1]);
    int m = atoi(argv[2]);
    int patchSizeH = atoi(argv[3]);
    int patchSizeW = atoi(argv[4]);

    char* file_path;
    file_path=(char*)malloc(strlen(argv[5])*sizeof(char));
    memcpy(file_path,argv[5],strlen(argv[5]));
       
    float patchSigma =5/3;
    float filtSigma =0.01 ;
    
    float *I, *I_norm, *J, *If;
    float *dev_I, *dev_I_norm, *dev_J, *dev_gauss;
    float *P, *dev_P, *w;

    int size = N * sizeof(float);
    int sizePatch = patchSizeH * patchSizeW * sizeof(float);
    int pSize = patchSizeH * patchSizeW;
    
    //allocate memory for device copies
    cudaMalloc(&dev_I, size);
    cudaMalloc(&dev_I_norm, size);
    cudaMalloc(&dev_J, size);
    cudaMalloc(&dev_gauss, sizePatch);
    cudaMalloc(&dev_P, N*pSize*sizeof(float));    

    I = (float*)malloc(size);
    I_norm = (float*)malloc(size);
    J = (float*)malloc(size);
    If = (float*)malloc(size);
    
    Patch* allPatches;
    allPatches = (Patch*)malloc(n*m*sizeof(Patch));

    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            allPatches[n*j+i].patchArray = (float*)malloc(patchSizeH*patchSizeW*sizeof(float));
        }
    }    

    w = (float*)malloc(N*N*sizeof(float));
    float* gauss = (float*)malloc(sizePatch);
    float* Z = (float*)malloc(size);

    struct timeval tStart;

    I = readFile(n,m,file_path);

    //find min of 'I' and max of 'I-min'
    float min = INFINITY;
    float max = -1.0;

    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            if(I[n*i+j]<min) min= I[n*i+j];
        }
    }    

    for(int i=0; i<n*m; i++){
        if((I[i]-min)>max) max = I[i]-min;
    }

    cudaMemcpy(dev_I, I, size, cudaMemcpyHostToDevice);
    normalization<<<N/THREADS_PER_BLOCK,THREADS_PER_BLOCK>>>(dev_I, dev_I_norm, min, max);
    cudaMemcpy(I_norm, dev_I_norm, size, cudaMemcpyDeviceToHost);
   
    for(int i=0; i<n*m; i++){
        J[i] = I_norm[i] + AWGN_generator();
    }

    toTXT(I_norm,"normCuda.txt",n,m);
    toTXT(J,"JCuda.txt",n,m);

    allPatches = makePatches(J,n,m,allPatches,patchSizeH,patchSizeW);

    //pass all the elements of 'allPatches' to 'P' array(NxpSize)
    P = (float*)malloc(N*pSize*sizeof(float));
    for(int i=0; i<N; i++){
        for(int j=0; j<pSize; j++){
            P[pSize*i+j] = allPatches[i].patchArray[j];
        }
    }

    cudaMemcpy(dev_P, P, N*sizePatch, cudaMemcpyHostToDevice);
    
    gauss = computeG_a(patchSizeH, patchSizeW, patchSigma);
    cudaMemcpy(dev_gauss, gauss, sizePatch, cudaMemcpyHostToDevice);

    float *patch_i = (float*)malloc(sizePatch);
    float *dev_patchI;
    cudaMalloc(&dev_patchI, sizePatch);
    float *wi_j = (float*)malloc(N*sizeof(float));
    float *dev_wij;
    cudaMalloc(&dev_wij, N*sizeof(float));

    tStart = tic();

    for(int i=0; i<N; i++){ 
        for(int j=0; j<pSize; j++){ 
            patch_i[j] = P[pSize*i +j];
        }
        cudaMemcpy(dev_patchI, patch_i, sizePatch, cudaMemcpyHostToDevice);
        dist<<<N/THREADS_PER_BLOCK,THREADS_PER_BLOCK>>>(dev_wij, dev_patchI,dev_P, dev_gauss,pSize,filtSigma);
        cudaMemcpy(wi_j, dev_wij, size, cudaMemcpyDeviceToHost);
        for(int j=0; j<N;j++){
            Z[i] += wi_j[j]; 
            w[N*i+j] = wi_j[j];
        }
    }
    cudaFree(dev_patchI);
    cudaFree(dev_gauss);
    
    float *dev_Z;
    cudaMalloc(&dev_Z, sizeof(float));
    for(int i=0; i<N; i++){
        for(int j=0; j<N;j++){
            wi_j[j] = w[N*i+j];
        }
        cudaMemcpy(dev_wij, wi_j,size, cudaMemcpyHostToDevice);
        cudaMemcpy(dev_Z, &Z[i], sizeof(float), cudaMemcpyHostToDevice);
        dim<<<N/THREADS_PER_BLOCK,THREADS_PER_BLOCK>>>(dev_wij,dev_Z);
        cudaMemcpy(wi_j, dev_wij, size,cudaMemcpyDeviceToHost);
        for(int j=0; j<N;j++){
            w[N*i+j] = wi_j[j];
            If[i] += w[N*i+j] * J[j];
        }
    }
    double time = toc(tStart);

    toTXT(If,"IfCuda.txt",n,m);
    
    float* Dif = (float*)malloc(N*sizeof(float));
    for(int i=0; i<N; i++){
        Dif[i] =If[i] - J[i];
    }  

    toTXT(Dif,"DifCuda.txt",n,m);

    printf("Time: %f sec", time);    

    cudaFree(dev_I); cudaFree(dev_I_norm); cudaFree(dev_J); cudaFree(dev_P); cudaFree(dev_wij); cudaFree(dev_Z); 
    free(I); free(I_norm); free(J); free(patch_i); free(gauss); free(wi_j); free(Z); free(If); free(Dif); free(w);
    free(allPatches->patchArray);
    free(allPatches);
    return 0;
}
	.file	"tmpxft_00397fd4_00000000-6_v1.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2251:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2251:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0, @function
_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0:
.LFB2397:
	.cfi_startproc
	jmp	cudaMalloc@PLT
	.cfi_endproc
.LFE2397:
	.size	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0, .-_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	.globl	_Z3ticv
	.type	_Z3ticv, @function
_Z3ticv:
.LFB2241:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	gettimeofday@PLT
	movq	8(%rsp), %rax
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rcx
	subq	%fs:40, %rcx
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2241:
	.size	_Z3ticv, .-_Z3ticv
	.globl	_Z3toc7timeval
	.type	_Z3toc7timeval, @function
_Z3toc7timeval:
.LFB2242:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rsi, %rbx
	xorl	%esi, %esi
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	gettimeofday@PLT
	movq	8(%rsp), %rax
	movsd	.LC0(%rip), %xmm1
	subq	%rbp, %rax
	cvtsi2sdq	%rax, %xmm0
	movq	16(%rsp), %rax
	subq	%rbx, %rax
	cvtsi2sdq	%rax, %xmm2
	mulsd	%xmm1, %xmm0
	divsd	%xmm1, %xmm2
	addsd	%xmm2, %xmm0
	divsd	%xmm1, %xmm0
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	addq	$40, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2242:
	.size	_Z3toc7timeval, .-_Z3toc7timeval
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"r"
.LC2:
	.string	"Error Reading File\n"
.LC3:
	.string	"%f,"
	.text
	.globl	_Z8readFileiiPc
	.type	_Z8readFileiiPc, @function
_Z8readFileiiPc:
.LFB2243:
	.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
	movl	%esi, %r12d
	leaq	.LC1(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edi, %ebp
	movq	%rdx, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	fopen@PLT
	movl	%ebp, %edi
	imull	%r12d, %edi
	movq	%rax, %rbx
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	testq	%rbx, %rbx
	je	.L11
	movq	%rax, %r13
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L12
.L11:
	movl	$2, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%edi, %edi
	call	exit@PLT
.L17:
	incl	%r8d
	addl	%ebp, %ecx
.L12:
	cmpl	%ebp, %r8d
	jge	.L14
	movslq	%ecx, %rax
	xorl	%r14d, %r14d
	leaq	0(%r13,%rax,4), %r15
.L15:
	cmpl	%r12d, %r14d
	jge	.L17
	movq	%r15, %rdx
	leaq	.LC3(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	%ecx, 12(%rsp)
	incl	%r14d
	addq	$4, %r15
	movl	%r8d, 8(%rsp)
	call	__isoc23_fscanf@PLT
	movl	12(%rsp), %ecx
	movl	8(%rsp), %r8d
	jmp	.L15
.L14:
	movq	%rbx, %rdi
	call	fclose@PLT
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	movq	%r13, %rax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2243:
	.size	_Z8readFileiiPc, .-_Z8readFileiiPc
	.section	.rodata.str1.1
.LC4:
	.string	"w"
.LC5:
	.string	"%lf,"
.LC6:
	.string	"%lf"
.LC7:
	.string	"\n"
.LC8:
	.string	"File %s saved.\n"
	.text
	.globl	_Z5toTXTPfPcii
	.type	_Z5toTXTPfPcii, @function
_Z5toTXTPfPcii:
.LFB2244:
	.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
	movl	%ecx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	movq	%rbp, %r15
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rsi, 16(%rsp)
	movq	16(%rsp), %rdi
	leaq	.LC4(%rip), %rsi
	call	fopen@PLT
	movq	%rax, (%rsp)
	movslq	%ebx, %rax
	salq	$2, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movl	%eax, 12(%rsp)
.L19:
	cmpl	%ebx, 12(%rsp)
	jge	.L27
	xorl	%r14d, %r14d
.L23:
	cmpl	%r13d, %r14d
	jge	.L28
	leal	-1(%r13), %eax
	cmpl	%r14d, %eax
	jle	.L20
	leal	(%r14,%r12), %eax
	leaq	.LC5(%rip), %rdx
	cltq
	cvtss2sd	0(%rbp,%rax,4), %xmm0
	jmp	.L26
.L20:
	jne	.L21
	leal	(%r14,%r12), %eax
	leaq	.LC6(%rip), %rdx
	cltq
	cvtss2sd	0(%rbp,%rax,4), %xmm0
.L26:
	movq	(%rsp), %rdi
	movl	$2, %esi
	movb	$1, %al
	call	__fprintf_chk@PLT
.L21:
	incl	%r14d
	jmp	.L23
.L28:
	movq	(%rsp), %rdi
	leaq	.LC7(%rip), %rdx
	movb	$1, %al
	addl	%ebx, %r12d
	movl	$2, %esi
	cvtss2sd	(%r15), %xmm0
	call	__fprintf_chk@PLT
	movq	24(%rsp), %rax
	incl	12(%rsp)
	addq	%rax, %r15
	jmp	.L19
.L27:
	movq	(%rsp), %rdi
	call	fclose@PLT
	movq	16(%rsp), %rdx
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	movl	$2, %edi
	popq	%rbx
	.cfi_def_cfa_offset 48
	leaq	.LC8(%rip), %rsi
	popq	%rbp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	.cfi_endproc
.LFE2244:
	.size	_Z5toTXTPfPcii, .-_Z5toTXTPfPcii
	.globl	_Z14AWGN_generatorv
	.type	_Z14AWGN_generatorv, @function
_Z14AWGN_generatorv:
.LFB2245:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
.L30:
	call	rand@PLT
	xorps	%xmm0, %xmm0
	cvtsi2ssl	%eax, %xmm2
	mulss	.LC13(%rip), %xmm2
	ucomiss	%xmm0, %xmm2
	jp	.L32
	je	.L30
.L32:
	movss	%xmm2, 12(%rsp)
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC9(%rip), %xmm0
	mulsd	.LC10(%rip), %xmm0
	call	cos@PLT
	movss	12(%rsp), %xmm2
	movsd	%xmm0, (%rsp)
	movaps	%xmm2, %xmm0
	call	logf@PLT
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LC11(%rip), %xmm0
	call	sqrt@PLT
	movsd	(%rsp), %xmm1
	movaps	%xmm0, %xmm2
	cvtsd2ss	%xmm1, %xmm1
	cvtss2sd	%xmm1, %xmm0
	mulsd	%xmm2, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	mulss	.LC12(%rip), %xmm0
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2245:
	.size	_Z14AWGN_generatorv, .-_Z14AWGN_generatorv
	.globl	_Z11makePatchesPfiiP7Patchesii
	.type	_Z11makePatchesPfiiP7Patchesii, @function
_Z11makePatchesPfiiP7Patchesii:
.LFB2246:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	-1(%r9), %eax
	movl	%r9d, %r15d
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	movl	%edx, -52(%rsp)
	cltd
	movq	%rdi, -112(%rsp)
	movq	%rcx, %rdi
	movl	$2, %ecx
	movl	%eax, -96(%rsp)
	movl	-96(%rsp), %r10d
	idivl	%ecx
	imull	%r8d, %r10d
	movl	%eax, -116(%rsp)
	leal	-1(%r8), %eax
	movl	-116(%rsp), %r9d
	cltd
	movl	%eax, -92(%rsp)
	idivl	%ecx
	movl	%esi, %ecx
	imull	%esi, %r9d
	movslq	%esi, %rdx
	negl	%ecx
	movl	%ecx, -120(%rsp)
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	%rcx, -32(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r8d, %rdx
	movq	%rcx, -24(%rsp)
	leaq	0(,%rdx,4), %rcx
	movl	-116(%rsp), %edx
	movq	%rcx, -88(%rsp)
	movslq	-92(%rsp), %rcx
	imull	%r8d, %edx
	movl	%edx, -72(%rsp)
	movslq	%edx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	movslq	%r10d, %rdx
	movq	%rdx, -8(%rsp)
	movl	-52(%rsp), %edx
	subl	%eax, %r9d
	movq	%rcx, -48(%rsp)
	xorl	%ecx, %ecx
	decl	%edx
	movl	%edx, (%rsp)
	movl	%r9d, 4(%rsp)
.L37:
	movl	%ecx, -12(%rsp)
	movl	%ecx, -16(%rsp)
	movl	%ecx, -56(%rsp)
	cmpl	%ecx, %esi
	jle	.L78
	movq	-112(%rsp), %rbx
	movslq	-120(%rsp), %r10
	movq	%rcx, %rdx
	xorl	%r9d, %r9d
	movl	%ecx, -104(%rsp)
	salq	$4, %rdx
	leaq	(%rbx,%rcx,4), %rbx
	movq	%rdx, -64(%rsp)
	addq	%rdi, %rdx
	movq	%rbx, -80(%rsp)
	movl	%r10d, %ebx
	notl	%ebx
	movl	%ebx, -100(%rsp)
.L45:
	movl	-52(%rsp), %ebx
	cmpl	%ebx, %r9d
	jge	.L67
	leal	(%rsi,%r10), %ebx
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	movslq	%ebx, %r11
	movl	%ebx, -68(%rsp)
	salq	$4, %r11
	addq	%rdi, %r11
.L68:
	cmpl	%r15d, %ebp
	jge	.L39
	movslq	%r12d, %rbx
	xorl	%r13d, %r13d
	salq	$2, %rbx
.L40:
	cmpl	%r8d, %r13d
	jge	.L88
	movq	8(%r11), %r14
	incl	%r13d
	movl	$0x00000000, (%r14,%rbx)
	addq	$4, %rbx
	jmp	.L40
.L88:
	incl	%ebp
	addl	%r8d, %r12d
	jmp	.L68
.L39:
	movq	-80(%rsp), %rbx
	movss	(%rbx), %xmm0
	movl	-104(%rsp), %ebx
	movl	%ebx, (%rdx)
	movl	-16(%rsp), %ebx
	movss	%xmm0, 4(%rdx)
	orl	%r9d, %ebx
	jne	.L83
	movl	-72(%rsp), %r11d
	movl	-116(%rsp), %r12d
	xorl	%ebp, %ebp
.L41:
	cmpl	%r15d, %r12d
	jl	.L44
.L56:
	movq	-32(%rsp), %rbx
	movq	-24(%rsp), %r14
	incl	%r9d
	addq	%r14, -80(%rsp)
	movslq	-68(%rsp), %r10
	addl	%esi, -104(%rsp)
	addq	%rbx, %rdx
	jmp	.L45
.L44:
	movq	-112(%rsp), %r14
	movslq	%ebp, %rbx
	movslq	%eax, %r10
	leaq	(%r14,%rbx,4), %rbx
	movslq	%r11d, %r14
	movq	%r14, -40(%rsp)
.L46:
	cmpl	%r10d, %r8d
	jle	.L89
	movq	-40(%rsp), %r14
	movss	(%rbx), %xmm0
	addq	$4, %rbx
	addq	%r10, %r14
	incq	%r10
	movq	%r14, %r13
	movq	8(%rdx), %r14
	movss	%xmm0, (%r14,%r13,4)
	jmp	.L46
.L89:
	incl	%r12d
	addl	%esi, %ebp
	addl	%r8d, %r11d
	jmp	.L41
.L83:
	cmpl	$0, -56(%rsp)
	jle	.L49
	testl	%r9d, %r9d
	jne	.L84
	xorl	%r11d, %r11d
.L47:
	cmpl	%r11d, -92(%rsp)
	jle	.L51
	leaq	0(,%r11,4), %r10
	xorl	%ebx, %ebx
.L52:
	cmpl	%r15d, %ebx
	jge	.L90
	movq	-64(%rsp), %r14
	incl	%ebx
	movq	-8(%rdi,%r14), %rbp
	movq	-88(%rsp), %r14
	movss	4(%rbp,%r10), %xmm0
	movq	8(%rdx), %rbp
	movss	%xmm0, 0(%rbp,%r10)
	addq	%r14, %r10
	jmp	.L52
.L90:
	incq	%r11
	jmp	.L47
.L51:
	movl	-104(%rsp), %ebx
	movq	-48(%rsp), %r11
	movl	-116(%rsp), %r10d
	addl	%eax, %ebx
.L53:
	cmpl	%r15d, %r10d
	jge	.L56
	movq	8(%rdx), %rbp
	movl	-100(%rsp), %r14d
	xorps	%xmm0, %xmm0
	addq	%r11, %rbp
	cmpl	%r14d, %eax
	jg	.L54
	movq	-112(%rsp), %r14
	movslq	%ebx, %r12
	movss	(%r14,%r12,4), %xmm0
.L54:
	movq	-88(%rsp), %r14
	movss	%xmm0, 0(%rbp)
	incl	%r10d
	addl	%esi, %ebx
	addq	%r14, %r11
	jmp	.L53
.L49:
	testl	%r9d, %r9d
	je	.L56
.L84:
	salq	$4, %r10
	xorl	%r12d, %r12d
	leaq	(%rdi,%r10), %r11
	xorl	%r10d, %r10d
.L57:
	cmpl	%r12d, -96(%rsp)
	jle	.L59
	leal	(%r8,%r10), %r13d
	xorl	%ebp, %ebp
	salq	$2, %r10
	movslq	%r13d, %rbx
	salq	$2, %rbx
.L60:
	cmpl	%r8d, %ebp
	jge	.L91
	movq	8(%r11), %r14
	incl	%ebp
	movss	(%r14,%rbx), %xmm0
	movq	8(%rdx), %r14
	addq	$4, %rbx
	movss	%xmm0, (%r14,%r10)
	addq	$4, %r10
	jmp	.L60
.L91:
	incl	%r12d
	movslq	%r13d, %r10
	jmp	.L57
.L59:
	movl	-56(%rsp), %ebx
	cmpl	%ebx, %eax
	jg	.L61
	movl	-100(%rsp), %ebx
	cmpl	%ebx, %eax
	jg	.L92
	movl	%r8d, %ebx
	jmp	.L87
.L61:
	movl	-12(%rsp), %ebx
	movl	-100(%rsp), %r14d
	movl	%eax, %r10d
	subl	%ebx, %r10d
	movl	%r8d, %ebx
	cmpl	%r14d, %eax
	jle	.L62
	movl	-120(%rsp), %r11d
	movl	%eax, %ebx
	subl	%r11d, %ebx
	jmp	.L62
.L92:
	movl	-120(%rsp), %r11d
	movl	%eax, %ebx
	subl	%r11d, %ebx
.L87:
	xorl	%r10d, %r10d
.L62:
	movq	-8(%rsp), %r14
	movslq	%r10d, %r11
	movl	(%rsp), %r12d
	movl	-104(%rsp), %ebp
	addq	%r14, %r11
	movl	4(%rsp), %r14d
	subl	%r9d, %r12d
	salq	$2, %r11
	leal	(%r14,%rbp), %r13d
.L64:
	cmpl	%r10d, %ebx
	jle	.L56
	movq	8(%rdx), %rbp
	xorps	%xmm0, %xmm0
	addq	%r11, %rbp
	movq	%rbp, -40(%rsp)
	cmpl	%r12d, -116(%rsp)
	jg	.L65
	movq	-112(%rsp), %r14
	leal	0(%r13,%r10), %ebp
	movslq	%ebp, %rbp
	movss	(%r14,%rbp,4), %xmm0
.L65:
	movq	-40(%rsp), %r14
	incl	%r10d
	addq	$4, %r11
	movss	%xmm0, (%r14)
	jmp	.L64
.L67:
	incl	-120(%rsp)
	incq	%rcx
	jmp	.L37
.L78:
	popq	%rdx
	.cfi_def_cfa_offset 56
	movq	%rdi, %rax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2246:
	.size	_Z11makePatchesPfiiP7Patchesii, .-_Z11makePatchesPfiiP7Patchesii
	.globl	_Z10computeG_aiif
	.type	_Z10computeG_aiif, @function
_Z10computeG_aiif:
.LFB2247:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edi, %r12d
	imull	%esi, %edi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%esi, %ebx
	movslq	%edi, %rdi
	salq	$2, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movss	%xmm0, 4(%rsp)
	call	malloc@PLT
	movq	%rax, %r13
.L94:
	cmpl	%r12d, %r14d
	jge	.L93
	movslq	%r15d, %rax
	xorl	%ebp, %ebp
	leaq	0(%r13,%rax,4), %rax
.L97:
	cmpl	%ebp, %ebx
	jle	.L99
	cvtsi2sdl	%r14d, %xmm1
	leal	-1(%r12), %edx
	movq	%rax, 8(%rsp)
	cvtsi2sdl	%edx, %xmm0
	mulsd	.LC15(%rip), %xmm0
	leal	-1(%rbx), %edx
	cvtsi2sdl	%edx, %xmm2
	mulsd	.LC15(%rip), %xmm2
	subsd	%xmm0, %xmm1
	cvtsi2sdl	%ebp, %xmm0
	cvtsd2ss	%xmm1, %xmm1
	mulss	%xmm1, %xmm1
	subsd	%xmm2, %xmm0
	cvtss2sd	4(%rsp), %xmm2
	cvtsd2ss	%xmm0, %xmm0
	mulss	%xmm0, %xmm0
	addss	%xmm1, %xmm0
	movaps	%xmm2, %xmm1
	xorps	.LC16(%rip), %xmm0
	mulsd	.LC17(%rip), %xmm2
	cvtss2sd	%xmm0, %xmm0
	mulsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm0
	call	exp@PLT
	mulsd	.LC15(%rip), %xmm0
	movq	8(%rsp), %rax
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%rax,%rbp,4)
	incq	%rbp
	jmp	.L97
.L99:
	incl	%r14d
	addl	%ebx, %r15d
	jmp	.L94
.L93:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	movq	%r13, %rax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2247:
	.size	_Z10computeG_aiif, .-_Z10computeG_aiif
	.globl	_Z37__device_stub__Z13normalizationPfS_ffPfS_ff
	.type	_Z37__device_stub__Z13normalizationPfS_ffPfS_ff, @function
_Z37__device_stub__Z13normalizationPfS_ffPfS_ff:
.LFB2273:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rcx
	leaq	40(%rsp), %rdx
	movq	%rsi, 16(%rsp)
	leaq	56(%rsp), %rdi
	leaq	68(%rsp), %rsi
	movss	%xmm0, 12(%rsp)
	movss	%xmm1, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L100
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z13normalizationPfS_ff(%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
.L100:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L102
	call	__stack_chk_fail@PLT
.L102:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2273:
	.size	_Z37__device_stub__Z13normalizationPfS_ffPfS_ff, .-_Z37__device_stub__Z13normalizationPfS_ffPfS_ff
	.globl	_Z13normalizationPfS_ff
	.type	_Z13normalizationPfS_ff, @function
_Z13normalizationPfS_ff:
.LFB2274:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z13normalizationPfS_ffPfS_ff
	.cfi_endproc
.LFE2274:
	.size	_Z13normalizationPfS_ff, .-_Z13normalizationPfS_ff
	.globl	_Z31__device_stub__Z4distPfS_S_S_ifPfS_S_S_if
	.type	_Z31__device_stub__Z4distPfS_S_S_ifPfS_S_S_if, @function
_Z31__device_stub__Z4distPfS_S_S_ifPfS_S_S_if:
.LFB2275:
	.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)
	movss	%xmm0, 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	.L105
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z4distPfS_S_S_if(%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
.L105:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L107
	call	__stack_chk_fail@PLT
.L107:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2275:
	.size	_Z31__device_stub__Z4distPfS_S_S_ifPfS_S_S_if, .-_Z31__device_stub__Z4distPfS_S_S_ifPfS_S_S_if
	.globl	_Z4distPfS_S_S_if
	.type	_Z4distPfS_S_S_if, @function
_Z4distPfS_S_S_if:
.LFB2276:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z4distPfS_S_S_ifPfS_S_S_if
	.cfi_endproc
.LFE2276:
	.size	_Z4distPfS_S_S_if, .-_Z4distPfS_S_S_if
	.globl	_Z24__device_stub__Z3dimPfS_PfS_
	.type	_Z24__device_stub__Z3dimPfS_PfS_, @function
_Z24__device_stub__Z3dimPfS_PfS_:
.LFB2277:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L110
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z3dimPfS_(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L110:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L112
	call	__stack_chk_fail@PLT
.L112:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2277:
	.size	_Z24__device_stub__Z3dimPfS_PfS_, .-_Z24__device_stub__Z3dimPfS_PfS_
	.globl	_Z3dimPfS_
	.type	_Z3dimPfS_, @function
_Z3dimPfS_:
.LFB2278:
	.cfi_startproc
	endbr64
	jmp	_Z24__device_stub__Z3dimPfS_PfS_
	.cfi_endproc
.LFE2278:
	.size	_Z3dimPfS_, .-_Z3dimPfS_
	.section	.rodata.str1.1
.LC20:
	.string	"normCuda.txt"
.LC21:
	.string	"JCuda.txt"
.LC24:
	.string	"IfCuda.txt"
.LC25:
	.string	"DifCuda.txt"
.LC26:
	.string	"Time: %f sec"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2248:
	.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
	movq	%rsi, %rbx
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	8(%rsi), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	call	atoi@PLT
	movq	16(%rbx), %rdi
	movl	%eax, (%rsp)
	call	atoi@PLT
	movq	24(%rbx), %rdi
	movl	%eax, 4(%rsp)
	call	atoi@PLT
	movq	32(%rbx), %rdi
	movl	%eax, 56(%rsp)
	call	atoi@PLT
	movq	40(%rbx), %rbp
	movl	%eax, 64(%rsp)
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rax, %rdi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, 48(%rsp)
	call	strlen@PLT
	movq	48(%rsp), %rdi
	movq	%r12, %rcx
	movq	%rbp, %rsi
	movq	%rax, %rdx
	call	__memcpy_chk@PLT
	movl	64(%rsp), %eax
	movl	56(%rsp), %r14d
	leaq	112(%rsp), %rdi
	movl	$16384, %esi
	imull	%eax, %r14d
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	leaq	120(%rsp), %rdi
	movl	$16384, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	leaq	128(%rsp), %rdi
	movl	$16384, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	leal	0(,%r14,4), %r15d
	leaq	136(%rsp), %rdi
	movslq	%r14d, %r12
	movslq	%r15d, %rax
	movq	%rax, %rsi
	movq	%rax, 24(%rsp)
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	%r14d, %eax
	leaq	144(%rsp), %rdi
	sall	$12, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rsi
	movq	%rax, 80(%rsp)
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	$16384, %edi
	call	malloc@PLT
	movl	$16384, %edi
	movq	%rax, 32(%rsp)
	call	malloc@PLT
	movl	$16384, %edi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movl	(%rsp), %ebp
	movq	%rax, 16(%rsp)
	movl	4(%rsp), %eax
	imull	%eax, %ebp
	movslq	%ebp, %rdi
	salq	$4, %rdi
	call	malloc@PLT
	movslq	(%rsp), %r13
	xorl	%ecx, %ecx
	movq	%rax, 88(%rsp)
	leaq	0(,%r12,4), %rax
	movq	%rax, 40(%rsp)
	salq	$4, %r13
.L116:
	cmpl	%ecx, (%rsp)
	jle	.L118
	movq	88(%rsp), %rax
	movq	%rcx, %rdx
	xorl	%r12d, %r12d
	salq	$4, %rdx
	leaq	(%rax,%rdx), %rbx
.L119:
	movl	4(%rsp), %eax
	cmpl	%eax, %r12d
	jge	.L153
	movq	40(%rsp), %rdi
	movq	%rcx, 72(%rsp)
	incl	%r12d
	call	malloc@PLT
	movq	72(%rsp), %rcx
	movq	%rax, 8(%rbx)
	addq	%r13, %rbx
	jmp	.L119
.L153:
	incq	%rcx
	jmp	.L116
.L118:
	movl	$67108864, %edi
	call	malloc@PLT
	movl	$16384, %edi
	movq	%rax, 72(%rsp)
	call	malloc@PLT
	movq	48(%rsp), %rdx
	movl	4(%rsp), %esi
	movl	(%rsp), %edi
	movq	%rax, 40(%rsp)
	call	_Z8readFileiiPc
	movss	.LC18(%rip), %xmm0
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%rax, 48(%rsp)
.L120:
	movl	(%rsp), %eax
	cmpl	%eax, %ecx
	jge	.L147
	movq	48(%rsp), %rbx
	movslq	%edx, %rax
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
.L124:
	cmpl	%eax, 4(%rsp)
	jle	.L154
	movss	(%rsi,%rax,4), %xmm1
	incq	%rax
	minss	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	jmp	.L124
.L154:
	movl	(%rsp), %eax
	incl	%ecx
	addl	%eax, %edx
	jmp	.L120
.L147:
	movss	.LC19(%rip), %xmm1
	xorl	%eax, %eax
.L123:
	cmpl	%eax, %ebp
	jle	.L155
	movq	48(%rsp), %rbx
	movss	(%rbx,%rax,4), %xmm2
	incq	%rax
	subss	%xmm0, %xmm2
	maxss	%xmm1, %xmm2
	movaps	%xmm2, %xmm1
	jmp	.L123
.L155:
	movq	48(%rsp), %rsi
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movl	$16384, %edx
	movss	%xmm1, 104(%rsp)
	movss	%xmm0, 96(%rsp)
	call	cudaMemcpy@PLT
	movl	$67108865, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$6, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movl	$1, 196(%rsp)
	movq	%rdi, %rdx
	movq	%rdi, 188(%rsp)
	movq	%rdi, 176(%rsp)
	movl	$1, 184(%rsp)
	call	__cudaPushCallConfiguration@PLT
	movss	96(%rsp), %xmm0
	movss	104(%rsp), %xmm1
	testl	%eax, %eax
	jne	.L127
	movq	120(%rsp), %rsi
	movq	112(%rsp), %rdi
	call	_Z37__device_stub__Z13normalizationPfS_ffPfS_ff
.L127:
	movq	120(%rsp), %rsi
	movq	32(%rsp), %rdi
	movl	$2, %ecx
	xorl	%ebx, %ebx
	movl	$16384, %edx
	call	cudaMemcpy@PLT
.L128:
	cmpl	%ebx, %ebp
	jle	.L156
	movq	32(%rsp), %rax
	movss	(%rax,%rbx,4), %xmm3
	movss	%xmm3, 96(%rsp)
	call	_Z14AWGN_generatorv
	addss	96(%rsp), %xmm0
	movq	8(%rsp), %rax
	movss	%xmm0, (%rax,%rbx,4)
	incq	%rbx
	jmp	.L128
.L156:
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	leaq	.LC20(%rip), %rsi
	movq	32(%rsp), %rdi
	call	_Z5toTXTPfPcii
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	leaq	.LC21(%rip), %rsi
	movq	8(%rsp), %rdi
	call	_Z5toTXTPfPcii
	movq	88(%rsp), %rcx
	movl	4(%rsp), %edx
	movl	64(%rsp), %r9d
	movl	56(%rsp), %r8d
	movl	(%rsp), %esi
	movq	8(%rsp), %rdi
	call	_Z11makePatchesPfiiP7Patchesii
	movq	80(%rsp), %rdi
	movq	%rax, %r12
	call	malloc@PLT
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%rax, 80(%rsp)
.L130:
	movq	80(%rsp), %rbx
	movslq	%ecx, %rax
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
.L133:
	cmpl	%eax, %r14d
	jle	.L157
	movq	8(%r12,%rdx), %rdi
	movss	(%rdi,%rax,4), %xmm0
	movss	%xmm0, (%rsi,%rax,4)
	incq	%rax
	jmp	.L133
.L157:
	addq	$16, %rdx
	addl	%r14d, %ecx
	cmpq	$65536, %rdx
	jne	.L130
	movq	80(%rsp), %rsi
	sall	$12, %r15d
	movl	$1, %ecx
	xorl	%ebp, %ebp
	movq	144(%rsp), %rdi
	movslq	%r15d, %rdx
	movabsq	$4294967360, %r15
	call	cudaMemcpy@PLT
	movl	64(%rsp), %esi
	movl	56(%rsp), %edi
	movss	.LC22(%rip), %xmm0
	call	_Z10computeG_aiif
	movq	24(%rsp), %rdx
	movl	$1, %ecx
	movq	136(%rsp), %rdi
	movq	%rax, %rsi
	movq	%rax, 64(%rsp)
	call	cudaMemcpy@PLT
	movq	24(%rsp), %rdi
	call	malloc@PLT
	movq	24(%rsp), %rsi
	leaq	152(%rsp), %rdi
	movq	%rax, 56(%rsp)
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	$16384, %edi
	call	malloc@PLT
	leaq	160(%rsp), %rdi
	movl	$16384, %esi
	movq	%rax, %rbx
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	call	_Z3ticv
	movq	%rax, 96(%rsp)
	xorl	%eax, %eax
	movq	%rdx, 104(%rsp)
	movl	%eax, 88(%rsp)
.L134:
	movslq	88(%rsp), %rax
	movq	80(%rsp), %rcx
	leaq	(%rcx,%rax,4), %rdx
	xorl	%eax, %eax
.L139:
	cmpl	%eax, %r14d
	jle	.L158
	movss	(%rdx,%rax,4), %xmm0
	movq	56(%rsp), %rcx
	movss	%xmm0, (%rcx,%rax,4)
	incq	%rax
	jmp	.L139
.L158:
	movq	24(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	$1, %ecx
	movq	152(%rsp), %rdi
	call	cudaMemcpy@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r15, %rdx
	movl	$1, %ecx
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%r15, 188(%rsp)
	movl	$1, 196(%rsp)
	movq	%r15, 176(%rsp)
	movl	$1, 184(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L136
	movss	.LC23(%rip), %xmm0
	movq	136(%rsp), %rcx
	movl	%r14d, %r8d
	movq	144(%rsp), %rdx
	movq	152(%rsp), %rsi
	movq	160(%rsp), %rdi
	call	_Z31__device_stub__Z4distPfS_S_S_ifPfS_S_S_if
.L136:
	movq	160(%rsp), %rsi
	movl	$16384, %edx
	movl	$2, %ecx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rax
	movq	72(%rsp), %r13
	movq	%rbp, %rdx
	salq	$14, %rdx
	movss	(%rax,%rbp,4), %xmm0
	addq	%r13, %rdx
	xorl	%eax, %eax
.L137:
	movss	(%rbx,%rax), %xmm1
	movss	%xmm1, (%rdx,%rax)
	addq	$4, %rax
	addss	%xmm1, %xmm0
	cmpq	$16384, %rax
	jne	.L137
	movq	40(%rsp), %rax
	addl	%r14d, 88(%rsp)
	movss	%xmm0, (%rax,%rbp,4)
	incq	%rbp
	cmpq	$4096, %rbp
	jne	.L134
	movq	152(%rsp), %rdi
	xorl	%ebp, %ebp
	movabsq	$4294967360, %r14
	call	cudaFree@PLT
	movq	136(%rsp), %rdi
	call	cudaFree@PLT
	leaq	168(%rsp), %rdi
	movl	$4, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
.L140:
	movl	$4096, %ecx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movl	$16384, %edx
	rep movsl
	movq	160(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rax
	movl	$1, %ecx
	movq	168(%rsp), %rdi
	movl	$4, %edx
	leaq	(%rax,%rbp), %rsi
	call	cudaMemcpy@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r14, %rdx
	movl	$1, %ecx
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r14, 188(%rsp)
	movl	$1, 196(%rsp)
	movq	%r14, 176(%rsp)
	movl	$1, 184(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L143
	movq	168(%rsp), %rsi
	movq	160(%rsp), %rdi
	call	_Z24__device_stub__Z3dimPfS_PfS_
.L143:
	movq	160(%rsp), %rsi
	movl	$2, %ecx
	movl	$16384, %edx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rax
	movss	(%rax,%rbp), %xmm1
	xorl	%eax, %eax
.L141:
	movss	(%rbx,%rax), %xmm0
	movq	8(%rsp), %rcx
	movss	%xmm0, 0(%r13,%rax)
	mulss	(%rcx,%rax), %xmm0
	addq	$4, %rax
	addss	%xmm0, %xmm1
	cmpq	$16384, %rax
	jne	.L141
	movq	16(%rsp), %rax
	addq	$16384, %r13
	movss	%xmm1, (%rax,%rbp)
	addq	$4, %rbp
	cmpq	$16384, %rbp
	jne	.L140
	movq	96(%rsp), %rdi
	movq	104(%rsp), %rsi
	call	_Z3toc7timeval
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	leaq	.LC24(%rip), %rsi
	movq	16(%rsp), %rdi
	movq	%xmm0, %rbp
	call	_Z5toTXTPfPcii
	movl	$16384, %edi
	call	malloc@PLT
	movq	%rax, %r13
	xorl	%eax, %eax
.L145:
	movq	16(%rsp), %rcx
	movss	(%rcx,%rax), %xmm0
	movq	8(%rsp), %rcx
	subss	(%rcx,%rax), %xmm0
	movss	%xmm0, 0(%r13,%rax)
	addq	$4, %rax
	cmpq	$16384, %rax
	jne	.L145
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	leaq	.LC25(%rip), %rsi
	movq	%r13, %rdi
	call	_Z5toTXTPfPcii
	movq	%rbp, %xmm0
	leaq	.LC26(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	128(%rsp), %rdi
	call	cudaFree@PLT
	movq	144(%rsp), %rdi
	call	cudaFree@PLT
	movq	160(%rsp), %rdi
	call	cudaFree@PLT
	movq	168(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	free@PLT
	movq	32(%rsp), %rdi
	call	free@PLT
	movq	8(%rsp), %rdi
	call	free@PLT
	movq	56(%rsp), %rdi
	call	free@PLT
	movq	64(%rsp), %rdi
	call	free@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	40(%rsp), %rdi
	call	free@PLT
	movq	16(%rsp), %rdi
	call	free@PLT
	movq	%r13, %rdi
	call	free@PLT
	movq	72(%rsp), %rdi
	call	free@PLT
	movq	8(%r12), %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L146
	call	__stack_chk_fail@PLT
.L146:
	addq	$216, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2248:
	.size	main, .-main
	.section	.rodata.str1.1
.LC27:
	.string	"_Z3dimPfS_"
.LC28:
	.string	"_Z4distPfS_S_S_if"
.LC29:
	.string	"_Z13normalizationPfS_ff"
.LC30:
	.string	"precalc_xorwow_matrix"
.LC31:
	.string	"precalc_xorwow_offset_matrix"
.LC32:
	.string	"mrg32k3aM1"
.LC33:
	.string	"mrg32k3aM2"
.LC34:
	.string	"mrg32k3aM1SubSeq"
.LC35:
	.string	"mrg32k3aM2SubSeq"
.LC36:
	.string	"mrg32k3aM1Seq"
.LC37:
	.string	"mrg32k3aM2Seq"
.LC38:
	.string	"__cr_lgamma_table"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2280:
	.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	.LC27(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z3dimPfS_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC28(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z4distPfS_S_S_if(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC29(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z13normalizationPfS_ff(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC30(%rip), %rdx
	movl	$102400, %r9d
	leaq	_ZL21precalc_xorwow_matrix(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC31(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$102400, %r9d
	leaq	_ZL28precalc_xorwow_offset_matrix(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC32(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2304, %r9d
	leaq	_ZL10mrg32k3aM1(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC33(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2304, %r9d
	leaq	_ZL10mrg32k3aM2(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC34(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2016, %r9d
	leaq	_ZL16mrg32k3aM1SubSeq(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r11
	.cfi_def_cfa_offset 24
	popq	%rax
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC35(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2016, %r9d
	leaq	_ZL16mrg32k3aM2SubSeq(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC36(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2304, %r9d
	leaq	_ZL13mrg32k3aM1Seq(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC37(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2304, %r9d
	leaq	_ZL13mrg32k3aM2Seq(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC38(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movl	$72, %r9d
	movq	%rdx, %rcx
	leaq	_ZL17__cr_lgamma_table(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.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
.LFE2280:
	.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
	.local	_ZL17__cr_lgamma_table
	.comm	_ZL17__cr_lgamma_table,72,32
	.local	_ZL13mrg32k3aM2Seq
	.comm	_ZL13mrg32k3aM2Seq,2304,32
	.local	_ZL13mrg32k3aM1Seq
	.comm	_ZL13mrg32k3aM1Seq,2304,32
	.local	_ZL16mrg32k3aM2SubSeq
	.comm	_ZL16mrg32k3aM2SubSeq,2016,32
	.local	_ZL16mrg32k3aM1SubSeq
	.comm	_ZL16mrg32k3aM1SubSeq,2016,32
	.local	_ZL10mrg32k3aM2
	.comm	_ZL10mrg32k3aM2,2304,32
	.local	_ZL10mrg32k3aM1
	.comm	_ZL10mrg32k3aM1,2304,32
	.local	_ZL28precalc_xorwow_offset_matrix
	.comm	_ZL28precalc_xorwow_offset_matrix,102400,32
	.local	_ZL21precalc_xorwow_matrix
	.comm	_ZL21precalc_xorwow_matrix,102400,32
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1083129856
	.align 8
.LC9:
	.long	1610612736
	.long	1075388923
	.align 8
.LC10:
	.long	0
	.long	1040187392
	.align 8
.LC11:
	.long	0
	.long	-1073741824
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC12:
	.long	1023509497
	.align 4
.LC13:
	.long	805306368
	.section	.rodata.cst8
	.align 8
.LC15:
	.long	0
	.long	1071644672
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC16:
	.long	-2147483648
	.long	0
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC17:
	.long	1413777120
	.long	1075388923
	.section	.rodata.cst4
	.align 4
.LC18:
	.long	2139095040
	.align 4
.LC19:
	.long	-1082130432
	.align 4
.LC22:
	.long	1065353216
	.align 4
.LC23:
	.long	1008981770
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <hip/hip_runtime.h>

#include <hiprand/hiprand_kernel.h>
#include <stdlib.h>
#include <math.h>
#include <sys/time.h>
#include <time.h>
#include <string.h>

#define PI 3.1415926536
#define e 2.718281828459

#define N 64*64
#define THREADS_PER_BLOCK 64

struct timeval tic(){
    struct timeval tv;
    gettimeofday(&tv,NULL);
    return tv;
}

typedef struct Patches
{
    int index;
    float central;
    float* patchArray;
}Patch;

double toc(struct timeval begin){
    struct timeval end;
    gettimeofday(&end,NULL);
    double stime = ((double)(end.tv_sec-begin.tv_sec)*1000)+((double)(end.tv_usec-begin.tv_usec)/1000);
    stime = stime / 1000;
    return (stime);
}

float* readFile(int n, int m, char *file_path){
    FILE* ptrFile = fopen(file_path, "r");

    float *I = (float*)malloc(n*m*sizeof(float));

    if (!ptrFile){
        printf("Error Reading File\n");
        exit (0);
    }

    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            fscanf(ptrFile,"%f,", &I[n*i+j]);
        }
    }

    fclose(ptrFile);

    return I;
}

void toTXT(float* array,char *output, int n, int m){
    FILE *fp;

    fp=fopen(output,"w");

    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            if(j<m-1){
                fprintf(fp,"%lf,",array[n*i+j]);
            }else if(j==m-1){
                fprintf(fp,"%lf",array[n*i+j]);
            }
        }
        fprintf(fp,"\n",array[n*i]);
    }
    fclose(fp);
    printf("File %s saved.\n", output);
}

__global__ void normalization(float* A, float* B, float min, float max){
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if(i<N)
        B[i] = (A[i] - min) / max;
}

float AWGN_generator()     //https://www.embeddedrelated.com/showcode/311.php
{/* Generates additive white Gaussian Noise samples with zero mean and a standard deviation of 1. */
  float dev = 0.03162; //var = 0.01
  float temp1;
  float temp2;
  float result;
  int p = 1;

  while( p > 0 )
  {
	temp2 = ( rand() / ( (float)RAND_MAX ) ); /*  rand() function generates an
                                                       integer between 0 and  RAND_MAX,
                                                       which is defined in stdlib.h.
                                                   */

    if ( temp2 == 0 )
    {// temp2 is >= (RAND_MAX / 2)
        p = 1;
    }// end if
    else
    {// temp2 is < (RAND_MAX / 2)
        p = -1;
    }// end else

  }// end while()

  temp1 = cos( ( 2.0 * (float)PI ) * rand() / ( (float)RAND_MAX ) );
  result = sqrt( -2.0 * log( temp2 ) ) * temp1;

  return result * dev;	// return the generated random sample to the caller

}// end AWGN_generator()

Patch* makePatches(float* J, int n, int m, Patch* allPatches, int patchSizeH, int patchSizeW){
    int mdW = (patchSizeW - 1)/2;
    int mdH = (patchSizeH - 1)/2;
    
    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){

            for(int w=0; w<patchSizeW; w++){
                for(int h=0; h<patchSizeH; h++){
                    allPatches[n*j+i].patchArray[patchSizeH*w+h] = 0;
                }
            }

            allPatches[n*j+i].central = J[n*j+i];
            allPatches[n*j+i].index = n*j+i;

            if(i==0 && j==0){
                for(int w=mdW; w<patchSizeW; w++){
                    for(int h=mdH; h<patchSizeH; h++){
                        allPatches[n*j+i].patchArray[patchSizeH*w+h] = J[(n*j+i)-(mdW-w)*n-(mdH-h)];
                    }
                } 
            }else if(i>0 && j==0){
                for(int h=0; h<patchSizeH-1; h++){
                    for(int w=0; w<patchSizeW; w++){
                        allPatches[n*j+i].patchArray[patchSizeH*w+h] = allPatches[n*j+(i-1)].patchArray[patchSizeH*w+(h+1)];
                    }
                }
               

                for(int w=mdW; w<patchSizeW; w++){
                    if((n-1-i) >= mdH){
                        allPatches[n*j+i].patchArray[patchSizeH*w+(patchSizeH-1)] = J[(n*j+i)-(mdW-w)*n+mdH];
                    }else if((n-1-i) < mdH){
                        allPatches[n*j+i].patchArray[patchSizeH*w+(patchSizeH-1)] = 0;
                    }
                }
            }else if(j>0){
                for(int w=0; w<patchSizeW-1; w++){
                    for(int h=0; h<patchSizeH; h++){
                        allPatches[n*j+i].patchArray[patchSizeH*w+h] = allPatches[n*(j-1)+i].patchArray[patchSizeH*(w+1)+h];
                    }
                }

                int a,b;
                if(i>=mdH && (n-1-i)>=mdH){
                    a = 0;
                    b = patchSizeH;
                }else if(i<mdH && (n-1-i)>=mdH){
                    a = mdH - i;
                    b = patchSizeH;
                }else if(i<mdH && (n-1-i)<mdH){
                    a = mdH - i;
                    b = mdH + (n-i);
                }else if(i>=mdH && (n-1-i)<mdH){
                    a = 0;
                    b = mdH + (n-i);
                }

                for(int h=a; h<b; h++){
                    if((m-1-j) >= mdW){
                        allPatches[n*j+i].patchArray[patchSizeH*(patchSizeW-1)+h] = J[(n*j+i)+mdW*n-(mdH-h)];
                    }else if((m-1-j) < mdW){
                        allPatches[n*j+i].patchArray[patchSizeH*(patchSizeW-1)+h] = 0;
                    }
                }
            }
        }
    }
    return allPatches;
}

float* computeG_a(int patchSizeH, int patchSizeW, float patchSigma){
    float* gauss = (float*)malloc(patchSizeH*patchSizeW*sizeof(float));
    
    for (int i = 0; i < patchSizeH; i++) {
        for (int j = 0; j < patchSizeW; j++) {
            float y = i - (patchSizeH - 1) / 2.0;
            float x = j - (patchSizeW - 1) / 2.0;
            gauss[patchSizeW*i+j] = (1/2.0) * exp(-(x * x + y * y) / (2.0 * PI * patchSigma * patchSigma));
        }
    }    
    return gauss;
}

__global__ void dist(float *W,float *p_i, float *P, float *V, int pSize, float filtSigma){
    float d = 0;
    int k = blockIdx.x * blockDim.x + threadIdx.x;

    if(k<N){
        for (int i = 0; i < pSize; i++) {
            d += V[i] * pow(p_i[i] - P[pSize*k+i],2);
        }
        d = sqrt(d);
        W[k] = exp(-pow(d,2) / filtSigma);
        d=0;
    }   
}

__global__ void dim(float *w, float *z){
    int i = blockIdx.x * blockDim.x + threadIdx.x;

    if(i<N){
        w[i] = w[i] / *z;
    }
}

int main(int argc, char *argv[]){
    int n = atoi(argv[1]);
    int m = atoi(argv[2]);
    int patchSizeH = atoi(argv[3]);
    int patchSizeW = atoi(argv[4]);

    char* file_path;
    file_path=(char*)malloc(strlen(argv[5])*sizeof(char));
    memcpy(file_path,argv[5],strlen(argv[5]));
       
    float patchSigma =5/3;
    float filtSigma =0.01 ;
    
    float *I, *I_norm, *J, *If;
    float *dev_I, *dev_I_norm, *dev_J, *dev_gauss;
    float *P, *dev_P, *w;

    int size = N * sizeof(float);
    int sizePatch = patchSizeH * patchSizeW * sizeof(float);
    int pSize = patchSizeH * patchSizeW;
    
    //allocate memory for device copies
    hipMalloc(&dev_I, size);
    hipMalloc(&dev_I_norm, size);
    hipMalloc(&dev_J, size);
    hipMalloc(&dev_gauss, sizePatch);
    hipMalloc(&dev_P, N*pSize*sizeof(float));    

    I = (float*)malloc(size);
    I_norm = (float*)malloc(size);
    J = (float*)malloc(size);
    If = (float*)malloc(size);
    
    Patch* allPatches;
    allPatches = (Patch*)malloc(n*m*sizeof(Patch));

    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            allPatches[n*j+i].patchArray = (float*)malloc(patchSizeH*patchSizeW*sizeof(float));
        }
    }    

    w = (float*)malloc(N*N*sizeof(float));
    float* gauss = (float*)malloc(sizePatch);
    float* Z = (float*)malloc(size);

    struct timeval tStart;

    I = readFile(n,m,file_path);

    //find min of 'I' and max of 'I-min'
    float min = INFINITY;
    float max = -1.0;

    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            if(I[n*i+j]<min) min= I[n*i+j];
        }
    }    

    for(int i=0; i<n*m; i++){
        if((I[i]-min)>max) max = I[i]-min;
    }

    hipMemcpy(dev_I, I, size, hipMemcpyHostToDevice);
    normalization<<<N/THREADS_PER_BLOCK,THREADS_PER_BLOCK>>>(dev_I, dev_I_norm, min, max);
    hipMemcpy(I_norm, dev_I_norm, size, hipMemcpyDeviceToHost);
   
    for(int i=0; i<n*m; i++){
        J[i] = I_norm[i] + AWGN_generator();
    }

    toTXT(I_norm,"normCuda.txt",n,m);
    toTXT(J,"JCuda.txt",n,m);

    allPatches = makePatches(J,n,m,allPatches,patchSizeH,patchSizeW);

    //pass all the elements of 'allPatches' to 'P' array(NxpSize)
    P = (float*)malloc(N*pSize*sizeof(float));
    for(int i=0; i<N; i++){
        for(int j=0; j<pSize; j++){
            P[pSize*i+j] = allPatches[i].patchArray[j];
        }
    }

    hipMemcpy(dev_P, P, N*sizePatch, hipMemcpyHostToDevice);
    
    gauss = computeG_a(patchSizeH, patchSizeW, patchSigma);
    hipMemcpy(dev_gauss, gauss, sizePatch, hipMemcpyHostToDevice);

    float *patch_i = (float*)malloc(sizePatch);
    float *dev_patchI;
    hipMalloc(&dev_patchI, sizePatch);
    float *wi_j = (float*)malloc(N*sizeof(float));
    float *dev_wij;
    hipMalloc(&dev_wij, N*sizeof(float));

    tStart = tic();

    for(int i=0; i<N; i++){ 
        for(int j=0; j<pSize; j++){ 
            patch_i[j] = P[pSize*i +j];
        }
        hipMemcpy(dev_patchI, patch_i, sizePatch, hipMemcpyHostToDevice);
        dist<<<N/THREADS_PER_BLOCK,THREADS_PER_BLOCK>>>(dev_wij, dev_patchI,dev_P, dev_gauss,pSize,filtSigma);
        hipMemcpy(wi_j, dev_wij, size, hipMemcpyDeviceToHost);
        for(int j=0; j<N;j++){
            Z[i] += wi_j[j]; 
            w[N*i+j] = wi_j[j];
        }
    }
    hipFree(dev_patchI);
    hipFree(dev_gauss);
    
    float *dev_Z;
    hipMalloc(&dev_Z, sizeof(float));
    for(int i=0; i<N; i++){
        for(int j=0; j<N;j++){
            wi_j[j] = w[N*i+j];
        }
        hipMemcpy(dev_wij, wi_j,size, hipMemcpyHostToDevice);
        hipMemcpy(dev_Z, &Z[i], sizeof(float), hipMemcpyHostToDevice);
        dim<<<N/THREADS_PER_BLOCK,THREADS_PER_BLOCK>>>(dev_wij,dev_Z);
        hipMemcpy(wi_j, dev_wij, size,hipMemcpyDeviceToHost);
        for(int j=0; j<N;j++){
            w[N*i+j] = wi_j[j];
            If[i] += w[N*i+j] * J[j];
        }
    }
    double time = toc(tStart);

    toTXT(If,"IfCuda.txt",n,m);
    
    float* Dif = (float*)malloc(N*sizeof(float));
    for(int i=0; i<N; i++){
        Dif[i] =If[i] - J[i];
    }  

    toTXT(Dif,"DifCuda.txt",n,m);

    printf("Time: %f sec", time);    

    hipFree(dev_I); hipFree(dev_I_norm); hipFree(dev_J); hipFree(dev_P); hipFree(dev_wij); hipFree(dev_Z); 
    free(I); free(I_norm); free(J); free(patch_i); free(gauss); free(wi_j); free(Z); free(If); free(Dif); free(w);
    free(allPatches->patchArray);
    free(allPatches);
    return 0;
}
	.text
	.file	"v1.hip"
	.globl	_Z3ticv                         # -- Begin function _Z3ticv
	.type	_Z3ticv,@function
_Z3ticv:                                # @_Z3ticv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -16
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	movq	8(%rbx), %rdx
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z3ticv, .Lfunc_end0-_Z3ticv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z3toc7timeval
.LCPI1_0:
	.quad	0x408f400000000000              # double 1000
	.text
	.globl	_Z3toc7timeval
	.type	_Z3toc7timeval,@function
_Z3toc7timeval:                         # @_Z3toc7timeval
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsp, %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	subq	%r14, %rax
	cvtsi2sd	%rax, %xmm1
	movsd	.LCPI1_0(%rip), %xmm2           # xmm2 = mem[0],zero
	mulsd	%xmm2, %xmm1
	subq	%rbx, %rcx
	cvtsi2sd	%rcx, %xmm0
	divsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	divsd	%xmm2, %xmm0
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z3toc7timeval, .Lfunc_end1-_Z3toc7timeval
	.cfi_endproc
                                        # -- End function
	.globl	_Z8readFileiiPc                 # -- Begin function _Z8readFileiiPc
	.type	_Z8readFileiiPc,@function
_Z8readFileiiPc:                        # @_Z8readFileiiPc
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebx
	movl	%edi, %r13d
	movl	$.L.str, %esi
	movq	%rdx, %rdi
	callq	fopen
	movq	%rax, %r14
	movl	%ebx, 12(%rsp)                  # 4-byte Spill
	imull	%r13d, %ebx
	movslq	%ebx, %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	testq	%r14, %r14
	je	.LBB2_8
# %bb.1:                                # %.preheader19
	testl	%r13d, %r13d
	jle	.LBB2_7
# %bb.2:                                # %.preheader.lr.ph
	movl	%r13d, %eax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movl	12(%rsp), %eax                  # 4-byte Reload
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
.LBB2_3:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_5 Depth 2
	cmpl	$0, 12(%rsp)                    # 4-byte Folded Reload
	jle	.LBB2_6
# %bb.4:                                #   in Loop: Header=BB2_3 Depth=1
	movl	%r15d, %eax
	movq	16(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %r12
	movq	24(%rsp), %rbp                  # 8-byte Reload
.LBB2_5:                                #   Parent Loop BB2_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$.L.str.2, %esi
	movq	%r14, %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	addq	$4, %r12
	decq	%rbp
	jne	.LBB2_5
.LBB2_6:                                # %._crit_edge
                                        #   in Loop: Header=BB2_3 Depth=1
	incq	%rbx
	addl	%r13d, %r15d
	cmpq	32(%rsp), %rbx                  # 8-byte Folded Reload
	jne	.LBB2_3
.LBB2_7:                                # %._crit_edge22
	movq	%r14, %rdi
	callq	fclose
	movq	16(%rsp), %rax                  # 8-byte Reload
	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
.LBB2_8:
	.cfi_def_cfa_offset 96
	movl	$.Lstr, %edi
	callq	puts@PLT
	xorl	%edi, %edi
	callq	exit
.Lfunc_end2:
	.size	_Z8readFileiiPc, .Lfunc_end2-_Z8readFileiiPc
	.cfi_endproc
                                        # -- End function
	.globl	_Z5toTXTPfPcii                  # -- Begin function _Z5toTXTPfPcii
	.type	_Z5toTXTPfPcii,@function
_Z5toTXTPfPcii:                         # @_Z5toTXTPfPcii
	.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
                                        # kill: def $ecx killed $ecx def $rcx
	movq	%rcx, 32(%rsp)                  # 8-byte Spill
	movl	%edx, %ebx
	movq	%rsi, %rax
	movq	%rdi, 16(%rsp)                  # 8-byte Spill
	movl	$.L.str.3, %esi
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movq	%rax, %rdi
	callq	fopen
	movq	%rax, %r12
	movl	%ebx, 12(%rsp)                  # 4-byte Spill
	testl	%ebx, %ebx
	jle	.LBB3_9
# %bb.1:                                # %.preheader.lr.ph
	movq	32(%rsp), %rax                  # 8-byte Reload
	leal	-1(%rax), %ecx
	movslq	%ecx, %rbx
	movl	12(%rsp), %edx                  # 4-byte Reload
	movl	%eax, %ebp
	movq	16(%rsp), %rax                  # 8-byte Reload
	movq	%rcx, 80(%rsp)                  # 8-byte Spill
	leaq	(%rax,%rcx,4), %rax
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	xorl	%ecx, %ecx
	movq	%rdx, 64(%rsp)                  # 8-byte Spill
.LBB3_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
	movq	%rcx, 72(%rsp)                  # 8-byte Spill
	imulq	%rdx, %rcx
	movq	%rcx, 40(%rsp)                  # 8-byte Spill
	cmpl	$0, 32(%rsp)                    # 4-byte Folded Reload
	jle	.LBB3_8
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	24(%rsp), %eax                  # 4-byte Reload
	movq	16(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %r15
	movl	40(%rsp), %eax                  # 4-byte Reload
	movq	56(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r13d, %r13d
.LBB3_4:                                #   Parent Loop BB3_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$.L.str.4, %esi
	movq	%r15, %rax
	cmpq	%rbx, %r13
	jl	.LBB3_6
# %bb.5:                                #   in Loop: Header=BB3_4 Depth=2
	movl	$.L.str.5, %esi
	movq	%r14, %rax
	cmpq	%r13, 80(%rsp)                  # 8-byte Folded Reload
	jne	.LBB3_7
.LBB3_6:                                # %.sink.split
                                        #   in Loop: Header=BB3_4 Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rax), %xmm0
	movq	%r12, %rdi
	movb	$1, %al
	callq	fprintf
.LBB3_7:                                #   in Loop: Header=BB3_4 Depth=2
	incq	%r13
	addq	$4, %r15
	cmpq	%r13, %rbp
	jne	.LBB3_4
.LBB3_8:                                # %._crit_edge
                                        #   in Loop: Header=BB3_2 Depth=1
	movq	16(%rsp), %rax                  # 8-byte Reload
	movq	40(%rsp), %rcx                  # 8-byte Reload
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rax,%rcx,4), %xmm0
	movl	$.L.str.6, %esi
	movq	%r12, %rdi
	movb	$1, %al
	callq	fprintf
	movq	72(%rsp), %rcx                  # 8-byte Reload
	incq	%rcx
	movq	24(%rsp), %rax                  # 8-byte Reload
	addl	12(%rsp), %eax                  # 4-byte Folded Reload
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	64(%rsp), %rdx                  # 8-byte Reload
	cmpq	%rdx, %rcx
	jne	.LBB3_2
.LBB3_9:                                # %._crit_edge32
	movq	%r12, %rdi
	callq	fclose
	movl	$.L.str.7, %edi
	movq	48(%rsp), %rsi                  # 8-byte Reload
	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
.Lfunc_end3:
	.size	_Z5toTXTPfPcii, .Lfunc_end3-_Z5toTXTPfPcii
	.cfi_endproc
                                        # -- End function
	.globl	_Z28__device_stub__normalizationPfS_ff # -- Begin function _Z28__device_stub__normalizationPfS_ff
	.type	_Z28__device_stub__normalizationPfS_ff,@function
_Z28__device_stub__normalizationPfS_ff: # @_Z28__device_stub__normalizationPfS_ff
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rdx
	movss	%xmm0, (%rdx)
	leaq	8(%rsp), %rsi
	movss	%xmm1, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rdx, 16(%rbx)
	movq	%rsi, 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	$_Z13normalizationPfS_ff, %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_end4:
	.size	_Z28__device_stub__normalizationPfS_ff, .Lfunc_end4-_Z28__device_stub__normalizationPfS_ff
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z14AWGN_generatorv
.LCPI5_0:
	.long	0x30000000                      # float 4.65661287E-10
.LCPI5_4:
	.long	0x3d0183f9                      # float 0.0316199996
.LCPI5_5:
	.long	0x00000000                      # float 0
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI5_1:
	.quad	0x401921fb60000000              # double 6.2831854820251465
.LCPI5_2:
	.quad	0x3e00000000000000              # double 4.6566128730773926E-10
.LCPI5_3:
	.quad	0xc000000000000000              # double -2
	.text
	.globl	_Z14AWGN_generatorv
	.type	_Z14AWGN_generatorv,@function
_Z14AWGN_generatorv:                    # @_Z14AWGN_generatorv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
.LBB5_1:                                # %.backedge
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI5_0(%rip), %xmm0
	ucomiss	.LCPI5_5(%rip), %xmm0
	jne	.LBB5_2
	jnp	.LBB5_1
.LBB5_2:
	movss	%xmm0, (%rsp)                   # 4-byte Spill
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	mulsd	.LCPI5_1(%rip), %xmm0
	mulsd	.LCPI5_2(%rip), %xmm0
	callq	cos
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
	movss	(%rsp), %xmm0                   # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	callq	logf
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LCPI5_3(%rip), %xmm0
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jb	.LBB5_4
# %bb.3:
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB5_5
.LBB5_4:                                # %call.sqrt
	callq	sqrt
.LBB5_5:                                # %.split
	xorps	%xmm1, %xmm1
	cvtss2sd	4(%rsp), %xmm1                  # 4-byte Folded Reload
	mulsd	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm1, %xmm0
	mulss	.LCPI5_4(%rip), %xmm0
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z14AWGN_generatorv, .Lfunc_end5-_Z14AWGN_generatorv
	.cfi_endproc
                                        # -- End function
	.globl	_Z11makePatchesPfiiP7Patchesii  # -- Begin function _Z11makePatchesPfiiP7Patchesii
	.type	_Z11makePatchesPfiiP7Patchesii,@function
_Z11makePatchesPfiiP7Patchesii:         # @_Z11makePatchesPfiiP7Patchesii
	.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	$296, %rsp                      # imm = 0x128
	.cfi_def_cfa_offset 352
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
                                        # kill: def $r9d killed $r9d def $r9
                                        # kill: def $r8d killed $r8d def $r8
	movq	%rcx, (%rsp)                    # 8-byte Spill
	movl	%edx, 12(%rsp)                  # 4-byte Spill
                                        # kill: def $esi killed $esi def $rsi
	testl	%esi, %esi
	jle	.LBB6_5
# %bb.1:                                # %.preheader253.lr.ph
	movq	%rdi, %r13
	leal	-1(%r9), %eax
	movl	%eax, %ecx
	movl	%eax, %r15d
                                        # kill: def $eax killed $eax def $rax
	shrl	$31, %eax
	leal	(%r9,%rax), %edi
	decl	%edi
	sarl	%edi
	leal	-1(%r8), %edx
	movslq	%edx, %rax
                                        # kill: def $edx killed $edx def $rdx
	shrl	$31, %edx
	leal	(%r8,%rdx), %ebp
	decl	%ebp
	sarl	%ebp
	movl	%edi, %r10d
	imull	%esi, %r10d
	imull	%r8d, %ecx
	movslq	%r8d, %r12
	movslq	%ecx, %r11
	movl	%edi, 16(%rsp)                  # 4-byte Spill
	movslq	%edi, %rdi
	movslq	%ebp, %r14
	movl	%esi, %ebx
	movq	%rbx, 40(%rsp)                  # 8-byte Spill
	movslq	12(%rsp), %rcx                  # 4-byte Folded Reload
	movq	%r14, %rdx
	subq	%rbx, %rdx
	movq	%rdx, 120(%rsp)                 # 8-byte Spill
	movl	%eax, %edx
	movq	%rdx, 272(%rsp)                 # 8-byte Spill
	movq	%rdi, %rdx
	imulq	%r12, %rdx
	shlq	$2, %rax
	leaq	(%rax,%rdx,4), %rax
	movq	%rax, 184(%rsp)                 # 8-byte Spill
	leaq	(,%r14,4), %rax
	leaq	(%rax,%rdx,4), %rax
	movq	%rax, 200(%rsp)                 # 8-byte Spill
	movq	%rdi, %rax
	subq	%rcx, %rax
	movq	%rax, 256(%rsp)                 # 8-byte Spill
	movl	%ecx, %eax
	movq	%rax, 232(%rsp)                 # 8-byte Spill
	shlq	$2, %r11
	movq	%r11, 160(%rsp)                 # 8-byte Spill
	subl	%r14d, %r10d
	movslq	%r9d, %rax
	movq	%rax, 280(%rsp)                 # 8-byte Spill
	movq	%rdi, 208(%rsp)                 # 8-byte Spill
	subq	%rdi, %rax
	movq	%rax, 176(%rsp)                 # 8-byte Spill
	leaq	(,%r12,4), %rbx
	movq	%r14, 144(%rsp)                 # 8-byte Spill
	subq	%r14, %r12
	movq	40(%rsp), %rcx                  # 8-byte Reload
	leal	(%rsi,%rbp), %eax
	movl	%eax, 60(%rsp)                  # 4-byte Spill
	movl	%r8d, %eax
	leaq	(,%rax,4), %rdx
	movq	%rdx, 288(%rsp)                 # 8-byte Spill
	movl	%r9d, %edx
	movq	%rdx, 112(%rsp)                 # 8-byte Spill
	movl	%ebp, %edx
	xorl	%edi, %edi
	xorl	%r11d, %r11d
	movq	%r8, 136(%rsp)                  # 8-byte Spill
	movq	%r9, 88(%rsp)                   # 8-byte Spill
	movq	%rsi, 80(%rsp)                  # 8-byte Spill
	movq	%r15, 224(%rsp)                 # 8-byte Spill
	movq	%rbp, 72(%rsp)                  # 8-byte Spill
	movq	%rax, 248(%rsp)                 # 8-byte Spill
.LBB6_2:                                # %.preheader253
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_7 Depth 2
                                        #       Child Loop BB6_9 Depth 3
                                        #       Child Loop BB6_37 Depth 3
                                        #         Child Loop BB6_48 Depth 4
                                        #       Child Loop BB6_42 Depth 3
                                        #       Child Loop BB6_23 Depth 3
                                        #         Child Loop BB6_32 Depth 4
                                        #       Child Loop BB6_28 Depth 3
                                        #       Child Loop BB6_15 Depth 3
                                        #         Child Loop BB6_17 Depth 4
	cmpl	$0, 12(%rsp)                    # 4-byte Folded Reload
	jle	.LBB6_3
# %bb.6:                                # %.preheader252.lr.ph
                                        #   in Loop: Header=BB6_2 Depth=1
	movq	%rdi, %rax
	notq	%rax
	addl	60(%rsp), %r11d                 # 4-byte Folded Reload
	leaq	-1(%rdi), %r14
	movq	%r14, 192(%rsp)                 # 8-byte Spill
	movq	%rax, 128(%rsp)                 # 8-byte Spill
	cmpq	%rax, 120(%rsp)                 # 8-byte Folded Reload
	cmovlel	%r8d, %r11d
	movq	144(%rsp), %rax                 # 8-byte Reload
	movl	%eax, %r14d
	subl	%edi, %r14d
	cmpq	%rax, %rdi
	movl	$0, %eax
	cmovgel	%eax, %r14d
	movslq	%r14d, %rax
	movl	%r11d, 68(%rsp)                 # 4-byte Spill
	movslq	%r11d, %r11
	movq	%r10, 152(%rsp)                 # 8-byte Spill
	movq	%r14, 216(%rsp)                 # 8-byte Spill
	addl	%r14d, %r10d
	movq	%r10, 104(%rsp)                 # 8-byte Spill
	subq	%rax, %r11
	movq	%r11, 264(%rsp)                 # 8-byte Spill
	shlq	$2, %rax
	movq	%rax, 168(%rsp)                 # 8-byte Spill
	movq	%rdi, 96(%rsp)                  # 8-byte Spill
	movl	%edx, 64(%rsp)                  # 4-byte Spill
	movl	%edx, 20(%rsp)                  # 4-byte Spill
	xorl	%eax, %eax
	movq	%rdi, 48(%rsp)                  # 8-byte Spill
.LBB6_7:                                # %.preheader252
                                        #   Parent Loop BB6_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB6_9 Depth 3
                                        #       Child Loop BB6_37 Depth 3
                                        #         Child Loop BB6_48 Depth 4
                                        #       Child Loop BB6_42 Depth 3
                                        #       Child Loop BB6_23 Depth 3
                                        #         Child Loop BB6_32 Depth 4
                                        #       Child Loop BB6_28 Depth 3
                                        #       Child Loop BB6_15 Depth 3
                                        #         Child Loop BB6_17 Depth 4
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	imulq	%rcx, %rax
	movq	%rax, 240(%rsp)                 # 8-byte Spill
	addq	%rdi, %rax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	testl	%r9d, %r9d
	jle	.LBB6_12
# %bb.8:                                # %.preheader245.lr.ph
                                        #   in Loop: Header=BB6_7 Depth=2
	movq	24(%rsp), %rax                  # 8-byte Reload
	shlq	$4, %rax
	movq	(%rsp), %rcx                    # 8-byte Reload
	leaq	(%rcx,%rax), %rbp
	addq	$8, %rbp
	xorl	%r15d, %r15d
	movq	112(%rsp), %r14                 # 8-byte Reload
.LBB6_9:                                # %.preheader245
                                        #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_7 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	testl	%r8d, %r8d
	jle	.LBB6_11
# %bb.10:                               # %.lr.ph
                                        #   in Loop: Header=BB6_9 Depth=3
	movl	%r15d, %edi
	shlq	$2, %rdi
	addq	(%rbp), %rdi
	xorl	%esi, %esi
	movq	288(%rsp), %rdx                 # 8-byte Reload
	callq	memset@PLT
	movq	136(%rsp), %r8                  # 8-byte Reload
.LBB6_11:                               # %._crit_edge
                                        #   in Loop: Header=BB6_9 Depth=3
	addl	%r8d, %r15d
	decq	%r14
	jne	.LBB6_9
.LBB6_12:                               # %._crit_edge256
                                        #   in Loop: Header=BB6_7 Depth=2
	movq	24(%rsp), %rdx                  # 8-byte Reload
	movss	(%r13,%rdx,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movq	%rdx, %rax
	shlq	$4, %rax
	movq	(%rsp), %rcx                    # 8-byte Reload
	movss	%xmm0, 4(%rcx,%rax)
	movl	%edx, (%rcx,%rax)
	movq	32(%rsp), %rdi                  # 8-byte Reload
	movl	%edi, %ecx
	movq	48(%rsp), %rdx                  # 8-byte Reload
	orl	%edx, %ecx
	je	.LBB6_13
# %bb.19:                               #   in Loop: Header=BB6_7 Depth=2
	testq	%rdx, %rdx
	movq	88(%rsp), %r9                   # 8-byte Reload
	movq	80(%rsp), %rsi                  # 8-byte Reload
	movq	224(%rsp), %r15                 # 8-byte Reload
	movq	72(%rsp), %rbp                  # 8-byte Reload
	je	.LBB6_34
# %bb.20:                               #   in Loop: Header=BB6_7 Depth=2
	testq	%rdi, %rdi
	jne	.LBB6_34
# %bb.21:                               # %.preheader249
                                        #   in Loop: Header=BB6_7 Depth=2
	cmpl	$2, %r8d
	jl	.LBB6_26
# %bb.22:                               # %.preheader243.lr.ph
                                        #   in Loop: Header=BB6_7 Depth=2
	movq	240(%rsp), %rcx                 # 8-byte Reload
	addq	192(%rsp), %rcx                 # 8-byte Folded Reload
	shlq	$4, %rcx
	movq	(%rsp), %rdx                    # 8-byte Reload
	addq	%rdx, %rcx
	addq	$8, %rcx
	addq	%rax, %rdx
	addq	$8, %rdx
	xorl	%r14d, %r14d
.LBB6_23:                               # %.preheader243
                                        #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_7 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB6_32 Depth 4
	testl	%r9d, %r9d
	jle	.LBB6_24
# %bb.31:                               # %.lr.ph266
                                        #   in Loop: Header=BB6_23 Depth=3
	movq	(%rcx), %r8
	leaq	1(%r14), %rdi
	movq	(%rdx), %r11
	shlq	$2, %r14
	movq	112(%rsp), %r10                 # 8-byte Reload
.LBB6_32:                               #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_7 Depth=2
                                        #       Parent Loop BB6_23 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movss	4(%r8,%r14), %xmm0              # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%r11,%r14)
	addq	%rbx, %r14
	decq	%r10
	jne	.LBB6_32
# %bb.33:                               #   in Loop: Header=BB6_23 Depth=3
	movq	%rdi, %r14
	movq	136(%rsp), %r8                  # 8-byte Reload
	jmp	.LBB6_25
.LBB6_24:                               # %.preheader243.._crit_edge267_crit_edge
                                        #   in Loop: Header=BB6_23 Depth=3
	incq	%r14
	movq	%r14, %rdi
.LBB6_25:                               # %._crit_edge267
                                        #   in Loop: Header=BB6_23 Depth=3
	cmpq	272(%rsp), %rdi                 # 8-byte Folded Reload
	jne	.LBB6_23
.LBB6_26:                               # %.preheader247
                                        #   in Loop: Header=BB6_7 Depth=2
	cmpl	%r9d, 16(%rsp)                  # 4-byte Folded Reload
	jge	.LBB6_45
# %bb.27:                               # %.lr.ph270
                                        #   in Loop: Header=BB6_7 Depth=2
	movq	(%rsp), %rcx                    # 8-byte Reload
	movq	8(%rcx,%rax), %rax
	addq	184(%rsp), %rax                 # 8-byte Folded Reload
	movq	176(%rsp), %rcx                 # 8-byte Reload
	movl	20(%rsp), %edx                  # 4-byte Reload
.LBB6_28:                               #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_7 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	xorps	%xmm0, %xmm0
	movq	128(%rsp), %rdi                 # 8-byte Reload
	cmpq	%rdi, 120(%rsp)                 # 8-byte Folded Reload
	jg	.LBB6_30
# %bb.29:                               #   in Loop: Header=BB6_28 Depth=3
	movslq	%edx, %rdi
	movss	(%r13,%rdi,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
.LBB6_30:                               #   in Loop: Header=BB6_28 Depth=3
	movss	%xmm0, (%rax)
	addq	%rbx, %rax
	addl	%esi, %edx
	decq	%rcx
	jne	.LBB6_28
	jmp	.LBB6_45
.LBB6_13:                               # %.preheader246
                                        #   in Loop: Header=BB6_7 Depth=2
	movq	88(%rsp), %r9                   # 8-byte Reload
	cmpl	%r9d, 16(%rsp)                  # 4-byte Folded Reload
	movq	80(%rsp), %rsi                  # 8-byte Reload
	movq	72(%rsp), %rbp                  # 8-byte Reload
	jge	.LBB6_45
# %bb.14:                               # %.preheader.lr.ph
                                        #   in Loop: Header=BB6_7 Depth=2
	movq	(%rsp), %rcx                    # 8-byte Reload
	addq	%rcx, %rax
	addq	$8, %rax
	movq	96(%rsp), %rcx                  # 8-byte Reload
	movq	200(%rsp), %rdx                 # 8-byte Reload
	movq	208(%rsp), %r14                 # 8-byte Reload
.LBB6_15:                               # %.preheader
                                        #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_7 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB6_17 Depth 4
	cmpl	%r8d, %ebp
	jge	.LBB6_18
# %bb.16:                               # %.lr.ph272
                                        #   in Loop: Header=BB6_15 Depth=3
	movq	(%rax), %rdi
	addq	%rdx, %rdi
	xorl	%r11d, %r11d
.LBB6_17:                               #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_7 Depth=2
                                        #       Parent Loop BB6_15 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	leal	(%rcx,%r11), %r10d
	movslq	%r10d, %r10
	movss	(%r13,%r10,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rdi,%r11,4)
	incq	%r11
	cmpq	%r11, %r12
	jne	.LBB6_17
.LBB6_18:                               # %._crit_edge273
                                        #   in Loop: Header=BB6_15 Depth=3
	incq	%r14
	addq	%rbx, %rdx
	addq	40(%rsp), %rcx                  # 8-byte Folded Reload
	cmpq	280(%rsp), %r14                 # 8-byte Folded Reload
	jne	.LBB6_15
	jmp	.LBB6_45
.LBB6_34:                               #   in Loop: Header=BB6_7 Depth=2
	testq	%rdi, %rdi
	je	.LBB6_45
# %bb.35:                               # %.preheader251
                                        #   in Loop: Header=BB6_7 Depth=2
	cmpl	$2, %r9d
	jl	.LBB6_40
# %bb.36:                               # %.preheader244.lr.ph
                                        #   in Loop: Header=BB6_7 Depth=2
	movq	32(%rsp), %rcx                  # 8-byte Reload
	decq	%rcx
	imulq	40(%rsp), %rcx                  # 8-byte Folded Reload
	addq	48(%rsp), %rcx                  # 8-byte Folded Reload
	shlq	$4, %rcx
	movq	(%rsp), %rdx                    # 8-byte Reload
	addq	%rdx, %rcx
	addq	$8, %rcx
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	addq	%rax, %rdx
	addq	$8, %rdx
	xorl	%r14d, %r14d
.LBB6_37:                               # %.preheader244
                                        #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_7 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB6_48 Depth 4
	testl	%r8d, %r8d
	jle	.LBB6_38
# %bb.47:                               # %.lr.ph258
                                        #   in Loop: Header=BB6_37 Depth=3
	movq	%rbp, %rcx
	movq	%r15, %rbp
	leaq	1(%r14), %rdi
	movl	%edi, %r11d
	imull	%r8d, %r11d
	imull	%r8d, %r14d
	shlq	$2, %r11
	movq	24(%rsp), %r10                  # 8-byte Reload
	addq	(%r10), %r11
	shlq	$2, %r14
	addq	(%rdx), %r14
	xorl	%r10d, %r10d
	movq	248(%rsp), %r15                 # 8-byte Reload
.LBB6_48:                               #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_7 Depth=2
                                        #       Parent Loop BB6_37 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movss	(%r11,%r10,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%r14,%r10,4)
	incq	%r10
	cmpq	%r10, %r15
	jne	.LBB6_48
# %bb.49:                               #   in Loop: Header=BB6_37 Depth=3
	movq	%rdi, %r14
	movq	%rbp, %r15
	movq	%rcx, %rbp
	jmp	.LBB6_39
.LBB6_38:                               # %.preheader244.._crit_edge259_crit_edge
                                        #   in Loop: Header=BB6_37 Depth=3
	incq	%r14
	movq	%r14, %rdi
.LBB6_39:                               # %._crit_edge259
                                        #   in Loop: Header=BB6_37 Depth=3
	cmpq	%r15, %rdi
	jne	.LBB6_37
.LBB6_40:                               # %._crit_edge261
                                        #   in Loop: Header=BB6_7 Depth=2
	movq	216(%rsp), %rcx                 # 8-byte Reload
	cmpl	68(%rsp), %ecx                  # 4-byte Folded Reload
	jge	.LBB6_45
# %bb.41:                               # %.lr.ph264
                                        #   in Loop: Header=BB6_7 Depth=2
	movq	32(%rsp), %rcx                  # 8-byte Reload
	notq	%rcx
	movq	(%rsp), %rdx                    # 8-byte Reload
	movq	8(%rdx,%rax), %rax
	addq	160(%rsp), %rax                 # 8-byte Folded Reload
	addq	168(%rsp), %rax                 # 8-byte Folded Reload
	xorl	%edx, %edx
.LBB6_42:                               #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_7 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	xorps	%xmm0, %xmm0
	cmpq	%rcx, 256(%rsp)                 # 8-byte Folded Reload
	jg	.LBB6_44
# %bb.43:                               #   in Loop: Header=BB6_42 Depth=3
	movq	104(%rsp), %rdi                 # 8-byte Reload
	addl	%edx, %edi
	movslq	%edi, %rdi
	movss	(%r13,%rdi,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
.LBB6_44:                               #   in Loop: Header=BB6_42 Depth=3
	movss	%xmm0, (%rax,%rdx,4)
	incq	%rdx
	cmpq	%rdx, 264(%rsp)                 # 8-byte Folded Reload
	jne	.LBB6_42
.LBB6_45:                               # %.loopexit
                                        #   in Loop: Header=BB6_7 Depth=2
	movq	32(%rsp), %rax                  # 8-byte Reload
	incq	%rax
	movq	40(%rsp), %rcx                  # 8-byte Reload
	addq	%rcx, 104(%rsp)                 # 8-byte Folded Spill
	addl	%esi, 20(%rsp)                  # 4-byte Folded Spill
	addq	%rcx, 96(%rsp)                  # 8-byte Folded Spill
	cmpq	232(%rsp), %rax                 # 8-byte Folded Reload
	movq	48(%rsp), %rdi                  # 8-byte Reload
	jne	.LBB6_7
# %bb.46:                               #   in Loop: Header=BB6_2 Depth=1
	movq	152(%rsp), %r10                 # 8-byte Reload
	movl	64(%rsp), %edx                  # 4-byte Reload
	movq	128(%rsp), %r11                 # 8-byte Reload
	jmp	.LBB6_4
.LBB6_3:                                # %.preheader253.._crit_edge279_crit_edge
                                        #   in Loop: Header=BB6_2 Depth=1
	movq	%rdi, %r11
	notq	%r11
.LBB6_4:                                # %._crit_edge279
                                        #   in Loop: Header=BB6_2 Depth=1
	incq	%rdi
	incl	%r10d
	incl	%edx
                                        # kill: def $r11d killed $r11d killed $r11
	cmpq	%rcx, %rdi
	jne	.LBB6_2
.LBB6_5:                                # %._crit_edge285
	movq	(%rsp), %rax                    # 8-byte Reload
	addq	$296, %rsp                      # imm = 0x128
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_Z11makePatchesPfiiP7Patchesii, .Lfunc_end6-_Z11makePatchesPfiiP7Patchesii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z10computeG_aiif
.LCPI7_0:
	.quad	0x3fe0000000000000              # double 0.5
.LCPI7_1:
	.quad	0x401921fb544486e0              # double 6.2831853072000001
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI7_2:
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.text
	.globl	_Z10computeG_aiif
	.type	_Z10computeG_aiif,@function
_Z10computeG_aiif:                      # @_Z10computeG_aiif
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movl	%esi, %ebx
	movl	%edi, %r15d
	movl	%esi, %eax
	imull	%edi, %eax
	movslq	%eax, %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	testl	%r15d, %r15d
	jle	.LBB7_6
# %bb.1:                                # %.preheader.lr.ph
	leal	-1(%r15), %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	movsd	.LCPI7_0(%rip), %xmm1           # xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, 24(%rsp)                 # 8-byte Spill
	leal	-1(%rbx), %eax
	cvtsi2sd	%eax, %xmm2
	mulsd	%xmm1, %xmm2
	xorps	%xmm0, %xmm0
	cvtss2sd	12(%rsp), %xmm0                 # 4-byte Folded Reload
	movsd	.LCPI7_1(%rip), %xmm1           # xmm1 = mem[0],zero
	mulsd	%xmm0, %xmm1
	mulsd	%xmm0, %xmm1
	movl	%r15d, %eax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movl	%ebx, %r12d
	xorl	%r13d, %r13d
	movaps	.LCPI7_2(%rip), %xmm3           # xmm3 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
	xorl	%ebp, %ebp
	movsd	%xmm2, 48(%rsp)                 # 8-byte Spill
	movsd	%xmm1, 40(%rsp)                 # 8-byte Spill
.LBB7_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB7_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB7_2 Depth=1
	movl	%r13d, %eax
	movq	16(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorps	%xmm0, %xmm0
	cvtsi2sd	%ebp, %xmm0
	subsd	24(%rsp), %xmm0                 # 8-byte Folded Reload
	cvtsd2ss	%xmm0, %xmm0
	mulss	%xmm0, %xmm0
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	xorl	%r15d, %r15d
.LBB7_4:                                #   Parent Loop BB7_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r15d, %xmm0
	subsd	%xmm2, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	mulss	%xmm0, %xmm0
	addss	12(%rsp), %xmm0                 # 4-byte Folded Reload
	xorps	%xmm3, %xmm0
	cvtss2sd	%xmm0, %xmm0
	divsd	%xmm1, %xmm0
	callq	exp
	movaps	.LCPI7_2(%rip), %xmm3           # xmm3 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
	movsd	48(%rsp), %xmm2                 # 8-byte Reload
                                        # xmm2 = mem[0],zero
	movsd	.LCPI7_0(%rip), %xmm1           # xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm0
	movsd	40(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r14,%r15,4)
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB7_4
.LBB7_5:                                # %._crit_edge
                                        #   in Loop: Header=BB7_2 Depth=1
	incq	%rbp
	addl	%ebx, %r13d
	cmpq	32(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB7_2
.LBB7_6:                                # %._crit_edge27
	movq	16(%rsp), %rax                  # 8-byte Reload
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z10computeG_aiif, .Lfunc_end7-_Z10computeG_aiif
	.cfi_endproc
                                        # -- End function
	.globl	_Z19__device_stub__distPfS_S_S_if # -- Begin function _Z19__device_stub__distPfS_S_S_if
	.type	_Z19__device_stub__distPfS_S_S_if,@function
_Z19__device_stub__distPfS_S_S_if:      # @_Z19__device_stub__distPfS_S_S_if
	.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
	movss	%xmm0, (%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	$_Z4distPfS_S_S_if, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_Z19__device_stub__distPfS_S_S_if, .Lfunc_end8-_Z19__device_stub__distPfS_S_S_if
	.cfi_endproc
                                        # -- End function
	.globl	_Z18__device_stub__dimPfS_      # -- Begin function _Z18__device_stub__dimPfS_
	.type	_Z18__device_stub__dimPfS_,@function
_Z18__device_stub__dimPfS_:             # @_Z18__device_stub__dimPfS_
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.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	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z3dimPfS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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	_Z18__device_stub__dimPfS_, .Lfunc_end9-_Z18__device_stub__dimPfS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI10_0:
	.long	0x7f800000                      # float +Inf
.LCPI10_1:
	.long	0xbf800000                      # float -1
.LCPI10_2:
	.long	0x3f800000                      # float 1
.LCPI10_3:
	.long	0x3c23d70a                      # float 0.00999999977
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI10_4:
	.quad	0x408f400000000000              # double 1000
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	.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, %rbx
	movq	8(%rsi), %rdi
	callq	atoi
	movl	%eax, %ebp
	movq	16(%rbx), %rdi
	callq	atoi
	movl	%eax, %r15d
	movq	24(%rbx), %rdi
	callq	atoi
	movl	%eax, %r12d
	movq	32(%rbx), %rdi
	callq	atoi
	movl	%eax, %r13d
	movq	40(%rbx), %rbx
	movq	%rbx, %rdi
	callq	strlen
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	malloc
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
	movl	%r13d, 48(%rsp)                 # 4-byte Spill
	movl	%r12d, 80(%rsp)                 # 4-byte Spill
	imull	%r12d, %r13d
	movl	%r13d, 64(%rsp)                 # 4-byte Spill
	movslq	%r13d, %rbx
	leaq	(,%rbx,4), %rax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	leaq	160(%rsp), %rdi
	movl	$16384, %esi                    # imm = 0x4000
	callq	hipMalloc
	leaq	152(%rsp), %rdi
	movl	$16384, %esi                    # imm = 0x4000
	callq	hipMalloc
	leaq	192(%rsp), %rdi
	movl	$16384, %esi                    # imm = 0x4000
	callq	hipMalloc
	movq	%rbx, %rsi
	shlq	$34, %rsi
	sarq	$32, %rsi
	leaq	144(%rsp), %rdi
	movq	%rsi, 176(%rsp)                 # 8-byte Spill
	callq	hipMalloc
	shll	$12, %ebx
	movslq	%ebx, %rsi
	shlq	$2, %rsi
	leaq	136(%rsp), %rdi
	movq	%rsi, 72(%rsp)                  # 8-byte Spill
	callq	hipMalloc
	movl	$16384, %edi                    # imm = 0x4000
	callq	malloc
	movq	%rax, 104(%rsp)                 # 8-byte Spill
	movl	$16384, %edi                    # imm = 0x4000
	callq	malloc
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	movl	$16384, %edi                    # imm = 0x4000
	callq	malloc
	movq	%rax, 184(%rsp)                 # 8-byte Spill
	movl	%r15d, %eax
	imull	%ebp, %eax
	movl	%eax, 56(%rsp)                  # 4-byte Spill
	movslq	%eax, %rdi
	shlq	$4, %rdi
	callq	malloc
	movq	%rax, 112(%rsp)                 # 8-byte Spill
	movl	%ebp, %r12d
	movl	%r15d, 16(%rsp)                 # 4-byte Spill
	movl	%r15d, %r14d
	movl	%ebp, 20(%rsp)                  # 4-byte Spill
	testl	%ebp, %ebp
	jle	.LBB10_4
# %bb.1:                                # %.preheader259.lr.ph
	movq	112(%rsp), %rax                 # 8-byte Reload
	leaq	8(%rax), %rbp
	movq	%r12, %r15
	shlq	$4, %r15
	xorl	%ebx, %ebx
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	movq	32(%rsp), %r13                  # 8-byte Reload
.LBB10_2:                               # %.preheader259
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_8 Depth 2
	movq	%r14, %r12
	movq	%rbp, 40(%rsp)                  # 8-byte Spill
	cmpl	$0, 16(%rsp)                    # 4-byte Folded Reload
	jle	.LBB10_3
.LBB10_8:                               # %.lr.ph
                                        #   Parent Loop BB10_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	callq	malloc
	movq	%rax, (%rbp)
	addq	%r15, %rbp
	decq	%r12
	jne	.LBB10_8
.LBB10_3:                               # %._crit_edge
                                        #   in Loop: Header=BB10_2 Depth=1
	incq	%rbx
	movq	40(%rsp), %rbp                  # 8-byte Reload
	addq	$16, %rbp
	movq	8(%rsp), %r12                   # 8-byte Reload
	cmpq	%r12, %rbx
	jne	.LBB10_2
.LBB10_4:                               # %._crit_edge262
	movl	$67108864, %edi                 # imm = 0x4000000
	callq	malloc
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movl	$16384, %edi                    # imm = 0x4000
	callq	malloc
	movq	%rax, %r13
	movl	20(%rsp), %ebp                  # 4-byte Reload
	movl	%ebp, %edi
	movl	16(%rsp), %esi                  # 4-byte Reload
	movq	88(%rsp), %rdx                  # 8-byte Reload
	callq	_Z8readFileiiPc
	testl	%ebp, %ebp
	jle	.LBB10_5
# %bb.9:                                # %.preheader258.lr.ph
	movss	.LCPI10_0(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	xorl	%edi, %edi
	xorl	%ecx, %ecx
.LBB10_10:                              # %.preheader258
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_14 Depth 2
	cmpl	$0, 16(%rsp)                    # 4-byte Folded Reload
	jle	.LBB10_11
# %bb.13:                               # %.lr.ph265
                                        #   in Loop: Header=BB10_10 Depth=1
	movl	%edi, %edx
	leaq	(%rax,%rdx,4), %rdx
	xorl	%esi, %esi
.LBB10_14:                              #   Parent Loop BB10_10 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rdx,%rsi,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	minss	%xmm0, %xmm1
	incq	%rsi
	movaps	%xmm1, %xmm0
	cmpq	%rsi, %r14
	jne	.LBB10_14
	jmp	.LBB10_12
.LBB10_11:                              #   in Loop: Header=BB10_10 Depth=1
	movaps	%xmm0, %xmm1
.LBB10_12:                              # %._crit_edge266
                                        #   in Loop: Header=BB10_10 Depth=1
	incq	%rcx
	addl	%ebp, %edi
	movaps	%xmm1, %xmm0
	cmpq	%r12, %rcx
	jne	.LBB10_10
	jmp	.LBB10_6
.LBB10_5:
	movss	.LCPI10_0(%rip), %xmm1          # xmm1 = mem[0],zero,zero,zero
.LBB10_6:                               # %.preheader257
	movl	56(%rsp), %ecx                  # 4-byte Reload
	movl	%ecx, %r15d
	testl	%ecx, %ecx
	jle	.LBB10_7
# %bb.15:                               # %.lr.ph272.preheader
	movss	.LCPI10_1(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	xorl	%ecx, %ecx
	movq	104(%rsp), %r14                 # 8-byte Reload
	movq	96(%rsp), %r12                  # 8-byte Reload
.LBB10_16:                              # %.lr.ph272
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rax,%rcx,4), %xmm2            # xmm2 = mem[0],zero,zero,zero
	subss	%xmm1, %xmm2
	maxss	%xmm0, %xmm2
	incq	%rcx
	movaps	%xmm2, %xmm0
	cmpq	%rcx, %r15
	jne	.LBB10_16
	jmp	.LBB10_17
.LBB10_7:
	movss	.LCPI10_1(%rip), %xmm2          # xmm2 = mem[0],zero,zero,zero
	movq	104(%rsp), %r14                 # 8-byte Reload
	movq	96(%rsp), %r12                  # 8-byte Reload
.LBB10_17:                              # %._crit_edge273
	movss	%xmm2, 172(%rsp)                # 4-byte Spill
	movss	%xmm1, 8(%rsp)                  # 4-byte Spill
	movabsq	$4294967360, %rbx               # imm = 0x100000040
	movq	160(%rsp), %rdi
	movl	$16384, %edx                    # imm = 0x4000
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movq	%rax, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_19
# %bb.18:
	movq	160(%rsp), %rdi
	movq	152(%rsp), %rsi
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	172(%rsp), %xmm1                # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	callq	_Z28__device_stub__normalizationPfS_ff
.LBB10_19:
	movq	152(%rsp), %rsi
	movl	$16384, %edx                    # imm = 0x4000
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	cmpl	$0, 56(%rsp)                    # 4-byte Folded Reload
	jle	.LBB10_22
# %bb.20:                               # %.lr.ph277.preheader
	xorl	%ebx, %ebx
.LBB10_21:                              # %.lr.ph277
                                        # =>This Inner Loop Header: Depth=1
	movss	(%r14,%rbx,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 8(%rsp)                  # 4-byte Spill
	callq	_Z14AWGN_generatorv
	addss	8(%rsp), %xmm0                  # 4-byte Folded Reload
	movss	%xmm0, (%r12,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r15
	jne	.LBB10_21
.LBB10_22:                              # %._crit_edge278
	movl	$.L.str.8, %esi
	movq	%r14, %rdi
	movl	%ebp, %edx
	movl	16(%rsp), %ebx                  # 4-byte Reload
	movl	%ebx, %ecx
	callq	_Z5toTXTPfPcii
	movl	$.L.str.9, %esi
	movq	%r12, %rdi
	movl	%ebp, %edx
	movl	%ebx, %ecx
	callq	_Z5toTXTPfPcii
	movq	%r12, %rdi
	movl	%ebp, %esi
	movl	%ebx, %edx
	movq	112(%rsp), %rbx                 # 8-byte Reload
	movq	%rbx, %rcx
	movl	80(%rsp), %r15d                 # 4-byte Reload
	movl	%r15d, %r8d
	movl	48(%rsp), %r9d                  # 4-byte Reload
	callq	_Z11makePatchesPfiiP7Patchesii
	movq	72(%rsp), %rdi                  # 8-byte Reload
	callq	malloc
	movl	64(%rsp), %r14d                 # 4-byte Reload
	movl	%r14d, %r12d
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	movq	32(%rsp), %r8                   # 8-byte Reload
.LBB10_23:                              # %.preheader256
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_25 Depth 2
	testl	%r14d, %r14d
	jle	.LBB10_26
# %bb.24:                               # %.lr.ph280
                                        #   in Loop: Header=BB10_23 Depth=1
	movl	%r9d, %edx
	leaq	(%rax,%rdx,4), %rdx
	movq	%rcx, %rsi
	shlq	$4, %rsi
	movq	8(%rbx,%rsi), %rsi
	xorl	%edi, %edi
.LBB10_25:                              #   Parent Loop BB10_23 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%rsi,%rdi,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rdx,%rdi,4)
	incq	%rdi
	cmpq	%rdi, %r12
	jne	.LBB10_25
.LBB10_26:                              # %._crit_edge281
                                        #   in Loop: Header=BB10_23 Depth=1
	incq	%rcx
	addl	%r14d, %r9d
	cmpq	$4096, %rcx                     # imm = 0x1000
	jne	.LBB10_23
# %bb.27:
	movq	136(%rsp), %rdi
	shll	$12, %r8d
	movslq	%r8d, %rdx
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	movq	%rax, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movss	.LCPI10_2(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	movl	%r15d, %edi
	movl	48(%rsp), %esi                  # 4-byte Reload
	callq	_Z10computeG_aiif
	movq	144(%rsp), %rdi
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movq	%rax, %rsi
	movq	176(%rsp), %rbx                 # 8-byte Reload
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	leaq	128(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	movl	$16384, %edi                    # imm = 0x4000
	callq	malloc
	movq	%rax, %r15
	leaq	24(%rsp), %rdi
	movl	$16384, %esi                    # imm = 0x4000
	callq	hipMalloc
	xorl	%ebp, %ebp
	leaq	200(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	movq	8(%rbx), %rax
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	shlq	$2, %r12
.LBB10_28:                              # %.preheader255
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_33 Depth 2
	movq	%r13, %rbx
	testl	%r14d, %r14d
	movq	32(%rsp), %r13                  # 8-byte Reload
	jle	.LBB10_30
# %bb.29:                               # %.lr.ph284
                                        #   in Loop: Header=BB10_28 Depth=1
	movl	%r14d, %eax
	imull	%ebp, %eax
	movq	56(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %rsi
	movq	%r13, %rdi
	movq	%r12, %rdx
	callq	memcpy@PLT
.LBB10_30:                              # %._crit_edge285
                                        #   in Loop: Header=BB10_28 Depth=1
	movq	128(%rsp), %rdi
	movq	%r13, %rsi
	movq	176(%rsp), %rdx                 # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	movabsq	$4294967360, %rdi               # imm = 0x100000040
	movl	$1, %esi
	movq	%rdi, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_32
# %bb.31:                               #   in Loop: Header=BB10_28 Depth=1
	movq	24(%rsp), %rdi
	movq	128(%rsp), %rsi
	movq	136(%rsp), %rdx
	movq	144(%rsp), %rcx
	movl	%r14d, %r8d
	movss	.LCPI10_3(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	callq	_Z19__device_stub__distPfS_S_S_if
.LBB10_32:                              #   in Loop: Header=BB10_28 Depth=1
	movq	%rbp, %r14
	shlq	$14, %r14
	addq	40(%rsp), %r14                  # 8-byte Folded Reload
	movq	24(%rsp), %rsi
	movl	$16384, %edx                    # imm = 0x4000
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	%rbx, %r13
	movss	(%rbx,%rbp,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 8(%rsp)                  # 4-byte Spill
	movl	$16384, %edx                    # imm = 0x4000
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	memcpy@PLT
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	xorl	%eax, %eax
.LBB10_33:                              #   Parent Loop BB10_28 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	addss	(%r15,%rax,4), %xmm0
	incq	%rax
	cmpq	$4096, %rax                     # imm = 0x1000
	jne	.LBB10_33
# %bb.34:                               #   in Loop: Header=BB10_28 Depth=1
	movss	%xmm0, (%r13,%rbp,4)
	incq	%rbp
	cmpq	$4096, %rbp                     # imm = 0x1000
	movl	64(%rsp), %r14d                 # 4-byte Reload
	jne	.LBB10_28
# %bb.35:
	movq	%r13, %rbp
	movq	128(%rsp), %rdi
	callq	hipFree
	movq	144(%rsp), %rdi
	callq	hipFree
	leaq	120(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
	xorl	%r14d, %r14d
	movq	184(%rsp), %r13                 # 8-byte Reload
	movq	96(%rsp), %r12                  # 8-byte Reload
.LBB10_36:                              # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_39 Depth 2
	movq	%r14, %rbx
	shlq	$14, %rbx
	addq	40(%rsp), %rbx                  # 8-byte Folded Reload
	movl	$16384, %edx                    # imm = 0x4000
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	memcpy@PLT
	movq	24(%rsp), %rdi
	movl	$16384, %edx                    # imm = 0x4000
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	120(%rsp), %rdi
	leaq	(,%r14,4), %rsi
	addq	%rbp, %rsi
	movl	$4, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	movabsq	$4294967360, %rdi               # imm = 0x100000040
	movl	$1, %esi
	movq	%rdi, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_38
# %bb.37:                               #   in Loop: Header=BB10_36 Depth=1
	movq	24(%rsp), %rdi
	movq	120(%rsp), %rsi
	callq	_Z18__device_stub__dimPfS_
.LBB10_38:                              #   in Loop: Header=BB10_36 Depth=1
	movq	24(%rsp), %rsi
	movl	$16384, %edx                    # imm = 0x4000
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movss	(%r13,%r14,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 8(%rsp)                  # 4-byte Spill
	movl	$16384, %edx                    # imm = 0x4000
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	memcpy@PLT
	movss	8(%rsp), %xmm1                  # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	xorl	%eax, %eax
.LBB10_39:                              #   Parent Loop BB10_36 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r15,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	mulss	(%r12,%rax,4), %xmm0
	addss	%xmm0, %xmm1
	incq	%rax
	cmpq	$4096, %rax                     # imm = 0x1000
	jne	.LBB10_39
# %bb.40:                               #   in Loop: Header=BB10_36 Depth=1
	movss	%xmm1, (%r13,%r14,4)
	incq	%r14
	cmpq	$4096, %r14                     # imm = 0x1000
	jne	.LBB10_36
# %bb.41:
	movq	%r12, %r14
	xorl	%r12d, %r12d
	leaq	200(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movq	8(%rbx), %rax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	$.L.str.10, %esi
	movq	%r13, %rdi
	movl	20(%rsp), %edx                  # 4-byte Reload
	movl	16(%rsp), %ecx                  # 4-byte Reload
	callq	_Z5toTXTPfPcii
	movl	$16384, %edi                    # imm = 0x4000
	callq	malloc
	movq	%rax, %rbx
.LBB10_42:                              # =>This Inner Loop Header: Depth=1
	movss	(%r13,%r12,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	subss	(%r14,%r12,4), %xmm0
	movss	%xmm0, (%rbx,%r12,4)
	incq	%r12
	cmpq	$4096, %r12                     # imm = 0x1000
	jne	.LBB10_42
# %bb.43:
	movq	64(%rsp), %rax                  # 8-byte Reload
	subq	72(%rsp), %rax                  # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	movsd	.LCPI10_4(%rip), %xmm1          # xmm1 = mem[0],zero
	movq	8(%rsp), %rax                   # 8-byte Reload
	subq	80(%rsp), %rax                  # 8-byte Folded Reload
	cvtsi2sd	%rax, %xmm2
	mulsd	%xmm1, %xmm0
	divsd	%xmm1, %xmm2
	addsd	%xmm0, %xmm2
	divsd	%xmm1, %xmm2
	movsd	%xmm2, 8(%rsp)                  # 8-byte Spill
	movl	$.L.str.11, %esi
	movq	%rbx, %rdi
	movl	20(%rsp), %edx                  # 4-byte Reload
	movl	16(%rsp), %ecx                  # 4-byte Reload
	callq	_Z5toTXTPfPcii
	movl	$.L.str.12, %edi
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movq	160(%rsp), %rdi
	callq	hipFree
	movq	152(%rsp), %rdi
	callq	hipFree
	movq	192(%rsp), %rdi
	callq	hipFree
	movq	136(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	120(%rsp), %rdi
	callq	hipFree
	movq	88(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	104(%rsp), %rdi                 # 8-byte Reload
	callq	free
	movq	%r14, %rdi
	callq	free
	movq	32(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	48(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	%r15, %rdi
	callq	free
	movq	%rbp, %rdi
	callq	free
	movq	%r13, %rdi
	callq	free
	movq	%rbx, %rdi
	callq	free
	movq	40(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	112(%rsp), %rbx                 # 8-byte Reload
	movq	8(%rbx), %rdi
	callq	free
	movq	%rbx, %rdi
	callq	free
	xorl	%eax, %eax
	addq	$216, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end10:
	.size	main, .Lfunc_end10-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	.LBB11_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB11_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z13normalizationPfS_ff, %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	$_Z4distPfS_S_S_if, %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	$_Z3dimPfS_, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end11:
	.size	__hip_module_ctor, .Lfunc_end11-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB12_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB12_2:
	retq
.Lfunc_end12:
	.size	__hip_module_dtor, .Lfunc_end12-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"r"
	.size	.L.str, 2

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%f,"
	.size	.L.str.2, 4

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"%lf,"
	.size	.L.str.4, 5

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%lf"
	.size	.L.str.5, 4

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

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"File %s saved.\n"
	.size	.L.str.7, 16

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

	.type	_Z4distPfS_S_S_if,@object       # @_Z4distPfS_S_S_if
	.globl	_Z4distPfS_S_S_if
	.p2align	3, 0x0
_Z4distPfS_S_S_if:
	.quad	_Z19__device_stub__distPfS_S_S_if
	.size	_Z4distPfS_S_S_if, 8

	.type	_Z3dimPfS_,@object              # @_Z3dimPfS_
	.globl	_Z3dimPfS_
	.p2align	3, 0x0
_Z3dimPfS_:
	.quad	_Z18__device_stub__dimPfS_
	.size	_Z3dimPfS_, 8

	.type	.L.str.8,@object                # @.str.8
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.8:
	.asciz	"normCuda.txt"
	.size	.L.str.8, 13

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"JCuda.txt"
	.size	.L.str.9, 10

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"IfCuda.txt"
	.size	.L.str.10, 11

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"DifCuda.txt"
	.size	.L.str.11, 12

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Time: %f sec"
	.size	.L.str.12, 13

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z13normalizationPfS_ff"
	.size	.L__unnamed_1, 24

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z4distPfS_S_S_if"
	.size	.L__unnamed_2, 18

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z3dimPfS_"
	.size	.L__unnamed_3, 11

	.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	"Error Reading File"
	.size	.Lstr, 19

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z28__device_stub__normalizationPfS_ff
	.addrsig_sym _Z19__device_stub__distPfS_S_S_if
	.addrsig_sym _Z18__device_stub__dimPfS_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z13normalizationPfS_ff
	.addrsig_sym _Z4distPfS_S_S_if
	.addrsig_sym _Z3dimPfS_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z13normalizationPfS_ff ; -- Begin function _Z13normalizationPfS_ff
	.globl	_Z13normalizationPfS_ff
	.p2align	8
	.type	_Z13normalizationPfS_ff,@function
_Z13normalizationPfS_ff:                ; @_Z13normalizationPfS_ff
; %bb.0:
	s_load_b32 s2, s[0:1], 0x24
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e32 0x1000, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b64 s[0:1], s[0:1], 0x10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v1, vcc_lo
	global_load_b32 v2, v[2:3], off
	s_waitcnt vmcnt(0)
	v_subrev_f32_e32 v2, s0, v2
	v_div_scale_f32 v3, null, s1, s1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v4, v3
	s_waitcnt_depctr 0xfff
	v_fma_f32 v5, -v3, v4, 1.0
	v_fmac_f32_e32 v4, v5, v4
	v_div_scale_f32 v5, vcc_lo, v2, s1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v6, v5, v4
	v_fma_f32 v7, -v3, v6, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v6, v7, v4
	v_fma_f32 v3, -v3, v6, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_div_fmas_f32 v3, v3, v4, v6
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	v_div_fixup_f32 v2, v3, s1, v2
	global_store_b32 v[0:1], v2, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13normalizationPfS_ff
		.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 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_end0:
	.size	_Z13normalizationPfS_ff, .Lfunc_end0-_Z13normalizationPfS_ff
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 240
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 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: 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	_Z4distPfS_S_S_if       ; -- Begin function _Z4distPfS_S_S_if
	.globl	_Z4distPfS_S_S_if
	.p2align	8
	.type	_Z4distPfS_S_S_if,@function
_Z4distPfS_S_S_if:                      ; @_Z4distPfS_S_S_if
; %bb.0:
	s_load_b32 s2, s[0:1], 0x34
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e32 0x1000, v1
	s_cbranch_execz .LBB1_6
; %bb.1:                                ; %.preheader
	s_clause 0x1
	s_load_b64 s[2:3], s[0:1], 0x20
	s_load_b256 s[4:11], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s2, 1
	s_cbranch_scc1 .LBB1_4
; %bb.2:                                ; %.lr.ph
	v_mul_lo_u32 v2, v1, s2
	v_mov_b32_e32 v0, 0
	s_mov_b32 s1, 0x3e76c4e1
	s_delay_alu instid0(VALU_DEP_2) | 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, s8, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v3, vcc_lo
.LBB1_3:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v4, v[2:3], off
	s_load_b32 s0, s[6:7], 0x0
	s_load_b32 s8, s[10:11], 0x0
	s_add_i32 s2, s2, -1
	s_add_u32 s10, s10, 4
	s_addc_u32 s11, s11, 0
	s_add_u32 s6, s6, 4
	s_addc_u32 s7, s7, 0
	s_cmp_eq_u32 s2, 0
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_sub_f32_e32 v4, s0, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_frexp_mant_f32_e64 v5, |v4|
	v_cmp_gt_f32_e32 vcc_lo, 0x3f2aaaab, v5
	v_cndmask_b32_e64 v7, 0, 1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f32 v5, v5, v7
	v_add_f32_e32 v7, 1.0, v5
	v_frexp_exp_i32_f32_e32 v6, v4
	v_cmp_neq_f32_e64 s0, 0x7f800000, |v4|
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v9, v7
	v_subrev_co_ci_u32_e32 v6, vcc_lo, 0, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f32_i32_e32 v6, v6
	v_dual_add_f32 v8, -1.0, v5 :: v_dual_mul_f32 v11, 0x3f317218, v6
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v12, v8, v9
	v_add_f32_e32 v10, -1.0, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v5, v5, v10
	v_fma_f32 v10, 0x3f317218, v6, -v11
	v_fmac_f32_e32 v10, 0xb102e308, v6
	v_mul_f32_e32 v6, v7, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v7, v12, v7, -v6
	v_fmac_f32_e32 v7, v12, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v5, v6, v7
	v_sub_f32_e32 v13, v8, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v8, v8, v13
	v_dual_sub_f32 v6, v5, v6 :: v_dual_sub_f32 v5, v8, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v6, v6, v7
	v_add_f32_e32 v5, v6, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v5, v13, v5
	v_mul_f32_e32 v5, v9, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v12, v5
	v_sub_f32_e32 v7, v6, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_mul_f32 v8, v6, v6 :: v_dual_sub_f32 v5, v5, v7
	v_fma_f32 v7, v6, v6, -v8
	v_ldexp_f32 v9, v6, 1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f32_e32 v12, v5, v5
	v_ldexp_f32 v13, v5, 1
	v_fmac_f32_e32 v7, v6, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v12, v8, v7
	v_fmaak_f32 v14, s1, v12, 0x3e91f4c4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmaak_f32 v14, v12, v14, 0x3ecccdef
	v_sub_f32_e32 v8, v12, v8
	v_dual_mul_f32 v15, v6, v12 :: v_dual_mul_f32 v16, v12, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v7, v7, v8
	v_fma_f32 v8, v12, v6, -v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fmac_f32_e32 v8, v12, v5
	v_fma_f32 v5, v12, v14, -v16
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v8, v7, v6
	v_fmac_f32_e32 v5, v7, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v7, v16, v5
	v_sub_f32_e32 v14, v7, v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v5, v5, v14
	v_dual_add_f32 v5, 0x31739010, v5 :: v_dual_add_f32 v6, v15, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v12, v6, v15
	v_dual_add_f32 v15, 0x3f2aaaaa, v7 :: v_dual_sub_f32 v8, v8, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v12, 0xbf2aaaaa, v15
	v_sub_f32_e32 v7, v7, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v5, v5, v7
	v_add_f32_e32 v7, v15, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v12, v15, v7
	v_dual_mul_f32 v14, v6, v7 :: v_dual_add_f32 v5, v5, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v12, v6, v7, -v14
	v_fmac_f32_e32 v12, v6, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v12, v8, v7
	v_add_f32_e32 v5, v14, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v9, v5
	v_sub_f32_e32 v7, v5, v14
	v_dual_sub_f32 v7, v12, v7 :: v_dual_sub_f32 v8, v6, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f32_e32 v7, v13, v7
	v_dual_sub_f32 v5, v5, v8 :: v_dual_add_f32 v8, v11, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f32_e32 v5, v7, v5
	v_sub_f32_e32 v7, v8, v11
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v9, v6, v5
	v_dual_sub_f32 v7, v10, v7 :: v_dual_add_f32 v10, v8, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v6, v9, v6 :: v_dual_sub_f32 v11, v10, v8
	v_dual_sub_f32 v5, v5, v6 :: v_dual_sub_f32 v6, v10, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v6, v8, v6 :: v_dual_sub_f32 v9, v9, v11
	v_dual_add_f32 v11, v7, v5 :: v_dual_add_f32 v6, v9, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v8, v11, v7
	v_add_f32_e32 v6, v11, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v9, v11, v8
	v_dual_sub_f32 v5, v5, v8 :: v_dual_add_f32 v8, v10, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v7, v7, v9
	v_sub_f32_e32 v9, v8, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v6, v6, v9 :: v_dual_add_f32 v5, v5, v7
	v_add_f32_e32 v5, v5, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v8, v5
	v_sub_f32_e32 v7, v6, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_sub_f32 v5, v5, v7 :: v_dual_add_f32 v8, v6, v6
	v_mul_f32_e32 v9, 0, v6
	v_fma_f32 v6, v6, 2.0, -v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v9, 2.0, v5
	v_cmp_class_f32_e64 vcc_lo, v8, 0x204
	v_add_f32_e32 v5, v6, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v8, v5
	v_cndmask_b32_e32 v7, v6, v8, vcc_lo
	v_sub_f32_e32 v6, v6, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_eq_f32_e32 vcc_lo, 0x42b17218, v7
	v_sub_f32_e32 v5, v5, v6
	v_cndmask_b32_e64 v9, 0, 0x37000000, vcc_lo
	v_cmp_neq_f32_e64 vcc_lo, 0x7f800000, |v7|
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_sub_f32_e32 v10, v7, v9
	v_cndmask_b32_e32 v5, 0, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_f32_e32 v11, 0x3fb8aa3b, v10
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v10
	v_add_f32_e32 v5, v9, v5
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f32 v12, 0x3fb8aa3b, v10, -v11
	v_rndne_f32_e32 v13, v11
	v_dual_fmac_f32 v12, 0x32a5705f, v10 :: v_dual_sub_f32 v11, v11, v13
	v_cvt_i32_f32_e32 v8, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v11, v11, v12
	v_exp_f32_e32 v11, v11
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v6, v11, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v6, 0, v6, vcc_lo
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v10
	v_cndmask_b32_e32 v6, 0x7f800000, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f32 v5, v6, v5, v6
	v_cmp_eq_f32_e32 vcc_lo, 0x7f800000, v6
	v_cndmask_b32_e32 v5, v5, v6, vcc_lo
	v_add_co_u32 v2, vcc_lo, v2, 4
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v5, 0x7f800000, |v5|, s0
	v_cmp_neq_f32_e64 s0, 0, v4
	v_cndmask_b32_e64 v4, 0, v5, s0
	s_delay_alu instid0(VALU_DEP_1)
	v_fmac_f32_e32 v0, s8, v4
	s_cbranch_scc0 .LBB1_3
	s_branch .LBB1_5
.LBB1_4:
	v_mov_b32_e32 v0, 0
.LBB1_5:                                ; %Flow49
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v2, 0x4f800000, v0
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v0
	v_cndmask_b32_e32 v0, v0, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_sqrt_f32_e32 v2, v0
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v3, -1, v2
	v_add_nc_u32_e32 v4, 1, v2
	v_fma_f32 v5, -v3, v2, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v6, -v4, v2, v0
	v_cmp_ge_f32_e64 s0, 0, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v2, v2, v3, s0
	v_cmp_lt_f32_e64 s0, 0, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v2, v2, v4, s0
	s_mov_b32 s0, 0x3e76c4e1
	v_mul_f32_e32 v3, 0x37800000, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v2, v2, v3, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v0, 0x260
	v_cndmask_b32_e32 v0, v2, v0, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_frexp_mant_f32_e64 v2, |v0|
	v_cmp_gt_f32_e32 vcc_lo, 0x3f2aaaab, v2
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v3, 0, 1, vcc_lo
	v_ldexp_f32 v2, v2, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f32_e32 v3, 1.0, v2
	v_add_f32_e32 v5, -1.0, v2
	v_add_f32_e32 v7, -1.0, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v2, v2, v7
	v_rcp_f32_e32 v4, v3
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v6, v5, v4
	v_mul_f32_e32 v8, v3, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v3, v6, v3, -v8
	v_fmac_f32_e32 v3, v6, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v2, v8, v3
	v_dual_sub_f32 v7, v5, v2 :: v_dual_sub_f32 v8, v2, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v5, v5, v7
	v_dual_sub_f32 v3, v8, v3 :: v_dual_sub_f32 v2, v5, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v2, v3, v2
	v_add_f32_e32 v2, v7, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v2, v4, v2
	v_add_f32_e32 v3, v6, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v4, v3, v6
	v_dual_mul_f32 v5, v3, v3 :: v_dual_sub_f32 v2, v2, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v4, v3, v3, -v5
	v_add_f32_e32 v6, v2, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v4, v3, v6
	v_add_f32_e32 v6, v5, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_fmaak_f32 v7, s0, v6, 0x3e91f4c4
	v_sub_f32_e32 v5, v6, v5
	v_cmp_neq_f32_e64 s0, 0x7f800000, |v0|
	v_dual_fmaak_f32 v7, v6, v7, 0x3ecccdef :: v_dual_sub_f32 v4, v4, v5
	v_mul_f32_e32 v10, v3, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v8, v6, v7
	v_fma_f32 v11, v6, v3, -v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v5, v6, v7, -v8
	v_fmac_f32_e32 v11, v6, v2
	v_ldexp_f32 v2, v2, 1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v5, v4, v7
	v_fmac_f32_e32 v11, v4, v3
	v_ldexp_f32 v3, v3, 1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_add_f32 v7, v8, v5 :: v_dual_add_f32 v6, v10, v11
	v_dual_sub_f32 v8, v7, v8 :: v_dual_add_f32 v9, 0x3f2aaaaa, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v5, v5, v8 :: v_dual_add_f32 v8, 0xbf2aaaaa, v9
	v_add_f32_e32 v5, 0x31739010, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v7, v7, v8
	v_add_f32_e32 v5, v5, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v4, v9, v5
	v_sub_f32_e32 v7, v9, v4
	v_sub_f32_e32 v9, v6, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f32_e32 v5, v5, v7
	v_dual_sub_f32 v9, v11, v9 :: v_dual_mul_f32 v8, v6, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v7, v6, v4, -v8
	v_fmac_f32_e32 v7, v6, v5
	v_frexp_exp_i32_f32_e32 v5, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v7, v9, v4
	v_subrev_co_ci_u32_e32 v4, vcc_lo, 0, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f32_e32 v5, v8, v7
	v_cvt_f32_i32_e32 v4, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v8, v5, v8
	v_add_f32_e32 v6, v3, v5
	v_sub_f32_e32 v7, v7, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_mul_f32 v9, 0x3f317218, v4 :: v_dual_add_f32 v2, v2, v7
	v_fma_f32 v8, 0x3f317218, v4, -v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v3, v6, v3 :: v_dual_fmamk_f32 v4, v4, 0xb102e308, v8
	v_sub_f32_e32 v3, v5, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v2, v2, v3
	v_add_f32_e32 v5, v6, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v6, v5, v6
	v_dual_add_f32 v3, v9, v4 :: v_dual_sub_f32 v2, v2, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v9, v3, v9
	v_sub_f32_e32 v4, v4, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_add_f32 v7, v3, v5 :: v_dual_add_f32 v6, v4, v2
	v_sub_f32_e32 v8, v7, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v10, v7, v8
	v_sub_f32_e32 v5, v5, v8
	v_sub_f32_e32 v3, v3, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_f32_e32 v3, v5, v3
	v_sub_f32_e32 v5, v6, v4
	v_sub_f32_e32 v2, v2, v5
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f32_e32 v3, v6, v3
	v_sub_f32_e32 v6, v6, v5
	v_add_f32_e32 v8, v7, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v4, v4, v6
	v_dual_sub_f32 v5, v8, v7 :: v_dual_add_f32 v2, v2, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v3, v3, v5
	v_add_f32_e32 v2, v2, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v3, v8, v2
	v_sub_f32_e32 v4, v3, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_sub_f32 v2, v2, v4 :: v_dual_add_f32 v5, v3, v3
	v_mul_f32_e32 v6, 0, v3
	v_fma_f32 v3, v3, 2.0, -v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v6, 2.0, v2
	v_cmp_class_f32_e64 vcc_lo, v5, 0x204
	v_add_f32_e32 v2, v3, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v3, v5, v2
	v_cndmask_b32_e32 v4, v3, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_cmp_eq_f32_e32 vcc_lo, 0x42b17218, v4
	v_cndmask_b32_e64 v6, 0, 0x37000000, vcc_lo
	v_cmp_neq_f32_e64 vcc_lo, 0x7f800000, |v4|
	v_sub_f32_e32 v7, v4, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v8, 0x3fb8aa3b, v7
	v_fma_f32 v9, 0x3fb8aa3b, v7, -v8
	v_rndne_f32_e32 v10, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_dual_fmac_f32 v9, 0x32a5705f, v7 :: v_dual_sub_f32 v8, v8, v10
	v_sub_f32_e32 v3, v3, v5
	v_cvt_i32_f32_e32 v5, v10
	v_add_f32_e32 v8, v8, v9
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v2, v2, v3
	v_exp_f32_e32 v8, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v2, 0, v2, vcc_lo
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v7
	v_add_f32_e32 v2, v6, v2
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v3, v8, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v3, 0, v3, vcc_lo
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v7
	v_cndmask_b32_e32 v3, 0x7f800000, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f32 v2, v3, v2, v3
	v_cmp_eq_f32_e32 vcc_lo, 0x7f800000, v3
	v_cndmask_b32_e32 v2, v2, v3, vcc_lo
	v_cmp_neq_f32_e32 vcc_lo, 0, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v2, 0x7f800000, |v2|, s0
	v_cndmask_b32_e32 v0, 0, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f32 v2, null, s3, s3, -v0
	v_div_scale_f32 v5, vcc_lo, -v0, s3, -v0
	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(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v3, v4, v3
	v_mul_f32_e32 v4, v5, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v6, -v2, v4, v5
	v_fmac_f32_e32 v4, v6, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v2, -v2, v4, v5
	v_div_fmas_f32 v2, v2, v3, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f32 v3, v2, s3, -v0
	v_mul_f32_e32 v0, 0x3fb8aa3b, v3
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2ce8ed0, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f32 v2, 0x3fb8aa3b, v3, -v0
	v_rndne_f32_e32 v4, v0
	v_fmac_f32_e32 v2, 0x32a5705f, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_f32_e32 v0, v0, v4
	v_add_f32_e32 v0, v0, v2
	v_cvt_i32_f32_e32 v2, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_exp_f32_e32 v0, v0
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v0, v0, v2
	v_ashrrev_i32_e32 v2, 31, v1
	v_cndmask_b32_e32 v4, 0, v0, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	v_cmp_nlt_f32_e32 vcc_lo, 0x42b17218, v3
	v_cndmask_b32_e32 v2, 0x7f800000, v4, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	global_store_b32 v[0:1], v2, off
.LBB1_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z4distPfS_S_S_if
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.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 17
		.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	_Z4distPfS_S_S_if, .Lfunc_end1-_Z4distPfS_S_S_if
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 2452
; NumSgprs: 18
; NumVgprs: 17
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 17
; 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	_Z3dimPfS_              ; -- Begin function _Z3dimPfS_
	.globl	_Z3dimPfS_
	.p2align	8
	.type	_Z3dimPfS_,@function
_Z3dimPfS_:                             ; @_Z3dimPfS_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x1c
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e32 0x1000, v1
	s_cbranch_execz .LBB2_2
; %bb.1:
	s_load_b128 s[0:3], 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[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_load_b32 s0, s[2:3], 0x0
	global_load_b32 v2, v[0:1], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_div_scale_f32 v3, null, s0, s0, v2
	v_rcp_f32_e32 v4, v3
	s_waitcnt_depctr 0xfff
	v_fma_f32 v5, -v3, v4, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v4, v5, v4
	v_div_scale_f32 v5, vcc_lo, v2, s0, v2
	v_mul_f32_e32 v6, v5, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v7, -v3, v6, v5
	v_fmac_f32_e32 v6, v7, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v3, -v3, v6, v5
	v_div_fmas_f32 v3, v3, v4, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fixup_f32 v2, v3, s0, v2
	global_store_b32 v[0:1], v2, off
.LBB2_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z3dimPfS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.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 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	_Z3dimPfS_, .Lfunc_end2-_Z3dimPfS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 224
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 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: 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
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
