#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define MAX_CHAR 100
#define DATAFILE "data.txt"
#define RESULTSFILE "resultsCudal.txt"
#define G 6.674e-11
#define NUM_ITER 1000
#define NUM_ITER_SHOW 50

__device__ double atomicAddD(double* address, double val)
{
	unsigned long long int* address_as_ull =
		(unsigned long long int*)address;
	unsigned long long int old = *address_as_ull, assumed;
	do {
		assumed = old;
		old = atomicCAS(address_as_ull, assumed,
		                __double_as_longlong(val +
		                                     __longlong_as_double(assumed)));
	} while (assumed != old);
	return __longlong_as_double(old);
}

__global__ void asteroid(double * gpu_x, double * gpu_y, double * gpu_vx, double * gpu_vy, double * gpu_m){
	int posx = blockIdx.x * blockDim.x + threadIdx.x;
	int posy = blockIdx.y * blockDim.y + threadIdx.y;

	if (posx!=posy) {
		double d = sqrt(pow( (gpu_x[posx]-gpu_x[posy]),2.0) + pow( (gpu_y[posx]-gpu_y[posy]),2.0));
		double f = G*gpu_m[posx]*gpu_m[posy]/pow(d,2.0);
		double fx = f*(gpu_x[posy]-gpu_x[posx])/d;
		double fy = f*(gpu_y[posy]-gpu_y[posx])/d;
		double ax = fx/gpu_m[posx];
		double ay = fy/gpu_m[posx];
		// atomicAddD(gpu_vx+posx, ax);
		// atomicAddD(gpu_vy+posx, ay);
		atomicAddD(&gpu_vx[posx], ax);
		atomicAddD(&gpu_vy[posx], ay);
	}
}

__global__ void positions(double * gpu_x, double * gpu_y, double * gpu_vx, double * gpu_vy, double * gpu_m){
	int i = blockIdx.x * blockIdx.x + threadIdx.x;
	// gpu_x[i] += gpu_vx[i];
	// gpu_y[i] += gpu_vy[i];
	atomicAddD(&gpu_x[i], gpu_vx[i]);
	atomicAddD(&gpu_y[i], gpu_vy[i]);
}

int main(){

	clock_t start, end;
	double time_used;
	char str[MAX_CHAR];
	FILE *file;
	int noOfObjects;
	int i;

	file = fopen( DATAFILE, "r");
	fscanf(file,"%s",str);
	noOfObjects = atoi(str);
	printf("Number of objects: %d\n",noOfObjects);

	const int ARRAY_BYTES = noOfObjects * sizeof(double);

	double *x = (double *) malloc(ARRAY_BYTES);
	double *y = (double *) malloc(ARRAY_BYTES);
	double *vx = (double *) malloc(ARRAY_BYTES);
	double *vy = (double *) malloc(ARRAY_BYTES);
	double *m = (double *) malloc(ARRAY_BYTES);

	double *x_new = (double *) malloc(ARRAY_BYTES);
	double *y_new = (double *) malloc(ARRAY_BYTES);
	double *vx_new = (double *) malloc(ARRAY_BYTES);
	double *vy_new = (double *) malloc(ARRAY_BYTES);

	// declare GPU memory pointers
	double * gpu_x;
	double * gpu_y;
	double * gpu_vx;
	double * gpu_vy;
	double * gpu_m;
	double * gpu_x_new;
	double * gpu_y_new;
	double * gpu_vx_new;
	double * gpu_vy_new;

	// allocate GPU memory
	cudaMalloc((void**) &gpu_x, ARRAY_BYTES);
	cudaMalloc((void**) &gpu_y, ARRAY_BYTES);
	cudaMalloc((void**) &gpu_vx, ARRAY_BYTES);
	cudaMalloc((void**) &gpu_vy, ARRAY_BYTES);
	cudaMalloc((void**) &gpu_m, ARRAY_BYTES);
	cudaMalloc((void**) &gpu_x_new, ARRAY_BYTES);
	cudaMalloc((void**) &gpu_y_new, ARRAY_BYTES);
	cudaMalloc((void**) &gpu_vx_new, ARRAY_BYTES);
	cudaMalloc((void**) &gpu_vy_new, ARRAY_BYTES);

	// launch the kernel
	for (i=0; i < noOfObjects; i++) {
		fscanf(file,"%s",str);
		x[i] = atof(str);
		x_new[i] = atof(str);
		fscanf(file,"%s",str);
		y[i] = atof(str);
		y_new[i] = atof(str);
		fscanf(file,"%s",str);
		vx[i] = atof(str);
		vx_new[i] = atof(str);
		fscanf(file,"%s",str);
		vy[i] = atof(str);
		vy_new[i] = atof(str);
		fscanf(file,"%s",str);
		m[i] = atof(str);
	}
	fclose(file);

	// transfer the array to the GPU
	cudaMemcpy(gpu_x, x, ARRAY_BYTES, cudaMemcpyHostToDevice);
	cudaMemcpy(gpu_y, y, ARRAY_BYTES, cudaMemcpyHostToDevice);
	cudaMemcpy(gpu_vx, vx, ARRAY_BYTES, cudaMemcpyHostToDevice);
	cudaMemcpy(gpu_vy, vy, ARRAY_BYTES, cudaMemcpyHostToDevice);
	cudaMemcpy(gpu_m, m, ARRAY_BYTES, cudaMemcpyHostToDevice);

	start=clock();

	dim3 blocksPerGrid(32,32);              // blocks per grid
	dim3 threadsPerBlock(32,32);            // threads per block

	for (int niter=0; niter<=NUM_ITER; niter++) {

		asteroid<<<blocksPerGrid, threadsPerBlock>>>(gpu_x, gpu_y, gpu_vx, gpu_vy, gpu_m);
		positions<<<1, 1024>>>(gpu_x, gpu_y, gpu_vx, gpu_vy, gpu_m);

		if (niter%NUM_ITER_SHOW == 0)
			printf("Iteration %d/%d\n", niter, NUM_ITER);

	}  // nIter
	end=clock();

	// copy back the result array to the CPU
	cudaMemcpy(x, gpu_x, ARRAY_BYTES, cudaMemcpyDeviceToHost);
	cudaMemcpy(y, gpu_y, ARRAY_BYTES, cudaMemcpyDeviceToHost);
	cudaMemcpy(vx, gpu_vx, ARRAY_BYTES, cudaMemcpyDeviceToHost);
	cudaMemcpy(vy, gpu_vy, ARRAY_BYTES, cudaMemcpyDeviceToHost);
	cudaMemcpy(m, gpu_m, ARRAY_BYTES, cudaMemcpyDeviceToHost);

	file = fopen( RESULTSFILE, "w");
	fprintf(file, "Movement of objects\n");
	fprintf(file, "-------------------\n");
	for (i = 0; i < noOfObjects; i++) {
		double mov = sqrt(pow( (x_new[i]-x[i]),2.0) + pow( (y_new[i]-y[i]),2.0));
		// printf("  Object %i  - ORIGINAL: (%f,%f) -- NEW: (%f,%f) -> %f meters\n", i, x[i], y[i], x_new[i], y_new[i], mov);
		fprintf(file,"  Object %i  - ORIGINAL: (%f,%f) -- NEW: (%f,%f) -> %f meters\n", i, x[i], y[i], x_new[i], y_new[i], mov);

	}
	int hours = NUM_ITER/3600;
	int mins = (NUM_ITER - hours*3600)/60;
	int secs = (NUM_ITER - hours*3600 - mins*60);
	fprintf(file,"Time elapsed: %i seconds (%i hours, %i minutes, %i seconds)\n",NUM_ITER, hours, mins, secs);

	time_used = ((double)(end-start)) / CLOCKS_PER_SEC;
	fprintf(file,"Processing time: %f sec.\n",time_used);
	fclose(file);

	cudaFree(gpu_x);
	cudaFree(gpu_y);
	cudaFree(gpu_vx);
	cudaFree(gpu_vy);
	cudaFree(gpu_m);

	cudaFree(gpu_x_new);
	cudaFree(gpu_y_new);
	cudaFree(gpu_vx_new);
	cudaFree(gpu_vy_new);

}  // main

	.file	"tmpxft_0026df64_00000000-6_SimulateAsteroidsParallel.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2031:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2031:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z10atomicAddDPdd
	.type	_Z10atomicAddDPdd, @function
_Z10atomicAddDPdd:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2027:
	.size	_Z10atomicAddDPdd, .-_Z10atomicAddDPdd
	.globl	_Z35__device_stub__Z8asteroidPdS_S_S_S_PdS_S_S_S_
	.type	_Z35__device_stub__Z8asteroidPdS_S_S_S_PdS_S_S_S_, @function
_Z35__device_stub__Z8asteroidPdS_S_S_S_PdS_S_S_S_:
.LFB2053:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L4
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z8asteroidPdS_S_S_S_(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L4:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2053:
	.size	_Z35__device_stub__Z8asteroidPdS_S_S_S_PdS_S_S_S_, .-_Z35__device_stub__Z8asteroidPdS_S_S_S_PdS_S_S_S_
	.globl	_Z8asteroidPdS_S_S_S_
	.type	_Z8asteroidPdS_S_S_S_, @function
_Z8asteroidPdS_S_S_S_:
.LFB2054:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z8asteroidPdS_S_S_S_PdS_S_S_S_
	.cfi_endproc
.LFE2054:
	.size	_Z8asteroidPdS_S_S_S_, .-_Z8asteroidPdS_S_S_S_
	.globl	_Z36__device_stub__Z9positionsPdS_S_S_S_PdS_S_S_S_
	.type	_Z36__device_stub__Z9positionsPdS_S_S_S_PdS_S_S_S_, @function
_Z36__device_stub__Z9positionsPdS_S_S_S_PdS_S_S_S_:
.LFB2055:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L10
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z9positionsPdS_S_S_S_(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L10:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2055:
	.size	_Z36__device_stub__Z9positionsPdS_S_S_S_PdS_S_S_S_, .-_Z36__device_stub__Z9positionsPdS_S_S_S_PdS_S_S_S_
	.globl	_Z9positionsPdS_S_S_S_
	.type	_Z9positionsPdS_S_S_S_, @function
_Z9positionsPdS_S_S_S_:
.LFB2056:
	.cfi_startproc
	endbr64
	jmp	_Z36__device_stub__Z9positionsPdS_S_S_S_PdS_S_S_S_
	.cfi_endproc
.LFE2056:
	.size	_Z9positionsPdS_S_S_S_, .-_Z9positionsPdS_S_S_S_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"r"
.LC1:
	.string	"data.txt"
.LC2:
	.string	"%s"
.LC3:
	.string	"Number of objects: %d\n"
.LC4:
	.string	"Iteration %d/%d\n"
.LC5:
	.string	"w"
.LC6:
	.string	"resultsCudal.txt"
.LC7:
	.string	"Movement of objects\n"
.LC8:
	.string	"-------------------\n"
.LC9:
	.string	"  Object %i  - ORIGINAL: (%f,%f) -- NEW: (%f,%f) -> %f meters\n"
.LC10:
	.string	"Time elapsed: %i seconds (%i hours, %i minutes, %i seconds)\n"
.LC12:
	.string	"Processing time: %f sec.\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rsi
	leaq	.LC1(%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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$312, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	196(%rsp), %rbx
	call	fopen@PLT
	movq	%rbx, %rdx
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	movq	%rbx, %rdi
	xorl	%ebx, %ebx
	call	atoi@PLT
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	movl	%eax, %edx
	movl	%eax, 56(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	56(%rsp), %eax
	sall	$3, %eax
	cltq
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	call	malloc@PLT
	movq	(%rsp), %rdi
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	movq	(%rsp), %rdi
	movq	%rax, 32(%rsp)
	call	malloc@PLT
	movq	(%rsp), %rdi
	movq	%rax, %r15
	call	malloc@PLT
	movq	(%rsp), %rdi
	movq	%rax, 40(%rsp)
	call	malloc@PLT
	movq	(%rsp), %rdi
	movq	%rax, 48(%rsp)
	call	malloc@PLT
	movq	(%rsp), %rdi
	movq	%rax, %r12
	call	malloc@PLT
	movq	(%rsp), %rdi
	movq	%rax, %r13
	call	malloc@PLT
	movq	(%rsp), %rdi
	movq	%rax, %r14
	call	malloc@PLT
	movq	(%rsp), %rsi
	leaq	72(%rsp), %rdi
	movq	%rax, %rbp
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	80(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	88(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	96(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	104(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	112(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	120(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	128(%rsp), %rdi
	call	cudaMalloc@PLT
	movq	(%rsp), %rsi
	leaq	136(%rsp), %rdi
	call	cudaMalloc@PLT
.L16:
	cmpl	%ebx, 56(%rsp)
	jle	.L27
	leaq	196(%rsp), %rax
	movq	16(%rsp), %rdi
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdx
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	movq	8(%rsp), %rdi
	call	atof@PLT
	movq	24(%rsp), %rax
	movq	8(%rsp), %rdi
	movsd	%xmm0, (%rax,%rbx,8)
	call	atof@PLT
	movq	8(%rsp), %rdx
	movq	16(%rsp), %rdi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movsd	%xmm0, (%r12,%rbx,8)
	call	__isoc23_fscanf@PLT
	movq	8(%rsp), %rdi
	call	atof@PLT
	movq	32(%rsp), %rax
	movq	8(%rsp), %rdi
	movsd	%xmm0, (%rax,%rbx,8)
	call	atof@PLT
	movq	8(%rsp), %rdx
	movq	16(%rsp), %rdi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movsd	%xmm0, 0(%r13,%rbx,8)
	call	__isoc23_fscanf@PLT
	movq	8(%rsp), %rdi
	call	atof@PLT
	movq	8(%rsp), %rdi
	movsd	%xmm0, (%r15,%rbx,8)
	call	atof@PLT
	movq	8(%rsp), %rdx
	movq	16(%rsp), %rdi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movsd	%xmm0, (%r14,%rbx,8)
	call	__isoc23_fscanf@PLT
	movq	8(%rsp), %rdi
	call	atof@PLT
	movq	40(%rsp), %rax
	movq	8(%rsp), %rdi
	movsd	%xmm0, (%rax,%rbx,8)
	call	atof@PLT
	movq	8(%rsp), %rdx
	movq	16(%rsp), %rdi
	xorl	%eax, %eax
	movsd	%xmm0, 0(%rbp,%rbx,8)
	leaq	.LC2(%rip), %rsi
	call	__isoc23_fscanf@PLT
	movq	8(%rsp), %rdi
	call	atof@PLT
	movq	48(%rsp), %rax
	movsd	%xmm0, (%rax,%rbx,8)
	incq	%rbx
	jmp	.L16
.L27:
	movq	16(%rsp), %rdi
	movl	$4194305, %ebp
	xorl	%ebx, %ebx
	salq	$10, %rbp
	call	fclose@PLT
	movq	(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$1, %ecx
	movq	72(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	80(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	88(%rsp), %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	40(%rsp), %rsi
	movl	$1, %ecx
	movq	96(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	48(%rsp), %rsi
	movl	$1, %ecx
	movq	104(%rsp), %rdi
	call	cudaMemcpy@PLT
	call	clock@PLT
	movl	$1, 156(%rsp)
	movl	$1, 168(%rsp)
	movq	%rax, %r14
	movabsq	$137438953504, %rax
	movq	%rax, 148(%rsp)
	movq	%rax, 160(%rsp)
.L21:
	movl	168(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	160(%rsp), %rdx
	movq	148(%rsp), %rdi
	movl	156(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	movq	104(%rsp), %r8
	movq	96(%rsp), %rcx
	movq	88(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z35__device_stub__Z8asteroidPdS_S_S_S_PdS_S_S_S_
.L18:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rbp, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L19
	movq	104(%rsp), %r8
	movq	96(%rsp), %rcx
	movq	88(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z36__device_stub__Z9positionsPdS_S_S_S_PdS_S_S_S_
.L19:
	movl	%ebx, %eax
	movl	$50, %ecx
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	.L20
	movl	$1000, %ecx
	movl	%ebx, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
.L20:
	incl	%ebx
	cmpl	$1001, %ebx
	jne	.L21
	call	clock@PLT
	movq	(%rsp), %rdx
	movq	72(%rsp), %rsi
	xorl	%ebx, %ebx
	movq	24(%rsp), %rdi
	movl	$2, %ecx
	movq	%rax, %rbp
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	80(%rsp), %rsi
	movl	$2, %ecx
	movq	32(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	%r15, %rdi
	movl	$2, %ecx
	leaq	.LC9(%rip), %r15
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	96(%rsp), %rsi
	movl	$2, %ecx
	movq	40(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	(%rsp), %rdx
	movq	104(%rsp), %rsi
	movl	$2, %ecx
	movq	48(%rsp), %rdi
	call	cudaMemcpy@PLT
	leaq	.LC5(%rip), %rsi
	leaq	.LC6(%rip), %rdi
	call	fopen@PLT
	leaq	.LC7(%rip), %rdx
	movl	$2, %esi
	movq	%rax, %rdi
	movq	%rax, (%rsp)
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	(%rsp), %rdi
	movl	$2, %esi
	xorl	%eax, %eax
	leaq	.LC8(%rip), %rdx
	call	__fprintf_chk@PLT
.L22:
	movl	%ebx, %ecx
	cmpl	%ebx, 56(%rsp)
	jle	.L28
	movq	24(%rsp), %rax
	movsd	(%r12,%rbx,8), %xmm2
	movl	%ecx, 60(%rsp)
	movsd	0(%r13,%rbx,8), %xmm3
	movsd	(%rax,%rbx,8), %xmm5
	movq	32(%rsp), %rax
	movaps	%xmm2, %xmm4
	movsd	%xmm2, 48(%rsp)
	movaps	%xmm3, %xmm0
	movsd	%xmm3, 40(%rsp)
	movsd	(%rax,%rbx,8), %xmm1
	subsd	%xmm5, %xmm4
	movsd	%xmm5, 8(%rsp)
	incq	%rbx
	subsd	%xmm1, %xmm0
	movsd	%xmm1, 16(%rsp)
	mulsd	%xmm4, %xmm4
	mulsd	%xmm0, %xmm0
	addsd	%xmm4, %xmm0
	call	sqrt@PLT
	movsd	40(%rsp), %xmm3
	movq	%r15, %rdx
	movb	$5, %al
	movaps	%xmm0, %xmm4
	movl	60(%rsp), %ecx
	movq	(%rsp), %rdi
	movl	$2, %esi
	movsd	48(%rsp), %xmm2
	movsd	16(%rsp), %xmm1
	movsd	8(%rsp), %xmm0
	call	__fprintf_chk@PLT
	jmp	.L22
.L28:
	pushq	%rax
	.cfi_def_cfa_offset 376
	xorl	%r8d, %r8d
	movl	$16, %r9d
	movl	$1000, %ecx
	pushq	$40
	.cfi_def_cfa_offset 384
	movq	16(%rsp), %rdi
	leaq	.LC10(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	subq	%r14, %rbp
	call	__fprintf_chk@PLT
	popq	%rdx
	.cfi_def_cfa_offset 376
	popq	%rcx
	.cfi_def_cfa_offset 368
	leaq	.LC12(%rip), %rdx
	movq	(%rsp), %rdi
	movl	$2, %esi
	cvtsi2sdq	%rbp, %xmm0
	movb	$1, %al
	divsd	.LC11(%rip), %xmm0
	call	__fprintf_chk@PLT
	movq	(%rsp), %rdi
	call	fclose@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	96(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	128(%rsp), %rdi
	call	cudaFree@PLT
	movq	136(%rsp), %rdi
	call	cudaFree@PLT
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	addq	$312, %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
.LFE2028:
	.size	main, .-main
	.section	.rodata.str1.1
.LC13:
	.string	"_Z9positionsPdS_S_S_S_"
.LC14:
	.string	"_Z8asteroidPdS_S_S_S_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2058:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC13(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z9positionsPdS_S_S_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC14(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z8asteroidPdS_S_S_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2058:
	.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
.LC11:
	.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 <hip/hip_runtime.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define MAX_CHAR 100
#define DATAFILE "data.txt"
#define RESULTSFILE "resultsCudal.txt"
#define G 6.674e-11
#define NUM_ITER 1000
#define NUM_ITER_SHOW 50

__device__ double atomicAddD(double* address, double val)
{
	unsigned long long int* address_as_ull =
		(unsigned long long int*)address;
	unsigned long long int old = *address_as_ull, assumed;
	do {
		assumed = old;
		old = atomicCAS(address_as_ull, assumed,
		                __double_as_longlong(val +
		                                     __longlong_as_double(assumed)));
	} while (assumed != old);
	return __longlong_as_double(old);
}

__global__ void asteroid(double * gpu_x, double * gpu_y, double * gpu_vx, double * gpu_vy, double * gpu_m){
	int posx = blockIdx.x * blockDim.x + threadIdx.x;
	int posy = blockIdx.y * blockDim.y + threadIdx.y;

	if (posx!=posy) {
		double d = sqrt(pow( (gpu_x[posx]-gpu_x[posy]),2.0) + pow( (gpu_y[posx]-gpu_y[posy]),2.0));
		double f = G*gpu_m[posx]*gpu_m[posy]/pow(d,2.0);
		double fx = f*(gpu_x[posy]-gpu_x[posx])/d;
		double fy = f*(gpu_y[posy]-gpu_y[posx])/d;
		double ax = fx/gpu_m[posx];
		double ay = fy/gpu_m[posx];
		// atomicAddD(gpu_vx+posx, ax);
		// atomicAddD(gpu_vy+posx, ay);
		atomicAddD(&gpu_vx[posx], ax);
		atomicAddD(&gpu_vy[posx], ay);
	}
}

__global__ void positions(double * gpu_x, double * gpu_y, double * gpu_vx, double * gpu_vy, double * gpu_m){
	int i = blockIdx.x * blockIdx.x + threadIdx.x;
	// gpu_x[i] += gpu_vx[i];
	// gpu_y[i] += gpu_vy[i];
	atomicAddD(&gpu_x[i], gpu_vx[i]);
	atomicAddD(&gpu_y[i], gpu_vy[i]);
}

int main(){

	clock_t start, end;
	double time_used;
	char str[MAX_CHAR];
	FILE *file;
	int noOfObjects;
	int i;

	file = fopen( DATAFILE, "r");
	fscanf(file,"%s",str);
	noOfObjects = atoi(str);
	printf("Number of objects: %d\n",noOfObjects);

	const int ARRAY_BYTES = noOfObjects * sizeof(double);

	double *x = (double *) malloc(ARRAY_BYTES);
	double *y = (double *) malloc(ARRAY_BYTES);
	double *vx = (double *) malloc(ARRAY_BYTES);
	double *vy = (double *) malloc(ARRAY_BYTES);
	double *m = (double *) malloc(ARRAY_BYTES);

	double *x_new = (double *) malloc(ARRAY_BYTES);
	double *y_new = (double *) malloc(ARRAY_BYTES);
	double *vx_new = (double *) malloc(ARRAY_BYTES);
	double *vy_new = (double *) malloc(ARRAY_BYTES);

	// declare GPU memory pointers
	double * gpu_x;
	double * gpu_y;
	double * gpu_vx;
	double * gpu_vy;
	double * gpu_m;
	double * gpu_x_new;
	double * gpu_y_new;
	double * gpu_vx_new;
	double * gpu_vy_new;

	// allocate GPU memory
	hipMalloc((void**) &gpu_x, ARRAY_BYTES);
	hipMalloc((void**) &gpu_y, ARRAY_BYTES);
	hipMalloc((void**) &gpu_vx, ARRAY_BYTES);
	hipMalloc((void**) &gpu_vy, ARRAY_BYTES);
	hipMalloc((void**) &gpu_m, ARRAY_BYTES);
	hipMalloc((void**) &gpu_x_new, ARRAY_BYTES);
	hipMalloc((void**) &gpu_y_new, ARRAY_BYTES);
	hipMalloc((void**) &gpu_vx_new, ARRAY_BYTES);
	hipMalloc((void**) &gpu_vy_new, ARRAY_BYTES);

	// launch the kernel
	for (i=0; i < noOfObjects; i++) {
		fscanf(file,"%s",str);
		x[i] = atof(str);
		x_new[i] = atof(str);
		fscanf(file,"%s",str);
		y[i] = atof(str);
		y_new[i] = atof(str);
		fscanf(file,"%s",str);
		vx[i] = atof(str);
		vx_new[i] = atof(str);
		fscanf(file,"%s",str);
		vy[i] = atof(str);
		vy_new[i] = atof(str);
		fscanf(file,"%s",str);
		m[i] = atof(str);
	}
	fclose(file);

	// transfer the array to the GPU
	hipMemcpy(gpu_x, x, ARRAY_BYTES, hipMemcpyHostToDevice);
	hipMemcpy(gpu_y, y, ARRAY_BYTES, hipMemcpyHostToDevice);
	hipMemcpy(gpu_vx, vx, ARRAY_BYTES, hipMemcpyHostToDevice);
	hipMemcpy(gpu_vy, vy, ARRAY_BYTES, hipMemcpyHostToDevice);
	hipMemcpy(gpu_m, m, ARRAY_BYTES, hipMemcpyHostToDevice);

	start=clock();

	dim3 blocksPerGrid(32,32);              // blocks per grid
	dim3 threadsPerBlock(32,32);            // threads per block

	for (int niter=0; niter<=NUM_ITER; niter++) {

		asteroid<<<blocksPerGrid, threadsPerBlock>>>(gpu_x, gpu_y, gpu_vx, gpu_vy, gpu_m);
		positions<<<1, 1024>>>(gpu_x, gpu_y, gpu_vx, gpu_vy, gpu_m);

		if (niter%NUM_ITER_SHOW == 0)
			printf("Iteration %d/%d\n", niter, NUM_ITER);

	}  // nIter
	end=clock();

	// copy back the result array to the CPU
	hipMemcpy(x, gpu_x, ARRAY_BYTES, hipMemcpyDeviceToHost);
	hipMemcpy(y, gpu_y, ARRAY_BYTES, hipMemcpyDeviceToHost);
	hipMemcpy(vx, gpu_vx, ARRAY_BYTES, hipMemcpyDeviceToHost);
	hipMemcpy(vy, gpu_vy, ARRAY_BYTES, hipMemcpyDeviceToHost);
	hipMemcpy(m, gpu_m, ARRAY_BYTES, hipMemcpyDeviceToHost);

	file = fopen( RESULTSFILE, "w");
	fprintf(file, "Movement of objects\n");
	fprintf(file, "-------------------\n");
	for (i = 0; i < noOfObjects; i++) {
		double mov = sqrt(pow( (x_new[i]-x[i]),2.0) + pow( (y_new[i]-y[i]),2.0));
		// printf("  Object %i  - ORIGINAL: (%f,%f) -- NEW: (%f,%f) -> %f meters\n", i, x[i], y[i], x_new[i], y_new[i], mov);
		fprintf(file,"  Object %i  - ORIGINAL: (%f,%f) -- NEW: (%f,%f) -> %f meters\n", i, x[i], y[i], x_new[i], y_new[i], mov);

	}
	int hours = NUM_ITER/3600;
	int mins = (NUM_ITER - hours*3600)/60;
	int secs = (NUM_ITER - hours*3600 - mins*60);
	fprintf(file,"Time elapsed: %i seconds (%i hours, %i minutes, %i seconds)\n",NUM_ITER, hours, mins, secs);

	time_used = ((double)(end-start)) / CLOCKS_PER_SEC;
	fprintf(file,"Processing time: %f sec.\n",time_used);
	fclose(file);

	hipFree(gpu_x);
	hipFree(gpu_y);
	hipFree(gpu_vx);
	hipFree(gpu_vy);
	hipFree(gpu_m);

	hipFree(gpu_x_new);
	hipFree(gpu_y_new);
	hipFree(gpu_vx_new);
	hipFree(gpu_vy_new);

}  // main

	.text
	.file	"SimulateAsteroidsParallel.hip"
	.globl	_Z23__device_stub__asteroidPdS_S_S_S_ # -- Begin function _Z23__device_stub__asteroidPdS_S_S_S_
	.type	_Z23__device_stub__asteroidPdS_S_S_S_,@function
_Z23__device_stub__asteroidPdS_S_S_S_:  # @_Z23__device_stub__asteroidPdS_S_S_S_
	.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	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%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	$_Z8asteroidPdS_S_S_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	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__asteroidPdS_S_S_S_, .Lfunc_end0-_Z23__device_stub__asteroidPdS_S_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__positionsPdS_S_S_S_ # -- Begin function _Z24__device_stub__positionsPdS_S_S_S_
	.type	_Z24__device_stub__positionsPdS_S_S_S_,@function
_Z24__device_stub__positionsPdS_S_S_S_: # @_Z24__device_stub__positionsPdS_S_S_S_
	.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	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%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	$_Z9positionsPdS_S_S_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z24__device_stub__positionsPdS_S_S_S_, .Lfunc_end1-_Z24__device_stub__positionsPdS_S_S_S_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI2_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.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	$280, %rsp                      # imm = 0x118
	.cfi_def_cfa_offset 336
	.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	$.L.str, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	movq	%rax, %r12
	leaq	176(%rsp), %rbx
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movq	%rbx, %rdi
	callq	atoi
	movl	%eax, %ebx
	movl	$.L.str.3, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	printf
	leal	(,%rbx,8), %eax
	movslq	%eax, %r14
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, %r15
	leaq	40(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	32(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	24(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	168(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	160(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	152(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	144(%rsp), %rdi
	movq	%r14, 80(%rsp)                  # 8-byte Spill
	movq	%r14, %rsi
	callq	hipMalloc
	movl	%ebx, %ebp
	movq	%rbx, 128(%rsp)                 # 8-byte Spill
	testl	%ebx, %ebx
	jle	.LBB2_3
# %bb.1:                                # %.lr.ph.preheader
	leaq	176(%rsp), %rbx
	xorl	%r14d, %r14d
.LBB2_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	$.L.str.2, %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movq	%rbx, %rdi
	callq	atof
	movq	48(%rsp), %rax                  # 8-byte Reload
	movsd	%xmm0, (%rax,%r14,8)
	movq	%rbx, %rdi
	callq	atof
	movsd	%xmm0, (%r13,%r14,8)
	movl	$.L.str.2, %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movq	%rbx, %rdi
	callq	atof
	movq	72(%rsp), %rax                  # 8-byte Reload
	movsd	%xmm0, (%rax,%r14,8)
	movq	%rbx, %rdi
	callq	atof
	movsd	%xmm0, (%r15,%r14,8)
	movl	$.L.str.2, %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movq	%rbx, %rdi
	callq	atof
	movq	56(%rsp), %rax                  # 8-byte Reload
	movsd	%xmm0, (%rax,%r14,8)
	movl	$.L.str.2, %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movq	%rbx, %rdi
	callq	atof
	movq	64(%rsp), %rax                  # 8-byte Reload
	movsd	%xmm0, (%rax,%r14,8)
	movl	$.L.str.2, %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	movq	%rbx, %rdi
	callq	atof
	movq	88(%rsp), %rax                  # 8-byte Reload
	movsd	%xmm0, (%rax,%r14,8)
	incq	%r14
	cmpq	%r14, %rbp
	jne	.LBB2_2
.LBB2_3:                                # %._crit_edge
	movq	%rbp, 120(%rsp)                 # 8-byte Spill
	movq	%r15, 112(%rsp)                 # 8-byte Spill
	movq	%r13, 136(%rsp)                 # 8-byte Spill
	movabsq	$137438953504, %rbp             # imm = 0x2000000020
	movabsq	$4294967297, %rbx               # imm = 0x100000001
	movq	%r12, %rdi
	callq	fclose
	movq	40(%rsp), %rdi
	movq	48(%rsp), %rsi                  # 8-byte Reload
	movq	80(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rdi
	movq	72(%rsp), %rsi                  # 8-byte Reload
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	24(%rsp), %rdi
	movq	56(%rsp), %rsi                  # 8-byte Reload
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	16(%rsp), %rdi
	movq	64(%rsp), %rsi                  # 8-byte Reload
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rdi
	movq	88(%rsp), %rsi                  # 8-byte Reload
	movq	%rsi, %r15
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	callq	clock
	movq	%rax, 104(%rsp)                 # 8-byte Spill
	movl	$65535, %r13d                   # imm = 0xFFFF
	leaq	1023(%rbx), %r12
	xorl	%r14d, %r14d
.LBB2_4:                                # =>This Inner Loop Header: Depth=1
	movq	%rbp, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_6
# %bb.5:                                #   in Loop: Header=BB2_4 Depth=1
	movq	40(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rcx
	movq	8(%rsp), %r8
	callq	_Z23__device_stub__asteroidPdS_S_S_S_
.LBB2_6:                                #   in Loop: Header=BB2_4 Depth=1
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_8
# %bb.7:                                #   in Loop: Header=BB2_4 Depth=1
	movq	40(%rsp), %rdi
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rcx
	movq	8(%rsp), %r8
	callq	_Z24__device_stub__positionsPdS_S_S_S_
.LBB2_8:                                #   in Loop: Header=BB2_4 Depth=1
	movl	%r14d, %eax
	andl	%r13d, %eax
	shrl	%eax
	imull	$5243, %eax, %eax               # imm = 0x147B
	shrl	$17, %eax
	imull	$-50, %eax, %eax
	andl	%r13d, %eax
	addw	%r14w, %ax
	jne	.LBB2_10
# %bb.9:                                #   in Loop: Header=BB2_4 Depth=1
	movl	$.L.str.4, %edi
	movl	%r14d, %esi
	movl	$1000, %edx                     # imm = 0x3E8
	xorl	%eax, %eax
	callq	printf
.LBB2_10:                               #   in Loop: Header=BB2_4 Depth=1
	incl	%r14d
	cmpl	$1001, %r14d                    # imm = 0x3E9
	jne	.LBB2_4
# %bb.11:
	callq	clock
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	movq	40(%rsp), %rsi
	movq	48(%rsp), %rdi                  # 8-byte Reload
	movq	80(%rsp), %rbx                  # 8-byte Reload
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rsi
	movq	72(%rsp), %rbp                  # 8-byte Reload
	movq	%rbp, %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	24(%rsp), %rsi
	movq	56(%rsp), %rdi                  # 8-byte Reload
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	16(%rsp), %rsi
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$.L.str.5, %edi
	movl	$.L.str.6, %esi
	callq	fopen
	movq	%rax, %r12
	movl	$.L.str.7, %edi
	movl	$20, %esi
	movl	$1, %edx
	movq	%rax, %rcx
	callq	fwrite@PLT
	movl	$.L.str.8, %edi
	movl	$20, %esi
	movl	$1, %edx
	movq	%r12, %rcx
	callq	fwrite@PLT
	cmpl	$0, 128(%rsp)                   # 4-byte Folded Reload
	movq	136(%rsp), %rbx                 # 8-byte Reload
	movq	112(%rsp), %r15                 # 8-byte Reload
	movq	120(%rsp), %r13                 # 8-byte Reload
	jle	.LBB2_14
# %bb.12:                               # %.lr.ph132.preheader
	xorl	%r14d, %r14d
.LBB2_13:                               # %.lr.ph132
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rbx,%r14,8), %xmm2            # xmm2 = mem[0],zero
	movq	48(%rsp), %rax                  # 8-byte Reload
	movsd	(%rax,%r14,8), %xmm0            # xmm0 = mem[0],zero
	movapd	%xmm2, %xmm4
	subsd	%xmm0, %xmm4
	mulsd	%xmm4, %xmm4
	movsd	(%r15,%r14,8), %xmm3            # xmm3 = mem[0],zero
	movsd	(%rbp,%r14,8), %xmm1            # xmm1 = mem[0],zero
	movapd	%xmm3, %xmm5
	subsd	%xmm1, %xmm5
	mulsd	%xmm5, %xmm5
	addsd	%xmm4, %xmm5
	xorps	%xmm4, %xmm4
	sqrtsd	%xmm5, %xmm4
	movl	$.L.str.9, %esi
	movq	%r12, %rdi
	movl	%r14d, %edx
	movb	$5, %al
	callq	fprintf
	incq	%r14
	cmpq	%r14, %r13
	jne	.LBB2_13
.LBB2_14:                               # %._crit_edge133
	movl	$.L.str.10, %esi
	movq	%r12, %rdi
	movl	$1000, %edx                     # imm = 0x3E8
	xorl	%ecx, %ecx
	movl	$16, %r8d
	movl	$40, %r9d
	xorl	%eax, %eax
	callq	fprintf
	movq	96(%rsp), %rax                  # 8-byte Reload
	subq	104(%rsp), %rax                 # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI2_0(%rip), %xmm0
	movl	$.L.str.11, %esi
	movq	%r12, %rdi
	movb	$1, %al
	callq	fprintf
	movq	%r12, %rdi
	callq	fclose
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	168(%rsp), %rdi
	callq	hipFree
	movq	160(%rsp), %rdi
	callq	hipFree
	movq	152(%rsp), %rdi
	callq	hipFree
	movq	144(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$280, %rsp                      # imm = 0x118
	.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_end2:
	.size	main, .Lfunc_end2-main
	.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:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z8asteroidPdS_S_S_S_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9positionsPdS_S_S_S_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_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	_Z8asteroidPdS_S_S_S_,@object   # @_Z8asteroidPdS_S_S_S_
	.section	.rodata,"a",@progbits
	.globl	_Z8asteroidPdS_S_S_S_
	.p2align	3, 0x0
_Z8asteroidPdS_S_S_S_:
	.quad	_Z23__device_stub__asteroidPdS_S_S_S_
	.size	_Z8asteroidPdS_S_S_S_, 8

	.type	_Z9positionsPdS_S_S_S_,@object  # @_Z9positionsPdS_S_S_S_
	.globl	_Z9positionsPdS_S_S_S_
	.p2align	3, 0x0
_Z9positionsPdS_S_S_S_:
	.quad	_Z24__device_stub__positionsPdS_S_S_S_
	.size	_Z9positionsPdS_S_S_S_, 8

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

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%s"
	.size	.L.str.2, 3

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Number of objects: %d\n"
	.size	.L.str.3, 23

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Iteration %d/%d\n"
	.size	.L.str.4, 17

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"resultsCudal.txt"
	.size	.L.str.5, 17

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

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Movement of objects\n"
	.size	.L.str.7, 21

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"-------------------\n"
	.size	.L.str.8, 21

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"  Object %i  - ORIGINAL: (%f,%f) -- NEW: (%f,%f) -> %f meters\n"
	.size	.L.str.9, 63

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Time elapsed: %i seconds (%i hours, %i minutes, %i seconds)\n"
	.size	.L.str.10, 61

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Processing time: %f sec.\n"
	.size	.L.str.11, 26

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

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z9positionsPdS_S_S_S_"
	.size	.L__unnamed_2, 23

	.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__asteroidPdS_S_S_S_
	.addrsig_sym _Z24__device_stub__positionsPdS_S_S_S_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z8asteroidPdS_S_S_S_
	.addrsig_sym _Z9positionsPdS_S_S_S_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z8asteroidPdS_S_S_S_   ; -- Begin function _Z8asteroidPdS_S_S_S_
	.globl	_Z8asteroidPdS_S_S_S_
	.p2align	8
	.type	_Z8asteroidPdS_S_S_S_,@function
_Z8asteroidPdS_S_S_S_:                  ; @_Z8asteroidPdS_S_S_S_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x34
	v_and_b32_e32 v1, 0x3ff, v0
	v_bfe_u32 v4, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s14, s2, v[1:2]
	v_mad_u64_u32 v[0:1], null, s15, s3, v[4:5]
	s_mov_b32 s2, exec_lo
	v_cmpx_ne_u32_e64 v2, v0
	s_cbranch_execz .LBB0_5
; %bb.1:
	s_load_b256 s[8:15], s[0:1], 0x0
	v_ashrrev_i32_e32 v3, 31, v2
	v_ashrrev_i32_e32 v1, 31, v0
	s_mov_b32 s16, 0x968915a9
	s_mov_b32 s18, 0x4222de17
	s_mov_b32 s17, 0x3fba6564
	v_lshlrev_b64 v[4:5], 3, v[2:3]
	v_lshlrev_b64 v[6:7], 3, v[0:1]
	s_mov_b32 s19, 0x3fbdee67
	s_mov_b32 s20, 0x3abe935a
	s_mov_b32 s21, 0x3fbe25e4
	s_mov_b32 s22, 0x47e6c9c2
	s_mov_b32 s23, 0x3fc110ef
	s_mov_b32 s24, 0xcfa74449
	s_mov_b32 s25, 0x3fc3b13b
	s_mov_b32 s26, 0x71bf3c30
	s_mov_b32 s27, 0x3fc745d1
	s_mov_b32 s28, 0x1c7792ce
	s_mov_b32 s29, 0x3fcc71c7
	s_mov_b32 s30, 0x924920da
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s8, v4
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v5, vcc_lo
	v_add_co_u32 v2, vcc_lo, s8, v6
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v7, vcc_lo
	v_add_co_u32 v8, vcc_lo, s10, v4
	s_clause 0x1
	global_load_b64 v[0:1], v[0:1], off
	global_load_b64 v[2:3], v[2:3], off
	v_add_co_ci_u32_e32 v9, vcc_lo, s11, v5, vcc_lo
	v_add_co_u32 v10, vcc_lo, s10, v6
	v_add_co_ci_u32_e32 v11, vcc_lo, s11, v7, vcc_lo
	s_clause 0x1
	global_load_b64 v[8:9], v[8:9], off
	global_load_b64 v[10:11], v[10:11], off
	s_mov_b32 s10, 0x55555555
	s_mov_b32 s11, 0x3fe55555
	s_mov_b32 s31, 0x3fd24924
	s_mov_b32 s34, 0x9999999c
	s_mov_b32 s35, 0x3fd99999
	s_mov_b32 s37, 0xbfe55555
	s_mov_b32 s36, s10
	s_mov_b32 s38, 0xd5df274d
	s_mov_b32 s39, 0x3c8543b0
	s_mov_b32 s40, 0xfefa39ef
	s_mov_b32 s41, 0x3fe62e42
	s_mov_b32 s42, 0x3b39803f
	s_mov_b32 s43, 0x3c7abc9e
	s_mov_b32 s44, 0x652b82fe
	s_mov_b32 s45, 0x3ff71547
	s_mov_b32 s47, 0xbfe62e42
	s_mov_b32 s46, s40
	s_mov_b32 s49, 0xbc7abc9e
	s_mov_b32 s48, s42
	s_mov_b32 s50, 0xfca7ab0c
	s_mov_b32 s52, 0x6a5dcb37
	s_mov_b32 s51, 0x3e928af3
	s_mov_b32 s53, 0x3e5ade15
	s_mov_b32 s54, 0x623fde64
	s_mov_b32 s55, 0x3ec71dee
	s_mov_b32 s56, 0x7c89e6b0
	s_mov_b32 s57, 0x3efa0199
	s_mov_b32 s58, 0x14761f6e
	s_mov_b32 s59, 0x3f2a01a0
	s_mov_b32 s62, 0x1852b7b0
	s_mov_b32 s63, 0x3f56c16c
	s_mov_b32 s66, 0x11122322
	s_mov_b32 s67, 0x3f811111
	s_mov_b32 s64, 0x555502a1
	s_mov_b32 s65, 0x3fa55555
	s_mov_b32 s60, 0x55555511
	s_mov_b32 s61, 0x3fc55555
	s_mov_b32 s68, 11
	s_mov_b32 s69, 0x3fe00000
	s_load_b64 s[0:1], s[0:1], 0x20
	s_waitcnt vmcnt(2)
	v_add_f64 v[12:13], v[0:1], -v[2:3]
	v_add_f64 v[0:1], v[2:3], -v[0:1]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_frexp_mant_f64_e64 v[14:15], |v[12:13]|
	v_cmp_gt_f64_e32 vcc_lo, s[10:11], v[14:15]
	v_cndmask_b32_e64 v16, 0, 1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_ldexp_f64 v[14:15], v[14:15], v16
	s_waitcnt vmcnt(0)
	v_add_f64 v[16:17], v[8:9], -v[10:11]
	v_add_f64 v[18:19], v[14:15], 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_frexp_mant_f64_e64 v[20:21], |v[16:17]|
	v_add_f64 v[32:33], v[14:15], -1.0
	v_rcp_f64_e32 v[22:23], v[18:19]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_gt_f64_e64 s2, s[10:11], v[20:21]
	v_add_f64 v[34:35], v[18:19], -1.0
	v_cndmask_b32_e64 v24, 0, 1, s2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[14:15], v[14:15], -v[34:35]
	v_ldexp_f64 v[20:21], v[20:21], v24
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[24:25], -v[18:19], v[22:23], 1.0
	v_add_f64 v[26:27], v[20:21], 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fma_f64 v[22:23], v[24:25], v[22:23], v[22:23]
	v_add_f64 v[38:39], v[20:21], -1.0
	v_rcp_f64_e32 v[24:25], v[26:27]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[28:29], -v[18:19], v[22:23], 1.0
	v_fma_f64 v[22:23], v[28:29], v[22:23], v[22:23]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[30:31], -v[26:27], v[24:25], 1.0
	v_mul_f64 v[28:29], v[32:33], v[22:23]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[24:25], v[30:31], v[24:25], v[24:25]
	v_mul_f64 v[36:37], v[18:19], v[28:29]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[30:31], -v[26:27], v[24:25], 1.0
	v_fma_f64 v[18:19], v[28:29], v[18:19], -v[36:37]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[24:25], v[30:31], v[24:25], v[24:25]
	v_fma_f64 v[14:15], v[28:29], v[14:15], v[18:19]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_f64 v[30:31], v[38:39], v[24:25]
	v_add_f64 v[18:19], v[26:27], -1.0
	v_add_f64 v[40:41], v[36:37], v[14:15]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_f64 v[34:35], v[26:27], v[30:31]
	v_add_f64 v[18:19], v[20:21], -v[18:19]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fma_f64 v[20:21], v[30:31], v[26:27], -v[34:35]
	v_add_f64 v[26:27], v[32:33], -v[40:41]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fma_f64 v[18:19], v[30:31], v[18:19], v[20:21]
	v_add_f64 v[20:21], v[40:41], -v[36:37]
	v_add_f64 v[32:33], v[32:33], -v[26:27]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[36:37], v[34:35], v[18:19]
	v_add_f64 v[14:15], v[20:21], -v[14:15]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[20:21], v[32:33], -v[40:41]
	v_add_f64 v[32:33], v[38:39], -v[36:37]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_add_f64 v[14:15], v[14:15], v[20:21]
	v_add_f64 v[20:21], v[36:37], -v[34:35]
	v_add_f64 v[34:35], v[38:39], -v[32:33]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[14:15], v[26:27], v[14:15]
	v_add_f64 v[18:19], v[20:21], -v[18:19]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[20:21], v[34:35], -v[36:37]
	v_mul_f64 v[14:15], v[22:23], v[14:15]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[18:19], v[18:19], v[20:21]
	v_add_f64 v[20:21], v[28:29], v[14:15]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[18:19], v[32:33], v[18:19]
	v_add_f64 v[22:23], v[20:21], -v[28:29]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_f64 v[18:19], v[24:25], v[18:19]
	v_mul_f64 v[24:25], v[20:21], v[20:21]
	v_add_f64 v[14:15], v[14:15], -v[22:23]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[22:23], v[30:31], v[18:19]
	v_fma_f64 v[26:27], v[20:21], v[20:21], -v[24:25]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[28:29], v[14:15], v[14:15]
	v_add_f64 v[30:31], v[22:23], -v[30:31]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fma_f64 v[26:27], v[20:21], v[28:29], v[26:27]
	v_mul_f64 v[28:29], v[22:23], v[22:23]
	v_add_f64 v[18:19], v[18:19], -v[30:31]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[30:31], v[24:25], v[26:27]
	v_fma_f64 v[32:33], v[22:23], v[22:23], -v[28:29]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[34:35], v[18:19], v[18:19]
	v_fma_f64 v[36:37], v[30:31], s[18:19], s[16:17]
	v_add_f64 v[24:25], v[30:31], -v[24:25]
	v_mul_f64 v[46:47], v[20:21], v[30:31]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fma_f64 v[32:33], v[22:23], v[34:35], v[32:33]
	v_fma_f64 v[34:35], v[30:31], v[36:37], s[20:21]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[24:25], v[26:27], -v[24:25]
	v_add_f64 v[36:37], v[28:29], v[32:33]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[34:35], v[30:31], v[34:35], s[22:23]
	v_fma_f64 v[38:39], v[36:37], s[18:19], s[16:17]
	v_add_f64 v[28:29], v[36:37], -v[28:29]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[34:35], v[30:31], v[34:35], s[24:25]
	v_fma_f64 v[38:39], v[36:37], v[38:39], s[20:21]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[28:29], v[32:33], -v[28:29]
	v_fma_f64 v[34:35], v[30:31], v[34:35], s[26:27]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[38:39], v[36:37], v[38:39], s[22:23]
	v_fma_f64 v[34:35], v[30:31], v[34:35], s[28:29]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[38:39], v[36:37], v[38:39], s[24:25]
	v_fma_f64 v[34:35], v[30:31], v[34:35], s[30:31]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[38:39], v[36:37], v[38:39], s[26:27]
	v_fma_f64 v[34:35], v[30:31], v[34:35], s[34:35]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[38:39], v[36:37], v[38:39], s[28:29]
	v_mul_f64 v[40:41], v[30:31], v[34:35]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[38:39], v[36:37], v[38:39], s[30:31]
	v_fma_f64 v[26:27], v[30:31], v[34:35], -v[40:41]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[38:39], v[36:37], v[38:39], s[34:35]
	v_fma_f64 v[26:27], v[24:25], v[34:35], v[26:27]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[34:35], v[36:37], v[38:39]
	v_add_f64 v[42:43], v[40:41], v[26:27]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[32:33], v[36:37], v[38:39], -v[34:35]
	v_add_f64 v[44:45], v[42:43], s[10:11]
	v_add_f64 v[40:41], v[42:43], -v[40:41]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[32:33], v[28:29], v[38:39], v[32:33]
	v_add_f64 v[38:39], v[44:45], s[36:37]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_add_f64 v[26:27], v[26:27], -v[40:41]
	v_fma_f64 v[40:41], v[30:31], v[20:21], -v[46:47]
	v_add_f64 v[48:49], v[34:35], v[32:33]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f64 v[38:39], v[42:43], -v[38:39]
	v_add_f64 v[26:27], v[26:27], s[38:39]
	s_delay_alu instid0(VALU_DEP_4)
	v_fma_f64 v[30:31], v[30:31], v[14:15], v[40:41]
	v_mul_f64 v[42:43], v[22:23], v[36:37]
	v_ldexp_f64 v[14:15], v[14:15], 1
	v_add_f64 v[40:41], v[48:49], s[10:11]
	v_add_f64 v[34:35], v[48:49], -v[34:35]
	v_add_f64 v[26:27], v[26:27], v[38:39]
	v_fma_f64 v[24:25], v[24:25], v[20:21], v[30:31]
	v_ldexp_f64 v[20:21], v[20:21], 1
	v_add_f64 v[30:31], v[40:41], s[36:37]
	v_add_f64 v[32:33], v[32:33], -v[34:35]
	v_fma_f64 v[34:35], v[36:37], v[22:23], -v[42:43]
	v_add_f64 v[38:39], v[44:45], v[26:27]
	v_add_f64 v[50:51], v[46:47], v[24:25]
	v_add_f64 v[30:31], v[48:49], -v[30:31]
	v_add_f64 v[32:33], v[32:33], s[38:39]
	v_fma_f64 v[34:35], v[36:37], v[18:19], v[34:35]
	v_add_f64 v[36:37], v[44:45], -v[38:39]
	v_mul_f64 v[44:45], v[50:51], v[38:39]
	v_ldexp_f64 v[18:19], v[18:19], 1
	v_add_f64 v[30:31], v[32:33], v[30:31]
	v_fma_f64 v[28:29], v[28:29], v[22:23], v[34:35]
	v_add_f64 v[32:33], v[50:51], -v[46:47]
	v_add_f64 v[26:27], v[26:27], v[36:37]
	v_fma_f64 v[34:35], v[50:51], v[38:39], -v[44:45]
	v_ldexp_f64 v[22:23], v[22:23], 1
	v_add_f64 v[36:37], v[40:41], v[30:31]
	v_add_f64 v[46:47], v[42:43], v[28:29]
	v_add_f64 v[24:25], v[24:25], -v[32:33]
	v_fma_f64 v[26:27], v[50:51], v[26:27], v[34:35]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f64 v[32:33], v[40:41], -v[36:37]
	v_mul_f64 v[34:35], v[46:47], v[36:37]
	v_frexp_exp_i32_f64_e32 v40, v[12:13]
	s_delay_alu instid0(VALU_DEP_4)
	v_fma_f64 v[24:25], v[24:25], v[38:39], v[26:27]
	v_add_f64 v[26:27], v[46:47], -v[42:43]
	v_frexp_exp_i32_f64_e32 v42, v[16:17]
	v_add_f64 v[30:31], v[30:31], v[32:33]
	v_fma_f64 v[32:33], v[46:47], v[36:37], -v[34:35]
	v_add_f64 v[38:39], v[44:45], v[24:25]
	v_add_f64 v[26:27], v[28:29], -v[26:27]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_fma_f64 v[28:29], v[46:47], v[30:31], v[32:33]
	v_subrev_co_ci_u32_e32 v30, vcc_lo, 0, v40, vcc_lo
	v_add_f64 v[32:33], v[20:21], v[38:39]
	v_add_f64 v[40:41], v[38:39], -v[44:45]
	v_subrev_co_ci_u32_e64 v42, vcc_lo, 0, v42, s2
	s_delay_alu instid0(VALU_DEP_4)
	v_cvt_f64_i32_e32 v[30:31], v30
	v_cmp_eq_f64_e32 vcc_lo, 1.0, v[12:13]
	v_cmp_eq_f64_e64 s2, 1.0, v[16:17]
	v_fma_f64 v[26:27], v[26:27], v[36:37], v[28:29]
	v_add_f64 v[20:21], v[32:33], -v[20:21]
	v_add_f64 v[24:25], v[24:25], -v[40:41]
	v_mul_f64 v[28:29], v[30:31], s[40:41]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f64 v[36:37], v[34:35], v[26:27]
	v_add_f64 v[20:21], v[38:39], -v[20:21]
	s_delay_alu instid0(VALU_DEP_4)
	v_add_f64 v[14:15], v[14:15], v[24:25]
	v_cvt_f64_i32_e32 v[24:25], v42
	v_fma_f64 v[40:41], v[30:31], s[40:41], -v[28:29]
	v_add_f64 v[38:39], v[22:23], v[36:37]
	v_add_f64 v[34:35], v[36:37], -v[34:35]
	v_add_f64 v[14:15], v[14:15], v[20:21]
	v_mul_f64 v[20:21], v[24:25], s[40:41]
	v_fma_f64 v[30:31], v[30:31], s[42:43], v[40:41]
	v_add_f64 v[22:23], v[38:39], -v[22:23]
	v_add_f64 v[26:27], v[26:27], -v[34:35]
	v_add_f64 v[40:41], v[32:33], v[14:15]
	v_fma_f64 v[42:43], v[24:25], s[40:41], -v[20:21]
	v_add_f64 v[34:35], v[28:29], v[30:31]
	v_add_f64 v[22:23], v[36:37], -v[22:23]
	v_add_f64 v[18:19], v[18:19], v[26:27]
	v_add_f64 v[32:33], v[40:41], -v[32:33]
	v_fma_f64 v[24:25], v[24:25], s[42:43], v[42:43]
	v_add_f64 v[26:27], v[34:35], v[40:41]
	v_add_f64 v[28:29], v[34:35], -v[28:29]
	v_add_f64 v[18:19], v[18:19], v[22:23]
	v_add_f64 v[14:15], v[14:15], -v[32:33]
	v_add_f64 v[36:37], v[20:21], v[24:25]
	v_add_f64 v[22:23], v[26:27], -v[34:35]
	v_add_f64 v[28:29], v[30:31], -v[28:29]
	v_add_f64 v[42:43], v[38:39], v[18:19]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f64 v[20:21], v[36:37], -v[20:21]
	v_add_f64 v[44:45], v[26:27], -v[22:23]
	v_add_f64 v[22:23], v[40:41], -v[22:23]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f64 v[46:47], v[36:37], v[42:43]
	v_add_f64 v[20:21], v[24:25], -v[20:21]
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_add_f64 v[30:31], v[34:35], -v[44:45]
	v_add_f64 v[34:35], v[28:29], v[14:15]
	v_add_f64 v[32:33], v[46:47], -v[36:37]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_add_f64 v[22:23], v[22:23], v[30:31]
	v_add_f64 v[30:31], v[42:43], -v[38:39]
	v_add_f64 v[40:41], v[34:35], -v[28:29]
	s_delay_alu instid0(VALU_DEP_4)
	v_add_f64 v[38:39], v[46:47], -v[32:33]
	v_add_f64 v[24:25], v[42:43], -v[32:33]
	v_add_f64 v[22:23], v[34:35], v[22:23]
	v_add_f64 v[18:19], v[18:19], -v[30:31]
	v_add_f64 v[32:33], v[34:35], -v[40:41]
	v_add_f64 v[14:15], v[14:15], -v[40:41]
	v_add_f64 v[30:31], v[36:37], -v[38:39]
	v_add_f64 v[34:35], v[26:27], v[22:23]
	v_add_f64 v[36:37], v[20:21], v[18:19]
	v_add_f64 v[28:29], v[28:29], -v[32:33]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f64 v[24:25], v[24:25], v[30:31]
	v_add_f64 v[26:27], v[34:35], -v[26:27]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f64 v[30:31], v[36:37], -v[20:21]
	v_add_f64 v[14:15], v[14:15], v[28:29]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f64 v[24:25], v[36:37], v[24:25]
	v_add_f64 v[22:23], v[22:23], -v[26:27]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[26:27], v[36:37], -v[30:31]
	v_add_f64 v[28:29], v[46:47], v[24:25]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_add_f64 v[22:23], v[14:15], v[22:23]
	v_add_f64 v[14:15], v[18:19], -v[30:31]
	v_add_f64 v[18:19], v[20:21], -v[26:27]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_f64 v[20:21], v[28:29], -v[46:47]
	v_add_f64 v[26:27], v[34:35], v[22:23]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_f64 v[18:19], v[14:15], v[18:19]
	v_mov_b32_e32 v14, 0
	v_cndmask_b32_e64 v15, 2.0, 0x3ff00000, vcc_lo
	v_mul_f64 v[32:33], v[14:15], 0.5
	v_add_f64 v[20:21], v[24:25], -v[20:21]
	v_add_f64 v[24:25], v[26:27], -v[34:35]
	v_mul_f64 v[30:31], v[14:15], v[26:27]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_add_f64 v[18:19], v[18:19], v[20:21]
	v_trunc_f64_e32 v[20:21], v[14:15]
	v_add_f64 v[22:23], v[22:23], -v[24:25]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fma_f64 v[24:25], v[14:15], v[26:27], -v[30:31]
	v_add_f64 v[26:27], v[28:29], v[18:19]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_eq_f64_e32 vcc_lo, v[20:21], v[14:15]
	v_fma_f64 v[20:21], v[14:15], v[22:23], v[24:25]
	v_cndmask_b32_e64 v15, 2.0, 0x3ff00000, s2
	v_cmp_class_f64_e64 s2, v[30:31], 0x204
	v_add_f64 v[22:23], v[26:27], -v[28:29]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[24:25], v[14:15], v[26:27]
	v_add_f64 v[18:19], v[18:19], -v[22:23]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f64 v[22:23], v[14:15], v[26:27], -v[24:25]
	v_cmp_class_f64_e64 s3, v[24:25], 0x204
	v_fma_f64 v[18:19], v[14:15], v[18:19], v[22:23]
	v_add_f64 v[22:23], v[30:31], v[20:21]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[26:27], v[24:25], v[18:19]
	v_cndmask_b32_e64 v29, v23, v31, s2
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v28, v22, v30, s2
	v_add_f64 v[22:23], v[22:23], -v[30:31]
	v_mul_f64 v[36:37], v[28:29], s[44:45]
	v_cmp_neq_f64_e64 s2, 0x7ff00000, |v[28:29]|
	v_cmp_ngt_f64_e64 s4, 0xc090cc00, v[28:29]
	v_cndmask_b32_e64 v35, v27, v25, s3
	v_cndmask_b32_e64 v34, v26, v24, s3
	v_add_f64 v[24:25], v[26:27], -v[24:25]
	v_cmp_nlt_f64_e64 s3, 0x40900000, v[28:29]
	v_add_f64 v[20:21], v[20:21], -v[22:23]
	s_delay_alu instid0(VALU_DEP_4)
	v_mul_f64 v[38:39], v[34:35], s[44:45]
	v_rndne_f64_e32 v[36:37], v[36:37]
	v_cmp_nlt_f64_e64 s6, 0x40900000, v[34:35]
	v_cmp_ngt_f64_e64 s7, 0xc090cc00, v[34:35]
	v_cmp_neq_f64_e64 s5, 0x7ff00000, |v[34:35]|
	v_add_f64 v[18:19], v[18:19], -v[24:25]
	v_cndmask_b32_e64 v21, 0, v21, s2
	v_cndmask_b32_e64 v20, 0, v20, s2
	v_rndne_f64_e32 v[38:39], v[38:39]
	v_fma_f64 v[40:41], v[36:37], s[46:47], v[28:29]
	v_cvt_i32_f64_e32 v48, v[36:37]
	s_and_b32 s2, s4, s3
	v_cndmask_b32_e64 v19, 0, v19, s5
	v_cndmask_b32_e64 v18, 0, v18, s5
	v_fma_f64 v[42:43], v[38:39], s[46:47], v[34:35]
	v_fma_f64 v[40:41], v[36:37], s[48:49], v[40:41]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[42:43], v[38:39], s[48:49], v[42:43]
	v_fma_f64 v[44:45], v[40:41], s[52:53], s[50:51]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[46:47], v[42:43], s[52:53], s[50:51]
	v_fma_f64 v[44:45], v[40:41], v[44:45], s[54:55]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[46:47], v[42:43], v[46:47], s[54:55]
	v_fma_f64 v[44:45], v[40:41], v[44:45], s[56:57]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[46:47], v[42:43], v[46:47], s[56:57]
	v_fma_f64 v[44:45], v[40:41], v[44:45], s[58:59]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[46:47], v[42:43], v[46:47], s[58:59]
	v_fma_f64 v[44:45], v[40:41], v[44:45], s[62:63]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[46:47], v[42:43], v[46:47], s[62:63]
	v_fma_f64 v[44:45], v[40:41], v[44:45], s[66:67]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[46:47], v[42:43], v[46:47], s[66:67]
	v_fma_f64 v[44:45], v[40:41], v[44:45], s[64:65]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[46:47], v[42:43], v[46:47], s[64:65]
	v_fma_f64 v[44:45], v[40:41], v[44:45], s[60:61]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[46:47], v[42:43], v[46:47], s[60:61]
	v_fma_f64 v[44:45], v[40:41], v[44:45], s[68:69]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[46:47], v[42:43], v[46:47], s[68:69]
	v_fma_f64 v[44:45], v[40:41], v[44:45], 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[46:47], v[42:43], v[46:47], 1.0
	v_fma_f64 v[36:37], v[40:41], v[44:45], 1.0
	v_cvt_i32_f64_e32 v40, v[38:39]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[38:39], v[42:43], v[46:47], 1.0
	v_ldexp_f64 v[26:27], v[36:37], v48
	v_mul_f64 v[36:37], v[14:15], 0.5
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_ldexp_f64 v[30:31], v[38:39], v40
	v_trunc_f64_e32 v[38:39], v[32:33]
	v_trunc_f64_e32 v[40:41], v[14:15]
	v_trunc_f64_e32 v[22:23], v[36:37]
	v_cndmask_b32_e64 v24, 0x7ff00000, v27, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v25, 0, v24, s4
	v_cndmask_b32_e64 v24, 0, v26, s2
	s_and_b32 s2, s7, s6
	v_fma_f64 v[20:21], v[24:25], v[20:21], v[24:25]
	v_cndmask_b32_e64 v27, 0x7ff00000, v31, s6
	v_cmp_neq_f64_e64 s8, v[38:39], v[32:33]
	v_cndmask_b32_e64 v26, 0, v30, s2
	v_cmp_class_f64_e64 s2, v[24:25], 0x204
	v_cmp_eq_f64_e64 s9, v[40:41], v[14:15]
	v_cndmask_b32_e64 v27, 0, v27, s7
	v_cmp_neq_f64_e64 s3, v[22:23], v[36:37]
	v_cmp_eq_f64_e64 s6, 0, v[16:17]
	v_cmp_class_f64_e64 s7, v[12:13], 0x204
	s_delay_alu instid0(VALU_DEP_4)
	v_fma_f64 v[18:19], v[26:27], v[18:19], v[26:27]
	v_cmp_class_f64_e64 s4, v[26:27], 0x204
	s_and_b32 s5, vcc_lo, s8
	v_cmp_class_f64_e64 s8, v[16:17], 0x204
	v_cndmask_b32_e64 v15, 0x3ff00000, v13, s5
	v_cndmask_b32_e64 v21, v21, v25, s2
	v_cndmask_b32_e64 v20, v20, v24, s2
	s_and_b32 s2, s9, s3
	v_cmp_gt_f64_e64 s3, 0, v[16:17]
	v_cndmask_b32_e64 v22, 0x3ff00000, v17, s2
	v_bfi_b32 v15, 0x7fffffff, v21, v15
	v_cndmask_b32_e64 v28, 0, v17, s2
	v_cndmask_b32_e64 v18, v18, v26, s4
	v_cndmask_b32_e64 v19, v19, v27, s4
	v_cmp_eq_f64_e64 s4, 0, v[12:13]
	v_cndmask_b32_e32 v21, 0x7ff80000, v15, vcc_lo
	v_cndmask_b32_e64 v26, 0, v13, s5
	v_cndmask_b32_e64 v24, 0, v18, s9
	v_bfi_b32 v19, 0x7fffffff, v19, v22
	v_cndmask_b32_e32 v22, 0, v20, vcc_lo
	v_cmp_gt_f64_e32 vcc_lo, 0, v[12:13]
	v_cndmask_b32_e64 v27, 0x7ff00000, 0, s6
	v_cmp_o_f64_e64 s2, v[12:13], v[12:13]
	v_cndmask_b32_e64 v23, 0x7ff80000, v19, s9
	v_cndmask_b32_e64 v18, v18, v24, s3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v19, v19, v23, s3
	v_cndmask_b32_e64 v25, 0x7ff00000, 0, s4
	v_bfi_b32 v25, 0x7fffffff, v25, v26
	v_dual_cndmask_b32 v15, v15, v21 :: v_dual_cndmask_b32 v20, v20, v22
	v_bfi_b32 v21, 0x7fffffff, v27, v28
	s_or_b32 vcc_lo, s4, s7
	s_mov_b32 s4, 0xf4deae16
	s_delay_alu instid0(VALU_DEP_2)
	v_cndmask_b32_e32 v15, v15, v25, vcc_lo
	v_cndmask_b32_e64 v20, v20, 0, vcc_lo
	s_or_b32 vcc_lo, s6, s8
	s_mov_b32 s5, 0x3dd25868
	v_cndmask_b32_e32 v19, v19, v21, vcc_lo
	v_cndmask_b32_e64 v18, v18, 0, vcc_lo
	v_cmp_o_f64_e32 vcc_lo, v[16:17], v[16:17]
	v_cndmask_b32_e64 v12, 0, v20, s2
	v_cndmask_b32_e64 v13, 0x7ff80000, v15, s2
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v15, 0, v18, vcc_lo
	v_cndmask_b32_e32 v16, 0x7ff80000, v19, vcc_lo
	v_add_f64 v[12:13], v[12:13], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_gt_f64_e32 vcc_lo, 0x10000000, v[12:13]
	v_cndmask_b32_e64 v15, 0, 1, vcc_lo
	v_lshlrev_b32_e32 v15, 8, v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f64 v[12:13], v[12:13], v15
	v_rsq_f64_e32 v[15:16], v[12:13]
	s_waitcnt_depctr 0xfff
	v_mul_f64 v[17:18], v[12:13], v[15:16]
	v_mul_f64 v[15:16], v[15:16], 0.5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], -v[15:16], v[17:18], 0.5
	v_fma_f64 v[17:18], v[17:18], v[19:20], v[17:18]
	v_fma_f64 v[15:16], v[15:16], v[19:20], v[15:16]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], -v[17:18], v[17:18], v[12:13]
	v_fma_f64 v[17:18], v[19:20], v[15:16], v[17:18]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], -v[17:18], v[17:18], v[12:13]
	v_fma_f64 v[15:16], v[19:20], v[15:16], v[17:18]
	v_cndmask_b32_e64 v17, 0, 0xffffff80, vcc_lo
	v_cmp_class_f64_e64 vcc_lo, v[12:13], 0x260
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f64 v[15:16], v[15:16], v17
	v_dual_cndmask_b32 v13, v16, v13 :: v_dual_cndmask_b32 v12, v15, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_frexp_mant_f64_e64 v[15:16], |v[12:13]|
	v_cmp_eq_f64_e64 s2, 0, v[12:13]
	v_cmp_class_f64_e64 s3, v[12:13], 0x204
	v_cmp_gt_f64_e32 vcc_lo, s[10:11], v[15:16]
	v_cndmask_b32_e64 v17, 0, 1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f64 v[15:16], v[15:16], v17
	v_add_f64 v[17:18], v[15:16], 1.0
	v_add_f64 v[23:24], v[15:16], -1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[19:20], v[17:18]
	v_add_f64 v[25:26], v[17:18], -1.0
	v_add_f64 v[15:16], v[15:16], -v[25:26]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[21:22], -v[17:18], v[19:20], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], v[21:22], v[19:20], v[19:20]
	v_fma_f64 v[21:22], -v[17:18], v[19:20], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], v[21:22], v[19:20], v[19:20]
	v_mul_f64 v[21:22], v[23:24], v[19:20]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[27:28], v[17:18], v[21:22]
	v_fma_f64 v[17:18], v[21:22], v[17:18], -v[27:28]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[15:16], v[21:22], v[15:16], v[17:18]
	v_add_f64 v[17:18], v[27:28], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f64 v[25:26], v[23:24], -v[17:18]
	v_add_f64 v[27:28], v[17:18], -v[27:28]
	v_add_f64 v[23:24], v[23:24], -v[25:26]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[15:16], v[27:28], -v[15:16]
	v_add_f64 v[17:18], v[23:24], -v[17:18]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[15:16], v[15:16], v[17:18]
	v_add_f64 v[15:16], v[25:26], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[15:16], v[19:20], v[15:16]
	v_add_f64 v[17:18], v[21:22], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f64 v[19:20], v[17:18], -v[21:22]
	v_mul_f64 v[21:22], v[17:18], v[17:18]
	v_add_f64 v[15:16], v[15:16], -v[19:20]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[19:20], v[17:18], v[17:18], -v[21:22]
	v_add_f64 v[23:24], v[15:16], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], v[17:18], v[23:24], v[19:20]
	v_add_f64 v[23:24], v[21:22], v[19:20]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_fma_f64 v[25:26], v[23:24], s[18:19], s[16:17]
	v_add_f64 v[21:22], v[23:24], -v[21:22]
	v_mul_f64 v[31:32], v[17:18], v[23:24]
	v_fma_f64 v[25:26], v[23:24], v[25:26], s[20:21]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[19:20], v[19:20], -v[21:22]
	v_fma_f64 v[25:26], v[23:24], v[25:26], s[22:23]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[25:26], v[23:24], v[25:26], s[24:25]
	v_fma_f64 v[25:26], v[23:24], v[25:26], s[26:27]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[25:26], v[23:24], v[25:26], s[28:29]
	v_fma_f64 v[25:26], v[23:24], v[25:26], s[30:31]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[25:26], v[23:24], v[25:26], s[34:35]
	v_mul_f64 v[27:28], v[23:24], v[25:26]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[21:22], v[23:24], v[25:26], -v[27:28]
	v_fma_f64 v[21:22], v[19:20], v[25:26], v[21:22]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[25:26], v[27:28], v[21:22]
	v_add_f64 v[29:30], v[25:26], s[10:11]
	v_add_f64 v[27:28], v[25:26], -v[27:28]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[33:34], v[29:30], s[36:37]
	v_add_f64 v[21:22], v[21:22], -v[27:28]
	v_fma_f64 v[27:28], v[23:24], v[17:18], -v[31:32]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[25:26], v[25:26], -v[33:34]
	v_add_f64 v[21:22], v[21:22], s[38:39]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fma_f64 v[23:24], v[23:24], v[15:16], v[27:28]
	v_ldexp_f64 v[15:16], v[15:16], 1
	v_add_f64 v[21:22], v[21:22], v[25:26]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fma_f64 v[19:20], v[19:20], v[17:18], v[23:24]
	v_ldexp_f64 v[17:18], v[17:18], 1
	v_add_f64 v[23:24], v[29:30], v[21:22]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[25:26], v[31:32], v[19:20]
	v_add_f64 v[27:28], v[29:30], -v[23:24]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_f64 v[29:30], v[25:26], v[23:24]
	v_add_f64 v[31:32], v[25:26], -v[31:32]
	v_add_f64 v[21:22], v[21:22], v[27:28]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[27:28], v[25:26], v[23:24], -v[29:30]
	v_add_f64 v[19:20], v[19:20], -v[31:32]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[21:22], v[25:26], v[21:22], v[27:28]
	v_fma_f64 v[19:20], v[19:20], v[23:24], v[21:22]
	v_frexp_exp_i32_f64_e32 v23, v[12:13]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[21:22], v[29:30], v[19:20]
	v_subrev_co_ci_u32_e32 v23, vcc_lo, 0, v23, vcc_lo
	v_cmp_eq_f64_e32 vcc_lo, 1.0, v[12:13]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cvt_f64_i32_e32 v[23:24], v23
	v_add_f64 v[25:26], v[17:18], v[21:22]
	v_add_f64 v[27:28], v[21:22], -v[29:30]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_f64 v[29:30], v[23:24], s[40:41]
	v_add_f64 v[17:18], v[25:26], -v[17:18]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[19:20], v[19:20], -v[27:28]
	v_fma_f64 v[27:28], v[23:24], s[40:41], -v[29:30]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[17:18], v[21:22], -v[17:18]
	v_add_f64 v[15:16], v[15:16], v[19:20]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[19:20], v[23:24], s[42:43], v[27:28]
	v_add_f64 v[15:16], v[15:16], v[17:18]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[17:18], v[29:30], v[19:20]
	v_add_f64 v[21:22], v[25:26], v[15:16]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[29:30], v[17:18], -v[29:30]
	v_add_f64 v[23:24], v[17:18], v[21:22]
	v_add_f64 v[25:26], v[21:22], -v[25:26]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[19:20], v[19:20], -v[29:30]
	v_add_f64 v[27:28], v[23:24], -v[17:18]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[15:16], v[15:16], -v[25:26]
	v_add_f64 v[31:32], v[23:24], -v[27:28]
	v_add_f64 v[21:22], v[21:22], -v[27:28]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[25:26], v[19:20], v[15:16]
	v_add_f64 v[17:18], v[17:18], -v[31:32]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[17:18], v[21:22], v[17:18]
	v_add_f64 v[21:22], v[25:26], -v[19:20]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[17:18], v[25:26], v[17:18]
	v_add_f64 v[25:26], v[25:26], -v[21:22]
	v_add_f64 v[15:16], v[15:16], -v[21:22]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f64 v[27:28], v[23:24], v[17:18]
	v_add_f64 v[19:20], v[19:20], -v[25:26]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[21:22], v[27:28], -v[23:24]
	v_add_f64 v[15:16], v[15:16], v[19:20]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[17:18], v[17:18], -v[21:22]
	v_add_f64 v[16:17], v[15:16], v[17:18]
	v_cndmask_b32_e64 v15, 2.0, 0x3ff00000, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[18:19], v[27:28], v[16:17]
	v_add_f64 v[20:21], v[18:19], -v[27:28]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[22:23], v[14:15], v[18:19]
	v_add_f64 v[16:17], v[16:17], -v[20:21]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f64 v[18:19], v[14:15], v[18:19], -v[22:23]
	v_cmp_class_f64_e64 vcc_lo, v[22:23], 0x204
	v_fma_f64 v[18:19], v[14:15], v[16:17], v[18:19]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[20:21], v[22:23], v[18:19]
	v_dual_cndmask_b32 v25, v21, v23 :: v_dual_cndmask_b32 v24, v20, v22
	v_add_f64 v[20:21], v[20:21], -v[22:23]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[16:17], v[24:25], s[44:45]
	v_add_f64 v[18:19], v[18:19], -v[20:21]
	v_trunc_f64_e32 v[20:21], v[14:15]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_rndne_f64_e32 v[26:27], v[16:17]
	v_fma_f64 v[16:17], v[26:27], s[46:47], v[24:25]
	v_cvt_i32_f64_e32 v32, v[26:27]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[28:29], v[26:27], s[48:49], v[16:17]
	v_fma_f64 v[16:17], v[28:29], s[52:53], s[50:51]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[16:17], v[28:29], v[16:17], s[54:55]
	v_fma_f64 v[16:17], v[28:29], v[16:17], s[56:57]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[16:17], v[28:29], v[16:17], s[58:59]
	v_fma_f64 v[16:17], v[28:29], v[16:17], s[62:63]
	s_delay_alu instid0(VALU_DEP_1)
	v_fma_f64 v[30:31], v[28:29], v[16:17], s[66:67]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v16, vcc_lo, s0, v4
	v_add_co_ci_u32_e32 v17, vcc_lo, s1, v5, vcc_lo
	v_add_co_u32 v6, vcc_lo, s0, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, s1, v7, vcc_lo
	global_load_b64 v[16:17], v[16:17], off
	v_cmp_nlt_f64_e64 s0, 0x40900000, v[24:25]
	v_cmp_neq_f64_e64 vcc_lo, 0x7ff00000, |v[24:25]|
	global_load_b64 v[6:7], v[6:7], off
	v_cmp_ngt_f64_e64 s1, 0xc090cc00, v[24:25]
	v_fma_f64 v[30:31], v[28:29], v[30:31], s[64:65]
	v_dual_cndmask_b32 v19, 0, v19 :: v_dual_cndmask_b32 v18, 0, v18
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_and_b32 vcc_lo, s1, s0
	v_fma_f64 v[30:31], v[28:29], v[30:31], s[60:61]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[30:31], v[28:29], v[30:31], s[68:69]
	v_fma_f64 v[30:31], v[28:29], v[30:31], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[26:27], v[28:29], v[30:31], 1.0
	v_ldexp_f64 v[22:23], v[26:27], v32
	v_mul_f64 v[26:27], v[14:15], 0.5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v28, 0x7ff00000, v23, s0
	v_trunc_f64_e32 v[23:24], v[26:27]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v29, 0, v28, s1
	v_cndmask_b32_e32 v28, 0, v22, vcc_lo
	v_cmp_eq_f64_e32 vcc_lo, v[20:21], v[14:15]
	v_cndmask_b32_e64 v20, 0x7ff00000, 0, s2
	v_fma_f64 v[14:15], v[28:29], v[18:19], v[28:29]
	v_cmp_class_f64_e64 s1, v[28:29], 0x204
	v_cmp_neq_f64_e64 s0, v[23:24], v[26:27]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cndmask_b32_e64 v15, v15, v29, s1
	v_cndmask_b32_e64 v14, v14, v28, s1
	s_waitcnt vmcnt(1)
	v_mul_f64 v[18:19], v[16:17], s[4:5]
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)
	s_and_b32 vcc_lo, vcc_lo, s0
	s_mov_b32 s0, 0
	v_cndmask_b32_e32 v21, 0x3ff00000, v13, vcc_lo
	v_cndmask_b32_e32 v22, 0, v13, vcc_lo
	s_or_b32 vcc_lo, s2, s3
	v_cndmask_b32_e64 v14, v14, 0, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_bfi_b32 v15, 0x7fffffff, v15, v21
	v_bfi_b32 v20, 0x7fffffff, v20, v22
	s_delay_alu instid0(VALU_DEP_1)
	v_cndmask_b32_e32 v15, v15, v20, vcc_lo
	v_cmp_o_f64_e32 vcc_lo, v[12:13], v[12:13]
	s_waitcnt vmcnt(0)
	v_mul_f64 v[6:7], v[18:19], v[6:7]
	v_cndmask_b32_e32 v14, 0, v14, vcc_lo
	v_cndmask_b32_e32 v15, 0x7ff80000, v15, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f64 v[18:19], null, v[14:15], v[14:15], v[6:7]
	v_div_scale_f64 v[24:25], vcc_lo, v[6:7], v[14:15], v[6:7]
	v_rcp_f64_e32 v[20:21], v[18:19]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[22:23], -v[18:19], v[20:21], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[20:21], v[20:21], v[22:23], v[20:21]
	v_fma_f64 v[22:23], -v[18:19], v[20:21], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[20:21], v[20:21], v[22:23], v[20:21]
	v_mul_f64 v[22:23], v[24:25], v[20:21]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[18:19], -v[18:19], v[22:23], v[24:25]
	v_div_fmas_f64 v[18:19], v[18:19], v[20:21], v[22:23]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f64 v[6:7], v[18:19], v[14:15], v[6:7]
	v_mul_f64 v[0:1], v[0:1], v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f64 v[2:3], null, v[12:13], v[12:13], v[0:1]
	v_div_scale_f64 v[20:21], vcc_lo, v[0:1], v[12:13], v[0:1]
	v_rcp_f64_e32 v[14:15], v[2:3]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[18:19], -v[2:3], v[14:15], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[14:15], v[14:15], v[18:19], v[14:15]
	v_fma_f64 v[18:19], -v[2:3], v[14:15], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[14:15], v[14:15], v[18:19], v[14:15]
	v_mul_f64 v[18:19], v[20:21], v[14:15]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[2:3], -v[2:3], v[18:19], v[20:21]
	v_div_fmas_f64 v[2:3], v[2:3], v[14:15], v[18:19]
	v_add_co_u32 v14, vcc_lo, s12, v4
	v_add_co_ci_u32_e32 v15, vcc_lo, s13, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_div_fixup_f64 v[0:1], v[2:3], v[12:13], v[0:1]
	global_load_b64 v[2:3], v[14:15], off
	v_div_scale_f64 v[18:19], null, v[16:17], v[16:17], v[0:1]
	v_rcp_f64_e32 v[20:21], v[18:19]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[22:23], -v[18:19], v[20:21], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[20:21], v[20:21], v[22:23], v[20:21]
	v_fma_f64 v[22:23], -v[18:19], v[20:21], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f64 v[20:21], v[20:21], v[22:23], v[20:21]
	v_div_scale_f64 v[22:23], vcc_lo, v[0:1], v[16:17], v[0:1]
	v_mul_f64 v[24:25], v[22:23], v[20:21]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[18:19], -v[18:19], v[24:25], v[22:23]
	v_div_fmas_f64 v[18:19], v[18:19], v[20:21], v[24:25]
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fixup_f64 v[18:19], v[18:19], v[16:17], v[0:1]
.LBB0_2:                                ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f64 v[0:1], v[18:19], v[2:3]
	global_atomic_cmpswap_b64 v[0:1], v[14:15], v[0:3], off glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u64_e32 vcc_lo, v[2:3], v[0:1]
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
	s_or_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s0
	s_cbranch_execnz .LBB0_2
; %bb.3:                                ; %_Z10atomicAddDPdd.exit
	s_or_b32 exec_lo, exec_lo, s0
	v_add_f64 v[0:1], v[10:11], -v[8:9]
	s_mov_b32 s0, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[0:1], v[0:1], v[6:7]
	v_div_scale_f64 v[2:3], null, v[12:13], v[12:13], v[0:1]
	v_div_scale_f64 v[10:11], vcc_lo, v[0:1], v[12:13], v[0:1]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[6:7], v[2:3]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[8:9], -v[2:3], v[6:7], 1.0
	v_fma_f64 v[6:7], v[6:7], v[8:9], v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], -v[2:3], v[6:7], 1.0
	v_fma_f64 v[6:7], v[6:7], v[8:9], v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[8:9], v[10:11], v[6:7]
	v_fma_f64 v[2:3], -v[2:3], v[8:9], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_div_fmas_f64 v[2:3], v[2:3], v[6:7], v[8:9]
	v_add_co_u32 v4, vcc_lo, s14, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s15, v5, vcc_lo
	v_div_fixup_f64 v[0:1], v[2:3], v[12:13], v[0:1]
	global_load_b64 v[2:3], v[4:5], off
	v_div_scale_f64 v[6:7], null, v[16:17], v[16:17], v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[8:9], v[6:7]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[10:11], -v[6:7], v[8:9], 1.0
	v_fma_f64 v[8:9], v[8:9], v[10:11], v[8:9]
	v_div_scale_f64 v[10:11], vcc_lo, v[0:1], v[16:17], v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f64 v[12:13], v[10:11], v[8:9]
	v_fma_f64 v[6:7], -v[6:7], v[12:13], v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fmas_f64 v[6:7], v[6:7], v[8:9], v[12:13]
	v_div_fixup_f64 v[6:7], v[6:7], v[16:17], v[0:1]
.LBB0_4:                                ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f64 v[0:1], v[6:7], v[2:3]
	global_atomic_cmpswap_b64 v[0:1], v[4:5], v[0:3], off glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u64_e32 vcc_lo, v[2:3], v[0:1]
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
	s_or_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s0
	s_cbranch_execnz .LBB0_4
.LBB0_5:                                ; %_Z10atomicAddDPdd.exit47
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z8asteroidPdS_S_S_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 14
		.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 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 52
		.amdhsa_next_free_sgpr 70
		.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	_Z8asteroidPdS_S_S_S_, .Lfunc_end0-_Z8asteroidPdS_S_S_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 6380
; NumSgprs: 72
; NumVgprs: 52
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 8
; VGPRBlocks: 6
; NumSGPRsForWavesPerEU: 72
; NumVGPRsForWavesPerEU: 52
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z9positionsPdS_S_S_S_  ; -- Begin function _Z9positionsPdS_S_S_S_
	.globl	_Z9positionsPdS_S_S_S_
	.p2align	8
	.type	_Z9positionsPdS_S_S_S_,@function
_Z9positionsPdS_S_S_S_:                 ; @_Z9positionsPdS_S_S_S_
; %bb.0:
	s_load_b256 s[0:7], s[0:1], 0x0
	v_mad_u64_u32 v[1:2], null, s15, s15, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[4:5], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v5, vcc_lo
	v_add_co_u32 v6, vcc_lo, s0, v4
	v_add_co_ci_u32_e32 v7, vcc_lo, s1, v5, vcc_lo
	s_mov_b32 s0, 0
	global_load_b64 v[8:9], v[0:1], off
	global_load_b64 v[2:3], v[6:7], off
.LBB1_1:                                ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	v_add_f64 v[0:1], v[8:9], v[2:3]
	global_atomic_cmpswap_b64 v[0:1], v[6:7], v[0:3], off glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u64_e32 vcc_lo, v[2:3], v[0:1]
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
	s_or_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s0
	s_cbranch_execnz .LBB1_1
; %bb.2:                                ; %_Z10atomicAddDPdd.exit
	s_or_b32 exec_lo, exec_lo, s0
	v_add_co_u32 v0, vcc_lo, s6, v4
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v5, vcc_lo
	v_add_co_u32 v4, vcc_lo, s2, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s3, v5, vcc_lo
	s_mov_b32 s0, 0
	global_load_b64 v[6:7], v[0:1], off
	global_load_b64 v[2:3], v[4:5], off
.LBB1_3:                                ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	v_add_f64 v[0:1], v[6:7], v[2:3]
	global_atomic_cmpswap_b64 v[0:1], v[4:5], v[0:3], off glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u64_e32 vcc_lo, v[2:3], v[0:1]
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
	s_or_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s0
	s_cbranch_execnz .LBB1_3
; %bb.4:                                ; %_Z10atomicAddDPdd.exit14
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9positionsPdS_S_S_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 40
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 10
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z9positionsPdS_S_S_S_, .Lfunc_end1-_Z9positionsPdS_S_S_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 240
; NumSgprs: 18
; NumVgprs: 10
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 10
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.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
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z8asteroidPdS_S_S_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     72
    .sgpr_spill_count: 0
    .symbol:         _Z8asteroidPdS_S_S_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     52
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 40
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9positionsPdS_S_S_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9positionsPdS_S_S_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     10
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
