#include <cuda_profiler_api.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

#define AxCheckError(err) CheckError(err,__FUNCTION__, __LINE__)
#define AxCheckErrorMsg(err, msg) CheckErrorMsg(err, msg, __FUNCTION__, __LINE__)

void GenerateTestData(int const N, float* const input, float* const filtered, 
                      float* const ref);
void CompareData(int const N, float const* const a, float const* const b);

void CheckError(cudaError_t const err, char const* const fun, const int line);
void CheckErrorMsg(cudaError_t const err, char const* const msg, char const* const fun, int const line);

#define BLOCK_SIZE  512


float const FILTER_COEFFS[21] = {0.005f,0.01f, 0.02f, 0.03f, 0.04f, 
                                 0.05f, 0.06f, 0.07f, 0.25f, 0.75f, 
                                 1.0f,  0.75f, 0.25f, 0.07f, 0.06f, 
                                 0.05f, 0.04f, 0.03f, 0.02f, 0.01f, 0.005f};

// Armazenado na Constant Memory
__device__ __constant__ float FilterCoeffs[21] =  {0.005f,0.01f, 0.02f, 0.03f, 0.04f, 
                                                   0.05f, 0.06f, 0.07f, 0.25f, 0.75f, 
                                                   1.0f,  0.75f, 0.25f, 0.07f, 0.06f, 
                                                   0.05f, 0.04f, 0.03f, 0.02f, 0.01f, 0.005f};


// Usa apenas a Global Memory
__global__ void GlobalFilter(float* const input, float* const filtered, int const N)
{
   
    int gIdx = blockIdx.x * blockDim.x + threadIdx.x;
    
    if (10 < gIdx && gIdx < N - 10)
    {
        float sum;
        sum = input[gIdx - 10] * FilterCoeffs[ 0] +
              input[gIdx -  9] * FilterCoeffs[ 1] + 
              input[gIdx -  8] * FilterCoeffs[ 2] + 
              input[gIdx -  7] * FilterCoeffs[ 3] +
              input[gIdx -  6] * FilterCoeffs[ 4] +
              input[gIdx -  5] * FilterCoeffs[ 5] + 
              input[gIdx -  4] * FilterCoeffs[ 6] + 
              input[gIdx -  3] * FilterCoeffs[ 7] +
              input[gIdx -  2] * FilterCoeffs[ 8] + 
              input[gIdx -  1] * FilterCoeffs[ 9] + 
              input[gIdx     ] * FilterCoeffs[10] + 
              input[gIdx +  1] * FilterCoeffs[11] + 
              input[gIdx +  2] * FilterCoeffs[12] +
              input[gIdx +  3] * FilterCoeffs[13] +
              input[gIdx +  4] * FilterCoeffs[14] +
              input[gIdx +  5] * FilterCoeffs[15] +
              input[gIdx +  6] * FilterCoeffs[16] +
              input[gIdx +  7] * FilterCoeffs[17] +
              input[gIdx +  8] * FilterCoeffs[18] +
              input[gIdx +  9] * FilterCoeffs[19] +
              input[gIdx + 10] * FilterCoeffs[20];

        filtered[gIdx] = sum;
    }
}

// Usa a Shared Memory
__global__ void SharedFilter(float* const input, float* const filtered, int const N)
{
    __shared__ float inputS[BLOCK_SIZE+20];
    int sIdx = threadIdx.x;
    long long gIdx = blockIdx.x * blockDim.x + threadIdx.x;
    
	// Dez valores extras no ?ndice
    int sIdxShift = sIdx + 10;

    // Todas as threads fazem a leitura de um elemento na Global Memory e armazenam na Shared Memory.
    if (gIdx < N)
    {
        inputS[sIdxShift] = input[gIdx];
    }

    // As primeiras 10 threads no bloco armazenam os 10 valores extras nos 10 primeiros elementos da Shared Memory
    if(sIdx < 10 && blockIdx.x != 0)
    {
        inputS[sIdx] = input[gIdx - 10];
    }

    // As ?ltimas 10 threads armazenam os 10 valores extras na Shared Memory 
    if(sIdxShift >= blockDim.x && blockIdx.x < gridDim.x - 1)
    {
        inputS[sIdxShift + 10] = input[gIdx + 10];
    }

    __syncthreads();
    
    float sum;
    sum = inputS[sIdxShift - 10] * FilterCoeffs[ 0] +
          inputS[sIdxShift -  9] * FilterCoeffs[ 1] + 
          inputS[sIdxShift -  8] * FilterCoeffs[ 2] + 
          inputS[sIdxShift -  7] * FilterCoeffs[ 3] +
          inputS[sIdxShift -  6] * FilterCoeffs[ 4] +
          inputS[sIdxShift -  5] * FilterCoeffs[ 5] + 
          inputS[sIdxShift -  4] * FilterCoeffs[ 6] + 
          inputS[sIdxShift -  3] * FilterCoeffs[ 7] +
          inputS[sIdxShift -  2] * FilterCoeffs[ 8] + 
          inputS[sIdxShift -  1] * FilterCoeffs[ 9] + 
          inputS[sIdxShift     ] * FilterCoeffs[10] + 
          inputS[sIdxShift +  1] * FilterCoeffs[11] + 
          inputS[sIdxShift +  2] * FilterCoeffs[12] +
          inputS[sIdxShift +  3] * FilterCoeffs[13] +
          inputS[sIdxShift +  4] * FilterCoeffs[14] +
          inputS[sIdxShift +  5] * FilterCoeffs[15] +
          inputS[sIdxShift +  6] * FilterCoeffs[16] +
          inputS[sIdxShift +  7] * FilterCoeffs[17] +
          inputS[sIdxShift +  8] * FilterCoeffs[18] +
          inputS[sIdxShift +  9] * FilterCoeffs[19] +
          inputS[sIdxShift + 10] * FilterCoeffs[20];

    filtered[gIdx] = sum;
}

int main()
{
    float *inputH, *filteredH, *refH;
    float *inputD, *filteredD;
    cudaError_t e = cudaSuccess;
    dim3 gridSize, gridSize2;
    dim3 blockSize;

    int const N = 16*1024*1024;
    int const N_BYTES = N * sizeof(float);

    inputH =    (float*)malloc(N_BYTES);
    filteredH = (float*)malloc(N_BYTES);
    refH =      (float*)malloc(N_BYTES);

    GenerateTestData(N, inputH, filteredH, refH);

    e = cudaMalloc((void**)&inputD, N_BYTES);
    AxCheckError(e);
    e = cudaMalloc((void**)&filteredD, N_BYTES);
    AxCheckError(e);

    e = cudaMemcpy(inputD, inputH, N_BYTES, cudaMemcpyHostToDevice);
    AxCheckError(e);

    gridSize.x = ((N + BLOCK_SIZE - 1) / BLOCK_SIZE); 
    blockSize.x = BLOCK_SIZE; 

    int const TRIALS = 5;
    std::vector<float> sharedTimes;
    std::vector<float> globalTimes;
    cudaEvent_t start, stop;

    e = cudaEventCreate(&start);
    AxCheckError(e);
    e = cudaEventCreate(&stop);
    AxCheckError(e);

    e = cudaProfilerStart();

    for(int i = 0; i < TRIALS; i++)
    {
        e = cudaEventRecord(start, 0);
        SharedFilter<<<gridSize, blockSize>>>(inputD, filteredD, N);
        e = cudaEventRecord(stop, 0);
        AxCheckError(cudaDeviceSynchronize());
        AxCheckError(cudaGetLastError());

        float elapsed;
        e = cudaEventElapsedTime(&elapsed, start, stop);
        sharedTimes.push_back(elapsed);

        e = cudaEventRecord(start, 0);
        GlobalFilter<<<gridSize, blockSize>>>(inputD, filteredD, N);
        e = cudaEventRecord(stop, 0);
        AxCheckError(cudaDeviceSynchronize());
        AxCheckError(cudaGetLastError());

        e = cudaEventElapsedTime(&elapsed, start, stop);
        globalTimes.push_back(elapsed);
    }

    e = cudaProfilerStop();

    float averageTime = std::accumulate(globalTimes.begin(), globalTimes.end(), 0.0f)/globalTimes.size();
    std::cout << "Global Memory time (ms): " << averageTime << std::endl;
    averageTime = std::accumulate(sharedTimes.begin(), sharedTimes.end(), 0.0f)/sharedTimes.size();
    std::cout << "Shared Memory time (ms): " << averageTime << std::endl;

    /* Executando o kernel */
    SharedFilter<<<gridSize, blockSize>>>(inputD, filteredD, N);
    AxCheckError(cudaDeviceSynchronize());
    AxCheckError(cudaGetLastError());

    /* N?o geramos zeros para os 10 primeiros / ?ltimos 10 elementos no kernel. Na verdade, geramos valores usando
??????? Shared Memory n?o inicializada como entradas, logo elas est?o incorretas. Portanto, n?o os copiamos e confiamos
??????? no fato de que o filtro H foi previamente ajustado para zero. */
    e = cudaMemcpy(filteredH + 10, filteredD + 10, N_BYTES - 20 * sizeof(float), cudaMemcpyDeviceToHost);
    AxCheckError(e);

    std::cout << "Validando o output do SharedFilter..." << std::endl;
    CompareData(N, filteredH, refH);

    /* Executando o kernel */
    GlobalFilter<<<gridSize, blockSize>>>(inputD, filteredD, N);
    AxCheckError(cudaDeviceSynchronize());
    AxCheckError(cudaGetLastError());

    /* N?s n?o geramos sa?da para os 10 primeiros / ?ltimos 10 elementos no kernel. Portanto, n?o os copiamos e confiamos
???? no fato de que o filtroH foi previamente ajustado para zero. */
    e = cudaMemcpy(filteredH + 10, filteredD + 10, N_BYTES - 20 * sizeof(float), cudaMemcpyDeviceToHost);
    AxCheckError(e);

    std::cout << "Validando o output do GlobalFilter..." << std::endl;
    CompareData(N, filteredH, refH);

    cudaFree(inputD); cudaFree(filteredD);
    free(inputH); free(filteredH); free(refH);

    AxCheckError(cudaDeviceReset());

	getchar();

    return 0;
}

void GenerateTestData(int const N, float* const input, float* const filtered, float* const ref)
{
    int i;

    for(i = 0; i < N; i++)
    {
        //input[i] = ((float)rand())/RAND_MAX;
        input[i] = i;
        filtered[i] = 0.0f;
    }

    memset(ref, 0, N*sizeof(float) );

    /* N?o podemos calcular um filtro de 21 pontos nas bordas da nossa matriz.
??????? Se todos os 21 pontos n?o estiverem dispon?veis, o resultado esperado ? zero! */
    for(i = 10; i < N-10; i++)
    {   
        ref[i] = (input[i-10]*FILTER_COEFFS[ 0] +
                  input[i- 9]*FILTER_COEFFS[ 1] +
                  input[i- 8]*FILTER_COEFFS[ 2] +
                  input[i- 7]*FILTER_COEFFS[ 3] +
                  input[i- 6]*FILTER_COEFFS[ 4] +
                  input[i- 5]*FILTER_COEFFS[ 5] +
                  input[i- 4]*FILTER_COEFFS[ 6] +
                  input[i- 3]*FILTER_COEFFS[ 7] +
                  input[i- 2]*FILTER_COEFFS[ 8] +
                  input[i- 1]*FILTER_COEFFS[ 9] + 
                  input[i   ]*FILTER_COEFFS[10] + 
                  input[i+ 1]*FILTER_COEFFS[11] + 
                  input[i+ 2]*FILTER_COEFFS[12] + 
                  input[i+ 3]*FILTER_COEFFS[13] + 
                  input[i+ 4]*FILTER_COEFFS[14] + 
                  input[i+ 5]*FILTER_COEFFS[15] + 
                  input[i+ 6]*FILTER_COEFFS[16] + 
                  input[i+ 7]*FILTER_COEFFS[17] + 
                  input[i+ 8]*FILTER_COEFFS[18] + 
                  input[i+ 9]*FILTER_COEFFS[19] + 
                  input[i+10]*FILTER_COEFFS[20]);
    }
}

int UlpDifference(float a, float b)
{
    int iA, iB;
    iA = *((int*)(&a));
    iB = *((int*)(&b));
    return abs(iA - iB);
}

void CompareData(int const N, float const* const a, float const* const b)
{
    int i;
    int different = 0;

    for(i = 0; i < N; i++)
    {
        different = (UlpDifference(a[i],b[i]) > 5);
        if(different)
        {
            std::cout << "Mismatch: " << a[i] << " " << b[i] << std::endl;
            break;
        }
    }

    if(different)
    {
        printf("Arrays do not match @%d.\n", i);
    }
    else
    {
        printf("Arrays match.\n");
    }
}

void CheckError(cudaError_t const err, char const* const fun, const int line)
{
    if (err)
    {
        printf("CUDA Error Code[%d]: %s %s():%d\n",err,cudaGetErrorString(err),fun,line);
        exit(1);
    }
}

void CheckErrorMsg(cudaError_t const err, char const* const msg, char const* const fun, int const line)
{
    if (err)
    {
        printf("CUDA Error Code[%d]: %s %s() %d\n%s\n",err,cudaGetErrorString(err),fun,line,msg);
        exit(1);
    }
}

	.file	"tmpxft_00327b69_00000000-6_cmemory.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4297:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4297:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB5027:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE5027:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z16GenerateTestDataiPfS_S_
	.type	_Z16GenerateTestDataiPfS_S_, @function
_Z16GenerateTestDataiPfS_S_:
.LFB4290:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	movq	%rcx, %r9
	xorl	%eax, %eax
.L4:
	cmpl	%eax, %r8d
	jle	.L9
	cvtsi2ssl	%eax, %xmm0
	movss	%xmm0, (%rsi,%rax,4)
	movl	$0x00000000, (%rdx,%rax,4)
	incq	%rax
	jmp	.L4
.L9:
	movslq	%r8d, %rcx
	xorl	%eax, %eax
	movq	%r9, %rdi
	movss	.LC1(%rip), %xmm1
	salq	$2, %rcx
	movss	.LC2(%rip), %xmm2
	movss	.LC3(%rip), %xmm3
	movl	$10, %edx
	movss	.LC4(%rip), %xmm4
	movss	.LC5(%rip), %xmm5
	movss	.LC6(%rip), %xmm6
	movss	.LC7(%rip), %xmm7
	movss	.LC8(%rip), %xmm8
	movss	.LC9(%rip), %xmm9
	movss	.LC10(%rip), %xmm10
	rep stosb
	movq	%rsi, %rax
.L6:
	leal	-10(%r8), %ecx
	addq	$4, %rax
	cmpl	%edx, %ecx
	jle	.L10
	movss	-4(%rax), %xmm0
	movss	(%rax), %xmm11
	mulss	%xmm1, %xmm0
	mulss	%xmm2, %xmm11
	addss	%xmm11, %xmm0
	movss	4(%rax), %xmm11
	mulss	%xmm3, %xmm11
	addss	%xmm11, %xmm0
	movss	8(%rax), %xmm11
	mulss	%xmm4, %xmm11
	addss	%xmm11, %xmm0
	movss	12(%rax), %xmm11
	mulss	%xmm5, %xmm11
	addss	%xmm11, %xmm0
	movss	16(%rax), %xmm11
	mulss	%xmm6, %xmm11
	addss	%xmm11, %xmm0
	movss	20(%rax), %xmm11
	mulss	%xmm7, %xmm11
	addss	%xmm11, %xmm0
	movss	24(%rax), %xmm11
	mulss	%xmm8, %xmm11
	addss	%xmm11, %xmm0
	movss	28(%rax), %xmm11
	mulss	%xmm9, %xmm11
	addss	%xmm11, %xmm0
	movss	32(%rax), %xmm11
	mulss	%xmm10, %xmm11
	addss	%xmm11, %xmm0
	movss	40(%rax), %xmm11
	addss	36(%rax), %xmm0
	mulss	%xmm10, %xmm11
	addss	%xmm11, %xmm0
	movss	44(%rax), %xmm11
	mulss	%xmm9, %xmm11
	addss	%xmm11, %xmm0
	movss	48(%rax), %xmm11
	mulss	%xmm8, %xmm11
	addss	%xmm11, %xmm0
	movss	52(%rax), %xmm11
	mulss	%xmm7, %xmm11
	addss	%xmm11, %xmm0
	movss	56(%rax), %xmm11
	mulss	%xmm6, %xmm11
	addss	%xmm11, %xmm0
	movss	60(%rax), %xmm11
	mulss	%xmm5, %xmm11
	addss	%xmm11, %xmm0
	movss	64(%rax), %xmm11
	mulss	%xmm4, %xmm11
	addss	%xmm11, %xmm0
	movss	68(%rax), %xmm11
	mulss	%xmm3, %xmm11
	addss	%xmm11, %xmm0
	movss	72(%rax), %xmm11
	mulss	%xmm2, %xmm11
	addss	%xmm11, %xmm0
	movss	76(%rax), %xmm11
	mulss	%xmm1, %xmm11
	addss	%xmm11, %xmm0
	movss	%xmm0, (%r9,%rdx,4)
	incq	%rdx
	jmp	.L6
.L10:
	ret
	.cfi_endproc
.LFE4290:
	.size	_Z16GenerateTestDataiPfS_S_, .-_Z16GenerateTestDataiPfS_S_
	.globl	_Z13UlpDifferenceff
	.type	_Z13UlpDifferenceff, @function
_Z13UlpDifferenceff:
.LFB4291:
	.cfi_startproc
	endbr64
	movd	%xmm1, %eax
	movd	%xmm0, %edx
	subl	%eax, %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	ret
	.cfi_endproc
.LFE4291:
	.size	_Z13UlpDifferenceff, .-_Z13UlpDifferenceff
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC11:
	.string	"Mismatch: "
.LC12:
	.string	" "
.LC13:
	.string	"Arrays do not match @%d.\n"
.LC14:
	.string	"Arrays match.\n"
	.text
	.globl	_Z11CompareDataiPKfS0_
	.type	_Z11CompareDataiPKfS0_, @function
_Z11CompareDataiPKfS0_:
.LFB4292:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
.L13:
	cmpl	%edi, %ebx
	jge	.L17
	movq	%rdx, %rbp
	movq	%rsi, %r12
	addq	$4, %rdx
	addq	$4, %rsi
	movl	(%r12), %eax
	subl	0(%rbp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	$5, %eax
	jle	.L14
	leaq	.LC11(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	(%r12), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC12(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	0(%rbp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	%ebx, %edx
	leaq	.LC13(%rip), %rsi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L14:
	.cfi_restore_state
	incl	%ebx
	jmp	.L13
.L17:
	popq	%rbx
	.cfi_def_cfa_offset 24
	leaq	.LC14(%rip), %rsi
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE4292:
	.size	_Z11CompareDataiPKfS0_, .-_Z11CompareDataiPKfS0_
	.section	.rodata.str1.1
.LC15:
	.string	"CUDA Error Code[%d]: %s %s():%d\n"
	.text
	.globl	_Z10CheckError9cudaErrorPKci
	.type	_Z10CheckError9cudaErrorPKci, @function
_Z10CheckError9cudaErrorPKci:
.LFB4293:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L18
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movl	%edx, 12(%rsp)
	movq	%rsi, (%rsp)
	call	cudaGetErrorString@PLT
	movl	12(%rsp), %r9d
	movq	(%rsp), %r8
	movl	%ebx, %edx
	movq	%rax, %rcx
	movl	$2, %edi
	leaq	.LC15(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L18:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	ret
	.cfi_endproc
.LFE4293:
	.size	_Z10CheckError9cudaErrorPKci, .-_Z10CheckError9cudaErrorPKci
	.section	.rodata.str1.1
.LC16:
	.string	"CUDA Error Code[%d]: %s %s() %d\n%s\n"
	.text
	.globl	_Z13CheckErrorMsg9cudaErrorPKcS1_i
	.type	_Z13CheckErrorMsg9cudaErrorPKcS1_i, @function
_Z13CheckErrorMsg9cudaErrorPKcS1_i:
.LFB4294:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L23
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%ecx, 12(%rsp)
	movq	%rdx, (%rsp)
	call	cudaGetErrorString@PLT
	movl	$2, %edi
	movl	%ebx, %edx
	leaq	.LC16(%rip), %rsi
	movq	%rax, %rcx
	pushq	%rax
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 64
	movl	28(%rsp), %r9d
	movq	16(%rsp), %r8
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L23:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE4294:
	.size	_Z13CheckErrorMsg9cudaErrorPKcS1_i, .-_Z13CheckErrorMsg9cudaErrorPKcS1_i
	.globl	_Z35__device_stub__Z12GlobalFilterPfS_iPfS_i
	.type	_Z35__device_stub__Z12GlobalFilterPfS_iPfS_i, @function
_Z35__device_stub__Z12GlobalFilterPfS_iPfS_i:
.LFB4319:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L28
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z12GlobalFilterPfS_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L28:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4319:
	.size	_Z35__device_stub__Z12GlobalFilterPfS_iPfS_i, .-_Z35__device_stub__Z12GlobalFilterPfS_iPfS_i
	.globl	_Z12GlobalFilterPfS_i
	.type	_Z12GlobalFilterPfS_i, @function
_Z12GlobalFilterPfS_i:
.LFB4320:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z12GlobalFilterPfS_iPfS_i
	.cfi_endproc
.LFE4320:
	.size	_Z12GlobalFilterPfS_i, .-_Z12GlobalFilterPfS_i
	.globl	_Z35__device_stub__Z12SharedFilterPfS_iPfS_i
	.type	_Z35__device_stub__Z12SharedFilterPfS_iPfS_i, @function
_Z35__device_stub__Z12SharedFilterPfS_iPfS_i:
.LFB4321:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L33
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z12SharedFilterPfS_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L33:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4321:
	.size	_Z35__device_stub__Z12SharedFilterPfS_iPfS_i, .-_Z35__device_stub__Z12SharedFilterPfS_iPfS_i
	.globl	_Z12SharedFilterPfS_i
	.type	_Z12SharedFilterPfS_i, @function
_Z12SharedFilterPfS_i:
.LFB4322:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z12SharedFilterPfS_iPfS_i
	.cfi_endproc
.LFE4322:
	.size	_Z12SharedFilterPfS_i, .-_Z12SharedFilterPfS_i
	.section	.rodata.str1.1
.LC17:
	.string	"_Z12SharedFilterPfS_i"
.LC18:
	.string	"_Z12GlobalFilterPfS_i"
.LC19:
	.string	"FilterCoeffs"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4324:
	.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	.LC17(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z12SharedFilterPfS_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC18(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z12GlobalFilterPfS_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC19(%rip), %rdx
	movl	$84, %r9d
	leaq	_ZL12FilterCoeffs(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.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
.LFE4324:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIfSaIfEED2Ev,"axG",@progbits,_ZNSt6vectorIfSaIfEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEED2Ev
	.type	_ZNSt6vectorIfSaIfEED2Ev, @function
_ZNSt6vectorIfSaIfEED2Ev:
.LFB4634:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L40
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L40:
	ret
	.cfi_endproc
.LFE4634:
	.size	_ZNSt6vectorIfSaIfEED2Ev, .-_ZNSt6vectorIfSaIfEED2Ev
	.weak	_ZNSt6vectorIfSaIfEED1Ev
	.set	_ZNSt6vectorIfSaIfEED1Ev,_ZNSt6vectorIfSaIfEED2Ev
	.section	.rodata._ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_.str1.1,"aMS",@progbits,1
.LC20:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.type	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_, @function
_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_:
.LFB4799:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rcx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %rax
	movq	(%rdi), %r14
	movq	%rax, %rbx
	movq	%rax, (%rsp)
	subq	%r14, %rbx
	sarq	$2, %rbx
	cmpq	%rcx, %rbx
	jne	.L43
	leaq	.LC20(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L43:
	cmpq	%r14, (%rsp)
	movl	$1, %eax
	movq	%rsi, %r15
	movq	%rdi, %r13
	cmovne	%rbx, %rax
	movq	%rsi, %rbp
	addq	%rax, %rbx
	setc	%al
	subq	%r14, %r15
	movzbl	%al, %eax
	testq	%rax, %rax
	jne	.L53
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L48
	movabsq	$2305843009213693951, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L47
.L53:
	movq	%rcx, %rbx
.L47:
	leaq	0(,%rbx,4), %rdi
	movq	%rdx, 8(%rsp)
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L48:
	movss	(%rdx), %xmm0
	movss	%xmm0, (%r12,%r15)
	testq	%r15, %r15
	jle	.L49
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L49:
	movq	(%rsp), %rax
	leaq	4(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L50
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L50:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L51
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L51:
	leaq	(%r12,%rbx,4), %rax
	movq	%r12, 0(%r13)
	movq	%rbp, 8(%r13)
	movq	%rax, 16(%r13)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4799:
	.size	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_, .-_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.section	.text._ZNSt6vectorIfSaIfEE9push_backERKf,"axG",@progbits,_ZNSt6vectorIfSaIfEE9push_backERKf,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEE9push_backERKf
	.type	_ZNSt6vectorIfSaIfEE9push_backERKf, @function
_ZNSt6vectorIfSaIfEE9push_backERKf:
.LFB4636:
	.cfi_startproc
	endbr64
	movq	%rsi, %rdx
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.L61
	movss	(%rdx), %xmm0
	addq	$4, %rsi
	movss	%xmm0, -4(%rsi)
	movq	%rsi, 8(%rdi)
	ret
.L61:
	jmp	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.cfi_endproc
.LFE4636:
	.size	_ZNSt6vectorIfSaIfEE9push_backERKf, .-_ZNSt6vectorIfSaIfEE9push_backERKf
	.section	.rodata.str1.1
.LC21:
	.string	"main"
.LC22:
	.string	"Global Memory time (ms): "
.LC23:
	.string	"Shared Memory time (ms): "
.LC24:
	.string	"Validando o output do SharedFilter..."
.LC25:
	.string	"Validando o output do GlobalFilter..."
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4279:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4279
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$67108864, %edi
	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
	leaq	.LC21(%rip), %rbx
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	movl	$67108864, %edi
	movq	%rax, %r13
	call	malloc@PLT
	movl	$67108864, %edi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%rbp, %rdx
	movq	%r13, %rsi
	movl	$16777216, %edi
	movq	%rax, %rcx
	movq	%rax, %r12
	call	_Z16GenerateTestDataiPfS_S_
	leaq	32(%rsp), %rdi
	movl	$67108864, %esi
.LEHB0:
	call	cudaMalloc@PLT
	movl	$142, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10CheckError9cudaErrorPKci
	leaq	40(%rsp), %rdi
	movl	$67108864, %esi
	call	cudaMalloc@PLT
	movl	$144, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10CheckError9cudaErrorPKci
	movq	32(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	movl	$67108864, %edx
	call	cudaMemcpy@PLT
	movl	$147, %edx
	movq	%rbx, %rsi
	movl	%eax, %edi
	call	_Z10CheckError9cudaErrorPKci
.LEHE0:
	movl	$131073, %eax
	leaq	48(%rsp), %rdi
	movl	$1, 72(%rsp)
	salq	$15, %rax
	movl	$1, 84(%rsp)
	movq	%rax, 64(%rsp)
	subq	$32256, %rax
	movq	%rax, 76(%rsp)
	xorl	%eax, %eax
	movq	%rax, 88(%rsp)
	movq	%rax, 96(%rsp)
	movq	%rax, 104(%rsp)
	movq	%rax, 112(%rsp)
	movq	%rax, 120(%rsp)
	movq	%rax, 128(%rsp)
	leaq	88(%rsp), %rax
	movq	%rax, (%rsp)
	leaq	112(%rsp), %rax
	movq	%rax, 8(%rsp)
.LEHB1:
	call	cudaEventCreate@PLT
	movl	%eax, %edi
	movl	$158, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	leaq	56(%rsp), %rdi
	call	cudaEventCreate@PLT
	movl	%eax, %edi
	movl	$160, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	call	cudaProfilerStart@PLT
	movl	$5, %r15d
	leaq	28(%rsp), %r14
.L71:
	movq	48(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	84(%rsp), %ecx
	movq	76(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	64(%rsp), %rdi
	movl	72(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L65
.L67:
	movq	56(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	jmp	.L97
.L65:
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	movl	$16777216, %edx
	call	_Z35__device_stub__Z12SharedFilterPfS_iPfS_i
	jmp	.L67
.L97:
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	movl	$169, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	movl	$170, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	movq	(%rsp), %rdi
	movq	%r14, %rsi
	call	_ZNSt6vectorIfSaIfEE9push_backERKf
	movq	48(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	84(%rsp), %ecx
	movq	76(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	64(%rsp), %rdi
	movl	72(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L68
.L70:
	movq	56(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	jmp	.L98
.L68:
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	movl	$16777216, %edx
	call	_Z35__device_stub__Z12GlobalFilterPfS_iPfS_i
	jmp	.L70
.L98:
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	movl	$179, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	movl	$180, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rsi
	movq	%r14, %rdi
	call	cudaEventElapsedTime@PLT
	movq	8(%rsp), %rdi
	movq	%r14, %rsi
	call	_ZNSt6vectorIfSaIfEE9push_backERKf
	decl	%r15d
	jne	.L71
	call	cudaProfilerStop@PLT
	movq	112(%rsp), %rdx
	movq	120(%rsp), %rcx
	xorps	%xmm0, %xmm0
	movq	%rdx, %rax
.L72:
	cmpq	%rcx, %rax
	je	.L99
	addss	(%rax), %xmm0
	addq	$4, %rax
	jmp	.L72
.L99:
	subq	%rdx, %rax
	sarq	$2, %rax
	js	.L74
	cvtsi2ssq	%rax, %xmm1
	jmp	.L75
.L74:
	movq	%rax, %rdx
	andl	$1, %eax
	shrq	%rdx
	orq	%rax, %rdx
	cvtsi2ssq	%rdx, %xmm1
	addss	%xmm1, %xmm1
.L75:
	divss	%xmm1, %xmm0
	leaq	_ZSt4cout(%rip), %r14
	leaq	.LC22(%rip), %rsi
	movq	%r14, %rdi
	movd	%xmm0, %ebx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movd	%ebx, %xmm2
	movq	%rax, %rdi
	cvtss2sd	%xmm2, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	88(%rsp), %rdx
	movq	96(%rsp), %rcx
	xorps	%xmm0, %xmm0
	movq	%rdx, %rax
.L76:
	cmpq	%rcx, %rax
	je	.L100
	addss	(%rax), %xmm0
	addq	$4, %rax
	jmp	.L76
.L100:
	subq	%rdx, %rax
	sarq	$2, %rax
	js	.L78
	cvtsi2ssq	%rax, %xmm1
	jmp	.L79
.L78:
	movq	%rax, %rdx
	andl	$1, %eax
	shrq	%rdx
	orq	%rax, %rdx
	cvtsi2ssq	%rdx, %xmm1
	addss	%xmm1, %xmm1
.L79:
	divss	%xmm1, %xmm0
	leaq	.LC23(%rip), %rsi
	movq	%r14, %rdi
	movd	%xmm0, %ebx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movd	%ebx, %xmm3
	movq	%rax, %rdi
	cvtss2sd	%xmm3, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	84(%rsp), %ecx
	movq	76(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	64(%rsp), %rdi
	movl	72(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L80
.L82:
	call	cudaDeviceSynchronize@PLT
	leaq	.LC21(%rip), %rbx
	movl	%eax, %edi
	movl	$195, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	jmp	.L101
.L80:
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	movl	$16777216, %edx
	call	_Z35__device_stub__Z12SharedFilterPfS_iPfS_i
	jmp	.L82
.L101:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	movl	$196, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	movq	40(%rsp), %rax
	leaq	40(%rbp), %r15
	movl	$2, %ecx
	movl	$67108784, %edx
	movq	%r15, %rdi
	leaq	40(%rax), %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$202, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	leaq	.LC24(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movl	$16777216, %edi
	call	_Z11CompareDataiPKfS0_
	movl	84(%rsp), %ecx
	movq	76(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	64(%rsp), %rdi
	movl	72(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L83
.L85:
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	movl	$209, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	jmp	.L102
.L83:
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	movl	$16777216, %edx
	call	_Z35__device_stub__Z12GlobalFilterPfS_iPfS_i
	jmp	.L85
.L102:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	movl	$210, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	movq	40(%rsp), %rax
	movl	$2, %ecx
	movl	$67108784, %edx
	movq	%r15, %rdi
	leaq	40(%rax), %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$215, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	leaq	.LC25(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movl	$16777216, %edi
	call	_Z11CompareDataiPKfS0_
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	%r13, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	call	cudaDeviceReset@PLT
	movl	%eax, %edi
	movl	$223, %edx
	movq	%rbx, %rsi
	call	_Z10CheckError9cudaErrorPKci
	call	getchar@PLT
.LEHE1:
	leaq	112(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	leaq	88(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L88
	jmp	.L95
.L89:
	endbr64
	movq	%rax, %rbx
.L86:
	movq	8(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L95
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L95:
	call	__stack_chk_fail@PLT
.L88:
	addq	$152, %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
.LFE4279:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4279:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4279-.LLSDACSB4279
.LLSDACSB4279:
	.uleb128 .LEHB0-.LFB4279
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4279
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L89-.LFB4279
	.uleb128 0
	.uleb128 .LEHB2-.LFB4279
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4279:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.local	_ZL12FilterCoeffs
	.comm	_ZL12FilterCoeffs,84,32
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC1:
	.long	1000593162
	.align 4
.LC2:
	.long	1008981770
	.align 4
.LC3:
	.long	1017370378
	.align 4
.LC4:
	.long	1022739087
	.align 4
.LC5:
	.long	1025758986
	.align 4
.LC6:
	.long	1028443341
	.align 4
.LC7:
	.long	1031127695
	.align 4
.LC8:
	.long	1032805417
	.align 4
.LC9:
	.long	1048576000
	.align 4
.LC10:
	.long	1061158912
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <hip/hip_runtime_api.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

#define AxCheckError(err) CheckError(err,__FUNCTION__, __LINE__)
#define AxCheckErrorMsg(err, msg) CheckErrorMsg(err, msg, __FUNCTION__, __LINE__)

void GenerateTestData(int const N, float* const input, float* const filtered, 
                      float* const ref);
void CompareData(int const N, float const* const a, float const* const b);

void CheckError(hipError_t const err, char const* const fun, const int line);
void CheckErrorMsg(hipError_t const err, char const* const msg, char const* const fun, int const line);

#define BLOCK_SIZE  512


float const FILTER_COEFFS[21] = {0.005f,0.01f, 0.02f, 0.03f, 0.04f, 
                                 0.05f, 0.06f, 0.07f, 0.25f, 0.75f, 
                                 1.0f,  0.75f, 0.25f, 0.07f, 0.06f, 
                                 0.05f, 0.04f, 0.03f, 0.02f, 0.01f, 0.005f};

// Armazenado na Constant Memory
__device__ __constant__ float FilterCoeffs[21] =  {0.005f,0.01f, 0.02f, 0.03f, 0.04f, 
                                                   0.05f, 0.06f, 0.07f, 0.25f, 0.75f, 
                                                   1.0f,  0.75f, 0.25f, 0.07f, 0.06f, 
                                                   0.05f, 0.04f, 0.03f, 0.02f, 0.01f, 0.005f};


// Usa apenas a Global Memory
__global__ void GlobalFilter(float* const input, float* const filtered, int const N)
{
   
    int gIdx = blockIdx.x * blockDim.x + threadIdx.x;
    
    if (10 < gIdx && gIdx < N - 10)
    {
        float sum;
        sum = input[gIdx - 10] * FilterCoeffs[ 0] +
              input[gIdx -  9] * FilterCoeffs[ 1] + 
              input[gIdx -  8] * FilterCoeffs[ 2] + 
              input[gIdx -  7] * FilterCoeffs[ 3] +
              input[gIdx -  6] * FilterCoeffs[ 4] +
              input[gIdx -  5] * FilterCoeffs[ 5] + 
              input[gIdx -  4] * FilterCoeffs[ 6] + 
              input[gIdx -  3] * FilterCoeffs[ 7] +
              input[gIdx -  2] * FilterCoeffs[ 8] + 
              input[gIdx -  1] * FilterCoeffs[ 9] + 
              input[gIdx     ] * FilterCoeffs[10] + 
              input[gIdx +  1] * FilterCoeffs[11] + 
              input[gIdx +  2] * FilterCoeffs[12] +
              input[gIdx +  3] * FilterCoeffs[13] +
              input[gIdx +  4] * FilterCoeffs[14] +
              input[gIdx +  5] * FilterCoeffs[15] +
              input[gIdx +  6] * FilterCoeffs[16] +
              input[gIdx +  7] * FilterCoeffs[17] +
              input[gIdx +  8] * FilterCoeffs[18] +
              input[gIdx +  9] * FilterCoeffs[19] +
              input[gIdx + 10] * FilterCoeffs[20];

        filtered[gIdx] = sum;
    }
}

// Usa a Shared Memory
__global__ void SharedFilter(float* const input, float* const filtered, int const N)
{
    __shared__ float inputS[BLOCK_SIZE+20];
    int sIdx = threadIdx.x;
    long long gIdx = blockIdx.x * blockDim.x + threadIdx.x;
    
	// Dez valores extras no ?ndice
    int sIdxShift = sIdx + 10;

    // Todas as threads fazem a leitura de um elemento na Global Memory e armazenam na Shared Memory.
    if (gIdx < N)
    {
        inputS[sIdxShift] = input[gIdx];
    }

    // As primeiras 10 threads no bloco armazenam os 10 valores extras nos 10 primeiros elementos da Shared Memory
    if(sIdx < 10 && blockIdx.x != 0)
    {
        inputS[sIdx] = input[gIdx - 10];
    }

    // As ?ltimas 10 threads armazenam os 10 valores extras na Shared Memory 
    if(sIdxShift >= blockDim.x && blockIdx.x < gridDim.x - 1)
    {
        inputS[sIdxShift + 10] = input[gIdx + 10];
    }

    __syncthreads();
    
    float sum;
    sum = inputS[sIdxShift - 10] * FilterCoeffs[ 0] +
          inputS[sIdxShift -  9] * FilterCoeffs[ 1] + 
          inputS[sIdxShift -  8] * FilterCoeffs[ 2] + 
          inputS[sIdxShift -  7] * FilterCoeffs[ 3] +
          inputS[sIdxShift -  6] * FilterCoeffs[ 4] +
          inputS[sIdxShift -  5] * FilterCoeffs[ 5] + 
          inputS[sIdxShift -  4] * FilterCoeffs[ 6] + 
          inputS[sIdxShift -  3] * FilterCoeffs[ 7] +
          inputS[sIdxShift -  2] * FilterCoeffs[ 8] + 
          inputS[sIdxShift -  1] * FilterCoeffs[ 9] + 
          inputS[sIdxShift     ] * FilterCoeffs[10] + 
          inputS[sIdxShift +  1] * FilterCoeffs[11] + 
          inputS[sIdxShift +  2] * FilterCoeffs[12] +
          inputS[sIdxShift +  3] * FilterCoeffs[13] +
          inputS[sIdxShift +  4] * FilterCoeffs[14] +
          inputS[sIdxShift +  5] * FilterCoeffs[15] +
          inputS[sIdxShift +  6] * FilterCoeffs[16] +
          inputS[sIdxShift +  7] * FilterCoeffs[17] +
          inputS[sIdxShift +  8] * FilterCoeffs[18] +
          inputS[sIdxShift +  9] * FilterCoeffs[19] +
          inputS[sIdxShift + 10] * FilterCoeffs[20];

    filtered[gIdx] = sum;
}

int main()
{
    float *inputH, *filteredH, *refH;
    float *inputD, *filteredD;
    hipError_t e = hipSuccess;
    dim3 gridSize, gridSize2;
    dim3 blockSize;

    int const N = 16*1024*1024;
    int const N_BYTES = N * sizeof(float);

    inputH =    (float*)malloc(N_BYTES);
    filteredH = (float*)malloc(N_BYTES);
    refH =      (float*)malloc(N_BYTES);

    GenerateTestData(N, inputH, filteredH, refH);

    e = hipMalloc((void**)&inputD, N_BYTES);
    AxCheckError(e);
    e = hipMalloc((void**)&filteredD, N_BYTES);
    AxCheckError(e);

    e = hipMemcpy(inputD, inputH, N_BYTES, hipMemcpyHostToDevice);
    AxCheckError(e);

    gridSize.x = ((N + BLOCK_SIZE - 1) / BLOCK_SIZE); 
    blockSize.x = BLOCK_SIZE; 

    int const TRIALS = 5;
    std::vector<float> sharedTimes;
    std::vector<float> globalTimes;
    hipEvent_t start, stop;

    e = hipEventCreate(&start);
    AxCheckError(e);
    e = hipEventCreate(&stop);
    AxCheckError(e);

    e = hipProfilerStart();

    for(int i = 0; i < TRIALS; i++)
    {
        e = hipEventRecord(start, 0);
        SharedFilter<<<gridSize, blockSize>>>(inputD, filteredD, N);
        e = hipEventRecord(stop, 0);
        AxCheckError(hipDeviceSynchronize());
        AxCheckError(hipGetLastError());

        float elapsed;
        e = hipEventElapsedTime(&elapsed, start, stop);
        sharedTimes.push_back(elapsed);

        e = hipEventRecord(start, 0);
        GlobalFilter<<<gridSize, blockSize>>>(inputD, filteredD, N);
        e = hipEventRecord(stop, 0);
        AxCheckError(hipDeviceSynchronize());
        AxCheckError(hipGetLastError());

        e = hipEventElapsedTime(&elapsed, start, stop);
        globalTimes.push_back(elapsed);
    }

    e = hipProfilerStop();

    float averageTime = std::accumulate(globalTimes.begin(), globalTimes.end(), 0.0f)/globalTimes.size();
    std::cout << "Global Memory time (ms): " << averageTime << std::endl;
    averageTime = std::accumulate(sharedTimes.begin(), sharedTimes.end(), 0.0f)/sharedTimes.size();
    std::cout << "Shared Memory time (ms): " << averageTime << std::endl;

    /* Executando o kernel */
    SharedFilter<<<gridSize, blockSize>>>(inputD, filteredD, N);
    AxCheckError(hipDeviceSynchronize());
    AxCheckError(hipGetLastError());

    /* N?o geramos zeros para os 10 primeiros / ?ltimos 10 elementos no kernel. Na verdade, geramos valores usando
??????? Shared Memory n?o inicializada como entradas, logo elas est?o incorretas. Portanto, n?o os copiamos e confiamos
??????? no fato de que o filtro H foi previamente ajustado para zero. */
    e = hipMemcpy(filteredH + 10, filteredD + 10, N_BYTES - 20 * sizeof(float), hipMemcpyDeviceToHost);
    AxCheckError(e);

    std::cout << "Validando o output do SharedFilter..." << std::endl;
    CompareData(N, filteredH, refH);

    /* Executando o kernel */
    GlobalFilter<<<gridSize, blockSize>>>(inputD, filteredD, N);
    AxCheckError(hipDeviceSynchronize());
    AxCheckError(hipGetLastError());

    /* N?s n?o geramos sa?da para os 10 primeiros / ?ltimos 10 elementos no kernel. Portanto, n?o os copiamos e confiamos
???? no fato de que o filtroH foi previamente ajustado para zero. */
    e = hipMemcpy(filteredH + 10, filteredD + 10, N_BYTES - 20 * sizeof(float), hipMemcpyDeviceToHost);
    AxCheckError(e);

    std::cout << "Validando o output do GlobalFilter..." << std::endl;
    CompareData(N, filteredH, refH);

    hipFree(inputD); hipFree(filteredD);
    free(inputH); free(filteredH); free(refH);

    AxCheckError(hipDeviceReset());

	getchar();

    return 0;
}

void GenerateTestData(int const N, float* const input, float* const filtered, float* const ref)
{
    int i;

    for(i = 0; i < N; i++)
    {
        //input[i] = ((float)rand())/RAND_MAX;
        input[i] = i;
        filtered[i] = 0.0f;
    }

    memset(ref, 0, N*sizeof(float) );

    /* N?o podemos calcular um filtro de 21 pontos nas bordas da nossa matriz.
??????? Se todos os 21 pontos n?o estiverem dispon?veis, o resultado esperado ? zero! */
    for(i = 10; i < N-10; i++)
    {   
        ref[i] = (input[i-10]*FILTER_COEFFS[ 0] +
                  input[i- 9]*FILTER_COEFFS[ 1] +
                  input[i- 8]*FILTER_COEFFS[ 2] +
                  input[i- 7]*FILTER_COEFFS[ 3] +
                  input[i- 6]*FILTER_COEFFS[ 4] +
                  input[i- 5]*FILTER_COEFFS[ 5] +
                  input[i- 4]*FILTER_COEFFS[ 6] +
                  input[i- 3]*FILTER_COEFFS[ 7] +
                  input[i- 2]*FILTER_COEFFS[ 8] +
                  input[i- 1]*FILTER_COEFFS[ 9] + 
                  input[i   ]*FILTER_COEFFS[10] + 
                  input[i+ 1]*FILTER_COEFFS[11] + 
                  input[i+ 2]*FILTER_COEFFS[12] + 
                  input[i+ 3]*FILTER_COEFFS[13] + 
                  input[i+ 4]*FILTER_COEFFS[14] + 
                  input[i+ 5]*FILTER_COEFFS[15] + 
                  input[i+ 6]*FILTER_COEFFS[16] + 
                  input[i+ 7]*FILTER_COEFFS[17] + 
                  input[i+ 8]*FILTER_COEFFS[18] + 
                  input[i+ 9]*FILTER_COEFFS[19] + 
                  input[i+10]*FILTER_COEFFS[20]);
    }
}

int UlpDifference(float a, float b)
{
    int iA, iB;
    iA = *((int*)(&a));
    iB = *((int*)(&b));
    return abs(iA - iB);
}

void CompareData(int const N, float const* const a, float const* const b)
{
    int i;
    int different = 0;

    for(i = 0; i < N; i++)
    {
        different = (UlpDifference(a[i],b[i]) > 5);
        if(different)
        {
            std::cout << "Mismatch: " << a[i] << " " << b[i] << std::endl;
            break;
        }
    }

    if(different)
    {
        printf("Arrays do not match @%d.\n", i);
    }
    else
    {
        printf("Arrays match.\n");
    }
}

void CheckError(hipError_t const err, char const* const fun, const int line)
{
    if (err)
    {
        printf("CUDA Error Code[%d]: %s %s():%d\n",err,hipGetErrorString(err),fun,line);
        exit(1);
    }
}

void CheckErrorMsg(hipError_t const err, char const* const msg, char const* const fun, int const line)
{
    if (err)
    {
        printf("CUDA Error Code[%d]: %s %s() %d\n%s\n",err,hipGetErrorString(err),fun,line,msg);
        exit(1);
    }
}

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

                                        # End of file scope inline assembly
	.globl	_Z27__device_stub__GlobalFilterPfS_i # -- Begin function _Z27__device_stub__GlobalFilterPfS_i
	.type	_Z27__device_stub__GlobalFilterPfS_i,@function
_Z27__device_stub__GlobalFilterPfS_i:   # @_Z27__device_stub__GlobalFilterPfS_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$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), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%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	$_Z12GlobalFilterPfS_i, %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_end0:
	.size	_Z27__device_stub__GlobalFilterPfS_i, .Lfunc_end0-_Z27__device_stub__GlobalFilterPfS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z27__device_stub__SharedFilterPfS_i # -- Begin function _Z27__device_stub__SharedFilterPfS_i
	.type	_Z27__device_stub__SharedFilterPfS_i,@function
_Z27__device_stub__SharedFilterPfS_i:   # @_Z27__device_stub__SharedFilterPfS_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$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), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%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	$_Z12SharedFilterPfS_i, %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_end1:
	.size	_Z27__device_stub__SharedFilterPfS_i, .Lfunc_end1-_Z27__device_stub__SharedFilterPfS_i
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$67108864, %edi                 # imm = 0x4000000
	callq	malloc
	movq	%rax, %r14
	movl	$67108864, %edi                 # imm = 0x4000000
	callq	malloc
	movq	%rax, %r15
	movl	$67108864, %edi                 # imm = 0x4000000
	callq	malloc
	movl	$16777216, %edi                 # imm = 0x1000000
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%rax, 128(%rsp)                 # 8-byte Spill
	movq	%rax, %rcx
	callq	_Z16GenerateTestDataiPfS_S_
	leaq	16(%rsp), %rbx
	movl	$67108864, %esi                 # imm = 0x4000000
	movq	%rbx, %rdi
	callq	hipMalloc
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$144, %edx
	callq	_Z10CheckError10hipError_tPKci
	movq	%rsp, %rdi
	movl	$67108864, %esi                 # imm = 0x4000000
	callq	hipMalloc
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$146, %edx
	callq	_Z10CheckError10hipError_tPKci
	movq	(%rbx), %rdi
	movl	$67108864, %edx                 # imm = 0x4000000
	movq	%r14, 104(%rsp)                 # 8-byte Spill
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$149, %edx
	callq	_Z10CheckError10hipError_tPKci
	xorl	%eax, %eax
	movq	%rax, 96(%rsp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, 80(%rsp)
	movq	%rax, 64(%rsp)
	movaps	%xmm0, 48(%rsp)
.Ltmp0:
	leaq	40(%rsp), %rdi
	callq	hipEventCreate
.Ltmp1:
# %bb.1:
.Ltmp2:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$160, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp3:
# %bb.2:
.Ltmp4:
	leaq	32(%rsp), %rdi
	callq	hipEventCreate
.Ltmp5:
# %bb.3:
.Ltmp6:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$162, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp7:
# %bb.4:
.Ltmp8:
	callq	hipProfilerStart
.Ltmp9:
# %bb.5:                                # %.preheader
	movq	%r15, 120(%rsp)                 # 8-byte Spill
	movq	%r15, 112(%rsp)                 # 8-byte Spill
	movl	$5, %r15d
	movabsq	$4295000064, %r13               # imm = 0x100008000
	movabsq	$4294967808, %rbp               # imm = 0x100000200
	leaq	28(%rsp), %rbx
	leaq	80(%rsp), %r12
	leaq	48(%rsp), %r14
.LBB2_6:                                # =>This Inner Loop Header: Depth=1
	movq	40(%rsp), %rdi
.Ltmp10:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp11:
# %bb.7:                                #   in Loop: Header=BB2_6 Depth=1
.Ltmp12:
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp13:
# %bb.8:                                #   in Loop: Header=BB2_6 Depth=1
	testl	%eax, %eax
	jne	.LBB2_10
# %bb.9:                                #   in Loop: Header=BB2_6 Depth=1
	movq	16(%rsp), %rdi
	movq	(%rsp), %rsi
.Ltmp14:
	movl	$16777216, %edx                 # imm = 0x1000000
	callq	_Z27__device_stub__SharedFilterPfS_i
.Ltmp15:
.LBB2_10:                               #   in Loop: Header=BB2_6 Depth=1
	movq	32(%rsp), %rdi
.Ltmp16:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp17:
# %bb.11:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp18:
	callq	hipDeviceSynchronize
.Ltmp19:
# %bb.12:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp20:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$171, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp21:
# %bb.13:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp22:
	callq	hipGetLastError
.Ltmp23:
# %bb.14:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp24:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$172, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp25:
# %bb.15:                               #   in Loop: Header=BB2_6 Depth=1
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdx
.Ltmp27:
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
.Ltmp28:
# %bb.16:                               #   in Loop: Header=BB2_6 Depth=1
	movq	88(%rsp), %rsi
	cmpq	96(%rsp), %rsi
	je	.LBB2_18
# %bb.17:                               #   in Loop: Header=BB2_6 Depth=1
	movss	28(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 88(%rsp)
	jmp	.LBB2_19
.LBB2_18:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp29:
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
.Ltmp30:
.LBB2_19:                               # %_ZNSt6vectorIfSaIfEE9push_backERKf.exit
                                        #   in Loop: Header=BB2_6 Depth=1
	movq	40(%rsp), %rdi
.Ltmp31:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp32:
# %bb.20:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp33:
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp34:
# %bb.21:                               #   in Loop: Header=BB2_6 Depth=1
	testl	%eax, %eax
	jne	.LBB2_23
# %bb.22:                               #   in Loop: Header=BB2_6 Depth=1
	movq	16(%rsp), %rdi
	movq	(%rsp), %rsi
.Ltmp35:
	movl	$16777216, %edx                 # imm = 0x1000000
	callq	_Z27__device_stub__GlobalFilterPfS_i
.Ltmp36:
.LBB2_23:                               #   in Loop: Header=BB2_6 Depth=1
	movq	32(%rsp), %rdi
.Ltmp37:
	xorl	%esi, %esi
	callq	hipEventRecord
.Ltmp38:
# %bb.24:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp39:
	callq	hipDeviceSynchronize
.Ltmp40:
# %bb.25:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp41:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$181, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp42:
# %bb.26:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp43:
	callq	hipGetLastError
.Ltmp44:
# %bb.27:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp45:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$182, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp46:
# %bb.28:                               #   in Loop: Header=BB2_6 Depth=1
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdx
.Ltmp47:
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
.Ltmp48:
# %bb.29:                               #   in Loop: Header=BB2_6 Depth=1
	movq	56(%rsp), %rsi
	cmpq	64(%rsp), %rsi
	je	.LBB2_31
# %bb.30:                               #   in Loop: Header=BB2_6 Depth=1
	movss	28(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 56(%rsp)
	jmp	.LBB2_32
.LBB2_31:                               #   in Loop: Header=BB2_6 Depth=1
.Ltmp49:
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
.Ltmp50:
.LBB2_32:                               # %_ZNSt6vectorIfSaIfEE9push_backERKf.exit70
                                        #   in Loop: Header=BB2_6 Depth=1
	decl	%r15d
	jne	.LBB2_6
# %bb.33:
.Ltmp52:
	callq	hipProfilerStop
.Ltmp53:
	movq	120(%rsp), %r12                 # 8-byte Reload
# %bb.34:
	movq	48(%rsp), %r14
	movq	56(%rsp), %rbx
	cmpq	%rbx, %r14
	movq	128(%rsp), %r15                 # 8-byte Reload
	movq	112(%rsp), %r13                 # 8-byte Reload
	xorps	%xmm0, %xmm0
	je	.LBB2_37
# %bb.35:                               # %.lr.ph.i.preheader
	movq	%r14, %rax
.LBB2_36:                               # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	addss	(%rax), %xmm0
	addq	$4, %rax
	cmpq	%rbx, %rax
	jne	.LBB2_36
.LBB2_37:                               # %_ZSt10accumulateIN9__gnu_cxx17__normal_iteratorIPfSt6vectorIfSaIfEEEEfET0_T_S8_S7_.exit
.Ltmp55:
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$25, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp56:
# %bb.38:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	subq	%r14, %rbx
	sarq	$2, %rbx
	js	.LBB2_39
# %bb.40:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rbx, %xmm0
	jmp	.LBB2_41
.LBB2_39:
	movq	%rbx, %rax
	shrq	%rax
	andl	$1, %ebx
	orq	%rax, %rbx
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rbx, %xmm0
	addss	%xmm0, %xmm0
.LBB2_41:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movss	12(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
.Ltmp57:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp58:
# %bb.42:                               # %_ZNSolsEf.exit
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp59:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp60:
# %bb.43:                               # %.noexc102
.Ltmp61:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp62:
# %bb.44:                               # %.noexc103
.Ltmp63:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp64:
# %bb.45:                               # %_ZNSolsEPFRSoS_E.exit
	movq	80(%rsp), %r14
	movq	88(%rsp), %rbx
	xorps	%xmm0, %xmm0
	cmpq	%rbx, %r14
	je	.LBB2_48
# %bb.46:                               # %.lr.ph.i76.preheader
	movq	%r14, %rax
.LBB2_47:                               # %.lr.ph.i76
                                        # =>This Inner Loop Header: Depth=1
	addss	(%rax), %xmm0
	addq	$4, %rax
	cmpq	%rbx, %rax
	jne	.LBB2_47
.LBB2_48:                               # %_ZSt10accumulateIN9__gnu_cxx17__normal_iteratorIPfSt6vectorIfSaIfEEEEfET0_T_S8_S7_.exit81
.Ltmp65:
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$25, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp66:
# %bb.49:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit83
	subq	%r14, %rbx
	sarq	$2, %rbx
	js	.LBB2_50
# %bb.51:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit83
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rbx, %xmm0
	jmp	.LBB2_52
.LBB2_50:
	movq	%rbx, %rax
	shrq	%rax
	andl	$1, %ebx
	orq	%rax, %rbx
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rbx, %xmm0
	addss	%xmm0, %xmm0
.LBB2_52:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit83
	movss	12(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
.Ltmp67:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp68:
# %bb.53:                               # %_ZNSolsEf.exit85
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp69:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp70:
# %bb.54:                               # %.noexc105
.Ltmp71:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp72:
# %bb.55:                               # %.noexc106
.Ltmp73:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp74:
# %bb.56:                               # %_ZNSolsEPFRSoS_E.exit87
.Ltmp75:
	movabsq	$4295000064, %rdi               # imm = 0x100008000
	movabsq	$4294967808, %rdx               # imm = 0x100000200
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp76:
# %bb.57:
	testl	%eax, %eax
	jne	.LBB2_59
# %bb.58:
	movq	16(%rsp), %rdi
	movq	(%rsp), %rsi
.Ltmp77:
	movl	$16777216, %edx                 # imm = 0x1000000
	callq	_Z27__device_stub__SharedFilterPfS_i
.Ltmp78:
.LBB2_59:
.Ltmp79:
	callq	hipDeviceSynchronize
.Ltmp80:
# %bb.60:
.Ltmp81:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$197, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp82:
# %bb.61:
.Ltmp83:
	callq	hipGetLastError
.Ltmp84:
# %bb.62:
.Ltmp85:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$198, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp86:
# %bb.63:
	addq	$40, %r12
	movq	(%rsp), %rsi
	addq	$40, %rsi
.Ltmp87:
	movl	$67108784, %edx                 # imm = 0x3FFFFB0
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp88:
# %bb.64:
.Ltmp89:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$204, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp90:
# %bb.65:
.Ltmp91:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$37, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp92:
# %bb.66:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit89
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp93:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp94:
# %bb.67:                               # %.noexc109
.Ltmp95:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp96:
# %bb.68:                               # %.noexc110
.Ltmp97:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp98:
# %bb.69:                               # %_ZNSolsEPFRSoS_E.exit91
.Ltmp99:
	movl	$16777216, %edi                 # imm = 0x1000000
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_Z11CompareDataiPKfS0_
.Ltmp100:
# %bb.70:
.Ltmp101:
	movabsq	$4295000064, %rdi               # imm = 0x100008000
	movabsq	$4294967808, %rdx               # imm = 0x100000200
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp102:
# %bb.71:
	testl	%eax, %eax
	jne	.LBB2_73
# %bb.72:
	movq	16(%rsp), %rdi
	movq	(%rsp), %rsi
.Ltmp103:
	movl	$16777216, %edx                 # imm = 0x1000000
	callq	_Z27__device_stub__GlobalFilterPfS_i
.Ltmp104:
.LBB2_73:
.Ltmp105:
	callq	hipDeviceSynchronize
.Ltmp106:
# %bb.74:
.Ltmp107:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$211, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp108:
# %bb.75:
.Ltmp109:
	callq	hipGetLastError
.Ltmp110:
# %bb.76:
.Ltmp111:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$212, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp112:
# %bb.77:
	movq	(%rsp), %rsi
	addq	$40, %rsi
.Ltmp113:
	movl	$67108784, %edx                 # imm = 0x3FFFFB0
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp114:
# %bb.78:
.Ltmp115:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$217, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp116:
# %bb.79:
.Ltmp117:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$37, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp118:
# %bb.80:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit93
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp119:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp120:
# %bb.81:                               # %.noexc113
.Ltmp121:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp122:
# %bb.82:                               # %.noexc114
.Ltmp123:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp124:
# %bb.83:                               # %_ZNSolsEPFRSoS_E.exit95
.Ltmp125:
	movl	$16777216, %edi                 # imm = 0x1000000
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_Z11CompareDataiPKfS0_
.Ltmp126:
# %bb.84:
	movq	16(%rsp), %rdi
.Ltmp127:
	callq	hipFree
.Ltmp128:
# %bb.85:
	movq	(%rsp), %rdi
.Ltmp129:
	callq	hipFree
.Ltmp130:
# %bb.86:
	movq	104(%rsp), %rdi                 # 8-byte Reload
	callq	free
	movq	%r13, %rdi
	callq	free
	movq	%r15, %rdi
	callq	free
.Ltmp131:
	callq	hipDeviceReset
.Ltmp132:
# %bb.87:
.Ltmp133:
	movl	$.L__FUNCTION__.main, %esi
	movl	%eax, %edi
	movl	$225, %edx
	callq	_Z10CheckError10hipError_tPKci
.Ltmp134:
# %bb.88:
	callq	getchar
	movq	48(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_90
# %bb.89:
	callq	_ZdlPv
.LBB2_90:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit
	movq	80(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_92
# %bb.91:
	callq	_ZdlPv
.LBB2_92:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit97
	xorl	%eax, %eax
	addq	$136, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB2_93:
	.cfi_def_cfa_offset 192
.Ltmp54:
	jmp	.LBB2_94
.LBB2_101:
.Ltmp135:
	jmp	.LBB2_94
.LBB2_99:
.Ltmp26:
	jmp	.LBB2_94
.LBB2_100:
.Ltmp51:
.LBB2_94:
	movq	%rax, %rbx
	movq	48(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_96
# %bb.95:
	callq	_ZdlPv
.LBB2_96:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit99
	movq	80(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_98
# %bb.97:
	callq	_ZdlPv
.LBB2_98:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit101
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp9-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp9
	.uleb128 .Ltmp54-.Lfunc_begin0          #     jumps to .Ltmp54
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp10-.Lfunc_begin0          # >> Call Site 3 <<
	.uleb128 .Ltmp25-.Ltmp10                #   Call between .Ltmp10 and .Ltmp25
	.uleb128 .Ltmp26-.Lfunc_begin0          #     jumps to .Ltmp26
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp27-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp50-.Ltmp27                #   Call between .Ltmp27 and .Ltmp50
	.uleb128 .Ltmp51-.Lfunc_begin0          #     jumps to .Ltmp51
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp52-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp53-.Ltmp52                #   Call between .Ltmp52 and .Ltmp53
	.uleb128 .Ltmp54-.Lfunc_begin0          #     jumps to .Ltmp54
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp55-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp134-.Ltmp55               #   Call between .Ltmp55 and .Ltmp134
	.uleb128 .Ltmp135-.Lfunc_begin0         #     jumps to .Ltmp135
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp134-.Lfunc_begin0         # >> Call Site 7 <<
	.uleb128 .Lfunc_end2-.Ltmp134           #   Call between .Ltmp134 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z16GenerateTestDataiPfS_S_
.LCPI3_0:
	.long	0x3ba3d70a                      # float 0.00499999989
.LCPI3_1:
	.long	0x3c23d70a                      # float 0.00999999977
.LCPI3_2:
	.long	0x3ca3d70a                      # float 0.0199999996
.LCPI3_3:
	.long	0x3cf5c28f                      # float 0.0299999993
.LCPI3_4:
	.long	0x3d23d70a                      # float 0.0399999991
.LCPI3_5:
	.long	0x3d4ccccd                      # float 0.0500000007
.LCPI3_6:
	.long	0x3d75c28f                      # float 0.0599999987
.LCPI3_7:
	.long	0x3d8f5c29                      # float 0.0700000003
.LCPI3_8:
	.long	0x3e800000                      # float 0.25
.LCPI3_9:
	.long	0x3f400000                      # float 0.75
	.text
	.globl	_Z16GenerateTestDataiPfS_S_
	.type	_Z16GenerateTestDataiPfS_S_,@function
_Z16GenerateTestDataiPfS_S_:            # @_Z16GenerateTestDataiPfS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rcx, %rbx
	movl	%edi, %r14d
	testl	%edi, %edi
	jle	.LBB3_7
# %bb.1:                                # %.lr.ph.preheader
	movq	%rsi, %r15
	movl	%r14d, %r12d
	xorl	%eax, %eax
.LBB3_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%r15,%rax,4)
	movl	$0, (%rdx,%rax,4)
	incq	%rax
	cmpq	%rax, %r12
	jne	.LBB3_2
# %bb.3:                                # %._crit_edge
	movq	%r12, %rdx
	shlq	$2, %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	cmpl	$21, %r12d
	jl	.LBB3_6
# %bb.4:                                # %.lr.ph60.preheader
	addl	$-10, %r14d
	movl	$10, %eax
	movss	.LCPI3_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	.LCPI3_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movss	.LCPI3_2(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	movss	.LCPI3_3(%rip), %xmm3           # xmm3 = mem[0],zero,zero,zero
	movss	.LCPI3_4(%rip), %xmm4           # xmm4 = mem[0],zero,zero,zero
	movss	.LCPI3_5(%rip), %xmm5           # xmm5 = mem[0],zero,zero,zero
	movss	.LCPI3_6(%rip), %xmm6           # xmm6 = mem[0],zero,zero,zero
	movss	.LCPI3_7(%rip), %xmm7           # xmm7 = mem[0],zero,zero,zero
	movss	.LCPI3_8(%rip), %xmm8           # xmm8 = mem[0],zero,zero,zero
	movss	.LCPI3_9(%rip), %xmm9           # xmm9 = mem[0],zero,zero,zero
.LBB3_5:                                # %.lr.ph60
                                        # =>This Inner Loop Header: Depth=1
	movss	-40(%r15,%rax,4), %xmm10        # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm10
	movss	-36(%r15,%rax,4), %xmm11        # xmm11 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm11
	addss	%xmm10, %xmm11
	movss	-32(%r15,%rax,4), %xmm10        # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm2, %xmm10
	addss	%xmm11, %xmm10
	movss	-28(%r15,%rax,4), %xmm11        # xmm11 = mem[0],zero,zero,zero
	mulss	%xmm3, %xmm11
	addss	%xmm10, %xmm11
	movss	-24(%r15,%rax,4), %xmm10        # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm4, %xmm10
	addss	%xmm11, %xmm10
	movss	-20(%r15,%rax,4), %xmm11        # xmm11 = mem[0],zero,zero,zero
	mulss	%xmm5, %xmm11
	addss	%xmm10, %xmm11
	movss	-16(%r15,%rax,4), %xmm10        # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm6, %xmm10
	addss	%xmm11, %xmm10
	movss	-12(%r15,%rax,4), %xmm11        # xmm11 = mem[0],zero,zero,zero
	mulss	%xmm7, %xmm11
	addss	%xmm10, %xmm11
	movss	-8(%r15,%rax,4), %xmm10         # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm8, %xmm10
	addss	%xmm11, %xmm10
	movss	-4(%r15,%rax,4), %xmm11         # xmm11 = mem[0],zero,zero,zero
	mulss	%xmm9, %xmm11
	addss	%xmm10, %xmm11
	addss	(%r15,%rax,4), %xmm11
	movss	4(%r15,%rax,4), %xmm10          # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm9, %xmm10
	addss	%xmm11, %xmm10
	movss	8(%r15,%rax,4), %xmm11          # xmm11 = mem[0],zero,zero,zero
	mulss	%xmm8, %xmm11
	addss	%xmm10, %xmm11
	movss	12(%r15,%rax,4), %xmm10         # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm7, %xmm10
	addss	%xmm11, %xmm10
	movss	16(%r15,%rax,4), %xmm11         # xmm11 = mem[0],zero,zero,zero
	mulss	%xmm6, %xmm11
	addss	%xmm10, %xmm11
	movss	20(%r15,%rax,4), %xmm10         # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm5, %xmm10
	addss	%xmm11, %xmm10
	movss	24(%r15,%rax,4), %xmm11         # xmm11 = mem[0],zero,zero,zero
	mulss	%xmm4, %xmm11
	addss	%xmm10, %xmm11
	movss	28(%r15,%rax,4), %xmm10         # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm3, %xmm10
	addss	%xmm11, %xmm10
	movss	32(%r15,%rax,4), %xmm11         # xmm11 = mem[0],zero,zero,zero
	mulss	%xmm2, %xmm11
	addss	%xmm10, %xmm11
	movss	36(%r15,%rax,4), %xmm10         # xmm10 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm10
	addss	%xmm11, %xmm10
	movss	40(%r15,%rax,4), %xmm11         # xmm11 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm11
	addss	%xmm10, %xmm11
	movss	%xmm11, (%rbx,%rax,4)
	leaq	1(%rax), %rcx
	movq	%rcx, %rax
	cmpq	%rcx, %r14
	jne	.LBB3_5
.LBB3_6:                                # %._crit_edge61
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB3_7:                                # %._crit_edge.thread
	.cfi_def_cfa_offset 48
	movslq	%r14d, %rdx
	shlq	$2, %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	memset@PLT                      # TAILCALL
.Lfunc_end3:
	.size	_Z16GenerateTestDataiPfS_S_, .Lfunc_end3-_Z16GenerateTestDataiPfS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z10CheckError10hipError_tPKci  # -- Begin function _Z10CheckError10hipError_tPKci
	.type	_Z10CheckError10hipError_tPKci,@function
_Z10CheckError10hipError_tPKci:         # @_Z10CheckError10hipError_tPKci
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jne	.LBB4_2
# %bb.1:
	retq
.LBB4_2:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebx
	movq	%rsi, %r14
	movl	%edi, %ebp
	callq	hipGetErrorString
	movl	$.L.str.8, %edi
	movl	%ebp, %esi
	movq	%rax, %rdx
	movq	%r14, %rcx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.Lfunc_end4:
	.size	_Z10CheckError10hipError_tPKci, .Lfunc_end4-_Z10CheckError10hipError_tPKci
	.cfi_endproc
                                        # -- End function
	.globl	_Z11CompareDataiPKfS0_          # -- Begin function _Z11CompareDataiPKfS0_
	.type	_Z11CompareDataiPKfS0_,@function
_Z11CompareDataiPKfS0_:                 # @_Z11CompareDataiPKfS0_
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	testl	%edi, %edi
	jle	.LBB5_4
# %bb.1:                                # %.lr.ph.preheader
	movq	%rdx, %r14
	movq	%rsi, %r15
	movl	%edi, %eax
	xorl	%ebx, %ebx
.LBB5_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%r15,%rbx,4), %ecx
	subl	(%r14,%rbx,4), %ecx
	movl	%ecx, %edx
	negl	%edx
	cmovsl	%ecx, %edx
	cmpl	$5, %edx
	ja	.LBB5_5
# %bb.3:                                #   in Loop: Header=BB5_2 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	jne	.LBB5_2
.LBB5_4:                                # %._crit_edge
	movl	$.Lstr, %edi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	puts@PLT                        # TAILCALL
.LBB5_5:
	.cfi_def_cfa_offset 32
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cvtss2sd	(%r15,%rbx,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.5, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%rbx,4), %xmm0
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$.L.str.6, %edi
	movl	%ebx, %esi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.Lfunc_end5:
	.size	_Z11CompareDataiPKfS0_, .Lfunc_end5-_Z11CompareDataiPKfS0_
	.cfi_endproc
                                        # -- End function
	.globl	_Z13UlpDifferenceff             # -- Begin function _Z13UlpDifferenceff
	.type	_Z13UlpDifferenceff,@function
_Z13UlpDifferenceff:                    # @_Z13UlpDifferenceff
	.cfi_startproc
# %bb.0:
	movd	%xmm0, %ecx
	movd	%xmm1, %eax
	subl	%eax, %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovsl	%ecx, %eax
	retq
.Lfunc_end6:
	.size	_Z13UlpDifferenceff, .Lfunc_end6-_Z13UlpDifferenceff
	.cfi_endproc
                                        # -- End function
	.globl	_Z13CheckErrorMsg10hipError_tPKcS1_i # -- Begin function _Z13CheckErrorMsg10hipError_tPKcS1_i
	.type	_Z13CheckErrorMsg10hipError_tPKcS1_i,@function
_Z13CheckErrorMsg10hipError_tPKcS1_i:   # @_Z13CheckErrorMsg10hipError_tPKcS1_i
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jne	.LBB7_2
# %bb.1:
	retq
.LBB7_2:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%ecx, %ebx
	movq	%rdx, %r15
	movq	%rsi, %r14
	movl	%edi, %ebp
	callq	hipGetErrorString
	movl	$.L.str.9, %edi
	movl	%ebp, %esi
	movq	%rax, %rdx
	movq	%r15, %rcx
	movl	%ebx, %r8d
	movq	%r14, %r9
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.Lfunc_end7:
	.size	_Z13CheckErrorMsg10hipError_tPKcS1_i, .Lfunc_end7-_Z13CheckErrorMsg10hipError_tPKcS1_i
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_ # -- Begin function _ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_,@function
_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_: # @_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, (%rsp)                    # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.10, %edx
	callq	_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc
	movq	(%rbx), %r13
	movq	8(%rbx), %r15
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	subq	%r13, %r12
	movq	%r12, %r14
	sarq	$2, %r14
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB8_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIfE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB8_3
.LBB8_1:
	xorl	%ebp, %ebp
.LBB8_3:                                # %_ZNSt12_Vector_baseIfSaIfEE11_M_allocateEm.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movss	(%rax), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rbp,%r14,4)
	testq	%r12, %r12
	jle	.LBB8_5
# %bb.4:
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB8_5:                                # %_ZNSt6vectorIfSaIfEE11_S_relocateEPfS2_S2_RS0_.exit
	addq	%rbp, %r12
	addq	$4, %r12
	movq	8(%rsp), %rsi                   # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB8_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB8_7:                                # %_ZNSt6vectorIfSaIfEE11_S_relocateEPfS2_S2_RS0_.exit16
	testq	%r13, %r13
	je	.LBB8_9
# %bb.8:
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB8_9:                                # %_ZNSt12_Vector_baseIfSaIfEE13_M_deallocateEPfm.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,4), %rax
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_, .Lfunc_end8-_ZNSt6vectorIfSaIfEE17_M_realloc_insertIJRKfEEEvN9__gnu_cxx17__normal_iteratorIPfS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc,@function
_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc: # @_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$2305843009213693951, %rcx      # imm = 0x1FFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$2, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB9_2
# %bb.1:
	cmpq	%rsi, %r8
	cmovaq	%r8, %rsi
	leaq	(%rsi,%r8), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%r8, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB9_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end9:
	.size	_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc, .Lfunc_end9-_ZNKSt6vectorIfSaIfEE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIfE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIfE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIfE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIfE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIfE8allocateEmPKv,@function
_ZNSt15__new_allocatorIfE8allocateEmPKv: # @_ZNSt15__new_allocatorIfE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB10_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB10_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB10_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB10_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end10:
	.size	_ZNSt15__new_allocatorIfE8allocateEmPKv, .Lfunc_end10-_ZNSt15__new_allocatorIfE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB11_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB11_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z12GlobalFilterPfS_i, %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	$_Z12SharedFilterPfS_i, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$0, 8(%rsp)
	movl	$1, (%rsp)
	movl	$FilterCoeffs, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movl	$84, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	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	FilterCoeffs,@object            # @FilterCoeffs
	.local	FilterCoeffs
	.comm	FilterCoeffs,84,16
	.type	_Z12GlobalFilterPfS_i,@object   # @_Z12GlobalFilterPfS_i
	.section	.rodata,"a",@progbits
	.globl	_Z12GlobalFilterPfS_i
	.p2align	3, 0x0
_Z12GlobalFilterPfS_i:
	.quad	_Z27__device_stub__GlobalFilterPfS_i
	.size	_Z12GlobalFilterPfS_i, 8

	.type	_Z12SharedFilterPfS_i,@object   # @_Z12SharedFilterPfS_i
	.globl	_Z12SharedFilterPfS_i
	.p2align	3, 0x0
_Z12SharedFilterPfS_i:
	.quad	_Z27__device_stub__SharedFilterPfS_i
	.size	_Z12SharedFilterPfS_i, 8

	.type	.L__FUNCTION__.main,@object     # @__FUNCTION__.main
	.section	.rodata.str1.1,"aMS",@progbits,1
.L__FUNCTION__.main:
	.asciz	"main"
	.size	.L__FUNCTION__.main, 5

	.type	.L.str,@object                  # @.str
.L.str:
	.asciz	"Global Memory time (ms): "
	.size	.L.str, 26

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Shared Memory time (ms): "
	.size	.L.str.1, 26

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Validando o output do SharedFilter..."
	.size	.L.str.2, 38

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Validando o output do GlobalFilter..."
	.size	.L.str.3, 38

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

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

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Arrays do not match @%d.\n"
	.size	.L.str.6, 26

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"CUDA Error Code[%d]: %s %s():%d\n"
	.size	.L.str.8, 33

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"CUDA Error Code[%d]: %s %s() %d\n%s\n"
	.size	.L.str.9, 36

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"vector::_M_realloc_insert"
	.size	.L.str.10, 26

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z12GlobalFilterPfS_i"
	.size	.L__unnamed_1, 22

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z12SharedFilterPfS_i"
	.size	.L__unnamed_2, 22

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"FilterCoeffs"
	.size	.L__unnamed_3, 13

	.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	"Arrays match."
	.size	.Lstr, 14

	.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 _Z27__device_stub__GlobalFilterPfS_i
	.addrsig_sym _Z27__device_stub__SharedFilterPfS_i
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym FilterCoeffs
	.addrsig_sym _Z12GlobalFilterPfS_i
	.addrsig_sym _Z12SharedFilterPfS_i
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z12GlobalFilterPfS_i   ; -- Begin function _Z12GlobalFilterPfS_i
	.globl	_Z12GlobalFilterPfS_i
	.p2align	8
	.type	_Z12GlobalFilterPfS_i,@function
_Z12GlobalFilterPfS_i:                  ; @_Z12GlobalFilterPfS_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_add_i32 s3, s3, -10
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_lt_i32_e32 vcc_lo, 10, v1
	v_cmp_gt_i32_e64 s2, s3, v1
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b128 s[16:19], s[0:1], 0x0
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, FilterCoeffs@rel32@lo+4
	s_addc_u32 s1, s1, FilterCoeffs@rel32@hi+12
	s_load_b512 s[0:15], s[0:1], 0x0
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[20:21], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v22, vcc_lo, s16, v20
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v23, vcc_lo, s17, v21, vcc_lo
	s_clause 0x5
	global_load_b128 v[0:3], v[22:23], off offset:-40
	global_load_b128 v[4:7], v[22:23], off offset:-24
	global_load_b128 v[8:11], v[22:23], off offset:-8
	global_load_b128 v[12:15], v[22:23], off offset:8
	global_load_b128 v[16:19], v[22:23], off offset:24
	global_load_b32 v22, v[22:23], off offset:40
	s_waitcnt vmcnt(5)
	v_mul_f32_e32 v23, s1, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v23, s0, v0
	v_add_co_u32 v0, vcc_lo, s18, v20
	v_add_co_ci_u32_e32 v1, vcc_lo, s19, v21, vcc_lo
	v_fmac_f32_e32 v23, s2, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v23, s3, v3
	s_waitcnt vmcnt(4)
	v_fmac_f32_e32 v23, s4, v4
	s_delay_alu instid0(VALU_DEP_1)
	v_fmac_f32_e32 v23, s5, v5
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, FilterCoeffs@rel32@lo+68
	s_addc_u32 s5, s5, FilterCoeffs@rel32@hi+76
	s_clause 0x1
	s_load_b128 s[0:3], s[4:5], 0x0
	s_load_b32 s4, s[4:5], 0x10
	v_fmac_f32_e32 v23, s6, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v23, s7, v7
	s_waitcnt vmcnt(3)
	v_fmac_f32_e32 v23, s8, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v23, s9, v9
	v_fmac_f32_e32 v23, s10, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v23, s11, v11
	s_waitcnt vmcnt(2)
	v_fmac_f32_e32 v23, s12, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v23, s13, v13
	v_fmac_f32_e32 v23, s14, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v23, s15, v15
	s_waitcnt vmcnt(1) lgkmcnt(0)
	v_fmac_f32_e32 v23, s0, v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v23, s1, v17
	v_fmac_f32_e32 v23, s2, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v23, s3, v19
	s_waitcnt vmcnt(0)
	v_fmac_f32_e32 v23, s4, v22
	global_store_b32 v[0:1], v23, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12GlobalFilterPfS_i
		.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 24
		.amdhsa_next_free_sgpr 20
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z12GlobalFilterPfS_i, .Lfunc_end0-_Z12GlobalFilterPfS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 420
; NumSgprs: 22
; NumVgprs: 24
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 24
; 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	_Z12SharedFilterPfS_i   ; -- Begin function _Z12SharedFilterPfS_i
	.globl	_Z12SharedFilterPfS_i
	.p2align	8
	.type	_Z12SharedFilterPfS_i,@function
_Z12SharedFilterPfS_i:                  ; @_Z12SharedFilterPfS_i
; %bb.0:
	s_clause 0x2
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s4, s[0:1], 0x10
	s_load_b128 s[16:19], s[0:1], 0x0
	v_lshlrev_b32_e32 v3, 2, v0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_ashr_i32 s5, s4, 31
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_gt_i64_e32 vcc_lo, s[4:5], v[1:2]
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_and_saveexec_b32 s3, vcc_lo
	s_cbranch_execz .LBB1_2
; %bb.1:
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, s16, v1
	v_add_co_ci_u32_e32 v5, vcc_lo, s17, v2, vcc_lo
	global_load_b32 v4, v[4:5], off
	s_waitcnt vmcnt(0)
	ds_store_b32 v3, v4 offset:40
.LBB1_2:
	s_or_b32 exec_lo, exec_lo, s3
	s_load_b32 s0, s[0:1], 0x18
	v_cmp_gt_u32_e32 vcc_lo, 10, v0
	s_cmp_lg_u32 s15, 0
	s_cselect_b32 s1, -1, 0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s3, vcc_lo, s1
	s_and_saveexec_b32 s1, s3
	s_cbranch_execz .LBB1_4
; %bb.3:
	v_add_co_u32 v4, vcc_lo, s16, v1
	v_add_co_ci_u32_e32 v5, vcc_lo, s17, v2, vcc_lo
	global_load_b32 v4, v[4:5], off offset:-40
	s_waitcnt vmcnt(0)
	ds_store_b32 v3, v4
.LBB1_4:
	s_or_b32 exec_lo, exec_lo, s1
	v_add_nc_u32_e32 v0, 10, v0
	s_waitcnt lgkmcnt(0)
	s_add_i32 s0, s0, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(SALU_CYCLE_1)
	s_cmp_lt_u32 s15, s0
	s_cselect_b32 s0, -1, 0
	v_cmp_le_u32_e32 vcc_lo, s2, v0
	s_and_b32 s1, vcc_lo, s0
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB1_6
; %bb.5:
	v_add_co_u32 v4, vcc_lo, s16, v1
	v_add_co_ci_u32_e32 v5, vcc_lo, s17, v2, vcc_lo
	global_load_b32 v0, v[4:5], off offset:40
	s_waitcnt vmcnt(0)
	ds_store_b32 v3, v0 offset:80
.LBB1_6:                                ; %._crit_edge
	s_or_b32 exec_lo, exec_lo, s0
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, FilterCoeffs@rel32@lo+4
	s_addc_u32 s1, s1, FilterCoeffs@rel32@hi+12
	s_waitcnt lgkmcnt(0)
	s_load_b512 s[0:15], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	ds_load_2addr_b32 v[4:5], v3 offset1:1
	ds_load_2addr_b32 v[6:7], v3 offset0:2 offset1:3
	ds_load_2addr_b32 v[8:9], v3 offset0:4 offset1:5
	ds_load_2addr_b32 v[10:11], v3 offset0:6 offset1:7
	s_waitcnt lgkmcnt(3)
	v_mul_f32_e32 v12, s1, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v12, s0, v4
	ds_load_2addr_b32 v[4:5], v3 offset0:8 offset1:9
	s_waitcnt lgkmcnt(3)
	v_fmac_f32_e32 v12, s2, v6
	v_fmac_f32_e32 v12, s3, v7
	ds_load_2addr_b32 v[6:7], v3 offset0:10 offset1:11
	s_waitcnt lgkmcnt(3)
	v_fmac_f32_e32 v12, s4, v8
	s_delay_alu instid0(VALU_DEP_1)
	v_fmac_f32_e32 v12, s5, v9
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, FilterCoeffs@rel32@lo+68
	s_addc_u32 s5, s5, FilterCoeffs@rel32@hi+76
	s_clause 0x1
	s_load_b128 s[0:3], s[4:5], 0x0
	s_load_b32 s4, s[4:5], 0x10
	s_waitcnt lgkmcnt(0)
	v_fmac_f32_e32 v12, s6, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v12, s7, v11
	ds_load_2addr_b32 v[8:9], v3 offset0:12 offset1:13
	ds_load_2addr_b32 v[10:11], v3 offset0:14 offset1:15
	ds_load_b32 v0, v3 offset:80
	v_fmac_f32_e32 v12, s8, v4
	v_fmac_f32_e32 v12, s9, v5
	ds_load_2addr_b32 v[4:5], v3 offset0:16 offset1:17
	v_fmac_f32_e32 v12, s10, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v12, s11, v7
	ds_load_2addr_b32 v[6:7], v3 offset0:18 offset1:19
	s_waitcnt lgkmcnt(4)
	v_fmac_f32_e32 v12, s12, v8
	v_fmac_f32_e32 v12, s13, v9
	s_waitcnt lgkmcnt(3)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v12, s14, v10
	v_fmac_f32_e32 v12, s15, v11
	s_waitcnt lgkmcnt(1)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v12, s0, v4
	v_fmac_f32_e32 v12, s1, v5
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v12, s2, v6
	v_fmac_f32_e32 v12, s3, v7
	s_delay_alu instid0(VALU_DEP_1)
	v_fmac_f32_e32 v12, s4, v0
	v_add_co_u32 v0, vcc_lo, s18, v1
	v_add_co_ci_u32_e32 v1, vcc_lo, s19, v2, vcc_lo
	global_store_b32 v[0:1], v12, off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12SharedFilterPfS_i
		.amdhsa_group_segment_fixed_size 2128
		.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 13
		.amdhsa_next_free_sgpr 20
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z12SharedFilterPfS_i, .Lfunc_end1-_Z12SharedFilterPfS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 628
; NumSgprs: 22
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 2128 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 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
	.protected	FilterCoeffs            ; @FilterCoeffs
	.type	FilterCoeffs,@object
	.data
	.globl	FilterCoeffs
	.p2align	4, 0x0
FilterCoeffs:
	.long	0x3ba3d70a                      ; float 0.00499999989
	.long	0x3c23d70a                      ; float 0.00999999977
	.long	0x3ca3d70a                      ; float 0.0199999996
	.long	0x3cf5c28f                      ; float 0.0299999993
	.long	0x3d23d70a                      ; float 0.0399999991
	.long	0x3d4ccccd                      ; float 0.0500000007
	.long	0x3d75c28f                      ; float 0.0599999987
	.long	0x3d8f5c29                      ; float 0.0700000003
	.long	0x3e800000                      ; float 0.25
	.long	0x3f400000                      ; float 0.75
	.long	0x3f800000                      ; float 1
	.long	0x3f400000                      ; float 0.75
	.long	0x3e800000                      ; float 0.25
	.long	0x3d8f5c29                      ; float 0.0700000003
	.long	0x3d75c28f                      ; float 0.0599999987
	.long	0x3d4ccccd                      ; float 0.0500000007
	.long	0x3d23d70a                      ; float 0.0399999991
	.long	0x3cf5c28f                      ; float 0.0299999993
	.long	0x3ca3d70a                      ; float 0.0199999996
	.long	0x3c23d70a                      ; float 0.00999999977
	.long	0x3ba3d70a                      ; float 0.00499999989
	.size	FilterCoeffs, 84

	.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 FilterCoeffs
	.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:         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:           _Z12GlobalFilterPfS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z12GlobalFilterPfS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     24
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         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: 2128
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z12SharedFilterPfS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z12SharedFilterPfS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
