// kernel.cu
// Alex Getz

#include <cstddef>
#include <stdexcept>
#include <memory>
#include <cuda_profiler_api.h>

#include <fstream>
#include <cuda.h>
#include <curand.h>
#include <curand_kernel.h>
#include <cuda_runtime.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <string>

#include <random>
#include <functional>
#include <math.h>
#include <algorithm>
#include <array>

#define MAX_ENTRIES 11897026
#define B_SIZE 2000
#define TPB 128
#define SHMEM_SIZE 1024 * sizeof(int)








///////////////////////////////////////////////////////////////////////////////////////
inline
cudaError_t checkCuda(cudaError_t result)
{
#if defined(DEBUG) || defined(_DEBUG)
    if(result!=cudaSuccess){
        fprintf(stderr,"CUDA Runtime Error: %s\n",
                cudaGetErrorString(result));
        assert(result==cudaSuccess);
    }
#endif
    return result;
}

#define CUDA_CALL(x) do { if((x) != cudaSuccess) { \
    printf("Error at %s:%d\n",__FILE__,__LINE__); \
    return EXIT_FAILURE;}} /*while(0)*/

#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__);}
inline void gpuAssert(cudaError_t code, const char *file, int line, bool abort=true){
	if (code != cudaSuccess){
		fprintf(stderr,"GPUassert: %s %s %d\n", cudaGetErrorString(code), file, line);
		if(abort) exit(code);
	}
}
////////////////////////////////////////////////////////////////////////////////////////





/* ///   DEVICE FUNCTIONS   /// */

__device__ float getnextrand(curandState *state){
    return (float)(curand_uniform(state));
}

__device__ int getnextrandscaled(curandState *state, unsigned long int scale){
    return (unsigned long int) scale * getnextrand(state);
}


/* ///   DEVICE KERNELS   /// */

__global__ void initCurand(curandState *state, unsigned long seed){
    int idx = threadIdx.x + blockIdx.x * blockDim.x;
    curand_init(idx+seed, 0, 0, &state[idx]);
}

__global__ void bootstrap(double *output_mean, int *d_sample, curandState *state)
{
    __shared__ int partial_Sums[SHMEM_SIZE];

    unsigned int idx = threadIdx.x + (blockIdx.x*blockDim.x);
    unsigned int tNum = threadIdx.x;
    int bNum = blockIdx.x;
    int bSize = blockDim.x;
    unsigned long int ts = 0;
    long long int tSum = 0;
    int count = 0;

    for(unsigned int i=tNum; i<MAX_ENTRIES; i+=bSize){
	ts = getnextrandscaled(&state[idx], MAX_ENTRIES);
	tSum += d_sample[ts];
	count++;
    }
    partial_Sums[tNum] = tSum / count;
    __syncthreads();

    // Perform Sum reduction across all the threads of the block
    for(int s=(bSize/2); s>0; s >>= 1){
	// Each thread does work unless the index goes off the block
	if(tNum<s){
	    partial_Sums[tNum] += partial_Sums[tNum+s];
	}
	__syncthreads();
    }

    // Use first thread of each block to write results back to main mem
    if(tNum==0){
        output_mean[bNum] = (double)partial_Sums[0] / (double)bSize;
    }
}



/* ///   HOST GLOBAL FUNCTIONS   /// */

void throw_error(cudaError_t err){
    if(err != cudaSuccess)
	throw std::runtime_error(cudaGetErrorString(err));
}


/* ///   HOST GLOBAL STRUCTS & VARIABLES   /// */

struct cuda_free_deleter_t{
    void operator()(void* ptr) const
    {
	cudaFree(ptr);
    }
};


template <typename T>
auto cudaAllocBuffer(std::size_t size){
    void *ptr;
    throw_error(cudaMalloc(&ptr, size*sizeof(T)));
    return std::unique_ptr<T, cuda_free_deleter_t> { static_cast<T*>(ptr) };
}


int main(){
    int *BaseSample, *d_Base;
    double *d_mean, *h_mean;
    //curandState *devStates;
    checkCuda( cudaMallocHost((void**)&BaseSample,MAX_ENTRIES*sizeof(int)));
    //checkCuda( cudaMalloc((void**)&devStates,2048*1024*sizeof(curandState)));

    std::string line;
    uintmax_t m_numLines = 0;
    std::ifstream fs("../data/allCountries.txt");
    if(!fs){
        std::cout<<"ERROR\n";
    }else{
        while (std::getline(fs, line))
        {
            int counter=0;
            std::stringstream ss;
            std::string temp;
            // std::cout<<"\n"<<line<<"\n";
            ss << line;
            std::getline(ss,temp,'\t');
            // std::cout<<temp<<", position: "<<++counter<<"\n";
            while(std::getline(ss,temp,'\t')){
                if(temp.length() == 4){
                    BaseSample[m_numLines] = std::atoi(temp.c_str());



                    // std::cout<<temp<<", position: "<<++counter<<"\n";
                    break;
                } else{ ++counter; }
            }
            m_numLines++;
            // if(m_numLines==5){ break; }
        }
    }
    //std::cout << "m_numLines = " << m_numLines << "\nMoving on...\n\n";
    fs.close();

    //std::cout << "Element 300,000 of BaseSample: " << BaseSample[300000]<<std::endl;


    ///---			Calculating the Mean			 ---///
    ///////////////////////////////////////////////////////////////////////////
    std::cout<<"Sample has been generated.\nCalculating the mean...\n";
    long long int BaseSum = 0;
    for(int i=0;i<MAX_ENTRIES;i++){
	BaseSum += BaseSample[i];
    }
    double BaseMean = (double)BaseSum / (double)MAX_ENTRIES;
    std::cout<<"Mean has been calculated! Moving on...\n\n";
    


    ///---			KERNEL OPERATIONS			 ---///
    ///////////////////////////////////////////////////////////////////////////
    checkCuda( cudaMalloc((void**)&d_Base,MAX_ENTRIES*sizeof(int)));
    checkCuda( cudaMemcpy(d_Base,BaseSample,MAX_ENTRIES*sizeof(int),cudaMemcpyHostToDevice));


    //checkCuda( cudaFreeHost(BaseSample) );

    checkCuda( cudaMalloc((void**)&d_mean,2048*sizeof(double)));
    checkCuda( cudaMallocHost((void**)&h_mean,2048*sizeof(double)));

    std::cout<<"Launching initCurand Kernel now\n\n";

    //////////////////////////////////////
    //checkCuda( cudaProfilerStart() );
    try{
	constexpr int block_size = 512;
	constexpr int num_blocks = 4096;
	auto devStates = cudaAllocBuffer<curandState>(num_blocks * block_size);
	initCurand<<<num_blocks, block_size>>>(devStates.get(),1234);
	throw_error(cudaPeekAtLastError());
	throw_error(cudaDeviceSynchronize());
	std::cout<<"Curand Kernel Launch Try block SUCCESSFUL!\n";
	std::cout<<"Launching Bootstrap Kernel now\n\n";
	bootstrap<<<2048,1024>>>(d_mean,d_Base,devStates.get());
	throw_error(cudaPeekAtLastError());
	throw_error(cudaDeviceSynchronize());
	std::cout<<"Bootstrap Kernel Launch Try Block SUCCESSFUL!\n";
    }
    catch (const std::exception& e)
    {
	std::cerr << "Error: " << e.what() << '\n';
	return -1;
    }
    catch (...)
    {
	std::cerr << "Unknown Exception";
	return -1;
    }

    std::cout<<"Kernels appear complete, attempting to copy data back to Host\n";
    checkCuda( cudaMemcpy(h_mean,d_mean,2048*sizeof(double),cudaMemcpyDeviceToHost) );

    /* This loop is meant for testing the validity of the memcpy output
    for(int i=0;i<2048;++i){
        std::cout<<"element "<<i<<" : "<<h_mean[i]<<std::endl;
    }
    */

    // Standard Error of the bootstrap means
    int n = 2048;
    double SumOfMeans=0;
    for(int i=0;i<n;i++){
	SumOfMeans+=h_mean[i];
    }
    double MeanOfMeans = SumOfMeans / (double)n;
    std::cout<<"MeanofMeans: "<<MeanOfMeans<<"\n";

    double SqrDiff=0;
    for(int i=0;i<n;i++){
	SqrDiff += (h_mean[i]-MeanOfMeans) * (h_mean[i]-MeanOfMeans);
    }
    double SqrdVariance = SqrDiff / (n-1);
    double BootError = ((n-1)/(n*n)) * SqrdVariance;
    std::cout<<"SqrDiff, SqrdVariance, & BootError: "<<SqrDiff<<", "<<SqrdVariance<<", "<<BootError<<"\n";

    //std::sort(h_mean,h_mean+2048);
    std::cout<<"\nStandard Error is: "<<BootError<<"\n\n\n";

    double C_Arr[2048] = {};
    for(int i=0;i<n;i++){
	C_Arr[i]=h_mean[i]-BaseMean;
    }
    std::sort(std::begin(C_Arr),std::end(C_Arr));
    double L = 2048.0 * 0.1;
    int Lower = (int)L;
    double H = 2048 * 0.9;
    int Higher = (int)H;

    int LowerBound = C_Arr[Lower];
    int UpperBound = C_Arr[Higher];

    double Left = BaseMean - (double)LowerBound;
    double Right = BaseMean - (double)UpperBound;

    std::cout<<"\n\n\n------------------------------------------------\n";
    std::cout<<"The Confidence Interval is: 80%\n";
    std::cout<<"The Standard Error is: "<<BootError<<"\n";
    std::cout<<"This is on the 10th & 90th percentiles: ["<<Left<<", "<<Right<<"]\n";

    checkCuda( cudaFree(d_Base) );
    checkCuda( cudaFree(d_mean) );
    //checkCuda( cudaFree(devStates) );
    checkCuda( cudaFreeHost(BaseSample) );
    checkCuda( cudaFreeHost(h_mean) );
    printf("\n\n\nDONE\n");


    return 0;
}









//////////////////// Calculate Statistics. Soon to be offloaded
// int finalMean[400]={0};
// // std::vector<int> *meanVector;
// int bnum = 0;
// int sum1;
// int sum2 = 0;
// // int temp1;
// for (int a=0;a<400;++a){
//     sum1=0;
//     for(int b=0;b<100;++b){
//         sum1+=h_mean[b+(100*bnum)];
//     }
//     finalMean[a]=sum1/100;
//     // temp1 = sum1/100;
//     // meanVector[a].push_back( temp1 );
//     sum2 += std::pow( (finalMean[a]-meanOriginal), 2 );
//     bnum++;
//     // std::cout<<"Final Mean "<<a<<" : "<<finalMean[a]<<std::endl;
// }
// printf("\n\n\n");
// std::sort(finalMean,finalMean+SAMPLE_SIZE);
// std::cout<<"sum2 is "<<sum2<<std::endl;
// int div = 400;
// std::cout<<"div is "<<div<<std::endl;
// float stdDeviation = sqrt( (sum2/div) );
// std::cout<<"Standard Deviation is "<<stdDeviation<<std::endl;
// float stdErrorFactor = ( 100.0 / (100.0-1.0) );
// std::cout<<"The Error Factor is "<<stdErrorFactor<<std::endl;
// float stdError = sqrt( stdErrorFactor ) * stdDeviation;
// std::cout<<"Standard Error is "<<stdError<<std::endl;
// int tempA; int tempB;
// float lowerCI = 400 * ( 0.05/2 );
// tempA = finalMean[(int)lowerCI];
// std::cout<<"Lower (5%) Confidence Interval is "<<tempA<<std::endl;
// float higherCI = 400 * ( 1 - (0.05/2) );
// tempB = finalMean[(int)higherCI];
// std::cout<<"Higher (95%) Confidence Interval is "<<tempB<<std::endl;

	.file	"tmpxft_00209ee2_00000000-6_kernel.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB6546:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE6546:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0, @function
_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0:
.LFB7444:
	.cfi_startproc
	leaq	-1(%rdx), %rax
	movl	$2, %ecx
	movq	%rdx, %r8
	movq	%rsi, %r9
	cqto
	idivq	%rcx
	movq	%rsi, %rcx
.L3:
	cmpq	%rax, %rcx
	jge	.L15
	leaq	1(%rcx), %rsi
	addq	%rsi, %rsi
	movsd	-8(%rdi,%rsi,8), %xmm1
	comisd	(%rdi,%rsi,8), %xmm1
	jbe	.L4
	decq	%rsi
.L4:
	movsd	(%rdi,%rsi,8), %xmm1
	movsd	%xmm1, (%rdi,%rcx,8)
	movq	%rsi, %rcx
	jmp	.L3
.L15:
	testl	$1, %r8d
	jne	.L7
	leaq	-2(%r8), %rax
	movl	$2, %esi
	cqto
	idivq	%rsi
	cmpq	%rax, %rcx
	jne	.L7
	leaq	1(%rcx), %rax
	addq	%rax, %rax
	movsd	-8(%rdi,%rax,8), %xmm1
	movsd	%xmm1, (%rdi,%rcx,8)
	leaq	-1(%rax), %rcx
.L7:
	leaq	-1(%rcx), %rax
	movl	$2, %esi
.L13:
	cqto
	idivq	%rsi
	leaq	(%rdi,%rcx,8), %rdx
	cmpq	%rcx, %r9
	jge	.L8
	movsd	(%rdi,%rax,8), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L8
	movsd	%xmm1, (%rdx)
	leaq	-1(%rax), %rdx
	movq	%rax, %rcx
	movq	%rdx, %rax
	jmp	.L13
.L8:
	movsd	%xmm0, (%rdx)
	ret
	.cfi_endproc
.LFE7444:
	.size	_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0, .-_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0
	.type	_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0, @function
_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0:
.LFB7446:
	.cfi_startproc
	cmpq	%rsi, %rdi
	jne	.L31
	ret
.L31:
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$8, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	8(%rdi), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
.L18:
	cmpq	%rbx, %r12
	je	.L35
	movsd	(%rbx), %xmm0
	movsd	0(%rbp), %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L30
	movq	%rbx, %rdx
	subq	%rbp, %rdx
	cmpq	$8, %rdx
	jle	.L21
	movq	%r13, %rdi
	movq	%rbp, %rsi
	movsd	%xmm0, 8(%rsp)
	subq	%rdx, %rdi
	addq	%rbx, %rdi
	call	memmove@PLT
	movsd	8(%rsp), %xmm0
	jmp	.L22
.L21:
	jne	.L22
	movsd	%xmm1, (%rbx)
.L22:
	movsd	%xmm0, 0(%rbp)
	jmp	.L23
.L30:
	movq	%rbx, %rax
.L19:
	movsd	-8(%rax), %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L36
	movsd	%xmm1, (%rax)
	subq	$8, %rax
	jmp	.L19
.L36:
	movsd	%xmm0, (%rax)
.L23:
	addq	$8, %rbx
	jmp	.L18
.L35:
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE7446:
	.size	_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0, .-_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0
	.type	_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0, @function
_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0:
.LFB7450:
	.cfi_startproc
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rsi, %r10
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
.L38:
	movq	%r10, %rax
	subq	%rbx, %rax
	cmpq	$128, %rax
	jle	.L37
	movq	%rax, %rbp
	sarq	$3, %rbp
	testq	%r12, %r12
	jne	.L39
	leaq	-2(%rbp), %r11
	sarq	%r11
.L41:
	movsd	(%rbx,%r11,8), %xmm0
	movq	%rbp, %rdx
	movq	%r11, %rsi
	movq	%rbx, %rdi
	call	_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0
	testq	%r11, %r11
	je	.L40
	decq	%r11
	jmp	.L41
.L40:
	movq	%r10, %rax
	subq	%rbx, %rax
	cmpq	$8, %rax
	jle	.L37
	subq	$8, %r10
	movsd	(%rbx), %xmm1
	movsd	(%r10), %xmm0
	xorl	%esi, %esi
	movq	%r10, %rdx
	movq	%rbx, %rdi
	subq	%rbx, %rdx
	movsd	%xmm1, (%r10)
	sarq	$3, %rdx
	call	_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0
	jmp	.L40
.L39:
	sarq	$4, %rax
	movsd	8(%rbx), %xmm3
	movsd	(%rbx), %xmm0
	leaq	8(%rbx), %rbp
	leaq	(%rbx,%rax,8), %rax
	movsd	-8(%r10), %xmm1
	movsd	(%rax), %xmm2
	comisd	%xmm3, %xmm2
	jbe	.L69
	comisd	%xmm2, %xmm1
	jbe	.L70
.L76:
	movsd	%xmm2, (%rbx)
	movsd	%xmm0, (%rax)
.L50:
	movq	%r10, %rax
	jmp	.L47
.L70:
	comisd	%xmm3, %xmm1
	jbe	.L77
	jmp	.L75
.L69:
	comisd	%xmm3, %xmm1
	jbe	.L72
.L77:
	movsd	%xmm3, (%rbx)
	movsd	%xmm0, 8(%rbx)
	jmp	.L50
.L72:
	comisd	%xmm2, %xmm1
	jbe	.L76
.L75:
	movsd	%xmm1, (%rbx)
	movsd	%xmm0, -8(%r10)
	jmp	.L50
.L59:
	movsd	%xmm1, 0(%rbp)
	addq	$8, %rbp
	movsd	%xmm0, (%rax)
.L47:
	movsd	(%rbx), %xmm2
.L55:
	movsd	0(%rbp), %xmm0
	comisd	%xmm0, %xmm2
	jbe	.L58
	addq	$8, %rbp
	jmp	.L55
.L58:
	movsd	-8(%rax), %xmm1
	subq	$8, %rax
	comisd	%xmm2, %xmm1
	ja	.L58
	cmpq	%rax, %rbp
	jb	.L59
	decq	%r12
	movq	%r10, %rsi
	movq	%rbp, %rdi
	movq	%r12, %rdx
	call	_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0
	movq	%rbp, %r10
	jmp	.L38
.L37:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE7450:
	.size	_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0, .-_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0
	.globl	_Z11getnextrandP17curandStateXORWOW
	.type	_Z11getnextrandP17curandStateXORWOW, @function
_Z11getnextrandP17curandStateXORWOW:
.LFB6526:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE6526:
	.size	_Z11getnextrandP17curandStateXORWOW, .-_Z11getnextrandP17curandStateXORWOW
	.globl	_Z17getnextrandscaledP17curandStateXORWOWm
	.type	_Z17getnextrandscaledP17curandStateXORWOWm, @function
_Z17getnextrandscaledP17curandStateXORWOWm:
.LFB6527:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE6527:
	.size	_Z17getnextrandscaledP17curandStateXORWOWm, .-_Z17getnextrandscaledP17curandStateXORWOWm
	.globl	_Z11throw_error9cudaError
	.type	_Z11throw_error9cudaError, @function
_Z11throw_error9cudaError:
.LFB6528:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA6528
	endbr64
	testl	%edi, %edi
	je	.L82
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %ebp
	movl	$16, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	pushq	%rax
	.cfi_def_cfa_offset 32
	call	__cxa_allocate_exception@PLT
	movl	%ebp, %edi
	movq	%rax, %rbx
.LEHB0:
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZNSt13runtime_errorC1EPKc@PLT
.LEHE0:
	movq	_ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt13runtime_error(%rip), %rsi
	movq	%rbx, %rdi
.LEHB1:
	call	__cxa_throw@PLT
.L85:
	endbr64
	movq	%rax, %rbp
.L84:
	movq	%rbx, %rdi
	call	__cxa_free_exception@PLT
	movq	%rbp, %rdi
	call	_Unwind_Resume@PLT
.LEHE1:
.L82:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE6528:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA6528:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE6528-.LLSDACSB6528
.LLSDACSB6528:
	.uleb128 .LEHB0-.LFB6528
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L85-.LFB6528
	.uleb128 0
	.uleb128 .LEHB1-.LFB6528
	.uleb128 .LEHE1-.LEHB1
	.uleb128 0
	.uleb128 0
.LLSDACSE6528:
	.text
	.size	_Z11throw_error9cudaError, .-_Z11throw_error9cudaError
	.globl	_Z49__device_stub__Z10initCurandP17curandStateXORWOWmP17curandStateXORWOWm
	.type	_Z49__device_stub__Z10initCurandP17curandStateXORWOWmP17curandStateXORWOWm, @function
_Z49__device_stub__Z10initCurandP17curandStateXORWOWmP17curandStateXORWOWm:
.LFB6568:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L89
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z10initCurandP17curandStateXORWOWm(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L89:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L91
	call	__stack_chk_fail@PLT
.L91:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE6568:
	.size	_Z49__device_stub__Z10initCurandP17curandStateXORWOWmP17curandStateXORWOWm, .-_Z49__device_stub__Z10initCurandP17curandStateXORWOWmP17curandStateXORWOWm
	.globl	_Z10initCurandP17curandStateXORWOWm
	.type	_Z10initCurandP17curandStateXORWOWm, @function
_Z10initCurandP17curandStateXORWOWm:
.LFB6569:
	.cfi_startproc
	endbr64
	jmp	_Z49__device_stub__Z10initCurandP17curandStateXORWOWmP17curandStateXORWOWm
	.cfi_endproc
.LFE6569:
	.size	_Z10initCurandP17curandStateXORWOWm, .-_Z10initCurandP17curandStateXORWOWm
	.globl	_Z50__device_stub__Z9bootstrapPdPiP17curandStateXORWOWPdPiP17curandStateXORWOW
	.type	_Z50__device_stub__Z9bootstrapPdPiP17curandStateXORWOWPdPiP17curandStateXORWOW, @function
_Z50__device_stub__Z9bootstrapPdPiP17curandStateXORWOWPdPiP17curandStateXORWOW:
.LFB6570:
	.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
	movq	%rdx, 8(%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	8(%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	.L94
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z9bootstrapPdPiP17curandStateXORWOW(%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
.L94:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L96
	call	__stack_chk_fail@PLT
.L96:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE6570:
	.size	_Z50__device_stub__Z9bootstrapPdPiP17curandStateXORWOWPdPiP17curandStateXORWOW, .-_Z50__device_stub__Z9bootstrapPdPiP17curandStateXORWOWPdPiP17curandStateXORWOW
	.globl	_Z9bootstrapPdPiP17curandStateXORWOW
	.type	_Z9bootstrapPdPiP17curandStateXORWOW, @function
_Z9bootstrapPdPiP17curandStateXORWOW:
.LFB6571:
	.cfi_startproc
	endbr64
	jmp	_Z50__device_stub__Z9bootstrapPdPiP17curandStateXORWOWPdPiP17curandStateXORWOW
	.cfi_endproc
.LFE6571:
	.size	_Z9bootstrapPdPiP17curandStateXORWOW, .-_Z9bootstrapPdPiP17curandStateXORWOW
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z9bootstrapPdPiP17curandStateXORWOW"
.LC1:
	.string	"_Z10initCurandP17curandStateXORWOWm"
.LC2:
	.string	"precalc_xorwow_matrix"
.LC3:
	.string	"precalc_xorwow_offset_matrix"
.LC4:
	.string	"mrg32k3aM1"
.LC5:
	.string	"mrg32k3aM2"
.LC6:
	.string	"mrg32k3aM1SubSeq"
.LC7:
	.string	"mrg32k3aM2SubSeq"
.LC8:
	.string	"mrg32k3aM1Seq"
.LC9:
	.string	"mrg32k3aM2Seq"
.LC10:
	.string	"__cr_lgamma_table"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB6573:
	.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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z9bootstrapPdPiP17curandStateXORWOW(%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	.LC1(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z10initCurandP17curandStateXORWOWm(%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	.LC2(%rip), %rdx
	movl	$102400, %r9d
	leaq	_ZL21precalc_xorwow_matrix(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC3(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$102400, %r9d
	leaq	_ZL28precalc_xorwow_offset_matrix(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC4(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2304, %r9d
	leaq	_ZL10mrg32k3aM1(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC5(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2304, %r9d
	leaq	_ZL10mrg32k3aM2(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC6(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2016, %r9d
	leaq	_ZL16mrg32k3aM1SubSeq(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r11
	.cfi_def_cfa_offset 24
	popq	%rax
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC7(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2016, %r9d
	leaq	_ZL16mrg32k3aM2SubSeq(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC8(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2304, %r9d
	leaq	_ZL13mrg32k3aM1Seq(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC9(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$2304, %r9d
	leaq	_ZL13mrg32k3aM2Seq(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC10(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movl	$72, %r9d
	movq	%rdx, %rcx
	leaq	_ZL17__cr_lgamma_table(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE6573:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC12:
	.string	"../data/allCountries.txt"
.LC13:
	.string	"ERROR\n"
.LC14:
	.string	"Sample has been generated.\nCalculating the mean...\n"
.LC16:
	.string	"Mean has been calculated! Moving on...\n\n"
.LC17:
	.string	"Launching initCurand Kernel now\n\n"
.LC18:
	.string	"Curand Kernel Launch Try block SUCCESSFUL!\n"
.LC19:
	.string	"Launching Bootstrap Kernel now\n\n"
.LC20:
	.string	"Bootstrap Kernel Launch Try Block SUCCESSFUL!\n"
.LC21:
	.string	"Kernels appear complete, attempting to copy data back to Host\n"
.LC23:
	.string	"MeanofMeans: "
.LC24:
	.string	"\n"
.LC26:
	.string	"SqrDiff, SqrdVariance, & BootError: "
.LC27:
	.string	", "
.LC28:
	.string	"\nStandard Error is: "
.LC29:
	.string	"\n\n\n"
.LC30:
	.string	"\n\n\n------------------------------------------------\n"
.LC31:
	.string	"The Confidence Interval is: 80%\n"
.LC32:
	.string	"The Standard Error is: "
.LC33:
	.string	"This is on the 10th & 90th percentiles: ["
.LC34:
	.string	"]\n"
.LC35:
	.string	"\n\n\nDONE\n"
.LC36:
	.string	"Error: "
.LC37:
	.string	"Unknown Exception"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB6531:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA6531
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-16384(%rsp), %r11
	.cfi_def_cfa 11, 16440
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$696, %rsp
	.cfi_def_cfa_offset 17136
	movl	$47588104, %esi
	movq	%fs:40, %rax
	movq	%rax, 17064(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdi
	leaq	160(%rsp), %rbp
.LEHB2:
	call	cudaMallocHost@PLT
.LEHE2:
	xorl	%edx, %edx
	leaq	112(%rsp), %rax
	movq	%rbp, %rdi
	movq	%rdx, 104(%rsp)
	leaq	.LC12(%rip), %rsi
	movl	$8, %edx
	movq	%rax, 96(%rsp)
	movb	$0, 112(%rsp)
.LEHB3:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE3:
	xorl	%ebx, %ebx
	leaq	96(%rsp), %r14
	testb	$5, 448(%rsp)
	je	.L102
	leaq	.LC13(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
.LEHB4:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L108:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
	jmp	.L158
.L159:
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L108
	leaq	680(%rsp), %r12
	movq	%r12, %rdi
	call	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev@PLT
.LEHE4:
	leaq	144(%rsp), %rax
	movq	104(%rsp), %rdx
	movq	96(%rsp), %rsi
	leaq	696(%rsp), %rdi
	movq	%rax, 128(%rsp)
	xorl	%eax, %eax
	leaq	128(%rsp), %r13
	movq	%rax, 136(%rsp)
	movb	$0, 144(%rsp)
.LEHB5:
	call	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@PLT
	movl	$9, %edx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_@PLT
.L104:
	movl	$9, %edx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_@PLT
.LEHE5:
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L105
	cmpq	$4, 136(%rsp)
	jne	.L104
	movq	32(%rsp), %r15
	movq	128(%rsp), %rdi
	call	atoi@PLT
	addq	%rbx, %r15
	movl	%eax, (%r15)
.L105:
	movq	%r13, %rdi
	addq	$4, %rbx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r12, %rdi
	call	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
.L102:
	movq	%r14, %rsi
	movq	%rbp, %rdi
.LEHB6:
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	jmp	.L159
.L158:
	leaq	_ZSt4cout(%rip), %rbx
	leaq	.LC14(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	32(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%edx, %edx
.L109:
	movslq	(%rsi,%rax,4), %rcx
	incq	%rax
	addq	%rcx, %rdx
	cmpq	$11897026, %rax
	jne	.L109
	movq	%rbx, %rdi
	cvtsi2sdq	%rdx, %xmm0
	leaq	.LC16(%rip), %rsi
	divsd	.LC15(%rip), %xmm0
	movsd	%xmm0, 8(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	40(%rsp), %rdi
	movl	$47588104, %esi
	call	cudaMalloc@PLT
	movq	32(%rsp), %rsi
	movq	40(%rsp), %rdi
	movl	$1, %ecx
	movl	$47588104, %edx
	call	cudaMemcpy@PLT
	leaq	48(%rsp), %rdi
	movl	$16384, %esi
	call	cudaMalloc@PLT
	leaq	56(%rsp), %rdi
	movl	$16384, %esi
	call	cudaMallocHost@PLT
	leaq	.LC17(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.LEHE6:
	leaq	80(%rsp), %rdi
	movl	$100663296, %esi
.LEHB7:
	call	cudaMalloc@PLT
	movl	%eax, %edi
	call	_Z11throw_error9cudaError
.LEHE7:
	movl	$8388609, %edx
	movl	$1048577, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$9, %rdx
	salq	$12, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	80(%rsp), %r13
	movl	$1, 88(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%rdi, 68(%rsp)
	movl	$1, 76(%rsp)
.LEHB8:
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L110
	movl	$1234, %esi
	movq	%r13, %rdi
	call	_Z49__device_stub__Z10initCurandP17curandStateXORWOWmP17curandStateXORWOWm
.L110:
	call	cudaPeekAtLastError@PLT
	movl	%eax, %edi
	call	_Z11throw_error9cudaError
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	call	_Z11throw_error9cudaError
	leaq	.LC18(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC19(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$4194305, %edx
	movl	$2097153, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	salq	$11, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 80(%rsp)
	movl	$1, 88(%rsp)
	movq	%rdi, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L111
	movq	40(%rsp), %rsi
	movq	48(%rsp), %rdi
	movq	%r13, %rdx
	call	_Z50__device_stub__Z9bootstrapPdPiP17curandStateXORWOWPdPiP17curandStateXORWOW
.L111:
	call	cudaPeekAtLastError@PLT
	movl	%eax, %edi
	call	_Z11throw_error9cudaError
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	call	_Z11throw_error9cudaError
	leaq	.LC20(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.LEHE8:
	testq	%r13, %r13
	je	.L112
	movq	%r13, %rdi
	call	cudaFree@PLT
.L112:
	leaq	.LC21(%rip), %rsi
	movq	%rbx, %rdi
.LEHB9:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	48(%rsp), %rsi
	movq	56(%rsp), %rdi
	movl	$2, %ecx
	movl	$16384, %edx
	call	cudaMemcpy@PLT
	movq	56(%rsp), %rdx
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L113:
	addsd	(%rdx,%rax,8), %xmm0
	incq	%rax
	cmpq	$2048, %rax
	jne	.L113
	mulsd	.LC22(%rip), %xmm0
	leaq	.LC23(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	movsd	%xmm0, 16(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	16(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC24(%rip), %r13
	movq	%rax, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	$0x000000000, (%rsp)
	movq	56(%rsp), %rdx
	xorl	%eax, %eax
.L114:
	movsd	(%rdx,%rax,8), %xmm0
	subsd	16(%rsp), %xmm0
	incq	%rax
	mulsd	%xmm0, %xmm0
	addsd	(%rsp), %xmm0
	movsd	%xmm0, (%rsp)
	cmpq	$2048, %rax
	jne	.L114
	movaps	%xmm0, %xmm2
	xorps	%xmm0, %xmm0
	divsd	.LC25(%rip), %xmm2
	leaq	.LC26(%rip), %rsi
	mulsd	%xmm2, %xmm0
	leaq	_ZSt4cout(%rip), %rdi
	movsd	%xmm2, 24(%rsp)
	movsd	%xmm0, 16(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC27(%rip), %r12
	movq	%rax, %rdi
	movq	%r12, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	24(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movq	%r12, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	16(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC28(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	16(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC29(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	xorl	%eax, %eax
	movl	$4096, %ecx
	leaq	680(%rsp), %rdi
	movq	56(%rsp), %rdx
	rep stosl
	leaq	680(%rsp), %r15
	xorl	%eax, %eax
.L115:
	movsd	(%rdx,%rax), %xmm0
	subsd	8(%rsp), %xmm0
	movsd	%xmm0, (%r15,%rax)
	addq	$8, %rax
	cmpq	$16384, %rax
	jne	.L115
	leaq	17064(%rsp), %rbx
	movl	$22, %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	leaq	808(%rsp), %r14
	call	_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0
	movq	%r14, %rax
.L118:
	movsd	(%rax), %xmm0
	movq	%rax, %rdx
.L116:
	movsd	-8(%rdx), %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L160
	movsd	%xmm1, (%rdx)
	subq	$8, %rdx
	jmp	.L116
.L160:
	addq	$8, %rax
	movsd	%xmm0, (%rdx)
	cmpq	%rbx, %rax
	jne	.L118
	cvttsd2sil	2312(%rsp), %eax
	movsd	8(%rsp), %xmm3
	leaq	.LC30(%rip), %rsi
	movsd	8(%rsp), %xmm4
	leaq	_ZSt4cout(%rip), %rdi
	cvtsi2sdl	%eax, %xmm0
	cvttsd2sil	15424(%rsp), %eax
	subsd	%xmm0, %xmm3
	cvtsi2sdl	%eax, %xmm0
	movq	%xmm3, %rbx
	subsd	%xmm0, %xmm4
	movq	%xmm4, %r14
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC31(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC32(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	16(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC33(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%rbx, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movq	%r12, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%r14, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC34(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFreeHost@PLT
	movq	56(%rsp), %rdi
	call	cudaFreeHost@PLT
	leaq	.LC35(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.LEHE9:
	xorl	%ebx, %ebx
.L128:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	96(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	17064(%rsp), %rax
	subq	%fs:40, %rax
	je	.L133
	jmp	.L156
.L137:
	endbr64
	movq	%rax, %rbx
.L119:
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r12, %rdi
	call	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev@PLT
	jmp	.L120
.L139:
	endbr64
	movq	%rax, %rbx
	movq	%rdx, %r12
.L121:
	testq	%r13, %r13
	je	.L122
	movq	%r13, %rdi
	call	cudaFree@PLT
.L122:
	movq	%rbx, %rdi
	movq	%r12, %rdx
	jmp	.L123
.L138:
	endbr64
	movq	%rax, %rdi
.L123:
	decq	%rdx
	leaq	_ZSt4cerr(%rip), %r12
	jne	.L124
	call	__cxa_begin_catch@PLT
	leaq	.LC36(%rip), %rsi
	movq	%r12, %rdi
	movq	%rax, %rbx
.LEHB10:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %r12
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	call	*16(%rax)
	movq	%r12, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movb	$10, 68(%rsp)
	movq	%rax, %rdi
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 16(%rdi,%rax)
	je	.L125
	leaq	68(%rsp), %rsi
	movl	$1, %edx
	call	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@PLT
	jmp	.L126
.L125:
	movl	$10, %esi
	call	_ZNSo3putEc@PLT
.LEHE10:
.L126:
	call	__cxa_end_catch@PLT
	jmp	.L127
.L124:
	call	__cxa_begin_catch@PLT
	leaq	.LC37(%rip), %rsi
	movq	%r12, %rdi
.LEHB11:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.LEHE11:
.LEHB12:
	call	__cxa_end_catch@PLT
.LEHE12:
.L127:
	orl	$-1, %ebx
	jmp	.L128
.L140:
	endbr64
	movq	%rax, %rbx
.L129:
	call	__cxa_end_catch@PLT
	jmp	.L120
.L141:
	endbr64
	movq	%rax, %rbx
.L130:
	call	__cxa_end_catch@PLT
	jmp	.L120
.L136:
	endbr64
	movq	%rax, %rbx
.L120:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L131
.L135:
	endbr64
	movq	%rax, %rbx
.L131:
	leaq	96(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	17064(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L156
	movq	%rbx, %rdi
.LEHB13:
	call	_Unwind_Resume@PLT
.LEHE13:
.L156:
	call	__stack_chk_fail@PLT
.L133:
	addq	$17080, %rsp
	.cfi_def_cfa_offset 56
	movl	%ebx, %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
.LFE6531:
	.section	.gcc_except_table
	.align 4
.LLSDA6531:
	.byte	0xff
	.byte	0x9b
	.uleb128 .LLSDATT6531-.LLSDATTD6531
.LLSDATTD6531:
	.byte	0x1
	.uleb128 .LLSDACSE6531-.LLSDACSB6531
.LLSDACSB6531:
	.uleb128 .LEHB2-.LFB6531
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB3-.LFB6531
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L135-.LFB6531
	.uleb128 0
	.uleb128 .LEHB4-.LFB6531
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L136-.LFB6531
	.uleb128 0
	.uleb128 .LEHB5-.LFB6531
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L137-.LFB6531
	.uleb128 0
	.uleb128 .LEHB6-.LFB6531
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L136-.LFB6531
	.uleb128 0
	.uleb128 .LEHB7-.LFB6531
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L138-.LFB6531
	.uleb128 0x3
	.uleb128 .LEHB8-.LFB6531
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L139-.LFB6531
	.uleb128 0x3
	.uleb128 .LEHB9-.LFB6531
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L136-.LFB6531
	.uleb128 0
	.uleb128 .LEHB10-.LFB6531
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L140-.LFB6531
	.uleb128 0
	.uleb128 .LEHB11-.LFB6531
	.uleb128 .LEHE11-.LEHB11
	.uleb128 .L141-.LFB6531
	.uleb128 0
	.uleb128 .LEHB12-.LFB6531
	.uleb128 .LEHE12-.LEHB12
	.uleb128 .L136-.LFB6531
	.uleb128 0
	.uleb128 .LEHB13-.LFB6531
	.uleb128 .LEHE13-.LEHB13
	.uleb128 0
	.uleb128 0
.LLSDACSE6531:
	.byte	0x2
	.byte	0
	.byte	0x1
	.byte	0x7d
	.align 4
	.long	0

	.long	DW.ref._ZTISt9exception-.
.LLSDATT6531:
	.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	_ZL17__cr_lgamma_table
	.comm	_ZL17__cr_lgamma_table,72,32
	.local	_ZL13mrg32k3aM2Seq
	.comm	_ZL13mrg32k3aM2Seq,2304,32
	.local	_ZL13mrg32k3aM1Seq
	.comm	_ZL13mrg32k3aM1Seq,2304,32
	.local	_ZL16mrg32k3aM2SubSeq
	.comm	_ZL16mrg32k3aM2SubSeq,2016,32
	.local	_ZL16mrg32k3aM1SubSeq
	.comm	_ZL16mrg32k3aM1SubSeq,2016,32
	.local	_ZL10mrg32k3aM2
	.comm	_ZL10mrg32k3aM2,2304,32
	.local	_ZL10mrg32k3aM1
	.comm	_ZL10mrg32k3aM1,2304,32
	.local	_ZL28precalc_xorwow_offset_matrix
	.comm	_ZL28precalc_xorwow_offset_matrix,102400,32
	.local	_ZL21precalc_xorwow_matrix
	.comm	_ZL21precalc_xorwow_matrix,102400,32
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC15:
	.long	1073741824
	.long	1097249048
	.align 8
.LC22:
	.long	0
	.long	1061158912
	.align 8
.LC25:
	.long	0
	.long	1084226560
	.hidden	DW.ref._ZTISt9exception
	.weak	DW.ref._ZTISt9exception
	.section	.data.rel.local.DW.ref._ZTISt9exception,"awG",@progbits,DW.ref._ZTISt9exception,comdat
	.align 8
	.type	DW.ref._ZTISt9exception, @object
	.size	DW.ref._ZTISt9exception, 8
DW.ref._ZTISt9exception:
	.quad	_ZTISt9exception
	.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:

// kernel.cu
// Alex Getz

#include <cstddef>
#include <stdexcept>
#include <memory>
#include <hip/hip_runtime_api.h>

#include <fstream>
#include <hip/hip_runtime.h>
#include <hiprand/hiprand.h>
#include <hiprand/hiprand_kernel.h>

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <string>

#include <random>
#include <functional>
#include <math.h>
#include <algorithm>
#include <array>

#define MAX_ENTRIES 11897026
#define B_SIZE 2000
#define TPB 128
#define SHMEM_SIZE 1024 * sizeof(int)








///////////////////////////////////////////////////////////////////////////////////////
inline
hipError_t checkCuda(hipError_t result)
{
#if defined(DEBUG) || defined(_DEBUG)
    if(result!=hipSuccess){
        fprintf(stderr,"CUDA Runtime Error: %s\n",
                hipGetErrorString(result));
        assert(result==hipSuccess);
    }
#endif
    return result;
}

#define CUDA_CALL(x) do { if((x) != hipSuccess) { \
    printf("Error at %s:%d\n",__FILE__,__LINE__); \
    return EXIT_FAILURE;}} /*while(0)*/

#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__);}
inline void gpuAssert(hipError_t code, const char *file, int line, bool abort=true){
	if (code != hipSuccess){
		fprintf(stderr,"GPUassert: %s %s %d\n", hipGetErrorString(code), file, line);
		if(abort) exit(code);
	}
}
////////////////////////////////////////////////////////////////////////////////////////





/* ///   DEVICE FUNCTIONS   /// */

__device__ float getnextrand(hiprandState *state){
    return (float)(hiprand_uniform(state));
}

__device__ int getnextrandscaled(hiprandState *state, unsigned long int scale){
    return (unsigned long int) scale * getnextrand(state);
}


/* ///   DEVICE KERNELS   /// */

__global__ void initCurand(hiprandState *state, unsigned long seed){
    int idx = threadIdx.x + blockIdx.x * blockDim.x;
    hiprand_init(idx+seed, 0, 0, &state[idx]);
}

__global__ void bootstrap(double *output_mean, int *d_sample, hiprandState *state)
{
    __shared__ int partial_Sums[SHMEM_SIZE];

    unsigned int idx = threadIdx.x + (blockIdx.x*blockDim.x);
    unsigned int tNum = threadIdx.x;
    int bNum = blockIdx.x;
    int bSize = blockDim.x;
    unsigned long int ts = 0;
    long long int tSum = 0;
    int count = 0;

    for(unsigned int i=tNum; i<MAX_ENTRIES; i+=bSize){
	ts = getnextrandscaled(&state[idx], MAX_ENTRIES);
	tSum += d_sample[ts];
	count++;
    }
    partial_Sums[tNum] = tSum / count;
    __syncthreads();

    // Perform Sum reduction across all the threads of the block
    for(int s=(bSize/2); s>0; s >>= 1){
	// Each thread does work unless the index goes off the block
	if(tNum<s){
	    partial_Sums[tNum] += partial_Sums[tNum+s];
	}
	__syncthreads();
    }

    // Use first thread of each block to write results back to main mem
    if(tNum==0){
        output_mean[bNum] = (double)partial_Sums[0] / (double)bSize;
    }
}



/* ///   HOST GLOBAL FUNCTIONS   /// */

void throw_error(hipError_t err){
    if(err != hipSuccess)
	throw std::runtime_error(hipGetErrorString(err));
}


/* ///   HOST GLOBAL STRUCTS & VARIABLES   /// */

struct cuda_free_deleter_t{
    void operator()(void* ptr) const
    {
	hipFree(ptr);
    }
};


template <typename T>
auto cudaAllocBuffer(std::size_t size){
    void *ptr;
    throw_error(hipMalloc(&ptr, size*sizeof(T)));
    return std::unique_ptr<T, cuda_free_deleter_t> { static_cast<T*>(ptr) };
}


int main(){
    int *BaseSample, *d_Base;
    double *d_mean, *h_mean;
    //curandState *devStates;
    checkCuda( hipHostMalloc((void**)&BaseSample,MAX_ENTRIES*sizeof(int), hipHostMallocDefault));
    //checkCuda( cudaMalloc((void**)&devStates,2048*1024*sizeof(curandState)));

    std::string line;
    uintmax_t m_numLines = 0;
    std::ifstream fs("../data/allCountries.txt");
    if(!fs){
        std::cout<<"ERROR\n";
    }else{
        while (std::getline(fs, line))
        {
            int counter=0;
            std::stringstream ss;
            std::string temp;
            // std::cout<<"\n"<<line<<"\n";
            ss << line;
            std::getline(ss,temp,'\t');
            // std::cout<<temp<<", position: "<<++counter<<"\n";
            while(std::getline(ss,temp,'\t')){
                if(temp.length() == 4){
                    BaseSample[m_numLines] = std::atoi(temp.c_str());



                    // std::cout<<temp<<", position: "<<++counter<<"\n";
                    break;
                } else{ ++counter; }
            }
            m_numLines++;
            // if(m_numLines==5){ break; }
        }
    }
    //std::cout << "m_numLines = " << m_numLines << "\nMoving on...\n\n";
    fs.close();

    //std::cout << "Element 300,000 of BaseSample: " << BaseSample[300000]<<std::endl;


    ///---			Calculating the Mean			 ---///
    ///////////////////////////////////////////////////////////////////////////
    std::cout<<"Sample has been generated.\nCalculating the mean...\n";
    long long int BaseSum = 0;
    for(int i=0;i<MAX_ENTRIES;i++){
	BaseSum += BaseSample[i];
    }
    double BaseMean = (double)BaseSum / (double)MAX_ENTRIES;
    std::cout<<"Mean has been calculated! Moving on...\n\n";
    


    ///---			KERNEL OPERATIONS			 ---///
    ///////////////////////////////////////////////////////////////////////////
    checkCuda( hipMalloc((void**)&d_Base,MAX_ENTRIES*sizeof(int)));
    checkCuda( hipMemcpy(d_Base,BaseSample,MAX_ENTRIES*sizeof(int),hipMemcpyHostToDevice));


    //checkCuda( cudaFreeHost(BaseSample) );

    checkCuda( hipMalloc((void**)&d_mean,2048*sizeof(double)));
    checkCuda( hipHostMalloc((void**)&h_mean,2048*sizeof(double), hipHostMallocDefault));

    std::cout<<"Launching initCurand Kernel now\n\n";

    //////////////////////////////////////
    //checkCuda( cudaProfilerStart() );
    try{
	constexpr int block_size = 512;
	constexpr int num_blocks = 4096;
	auto devStates = cudaAllocBuffer<hiprandState>(num_blocks * block_size);
	initCurand<<<num_blocks, block_size>>>(devStates.get(),1234);
	throw_error(hipPeekAtLastError());
	throw_error(hipDeviceSynchronize());
	std::cout<<"Curand Kernel Launch Try block SUCCESSFUL!\n";
	std::cout<<"Launching Bootstrap Kernel now\n\n";
	bootstrap<<<2048,1024>>>(d_mean,d_Base,devStates.get());
	throw_error(hipPeekAtLastError());
	throw_error(hipDeviceSynchronize());
	std::cout<<"Bootstrap Kernel Launch Try Block SUCCESSFUL!\n";
    }
    catch (const std::exception& e)
    {
	std::cerr << "Error: " << e.what() << '\n';
	return -1;
    }
    catch (...)
    {
	std::cerr << "Unknown Exception";
	return -1;
    }

    std::cout<<"Kernels appear complete, attempting to copy data back to Host\n";
    checkCuda( hipMemcpy(h_mean,d_mean,2048*sizeof(double),hipMemcpyDeviceToHost) );

    /* This loop is meant for testing the validity of the memcpy output
    for(int i=0;i<2048;++i){
        std::cout<<"element "<<i<<" : "<<h_mean[i]<<std::endl;
    }
    */

    // Standard Error of the bootstrap means
    int n = 2048;
    double SumOfMeans=0;
    for(int i=0;i<n;i++){
	SumOfMeans+=h_mean[i];
    }
    double MeanOfMeans = SumOfMeans / (double)n;
    std::cout<<"MeanofMeans: "<<MeanOfMeans<<"\n";

    double SqrDiff=0;
    for(int i=0;i<n;i++){
	SqrDiff += (h_mean[i]-MeanOfMeans) * (h_mean[i]-MeanOfMeans);
    }
    double SqrdVariance = SqrDiff / (n-1);
    double BootError = ((n-1)/(n*n)) * SqrdVariance;
    std::cout<<"SqrDiff, SqrdVariance, & BootError: "<<SqrDiff<<", "<<SqrdVariance<<", "<<BootError<<"\n";

    //std::sort(h_mean,h_mean+2048);
    std::cout<<"\nStandard Error is: "<<BootError<<"\n\n\n";

    double C_Arr[2048] = {};
    for(int i=0;i<n;i++){
	C_Arr[i]=h_mean[i]-BaseMean;
    }
    std::sort(std::begin(C_Arr),std::end(C_Arr));
    double L = 2048.0 * 0.1;
    int Lower = (int)L;
    double H = 2048 * 0.9;
    int Higher = (int)H;

    int LowerBound = C_Arr[Lower];
    int UpperBound = C_Arr[Higher];

    double Left = BaseMean - (double)LowerBound;
    double Right = BaseMean - (double)UpperBound;

    std::cout<<"\n\n\n------------------------------------------------\n";
    std::cout<<"The Confidence Interval is: 80%\n";
    std::cout<<"The Standard Error is: "<<BootError<<"\n";
    std::cout<<"This is on the 10th & 90th percentiles: ["<<Left<<", "<<Right<<"]\n";

    checkCuda( hipFree(d_Base) );
    checkCuda( hipFree(d_mean) );
    //checkCuda( cudaFree(devStates) );
    checkCuda( hipHostFree(BaseSample) );
    checkCuda( hipHostFree(h_mean) );
    printf("\n\n\nDONE\n");


    return 0;
}









//////////////////// Calculate Statistics. Soon to be offloaded
// int finalMean[400]={0};
// // std::vector<int> *meanVector;
// int bnum = 0;
// int sum1;
// int sum2 = 0;
// // int temp1;
// for (int a=0;a<400;++a){
//     sum1=0;
//     for(int b=0;b<100;++b){
//         sum1+=h_mean[b+(100*bnum)];
//     }
//     finalMean[a]=sum1/100;
//     // temp1 = sum1/100;
//     // meanVector[a].push_back( temp1 );
//     sum2 += std::pow( (finalMean[a]-meanOriginal), 2 );
//     bnum++;
//     // std::cout<<"Final Mean "<<a<<" : "<<finalMean[a]<<std::endl;
// }
// printf("\n\n\n");
// std::sort(finalMean,finalMean+SAMPLE_SIZE);
// std::cout<<"sum2 is "<<sum2<<std::endl;
// int div = 400;
// std::cout<<"div is "<<div<<std::endl;
// float stdDeviation = sqrt( (sum2/div) );
// std::cout<<"Standard Deviation is "<<stdDeviation<<std::endl;
// float stdErrorFactor = ( 100.0 / (100.0-1.0) );
// std::cout<<"The Error Factor is "<<stdErrorFactor<<std::endl;
// float stdError = sqrt( stdErrorFactor ) * stdDeviation;
// std::cout<<"Standard Error is "<<stdError<<std::endl;
// int tempA; int tempB;
// float lowerCI = 400 * ( 0.05/2 );
// tempA = finalMean[(int)lowerCI];
// std::cout<<"Lower (5%) Confidence Interval is "<<tempA<<std::endl;
// float higherCI = 400 * ( 1 - (0.05/2) );
// tempB = finalMean[(int)higherCI];
// std::cout<<"Higher (95%) Confidence Interval is "<<tempB<<std::endl;

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

                                        # End of file scope inline assembly
	.globl	_Z25__device_stub__initCurandP12hiprandStatem # -- Begin function _Z25__device_stub__initCurandP12hiprandStatem
	.type	_Z25__device_stub__initCurandP12hiprandStatem,@function
_Z25__device_stub__initCurandP12hiprandStatem: # @_Z25__device_stub__initCurandP12hiprandStatem
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z10initCurandP12hiprandStatem, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z25__device_stub__initCurandP12hiprandStatem, .Lfunc_end0-_Z25__device_stub__initCurandP12hiprandStatem
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__bootstrapPdPiP12hiprandState # -- Begin function _Z24__device_stub__bootstrapPdPiP12hiprandState
	.type	_Z24__device_stub__bootstrapPdPiP12hiprandState,@function
_Z24__device_stub__bootstrapPdPiP12hiprandState: # @_Z24__device_stub__bootstrapPdPiP12hiprandState
	.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	24(%rsp), %rsi
	movq	%rdx, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9bootstrapPdPiP12hiprandState, %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	_Z24__device_stub__bootstrapPdPiP12hiprandState, .Lfunc_end1-_Z24__device_stub__bootstrapPdPiP12hiprandState
	.cfi_endproc
                                        # -- End function
	.globl	_Z11throw_error10hipError_t     # -- Begin function _Z11throw_error10hipError_t
	.type	_Z11throw_error10hipError_t,@function
_Z11throw_error10hipError_t:            # @_Z11throw_error10hipError_t
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	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
	testl	%edi, %edi
	jne	.LBB2_1
# %bb.5:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB2_1:
	.cfi_def_cfa_offset 32
	movl	%edi, %ebp
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %rbx
.Ltmp0:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp1:
# %bb.2:
.Ltmp2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_ZNSt13runtime_errorC1EPKc
.Ltmp3:
# %bb.3:
	movl	$_ZTISt13runtime_error, %esi
	movl	$_ZNSt13runtime_errorD1Ev, %edx
	movq	%rbx, %rdi
	callq	__cxa_throw
.LBB2_4:
.Ltmp4:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	__cxa_free_exception
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_Z11throw_error10hipError_t, .Lfunc_end2-_Z11throw_error10hipError_t
	.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 .Ltmp3-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp3
	.uleb128 .Ltmp4-.Lfunc_begin0           #     jumps to .Ltmp4
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Lfunc_end2-.Ltmp3             #   Call between .Ltmp3 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI3_0:
	.quad	0x4166b11840000000              # double 11897026
.LCPI3_1:
	.quad	0x3f40000000000000              # double 4.8828125E-4
.LCPI3_2:
	.quad	0x409ffc0000000000              # double 2047
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$17064, %rsp                    # imm = 0x42A8
	.cfi_def_cfa_offset 17120
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	16(%rsp), %rdi
	movl	$47588104, %esi                 # imm = 0x2D62308
	xorl	%edx, %edx
	callq	hipHostMalloc
	leaq	96(%rsp), %rax
	movq	%rax, -16(%rax)
	movq	$0, -8(%rax)
	movb	$0, (%rax)
.Ltmp5:
	leaq	152(%rsp), %rdi
	movl	$.L.str, %esi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp6:
# %bb.1:
	movq	152(%rsp), %rax
	movq	-24(%rax), %rax
	testb	$5, 184(%rsp,%rax)
	je	.LBB3_2
# %bb.25:
.Ltmp8:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp9:
.LBB3_26:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp15:
	leaq	152(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp16:
# %bb.27:
.Ltmp17:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$51, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp18:
# %bb.28:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit102.preheader
	movq	16(%rsp), %rax
	xorl	%ecx, %ecx
	xorl	%ebx, %ebx
.LBB3_29:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit102
                                        # =>This Inner Loop Header: Depth=1
	movslq	(%rax,%rcx,4), %rdx
	addq	%rdx, %rbx
	incq	%rcx
	cmpq	$11897026, %rcx                 # imm = 0xB588C2
	jne	.LBB3_29
# %bb.30:
.Ltmp20:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$40, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp21:
# %bb.31:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit104
.Ltmp22:
	leaq	40(%rsp), %rdi
	movl	$47588104, %esi                 # imm = 0x2D62308
	callq	hipMalloc
.Ltmp23:
# %bb.32:
	movq	40(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp24:
	movl	$47588104, %edx                 # imm = 0x2D62308
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp25:
# %bb.33:
.Ltmp26:
	leaq	32(%rsp), %rdi
	movl	$16384, %esi                    # imm = 0x4000
	callq	hipMalloc
.Ltmp27:
# %bb.34:
.Ltmp28:
	leaq	8(%rsp), %rdi
	movl	$16384, %esi                    # imm = 0x4000
	xorl	%edx, %edx
	callq	hipHostMalloc
.Ltmp29:
# %bb.35:
.Ltmp30:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$33, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp31:
# %bb.36:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit106
.Ltmp32:
	leaq	672(%rsp), %rdi
	movl	$100663296, %esi                # imm = 0x6000000
	callq	hipMalloc
.Ltmp33:
# %bb.37:                               # %.noexc107
.Ltmp34:
	movl	%eax, %edi
	callq	_Z11throw_error10hipError_t
.Ltmp35:
# %bb.38:
	movq	672(%rsp), %rax
	movq	%rax, 48(%rsp)
.Ltmp37:
	movabsq	$4294971392, %rdi               # imm = 0x100001000
	movabsq	$4294967808, %rdx               # imm = 0x100000200
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp38:
# %bb.39:
	testl	%eax, %eax
	jne	.LBB3_41
# %bb.40:
	movq	48(%rsp), %rdi
.Ltmp39:
	movl	$1234, %esi                     # imm = 0x4D2
	callq	_Z25__device_stub__initCurandP12hiprandStatem
.Ltmp40:
.LBB3_41:
.Ltmp41:
	callq	hipPeekAtLastError
.Ltmp42:
# %bb.42:
.Ltmp43:
	movl	%eax, %edi
	callq	_Z11throw_error10hipError_t
.Ltmp44:
# %bb.43:
.Ltmp45:
	callq	hipDeviceSynchronize
.Ltmp46:
# %bb.44:
.Ltmp47:
	movl	%eax, %edi
	callq	_Z11throw_error10hipError_t
.Ltmp48:
# %bb.45:
.Ltmp49:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$43, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp50:
# %bb.46:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit110
.Ltmp51:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$32, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp52:
# %bb.47:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit112
.Ltmp53:
	movabsq	$4294969344, %rdi               # imm = 0x100000800
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp54:
# %bb.48:
	testl	%eax, %eax
	jne	.LBB3_50
# %bb.49:
	movq	32(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	48(%rsp), %rdx
.Ltmp55:
	callq	_Z24__device_stub__bootstrapPdPiP12hiprandState
.Ltmp56:
.LBB3_50:
.Ltmp57:
	callq	hipPeekAtLastError
.Ltmp58:
# %bb.51:
.Ltmp59:
	movl	%eax, %edi
	callq	_Z11throw_error10hipError_t
.Ltmp60:
# %bb.52:
.Ltmp61:
	callq	hipDeviceSynchronize
.Ltmp62:
# %bb.53:
.Ltmp63:
	movl	%eax, %edi
	callq	_Z11throw_error10hipError_t
.Ltmp64:
# %bb.54:
.Ltmp65:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$46, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp66:
# %bb.55:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit114
	leaq	48(%rsp), %rdi
	callq	_ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev
.Ltmp88:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	movl	$62, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp89:
# %bb.56:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit116
	movq	8(%rsp), %rdi
	movq	32(%rsp), %rsi
.Ltmp90:
	movl	$16384, %edx                    # imm = 0x4000
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp91:
# %bb.57:                               # %.preheader
	cvtsi2sd	%rbx, %xmm0
	divsd	.LCPI3_0(%rip), %xmm0
	movsd	%xmm0, 24(%rsp)                 # 8-byte Spill
	xorpd	%xmm0, %xmm0
	movq	8(%rsp), %rax
	xorl	%ecx, %ecx
.LBB3_58:                               # =>This Inner Loop Header: Depth=1
	addsd	(%rax,%rcx,8), %xmm0
	incq	%rcx
	cmpq	$2048, %rcx                     # imm = 0x800
	jne	.LBB3_58
# %bb.59:
.Ltmp93:
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str.11, %esi
	movl	$13, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp94:
# %bb.60:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit122
.Ltmp95:
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	mulsd	.LCPI3_1(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp96:
# %bb.61:                               # %_ZNSolsEd.exit
.Ltmp97:
	movl	$.L.str.12, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp98:
# %bb.62:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit125.preheader
	xorpd	%xmm1, %xmm1
	movq	8(%rsp), %rax
	xorl	%ecx, %ecx
	movsd	(%rsp), %xmm2                   # 8-byte Reload
                                        # xmm2 = mem[0],zero
.LBB3_63:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit125
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rax,%rcx,8), %xmm0            # xmm0 = mem[0],zero
	subsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	incq	%rcx
	cmpq	$2048, %rcx                     # imm = 0x800
	jne	.LBB3_63
# %bb.64:
.Ltmp100:
	movsd	%xmm1, (%rsp)                   # 8-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str.13, %esi
	movl	$36, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp101:
# %bb.65:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit127
.Ltmp102:
	movl	$_ZSt4cout, %edi
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp103:
# %bb.66:                               # %_ZNSolsEd.exit129
.Ltmp104:
	movq	%rax, %rbx
	movl	$.L.str.14, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp105:
# %bb.67:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit131
.Ltmp106:
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	divsd	.LCPI3_2(%rip), %xmm0
	movq	%rbx, %rdi
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp107:
# %bb.68:                               # %_ZNSolsEd.exit133
.Ltmp108:
	movq	%rax, %rbx
	movl	$.L.str.14, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp109:
# %bb.69:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit135
.Ltmp110:
	xorpd	%xmm1, %xmm1
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	mulsd	%xmm1, %xmm0
	movq	%rbx, %rdi
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp111:
# %bb.70:                               # %_ZNSolsEd.exit137
.Ltmp112:
	movl	$.L.str.12, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp113:
# %bb.71:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit139
.Ltmp114:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.15, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp115:
# %bb.72:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit141
.Ltmp116:
	movl	$_ZSt4cout, %edi
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp117:
# %bb.73:                               # %_ZNSolsEd.exit143
.Ltmp118:
	movl	$.L.str.16, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp119:
# %bb.74:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit145
	leaq	672(%rsp), %rdi
	xorl	%ebx, %ebx
	movl	$16384, %edx                    # imm = 0x4000
	xorl	%esi, %esi
	callq	memset@PLT
	movq	8(%rsp), %rax
	movsd	24(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
.LBB3_75:                               # =>This Inner Loop Header: Depth=1
	movsd	(%rax,%rbx,8), %xmm0            # xmm0 = mem[0],zero
	subsd	%xmm1, %xmm0
	movsd	%xmm0, 672(%rsp,%rbx,8)
	incq	%rbx
	cmpq	$2048, %rbx                     # imm = 0x800
	jne	.LBB3_75
# %bb.76:
	leaq	17056(%rsp), %rbx
.Ltmp121:
	leaq	672(%rsp), %rdi
	movl	$22, %edx
	movq	%rbx, %rsi
	callq	_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_
.Ltmp122:
# %bb.77:                               # %.noexc146
.Ltmp123:
	leaq	672(%rsp), %rdi
	movq	%rbx, %rsi
	callq	_ZSt22__final_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
.Ltmp124:
# %bb.78:                               # %_ZSt4sortIPdEvT_S1_.exit
	movsd	2304(%rsp), %xmm0               # xmm0 = mem[0],zero
	movaps	%xmm0, 128(%rsp)                # 16-byte Spill
	movsd	15416(%rsp), %xmm0              # xmm0 = mem[0],zero
	movapd	%xmm0, 112(%rsp)                # 16-byte Spill
.Ltmp126:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.17, %esi
	movl	$52, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp127:
# %bb.79:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit149
.Ltmp128:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.18, %esi
	movl	$32, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp129:
# %bb.80:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit151
.Ltmp130:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.19, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp131:
# %bb.81:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit153
.Ltmp132:
	movl	$_ZSt4cout, %edi
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp133:
# %bb.82:                               # %_ZNSolsEd.exit155
.Ltmp134:
	movl	$.L.str.12, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp135:
# %bb.83:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit157
.Ltmp136:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.20, %esi
	movl	$41, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp137:
# %bb.84:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit159
.Ltmp138:
	cvttpd2dq	128(%rsp), %xmm0        # 16-byte Folded Reload
	cvtdq2pd	%xmm0, %xmm1
	movsd	24(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	subsd	%xmm1, %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp139:
# %bb.85:                               # %_ZNSolsEd.exit161
.Ltmp140:
	movq	%rax, %rbx
	movl	$.L.str.14, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp141:
# %bb.86:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit163
.Ltmp142:
	cvttpd2dq	112(%rsp), %xmm0        # 16-byte Folded Reload
	cvtdq2pd	%xmm0, %xmm1
	movsd	24(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	subsd	%xmm1, %xmm0
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp143:
# %bb.87:                               # %_ZNSolsEd.exit165
.Ltmp144:
	movl	$.L.str.21, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp145:
# %bb.88:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit167
	movq	40(%rsp), %rdi
.Ltmp146:
	callq	hipFree
.Ltmp147:
# %bb.89:
	movq	32(%rsp), %rdi
.Ltmp148:
	callq	hipFree
.Ltmp149:
# %bb.90:
	movq	16(%rsp), %rdi
.Ltmp150:
	callq	hipHostFree
.Ltmp151:
# %bb.91:
	movq	8(%rsp), %rdi
.Ltmp152:
	callq	hipHostFree
.Ltmp153:
# %bb.92:
	movl	$.Lstr, %edi
	callq	puts@PLT
	xorl	%ebx, %ebx
.LBB3_103:
	leaq	152(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	80(%rsp), %rdi
	leaq	96(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB3_105
# %bb.104:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i168
	callq	_ZdlPv
.LBB3_105:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit170
	movl	%ebx, %eax
	addq	$17064, %rsp                    # imm = 0x42A8
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB3_2:                                # %.preheader186
	.cfi_def_cfa_offset 17120
	leaq	64(%rsp), %r14
	xorl	%r15d, %r15d
	leaq	80(%rsp), %r12
	leaq	672(%rsp), %r13
	leaq	48(%rsp), %rbp
.LBB3_3:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_9 Depth 2
	leaq	(%rsp,%rax), %rdi
	addq	$152, %rdi
.Ltmp10:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp11:
# %bb.4:                                # %.noexc
                                        #   in Loop: Header=BB3_3 Depth=1
.Ltmp12:
	movsbl	%al, %edx
	leaq	152(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp13:
# %bb.5:                                #   in Loop: Header=BB3_3 Depth=1
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB3_26
# %bb.6:                                #   in Loop: Header=BB3_3 Depth=1
.Ltmp155:
	movq	%r13, %rdi
	callq	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev
.Ltmp156:
# %bb.7:                                #   in Loop: Header=BB3_3 Depth=1
	movq	%r14, 48(%rsp)
	movq	$0, 56(%rsp)
	movb	$0, 64(%rsp)
	movq	80(%rsp), %rsi
	movq	88(%rsp), %rdx
.Ltmp158:
	leaq	688(%rsp), %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp159:
# %bb.8:                                # %_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit
                                        #   in Loop: Header=BB3_3 Depth=1
.Ltmp160:
	movq	%r13, %rdi
	movq	%rbp, %rsi
	movl	$9, %edx
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp161:
.LBB3_9:                                # %.preheader184
                                        #   Parent Loop BB3_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
.Ltmp163:
	movq	%r13, %rdi
	movq	%rbp, %rsi
	movl	$9, %edx
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp164:
# %bb.10:                               #   in Loop: Header=BB3_9 Depth=2
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB3_21
# %bb.11:                               #   in Loop: Header=BB3_9 Depth=2
	cmpq	$4, 56(%rsp)
	jne	.LBB3_9
# %bb.12:                               #   in Loop: Header=BB3_3 Depth=1
	movq	48(%rsp), %rbx
	movq	%rbx, %rdi
	callq	atoi
	movq	16(%rsp), %rcx
	movl	%eax, (%rcx,%r15,4)
	jmp	.LBB3_22
.LBB3_21:                               # %.loopexit185.loopexit
                                        #   in Loop: Header=BB3_3 Depth=1
	movq	48(%rsp), %rbx
.LBB3_22:                               # %.loopexit185
                                        #   in Loop: Header=BB3_3 Depth=1
	cmpq	%r14, %rbx
	je	.LBB3_24
# %bb.23:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i98
                                        #   in Loop: Header=BB3_3 Depth=1
	movq	%rbx, %rdi
	callq	_ZdlPv
.LBB3_24:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit100
                                        #   in Loop: Header=BB3_3 Depth=1
	incq	%r15
	movl	$_ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE, %esi
	movq	%r13, %rdi
	callq	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	800(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	movq	152(%rsp), %rax
	movq	-24(%rax), %rax
	jmp	.LBB3_3
.LBB3_13:
.Ltmp7:
	movq	%rax, %rbx
	jmp	.LBB3_115
.LBB3_110:
.Ltmp125:
	jmp	.LBB3_113
.LBB3_95:
.Ltmp36:
	movq	%rdx, %rbx
	movq	%rax, %r14
	jmp	.LBB3_96
.LBB3_14:                               # %.loopexit.split-lp188
.Ltmp19:
	jmp	.LBB3_113
.LBB3_119:
.Ltmp99:
	jmp	.LBB3_113
.LBB3_109:
.Ltmp120:
	jmp	.LBB3_113
.LBB3_15:
.Ltmp157:
	jmp	.LBB3_113
.LBB3_94:
.Ltmp67:
	movq	%rdx, %rbx
	movq	%rax, %r14
	leaq	48(%rsp), %rdi
	callq	_ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev
.LBB3_96:
	movq	%r14, %rdi
	callq	__cxa_begin_catch
	cmpl	$2, %ebx
	jne	.LBB3_101
# %bb.97:
.Ltmp75:
	movq	%rax, %r14
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.9, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp76:
# %bb.98:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit118
	movq	(%r14), %rax
	movq	%r14, %rdi
	callq	*16(%rax)
.Ltmp77:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp78:
# %bb.99:
.Ltmp79:
	movq	%rax, %rdi
	movl	$10, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c
.Ltmp80:
# %bb.100:
	movl	$-1, %ebx
.Ltmp85:
	callq	__cxa_end_catch
.Ltmp86:
	jmp	.LBB3_103
.LBB3_101:
.Ltmp68:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.8, %esi
	movl	$17, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp69:
# %bb.102:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit120
	movl	$-1, %ebx
.Ltmp73:
	callq	__cxa_end_catch
.Ltmp74:
	jmp	.LBB3_103
.LBB3_106:
.Ltmp70:
	movq	%rax, %rbx
.Ltmp71:
	callq	__cxa_end_catch
.Ltmp72:
	jmp	.LBB3_114
.LBB3_108:
.Ltmp87:
	jmp	.LBB3_113
.LBB3_107:
.Ltmp81:
	movq	%rax, %rbx
.Ltmp82:
	callq	__cxa_end_catch
.Ltmp83:
	jmp	.LBB3_114
.LBB3_118:
.Ltmp84:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.LBB3_93:
.Ltmp92:
	jmp	.LBB3_113
.LBB3_111:
.Ltmp154:
	jmp	.LBB3_113
.LBB3_17:                               # %.loopexit.split-lp
.Ltmp162:
	jmp	.LBB3_18
.LBB3_112:                              # %.loopexit187
.Ltmp14:
.LBB3_113:
	movq	%rax, %rbx
	jmp	.LBB3_114
.LBB3_16:                               # %.loopexit
.Ltmp165:
.LBB3_18:
	movq	%rax, %rbx
	movq	48(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB3_20
# %bb.19:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB3_20:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	leaq	672(%rsp), %rdi
	movl	$_ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE, %esi
	callq	_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED2Ev
	leaq	800(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
.LBB3_114:
	leaq	152(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
.LBB3_115:
	movq	80(%rsp), %rdi
	leaq	96(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB3_117
# %bb.116:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i171
	callq	_ZdlPv
.LBB3_117:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit173
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table3:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp5-.Lfunc_begin1           #   Call between .Lfunc_begin1 and .Ltmp5
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp5-.Lfunc_begin1           # >> Call Site 2 <<
	.uleb128 .Ltmp6-.Ltmp5                  #   Call between .Ltmp5 and .Ltmp6
	.uleb128 .Ltmp7-.Lfunc_begin1           #     jumps to .Ltmp7
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin1           # >> Call Site 3 <<
	.uleb128 .Ltmp18-.Ltmp8                 #   Call between .Ltmp8 and .Ltmp18
	.uleb128 .Ltmp19-.Lfunc_begin1          #     jumps to .Ltmp19
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp20-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp31-.Ltmp20                #   Call between .Ltmp20 and .Ltmp31
	.uleb128 .Ltmp92-.Lfunc_begin1          #     jumps to .Ltmp92
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp32-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp35-.Ltmp32                #   Call between .Ltmp32 and .Ltmp35
	.uleb128 .Ltmp36-.Lfunc_begin1          #     jumps to .Ltmp36
	.byte	3                               #   On action: 2
	.uleb128 .Ltmp37-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Ltmp66-.Ltmp37                #   Call between .Ltmp37 and .Ltmp66
	.uleb128 .Ltmp67-.Lfunc_begin1          #     jumps to .Ltmp67
	.byte	3                               #   On action: 2
	.uleb128 .Ltmp88-.Lfunc_begin1          # >> Call Site 7 <<
	.uleb128 .Ltmp91-.Ltmp88                #   Call between .Ltmp88 and .Ltmp91
	.uleb128 .Ltmp92-.Lfunc_begin1          #     jumps to .Ltmp92
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp93-.Lfunc_begin1          # >> Call Site 8 <<
	.uleb128 .Ltmp98-.Ltmp93                #   Call between .Ltmp93 and .Ltmp98
	.uleb128 .Ltmp99-.Lfunc_begin1          #     jumps to .Ltmp99
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp100-.Lfunc_begin1         # >> Call Site 9 <<
	.uleb128 .Ltmp119-.Ltmp100              #   Call between .Ltmp100 and .Ltmp119
	.uleb128 .Ltmp120-.Lfunc_begin1         #     jumps to .Ltmp120
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp119-.Lfunc_begin1         # >> Call Site 10 <<
	.uleb128 .Ltmp121-.Ltmp119              #   Call between .Ltmp119 and .Ltmp121
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp121-.Lfunc_begin1         # >> Call Site 11 <<
	.uleb128 .Ltmp124-.Ltmp121              #   Call between .Ltmp121 and .Ltmp124
	.uleb128 .Ltmp125-.Lfunc_begin1         #     jumps to .Ltmp125
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp126-.Lfunc_begin1         # >> Call Site 12 <<
	.uleb128 .Ltmp153-.Ltmp126              #   Call between .Ltmp126 and .Ltmp153
	.uleb128 .Ltmp154-.Lfunc_begin1         #     jumps to .Ltmp154
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp10-.Lfunc_begin1          # >> Call Site 13 <<
	.uleb128 .Ltmp13-.Ltmp10                #   Call between .Ltmp10 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin1          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp155-.Lfunc_begin1         # >> Call Site 14 <<
	.uleb128 .Ltmp156-.Ltmp155              #   Call between .Ltmp155 and .Ltmp156
	.uleb128 .Ltmp157-.Lfunc_begin1         #     jumps to .Ltmp157
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp158-.Lfunc_begin1         # >> Call Site 15 <<
	.uleb128 .Ltmp161-.Ltmp158              #   Call between .Ltmp158 and .Ltmp161
	.uleb128 .Ltmp162-.Lfunc_begin1         #     jumps to .Ltmp162
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp163-.Lfunc_begin1         # >> Call Site 16 <<
	.uleb128 .Ltmp164-.Ltmp163              #   Call between .Ltmp163 and .Ltmp164
	.uleb128 .Ltmp165-.Lfunc_begin1         #     jumps to .Ltmp165
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp164-.Lfunc_begin1         # >> Call Site 17 <<
	.uleb128 .Ltmp75-.Ltmp164               #   Call between .Ltmp164 and .Ltmp75
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp75-.Lfunc_begin1          # >> Call Site 18 <<
	.uleb128 .Ltmp76-.Ltmp75                #   Call between .Ltmp75 and .Ltmp76
	.uleb128 .Ltmp81-.Lfunc_begin1          #     jumps to .Ltmp81
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp76-.Lfunc_begin1          # >> Call Site 19 <<
	.uleb128 .Ltmp77-.Ltmp76                #   Call between .Ltmp76 and .Ltmp77
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp77-.Lfunc_begin1          # >> Call Site 20 <<
	.uleb128 .Ltmp80-.Ltmp77                #   Call between .Ltmp77 and .Ltmp80
	.uleb128 .Ltmp81-.Lfunc_begin1          #     jumps to .Ltmp81
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp85-.Lfunc_begin1          # >> Call Site 21 <<
	.uleb128 .Ltmp86-.Ltmp85                #   Call between .Ltmp85 and .Ltmp86
	.uleb128 .Ltmp87-.Lfunc_begin1          #     jumps to .Ltmp87
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp68-.Lfunc_begin1          # >> Call Site 22 <<
	.uleb128 .Ltmp69-.Ltmp68                #   Call between .Ltmp68 and .Ltmp69
	.uleb128 .Ltmp70-.Lfunc_begin1          #     jumps to .Ltmp70
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp73-.Lfunc_begin1          # >> Call Site 23 <<
	.uleb128 .Ltmp74-.Ltmp73                #   Call between .Ltmp73 and .Ltmp74
	.uleb128 .Ltmp92-.Lfunc_begin1          #     jumps to .Ltmp92
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp71-.Lfunc_begin1          # >> Call Site 24 <<
	.uleb128 .Ltmp83-.Ltmp71                #   Call between .Ltmp71 and .Ltmp83
	.uleb128 .Ltmp84-.Lfunc_begin1          #     jumps to .Ltmp84
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp83-.Lfunc_begin1          # >> Call Site 25 <<
	.uleb128 .Lfunc_end3-.Ltmp83            #   Call between .Ltmp83 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.byte	2                               # >> Action Record 2 <<
                                        #   Catch TypeInfo 2
	.byte	125                             #   Continue to action 1
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	_ZTISt9exception                # TypeInfo 2
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev,"axG",@progbits,_ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev,comdat
	.weak	_ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev # -- Begin function _ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev
	.p2align	1, 0x90
	.type	_ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev,@function
_ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev: # @_ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev
.Lfunc_begin2:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception2
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.LBB4_2
# %bb.1:
.Ltmp166:
	callq	hipFree
.Ltmp167:
.LBB4_2:                                # %_ZNK19cuda_free_deleter_tclEPv.exit
	movq	$0, (%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB4_3:
	.cfi_def_cfa_offset 16
.Ltmp168:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end4:
	.size	_ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev, .Lfunc_end4-_ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev
	.cfi_endproc
	.section	.gcc_except_table._ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev,"aG",@progbits,_ZNSt10unique_ptrI12hiprandState19cuda_free_deleter_tED2Ev,comdat
	.p2align	2, 0x0
GCC_except_table4:
.Lexception2:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase1-.Lttbaseref1
.Lttbaseref1:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end2-.Lcst_begin2
.Lcst_begin2:
	.uleb128 .Ltmp166-.Lfunc_begin2         # >> Call Site 1 <<
	.uleb128 .Ltmp167-.Ltmp166              #   Call between .Ltmp166 and .Ltmp167
	.uleb128 .Ltmp168-.Lfunc_begin2         #     jumps to .Ltmp168
	.byte	1                               #   On action: 1
.Lcst_end2:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end5:
	.size	__clang_call_terminate, .Lfunc_end5-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_,"axG",@progbits,_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_,comdat
	.weak	_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_ # -- Begin function _ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_
	.type	_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_,@function
_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_: # @_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_
	.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	%rsi, %r14
	subq	%rdi, %r14
	cmpq	$129, %r14
	jl	.LBB6_12
# %bb.1:                                # %.lr.ph
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	leaq	8(%rdi), %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movq	$-8, %rbp
	subq	%rdi, %rbp
.LBB6_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_5 Depth 2
                                        #       Child Loop BB6_6 Depth 3
                                        #       Child Loop BB6_8 Depth 3
	subq	$1, %r15
	jb	.LBB6_3
# %bb.4:                                #   in Loop: Header=BB6_2 Depth=1
	shrq	$4, %r14
	leaq	(%rbx,%r14,8), %rdx
	leaq	-8(%r12), %rcx
	movq	%rbx, %rdi
	movq	16(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rsi
	callq	_ZSt22__move_median_to_firstIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_
	movq	%r12, %rax
	movq	%r14, %rcx
.LBB6_5:                                #   Parent Loop BB6_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB6_6 Depth 3
                                        #       Child Loop BB6_8 Depth 3
	movsd	(%rbx), %xmm0                   # xmm0 = mem[0],zero
	leaq	(%rcx,%rbp), %r14
.LBB6_6:                                #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movsd	(%rcx), %xmm1                   # xmm1 = mem[0],zero
	addq	$8, %rcx
	addq	$8, %r14
	ucomisd	%xmm1, %xmm0
	ja	.LBB6_6
# %bb.7:                                # %.preheader.i.i.preheader
                                        #   in Loop: Header=BB6_5 Depth=2
	leaq	-8(%rcx), %r13
.LBB6_8:                                # %.preheader.i.i
                                        #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movsd	-8(%rax), %xmm2                 # xmm2 = mem[0],zero
	addq	$-8, %rax
	ucomisd	%xmm0, %xmm2
	ja	.LBB6_8
# %bb.9:                                #   in Loop: Header=BB6_5 Depth=2
	cmpq	%rax, %r13
	jae	.LBB6_11
# %bb.10:                               #   in Loop: Header=BB6_5 Depth=2
	movsd	%xmm2, (%r13)
	movsd	%xmm1, (%rax)
	jmp	.LBB6_5
.LBB6_11:                               # %_ZSt27__unguarded_partition_pivotIPdN9__gnu_cxx5__ops15_Iter_less_iterEET_S4_S4_T0_.exit
                                        #   in Loop: Header=BB6_2 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_
	movq	%r13, %r12
	cmpq	$128, %r14
	jg	.LBB6_2
	jmp	.LBB6_12
.LBB6_3:
	leaq	15(%rsp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ZSt11__make_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	leaq	14(%rsp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ZSt11__sort_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
.LBB6_12:                               # %.loopexit
	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_end6:
	.size	_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_, .Lfunc_end6-_ZSt16__introsort_loopIPdlN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt22__final_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,"axG",@progbits,_ZSt22__final_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,comdat
	.weak	_ZSt22__final_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_ # -- Begin function _ZSt22__final_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.type	_ZSt22__final_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,@function
_ZSt22__final_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_: # @_ZSt22__final_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rsi, %rbx
	movq	%rsi, %rax
	subq	%rdi, %rax
	cmpq	$129, %rax
	jl	.LBB7_8
# %bb.1:
	leaq	128(%rdi), %r14
	movq	%r14, %rsi
	callq	_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
.LBB7_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_5 Depth 2
	cmpq	%rbx, %r14
	je	.LBB7_7
# %bb.3:                                # %.lr.ph.i
                                        #   in Loop: Header=BB7_2 Depth=1
	movsd	-8(%r14), %xmm1                 # xmm1 = mem[0],zero
	movsd	(%r14), %xmm0                   # xmm0 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	movq	%r14, %rax
	jbe	.LBB7_6
# %bb.4:                                # %.lr.ph.i.i.preheader
                                        #   in Loop: Header=BB7_2 Depth=1
	movq	%r14, %rax
.LBB7_5:                                # %.lr.ph.i.i
                                        #   Parent Loop BB7_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	%xmm1, (%rax)
	movsd	-16(%rax), %xmm1                # xmm1 = mem[0],zero
	addq	$-8, %rax
	ucomisd	%xmm0, %xmm1
	ja	.LBB7_5
.LBB7_6:                                # %_ZSt25__unguarded_linear_insertIPdN9__gnu_cxx5__ops14_Val_less_iterEEvT_T0_.exit.i
                                        #   in Loop: Header=BB7_2 Depth=1
	movsd	%xmm0, (%rax)
	addq	$8, %r14
	jmp	.LBB7_2
.LBB7_8:
	movq	%rbx, %rsi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_ # TAILCALL
.LBB7_7:                                # %_ZSt26__unguarded_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.exit
	.cfi_def_cfa_offset 32
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_ZSt22__final_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_, .Lfunc_end7-_ZSt22__final_insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt11__sort_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,"axG",@progbits,_ZSt11__sort_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,comdat
	.weak	_ZSt11__sort_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_ # -- Begin function _ZSt11__sort_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.type	_ZSt11__sort_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,@function
_ZSt11__sort_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_: # @_ZSt11__sort_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.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
	movq	%rsi, %r15
	subq	%rdi, %r15
	cmpq	$9, %r15
	jl	.LBB8_3
# %bb.1:                                # %.lr.ph.preheader
	movq	%rsi, %rbx
	movq	%rdi, %r14
	addq	$-8, %rbx
.LBB8_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rbx), %xmm0                   # xmm0 = mem[0],zero
	movsd	(%r14), %xmm1                   # xmm1 = mem[0],zero
	movsd	%xmm1, (%rbx)
	addq	$-8, %r15
	movq	%r15, %rdx
	sarq	$3, %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_
	addq	$-8, %rbx
	cmpq	$8, %r15
	jg	.LBB8_2
.LBB8_3:                                # %._crit_edge
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_ZSt11__sort_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_, .Lfunc_end8-_ZSt11__sort_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt11__make_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,"axG",@progbits,_ZSt11__make_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,comdat
	.weak	_ZSt11__make_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_ # -- Begin function _ZSt11__make_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.type	_ZSt11__make_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,@function
_ZSt11__make_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_: # @_ZSt11__make_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.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
	movq	%rsi, %rbx
	subq	%rdi, %rbx
	sarq	$3, %rbx
	cmpq	$2, %rbx
	jl	.LBB9_3
# %bb.1:
	movq	%rdi, %r14
	leaq	-2(%rbx), %r15
	shrq	%r15
.LBB9_2:                                # =>This Inner Loop Header: Depth=1
	movsd	(%r14,%r15,8), %xmm0            # xmm0 = mem[0],zero
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_
	addq	$-1, %r15
	jb	.LBB9_2
.LBB9_3:                                # %.loopexit
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_ZSt11__make_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_, .Lfunc_end9-_ZSt11__make_heapIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_,"axG",@progbits,_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_,comdat
	.weak	_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_ # -- Begin function _ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_
	.type	_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_,@function
_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_: # @_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_
	.cfi_startproc
# %bb.0:
	leaq	-1(%rdx), %rax
	shrq	$63, %rax
	leaq	(%rdx,%rax), %rcx
	decq	%rcx
	sarq	%rcx
	movq	%rsi, %rax
	cmpq	%rsi, %rcx
	jle	.LBB10_6
# %bb.1:                                # %.lr.ph.preheader
	movq	%rsi, %r8
.LBB10_2:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	leaq	(%r8,%r8), %rax
	movsd	8(%rdi,%rax,8), %xmm1           # xmm1 = mem[0],zero
	ucomisd	16(%rdi,%rax,8), %xmm1
	ja	.LBB10_3
# %bb.4:                                # %.lr.ph
                                        #   in Loop: Header=BB10_2 Depth=1
	leaq	2(,%r8,2), %rax
	jmp	.LBB10_5
.LBB10_3:                               #   in Loop: Header=BB10_2 Depth=1
	leaq	1(,%r8,2), %rax
.LBB10_5:                               # %.lr.ph
                                        #   in Loop: Header=BB10_2 Depth=1
	movsd	(%rdi,%rax,8), %xmm1            # xmm1 = mem[0],zero
	movsd	%xmm1, (%rdi,%r8,8)
	movq	%rax, %r8
	cmpq	%rcx, %rax
	jl	.LBB10_2
.LBB10_6:                               # %._crit_edge
	testb	$1, %dl
	jne	.LBB10_9
# %bb.7:
	addq	$-2, %rdx
	sarq	%rdx
	cmpq	%rdx, %rax
	jne	.LBB10_9
# %bb.8:
	leaq	(%rax,%rax), %rcx
	movsd	8(%rdi,%rcx,8), %xmm1           # xmm1 = mem[0],zero
	movsd	%xmm1, (%rdi,%rax,8)
	leaq	1(,%rax,2), %rax
.LBB10_9:
	cmpq	%rsi, %rax
	jle	.LBB10_10
.LBB10_11:                              # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	leaq	-1(%rax), %rcx
	shrq	$63, %rcx
	addq	%rax, %rcx
	decq	%rcx
	sarq	%rcx
	movsd	(%rdi,%rcx,8), %xmm1            # xmm1 = mem[0],zero
	ucomisd	%xmm1, %xmm0
	jbe	.LBB10_10
# %bb.12:                               #   in Loop: Header=BB10_11 Depth=1
	movsd	%xmm1, (%rdi,%rax,8)
	movq	%rcx, %rax
	cmpq	%rsi, %rcx
	jg	.LBB10_11
	jmp	.LBB10_13
.LBB10_10:
	movq	%rax, %rcx
.LBB10_13:                              # %_ZSt11__push_heapIPdldN9__gnu_cxx5__ops14_Iter_less_valEEvT_T0_S5_T1_RT2_.exit
	movsd	%xmm0, (%rdi,%rcx,8)
	retq
.Lfunc_end10:
	.size	_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_, .Lfunc_end10-_ZSt13__adjust_heapIPdldN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt22__move_median_to_firstIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_,"axG",@progbits,_ZSt22__move_median_to_firstIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_,comdat
	.weak	_ZSt22__move_median_to_firstIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_ # -- Begin function _ZSt22__move_median_to_firstIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_
	.type	_ZSt22__move_median_to_firstIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_,@function
_ZSt22__move_median_to_firstIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_: # @_ZSt22__move_median_to_firstIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_
	.cfi_startproc
# %bb.0:
	movsd	(%rsi), %xmm1                   # xmm1 = mem[0],zero
	movsd	(%rdx), %xmm2                   # xmm2 = mem[0],zero
	ucomisd	%xmm1, %xmm2
	movsd	(%rcx), %xmm0                   # xmm0 = mem[0],zero
	jbe	.LBB11_6
# %bb.1:
	ucomisd	%xmm2, %xmm0
	jbe	.LBB11_3
# %bb.2:
	movsd	(%rdi), %xmm0                   # xmm0 = mem[0],zero
	movsd	%xmm2, (%rdi)
	movsd	%xmm0, (%rdx)
	retq
.LBB11_6:
	ucomisd	%xmm1, %xmm0
	jbe	.LBB11_8
# %bb.7:
	movsd	(%rdi), %xmm0                   # xmm0 = mem[0],zero
	movsd	%xmm1, (%rdi)
	movsd	%xmm0, (%rsi)
	retq
.LBB11_3:
	ucomisd	%xmm1, %xmm0
	movsd	(%rdi), %xmm2                   # xmm2 = mem[0],zero
	jbe	.LBB11_5
# %bb.4:
	movsd	%xmm0, (%rdi)
	movsd	%xmm2, (%rcx)
	retq
.LBB11_8:
	ucomisd	%xmm2, %xmm0
	movsd	(%rdi), %xmm1                   # xmm1 = mem[0],zero
	jbe	.LBB11_10
# %bb.9:
	movsd	%xmm0, (%rdi)
	movsd	%xmm1, (%rcx)
	retq
.LBB11_5:
	movsd	%xmm1, (%rdi)
	movsd	%xmm2, (%rsi)
	retq
.LBB11_10:
	movsd	%xmm2, (%rdi)
	movsd	%xmm1, (%rdx)
	retq
.Lfunc_end11:
	.size	_ZSt22__move_median_to_firstIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_, .Lfunc_end11-_ZSt22__move_median_to_firstIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,"axG",@progbits,_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,comdat
	.weak	_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_ # -- Begin function _ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.type	_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,@function
_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_: # @_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.cfi_startproc
# %bb.0:
	cmpq	%rsi, %rdi
	je	.LBB12_14
# %bb.1:                                # %.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	8(%rdi), %rax
	cmpq	%rsi, %rax
	je	.LBB12_13
# %bb.2:                                # %.lr.ph
	movq	%r14, %r15
.LBB12_3:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB12_8 Depth 2
	movq	%r15, %rdi
	movq	%rax, %r15
	movsd	8(%rdi), %xmm1                  # xmm1 = mem[0],zero
	movsd	(%r14), %xmm0                   # xmm0 = mem[0],zero
	ucomisd	%xmm1, %xmm0
	jbe	.LBB12_6
# %bb.4:                                #   in Loop: Header=BB12_3 Depth=1
	movq	%r15, %rdx
	subq	%r14, %rdx
	movq	%rdx, %rax
	sarq	$3, %rax
	cmpq	$2, %rax
	jl	.LBB12_10
# %bb.5:                                #   in Loop: Header=BB12_3 Depth=1
	shlq	$3, %rax
	subq	%rax, %rdi
	addq	$16, %rdi
	movq	%r14, %rsi
	movsd	%xmm1, 8(%rsp)                  # 8-byte Spill
	callq	memmove@PLT
	movsd	8(%rsp), %xmm1                  # 8-byte Reload
                                        # xmm1 = mem[0],zero
.LBB12_12:                              # %_ZSt13move_backwardIPdS0_ET0_T_S2_S1_.exit
                                        #   in Loop: Header=BB12_3 Depth=1
	movq	%r14, %rax
	jmp	.LBB12_9
.LBB12_6:                               #   in Loop: Header=BB12_3 Depth=1
	movsd	(%rdi), %xmm0                   # xmm0 = mem[0],zero
	ucomisd	%xmm1, %xmm0
	movq	%r15, %rax
	jbe	.LBB12_9
# %bb.7:                                # %.lr.ph.i.preheader
                                        #   in Loop: Header=BB12_3 Depth=1
	movq	%r15, %rax
.LBB12_8:                               # %.lr.ph.i
                                        #   Parent Loop BB12_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	%xmm0, (%rax)
	movsd	-16(%rax), %xmm0                # xmm0 = mem[0],zero
	addq	$-8, %rax
	ucomisd	%xmm1, %xmm0
	ja	.LBB12_8
.LBB12_9:                               # %_ZSt13move_backwardIPdS0_ET0_T_S2_S1_.exit
                                        #   in Loop: Header=BB12_3 Depth=1
	movsd	%xmm1, (%rax)
	leaq	8(%r15), %rax
	cmpq	%rbx, %rax
	jne	.LBB12_3
	jmp	.LBB12_13
.LBB12_10:                              #   in Loop: Header=BB12_3 Depth=1
	movq	%r14, %rax
	cmpq	$8, %rdx
	jne	.LBB12_9
# %bb.11:                               #   in Loop: Header=BB12_3 Depth=1
	movsd	%xmm0, 8(%rdi)
	jmp	.LBB12_12
.LBB12_13:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB12_14:                              # %.loopexit
	retq
.Lfunc_end12:
	.size	_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_, .Lfunc_end12-_ZSt16__insertion_sortIPdN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.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	.LBB13_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB13_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z10initCurandP12hiprandStatem, %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	$_Z9bootstrapPdPiP12hiprandState, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end13:
	.size	__hip_module_ctor, .Lfunc_end13-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB14_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB14_2:
	retq
.Lfunc_end14:
	.size	__hip_module_dtor, .Lfunc_end14-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z10initCurandP12hiprandStatem,@object # @_Z10initCurandP12hiprandStatem
	.section	.rodata,"a",@progbits
	.globl	_Z10initCurandP12hiprandStatem
	.p2align	3, 0x0
_Z10initCurandP12hiprandStatem:
	.quad	_Z25__device_stub__initCurandP12hiprandStatem
	.size	_Z10initCurandP12hiprandStatem, 8

	.type	_Z9bootstrapPdPiP12hiprandState,@object # @_Z9bootstrapPdPiP12hiprandState
	.globl	_Z9bootstrapPdPiP12hiprandState
	.p2align	3, 0x0
_Z9bootstrapPdPiP12hiprandState:
	.quad	_Z24__device_stub__bootstrapPdPiP12hiprandState
	.size	_Z9bootstrapPdPiP12hiprandState, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"../data/allCountries.txt"
	.size	.L.str, 25

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"ERROR\n"
	.size	.L.str.1, 7

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Sample has been generated.\nCalculating the mean...\n"
	.size	.L.str.2, 52

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Mean has been calculated! Moving on...\n\n"
	.size	.L.str.3, 41

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Launching initCurand Kernel now\n\n"
	.size	.L.str.4, 34

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Curand Kernel Launch Try block SUCCESSFUL!\n"
	.size	.L.str.5, 44

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Launching Bootstrap Kernel now\n\n"
	.size	.L.str.6, 33

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Bootstrap Kernel Launch Try Block SUCCESSFUL!\n"
	.size	.L.str.7, 47

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Unknown Exception"
	.size	.L.str.8, 18

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

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Kernels appear complete, attempting to copy data back to Host\n"
	.size	.L.str.10, 63

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"MeanofMeans: "
	.size	.L.str.11, 14

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

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"SqrDiff, SqrdVariance, & BootError: "
	.size	.L.str.13, 37

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

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"\nStandard Error is: "
	.size	.L.str.15, 21

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"\n\n\n"
	.size	.L.str.16, 4

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"\n\n\n------------------------------------------------\n"
	.size	.L.str.17, 53

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"The Confidence Interval is: 80%\n"
	.size	.L.str.18, 33

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"The Standard Error is: "
	.size	.L.str.19, 24

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"This is on the 10th & 90th percentiles: ["
	.size	.L.str.20, 42

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"]\n"
	.size	.L.str.21, 3

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z10initCurandP12hiprandStatem"
	.size	.L__unnamed_1, 31

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z9bootstrapPdPiP12hiprandState"
	.size	.L__unnamed_2, 32

	.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	"\n\n\nDONE"
	.size	.Lstr, 8

	.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 _Z25__device_stub__initCurandP12hiprandStatem
	.addrsig_sym _Z24__device_stub__bootstrapPdPiP12hiprandState
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z10initCurandP12hiprandStatem
	.addrsig_sym _Z9bootstrapPdPiP12hiprandState
	.addrsig_sym _ZTISt13runtime_error
	.addrsig_sym _ZSt4cout
	.addrsig_sym _ZTISt9exception
	.addrsig_sym _ZSt4cerr
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z10initCurandP12hiprandStatem ; -- Begin function _Z10initCurandP12hiprandStatem
	.globl	_Z10initCurandP12hiprandStatem
	.p2align	8
	.type	_Z10initCurandP12hiprandStatem,@function
_Z10initCurandP12hiprandStatem:         ; @_Z10initCurandP12hiprandStatem
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x1c
	s_load_b128 s[0:3], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	v_ashrrev_i32_e32 v0, 31, v1
	v_add_co_u32 v2, vcc_lo, v1, s2
	v_mad_i64_i32 v[7:8], null, v1, 48, s[0:1]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v0, vcc_lo, s3, v0, vcc_lo
	v_xor_b32_e32 v2, 0x2c7f967f, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor_b32_e32 v0, 0xa03697cb, v0
	v_mul_lo_u32 v9, 0x493c4aa1, v2
	v_mov_b32_e32 v5, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_lo_u32 v3, 0x7b99840d, v0
	v_add_nc_u32_e32 v0, 0x75bcd15, v9
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_mov_b32_e32 v6, v5
	v_xor_b32_e32 v1, 0x159a55e5, v9
	v_add3_u32 v4, v9, v3, 0x64f0c9
	v_add_nc_u32_e32 v9, 0x583f19, v9
	v_add_nc_u32_e32 v2, 0x1f123bb5, v3
	v_xor_b32_e32 v3, 0x5491333, v3
	s_clause 0x2
	global_store_b96 v[7:8], v[4:6], off
	global_store_b128 v[7:8], v[0:3], off offset:24
	global_store_b32 v[7:8], v9, off offset:40
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z10initCurandP12hiprandStatem
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 10
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z10initCurandP12hiprandStatem, .Lfunc_end0-_Z10initCurandP12hiprandStatem
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 224
; NumSgprs: 18
; NumVgprs: 10
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 10
; 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	_Z9bootstrapPdPiP12hiprandState ; -- Begin function _Z9bootstrapPdPiP12hiprandState
	.globl	_Z9bootstrapPdPiP12hiprandState
	.p2align	8
	.type	_Z9bootstrapPdPiP12hiprandState,@function
_Z9bootstrapPdPiP12hiprandState:        ; @_Z9bootstrapPdPiP12hiprandState
; %bb.0:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x24
	s_load_b64 s[4:5], s[0:1], 0x10
	s_mov_b32 s2, s15
	s_mov_b32 s8, 0
	v_mov_b32_e32 v13, v0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s3, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s2, s3, v[0:1]
	v_mad_u64_u32 v[11:12], null, v1, 48, s[4:5]
	s_clause 0x2
	global_load_b32 v4, v[11:12], off offset:40
	global_load_b32 v1, v[11:12], off
	global_load_b128 v[5:8], v[11:12], off offset:24
	s_load_b128 s[4:7], s[0:1], 0x0
	v_mov_b32_e32 v9, 0
	v_mov_b32_e32 v10, 0
	s_mov_b32 s1, 0
	s_waitcnt vmcnt(0)
	v_dual_mov_b32 v1, v6 :: v_dual_add_nc_u32 v14, 0x587c5, v1
	v_dual_mov_b32 v2, v7 :: v_dual_mov_b32 v3, v8
.LBB1_1:                                ; =>This Inner Loop Header: Depth=1
	v_lshrrev_b32_e32 v6, 2, v5
	s_add_i32 s8, s8, 1
	v_add_nc_u32_e32 v13, s3, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_xor_b32_e32 v5, v6, v5
	v_lshlrev_b32_e32 v6, 4, v4
	v_lshlrev_b32_e32 v7, 1, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v6, v7, v6
	v_xor3_b32 v7, v6, v5, v4
	s_clause 0x2
	global_store_b32 v[11:12], v14, off
	global_store_b128 v[11:12], v[1:4], off offset:24
	global_store_b32 v[11:12], v7, off offset:40
	v_add_nc_u32_e32 v5, v14, v7
	v_add_nc_u32_e32 v14, 0x587c5, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f32_u32_e32 v5, v5
	v_fmaak_f32 v5, 0x2f800000, v5, 0x2f800000
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v5, 0x4b3588c2, v5
	v_cvt_i32_f32_e32 v5, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v6, 31, v5
	v_lshlrev_b64 v[5:6], 2, v[5:6]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, s6, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s7, v6, vcc_lo
	v_cmp_lt_u32_e32 vcc_lo, 0xb588c1, v13
	global_load_b32 v8, v[5:6], off
	v_dual_mov_b32 v6, s8 :: v_dual_mov_b32 v5, v1
	v_dual_mov_b32 v1, v2 :: v_dual_mov_b32 v2, v3
	v_dual_mov_b32 v3, v4 :: v_dual_mov_b32 v4, v7
	s_or_b32 s1, vcc_lo, s1
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v15, 31, v8
	v_add_co_u32 v9, s0, v9, v8
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v10, s0, v10, v15, s0
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB1_1
; %bb.2:
	s_or_b32 exec_lo, exec_lo, s1
	v_cvt_f32_u32_e32 v1, v6
	v_cvt_f32_ubyte0_e32 v2, 0
	v_sub_co_u32 v11, s0, 0, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_sub_co_ci_u32_e64 v12, null, 0, 0, s0
	v_fmamk_f32 v1, v2, 0x4f800000, v1
	s_cmp_lt_u32 s3, 2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v1, v1
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v1, 0x5f7ffffc, v1
	v_mul_f32_e32 v2, 0x2f800000, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_trunc_f32_e32 v2, v2
	v_fmamk_f32 v1, v2, 0xcf800000, v1
	v_cvt_u32_f32_e32 v13, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_u32_f32_e32 v14, v1
	v_mul_lo_u32 v3, v11, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v4, v12, v14
	v_mad_u64_u32 v[1:2], null, v11, v14, 0
	v_add3_u32 v15, v2, v3, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_hi_u32 v16, v14, v1
	v_mad_u64_u32 v[4:5], null, v13, v1, 0
	v_mad_u64_u32 v[2:3], null, v14, v15, 0
	v_mad_u64_u32 v[7:8], null, v13, v15, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v1, vcc_lo, v16, v2
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, v1, v4
	v_add_co_ci_u32_e32 v1, vcc_lo, v2, v5, vcc_lo
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, v1, v7
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v14, vcc_lo, v14, v1
	v_add_co_ci_u32_e32 v13, vcc_lo, v13, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_lo_u32 v3, v12, v14
	v_mad_u64_u32 v[1:2], null, v11, v14, 0
	v_mul_lo_u32 v4, v11, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_hi_u32 v12, v14, v1
	v_add3_u32 v11, v2, v4, v3
	v_mad_u64_u32 v[4:5], null, v13, v1, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_mad_u64_u32 v[2:3], null, v14, v11, 0
	v_mad_u64_u32 v[7:8], null, v13, v11, 0
	v_ashrrev_i32_e32 v11, 31, v10
	v_add_co_u32 v1, vcc_lo, v12, v2
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v3, vcc_lo
	v_add_co_u32 v1, vcc_lo, v1, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_add_co_ci_u32_e32 v1, vcc_lo, v2, v5, vcc_lo
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v8, vcc_lo
	v_add_co_u32 v3, vcc_lo, v9, v11
	v_add_co_ci_u32_e32 v4, vcc_lo, v10, v11, vcc_lo
	v_add_co_u32 v1, vcc_lo, v1, v7
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v2, vcc_lo
	v_xor_b32_e32 v5, v3, v11
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v7, vcc_lo, v14, v1
	v_add_co_ci_u32_e32 v9, vcc_lo, v13, v2, vcc_lo
	v_xor_b32_e32 v10, v4, v11
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_hi_u32 v12, v5, v7
	v_mad_u64_u32 v[1:2], null, v5, v9, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mad_u64_u32 v[3:4], null, v10, v7, 0
	v_mad_u64_u32 v[7:8], null, v10, v9, 0
	v_add_co_u32 v1, vcc_lo, v12, v1
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v2, vcc_lo
	v_add_co_u32 v1, vcc_lo, v1, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, v2, v4, vcc_lo
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v8, vcc_lo
	v_add_co_u32 v7, vcc_lo, v1, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e32 v8, vcc_lo, 0, v2, vcc_lo
	v_mad_u64_u32 v[1:2], null, v6, v7, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[3:4], null, v6, v8, v[2:3]
	v_sub_co_u32 v1, vcc_lo, v5, v1
	v_add_nc_u32_e32 v5, 2, v7
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_sub_co_ci_u32_e32 v2, vcc_lo, v10, v3, vcc_lo
	v_sub_co_u32 v3, vcc_lo, v1, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_subrev_co_ci_u32_e32 v4, vcc_lo, 0, v2, vcc_lo
	v_cmp_ge_u32_e32 vcc_lo, v3, v6
	v_cndmask_b32_e64 v3, 0, -1, vcc_lo
	v_cmp_ge_u32_e32 vcc_lo, v1, v6
	v_cndmask_b32_e64 v1, 0, -1, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, 0, v4
	v_add_nc_u32_e32 v4, 1, v7
	v_cndmask_b32_e32 v3, -1, v3, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, 0, v2
	v_cndmask_b32_e32 v1, -1, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_cmp_ne_u32_e32 vcc_lo, 0, v3
	v_cndmask_b32_e32 v2, v4, v5, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, 0, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v1, v7, v2, vcc_lo
	v_xor_b32_e32 v2, v1, v11
	v_lshlrev_b32_e32 v1, 2, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_sub_nc_u32_e32 v2, v2, v11
	ds_store_b32 v1, v2
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB1_7
; %bb.3:
	s_mov_b32 s0, s3
.LBB1_4:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_lshr_b32 s1, s0, 1
	s_mov_b32 s6, exec_lo
	v_cmpx_gt_u32_e64 s1, v0
	s_cbranch_execz .LBB1_6
; %bb.5:                                ;   in Loop: Header=BB1_4 Depth=1
	v_lshl_add_u32 v2, s1, 2, v1
	ds_load_b32 v2, v2
	ds_load_b32 v3, v1
	s_waitcnt lgkmcnt(0)
	v_add_nc_u32_e32 v2, v3, v2
	ds_store_b32 v1, v2
.LBB1_6:                                ;   in Loop: Header=BB1_4 Depth=1
	s_or_b32 exec_lo, exec_lo, s6
	s_cmp_lt_u32 s0, 4
	s_mov_b32 s0, s1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc0 .LBB1_4
.LBB1_7:                                ; %._crit_edge
	s_mov_b32 s0, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB1_9
; %bb.8:
	v_mov_b32_e32 v12, 0
	v_cvt_f64_u32_e32 v[0:1], s3
	s_ashr_i32 s3, s2, 31
	s_delay_alu instid0(SALU_CYCLE_1)
	s_lshl_b64 s[0:1], s[2:3], 3
	ds_load_b32 v2, v12
	s_add_u32 s0, s4, s0
	s_addc_u32 s1, s5, s1
	s_waitcnt lgkmcnt(0)
	v_cvt_f64_i32_e32 v[2:3], v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_scale_f64 v[4:5], null, v[0:1], v[0:1], v[2:3]
	v_rcp_f64_e32 v[6:7], v[4:5]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[8:9], -v[4:5], v[6:7], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[6:7], v[6:7], v[8:9], v[6:7]
	v_fma_f64 v[8:9], -v[4:5], v[6:7], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f64 v[6:7], v[6:7], v[8:9], v[6:7]
	v_div_scale_f64 v[8:9], vcc_lo, v[2:3], v[0:1], v[2:3]
	v_mul_f64 v[10:11], v[8:9], v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[4:5], -v[4:5], v[10:11], v[8:9]
	v_div_fmas_f64 v[4:5], v[4:5], v[6:7], v[10:11]
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fixup_f64 v[0:1], v[4:5], v[0:1], v[2:3]
	global_store_b64 v12, v[0:1], s[0:1]
.LBB1_9:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9bootstrapPdPiP12hiprandState
		.amdhsa_group_segment_fixed_size 16384
		.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 17
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z9bootstrapPdPiP12hiprandState, .Lfunc_end1-_Z9bootstrapPdPiP12hiprandState
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1324
; NumSgprs: 18
; NumVgprs: 17
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 16384 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 17
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
