// to avoid highlight problems
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <iostream>
#include <stdlib.h> // imported for rand() which generates a number between 0 & RAND_MAX
#include <time.h>   // imported for the time() function and also the clock function
#include <limits>	// for a large value
#include <cmath>    // for exponentiation
using namespace std;

void FindClosestPoint(float3 *points, const int numberPoints, int *closestPoint)
{
	// now find the closest point to each point
	// 'i' represents the current point that we are finding the closest point to!	
	for (int i = 0; i < numberPoints; i++)
	{
		int distanceBetweenPoints = numeric_limits<int>::max(), tempDistance=0;
		for (int j = 0; j < numberPoints; j++)
			if (i != j)		// dont check the distance between the point and itself
			{
				tempDistance = pow((points[i].x - points[j].x), 2) + pow((points[i].y - points[j].y), 2);
				if (tempDistance < distanceBetweenPoints)
				{
					distanceBetweenPoints = tempDistance;
					closestPoint[i] = j;
				}
			}
	}
	// display the closest points
	cout << "The closest points :" << endl;
	for (int i = 0; i < numberPoints; i++)
		cout << i << "\t" << closestPoint[i] << endl;
}

int main()
{
	srand(time(NULL));  // used to initialize the seed for the random number generator
	const int numberPoints = 1000;
	clock_t startTime, endTime;
	float3 *points = new float3[numberPoints];
	int *closestPoint = new int[numberPoints];
	// initialize the points with random numbers	
	for (int i = 0; i < numberPoints; i++)
	{
		points[i].x = rand() % 1000;
		points[i].y = rand() % 1000;
		points[i].z = rand() % 1000;
	}
	// print the points initialized
	for (int i = 0; i < numberPoints; i++)
		cout << points[i].x << "\t" << points[i].y << "\t" << points[i].z << endl;
	cout << endl;
	// now find the distance between all points
	startTime = clock();
	FindClosestPoint(points, numberPoints, closestPoint);
	endTime = clock() - startTime;
	cout << "Time it took was " << ((float) endTime / CLOCKS_PER_SEC) << endl;
}

	.file	"tmpxft_003722a1_00000000-6_kernel.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:
.LFB4292:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4292:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"The closest points :"
.LC1:
	.string	"\t"
	.text
	.globl	_Z16FindClosestPointP6float3iPi
	.type	_Z16FindClosestPointP6float3iPi, @function
_Z16FindClosestPointP6float3iPi:
.LFB3635:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %rcx
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
.L4:
	movl	%eax, %r10d
	cmpl	%eax, %ebp
	jle	.L13
	movq	%rdi, %rsi
	xorl	%edx, %edx
	movl	$2147483647, %r8d
.L6:
	cmpl	%r10d, %edx
	je	.L5
	movss	(%rcx), %xmm1
	movss	4(%rcx), %xmm0
	subss	(%rsi), %xmm1
	subss	4(%rsi), %xmm0
	cvtss2sd	%xmm1, %xmm1
	cvtss2sd	%xmm0, %xmm0
	mulsd	%xmm1, %xmm1
	mulsd	%xmm0, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %r9d
	cmpl	%r8d, %r9d
	jge	.L5
	movl	%edx, (%r12,%rax,4)
	movl	%r9d, %r8d
.L5:
	incl	%edx
	addq	$12, %rsi
	cmpl	%edx, %ebp
	jne	.L6
	incq	%rax
	addq	$12, %rcx
	jmp	.L4
.L13:
	leaq	_ZSt4cout(%rip), %r13
	leaq	.LC0(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	leaq	.LC1(%rip), %r14
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L7:
	movl	%ebx, %esi
	cmpl	%ebx, %ebp
	jle	.L14
	movq	%r13, %rdi
	call	_ZNSolsEi@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%r12,%rbx,4), %esi
	incq	%rbx
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L7
.L14:
	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
.LFE3635:
	.size	_Z16FindClosestPointP6float3iPi, .-_Z16FindClosestPointP6float3iPi
	.section	.rodata.str1.1
.LC2:
	.string	"Time it took was "
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3636:
	.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
	movl	$1000, %r13d
	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
	pushq	%rcx
	.cfi_def_cfa_offset 64
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	movl	$12000, %edi
	call	_Znam@PLT
	movl	$4000, %edi
	movq	%rax, %rbx
	call	_Znam@PLT
	movq	%rbx, %rbp
	leaq	12000(%rbx), %r15
	movq	%rbx, %r12
	movq	%rax, %r14
.L16:
	call	rand@PLT
	addq	$12, %r12
	cltd
	idivl	%r13d
	cvtsi2ssl	%edx, %xmm0
	movss	%xmm0, -12(%r12)
	call	rand@PLT
	cltd
	idivl	%r13d
	cvtsi2ssl	%edx, %xmm0
	movss	%xmm0, -8(%r12)
	call	rand@PLT
	cltd
	idivl	%r13d
	cvtsi2ssl	%edx, %xmm0
	movss	%xmm0, -4(%r12)
	cmpq	%r15, %r12
	jne	.L16
	leaq	_ZSt4cout(%rip), %r12
.L17:
	movq	%r12, %rdi
	cvtss2sd	0(%rbp), %xmm0
	leaq	.LC1(%rip), %r13
	addq	$12, %rbp
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	-8(%rbp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	-4(%rbp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	cmpq	%r15, %rbp
	jne	.L17
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	call	clock@PLT
	movq	%r14, %rdx
	movq	%rbx, %rdi
	movl	$1000, %esi
	movq	%rax, %rbp
	call	_Z16FindClosestPointP6float3iPi
	call	clock@PLT
	leaq	.LC2(%rip), %rsi
	movq	%r12, %rdi
	subq	%rbp, %rax
	movq	%rax, %rbx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtsi2ssq	%rbx, %xmm0
	divss	.LC3(%rip), %xmm0
	cvtss2sd	%xmm0, %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
	popq	%rdx
	.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
.LFE3636:
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3662:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3662:
	.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.cst4,"aM",@progbits,4
	.align 4
.LC3:
	.long	1232348160
	.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:

// to avoid highlight problems
#include "hip/hip_runtime.h"

#include <iostream>
#include <stdlib.h> // imported for rand() which generates a number between 0 & RAND_MAX
#include <time.h>   // imported for the time() function and also the clock function
#include <limits>	// for a large value
#include <cmath>    // for exponentiation
using namespace std;

void FindClosestPoint(float3 *points, const int numberPoints, int *closestPoint)
{
	// now find the closest point to each point
	// 'i' represents the current point that we are finding the closest point to!	
	for (int i = 0; i < numberPoints; i++)
	{
		int distanceBetweenPoints = numeric_limits<int>::max(), tempDistance=0;
		for (int j = 0; j < numberPoints; j++)
			if (i != j)		// dont check the distance between the point and itself
			{
				tempDistance = pow((points[i].x - points[j].x), 2) + pow((points[i].y - points[j].y), 2);
				if (tempDistance < distanceBetweenPoints)
				{
					distanceBetweenPoints = tempDistance;
					closestPoint[i] = j;
				}
			}
	}
	// display the closest points
	cout << "The closest points :" << endl;
	for (int i = 0; i < numberPoints; i++)
		cout << i << "\t" << closestPoint[i] << endl;
}

int main()
{
	srand(time(NULL));  // used to initialize the seed for the random number generator
	const int numberPoints = 1000;
	clock_t startTime, endTime;
	float3 *points = new float3[numberPoints];
	int *closestPoint = new int[numberPoints];
	// initialize the points with random numbers	
	for (int i = 0; i < numberPoints; i++)
	{
		points[i].x = rand() % 1000;
		points[i].y = rand() % 1000;
		points[i].z = rand() % 1000;
	}
	// print the points initialized
	for (int i = 0; i < numberPoints; i++)
		cout << points[i].x << "\t" << points[i].y << "\t" << points[i].z << endl;
	cout << endl;
	// now find the distance between all points
	startTime = clock();
	FindClosestPoint(points, numberPoints, closestPoint);
	endTime = clock() - startTime;
	cout << "Time it took was " << ((float) endTime / CLOCKS_PER_SEC) << endl;
}

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

                                        # End of file scope inline assembly
	.globl	_Z16FindClosestPointP15HIP_vector_typeIfLj3EEiPi # -- Begin function _Z16FindClosestPointP15HIP_vector_typeIfLj3EEiPi
	.type	_Z16FindClosestPointP15HIP_vector_typeIfLj3EEiPi,@function
_Z16FindClosestPointP15HIP_vector_typeIfLj3EEiPi: # @_Z16FindClosestPointP15HIP_vector_typeIfLj3EEiPi
	.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	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	testl	%esi, %esi
	jle	.LBB0_12
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdx, %rbx
	movl	%esi, %ebp
	movl	%esi, %r12d
	leaq	4(%rdi), %rax
	xorl	%ecx, %ecx
.LBB0_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_3 Depth 2
	leaq	(%rcx,%rcx,2), %rdx
	leaq	(%rdi,%rdx,4), %rdx
	movl	$2147483647, %r9d               # imm = 0x7FFFFFFF
	movq	%rax, %rsi
	xorl	%r8d, %r8d
.LBB0_3:                                #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpq	%r8, %rcx
	je	.LBB0_6
# %bb.4:                                #   in Loop: Header=BB0_3 Depth=2
	movss	(%rdx), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	movss	4(%rdx), %xmm1                  # xmm1 = mem[0],zero,zero,zero
	subss	-4(%rsi), %xmm0
	cvtss2sd	%xmm0, %xmm0
	mulsd	%xmm0, %xmm0
	subss	(%rsi), %xmm1
	cvtss2sd	%xmm1, %xmm1
	mulsd	%xmm1, %xmm1
	addsd	%xmm0, %xmm1
	cvttsd2si	%xmm1, %r10d
	cmpl	%r10d, %r9d
	jle	.LBB0_6
# %bb.5:                                #   in Loop: Header=BB0_3 Depth=2
	movl	%r8d, (%rbx,%rcx,4)
	movl	%r10d, %r9d
.LBB0_6:                                #   in Loop: Header=BB0_3 Depth=2
	incq	%r8
	addq	$12, %rsi
	cmpq	%r8, %r12
	jne	.LBB0_3
# %bb.7:                                # %._crit_edge
                                        #   in Loop: Header=BB0_2 Depth=1
	incq	%rcx
	cmpq	%r12, %rcx
	jne	.LBB0_2
# %bb.8:                                # %._crit_edge37
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$20, %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
	testl	%ebp, %ebp
	jle	.LBB0_11
# %bb.9:                                # %.lr.ph40.preheader
	xorl	%r14d, %r14d
.LBB0_10:                               # %.lr.ph40
                                        # =>This Inner Loop Header: Depth=1
	movl	$_ZSt4cout, %edi
	movl	%r14d, %esi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	(%rbx,%r14,4), %esi
	movq	%r15, %rdi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%r14
	cmpq	%r14, %r12
	jne	.LBB0_10
.LBB0_11:                               # %._crit_edge41
	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
.LBB0_12:                               # %._crit_edge41.critedge
	.cfi_def_cfa_offset 48
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$20, %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
	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
	jmp	_ZNSo5flushEv                   # TAILCALL
.Lfunc_end0:
	.size	_Z16FindClosestPointP15HIP_vector_typeIfLj3EEiPi, .Lfunc_end0-_Z16FindClosestPointP15HIP_vector_typeIfLj3EEiPi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI1_0:
	.long	0x49742400                      # float 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.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
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	movl	$12000, %edi                    # imm = 0x2EE0
	callq	_Znam
	movq	%rax, %rbx
	movl	$4000, %edi                     # imm = 0xFA0
	callq	_Znam
	movq	%rax, %r14
	movl	$8, %r15d
.LBB1_1:                                # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	imulq	$274877907, %rax, %rcx          # imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	imull	$1000, %ecx, %ecx               # imm = 0x3E8
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, -8(%rbx,%r15)
	callq	rand
	cltq
	imulq	$274877907, %rax, %rcx          # imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	imull	$1000, %ecx, %ecx               # imm = 0x3E8
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, -4(%rbx,%r15)
	callq	rand
	cltq
	imulq	$274877907, %rax, %rcx          # imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	imull	$1000, %ecx, %ecx               # imm = 0x3E8
	subl	%ecx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%rbx,%r15)
	addq	$12, %r15
	cmpq	$12008, %r15                    # imm = 0x2EE8
	jne	.LBB1_1
# %bb.2:                                # %.preheader.preheader
	movl	$8, %r12d
.LBB1_3:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	-8(%rbx,%r12), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	-4(%rbx,%r12), %xmm0
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx,%r12), %xmm0
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	addq	$12, %r12
	cmpq	$12008, %r12                    # imm = 0x2EE8
	jne	.LBB1_3
# %bb.4:
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	callq	clock
	movq	%rax, %r15
	movq	%rbx, %rdi
	movl	$1000, %esi                     # imm = 0x3E8
	movq	%r14, %rdx
	callq	_Z16FindClosestPointP15HIP_vector_typeIfLj3EEiPi
	callq	clock
	movq	%rax, %rbx
	subq	%r15, %rbx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$17, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rbx, %xmm0
	divss	.LCPI1_0(%rip), %xmm0
	cvtss2sd	%xmm0, %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
	xorl	%eax, %eax
	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_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"The closest points :"
	.size	.L.str, 21

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"\t"
	.size	.L.str.1, 2

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Time it took was "
	.size	.L.str.2, 18

	.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 _ZSt4cout
	.addrsig_sym __hip_cuid_

	.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_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
