#include <iostream>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <cuda.h>
#include <curand.h>
#include <random>

#define BLOCK_SIZE 500

using namespace std;

__global__ void piCalcGPU(float* d_X, float* d_Y, int* d_countInBlocks, int blocksPerGrid, int N) 
{

  __shared__ int shared_blocks[500];

  int index = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * blocksPerGrid;

  int points_in_circle = 0;  
  for (int i = index; i < N; i+= stride) {    
	if (d_X[i]*d_X[i] + d_Y[i]*d_Y[i] <= 1.0f) {
	  points_in_circle++;    
	}  
  }
  shared_blocks[threadIdx.x] = points_in_circle;
  __syncthreads();

  if (threadIdx.x == 0) 
  {    
    int pointsInCircleBlock = 0;    
    for (int j = 0; j < blockDim.x; j++) 
    {      
      pointsInCircleBlock += shared_blocks[j];    
    }
    d_countInBlocks[blockIdx.x] = pointsInCircleBlock;  
  }
}

float piCalcCPU(int interval, float * X, float * Y) {
	int points_in_circle = 0;
  float dist;
	for(int i = 0; i < interval; i++) {
	  dist = X[i]*X[i] + Y[i]*Y[i];
    if (dist <= 1.0){
        points_in_circle++;
    }
	}
	return 4.0f * points_in_circle / interval;
}


float * generateSequencesRandom(int N) {
    float * randArr = new float[N];
    std::random_device rd;
    std::mt19937 gen(rd());
    std::uniform_real_distribution<> dis(0.0, 1.0);
    for (int n = 0; n < N; ++n) {
        randArr[n] = dis(gen);
    }
    return randArr;
}

int main(int argc, char *argv[]) {  
  srand(time(NULL));
  
  int N = atoi(argv[1]);
  
  float * h_X = generateSequencesRandom(N);   
  float * h_Y = generateSequencesRandom(N);   
   
  size_t size = N * sizeof(float);    
  float* d_X;    
  float* d_Y;    
  cudaMalloc((void **)&d_X, size);  
  cudaMalloc((void **)&d_Y, size);
  cudaMemcpy(d_X, h_X, size, cudaMemcpyHostToDevice);    
  cudaMemcpy(d_Y, h_Y, size, cudaMemcpyHostToDevice);
  
  int threadsPerBlock = BLOCK_SIZE;
  int blocks = N / BLOCK_SIZE;
  int blocksPerGrid = (N % BLOCK_SIZE > 0) ?  blocks + 1 :  blocks;
  size_t countBlocks = blocksPerGrid * sizeof(int);
 
  int* d_countInBlocks;
  cudaMalloc((void **)&d_countInBlocks, countBlocks);
 
  clock_t start1 = clock();
  piCalcGPU<<<blocksPerGrid, threadsPerBlock>>>(d_X, d_Y, d_countInBlocks, blocksPerGrid, N);
  if (cudaSuccess != cudaGetLastError())
    cout << "Error!\n";

  int* h_countInBlocks = new int[blocksPerGrid];
  cudaMemcpy(h_countInBlocks, d_countInBlocks, countBlocks, cudaMemcpyDeviceToHost);

  int N_in_circle = 0;
  for (int i = 0 ; i < blocksPerGrid; i++) {
    N_in_circle = N_in_circle + h_countInBlocks[i];
  }
  float pi_gpu = 4.0 * float(N_in_circle) / N;

  clock_t stop1 = clock();
  float gpu_time = (stop1-start1)/(float)CLOCKS_PER_SEC;
  printf("time Pi GPU: %f s.\n", gpu_time);
  printf("value Pi GPU: %f\n", pi_gpu);

  clock_t start2 = clock();
  float pi_cpu = piCalcCPU(N, h_X, h_Y);
	clock_t stop2 = clock();
  float cpu_time = (stop2-start2)/(float)CLOCKS_PER_SEC;
	printf("time Pi CPU: %f s.\n", cpu_time);
  printf("value Pi CPU: %f\n", pi_cpu);

  printf("Acceleration: %f\n", cpu_time/gpu_time);
  
  delete[]h_X;
  delete[]h_Y;
  cudaFree(d_X);
  cudaFree(d_Y);
  cudaFree(d_countInBlocks);

}
	.file	"tmpxft_002f6f2d_00000000-6_cuda_pi_calc.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4724:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4724:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z9piCalcCPUiPfS_
	.type	_Z9piCalcCPUiPfS_, @function
_Z9piCalcCPUiPfS_:
.LFB4719:
	.cfi_startproc
	endbr64
	movss	.LC0(%rip), %xmm2
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.L3:
	cmpl	%eax, %edi
	jle	.L9
	movss	(%rsi,%rax,4), %xmm0
	movss	(%rdx,%rax,4), %xmm1
	mulss	%xmm0, %xmm0
	mulss	%xmm1, %xmm1
	addss	%xmm1, %xmm0
	comiss	%xmm0, %xmm2
	sbbl	$-1, %ecx
	incq	%rax
	jmp	.L3
.L9:
	cvtsi2ssl	%ecx, %xmm0
	mulss	.LC1(%rip), %xmm0
	cvtsi2ssl	%edi, %xmm1
	divss	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE4719:
	.size	_Z9piCalcCPUiPfS_, .-_Z9piCalcCPUiPfS_
	.globl	_Z34__device_stub__Z9piCalcGPUPfS_PiiiPfS_Piii
	.type	_Z34__device_stub__Z9piCalcGPUPfS_PiiiPfS_Piii, @function
_Z34__device_stub__Z9piCalcGPUPfS_PiiiPfS_Piii:
.LFB4746:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L10
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z9piCalcGPUPfS_Piii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L10:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4746:
	.size	_Z34__device_stub__Z9piCalcGPUPfS_PiiiPfS_Piii, .-_Z34__device_stub__Z9piCalcGPUPfS_PiiiPfS_Piii
	.globl	_Z9piCalcGPUPfS_Piii
	.type	_Z9piCalcGPUPfS_Piii, @function
_Z9piCalcGPUPfS_Piii:
.LFB4747:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z9piCalcGPUPfS_PiiiPfS_Piii
	.cfi_endproc
.LFE4747:
	.size	_Z9piCalcGPUPfS_Piii, .-_Z9piCalcGPUPfS_Piii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"_Z9piCalcGPUPfS_Piii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4749:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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	.LC2(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z9piCalcGPUPfS_Piii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4749:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,"axG",@progbits,_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,comdat
	.align 2
	.weak	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.type	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv, @function
_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv:
.LFB5430:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	xorl	%edx, %edx
	movl	$2567483615, %edi
.L19:
	movq	(%rax,%rdx,8), %rsi
	incq	%rdx
	movq	(%rax,%rdx,8), %rcx
	andq	$-2147483648, %rsi
	andl	$2147483647, %ecx
	orq	%rsi, %rcx
	movq	%rcx, %rsi
	shrq	%rsi
	xorq	3168(%rax,%rdx,8), %rsi
	andl	$1, %ecx
	je	.L18
	movq	%rdi, %rcx
.L18:
	xorq	%rsi, %rcx
	movq	%rcx, -8(%rax,%rdx,8)
	cmpq	$227, %rdx
	jne	.L19
	movl	$2567483615, %edi
.L21:
	movq	(%rax,%rdx,8), %rsi
	incq	%rdx
	movq	(%rax,%rdx,8), %rcx
	andq	$-2147483648, %rsi
	andl	$2147483647, %ecx
	orq	%rsi, %rcx
	movq	%rcx, %rsi
	shrq	%rsi
	xorq	-1824(%rax,%rdx,8), %rsi
	andl	$1, %ecx
	je	.L20
	movq	%rdi, %rcx
.L20:
	xorq	%rsi, %rcx
	movq	%rcx, -8(%rax,%rdx,8)
	cmpq	$623, %rdx
	jne	.L21
	movq	4984(%rax), %rdx
	movq	(%rax), %rcx
	andq	$-2147483648, %rdx
	andl	$2147483647, %ecx
	orq	%rcx, %rdx
	movq	%rdx, %rcx
	shrq	%rcx
	xorq	3168(%rax), %rcx
	andl	$1, %edx
	je	.L22
	movl	$2567483615, %edx
.L22:
	xorq	%rcx, %rdx
	movq	%rdx, 4984(%rax)
	xorl	%edx, %edx
	movq	%rdx, 4992(%rax)
	ret
	.cfi_endproc
.LFE5430:
	.size	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv, .-_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.section	.rodata.str1.1
.LC6:
	.string	"default"
	.text
	.globl	_Z23generateSequencesRandomi
	.type	_Z23generateSequencesRandomi, @function
_Z23generateSequencesRandomi:
.LFB4720:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4720
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$1848, %rsp
	.cfi_def_cfa_offset 10096
	movq	%fs:40, %rax
	movq	%rax, 10024(%rsp)
	movabsq	$2305843009213693950, %rax
	movslq	%edi, %rdi
	cmpq	%rdi, %rax
	jb	.L35
	movq	%rdi, %r13
	salq	$2, %rdi
	leaq	5024(%rsp), %rbx
	leaq	24(%rsp), %r12
.LEHB0:
	call	_Znam@PLT
.LEHE0:
	leaq	7+.LC6(%rip), %rdx
	leaq	5040(%rsp), %rdi
	leaq	-7(%rdx), %rsi
	movq	%rdi, 5024(%rsp)
	movq	%rax, %rbp
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	5024(%rsp), %rax
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movq	$7, 5032(%rsp)
	movb	$0, 7(%rax)
.LEHB1:
	call	_ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE1:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r12, %rdi
.LEHB2:
	call	_ZNSt13random_device9_M_getvalEv@PLT
.LEHE2:
	movl	%eax, %eax
	movl	$1, %edx
	movq	%rax, 5024(%rsp)
	jmp	.L40
.L54:
	endbr64
	movq	%rax, %rbp
.L37:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	je	.L59
	jmp	.L56
.L35:
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
.LEHB3:
	call	__cxa_throw_bad_array_new_length@PLT
.LEHE3:
.L40:
	movq	-8(%rbx,%rdx,8), %rax
	movq	%rax, %rcx
	shrq	$30, %rcx
	xorq	%rcx, %rax
	imulq	$1812433253, %rax, %rax
	addl	%edx, %eax
	movq	%rax, (%rbx,%rdx,8)
	incq	%rdx
	cmpq	$624, %rdx
	jne	.L40
	movq	$624, 10016(%rsp)
	xorl	%r14d, %r14d
.L41:
	cmpl	%r14d, %r13d
	jle	.L60
	movq	.LC4(%rip), %rax
	movl	$2, %r15d
	xorps	%xmm0, %xmm0
	movq	%rax, (%rsp)
.L45:
	cmpq	$623, 10016(%rsp)
	jbe	.L42
	movq	%rbx, %rdi
	movsd	%xmm0, 8(%rsp)
	call	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	movsd	8(%rsp), %xmm0
.L42:
	movq	10016(%rsp), %rax
	leaq	1(%rax), %rdx
	movq	5024(%rsp,%rax,8), %rax
	movq	%rdx, 10016(%rsp)
	movq	%rax, %rdx
	shrq	$11, %rdx
	movl	%edx, %edx
	xorq	%rdx, %rax
	movq	%rax, %rdx
	salq	$7, %rdx
	andl	$2636928640, %edx
	xorq	%rdx, %rax
	movq	%rax, %rdx
	salq	$15, %rdx
	andl	$4022730752, %edx
	xorq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$18, %rdx
	xorq	%rdx, %rax
	js	.L43
	cvtsi2sdq	%rax, %xmm1
	jmp	.L44
.L43:
	movq	%rax, %rdx
	andl	$1, %eax
	shrq	%rdx
	orq	%rax, %rdx
	cvtsi2sdq	%rdx, %xmm1
	addsd	%xmm1, %xmm1
.L44:
	mulsd	(%rsp), %xmm1
	flds	.LC7(%rip)
	decl	%r15d
	fmull	(%rsp)
	addsd	%xmm1, %xmm0
	fstpl	(%rsp)
	je	.L61
	movl	$1, %r15d
	jmp	.L45
.L61:
	divsd	(%rsp), %xmm0
	comisd	.LC4(%rip), %xmm0
	jb	.L46
	movsd	.LC5(%rip), %xmm0
.L46:
	xorps	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 0(%rbp,%r14,4)
	incq	%r14
	jmp	.L41
.L60:
	movq	%r12, %rdi
	call	_ZNSt13random_device7_M_finiEv@PLT
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	je	.L49
	jmp	.L56
.L53:
	endbr64
	movq	%rax, %rbx
.L47:
	movq	%r12, %rdi
	call	_ZNSt13random_device7_M_finiEv@PLT
	movq	%rbx, %rdi
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
.L59:
.LEHB4:
	call	_Unwind_Resume@PLT
.LEHE4:
.L56:
	call	__stack_chk_fail@PLT
.L49:
	addq	$10040, %rsp
	.cfi_def_cfa_offset 56
	movq	%rbp, %rax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4720:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4720:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4720-.LLSDACSB4720
.LLSDACSB4720:
	.uleb128 .LEHB0-.LFB4720
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4720
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L54-.LFB4720
	.uleb128 0
	.uleb128 .LEHB2-.LFB4720
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L53-.LFB4720
	.uleb128 0
	.uleb128 .LEHB3-.LFB4720
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB4720
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
.LLSDACSE4720:
	.text
	.size	_Z23generateSequencesRandomi, .-_Z23generateSequencesRandomi
	.section	.rodata.str1.1
.LC9:
	.string	"Error!\n"
.LC12:
	.string	"time Pi GPU: %f s.\n"
.LC13:
	.string	"value Pi GPU: %f\n"
.LC14:
	.string	"time Pi CPU: %f s.\n"
.LC15:
	.string	"value Pi CPU: %f\n"
.LC16:
	.string	"Acceleration: %f\n"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4721:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%edi, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	movq	8(%rbx), %rdi
	call	atoi@PLT
	movslq	%eax, %r13
	movl	%r13d, %edi
	movq	%r13, %rbx
	call	_Z23generateSequencesRandomi
	movl	%r13d, %edi
	salq	$2, %r13
	movq	%rax, %r12
	call	_Z23generateSequencesRandomi
	movq	%r13, %rsi
	leaq	24(%rsp), %rdi
	movq	%rax, %rbp
	call	cudaMalloc@PLT
	movq	%r13, %rsi
	leaq	32(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	24(%rsp), %rdi
	movq	%r13, %rdx
	movq	%r12, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	32(%rsp), %rdi
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	%ebx, %eax
	movl	$500, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %r13d
	testl	%edx, %edx
	jle	.L63
	incl	%r13d
.L63:
	movslq	%r13d, %r15
	leaq	40(%rsp), %rdi
	leaq	0(,%r15,4), %rax
	movq	%rax, %rsi
	movq	%rax, (%rsp)
	call	cudaMalloc@PLT
	call	clock@PLT
	movl	%r13d, 48(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rax, %r14
	movl	$1073741949, %edx
	movl	$1, %ecx
	movabsq	$4294967297, %rax
	movq	%rax, 52(%rsp)
	movq	48(%rsp), %rdi
	salq	$2, %rdx
	movl	56(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L64
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	%ebx, %r8d
	movl	%r13d, %ecx
	movq	24(%rsp), %rdi
	call	_Z34__device_stub__Z9piCalcGPUPfS_PiiiPfS_Piii
.L64:
	call	cudaGetLastError@PLT
	testl	%eax, %eax
	je	.L65
	movl	$7, %edx
	leaq	.LC9(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@PLT
.L65:
	movabsq	$2305843009213693950, %rax
	cmpq	%r15, %rax
	jb	.L66
	movq	(%rsp), %rdi
	call	_Znam@PLT
	movq	(%rsp), %rdx
	movq	40(%rsp), %rsi
	movl	$2, %ecx
	movq	%rax, %rdi
	movq	%rax, %r15
	call	cudaMemcpy@PLT
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L67
.L66:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	call	__cxa_throw_bad_array_new_length@PLT
.L67:
	cmpl	%edx, %r13d
	jle	.L84
	addl	(%r15,%rdx,4), %eax
	incq	%rdx
	jmp	.L67
.L84:
	cvtsi2ssl	%eax, %xmm0
	cvtsi2sdl	%ebx, %xmm1
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LC10(%rip), %xmm0
	divsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm3
	movd	%xmm3, %r13d
	call	clock@PLT
	leaq	.LC12(%rip), %rsi
	movl	$2, %edi
	subq	%r14, %rax
	cvtsi2ssq	%rax, %xmm2
	movb	$1, %al
	divss	.LC11(%rip), %xmm2
	cvtss2sd	%xmm2, %xmm0
	movss	%xmm2, 12(%rsp)
	call	__printf_chk@PLT
	movd	%r13d, %xmm4
	leaq	.LC13(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	cvtss2sd	%xmm4, %xmm0
	call	__printf_chk@PLT
	call	clock@PLT
	movq	%rbp, %rdx
	movl	%ebx, %edi
	movq	%r12, %rsi
	movq	%rax, %r13
	call	_Z9piCalcCPUiPfS_
	movd	%xmm0, %ebx
	call	clock@PLT
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	subq	%r13, %rax
	cvtsi2ssq	%rax, %xmm1
	movb	$1, %al
	divss	.LC11(%rip), %xmm1
	cvtss2sd	%xmm1, %xmm0
	movss	%xmm1, (%rsp)
	call	__printf_chk@PLT
	movd	%ebx, %xmm5
	movl	$2, %edi
	movb	$1, %al
	leaq	.LC15(%rip), %rsi
	cvtss2sd	%xmm5, %xmm0
	call	__printf_chk@PLT
	movss	(%rsp), %xmm1
	movss	12(%rsp), %xmm2
	movb	$1, %al
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	divss	%xmm2, %xmm1
	cvtss2sd	%xmm1, %xmm0
	call	__printf_chk@PLT
	testq	%r12, %r12
	je	.L70
	movq	%r12, %rdi
	call	_ZdaPv@PLT
.L70:
	testq	%rbp, %rbp
	je	.L71
	movq	%rbp, %rdi
	call	_ZdaPv@PLT
.L71:
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L72
.L83:
	call	__stack_chk_fail@PLT
.L72:
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4721:
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	1065353216
	.align 4
.LC1:
	.long	1082130432
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.long	0
	.long	1072693248
	.align 8
.LC5:
	.long	-1
	.long	1072693247
	.section	.rodata.cst4
	.align 4
.LC7:
	.long	1333788672
	.section	.rodata.cst8
	.align 8
.LC10:
	.long	0
	.long	1074790400
	.section	.rodata.cst4
	.align 4
.LC11:
	.long	1232348160
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <iostream>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <hip/hip_runtime.h>
#include <hiprand/hiprand.h>
#include <random>

#define BLOCK_SIZE 500

using namespace std;

__global__ void piCalcGPU(float* d_X, float* d_Y, int* d_countInBlocks, int blocksPerGrid, int N) 
{

  __shared__ int shared_blocks[500];

  int index = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * blocksPerGrid;

  int points_in_circle = 0;  
  for (int i = index; i < N; i+= stride) {    
	if (d_X[i]*d_X[i] + d_Y[i]*d_Y[i] <= 1.0f) {
	  points_in_circle++;    
	}  
  }
  shared_blocks[threadIdx.x] = points_in_circle;
  __syncthreads();

  if (threadIdx.x == 0) 
  {    
    int pointsInCircleBlock = 0;    
    for (int j = 0; j < blockDim.x; j++) 
    {      
      pointsInCircleBlock += shared_blocks[j];    
    }
    d_countInBlocks[blockIdx.x] = pointsInCircleBlock;  
  }
}

float piCalcCPU(int interval, float * X, float * Y) {
	int points_in_circle = 0;
  float dist;
	for(int i = 0; i < interval; i++) {
	  dist = X[i]*X[i] + Y[i]*Y[i];
    if (dist <= 1.0){
        points_in_circle++;
    }
	}
	return 4.0f * points_in_circle / interval;
}


float * generateSequencesRandom(int N) {
    float * randArr = new float[N];
    std::random_device rd;
    std::mt19937 gen(rd());
    std::uniform_real_distribution<> dis(0.0, 1.0);
    for (int n = 0; n < N; ++n) {
        randArr[n] = dis(gen);
    }
    return randArr;
}

int main(int argc, char *argv[]) {  
  srand(time(NULL));
  
  int N = atoi(argv[1]);
  
  float * h_X = generateSequencesRandom(N);   
  float * h_Y = generateSequencesRandom(N);   
   
  size_t size = N * sizeof(float);    
  float* d_X;    
  float* d_Y;    
  hipMalloc((void **)&d_X, size);  
  hipMalloc((void **)&d_Y, size);
  hipMemcpy(d_X, h_X, size, hipMemcpyHostToDevice);    
  hipMemcpy(d_Y, h_Y, size, hipMemcpyHostToDevice);
  
  int threadsPerBlock = BLOCK_SIZE;
  int blocks = N / BLOCK_SIZE;
  int blocksPerGrid = (N % BLOCK_SIZE > 0) ?  blocks + 1 :  blocks;
  size_t countBlocks = blocksPerGrid * sizeof(int);
 
  int* d_countInBlocks;
  hipMalloc((void **)&d_countInBlocks, countBlocks);
 
  clock_t start1 = clock();
  piCalcGPU<<<blocksPerGrid, threadsPerBlock>>>(d_X, d_Y, d_countInBlocks, blocksPerGrid, N);
  if (hipSuccess != hipGetLastError())
    cout << "Error!\n";

  int* h_countInBlocks = new int[blocksPerGrid];
  hipMemcpy(h_countInBlocks, d_countInBlocks, countBlocks, hipMemcpyDeviceToHost);

  int N_in_circle = 0;
  for (int i = 0 ; i < blocksPerGrid; i++) {
    N_in_circle = N_in_circle + h_countInBlocks[i];
  }
  float pi_gpu = 4.0 * float(N_in_circle) / N;

  clock_t stop1 = clock();
  float gpu_time = (stop1-start1)/(float)CLOCKS_PER_SEC;
  printf("time Pi GPU: %f s.\n", gpu_time);
  printf("value Pi GPU: %f\n", pi_gpu);

  clock_t start2 = clock();
  float pi_cpu = piCalcCPU(N, h_X, h_Y);
	clock_t stop2 = clock();
  float cpu_time = (stop2-start2)/(float)CLOCKS_PER_SEC;
	printf("time Pi CPU: %f s.\n", cpu_time);
  printf("value Pi CPU: %f\n", pi_cpu);

  printf("Acceleration: %f\n", cpu_time/gpu_time);
  
  delete[]h_X;
  delete[]h_Y;
  hipFree(d_X);
  hipFree(d_Y);
  hipFree(d_countInBlocks);

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

                                        # End of file scope inline assembly
	.globl	_Z24__device_stub__piCalcGPUPfS_Piii # -- Begin function _Z24__device_stub__piCalcGPUPfS_Piii
	.type	_Z24__device_stub__piCalcGPUPfS_Piii,@function
_Z24__device_stub__piCalcGPUPfS_Piii:   # @_Z24__device_stub__piCalcGPUPfS_Piii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%rsp), %rdx
	movl	%ecx, (%rdx)
	movq	%rsp, %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z9piCalcGPUPfS_Piii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z24__device_stub__piCalcGPUPfS_Piii, .Lfunc_end0-_Z24__device_stub__piCalcGPUPfS_Piii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z9piCalcCPUiPfS_
.LCPI1_0:
	.long	0x3f800000                      # float 1
.LCPI1_1:
	.long	0x40800000                      # float 4
	.text
	.globl	_Z9piCalcCPUiPfS_
	.type	_Z9piCalcCPUiPfS_,@function
_Z9piCalcCPUiPfS_:                      # @_Z9piCalcCPUiPfS_
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jle	.LBB1_1
# %bb.4:                                # %.lr.ph.preheader
	movl	%edi, %eax
	xorl	%ecx, %ecx
	movss	.LCPI1_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	xorl	%r8d, %r8d
.LBB1_5:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rsi,%rcx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm1
	movss	(%rdx,%rcx,4), %xmm2            # xmm2 = mem[0],zero,zero,zero
	mulss	%xmm2, %xmm2
	addss	%xmm1, %xmm2
	ucomiss	%xmm2, %xmm0
	sbbl	$-1, %r8d
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB1_5
# %bb.2:                                # %._crit_edge.loopexit
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r8d, %xmm0
	mulss	.LCPI1_1(%rip), %xmm0
	jmp	.LBB1_3
.LBB1_1:
	xorps	%xmm0, %xmm0
.LBB1_3:                                # %._crit_edge
	xorps	%xmm1, %xmm1
	cvtsi2ss	%edi, %xmm1
	divss	%xmm1, %xmm0
	retq
.Lfunc_end1:
	.size	_Z9piCalcCPUiPfS_, .Lfunc_end1-_Z9piCalcCPUiPfS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z23generateSequencesRandomi
.LCPI2_0:
	.quad	0x0000000000000000              # double 0
	.text
	.globl	_Z23generateSequencesRandomi
	.type	_Z23generateSequencesRandomi,@function
_Z23generateSequencesRandomi:           # @_Z23generateSequencesRandomi
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$10000, %rsp                    # imm = 0x2710
	.cfi_def_cfa_offset 10048
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edi, %ebp
	movl	%edi, %r15d
	leaq	(,%r15,4), %rax
	testl	%edi, %edi
	movq	$-1, %rdi
	cmovnsq	%rax, %rdi
	callq	_Znam
	movq	%rax, %rbx
	leaq	5000(%rsp), %r14
	movq	%r14, %rdi
	callq	_ZNSt13random_deviceC2Ev
.Ltmp0:
	movq	%r14, %rdi
	callq	_ZNSt13random_device9_M_getvalEv
.Ltmp1:
# %bb.1:                                # %_ZNSt13random_deviceclEv.exit
	movl	%eax, %eax
	movq	%rax, (%rsp)
	movl	$1, %ecx
.LBB2_2:                                # =>This Inner Loop Header: Depth=1
	movq	%rax, %rdx
	shrq	$30, %rdx
	xorl	%eax, %edx
	imull	$1812433253, %edx, %eax         # imm = 0x6C078965
	addl	%ecx, %eax
	movq	%rax, (%rsp,%rcx,8)
	incq	%rcx
	cmpq	$624, %rcx                      # imm = 0x270
	jne	.LBB2_2
# %bb.3:
	movq	$624, 4992(%rsp)                # imm = 0x270
	testl	%ebp, %ebp
	jle	.LBB2_7
# %bb.4:                                # %.lr.ph.preheader
	xorl	%r12d, %r12d
	movq	%rsp, %r14
.LBB2_5:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
.Ltmp3:
	movq	%r14, %rdi
	callq	_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_
.Ltmp4:
# %bb.6:                                #   in Loop: Header=BB2_5 Depth=1
	addsd	.LCPI2_0(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%rbx,%r12,4)
	incq	%r12
	cmpq	%r12, %r15
	jne	.LBB2_5
.LBB2_7:                                # %._crit_edge
.Ltmp9:
	leaq	5000(%rsp), %rdi
	callq	_ZNSt13random_device7_M_finiEv
.Ltmp10:
# %bb.8:                                # %_ZNSt13random_deviceD2Ev.exit
	movq	%rbx, %rax
	addq	$10000, %rsp                    # imm = 0x2710
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB2_9:
	.cfi_def_cfa_offset 10048
.Ltmp11:
	jmp	.LBB2_10
.LBB2_11:
.Ltmp2:
	jmp	.LBB2_13
.LBB2_12:
.Ltmp5:
.LBB2_13:
	movq	%rax, %rbx
.Ltmp6:
	leaq	5000(%rsp), %rdi
	callq	_ZNSt13random_device7_M_finiEv
.Ltmp7:
# %bb.14:                               # %_ZNSt13random_deviceD2Ev.exit13
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB2_15:
.Ltmp8:
.LBB2_10:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end2:
	.size	_Z23generateSequencesRandomi, .Lfunc_end2-_Z23generateSequencesRandomi
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.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 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin0          #     jumps to .Ltmp11
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp7-.Lfunc_begin0           # >> Call Site 6 <<
	.uleb128 .Lfunc_end2-.Ltmp7             #   Call between .Ltmp7 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt13random_deviceC2Ev,"axG",@progbits,_ZNSt13random_deviceC2Ev,comdat
	.weak	_ZNSt13random_deviceC2Ev        # -- Begin function _ZNSt13random_deviceC2Ev
	.p2align	1, 0x90
	.type	_ZNSt13random_deviceC2Ev,@function
_ZNSt13random_deviceC2Ev:               # @_ZNSt13random_deviceC2Ev
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	leaq	16(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	%rsp, %r14
	movl	$.L.str.6, %esi
	movl	$.L.str.6+7, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp12:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp13:
# %bb.1:
	movq	(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB3_3
# %bb.2:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB3_3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	addq	$32, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB3_4:
	.cfi_def_cfa_offset 64
.Ltmp14:
	movq	%rax, %rbx
	movq	(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB3_6
# %bb.5:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i4
	callq	_ZdlPv
.LBB3_6:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit6
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end3:
	.size	_ZNSt13random_deviceC2Ev, .Lfunc_end3-_ZNSt13random_deviceC2Ev
	.cfi_endproc
	.section	.gcc_except_table._ZNSt13random_deviceC2Ev,"aG",@progbits,_ZNSt13random_deviceC2Ev,comdat
	.p2align	2, 0x0
GCC_except_table3:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp12-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp12
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin1          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Lfunc_end3-.Ltmp13            #   Call between .Ltmp13 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI4_0:
	.quad	0x4010000000000000              # double 4
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI4_1:
	.long	0x49742400                      # float 1.0E+6
.LCPI4_2:
	.long	0x3f800000                      # float 1
.LCPI4_3:
	.long	0x40800000                      # float 4
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %rbx
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	movq	8(%rbx), %rdi
	callq	atoi
	movl	%eax, %ebp
	movl	%eax, %edi
	callq	_Z23generateSequencesRandomi
	movq	%rax, %rbx
	movl	%ebp, %edi
	callq	_Z23generateSequencesRandomi
	movq	%rax, %r14
	movslq	%ebp, %r13
	leaq	(,%r13,4), %r15
	leaq	48(%rsp), %r12
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	leaq	32(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	movq	(%r12), %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	imulq	$274877907, %r13, %rax          # imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$37, %rax
	addl	%ecx, %eax
	imull	$500, %eax, %ecx                # imm = 0x1F4
	movl	%ebp, %edx
	subl	%ecx, %edx
	xorl	%r12d, %r12d
	testl	%edx, %edx
	setg	%r12b
	addl	%eax, %r12d
	movslq	%r12d, %r13
	shlq	$2, %r13
	leaq	24(%rsp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	callq	clock
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movq	%r12, %rdi
	btsq	$32, %rdi
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$500, %rdx                      # imm = 0x1F4
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_2
# %bb.1:
	movq	48(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
	movl	%r12d, %ecx
	movl	%ebp, %r8d
	callq	_Z24__device_stub__piCalcGPUPfS_Piii
.LBB4_2:
	callq	hipGetLastError
	testl	%eax, %eax
	je	.LBB4_4
# %bb.3:
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB4_4:
	testl	%r12d, %r12d
	movq	$-1, %rdi
	cmovnsq	%r13, %rdi
	callq	_Znam
	movq	%rax, %r15
	movq	24(%rsp), %rsi
	movq	%rax, %rdi
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r12d, %r12d
	jle	.LBB4_5
# %bb.13:                               # %.lr.ph.preheader
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.LBB4_14:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	addl	(%r15,%rax,4), %ecx
	incq	%rax
	cmpq	%rax, %r12
	jne	.LBB4_14
# %bb.6:                                # %._crit_edge.loopexit
	cvtsi2ss	%ecx, %xmm0
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LCPI4_0(%rip), %xmm0
	jmp	.LBB4_7
.LBB4_5:
	xorpd	%xmm0, %xmm0
.LBB4_7:                                # %._crit_edge
	cvtsi2sd	%ebp, %xmm1
	divsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	callq	clock
	subq	16(%rsp), %rax                  # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	divss	.LCPI4_1(%rip), %xmm0
	movss	%xmm0, 16(%rsp)                 # 4-byte Spill
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.1, %edi
	movb	$1, %al
	callq	printf
	xorps	%xmm0, %xmm0
	cvtss2sd	12(%rsp), %xmm0                 # 4-byte Folded Reload
	movl	$.L.str.2, %edi
	movb	$1, %al
	callq	printf
	callq	clock
	movq	%rax, %r15
	testl	%ebp, %ebp
	jle	.LBB4_8
# %bb.9:                                # %.lr.ph.preheader.i
	movl	%ebp, %eax
	xorl	%ecx, %ecx
	movss	.LCPI4_2(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	xorl	%edx, %edx
.LBB4_10:                               # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movss	(%rbx,%rcx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm1
	movss	(%r14,%rcx,4), %xmm2            # xmm2 = mem[0],zero,zero,zero
	mulss	%xmm2, %xmm2
	addss	%xmm1, %xmm2
	ucomiss	%xmm2, %xmm0
	sbbl	$-1, %edx
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB4_10
# %bb.11:                               # %._crit_edge.loopexit.i
	xorps	%xmm1, %xmm1
	cvtsi2ss	%edx, %xmm1
	mulss	.LCPI4_3(%rip), %xmm1
	jmp	.LBB4_12
.LBB4_8:
	xorpd	%xmm1, %xmm1
.LBB4_12:
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ebp, %xmm0
	divss	%xmm0, %xmm1
	movss	%xmm1, 12(%rsp)                 # 4-byte Spill
	callq	clock
	subq	%r15, %rax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	divss	.LCPI4_1(%rip), %xmm0
	movss	%xmm0, 44(%rsp)                 # 4-byte Spill
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.3, %edi
	movb	$1, %al
	callq	printf
	xorps	%xmm0, %xmm0
	cvtss2sd	12(%rsp), %xmm0                 # 4-byte Folded Reload
	movl	$.L.str.4, %edi
	movb	$1, %al
	callq	printf
	movss	44(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	divss	16(%rsp), %xmm0                 # 4-byte Folded Reload
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.5, %edi
	movb	$1, %al
	callq	printf
	movq	%rbx, %rdi
	callq	_ZdaPv
	movq	%r14, %rdi
	callq	_ZdaPv
	movq	48(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB5_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB5_3
.LBB5_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB5_3:
	testq	%r14, %r14
	je	.LBB5_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB5_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB5_7
.LBB5_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB5_7:                                # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end5-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- 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_end6:
	.size	__clang_call_terminate, .Lfunc_end6-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_
.LCPI7_0:
	.long	0x4f800000                      # float 4.2949673E+9
.LCPI7_1:
	.long	0x40000000                      # float 2
.LCPI7_2:
	.long	0x5f000000                      # float 9.22337203E+18
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI7_3:
	.quad	0x3ff0000000000000              # double 1
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI7_4:
	.long	1127219200                      # 0x43300000
	.long	1160773632                      # 0x45300000
	.long	0                               # 0x0
	.long	0                               # 0x0
.LCPI7_5:
	.quad	0x4330000000000000              # double 4503599627370496
	.quad	0x4530000000000000              # double 1.9342813113834067E+25
	.section	.text._ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_,"axG",@progbits,_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_,comdat
	.weak	_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_
	.type	_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_,@function
_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_: # @_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$72, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %rbx
	flds	.LCPI7_0(%rip)
	fstpt	(%rsp)
	callq	logl
	fstpt	24(%rsp)                        # 10-byte Folded Spill
	flds	.LCPI7_1(%rip)
	fstpt	(%rsp)
	callq	logl
	fldt	24(%rsp)                        # 10-byte Folded Reload
	fdivp	%st, %st(1)
	flds	.LCPI7_2(%rip)
	xorl	%ecx, %ecx
	fxch	%st(1)
	fucomi	%st(1), %st
	fldz
	fcmovnb	%st(2), %st
	fstp	%st(2)
	fsubp	%st, %st(1)
	setae	%cl
	fnstcw	20(%rsp)
	movzwl	20(%rsp), %eax
	orl	$3072, %eax                     # imm = 0xC00
	movw	%ax, 22(%rsp)
	fldcw	22(%rsp)
	fistpll	64(%rsp)
	fldcw	20(%rsp)
	shlq	$63, %rcx
	xorq	64(%rsp), %rcx
	leaq	52(%rcx), %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r14
	cmpq	$1, %rax
	adcq	$0, %r14
	xorpd	%xmm0, %xmm0
	movsd	.LCPI7_3(%rip), %xmm1           # xmm1 = mem[0],zero
.LBB7_1:                                # %select.unfold
                                        # =>This Inner Loop Header: Depth=1
	movsd	%xmm1, 40(%rsp)                 # 8-byte Spill
	movsd	%xmm0, 24(%rsp)                 # 8-byte Spill
	movq	%rbx, %rdi
	callq	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	movq	%rax, %xmm0
	punpckldq	.LCPI7_4(%rip), %xmm0   # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
	subpd	.LCPI7_5(%rip), %xmm0
	movapd	%xmm0, %xmm1
	unpckhpd	%xmm0, %xmm1                    # xmm1 = xmm1[1],xmm0[1]
	addsd	%xmm0, %xmm1
	movsd	24(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movsd	40(%rsp), %xmm2                 # 8-byte Reload
                                        # xmm2 = mem[0],zero
	mulsd	%xmm2, %xmm1
	movsd	%xmm2, 56(%rsp)
	fldl	56(%rsp)
	fmuls	.LCPI7_0(%rip)
	addsd	%xmm1, %xmm0
	fstpl	48(%rsp)
	movsd	48(%rsp), %xmm1                 # xmm1 = mem[0],zero
	decq	%r14
	jne	.LBB7_1
# %bb.2:
	divsd	%xmm1, %xmm0
	ucomisd	.LCPI7_3(%rip), %xmm0
	jae	.LBB7_4
# %bb.3:
	addq	$72, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB7_4:
	.cfi_def_cfa_offset 96
	movsd	.LCPI7_3(%rip), %xmm0           # xmm0 = mem[0],zero
	xorpd	%xmm1, %xmm1
	addq	$72, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	nextafter                       # TAILCALL
.Lfunc_end7:
	.size	_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_, .Lfunc_end7-_ZSt18generate_canonicalIdLm53ESt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEET_RT1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,"axG",@progbits,_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,comdat
	.weak	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv # -- Begin function _ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.p2align	1, 0x90
	.type	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,@function
_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv: # @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	4992(%rdi), %rax
	cmpq	$624, %rax                      # imm = 0x270
	jb	.LBB8_2
# %bb.1:
	movq	%rbx, %rdi
	callq	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	movq	4992(%rbx), %rax
.LBB8_2:
	leaq	1(%rax), %rcx
	movq	%rcx, 4992(%rbx)
	movq	(%rbx,%rax,8), %rax
	movq	%rax, %rcx
	shrq	$11, %rcx
	movl	%ecx, %ecx
	xorq	%rax, %rcx
	movl	%ecx, %eax
	shll	$7, %eax
	andl	$-1658038656, %eax              # imm = 0x9D2C5680
	xorq	%rcx, %rax
	movl	%eax, %ecx
	shll	$15, %ecx
	andl	$-272236544, %ecx               # imm = 0xEFC60000
	xorq	%rax, %rcx
	movq	%rcx, %rax
	shrq	$18, %rax
	xorq	%rcx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv, .Lfunc_end8-_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,"axG",@progbits,_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,comdat
	.weak	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv # -- Begin function _ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.p2align	1, 0x90
	.type	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,@function
_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv: # @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.cfi_startproc
# %bb.0:
	movl	$2567483615, %eax               # imm = 0x9908B0DF
	movq	(%rdi), %rdx
	xorl	%ecx, %ecx
.LBB9_1:                                # =>This Inner Loop Header: Depth=1
	andq	$-2147483648, %rdx              # imm = 0x80000000
	movq	8(%rdi,%rcx,8), %rsi
	movl	%esi, %r8d
	andl	$2147483646, %r8d               # imm = 0x7FFFFFFE
	orq	%rdx, %r8
	shrq	%r8
	xorq	3176(%rdi,%rcx,8), %r8
	movq	%rsi, %rdx
                                        # kill: def $esi killed $esi killed $rsi def $rsi
	andl	$1, %esi
	negl	%esi
	andl	%eax, %esi
	xorq	%r8, %rsi
	movq	%rsi, (%rdi,%rcx,8)
	leaq	1(%rcx), %rsi
	movq	%rsi, %rcx
	cmpq	$227, %rsi
	jne	.LBB9_1
# %bb.2:                                # %.preheader.preheader
	movq	1816(%rdi), %rdx
	movl	$228, %ecx
.LBB9_3:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	andq	$-2147483648, %rdx              # imm = 0x80000000
	movq	(%rdi,%rcx,8), %rsi
	movl	%esi, %r8d
	andl	$2147483646, %r8d               # imm = 0x7FFFFFFE
	orq	%rdx, %r8
	shrq	%r8
	xorq	-1824(%rdi,%rcx,8), %r8
	movq	%rsi, %rdx
                                        # kill: def $esi killed $esi killed $rsi def $rsi
	andl	$1, %esi
	negl	%esi
	andl	%eax, %esi
	xorq	%r8, %rsi
	movq	%rsi, -8(%rdi,%rcx,8)
	incq	%rcx
	cmpq	$624, %rcx                      # imm = 0x270
	jne	.LBB9_3
# %bb.4:
	movq	$-2147483648, %rcx              # imm = 0x80000000
	andq	4984(%rdi), %rcx
	movq	(%rdi), %rdx
	movl	%edx, %esi
	andl	$2147483646, %esi               # imm = 0x7FFFFFFE
	orq	%rcx, %rsi
	shrq	%rsi
	xorq	3168(%rdi), %rsi
	andl	$1, %edx
	negl	%edx
	andl	%eax, %edx
	xorq	%rsi, %rdx
	movq	%rdx, 4984(%rdi)
	movq	$0, 4992(%rdi)
	retq
.Lfunc_end9:
	.size	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv, .Lfunc_end9-_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB10_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB10_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9piCalcGPUPfS_Piii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end10:
	.size	__hip_module_ctor, .Lfunc_end10-__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	.LBB11_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
.LBB11_2:
	retq
.Lfunc_end11:
	.size	__hip_module_dtor, .Lfunc_end11-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z9piCalcGPUPfS_Piii,@object    # @_Z9piCalcGPUPfS_Piii
	.section	.rodata,"a",@progbits
	.globl	_Z9piCalcGPUPfS_Piii
	.p2align	3, 0x0
_Z9piCalcGPUPfS_Piii:
	.quad	_Z24__device_stub__piCalcGPUPfS_Piii
	.size	_Z9piCalcGPUPfS_Piii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Error!\n"
	.size	.L.str, 8

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"time Pi GPU: %f s.\n"
	.size	.L.str.1, 20

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"value Pi GPU: %f\n"
	.size	.L.str.2, 18

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"time Pi CPU: %f s.\n"
	.size	.L.str.3, 20

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"value Pi CPU: %f\n"
	.size	.L.str.4, 18

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Acceleration: %f\n"
	.size	.L.str.5, 18

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"default"
	.size	.L.str.6, 8

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z9piCalcGPUPfS_Piii"
	.size	.L__unnamed_1, 21

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

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z24__device_stub__piCalcGPUPfS_Piii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z9piCalcGPUPfS_Piii
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z9piCalcGPUPfS_Piii    ; -- Begin function _Z9piCalcGPUPfS_Piii
	.globl	_Z9piCalcGPUPfS_Piii
	.p2align	8
	.type	_Z9piCalcGPUPfS_Piii,@function
_Z9piCalcGPUPfS_Piii:                   ; @_Z9piCalcGPUPfS_Piii
; %bb.0:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x2c
	s_load_b256 s[4:11], s[0:1], 0x0
	s_mov_b32 s2, s15
	v_mov_b32_e32 v4, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s1, s3, 0xffff
	s_mov_b32 s3, exec_lo
	v_mad_u64_u32 v[1:2], null, s2, s1, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s11, v1
	s_cbranch_execz .LBB0_4
; %bb.1:                                ; %.lr.ph.preheader
	v_ashrrev_i32_e32 v2, 31, v1
	s_mul_i32 s12, s1, s10
	v_mov_b32_e32 v4, 0
	s_ashr_i32 s13, s12, 31
	s_mov_b32 s10, 0
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	s_lshl_b64 s[14:15], s[12:13], 2
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v5, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v6, vcc_lo, s7, v3, vcc_lo
	v_add_co_u32 v7, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v8, vcc_lo, s5, v3, vcc_lo
	v_add_nc_u32_e32 v1, s12, v1
	global_load_b32 v5, v[5:6], off
	global_load_b32 v6, v[7:8], off
	v_add_co_u32 v2, vcc_lo, v2, s14
	v_add_co_ci_u32_e32 v3, vcc_lo, s15, v3, vcc_lo
	v_cmp_le_i32_e32 vcc_lo, s11, v1
	s_or_b32 s10, vcc_lo, s10
	s_waitcnt vmcnt(1)
	v_mul_f32_e32 v5, v5, v5
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v5, v6, v6
	v_cmp_ge_f32_e64 s0, 1.0, v5
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v4, s0, 0, v4, s0
	s_and_not1_b32 exec_lo, exec_lo, s10
	s_cbranch_execnz .LBB0_2
; %bb.3:                                ; %Flow55
	s_or_b32 exec_lo, exec_lo, s10
.LBB0_4:                                ; %Flow56
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s3
	v_lshlrev_b32_e32 v1, 2, v0
	s_mov_b32 s0, exec_lo
	ds_store_b32 v1, v4
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB0_9
; %bb.5:                                ; %.preheader
	v_mov_b32_e32 v0, 0
	s_cmp_eq_u32 s1, 0
	s_cbranch_scc1 .LBB0_8
; %bb.6:                                ; %.lr.ph31.preheader
	v_mov_b32_e32 v0, 0
	s_mov_b32 s0, 0
.LBB0_7:                                ; %.lr.ph31
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v1, s0
	s_add_i32 s1, s1, -1
	s_add_i32 s0, s0, 4
	s_cmp_eq_u32 s1, 0
	ds_load_b32 v1, v1
	s_waitcnt lgkmcnt(0)
	v_add_nc_u32_e32 v0, v1, v0
	s_cbranch_scc0 .LBB0_7
.LBB0_8:                                ; %Flow53
	s_mov_b32 s3, 0
	v_mov_b32_e32 v1, 0
	s_lshl_b64 s[0:1], s[2:3], 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s8, s0
	s_addc_u32 s1, s9, s1
	global_store_b32 v1, v0, s[0:1]
.LBB0_9:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9piCalcGPUPfS_Piii
		.amdhsa_group_segment_fixed_size 2000
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 9
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z9piCalcGPUPfS_Piii, .Lfunc_end0-_Z9piCalcGPUPfS_Piii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 372
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 2000 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 2000
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9piCalcGPUPfS_Piii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9piCalcGPUPfS_Piii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
