#include <iostream>
#include <cstdlib>
#include <cmath>
#include <ctime>
using namespace std;

#include "cuda_runtime.h"
#include "device_launch_parameters.h"

static const long long SIZE = 4096*4096*4;

cudaError_t calaAddArray(const double* a, const double* b, double* res, const long SIZE);

__global__ void addArray(const double* a,const double *b, double* c)
{
	int i = threadIdx.x + blockIdx.x*blockDim.x;
	while (i < SIZE)
	{
		c[i] = (a[i] * b[i]-b[i]*3.1415926)/a[i] * b[i]*b[i]-a[i]*b[i];
		i += gridDim.x*blockDim.x;;
	}
}

int main4444()
{
	cout<<"Begin :   "<<endl;
	srand(time(0));
	double* a = new double[SIZE];
	double* b = new double[SIZE];
	for (long i = 0; i < SIZE; i++)
	{
		a[i] = (double)rand() * (double)rand();
		b[i] = (double)rand() * (double)rand();
	}
	double* res = new double[SIZE];
	

	int count=2;
	clock_t start, finish;
	start = clock();
	for(int i=0;i<count;i++)
	{
		for (long long i = 0; i < SIZE; i++)
			res[i] = (a[i] * b[i]-b[i]*3.1415926)/a[i] * b[i]*b[i]-a[i]*b[i];
	}

	finish = clock();
	/*
	for (int i = 0; i < SIZE; i++)
		cout << a[i] << ", ";
	cout << endl;
	for (int i = 0; i < SIZE; i++)
		cout << b[i] << ", ";
	cout << endl;
	for (int i = 0; i < SIZE; i++)
		cout << res[i] << ", ";
	cout << endl << endl << endl;
	*/
	for (long long i = 0; i < SIZE; i++)
	{
		if (res[i] != (a[i] * b[i]-b[i]*3.1415926)/a[i] * b[i]*b[i]-a[i]*b[i] )
		{
			cout << "***********  Failed CPU" << endl;
			break;
		}
	}
	cout << start << "   " << finish << endl;
	cout << "By CPU Array Mult: " << (double)(finish - start) / CLOCKS_PER_SEC << endl;
	
	start = clock();
	for(int i=0;i<count;i++)
	{
		cudaError_t cudaErrorRes = calaAddArray(a, b, res, SIZE);
		if (cudaErrorRes != cudaSuccess)
		{
			cout << "*************   CUDA Return Result Failed " << endl;
		}
	}
	finish = clock();

/*
	for (int i = 0; i < SIZE; i++)
		cout << a[i] << ", ";
	cout << endl;
	for (int i = 0; i < SIZE; i++)
		cout << b[i] << ", ";
	cout << endl;
	*/
	for (long long i = 0; i < SIZE; i++)
	{
		if (res[i] != (a[i] * b[i]-b[i]*3.1415926)/a[i] * b[i]*b[i]-a[i]*b[i])
		{
			cout << "*************   Failed GPU" << endl;
			break;
		}
	}

	cout << endl;
	cout << start << "   " << finish << endl;
	cout << "By CUDA Array Mult: " << (double)(finish - start)/CLOCKS_PER_SEC << endl;

	cout<<"Game Over!!!!"<<endl;
	return 1;
}

cudaError_t calaAddArray(const double* a, const double* b, double* c, const long SIZE)
{
	double* dev_a=0;
	double* dev_b=0;
	double* dev_c=0;
	cudaError_t cudaStatus=cudaSetDevice(0);
	if (cudaStatus != cudaSuccess)
	{
		cout << "CUDA ADD Failed In Function cudaError_t calaAddArray " << endl;
		goto Error;
	}

	cudaStatus = cudaMalloc((void**)&dev_a, sizeof(double)*SIZE);
	if (cudaStatus != cudaSuccess)
	{
		cout << "cudaMalloc decvA failed!" << endl;
		goto Error;
	}

	cudaStatus = cudaMalloc((void**)&dev_b, sizeof(double)*SIZE);
	if (cudaStatus != cudaSuccess)
	{
		cout << "cudaMalloc decvB failed!" << endl;
		goto Error;
	}

	cudaStatus = cudaMalloc((void**)&dev_c, sizeof(double)*SIZE);
	if (cudaStatus != cudaSuccess)
	{
		cout << "cudaMalloc decvC failed!" << endl;
		goto Error;
	}

	cudaStatus = cudaMemcpy(dev_a,a,SIZE * sizeof(double),cudaMemcpyHostToDevice);
	if (cudaStatus != cudaSuccess)
	{
		cout << "cudaMemcpy decvA failed!" << endl;
		goto Error;
	}

	cudaStatus = cudaMemcpy(dev_b, b, SIZE * sizeof(double), cudaMemcpyHostToDevice);
	if (cudaStatus != cudaSuccess)
	{
		cout << "cudaMemcpy decvB failed!" << endl;
		goto Error;
	}

	addArray <<<4096,1024>>>(dev_a, dev_b, dev_c);
	
	cudaStatus = cudaGetLastError();
	if (cudaStatus != cudaSuccess) 
	{
		cout << "addKernel launch failed: " <<cudaGetErrorString(cudaStatus)<<endl;
		goto Error;
	}

	cudaStatus = cudaDeviceSynchronize();
	if (cudaStatus != cudaSuccess) 
	{
		cout<<cudaStatus<<" cudaDeviceSynchronize returned error code %d after launching addKernel!"<<endl;
		goto Error;
	}

	cudaStatus = cudaMemcpy(c, dev_c, SIZE * sizeof(double), cudaMemcpyDeviceToHost);
	if (cudaStatus != cudaSuccess)
	{
		cout << "cudaMemcpy decvC failed!" << endl;
		goto Error;
	}
Error:
	cudaFree(dev_a);
	cudaFree(dev_b);
	cudaFree(dev_c);
	return cudaStatus;
}

	.file	"tmpxft_0038107d_00000000-6_helloword.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3639:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3639:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4295:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4295:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z33__device_stub__Z8addArrayPKdS0_PdPKdS0_Pd
	.type	_Z33__device_stub__Z8addArrayPKdS0_PdPKdS0_Pd, @function
_Z33__device_stub__Z8addArrayPKdS0_PdPKdS0_Pd:
.LFB3661:
	.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	.L3
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z8addArrayPKdS0_Pd(%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
.L3:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3661:
	.size	_Z33__device_stub__Z8addArrayPKdS0_PdPKdS0_Pd, .-_Z33__device_stub__Z8addArrayPKdS0_PdPKdS0_Pd
	.globl	_Z8addArrayPKdS0_Pd
	.type	_Z8addArrayPKdS0_Pd, @function
_Z8addArrayPKdS0_Pd:
.LFB3662:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z8addArrayPKdS0_PdPKdS0_Pd
	.cfi_endproc
.LFE3662:
	.size	_Z8addArrayPKdS0_Pd, .-_Z8addArrayPKdS0_Pd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"CUDA ADD Failed In Function cudaError_t calaAddArray "
.LC1:
	.string	"cudaMalloc decvA failed!"
.LC2:
	.string	"cudaMalloc decvB failed!"
.LC3:
	.string	"cudaMalloc decvC failed!"
.LC4:
	.string	"cudaMemcpy decvA failed!"
.LC5:
	.string	"cudaMemcpy decvB failed!"
.LC6:
	.string	"addKernel launch failed: "
.LC7:
	.string	" cudaDeviceSynchronize returned error code %d after launching addKernel!"
.LC8:
	.string	"cudaMemcpy decvC failed!"
	.text
	.globl	_Z12calaAddArrayPKdS0_Pdl
	.type	_Z12calaAddArrayPKdS0_Pdl, @function
_Z12calaAddArrayPKdS0_Pdl:
.LFB3636:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdi, %r13
	xorl	%edi, %edi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	xorl	%eax, %eax
	movq	%rax, 8(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, 24(%rsp)
	call	cudaSetDevice@PLT
	leaq	.LC0(%rip), %rsi
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L24
	salq	$3, %rbp
	leaq	8(%rsp), %rdi
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	leaq	.LC1(%rip), %rsi
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L24
	movq	%rbp, %rsi
	leaq	16(%rsp), %rdi
	call	cudaMalloc@PLT
	leaq	.LC2(%rip), %rsi
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L24
	movq	%rbp, %rsi
	leaq	24(%rsp), %rdi
	call	cudaMalloc@PLT
	leaq	.LC3(%rip), %rsi
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L24
	movq	8(%rsp), %rdi
	movq	%r13, %rsi
	movl	$1, %ecx
	movq	%rbp, %rdx
	call	cudaMemcpy@PLT
	leaq	.LC4(%rip), %rsi
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L24
	movq	16(%rsp), %rdi
	movq	%r12, %rsi
	movl	$1, %ecx
	movq	%rbp, %rdx
	call	cudaMemcpy@PLT
	leaq	.LC5(%rip), %rsi
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.L24
	movl	$4194305, %edx
	movl	$1048577, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	salq	$12, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L17
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	call	_Z33__device_stub__Z8addArrayPKdS0_PdPKdS0_Pd
.L17:
	call	cudaGetLastError@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L18
	leaq	.LC6(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rbp, %rdi
	movq	%rax, %rsi
	jmp	.L25
.L18:
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L19
	movl	%eax, %esi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rax, %rdi
	jmp	.L25
.L19:
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbp, %rdx
	movq	%r14, %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L11
	leaq	.LC8(%rip), %rsi
.L24:
	leaq	_ZSt4cout(%rip), %rdi
.L25:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L11:
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	addq	$64, %rsp
	.cfi_def_cfa_offset 48
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3636:
	.size	_Z12calaAddArrayPKdS0_Pdl, .-_Z12calaAddArrayPKdS0_Pdl
	.section	.rodata.str1.1
.LC9:
	.string	"Begin :   "
.LC11:
	.string	"***********  Failed CPU"
.LC12:
	.string	"   "
.LC13:
	.string	"By CPU Array Mult: "
.LC15:
	.string	"*************   CUDA Return Result Failed "
.LC16:
	.string	"*************   Failed GPU"
.LC17:
	.string	"By CUDA Array Mult: "
.LC18:
	.string	"Game Over!!!!"
	.text
	.globl	_Z8main4444v
	.type	_Z8main4444v, @function
_Z8main4444v:
.LFB3635:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC9(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	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
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	xorl	%edi, %edi
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	movl	$536870912, %edi
	call	_Znam@PLT
	movl	$536870912, %edi
	movq	%rax, %rbx
	call	_Znam@PLT
	movq	%rax, %rbp
.L27:
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm5
	movsd	%xmm5, 8(%rsp)
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm0
	mulsd	8(%rsp), %xmm0
	movsd	%xmm0, (%rbx,%r12,8)
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm7
	movsd	%xmm7, 8(%rsp)
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm0
	mulsd	8(%rsp), %xmm0
	movsd	%xmm0, 0(%rbp,%r12,8)
	incq	%r12
	cmpq	$67108864, %r12
	jne	.L27
	movl	$536870912, %edi
	call	_Znam@PLT
	movq	%rax, %r13
	call	clock@PLT
	movl	$2, %edx
	movq	%rax, %r15
.L28:
	xorl	%eax, %eax
.L29:
	movsd	(%rbx,%rax,8), %xmm3
	movsd	0(%rbp,%rax,8), %xmm1
	movsd	.LC10(%rip), %xmm4
	movaps	%xmm3, %xmm2
	mulsd	%xmm1, %xmm2
	mulsd	%xmm1, %xmm4
	movaps	%xmm2, %xmm0
	subsd	%xmm4, %xmm0
	divsd	%xmm3, %xmm0
	mulsd	%xmm1, %xmm0
	mulsd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	movsd	%xmm0, 0(%r13,%rax,8)
	incq	%rax
	cmpq	$67108864, %rax
	jne	.L29
	decl	%edx
	je	.L30
	movl	$1, %edx
	jmp	.L28
.L30:
	call	clock@PLT
	movq	%rax, %r12
	xorl	%eax, %eax
.L34:
	movsd	(%rbx,%rax,8), %xmm3
	movsd	0(%rbp,%rax,8), %xmm1
	movsd	.LC10(%rip), %xmm4
	movaps	%xmm3, %xmm2
	mulsd	%xmm1, %xmm2
	mulsd	%xmm1, %xmm4
	movaps	%xmm2, %xmm0
	subsd	%xmm4, %xmm0
	divsd	%xmm3, %xmm0
	mulsd	%xmm1, %xmm0
	mulsd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	ucomisd	0(%r13,%rax,8), %xmm0
	jp	.L42
	je	.L31
.L42:
	leaq	.LC11(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L33
.L31:
	incq	%rax
	cmpq	$67108864, %rax
	jne	.L34
.L33:
	movq	%r15, %rsi
	leaq	_ZSt4cout(%rip), %rdi
	leaq	.LC12(%rip), %r14
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r12, %rsi
	subq	%r15, %r12
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC13(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtsi2sdq	%r12, %xmm0
	movl	$2, %r12d
	divsd	.LC14(%rip), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	call	clock@PLT
	movq	%rax, %r15
.L36:
	movl	$67108864, %ecx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	_Z12calaAddArrayPKdS0_Pdl
	testl	%eax, %eax
	je	.L35
	leaq	.LC15(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L35:
	decl	%r12d
	je	.L52
	movl	$1, %r12d
	jmp	.L36
.L52:
	call	clock@PLT
	movq	%rax, %r12
	xorl	%eax, %eax
.L40:
	movsd	(%rbx,%rax,8), %xmm3
	movsd	0(%rbp,%rax,8), %xmm1
	movsd	.LC10(%rip), %xmm4
	movaps	%xmm3, %xmm2
	mulsd	%xmm1, %xmm2
	mulsd	%xmm1, %xmm4
	movaps	%xmm2, %xmm0
	subsd	%xmm4, %xmm0
	divsd	%xmm3, %xmm0
	mulsd	%xmm1, %xmm0
	mulsd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	ucomisd	0(%r13,%rax,8), %xmm0
	jp	.L43
	je	.L37
.L43:
	leaq	.LC16(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L39
.L37:
	incq	%rax
	cmpq	$67108864, %rax
	jne	.L40
.L39:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%r15, %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r12, %rsi
	subq	%r15, %r12
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC17(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtsi2sdq	%r12, %xmm0
	divsd	.LC14(%rip), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC18(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	movl	$1, %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
.LFE3635:
	.size	_Z8main4444v, .-_Z8main4444v
	.section	.rodata.str1.1
.LC19:
	.string	"_Z8addArrayPKdS0_Pd"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3664:
	.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	.LC19(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z8addArrayPKdS0_Pd(%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
.LFE3664:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC10:
	.long	1293080650
	.long	1074340347
	.align 8
.LC14:
	.long	0
	.long	1093567616
	.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 <cstdlib>
#include <cmath>
#include <ctime>
using namespace std;

#include "hip/hip_runtime.h"


static const long long SIZE = 4096*4096*4;

hipError_t calaAddArray(const double* a, const double* b, double* res, const long SIZE);

__global__ void addArray(const double* a,const double *b, double* c)
{
	int i = threadIdx.x + blockIdx.x*blockDim.x;
	while (i < SIZE)
	{
		c[i] = (a[i] * b[i]-b[i]*3.1415926)/a[i] * b[i]*b[i]-a[i]*b[i];
		i += gridDim.x*blockDim.x;;
	}
}

int main4444()
{
	cout<<"Begin :   "<<endl;
	srand(time(0));
	double* a = new double[SIZE];
	double* b = new double[SIZE];
	for (long i = 0; i < SIZE; i++)
	{
		a[i] = (double)rand() * (double)rand();
		b[i] = (double)rand() * (double)rand();
	}
	double* res = new double[SIZE];
	

	int count=2;
	clock_t start, finish;
	start = clock();
	for(int i=0;i<count;i++)
	{
		for (long long i = 0; i < SIZE; i++)
			res[i] = (a[i] * b[i]-b[i]*3.1415926)/a[i] * b[i]*b[i]-a[i]*b[i];
	}

	finish = clock();
	/*
	for (int i = 0; i < SIZE; i++)
		cout << a[i] << ", ";
	cout << endl;
	for (int i = 0; i < SIZE; i++)
		cout << b[i] << ", ";
	cout << endl;
	for (int i = 0; i < SIZE; i++)
		cout << res[i] << ", ";
	cout << endl << endl << endl;
	*/
	for (long long i = 0; i < SIZE; i++)
	{
		if (res[i] != (a[i] * b[i]-b[i]*3.1415926)/a[i] * b[i]*b[i]-a[i]*b[i] )
		{
			cout << "***********  Failed CPU" << endl;
			break;
		}
	}
	cout << start << "   " << finish << endl;
	cout << "By CPU Array Mult: " << (double)(finish - start) / CLOCKS_PER_SEC << endl;
	
	start = clock();
	for(int i=0;i<count;i++)
	{
		hipError_t cudaErrorRes = calaAddArray(a, b, res, SIZE);
		if (cudaErrorRes != hipSuccess)
		{
			cout << "*************   CUDA Return Result Failed " << endl;
		}
	}
	finish = clock();

/*
	for (int i = 0; i < SIZE; i++)
		cout << a[i] << ", ";
	cout << endl;
	for (int i = 0; i < SIZE; i++)
		cout << b[i] << ", ";
	cout << endl;
	*/
	for (long long i = 0; i < SIZE; i++)
	{
		if (res[i] != (a[i] * b[i]-b[i]*3.1415926)/a[i] * b[i]*b[i]-a[i]*b[i])
		{
			cout << "*************   Failed GPU" << endl;
			break;
		}
	}

	cout << endl;
	cout << start << "   " << finish << endl;
	cout << "By CUDA Array Mult: " << (double)(finish - start)/CLOCKS_PER_SEC << endl;

	cout<<"Game Over!!!!"<<endl;
	return 1;
}

hipError_t calaAddArray(const double* a, const double* b, double* c, const long SIZE)
{
	double* dev_a=0;
	double* dev_b=0;
	double* dev_c=0;
	hipError_t cudaStatus=hipSetDevice(0);
	if (cudaStatus != hipSuccess)
	{
		cout << "CUDA ADD Failed In Function hipError_t calaAddArray " << endl;
		goto Error;
	}

	cudaStatus = hipMalloc((void**)&dev_a, sizeof(double)*SIZE);
	if (cudaStatus != hipSuccess)
	{
		cout << "hipMalloc decvA failed!" << endl;
		goto Error;
	}

	cudaStatus = hipMalloc((void**)&dev_b, sizeof(double)*SIZE);
	if (cudaStatus != hipSuccess)
	{
		cout << "hipMalloc decvB failed!" << endl;
		goto Error;
	}

	cudaStatus = hipMalloc((void**)&dev_c, sizeof(double)*SIZE);
	if (cudaStatus != hipSuccess)
	{
		cout << "hipMalloc decvC failed!" << endl;
		goto Error;
	}

	cudaStatus = hipMemcpy(dev_a,a,SIZE * sizeof(double),hipMemcpyHostToDevice);
	if (cudaStatus != hipSuccess)
	{
		cout << "hipMemcpy decvA failed!" << endl;
		goto Error;
	}

	cudaStatus = hipMemcpy(dev_b, b, SIZE * sizeof(double), hipMemcpyHostToDevice);
	if (cudaStatus != hipSuccess)
	{
		cout << "hipMemcpy decvB failed!" << endl;
		goto Error;
	}

	addArray <<<4096,1024>>>(dev_a, dev_b, dev_c);
	
	cudaStatus = hipGetLastError();
	if (cudaStatus != hipSuccess) 
	{
		cout << "addKernel launch failed: " <<hipGetErrorString(cudaStatus)<<endl;
		goto Error;
	}

	cudaStatus = hipDeviceSynchronize();
	if (cudaStatus != hipSuccess) 
	{
		cout<<cudaStatus<<" hipDeviceSynchronize returned error code %d after launching addKernel!"<<endl;
		goto Error;
	}

	cudaStatus = hipMemcpy(c, dev_c, SIZE * sizeof(double), hipMemcpyDeviceToHost);
	if (cudaStatus != hipSuccess)
	{
		cout << "hipMemcpy decvC failed!" << endl;
		goto Error;
	}
Error:
	hipFree(dev_a);
	hipFree(dev_b);
	hipFree(dev_c);
	return cudaStatus;
}

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

                                        # End of file scope inline assembly
	.globl	_Z23__device_stub__addArrayPKdS0_Pd # -- Begin function _Z23__device_stub__addArrayPKdS0_Pd
	.type	_Z23__device_stub__addArrayPKdS0_Pd,@function
_Z23__device_stub__addArrayPKdS0_Pd:    # @_Z23__device_stub__addArrayPKdS0_Pd
	.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	$_Z8addArrayPKdS0_Pd, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z23__device_stub__addArrayPKdS0_Pd, .Lfunc_end0-_Z23__device_stub__addArrayPKdS0_Pd
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z8main4444v
.LCPI1_0:
	.quad	0xc00921fb4d12d84a              # double -3.1415926000000001
.LCPI1_1:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	_Z8main4444v
	.type	_Z8main4444v,@function
_Z8main4444v:                           # @_Z8main4444v
	.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
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	xorl	%r15d, %r15d
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	movl	$536870912, %edi                # imm = 0x20000000
	callq	_Znam
	movq	%rax, %rbx
	movl	$536870912, %edi                # imm = 0x20000000
	callq	_Znam
	movq	%rax, %r14
.LBB1_1:                                # =>This Inner Loop Header: Depth=1
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	mulsd	8(%rsp), %xmm0                  # 8-byte Folded Reload
	movsd	%xmm0, (%rbx,%r15,8)
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	mulsd	8(%rsp), %xmm0                  # 8-byte Folded Reload
	movsd	%xmm0, (%r14,%r15,8)
	incq	%r15
	cmpq	$67108864, %r15                 # imm = 0x4000000
	jne	.LBB1_1
# %bb.2:
	movl	$536870912, %edi                # imm = 0x20000000
	callq	_Znam
	movq	%rax, %r15
	movb	$1, %bpl
	callq	clock
	movq	%rax, 8(%rsp)                   # 8-byte Spill
.LBB1_3:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_4 Depth 2
	xorl	%eax, %eax
.LBB1_4:                                #   Parent Loop BB1_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rbx,%rax,8), %xmm0            # xmm0 = mem[0],zero
	movsd	(%r14,%rax,8), %xmm1            # xmm1 = mem[0],zero
	movapd	%xmm0, %xmm2
	mulsd	%xmm1, %xmm2
	movapd	%xmm1, %xmm3
	mulsd	.LCPI1_0(%rip), %xmm3
	addsd	%xmm2, %xmm3
	divsd	%xmm0, %xmm3
	mulsd	%xmm1, %xmm3
	mulsd	%xmm1, %xmm3
	subsd	%xmm2, %xmm3
	movsd	%xmm3, (%r15,%rax,8)
	incq	%rax
	cmpq	$67108864, %rax                 # imm = 0x4000000
	jne	.LBB1_4
# %bb.5:                                #   in Loop: Header=BB1_3 Depth=1
	testb	$1, %bpl
	movl	$0, %ebp
	jne	.LBB1_3
# %bb.6:
	xorl	%r13d, %r13d
	callq	clock
	movsd	.LCPI1_0(%rip), %xmm5           # xmm5 = mem[0],zero
	movq	%rax, 16(%rsp)                  # 8-byte Spill
.LBB1_8:                                # =>This Inner Loop Header: Depth=1
	movsd	(%r15,%r13,8), %xmm0            # xmm0 = mem[0],zero
	movsd	(%rbx,%r13,8), %xmm1            # xmm1 = mem[0],zero
	movsd	(%r14,%r13,8), %xmm2            # xmm2 = mem[0],zero
	movapd	%xmm1, %xmm3
	mulsd	%xmm2, %xmm3
	movapd	%xmm2, %xmm4
	mulsd	%xmm5, %xmm4
	addsd	%xmm3, %xmm4
	divsd	%xmm1, %xmm4
	mulsd	%xmm2, %xmm4
	mulsd	%xmm2, %xmm4
	subsd	%xmm3, %xmm4
	ucomisd	%xmm4, %xmm0
	jne	.LBB1_9
	jp	.LBB1_9
# %bb.7:                                #   in Loop: Header=BB1_8 Depth=1
	incq	%r13
	cmpq	$67108864, %r13                 # imm = 0x4000000
	jne	.LBB1_8
	jmp	.LBB1_10
.LBB1_9:
	movl	$_ZSt4cout, %r13d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB1_10:                               # %.loopexit88
	movl	$_ZSt4cout, %r13d
	movl	$_ZSt4cout, %edi
	movq	8(%rsp), %rsi                   # 8-byte Reload
	callq	_ZNSo9_M_insertIlEERSoT_
	movq	%rax, %rbp
	movl	$.L.str.2, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%rbp, %rdi
	movq	16(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rsi
	callq	_ZNSo9_M_insertIlEERSoT_
	movq	%rax, %rbp
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbp, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$19, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	subq	8(%rsp), %r12                   # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r12, %xmm0
	divsd	.LCPI1_1(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movb	$1, %bpl
	callq	clock
	movq	%rax, %r12
.LBB1_11:                               # =>This Inner Loop Header: Depth=1
	movl	$67108864, %ecx                 # imm = 0x4000000
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_Z12calaAddArrayPKdS0_Pdl
	testl	%eax, %eax
	je	.LBB1_13
# %bb.12:                               #   in Loop: Header=BB1_11 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$42, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB1_13:                               #   in Loop: Header=BB1_11 Depth=1
	testb	$1, %bpl
	movl	$0, %ebp
	jne	.LBB1_11
# %bb.14:
	xorl	%ebp, %ebp
	callq	clock
	movq	%rax, %r13
	movsd	.LCPI1_0(%rip), %xmm5           # xmm5 = mem[0],zero
.LBB1_16:                               # =>This Inner Loop Header: Depth=1
	movsd	(%r15,%rbp,8), %xmm0            # xmm0 = mem[0],zero
	movsd	(%rbx,%rbp,8), %xmm1            # xmm1 = mem[0],zero
	movsd	(%r14,%rbp,8), %xmm2            # xmm2 = mem[0],zero
	movapd	%xmm1, %xmm3
	mulsd	%xmm2, %xmm3
	movapd	%xmm2, %xmm4
	mulsd	%xmm5, %xmm4
	addsd	%xmm3, %xmm4
	divsd	%xmm1, %xmm4
	mulsd	%xmm2, %xmm4
	mulsd	%xmm2, %xmm4
	subsd	%xmm3, %xmm4
	ucomisd	%xmm4, %xmm0
	jne	.LBB1_17
	jp	.LBB1_17
# %bb.15:                               #   in Loop: Header=BB1_16 Depth=1
	incq	%rbp
	cmpq	$67108864, %rbp                 # imm = 0x4000000
	jne	.LBB1_16
	jmp	.LBB1_18
.LBB1_17:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$26, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB1_18:                               # %.loopexit
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %r14d
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movq	%r12, %rsi
	callq	_ZNSo9_M_insertIlEERSoT_
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_ZNSo9_M_insertIlEERSoT_
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	subq	%r12, %r13
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r13, %xmm0
	divsd	.LCPI1_1(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$13, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$1, %eax
	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_end1:
	.size	_Z8main4444v, .Lfunc_end1-_Z8main4444v
	.cfi_endproc
                                        # -- End function
	.globl	_Z12calaAddArrayPKdS0_Pdl       # -- Begin function _Z12calaAddArrayPKdS0_Pdl
	.type	_Z12calaAddArrayPKdS0_Pdl,@function
_Z12calaAddArrayPKdS0_Pdl:              # @_Z12calaAddArrayPKdS0_Pdl
	.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	$32, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	xorl	%eax, %eax
	movq	%rax, 24(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, 8(%rsp)
	xorl	%edi, %edi
	callq	hipSetDevice
	testl	%eax, %eax
	je	.LBB2_2
# %bb.1:
	movl	%eax, %ebx
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$52, %edx
	jmp	.LBB2_5
.LBB2_2:
	shlq	$3, %r14
	leaq	24(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB2_6
# %bb.3:
	movl	%eax, %ebx
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	jmp	.LBB2_4
.LBB2_6:
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB2_8
# %bb.7:
	movl	%eax, %ebx
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	jmp	.LBB2_4
.LBB2_8:
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB2_10
# %bb.9:
	movl	%eax, %ebx
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.11, %esi
.LBB2_4:
	movl	$23, %edx
.LBB2_5:
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB2_25:
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	movl	%ebx, %eax
	addq	$32, %rsp
	.cfi_def_cfa_offset 48
	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
.LBB2_10:
	.cfi_def_cfa_offset 80
	movq	24(%rsp), %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	je	.LBB2_12
# %bb.11:
	movl	%eax, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	jmp	.LBB2_23
.LBB2_12:
	movq	16(%rsp), %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	je	.LBB2_14
# %bb.13:
	movl	%eax, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.13, %esi
.LBB2_23:
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
.LBB2_24:
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	jmp	.LBB2_25
.LBB2_14:
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	leaq	3072(%rdx), %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_16
# %bb.15:
	movq	24(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdx
	callq	_Z23__device_stub__addArrayPKdS0_Pd
.LBB2_16:
	callq	hipGetLastError
	testl	%eax, %eax
	je	.LBB2_18
# %bb.17:
	movl	%eax, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.14, %esi
	movl	$25, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebx, %edi
	callq	hipGetErrorString
	movl	$_ZSt4cout, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	jmp	.LBB2_24
.LBB2_18:
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	je	.LBB2_20
# %bb.19:
	movl	%eax, %ebx
	movl	$_ZSt4cout, %edi
	movl	%eax, %esi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movl	$.L.str.15, %esi
	movl	$71, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r14, %rdi
	jmp	.LBB2_24
.LBB2_20:
	movq	8(%rsp), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	je	.LBB2_21
# %bb.22:
	movl	%eax, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.16, %esi
	jmp	.LBB2_23
.LBB2_21:
	xorl	%ebx, %ebx
	jmp	.LBB2_25
.Lfunc_end2:
	.size	_Z12calaAddArrayPKdS0_Pdl, .Lfunc_end2-_Z12calaAddArrayPKdS0_Pdl
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8addArrayPKdS0_Pd, %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_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__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	.LBB4_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
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z8addArrayPKdS0_Pd,@object     # @_Z8addArrayPKdS0_Pd
	.section	.rodata,"a",@progbits
	.globl	_Z8addArrayPKdS0_Pd
	.p2align	3, 0x0
_Z8addArrayPKdS0_Pd:
	.quad	_Z23__device_stub__addArrayPKdS0_Pd
	.size	_Z8addArrayPKdS0_Pd, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Begin :   "
	.size	.L.str, 11

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"***********  Failed CPU"
	.size	.L.str.1, 24

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

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"By CPU Array Mult: "
	.size	.L.str.3, 20

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"*************   CUDA Return Result Failed "
	.size	.L.str.4, 43

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"*************   Failed GPU"
	.size	.L.str.5, 27

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"By CUDA Array Mult: "
	.size	.L.str.6, 21

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Game Over!!!!"
	.size	.L.str.7, 14

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"CUDA ADD Failed In Function hipError_t calaAddArray "
	.size	.L.str.8, 53

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"hipMalloc decvA failed!"
	.size	.L.str.9, 24

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"hipMalloc decvB failed!"
	.size	.L.str.10, 24

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"hipMalloc decvC failed!"
	.size	.L.str.11, 24

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"hipMemcpy decvA failed!"
	.size	.L.str.12, 24

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"hipMemcpy decvB failed!"
	.size	.L.str.13, 24

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"addKernel launch failed: "
	.size	.L.str.14, 26

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	" hipDeviceSynchronize returned error code %d after launching addKernel!"
	.size	.L.str.15, 72

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"hipMemcpy decvC failed!"
	.size	.L.str.16, 24

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z8addArrayPKdS0_Pd"
	.size	.L__unnamed_1, 20

	.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 _Z23__device_stub__addArrayPKdS0_Pd
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z8addArrayPKdS0_Pd
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z8addArrayPKdS0_Pd     ; -- Begin function _Z8addArrayPKdS0_Pd
	.globl	_Z8addArrayPKdS0_Pd
	.p2align	8
	.type	_Z8addArrayPKdS0_Pd,@function
_Z8addArrayPKdS0_Pd:                    ; @_Z8addArrayPKdS0_Pd
; %bb.0:
	s_load_b32 s4, s[0:1], 0x24
	s_add_u32 s2, s0, 24
	s_addc_u32 s3, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s10, s4, 0xffff
	s_mov_b32 s4, exec_lo
	v_mad_u64_u32 v[1:2], null, s15, s10, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e32 0x4000000, v1
	s_cbranch_execz .LBB0_3
; %bb.1:                                ; %.lr.ph
	s_load_b32 s11, s[2:3], 0x0
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[2:3], s[0:1], 0x10
	s_mov_b32 s8, 0x4d12d84a
	s_mov_b32 s9, 0xc00921fb
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s1, s11, s10
	s_mov_b32 s10, 0
.LBB0_2:                                ; =>This Inner Loop Header: Depth=1
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[2:3], 3, v[1:2]
	v_add_nc_u32_e32 v1, s1, v1
	v_add_co_u32 v4, vcc_lo, s4, v2
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v3, vcc_lo
	v_add_co_u32 v6, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v7, vcc_lo, s7, v3, vcc_lo
	v_add_co_u32 v2, s0, s2, v2
	global_load_b64 v[4:5], v[4:5], off
	global_load_b64 v[6:7], v[6:7], off
	v_add_co_ci_u32_e64 v3, s0, s3, v3, s0
	s_waitcnt vmcnt(0)
	v_mul_f64 v[8:9], v[4:5], v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[10:11], v[6:7], s[8:9], v[8:9]
	v_div_scale_f64 v[12:13], null, v[4:5], v[4:5], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[14:15], v[12:13]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[16:17], -v[12:13], v[14:15], 1.0
	v_fma_f64 v[14:15], v[14:15], v[16:17], v[14:15]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[16:17], -v[12:13], v[14:15], 1.0
	v_fma_f64 v[14:15], v[14:15], v[16:17], v[14:15]
	v_div_scale_f64 v[16:17], vcc_lo, v[10:11], v[4:5], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[18:19], v[16:17], v[14:15]
	v_fma_f64 v[12:13], -v[12:13], v[18:19], v[16:17]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_div_fmas_f64 v[12:13], v[12:13], v[14:15], v[18:19]
	v_cmp_lt_i32_e32 vcc_lo, 0x3ffffff, v1
	s_or_b32 s10, vcc_lo, s10
	v_div_fixup_f64 v[4:5], v[12:13], v[4:5], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[4:5], v[6:7], v[4:5]
	v_fma_f64 v[4:5], v[6:7], v[4:5], -v[8:9]
	global_store_b64 v[2:3], v[4:5], off
	s_and_not1_b32 exec_lo, exec_lo, s10
	s_cbranch_execnz .LBB0_2
.LBB0_3:                                ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8addArrayPKdS0_Pd
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 20
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z8addArrayPKdS0_Pd, .Lfunc_end0-_Z8addArrayPKdS0_Pd
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 380
; NumSgprs: 18
; NumVgprs: 20
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 20
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 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:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8addArrayPKdS0_Pd
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z8addArrayPKdS0_Pd.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     20
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
