/*	Simulation overview:

	1. Define the information contained within a point in space as a c++ struct.
	2. Generate multiple copies of this point in a GPU array, each with unique parameters.
	3. Calculate a quantity at each point due to the given parameters within a CUDA kernel.
	4. Advance in time, and repeat.
*/

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <cuda.h>



int numPoints = 4096,		// number of points to generate (multiples of 32 are best)
    maxSteps  = 250000, 	// total iterations
	saveSteps = 1000;		// data will be written to file when current step % saveSteps = 0


__device__ __constant__ float dt = 0.0005,   // Time step size.
                              A, k, w, c, dk;

const float pi = 3.14159265358979f;                          
const float plotBoundary = 4 * pi;


typedef struct
{
	// Represents a point in space with its associated fields, as well
	// as any information we wish to carry along with each point.
	
	float x, y,     // position data
		  psi;      // wave height
		  
} point;



// HOST FUNCTIONS //////////////////////////////////////////////////////////////////////////////////
//


// Get GPU debugging mesagges.
inline void check_cuda_errors( const char *filename, const int line_number )
{
#ifdef DEBUG
  cudaThreadSynchronize();
  cudaError_t error = cudaGetLastError();
  if( error != cudaSuccess )
  {
    printf( "CUDA error at %s:%i: %s\n", filename, line_number, cudaGetErrorString( error ) );
    exit( -1 );
  }
#endif
}

// Get the current timestamp.
char *date_and_time()
{
	time_t  time_raw_format;
	struct tm * ptr_time;
	time ( &time_raw_format);
	ptr_time = localtime ( &time_raw_format );
	return asctime(ptr_time);
}

// Store simulation data into the directory specified by *path.
void writeDataToFile( char *path, point *p, int numPoints, float simTime, float plotLimit )
{
	// Initialize data file and write common parameters:
	FILE *file;	
	char filename[ strlen( path )+24 ];
	sprintf( filename,"%s/%.16f.dat", path, simTime );
	file = fopen( filename,"w" );
	char sp[10] = "         ";
	fprintf( file,"# limit = %g\n#\n# x%s  y%s  psi\n", plotLimit, sp, sp);
	
	// Write data to file:
	for( int i = 0; i < numPoints; i++ )
	{
		fprintf( file,"% .4e % .4e % .4e\n",
			p[i].x, p[i].y, p[i].psi );
	}
	
	fclose(file);
}


// Calculate constants used in device kernels.
void initializeDeviceConstants()
{
    float a = 1,
          lambda = 2 * pi,
          K = 2 * pi / lambda,
          hBar = 1 / ( 2 * pi ),  // letting h = 1
          m = 1,
          W = 0.5 * hBar * K * K / m,
          C =  W / K,
          DK = K / 8;  // determines the "tightness" of the wave packet

    cudaMemcpyToSymbol( A, &a, sizeof( float ) );
    cudaMemcpyToSymbol( k, &K, sizeof( float ) );
    cudaMemcpyToSymbol( w, &W, sizeof( float ) );
    cudaMemcpyToSymbol( c, &C, sizeof( float ) );
    cudaMemcpyToSymbol( dk, &DK, sizeof( float ) );
}


// Populate the point array on the host.
void initializePoints( point *p, int N )
{
    // Define the boudaries of the point-space.
    float dR = plotBoundary / sqrt( (float)N ),
          dTheta = 2 * pi / sqrt( (float)N );
          
    // Assign each point a specific location in space.
    int i = 0;
	for( float r = 0; r <= plotBoundary; r += dR )
	{	
	    for( float theta = 0; theta <= 2 * pi; theta += dTheta )
	    {
	        if( i > N )
	            continue;
            p[i].x = r * cos( theta );     // position vector
            p[i].y = r * sin( theta );	   //
            i++;
        }
	}
}

//
// END HOST FUNTIONS ///////////////////////////////////////////////////////////////////////////////




// DEVICE KERNELS //////////////////////////////////////////////////////////////////////////////////
//


__device__ int getGlobalIndex( void ) { return blockIdx.x * blockDim.x + threadIdx.x; }

__device__ float t = 0;
                              
__device__ void updateTime() { t += dt; }

// Calcutate the new point values in time and space at each timestep.
__global__ void incrementPoint( point *p, int numPoints )
{
	int	i = getGlobalIndex();
	 
    float r = sqrt( p[i].x*p[i].x + p[i].y*p[i].y );
    
    //p[i].psi = A * cos( k * r - w * t );  // simple circular wave
    
    // Disbursive Wave Packet
    // From A. C. Philips: Intro to Quantum Mechanics, problem 2.2 and fig. 2.1, with c = w/k.
    float alpha = r - c * t;
    p[i].psi = 2 * A * dk * sin( dk * alpha ) * cos( k * alpha ) / ( dk * alpha );
    
    updateTime();
}


//
// END DEVICE KERNELS //////////////////////////////////////////////////////////////////////////////


int main(int argc, char *argv[])
{


////////////////////////////////////////////////////////////////////////////////////////////////////
// SELECT DEVICE


    // Get the number of CUDA enabled devices.
	int deviceCount;
	cudaGetDeviceCount( &deviceCount );
	if( deviceCount < 1 )
	{
		printf( "No CUDA-capable devices were detected.\n" );
		return 1;
	}

	// Get properties, select device, and display info.
	int device, useDevice;
	float computeCapability, cudaVersion = 0;
	cudaDeviceProp deviceProp;
	for( device = 0; device < deviceCount; device++ )
	{
	    // Display info for each device.
		cudaGetDeviceProperties( &deviceProp, device );
		computeCapability = deviceProp.major + deviceProp.minor * 0.1;
			
	    // Select the device with the greatest compute capability. If multiple devices
	    // with this capability are found, the first encountered will be used.
		if( computeCapability > cudaVersion )
		{
			cudaVersion = computeCapability;
			useDevice = device;
		}
	}
	device = useDevice;
	cudaGetDevice(&device);
	cudaGetDeviceProperties( &deviceProp, device );
    printf( "# Using %s, device number: %d, compute capability: %g.\n",
        deviceProp.name, device, cudaVersion );

    // Check for kernel timeout.
	if( deviceProp.kernelExecTimeoutEnabled == 1 )
	{
	    printf( "#\n" );
		printf( "# Warning: Timeout enabled. Using this device without a display \n" );
		printf( "# may lift kernel timeout restrictions.\n" );
	}  
	
	
// END SELECT DEVICE
////////////////////////////////////////////////////////////////////////////////////////////////////


	// Allocate memory:
	int threadsPerBlock = ( deviceProp.major >= 2 ? 512 : 256 ),
		numBlocks		= ceil( (float)numPoints / (float)threadsPerBlock ),
		numBytes		= numPoints * sizeof( point );
	point *cpuPointArray, *gpuPointArray;
	cpuPointArray = (point*)malloc( numBytes );
	cudaMalloc( (void**)&gpuPointArray, numBytes );
	check_cuda_errors( __FILE__, __LINE__ );
	
	
////////////////////////////////////////////////////////////////////////////////////////////////////
// BEGIN SIMULATION


	// Begin simulation:
	for( int s = 0; s < maxSteps; s++ )
	{
		
		// Perform setup tasks before the first iteration.
		if( s == 0 )
		{	
		    // Initialize point array and device constants.
			srand( time( NULL ) );
			initializePoints( cpuPointArray, numPoints );
			initializeDeviceConstants();
			cudaMemcpy( gpuPointArray, cpuPointArray, numBytes, cudaMemcpyHostToDevice );

			// Write simulation info to stdout.
			float stepSize;
			cudaMemcpyFromSymbol( &stepSize, dt, sizeof(float) );
			printf( "#\n#\n" );
			printf( "# Started %s#\n# numPoints = %d\n# maxSteps  = %d\n# dt        = %g\n#\n",
				date_and_time(), numPoints, maxSteps, stepSize );
			printf( "# Steps   | Seconds  | Sim. Time\n# ------------------------------\n" );
			
			check_cuda_errors(__FILE__, __LINE__);	
		}

		// Execute portion of simulation on GPU:
		incrementPoint<<<numBlocks,threadsPerBlock>>>( gpuPointArray, numPoints );
			
		// Retrieve results:
		float simTime;
		cudaMemcpyFromSymbol( &simTime, t, sizeof( float ) );
		cudaMemcpy( cpuPointArray, gpuPointArray, numBytes, cudaMemcpyDeviceToHost );

		// Output data every [saveSteps] steps.
		if( s % saveSteps == 0 )
		{
		    // Write to file if save paths specified in argument to main().
		    if( argc > 1 )
			    writeDataToFile( argv[1], cpuPointArray, numPoints, simTime, plotBoundary );
			
			// Print data to stdout.
			printf( "%.4e %.4e %.4e\n", (float)s, (float)( clock() / CLOCKS_PER_SEC ), simTime );
		}

	}
	
	
// END SIMULATION
////////////////////////////////////////////////////////////////////////////////////////////////////
 	
 	
  	// Deallocate memory and exit.
  	free( cpuPointArray );
  	cudaFree( gpuPointArray );
  	check_cuda_errors( __FILE__, __LINE__ );
  	printf( "\n# Completed %s", date_and_time() );
	return 0;
	
	
}	// end main

	.file	"tmpxft_002f55a0_00000000-6_nPoint.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2037:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2037:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z13date_and_timev
	.type	_Z13date_and_timev, @function
_Z13date_and_timev:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	call	time@PLT
	movq	%rbx, %rdi
	call	localtime@PLT
	movq	%rax, %rdi
	call	asctime@PLT
	movq	8(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z13date_and_timev, .-_Z13date_and_timev
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s/%.16f.dat"
.LC1:
	.string	"w"
.LC2:
	.string	"# limit = %g\n#\n# x%s  y%s  psi\n"
.LC3:
	.string	"% .4e % .4e % .4e\n"
	.text
	.globl	_Z15writeDataToFilePcP5pointiff
	.type	_Z15writeDataToFilePcP5pointiff, @function
_Z15writeDataToFilePcP5pointiff:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	movd	%xmm1, %r15d
	pushq	%r14
	pushq	%r13
	pushq	%r12
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	movl	%edx, %r12d
	pushq	%rbx
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$56, %rsp
	movss	%xmm0, -92(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rdi, -88(%rbp)
	call	strlen@PLT
	movq	%rsp, %rcx
	movss	-92(%rbp), %xmm0
	movq	-88(%rbp), %r8
	leaq	24(%rax), %rdx
	addq	$39, %rax
	movq	%rax, %rsi
	andq	$-4096, %rax
	andq	$-16, %rsi
	subq	%rax, %rcx
.L7:
	cmpq	%rcx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rsi, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L9
	orq	$0, -8(%rsp,%rax)
.L9:
	leaq	.LC0(%rip), %rcx
	movl	$2, %esi
	movq	%rsp, %rdi
	movb	$1, %al
	cvtss2sd	%xmm0, %xmm0
	call	__sprintf_chk@PLT
	movq	%rsp, %rdi
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %rsi
	call	fopen@PLT
	leaq	-66(%rbp), %rcx
	movd	%r15d, %xmm3
	leaq	.LC2(%rip), %rdx
	movq	%rax, %r13
	movq	%rcx, %r8
	movl	$2, %esi
	movabsq	$2314885530818453536, %rax
	movq	%rax, -66(%rbp)
	movq	%r13, %rdi
	movb	$1, %al
	cvtss2sd	%xmm3, %xmm0
	movw	$32, -58(%rbp)
	leaq	.LC3(%rip), %r15
	call	__fprintf_chk@PLT
.L10:
	cmpl	%r12d, %r14d
	jge	.L17
	movq	%r15, %rdx
	movl	$2, %esi
	movq	%r13, %rdi
	movb	$3, %al
	cvtss2sd	(%rbx), %xmm0
	cvtss2sd	8(%rbx), %xmm2
	cvtss2sd	4(%rbx), %xmm1
	incl	%r14d
	call	__fprintf_chk@PLT
	addq	$12, %rbx
	jmp	.L10
.L17:
	movq	%r13, %rdi
	call	fclose@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z15writeDataToFilePcP5pointiff, .-_Z15writeDataToFilePcP5pointiff
	.globl	_Z25initializeDeviceConstantsv
	.type	_Z25initializeDeviceConstantsv, @function
_Z25initializeDeviceConstantsv:
.LFB2030:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movss	.LC4(%rip), %xmm0
	xorl	%ecx, %ecx
	movl	$1, %r8d
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movl	$4, %edx
	leaq	_ZL1A(%rip), %rdi
	movss	%xmm0, 4(%rsp)
	movss	%xmm0, 8(%rsp)
	movss	.LC5(%rip), %xmm0
	movl	$0x3e000000, 20(%rsp)
	movss	%xmm0, 12(%rsp)
	movss	%xmm0, 16(%rsp)
	call	cudaMemcpyToSymbol@PLT
	xorl	%ecx, %ecx
	leaq	8(%rsp), %rsi
	movl	$1, %r8d
	movl	$4, %edx
	leaq	_ZL1k(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	xorl	%ecx, %ecx
	leaq	12(%rsp), %rsi
	movl	$1, %r8d
	movl	$4, %edx
	leaq	_ZL1w(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	xorl	%ecx, %ecx
	leaq	16(%rsp), %rsi
	movl	$1, %r8d
	movl	$4, %edx
	leaq	_ZL1c(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	xorl	%ecx, %ecx
	leaq	20(%rsp), %rsi
	movl	$1, %r8d
	movl	$4, %edx
	leaq	_ZL2dk(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z25initializeDeviceConstantsv, .-_Z25initializeDeviceConstantsv
	.globl	_Z16initializePointsP5pointi
	.type	_Z16initializePointsP5pointi, @function
_Z16initializePointsP5pointi:
.LFB2031:
	.cfi_startproc
	endbr64
	cvtsi2ssl	%esi, %xmm5
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%esi, %ebx
	movaps	%xmm5, %xmm0
	movd	%xmm5, %r12d
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	call	sqrtf@PLT
	movss	.LC8(%rip), %xmm3
	divss	%xmm0, %xmm3
	movd	%r12d, %xmm0
	leaq	28(%rsp), %r12
	movss	%xmm3, 8(%rsp)
	call	sqrtf@PLT
	movss	.LC9(%rip), %xmm4
	xorps	%xmm1, %xmm1
	divss	%xmm0, %xmm4
	movss	%xmm4, 12(%rsp)
.L22:
	xorps	%xmm0, %xmm0
.L24:
	cmpl	%r13d, %ebx
	jl	.L23
	leaq	24(%rsp), %rsi
	movq	%r12, %rdi
	movss	%xmm1, 20(%rsp)
	movss	%xmm0, 16(%rsp)
	call	sincosf@PLT
	movss	24(%rsp), %xmm2
	movslq	%r13d, %rax
	movss	20(%rsp), %xmm1
	imulq	$12, %rax, %rax
	movss	16(%rsp), %xmm0
	incl	%r13d
	mulss	%xmm1, %xmm2
	addq	%rbp, %rax
	movss	%xmm2, (%rax)
	movss	28(%rsp), %xmm2
	mulss	%xmm1, %xmm2
	movss	%xmm2, 4(%rax)
.L23:
	addss	12(%rsp), %xmm0
	movss	.LC9(%rip), %xmm7
	comiss	%xmm0, %xmm7
	jnb	.L24
	addss	8(%rsp), %xmm1
	movss	.LC8(%rip), %xmm6
	comiss	%xmm1, %xmm6
	jnb	.L22
	addq	$40, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z16initializePointsP5pointi, .-_Z16initializePointsP5pointi
	.globl	_Z14getGlobalIndexv
	.type	_Z14getGlobalIndexv, @function
_Z14getGlobalIndexv:
.LFB2032:
	.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
.LFE2032:
	.size	_Z14getGlobalIndexv, .-_Z14getGlobalIndexv
	.globl	_Z10updateTimev
	.type	_Z10updateTimev, @function
_Z10updateTimev:
.LFB2033:
	.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
.LFE2033:
	.size	_Z10updateTimev, .-_Z10updateTimev
	.globl	_Z40__device_stub__Z14incrementPointP5pointiP5pointi
	.type	_Z40__device_stub__Z14incrementPointP5pointiP5pointi, @function
_Z40__device_stub__Z14incrementPointP5pointiP5pointi:
.LFB2059:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L34
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z14incrementPointP5pointi(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L34:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2059:
	.size	_Z40__device_stub__Z14incrementPointP5pointiP5pointi, .-_Z40__device_stub__Z14incrementPointP5pointiP5pointi
	.globl	_Z14incrementPointP5pointi
	.type	_Z14incrementPointP5pointi, @function
_Z14incrementPointP5pointi:
.LFB2060:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z14incrementPointP5pointiP5pointi
	.cfi_endproc
.LFE2060:
	.size	_Z14incrementPointP5pointi, .-_Z14incrementPointP5pointi
	.section	.rodata.str1.1
.LC10:
	.string	"No CUDA-capable devices were detected.\n"
.LC12:
	.string	"# Using %s, device number: %d, compute capability: %g.\n"
.LC13:
	.string	"#\n"
.LC14:
	.string	"# Warning: Timeout enabled. Using this device without a display \n"
.LC15:
	.string	"# may lift kernel timeout restrictions.\n"
.LC16:
	.string	"#\n#\n"
.LC17:
	.string	"# Started %s#\n# numPoints = %d\n# maxSteps  = %d\n# dt        = %g\n#\n"
.LC18:
	.string	"# Steps   | Seconds  | Sim. Time\n# ------------------------------\n"
.LC19:
	.string	"%.4e %.4e %.4e\n"
.LC20:
	.string	"\n# Completed %s"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2034:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1144, %rsp
	.cfi_def_cfa_offset 1200
	movq	%fs:40, %rax
	movq	%rax, 1128(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rdi
	call	cudaGetDeviceCount@PLT
	cmpl	$0, 56(%rsp)
	jg	.L54
	leaq	.LC10(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %eax
	jmp	.L39
.L54:
	xorl	%esi, %esi
	xorps	%xmm0, %xmm0
.L40:
	cmpl	%esi, 56(%rsp)
	movl	%esi, 60(%rsp)
	leaq	96(%rsp), %rbp
	movss	%xmm0, 8(%rsp)
	jle	.L58
	movq	%rbp, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movss	8(%rsp), %xmm0
	movl	60(%rsp), %esi
	cvtsi2sdl	460(%rsp), %xmm1
	mulsd	.LC11(%rip), %xmm1
	cvtsi2sdl	456(%rsp), %xmm2
	addsd	%xmm2, %xmm1
	cvtsd2ss	%xmm1, %xmm1
	comiss	%xmm0, %xmm1
	maxss	%xmm0, %xmm1
	cmova	%esi, %ebx
	movaps	%xmm1, %xmm0
	incl	%esi
	jmp	.L40
.L58:
	leaq	60(%rsp), %rdi
	movl	%ebx, 60(%rsp)
	call	cudaGetDevice@PLT
	movl	60(%rsp), %esi
	movq	%rbp, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movss	8(%rsp), %xmm0
	movq	%rbp, %rdx
	movb	$1, %al
	movl	60(%rsp), %ecx
	leaq	.LC12(%rip), %rsi
	movl	$2, %edi
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	cmpl	$1, 488(%rsp)
	jne	.L45
	leaq	.LC13(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L45:
	movl	$512, %eax
	cmpl	$2, 456(%rsp)
	movl	$256, %ebp
	movl	numPoints(%rip), %ebx
	cmovge	%eax, %ebp
	cvtsi2ssl	%ebx, %xmm0
	cvtsi2ssl	%ebp, %xmm1
	imull	$12, %ebx, %ebx
	divss	%xmm1, %xmm0
	call	ceilf@PLT
	movslq	%ebx, %rax
	xorl	%ebx, %ebx
	movq	%rax, %rdi
	cvttss2sil	%xmm0, %r14d
	movq	%rax, 16(%rsp)
	call	malloc@PLT
	movq	16(%rsp), %rsi
	leaq	64(%rsp), %rdi
	movq	%rax, 8(%rsp)
	call	cudaMalloc@PLT
.L47:
	cmpl	%ebx, maxSteps(%rip)
	jle	.L59
	leaq	84(%rsp), %rax
	testl	%ebx, %ebx
	movq	%rax, 24(%rsp)
	jne	.L48
	xorl	%edi, %edi
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	movl	numPoints(%rip), %esi
	movq	8(%rsp), %rdi
	call	_Z16initializePointsP5pointi
	call	_Z25initializeDeviceConstantsv
	movq	16(%rsp), %rdx
	movq	8(%rsp), %rsi
	movl	$1, %ecx
	movq	64(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	24(%rsp), %rdi
	xorl	%ecx, %ecx
	movl	$4, %edx
	movl	$2, %r8d
	leaq	_ZL2dt(%rip), %rsi
	call	cudaMemcpyFromSymbol@PLT
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	maxSteps(%rip), %r8d
	movl	numPoints(%rip), %r15d
	cvtss2sd	84(%rsp), %xmm0
	movsd	%xmm0, 40(%rsp)
	movl	%r8d, 36(%rsp)
	call	_Z13date_and_timev
	movsd	40(%rsp), %xmm0
	movl	36(%rsp), %r8d
	movl	%r15d, %ecx
	movq	%rax, %rdx
	leaq	.LC17(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
	leaq	.LC18(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L48:
	movabsq	$4294967297, %rax
	movl	%ebp, 84(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rax, 88(%rsp)
	movl	92(%rsp), %ecx
	movq	%rax, 76(%rsp)
	movq	84(%rsp), %rdx
	movl	%r14d, 72(%rsp)
	movl	80(%rsp), %esi
	movq	72(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L49
	movl	numPoints(%rip), %esi
	movq	64(%rsp), %rdi
	call	_Z40__device_stub__Z14incrementPointP5pointiP5pointi
.L49:
	movq	24(%rsp), %rdi
	movl	$2, %r8d
	xorl	%ecx, %ecx
	movl	$4, %edx
	leaq	_ZL1t(%rip), %rsi
	call	cudaMemcpyFromSymbol@PLT
	movq	16(%rsp), %rdx
	movq	64(%rsp), %rsi
	movl	$2, %ecx
	movq	8(%rsp), %rdi
	call	cudaMemcpy@PLT
	movl	%ebx, %eax
	cltd
	idivl	saveSteps(%rip)
	testl	%edx, %edx
	jne	.L50
	cmpl	$1, %r12d
	jle	.L51
	movq	8(%r13), %rdi
	movss	.LC8(%rip), %xmm1
	movss	84(%rsp), %xmm0
	movl	numPoints(%rip), %edx
	movq	8(%rsp), %rsi
	call	_Z15writeDataToFilePcP5pointiff
.L51:
	cvtss2sd	84(%rsp), %xmm2
	movsd	%xmm2, 24(%rsp)
	call	clock@PLT
	movl	$1000000, %ecx
	cvtsi2ssl	%ebx, %xmm0
	movsd	24(%rsp), %xmm2
	cqto
	leaq	.LC19(%rip), %rsi
	movl	$2, %edi
	idivq	%rcx
	cvtss2sd	%xmm0, %xmm0
	cvtsi2ssq	%rax, %xmm1
	movb	$3, %al
	cvtss2sd	%xmm1, %xmm1
	call	__printf_chk@PLT
.L50:
	incl	%ebx
	jmp	.L47
.L59:
	movq	8(%rsp), %rdi
	call	free@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	call	_Z13date_and_timev
	leaq	.LC20(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
.L39:
	movq	1128(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L53
	call	__stack_chk_fail@PLT
.L53:
	addq	$1144, %rsp
	.cfi_def_cfa_offset 56
	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
.LFE2034:
	.size	main, .-main
	.section	.rodata.str1.1
.LC21:
	.string	"_Z14incrementPointP5pointi"
.LC22:
	.string	"dt"
.LC23:
	.string	"A"
.LC24:
	.string	"k"
.LC25:
	.string	"c"
.LC26:
	.string	"dk"
.LC27:
	.string	"t"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2062:
	.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	.LC21(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z14incrementPointP5pointi(%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	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC22(%rip), %rdx
	movl	$4, %r9d
	leaq	_ZL2dt(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC23(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL1A(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC24(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL1k(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL1w(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC25(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL1c(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r11
	.cfi_def_cfa_offset 24
	popq	%rax
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC26(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL2dk(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC27(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL1t(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.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
.LFE2062:
	.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
	.local	_ZL1t
	.comm	_ZL1t,4,4
	.local	_ZL2dk
	.comm	_ZL2dk,4,4
	.local	_ZL1c
	.comm	_ZL1c,4,4
	.local	_ZL1w
	.comm	_ZL1w,4,4
	.local	_ZL1k
	.comm	_ZL1k,4,4
	.local	_ZL1A
	.comm	_ZL1A,4,4
	.local	_ZL2dt
	.comm	_ZL2dt,4,4
	.globl	saveSteps
	.data
	.align 4
	.type	saveSteps, @object
	.size	saveSteps, 4
saveSteps:
	.long	1000
	.globl	maxSteps
	.align 4
	.type	maxSteps, @object
	.size	maxSteps, 4
maxSteps:
	.long	250000
	.globl	numPoints
	.align 4
	.type	numPoints, @object
	.size	numPoints, 4
numPoints:
	.long	4096
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC4:
	.long	1065353216
	.align 4
.LC5:
	.long	1034090883
	.align 4
.LC8:
	.long	1095307227
	.align 4
.LC9:
	.long	1086918619
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC11:
	.long	-1717986918
	.long	1069128089
	.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:

/*	Simulation overview:

	1. Define the information contained within a point in space as a c++ struct.
	2. Generate multiple copies of this point in a GPU array, each with unique parameters.
	3. Calculate a quantity at each point due to the given parameters within a CUDA kernel.
	4. Advance in time, and repeat.
*/

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <hip/hip_runtime.h>



int numPoints = 4096,		// number of points to generate (multiples of 32 are best)
    maxSteps  = 250000, 	// total iterations
	saveSteps = 1000;		// data will be written to file when current step % saveSteps = 0


__device__ __constant__ float dt = 0.0005,   // Time step size.
                              A, k, w, c, dk;

const float pi = 3.14159265358979f;                          
const float plotBoundary = 4 * pi;


typedef struct
{
	// Represents a point in space with its associated fields, as well
	// as any information we wish to carry along with each point.
	
	float x, y,     // position data
		  psi;      // wave height
		  
} point;



// HOST FUNCTIONS //////////////////////////////////////////////////////////////////////////////////
//


// Get GPU debugging mesagges.
inline void check_cuda_errors( const char *filename, const int line_number )
{
#ifdef DEBUG
  hipDeviceSynchronize();
  hipError_t error = hipGetLastError();
  if( error != hipSuccess )
  {
    printf( "CUDA error at %s:%i: %s\n", filename, line_number, hipGetErrorString( error ) );
    exit( -1 );
  }
#endif
}

// Get the current timestamp.
char *date_and_time()
{
	time_t  time_raw_format;
	struct tm * ptr_time;
	time ( &time_raw_format);
	ptr_time = localtime ( &time_raw_format );
	return asctime(ptr_time);
}

// Store simulation data into the directory specified by *path.
void writeDataToFile( char *path, point *p, int numPoints, float simTime, float plotLimit )
{
	// Initialize data file and write common parameters:
	FILE *file;	
	char filename[ strlen( path )+24 ];
	sprintf( filename,"%s/%.16f.dat", path, simTime );
	file = fopen( filename,"w" );
	char sp[10] = "         ";
	fprintf( file,"# limit = %g\n#\n# x%s  y%s  psi\n", plotLimit, sp, sp);
	
	// Write data to file:
	for( int i = 0; i < numPoints; i++ )
	{
		fprintf( file,"% .4e % .4e % .4e\n",
			p[i].x, p[i].y, p[i].psi );
	}
	
	fclose(file);
}


// Calculate constants used in device kernels.
void initializeDeviceConstants()
{
    float a = 1,
          lambda = 2 * pi,
          K = 2 * pi / lambda,
          hBar = 1 / ( 2 * pi ),  // letting h = 1
          m = 1,
          W = 0.5 * hBar * K * K / m,
          C =  W / K,
          DK = K / 8;  // determines the "tightness" of the wave packet

    hipMemcpyToSymbol( HIP_SYMBOL(A), &a, sizeof( float ) );
    hipMemcpyToSymbol( HIP_SYMBOL(k), &K, sizeof( float ) );
    hipMemcpyToSymbol( HIP_SYMBOL(w), &W, sizeof( float ) );
    hipMemcpyToSymbol( HIP_SYMBOL(c), &C, sizeof( float ) );
    hipMemcpyToSymbol( HIP_SYMBOL(dk), &DK, sizeof( float ) );
}


// Populate the point array on the host.
void initializePoints( point *p, int N )
{
    // Define the boudaries of the point-space.
    float dR = plotBoundary / sqrt( (float)N ),
          dTheta = 2 * pi / sqrt( (float)N );
          
    // Assign each point a specific location in space.
    int i = 0;
	for( float r = 0; r <= plotBoundary; r += dR )
	{	
	    for( float theta = 0; theta <= 2 * pi; theta += dTheta )
	    {
	        if( i > N )
	            continue;
            p[i].x = r * cos( theta );     // position vector
            p[i].y = r * sin( theta );	   //
            i++;
        }
	}
}

//
// END HOST FUNTIONS ///////////////////////////////////////////////////////////////////////////////




// DEVICE KERNELS //////////////////////////////////////////////////////////////////////////////////
//


__device__ int getGlobalIndex( void ) { return blockIdx.x * blockDim.x + threadIdx.x; }

__device__ float t = 0;
                              
__device__ void updateTime() { t += dt; }

// Calcutate the new point values in time and space at each timestep.
__global__ void incrementPoint( point *p, int numPoints )
{
	int	i = getGlobalIndex();
	 
    float r = sqrt( p[i].x*p[i].x + p[i].y*p[i].y );
    
    //p[i].psi = A * cos( k * r - w * t );  // simple circular wave
    
    // Disbursive Wave Packet
    // From A. C. Philips: Intro to Quantum Mechanics, problem 2.2 and fig. 2.1, with c = w/k.
    float alpha = r - c * t;
    p[i].psi = 2 * A * dk * sin( dk * alpha ) * cos( k * alpha ) / ( dk * alpha );
    
    updateTime();
}


//
// END DEVICE KERNELS //////////////////////////////////////////////////////////////////////////////


int main(int argc, char *argv[])
{


////////////////////////////////////////////////////////////////////////////////////////////////////
// SELECT DEVICE


    // Get the number of CUDA enabled devices.
	int deviceCount;
	hipGetDeviceCount( &deviceCount );
	if( deviceCount < 1 )
	{
		printf( "No CUDA-capable devices were detected.\n" );
		return 1;
	}

	// Get properties, select device, and display info.
	int device, useDevice;
	float computeCapability, cudaVersion = 0;
	hipDeviceProp_t deviceProp;
	for( device = 0; device < deviceCount; device++ )
	{
	    // Display info for each device.
		hipGetDeviceProperties( &deviceProp, device );
		computeCapability = deviceProp.major + deviceProp.minor * 0.1;
			
	    // Select the device with the greatest compute capability. If multiple devices
	    // with this capability are found, the first encountered will be used.
		if( computeCapability > cudaVersion )
		{
			cudaVersion = computeCapability;
			useDevice = device;
		}
	}
	device = useDevice;
	hipGetDevice(&device);
	hipGetDeviceProperties( &deviceProp, device );
    printf( "# Using %s, device number: %d, compute capability: %g.\n",
        deviceProp.name, device, cudaVersion );

    // Check for kernel timeout.
	if( deviceProp.kernelExecTimeoutEnabled == 1 )
	{
	    printf( "#\n" );
		printf( "# Warning: Timeout enabled. Using this device without a display \n" );
		printf( "# may lift kernel timeout restrictions.\n" );
	}  
	
	
// END SELECT DEVICE
////////////////////////////////////////////////////////////////////////////////////////////////////


	// Allocate memory:
	int threadsPerBlock = ( deviceProp.major >= 2 ? 512 : 256 ),
		numBlocks		= ceil( (float)numPoints / (float)threadsPerBlock ),
		numBytes		= numPoints * sizeof( point );
	point *cpuPointArray, *gpuPointArray;
	cpuPointArray = (point*)malloc( numBytes );
	hipMalloc( (void**)&gpuPointArray, numBytes );
	check_cuda_errors( __FILE__, __LINE__ );
	
	
////////////////////////////////////////////////////////////////////////////////////////////////////
// BEGIN SIMULATION


	// Begin simulation:
	for( int s = 0; s < maxSteps; s++ )
	{
		
		// Perform setup tasks before the first iteration.
		if( s == 0 )
		{	
		    // Initialize point array and device constants.
			srand( time( NULL ) );
			initializePoints( cpuPointArray, numPoints );
			initializeDeviceConstants();
			hipMemcpy( gpuPointArray, cpuPointArray, numBytes, hipMemcpyHostToDevice );

			// Write simulation info to stdout.
			float stepSize;
			hipMemcpyFromSymbol( &stepSize, HIP_SYMBOL(dt), sizeof(float) );
			printf( "#\n#\n" );
			printf( "# Started %s#\n# numPoints = %d\n# maxSteps  = %d\n# dt        = %g\n#\n",
				date_and_time(), numPoints, maxSteps, stepSize );
			printf( "# Steps   | Seconds  | Sim. Time\n# ------------------------------\n" );
			
			check_cuda_errors(__FILE__, __LINE__);	
		}

		// Execute portion of simulation on GPU:
		incrementPoint<<<numBlocks,threadsPerBlock>>>( gpuPointArray, numPoints );
			
		// Retrieve results:
		float simTime;
		hipMemcpyFromSymbol( &simTime, HIP_SYMBOL(t), sizeof( float ) );
		hipMemcpy( cpuPointArray, gpuPointArray, numBytes, hipMemcpyDeviceToHost );

		// Output data every [saveSteps] steps.
		if( s % saveSteps == 0 )
		{
		    // Write to file if save paths specified in argument to main().
		    if( argc > 1 )
			    writeDataToFile( argv[1], cpuPointArray, numPoints, simTime, plotBoundary );
			
			// Print data to stdout.
			printf( "%.4e %.4e %.4e\n", (float)s, (float)( clock() / CLOCKS_PER_SEC ), simTime );
		}

	}
	
	
// END SIMULATION
////////////////////////////////////////////////////////////////////////////////////////////////////
 	
 	
  	// Deallocate memory and exit.
  	free( cpuPointArray );
  	hipFree( gpuPointArray );
  	check_cuda_errors( __FILE__, __LINE__ );
  	printf( "\n# Completed %s", date_and_time() );
	return 0;
	
	
}	// end main

	.text
	.file	"nPoint.hip"
	.globl	_Z13date_and_timev              # -- Begin function _Z13date_and_timev
	.type	_Z13date_and_timev,@function
_Z13date_and_timev:                     # @_Z13date_and_timev
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -16
	leaq	8(%rsp), %rbx
	movq	%rbx, %rdi
	callq	time
	movq	%rbx, %rdi
	callq	localtime
	movq	%rax, %rdi
	callq	asctime
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z13date_and_timev, .Lfunc_end0-_Z13date_and_timev
	.cfi_endproc
                                        # -- End function
	.globl	_Z15writeDataToFilePcP5pointiff # -- Begin function _Z15writeDataToFilePcP5pointiff
	.type	_Z15writeDataToFilePcP5pointiff,@function
_Z15writeDataToFilePcP5pointiff:        # @_Z15writeDataToFilePcP5pointiff
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movss	%xmm1, -40(%rbp)                # 4-byte Spill
	movss	%xmm0, -36(%rbp)                # 4-byte Spill
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	strlen
	movq	%rsp, %r12
	addq	$39, %rax
	andq	$-16, %rax
	subq	%rax, %r12
	movq	%r12, %rsp
	xorps	%xmm0, %xmm0
	cvtss2sd	-36(%rbp), %xmm0                # 4-byte Folded Reload
	movl	$.L.str, %esi
	movq	%r12, %rdi
	movq	%r15, %rdx
	movb	$1, %al
	callq	sprintf
	movl	$.L.str.1, %esi
	movq	%r12, %rdi
	callq	fopen
	movq	%rax, %r15
	movabsq	$2314885530818453536, %rax      # imm = 0x2020202020202020
	leaq	-56(%rbp), %rcx
	movq	%rax, (%rcx)
	movw	$32, 8(%rcx)
	xorps	%xmm0, %xmm0
	cvtss2sd	-40(%rbp), %xmm0                # 4-byte Folded Reload
	movl	$.L.str.2, %esi
	movq	%r15, %rdi
	movq	%rcx, %rdx
	movb	$1, %al
	callq	fprintf
	testl	%r14d, %r14d
	jle	.LBB1_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%r14d, %eax
	shlq	$2, %rax
	leaq	(%rax,%rax,2), %r14
	xorl	%r12d, %r12d
.LBB1_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx,%r12), %xmm0
	xorps	%xmm1, %xmm1
	cvtss2sd	4(%rbx,%r12), %xmm1
	xorps	%xmm2, %xmm2
	cvtss2sd	8(%rbx,%r12), %xmm2
	movl	$.L.str.3, %esi
	movq	%r15, %rdi
	movb	$3, %al
	callq	fprintf
	addq	$12, %r12
	cmpq	%r12, %r14
	jne	.LBB1_2
.LBB1_3:                                # %._crit_edge
	movq	%r15, %rdi
	callq	fclose
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.Lfunc_end1:
	.size	_Z15writeDataToFilePcP5pointiff, .Lfunc_end1-_Z15writeDataToFilePcP5pointiff
	.cfi_endproc
                                        # -- End function
	.globl	_Z25initializeDeviceConstantsv  # -- Begin function _Z25initializeDeviceConstantsv
	.type	_Z25initializeDeviceConstantsv,@function
_Z25initializeDeviceConstantsv:         # @_Z25initializeDeviceConstantsv
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$1065353216, %eax               # imm = 0x3F800000
	leaq	20(%rsp), %rsi
	movl	%eax, (%rsi)
	leaq	16(%rsp), %r12
	movl	%eax, (%r12)
	movl	$1034090883, %eax               # imm = 0x3DA2F983
	leaq	12(%rsp), %r15
	movl	%eax, (%r15)
	leaq	8(%rsp), %r14
	movl	%eax, (%r14)
	leaq	4(%rsp), %rbx
	movl	$1040187392, (%rbx)             # imm = 0x3E000000
	movl	$A, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	$k, %edi
	movl	$4, %edx
	movq	%r12, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	$w, %edi
	movl	$4, %edx
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	$c, %edi
	movl	$4, %edx
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	$dk, %edi
	movl	$4, %edx
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z25initializeDeviceConstantsv, .Lfunc_end2-_Z25initializeDeviceConstantsv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z16initializePointsP5pointi
.LCPI3_0:
	.long	0x41490fdb                      # float 12.566371
.LCPI3_1:
	.long	0x40c90fdb                      # float 6.28318548
	.text
	.globl	_Z16initializePointsP5pointi
	.type	_Z16initializePointsP5pointi,@function
_Z16initializePointsP5pointi:           # @_Z16initializePointsP5pointi
	.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	%rbx
	.cfi_def_cfa_offset 40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebx
	movq	%rdi, %r14
	cvtsi2ss	%esi, %xmm0
	sqrtss	%xmm0, %xmm3
	xorps	%xmm2, %xmm2
	ucomiss	%xmm2, %xmm0
	movaps	%xmm3, %xmm1
	jae	.LBB3_2
# %bb.1:                                # %call.sqrt
	movss	%xmm0, 8(%rsp)                  # 4-byte Spill
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	%xmm3, 12(%rsp)                 # 4-byte Spill
	callq	sqrtf
	xorps	%xmm2, %xmm2
	movss	12(%rsp), %xmm3                 # 4-byte Reload
                                        # xmm3 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm1
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
.LBB3_2:                                # %.split
	ucomiss	%xmm2, %xmm0
	jae	.LBB3_4
# %bb.3:                                # %call.sqrt24
	movss	%xmm1, 8(%rsp)                  # 4-byte Spill
	callq	sqrtf
	movss	8(%rsp), %xmm1                  # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm3
.LBB3_4:                                # %.split.split
	movss	.LCPI3_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	divss	%xmm1, %xmm0
	movss	%xmm0, 16(%rsp)                 # 4-byte Spill
	movss	.LCPI3_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movaps	%xmm1, %xmm2
	divss	%xmm3, %xmm2
	xorl	%ebp, %ebp
	xorps	%xmm0, %xmm0
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movss	%xmm2, 20(%rsp)                 # 4-byte Spill
.LBB3_5:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_6 Depth 2
	xorps	%xmm0, %xmm0
.LBB3_6:                                #   Parent Loop BB3_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpl	%ebx, %ebp
	jg	.LBB3_8
# %bb.7:                                #   in Loop: Header=BB3_6 Depth=2
	movss	%xmm0, 8(%rsp)                  # 4-byte Spill
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	callq	cosf
	mulss	12(%rsp), %xmm0                 # 4-byte Folded Reload
	movslq	%ebp, %rax
	leaq	(%rax,%rax,2), %r15
	movss	%xmm0, (%r14,%r15,4)
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	callq	sinf
	movss	20(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	movss	.LCPI3_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	mulss	12(%rsp), %xmm0                 # 4-byte Folded Reload
	movss	%xmm0, 4(%r14,%r15,4)
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	incl	%ebp
.LBB3_8:                                #   in Loop: Header=BB3_6 Depth=2
	addss	%xmm2, %xmm0
	ucomiss	%xmm0, %xmm1
	jae	.LBB3_6
# %bb.9:                                #   in Loop: Header=BB3_5 Depth=1
	movss	12(%rsp), %xmm3                 # 4-byte Reload
                                        # xmm3 = mem[0],zero,zero,zero
	addss	16(%rsp), %xmm3                 # 4-byte Folded Reload
	movss	.LCPI3_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	%xmm3, 12(%rsp)                 # 4-byte Spill
	ucomiss	%xmm3, %xmm0
	jae	.LBB3_5
# %bb.10:
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.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_end3:
	.size	_Z16initializePointsP5pointi, .Lfunc_end3-_Z16initializePointsP5pointi
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__incrementPointP5pointi # -- Begin function _Z29__device_stub__incrementPointP5pointi
	.type	_Z29__device_stub__incrementPointP5pointi,@function
_Z29__device_stub__incrementPointP5pointi: # @_Z29__device_stub__incrementPointP5pointi
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%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	$_Z14incrementPointP5pointi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z29__device_stub__incrementPointP5pointi, .Lfunc_end4-_Z29__device_stub__incrementPointP5pointi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI5_0:
	.quad	0x3fb999999999999a              # double 0.10000000000000001
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI5_1:
	.long	0x41490fdb                      # float 12.566371
	.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	$1528, %rsp                     # imm = 0x5F8
	.cfi_def_cfa_offset 1584
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, 40(%rsp)                  # 8-byte Spill
	movl	%edi, 32(%rsp)                  # 4-byte Spill
	leaq	36(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDeviceCount
	cmpl	$0, (%rbx)
	jle	.LBB5_1
# %bb.2:                                # %.lr.ph
	xorl	%ebx, %ebx
	xorps	%xmm0, %xmm0
	leaq	56(%rsp), %r14
                                        # implicit-def: $ebp
.LBB5_3:                                # =>This Inner Loop Header: Depth=1
	movss	%xmm0, 16(%rsp)                 # 4-byte Spill
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	hipGetDevicePropertiesR0600
	xorps	%xmm0, %xmm0
	cvtsi2sdl	416(%rsp), %xmm0
	xorps	%xmm1, %xmm1
	cvtsi2sdl	420(%rsp), %xmm1
	mulsd	.LCPI5_0(%rip), %xmm1
	addsd	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm1, %xmm0
	movss	16(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	cmoval	%ebx, %ebp
	maxss	%xmm1, %xmm0
	incl	%ebx
	cmpl	36(%rsp), %ebx
	jl	.LBB5_3
# %bb.4:                                # %._crit_edge
	leaq	52(%rsp), %rbx
	movl	%ebp, (%rbx)
	movq	%rbx, %rdi
	movss	%xmm0, 16(%rsp)                 # 4-byte Spill
	callq	hipGetDevice
	movl	(%rbx), %esi
	leaq	56(%rsp), %r14
	movq	%r14, %rdi
	callq	hipGetDevicePropertiesR0600
	movl	(%rbx), %edx
	xorps	%xmm0, %xmm0
	cvtss2sd	16(%rsp), %xmm0                 # 4-byte Folded Reload
	movl	$.L.str.5, %edi
	movq	%r14, %rsi
	movb	$1, %al
	callq	printf
	cmpl	$1, 392(%r14)
	jne	.LBB5_6
# %bb.5:
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movl	$.Lstr.2, %edi
	callq	puts@PLT
.LBB5_6:
	movl	416(%rsp), %ebx
	movl	numPoints(%rip), %r12d
	leal	(,%r12,4), %eax
	leal	(%rax,%rax,2), %eax
	movslq	%eax, %r14
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, %r15
	leaq	24(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	cmpl	$0, maxSteps(%rip)
	jle	.LBB5_17
# %bb.7:                                # %.lr.ph46
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r12d, %xmm0
	xorl	%r12d, %r12d
	cmpl	$2, %ebx
	setge	%r12b
	shll	$8, %r12d
	addl	$256, %r12d                     # imm = 0x100
	xorps	%xmm1, %xmm1
	cvtsi2ss	%r12d, %xmm1
	divss	%xmm1, %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %r13d
	btsq	$32, %r13
	btsq	$32, %r12
	xorl	%ebx, %ebx
	leaq	12(%rsp), %rbp
.LBB5_8:                                # =>This Inner Loop Header: Depth=1
	testl	%ebx, %ebx
	jne	.LBB5_10
# %bb.9:                                #   in Loop: Header=BB5_8 Depth=1
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	movl	numPoints(%rip), %esi
	movq	%r15, %rdi
	callq	_Z16initializePointsP5pointi
	callq	_Z25initializeDeviceConstantsv
	movq	24(%rsp), %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$dt, %esi
	movl	$4, %edx
	movq	%rbp, %rdi
	xorl	%ecx, %ecx
	movl	$2, %r8d
	callq	hipMemcpyFromSymbol
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	callq	_Z13date_and_timev
	movl	numPoints(%rip), %edx
	movl	maxSteps(%rip), %ecx
	xorps	%xmm0, %xmm0
	cvtss2sd	12(%rsp), %xmm0
	movl	$.L.str.11, %edi
	movq	%rax, %rsi
	movb	$1, %al
	callq	printf
	movl	$.Lstr.4, %edi
	callq	puts@PLT
.LBB5_10:                               #   in Loop: Header=BB5_8 Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_12
# %bb.11:                               #   in Loop: Header=BB5_8 Depth=1
	movq	24(%rsp), %rdi
	movl	numPoints(%rip), %esi
	callq	_Z29__device_stub__incrementPointP5pointi
.LBB5_12:                               #   in Loop: Header=BB5_8 Depth=1
	movl	$t, %esi
	movl	$4, %edx
	movq	%rbp, %rdi
	xorl	%ecx, %ecx
	movl	$2, %r8d
	callq	hipMemcpyFromSymbol
	movq	24(%rsp), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	%ebx, %eax
	cltd
	idivl	saveSteps(%rip)
	testl	%edx, %edx
	jne	.LBB5_16
# %bb.13:                               #   in Loop: Header=BB5_8 Depth=1
	cmpl	$2, 32(%rsp)                    # 4-byte Folded Reload
	jl	.LBB5_15
# %bb.14:                               #   in Loop: Header=BB5_8 Depth=1
	movq	40(%rsp), %rax                  # 8-byte Reload
	movq	8(%rax), %rdi
	movl	numPoints(%rip), %edx
	movss	12(%rsp), %xmm0                 # xmm0 = mem[0],zero,zero,zero
	movq	%r15, %rsi
	movss	.LCPI5_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	callq	_Z15writeDataToFilePcP5pointiff
.LBB5_15:                               #   in Loop: Header=BB5_8 Depth=1
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ebx, %xmm0
	cvtss2sd	%xmm0, %xmm0
	movsd	%xmm0, 16(%rsp)                 # 8-byte Spill
	callq	clock
	movabsq	$4835703278458516699, %rcx      # imm = 0x431BDE82D7B634DB
	imulq	%rcx
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$18, %rdx
	addq	%rax, %rdx
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rdx, %xmm0
	xorps	%xmm1, %xmm1
	cvtss2sd	%xmm0, %xmm1
	xorps	%xmm2, %xmm2
	cvtss2sd	12(%rsp), %xmm2
	movl	$.L.str.13, %edi
	movsd	16(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$3, %al
	callq	printf
.LBB5_16:                               #   in Loop: Header=BB5_8 Depth=1
	incl	%ebx
	cmpl	maxSteps(%rip), %ebx
	jl	.LBB5_8
.LBB5_17:                               # %._crit_edge47
	movq	%r15, %rdi
	callq	free
	movq	24(%rsp), %rdi
	callq	hipFree
	callq	_Z13date_and_timev
	xorl	%ebx, %ebx
	movl	$.L.str.14, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB5_18
.LBB5_1:
	movl	$.Lstr.5, %edi
	callq	puts@PLT
	movl	$1, %ebx
.LBB5_18:
	movl	%ebx, %eax
	addq	$1528, %rsp                     # imm = 0x5F8
	.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_end5:
	.size	main, .Lfunc_end5-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
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	subq	$32, %rsp
	.cfi_adjust_cfa_offset 32
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14incrementPointP5pointi, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movl	$dt, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$A, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$k, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$w, %esi
	movl	$.L.str.1, %edx
	movl	$.L.str.1, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$c, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$dk, %esi
	movl	$.L__unnamed_6, %edx
	movl	$.L__unnamed_6, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$t, %esi
	movl	$.L__unnamed_7, %edx
	movl	$.L__unnamed_7, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$__hip_module_dtor, %edi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__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	.LBB7_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
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	numPoints,@object               # @numPoints
	.data
	.globl	numPoints
	.p2align	2, 0x0
numPoints:
	.long	4096                            # 0x1000
	.size	numPoints, 4

	.type	maxSteps,@object                # @maxSteps
	.globl	maxSteps
	.p2align	2, 0x0
maxSteps:
	.long	250000                          # 0x3d090
	.size	maxSteps, 4

	.type	saveSteps,@object               # @saveSteps
	.globl	saveSteps
	.p2align	2, 0x0
saveSteps:
	.long	1000                            # 0x3e8
	.size	saveSteps, 4

	.type	dt,@object                      # @dt
	.local	dt
	.comm	dt,4,4
	.type	A,@object                       # @A
	.local	A
	.comm	A,4,4
	.type	k,@object                       # @k
	.local	k
	.comm	k,4,4
	.type	w,@object                       # @w
	.local	w
	.comm	w,4,4
	.type	c,@object                       # @c
	.local	c
	.comm	c,4,4
	.type	dk,@object                      # @dk
	.local	dk
	.comm	dk,4,4
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"%s/%.16f.dat"
	.size	.L.str, 13

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"# limit = %g\n#\n# x%s  y%s  psi\n"
	.size	.L.str.2, 32

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"% .4e % .4e % .4e\n"
	.size	.L.str.3, 19

	.type	t,@object                       # @t
	.local	t
	.comm	t,4,4
	.type	_Z14incrementPointP5pointi,@object # @_Z14incrementPointP5pointi
	.section	.rodata,"a",@progbits
	.globl	_Z14incrementPointP5pointi
	.p2align	3, 0x0
_Z14incrementPointP5pointi:
	.quad	_Z29__device_stub__incrementPointP5pointi
	.size	_Z14incrementPointP5pointi, 8

	.type	.L.str.5,@object                # @.str.5
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.5:
	.asciz	"# Using %s, device number: %d, compute capability: %g.\n"
	.size	.L.str.5, 56

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"# Started %s#\n# numPoints = %d\n# maxSteps  = %d\n# dt        = %g\n#\n"
	.size	.L.str.11, 68

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

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"\n# Completed %s"
	.size	.L.str.14, 16

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z14incrementPointP5pointi"
	.size	.L__unnamed_1, 27

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"dt"
	.size	.L__unnamed_2, 3

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"A"
	.size	.L__unnamed_3, 2

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"k"
	.size	.L__unnamed_4, 2

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"c"
	.size	.L__unnamed_5, 2

	.type	.L__unnamed_6,@object           # @5
.L__unnamed_6:
	.asciz	"dk"
	.size	.L__unnamed_6, 3

	.type	.L__unnamed_7,@object           # @6
.L__unnamed_7:
	.asciz	"t"
	.size	.L__unnamed_7, 2

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

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"#"
	.size	.Lstr, 2

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"# Warning: Timeout enabled. Using this device without a display "
	.size	.Lstr.1, 65

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"# may lift kernel timeout restrictions."
	.size	.Lstr.2, 40

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"#\n#"
	.size	.Lstr.3, 4

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"# Steps   | Seconds  | Sim. Time\n# ------------------------------"
	.size	.Lstr.4, 66

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"No CUDA-capable devices were detected."
	.size	.Lstr.5, 39

	.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 _Z29__device_stub__incrementPointP5pointi
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym dt
	.addrsig_sym A
	.addrsig_sym k
	.addrsig_sym w
	.addrsig_sym c
	.addrsig_sym dk
	.addrsig_sym t
	.addrsig_sym _Z14incrementPointP5pointi
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z14incrementPointP5pointi ; -- Begin function _Z14incrementPointP5pointi
	.globl	_Z14incrementPointP5pointi
	.p2align	8
	.type	_Z14incrementPointP5pointi,@function
_Z14incrementPointP5pointi:             ; @_Z14incrementPointP5pointi
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x1c
	s_load_b64 s[2:3], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s0, s4, 0xffff
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, c@rel32@lo+4
	s_addc_u32 s5, s5, c@rel32@hi+12
	v_mad_u64_u32 v[1:2], null, s15, s0, v[0:1]
	s_getpc_b64 s[6:7]
	s_add_u32 s6, s6, t@rel32@lo+4
	s_addc_u32 s7, s7, t@rel32@hi+12
	s_getpc_b64 s[8:9]
	s_add_u32 s8, s8, dk@rel32@lo+4
	s_addc_u32 s9, s9, dk@rel32@hi+12
	s_delay_alu instid0(VALU_DEP_1)
	v_mad_i64_i32 v[2:3], null, v1, 12, s[2:3]
	global_load_b64 v[2:3], v[2:3], off
	s_load_b32 s1, s[4:5], 0x0
	s_load_b32 s4, s[6:7], 0x0
	s_load_b32 s6, s[8:9], 0x0
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v0, v3, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v0, v2, v2
	v_mul_f32_e32 v2, 0x4f800000, v0
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v2, vcc_lo
	v_sqrt_f32_e32 v2, v0
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v3, -1, v2
	v_add_nc_u32_e32 v4, 1, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v5, -v3, v2, v0
	v_fma_f32 v6, -v4, v2, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s0, 0, v5
	v_cndmask_b32_e64 v2, v2, v3, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s0, 0, v6
	v_cndmask_b32_e64 v2, v2, v4, s0
                                        ; implicit-def: $vgpr4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v3, 0x37800000, v2
	v_cndmask_b32_e32 v2, v2, v3, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v0, 0x260
                                        ; implicit-def: $vgpr3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v2, v0, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_fma_f32 v5, -s1, s4, v0
	s_mov_b32 s1, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v0, s6, v5
	v_and_b32_e32 v2, 0x7fffffff, v0
	v_cmpx_ngt_f32_e64 0x48000000, |v0|
	s_xor_b32 s4, exec_lo, s1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_mov_b32 s0, 0x7fffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_or_b32 v15, v2, s0, 0x800000
	v_mad_u64_u32 v[3:4], null, 0xfe5163ab, v15, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_mov_b32 v7, 0 :: v_dual_mov_b32 v6, v4
	v_lshrrev_b32_e32 v4, 23, v2
	v_mad_u64_u32 v[8:9], null, 0x3c439041, v15, v[6:7]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v4, 0xffffff88, v4
	v_cmp_lt_u32_e32 vcc_lo, 63, v4
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v6, v9
	v_cndmask_b32_e64 v13, 0, 0xffffffc0, vcc_lo
	v_mad_u64_u32 v[9:10], null, 0xdb629599, v15, v[6:7]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v4, v13, v4
	v_mov_b32_e32 v6, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cmp_lt_u32_e64 s0, 31, v4
	v_cndmask_b32_e32 v3, v9, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mad_u64_u32 v[10:11], null, 0xf534ddc0, v15, v[6:7]
	v_cndmask_b32_e64 v14, 0, 0xffffffe0, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_nc_u32_e32 v4, v14, v4
	v_mov_b32_e32 v6, v11
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_lt_u32_e64 s1, 31, v4
	v_mad_u64_u32 v[11:12], null, 0xfc2757d1, v15, v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v6, v12
	v_mad_u64_u32 v[12:13], null, 0x4e441529, v15, v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v6, v13
	v_mad_u64_u32 v[13:14], null, 0xa2f9836e, v15, v[6:7]
	v_cndmask_b32_e64 v6, 0, 0xffffffe0, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_dual_cndmask_b32 v7, v12, v10 :: v_dual_add_nc_u32 v4, v6, v4
	v_dual_cndmask_b32 v13, v13, v11 :: v_dual_cndmask_b32 v12, v14, v12
	v_dual_cndmask_b32 v11, v11, v9 :: v_dual_cndmask_b32 v6, v10, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_eq_u32_e32 vcc_lo, 0, v4
	v_cndmask_b32_e64 v8, v13, v7, s0
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cndmask_b32_e64 v10, v12, v13, s0
	v_cndmask_b32_e64 v7, v7, v11, s0
	v_sub_nc_u32_e32 v12, 32, v4
	v_cndmask_b32_e64 v11, v11, v6, s0
	v_cndmask_b32_e64 v3, v6, v3, s0
	v_cndmask_b32_e64 v10, v10, v8, s1
	v_cndmask_b32_e64 v8, v8, v7, s1
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cndmask_b32_e64 v7, v7, v11, s1
	v_cndmask_b32_e64 v3, v11, v3, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_alignbit_b32 v13, v10, v8, v12
	v_alignbit_b32 v9, v8, v7, v12
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_alignbit_b32 v11, v7, v3, v12
	v_cndmask_b32_e32 v4, v13, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_cndmask_b32 v6, v9, v8 :: v_dual_cndmask_b32 v7, v11, v7
	v_bfe_u32 v8, v4, 29, 1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_alignbit_b32 v9, v4, v6, 30
	v_alignbit_b32 v6, v6, v7, 30
	v_alignbit_b32 v3, v7, v3, 30
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v10, 0, v8
	v_xor_b32_e32 v9, v9, v10
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_xor_b32_e32 v6, v6, v10
	v_xor_b32_e32 v3, v3, v10
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_clz_i32_u32_e32 v11, v9
	v_min_u32_e32 v11, 32, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v7, 31, v11
	v_lshlrev_b32_e32 v13, 23, v11
	v_alignbit_b32 v9, v9, v6, v7
	v_alignbit_b32 v3, v6, v3, v7
	v_lshrrev_b32_e32 v7, 29, v4
	v_lshrrev_b32_e32 v4, 30, v4
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_alignbit_b32 v6, v9, v3, 9
	v_lshlrev_b32_e32 v7, 31, v7
	v_lshrrev_b32_e32 v9, 9, v9
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_nc_u32_e32 v4, v8, v4
	v_clz_i32_u32_e32 v10, v6
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_or_b32_e32 v12, 0.5, v7
	v_min_u32_e32 v10, 32, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v12, v12, v13
	v_sub_nc_u32_e32 v14, 31, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_alignbit_b32 v3, v6, v3, v14
	v_or_b32_e32 v6, v9, v12
	v_add_lshl_u32 v9, v10, v11, 23
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshrrev_b32_e32 v3, 9, v3
	v_mul_f32_e32 v10, 0x3fc90fda, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v3, v3, v9
	v_fma_f32 v9, 0x3fc90fda, v6, -v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v3, 0x33000000, v3
	v_fmamk_f32 v6, v6, 0x33a22168, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_or_b32_e32 v3, v3, v7
	v_fmac_f32_e32 v6, 0x3fc90fda, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v3, v10, v6
.LBB0_2:                                ; %Flow25
	s_and_not1_saveexec_b32 s0, s4
; %bb.3:
	v_mul_f32_e64 v3, 0x3f22f983, |v0|
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_rndne_f32_e32 v4, v3
	v_fma_f32 v3, 0xbfc90fda, v4, |v0|
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmamk_f32 v3, v4, 0xb3a22168, v3
	v_fmamk_f32 v3, v4, 0xa7c234c4, v3
	v_cvt_i32_f32_e32 v4, v4
; %bb.4:                                ; %_ZL3sinf.exit
	s_or_b32 exec_lo, exec_lo, s0
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, k@rel32@lo+4
	s_addc_u32 s1, s1, k@rel32@hi+12
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, A@rel32@lo+4
	s_addc_u32 s5, s5, A@rel32@hi+12
	s_load_b32 s0, s[0:1], 0x0
                                        ; implicit-def: $vgpr7
                                        ; implicit-def: $vgpr6
	s_mov_b32 s1, exec_lo
	s_waitcnt lgkmcnt(0)
	v_mul_f32_e32 v5, s0, v5
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_ngt_f32_e64 0x48000000, |v5|
	s_xor_b32 s7, exec_lo, s1
	s_cbranch_execz .LBB0_6
; %bb.5:
	v_dual_mov_b32 v8, 0 :: v_dual_and_b32 v13, 0x7fffffff, v5
	s_mov_b32 s0, 0x7fffff
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_and_or_b32 v16, v13, s0, 0x800000
	v_lshrrev_b32_e32 v13, 23, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[6:7], null, 0xfe5163ab, v16, 0
	v_add_nc_u32_e32 v14, 0xffffff88, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_lt_u32_e32 vcc_lo, 63, v14
	v_mad_u64_u32 v[9:10], null, 0x3c439041, v16, v[7:8]
	v_cndmask_b32_e64 v15, 0, 0xffffffc0, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v7, v10
	v_add_nc_u32_e32 v15, v15, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[10:11], null, 0xdb629599, v16, v[7:8]
	v_cmp_lt_u32_e64 s0, 31, v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v17, 0, 0xffffffe0, s0
	v_dual_mov_b32 v7, v11 :: v_dual_cndmask_b32 v6, v10, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v17, v17, v15
	v_mad_u64_u32 v[11:12], null, 0xf534ddc0, v16, v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_lt_u32_e64 s1, 31, v17
	v_mov_b32_e32 v7, v12
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v9, v11, v9, vcc_lo
	v_mad_u64_u32 v[12:13], null, 0xfc2757d1, v16, v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v6, v9, v6, s0
	v_mov_b32_e32 v7, v13
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[13:14], null, 0x4e441529, v16, v[7:8]
	v_mov_b32_e32 v7, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[14:15], null, 0xa2f9836e, v16, v[7:8]
	v_cndmask_b32_e64 v7, 0, 0xffffffe0, s1
	v_dual_cndmask_b32 v8, v13, v11 :: v_dual_add_nc_u32 v7, v7, v17
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_dual_cndmask_b32 v14, v14, v12 :: v_dual_cndmask_b32 v13, v15, v13
	v_cndmask_b32_e32 v12, v12, v10, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, 0, v7
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cndmask_b32_e64 v11, v14, v8, s0
	v_cndmask_b32_e64 v13, v13, v14, s0
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_cndmask_b32_e64 v8, v8, v12, s0
	v_sub_nc_u32_e32 v14, 32, v7
	v_cndmask_b32_e64 v12, v12, v9, s0
	v_cndmask_b32_e64 v13, v13, v11, s1
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v11, v11, v8, s1
	v_cndmask_b32_e64 v8, v8, v12, s1
	v_cndmask_b32_e64 v6, v12, v6, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_alignbit_b32 v15, v13, v11, v14
	v_alignbit_b32 v10, v11, v8, v14
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cndmask_b32_e32 v7, v15, v13, vcc_lo
	v_alignbit_b32 v13, v8, v6, v14
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v9, v10, v11, vcc_lo
	v_bfe_u32 v10, v7, 29, 1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v8, v13, v8, vcc_lo
	v_alignbit_b32 v11, v7, v9, 30
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_sub_nc_u32_e32 v12, 0, v10
	v_alignbit_b32 v9, v9, v8, 30
	v_alignbit_b32 v6, v8, v6, 30
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_xor_b32_e32 v11, v11, v12
	v_xor_b32_e32 v8, v9, v12
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_xor_b32_e32 v6, v6, v12
	v_clz_i32_u32_e32 v13, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_min_u32_e32 v13, 32, v13
	v_sub_nc_u32_e32 v9, 31, v13
	v_lshlrev_b32_e32 v15, 23, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_alignbit_b32 v11, v11, v8, v9
	v_alignbit_b32 v6, v8, v6, v9
	v_lshrrev_b32_e32 v9, 29, v7
	v_alignbit_b32 v8, v11, v6, 9
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_lshlrev_b32_e32 v9, 31, v9
	v_lshrrev_b32_e32 v11, 9, v11
	v_clz_i32_u32_e32 v12, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_or_b32_e32 v14, 0.5, v9
	v_min_u32_e32 v12, 32, v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v14, v14, v15
	v_sub_nc_u32_e32 v16, 31, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_alignbit_b32 v6, v8, v6, v16
	v_or_b32_e32 v8, v11, v14
	v_add_lshl_u32 v11, v12, v13, 23
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshrrev_b32_e32 v6, 9, v6
	v_mul_f32_e32 v12, 0x3fc90fda, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v6, v6, v11
	v_fma_f32 v11, 0x3fc90fda, v8, -v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v6, 0x33000000, v6
	v_fmamk_f32 v8, v8, 0x33a22168, v11
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_or_b32_e32 v6, v6, v9
	v_fmac_f32_e32 v8, 0x3fc90fda, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, v12, v8
	v_lshrrev_b32_e32 v7, 30, v7
	v_add_nc_u32_e32 v7, v10, v7
.LBB0_6:                                ; %Flow
	s_or_saveexec_b32 s0, s7
	s_load_b32 s1, s[4:5], 0x0
	s_xor_b32 exec_lo, exec_lo, s0
; %bb.7:
	v_mul_f32_e64 v6, 0x3f22f983, |v5|
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_rndne_f32_e32 v7, v6
	v_fma_f32 v6, 0xbfc90fda, v7, |v5|
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmamk_f32 v6, v7, 0xb3a22168, v6
	v_fmamk_f32 v6, v7, 0xa7c234c4, v6
	v_cvt_i32_f32_e32 v7, v7
; %bb.8:                                ; %_ZL3cosf.exit
	s_or_b32 exec_lo, exec_lo, s0
	s_delay_alu instid0(VALU_DEP_2)
	v_dual_mul_f32 v9, v3, v3 :: v_dual_mul_f32 v10, v6, v6
	s_waitcnt lgkmcnt(0)
	v_add_f32_e64 v8, s1, s1
	s_mov_b32 s0, 0xb94c1982
	s_mov_b32 s1, 0x37d75334
	v_dual_fmaak_f32 v11, s0, v9, 0x3c0881c4 :: v_dual_lshlrev_b32 v14, 30, v4
	v_dual_fmaak_f32 v12, s1, v9, 0xbab64f3b :: v_dual_fmaak_f32 v15, s1, v10, 0xbab64f3b
	v_dual_fmaak_f32 v13, s0, v10, 0x3c0881c4 :: v_dual_and_b32 v4, 1, v4
	v_xor_b32_e32 v2, v2, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_dual_fmaak_f32 v12, v9, v12, 0x3d2aabf7 :: v_dual_fmaak_f32 v15, v10, v15, 0x3d2aabf7
	v_fmaak_f32 v13, v10, v13, 0xbe2aaa9d
	s_delay_alu instid0(VALU_DEP_4)
	v_cmp_eq_u32_e32 vcc_lo, 0, v4
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, t@rel32@lo+4
	s_addc_u32 s1, s1, t@rel32@hi+12
	v_dual_fmaak_f32 v12, v9, v12, 0xbf000004 :: v_dual_fmaak_f32 v15, v10, v15, 0xbf000004
	v_mul_f32_e32 v13, v10, v13
	v_fmaak_f32 v11, v9, v11, 0xbe2aaa9d
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f32 v10, v10, v15, 1.0
	v_fmac_f32_e32 v6, v6, v13
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_mul_f32 v11, v9, v11 :: v_dual_and_b32 v14, 0x80000000, v14
	v_fma_f32 v9, v9, v12, 1.0
	v_fmac_f32_e32 v3, v3, v11
	v_and_b32_e32 v11, 1, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v3, v9, v3, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, 0, v11
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_xor3_b32 v2, v2, v14, v3
	v_cndmask_b32_e64 v4, -v6, v10, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v0, 0x1f8
	v_mul_f32_e32 v3, s6, v8
	v_cndmask_b32_e32 v2, 0x7fc00000, v2, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v5, 0x1f8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_mul_f32 v2, v3, v2 :: v_dual_lshlrev_b32 v7, 30, v7
	v_and_b32_e32 v6, 0x80000000, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v4, v6, v4
	v_cndmask_b32_e32 v4, 0x7fc00000, v4, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v4, v2, v4
	v_div_scale_f32 v2, null, v0, v0, v4
	v_div_scale_f32 v6, vcc_lo, v4, v0, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v3, v2
	s_waitcnt_depctr 0xfff
	v_fma_f32 v5, -v2, v3, 1.0
	v_fmac_f32_e32 v3, v5, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v5, v6, v3
	v_fma_f32 v7, -v2, v5, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v5, v7, v3
	v_fma_f32 v2, -v2, v5, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fmas_f32 v5, v2, v3, v5
	v_mad_i64_i32 v[2:3], null, v1, 12, s[2:3]
	v_mov_b32_e32 v1, 0
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, dt@rel32@lo+4
	s_addc_u32 s3, s3, dt@rel32@hi+12
	v_div_fixup_f32 v0, v5, v0, v4
	s_load_b32 s2, s[2:3], 0x0
	global_store_b32 v[2:3], v0, off offset:8
	global_load_b32 v0, v1, s[0:1]
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_add_f32_e32 v0, s2, v0
	global_store_b32 v1, v0, s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14incrementPointP5pointi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 18
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z14incrementPointP5pointi, .Lfunc_end0-_Z14incrementPointP5pointi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 2456
; NumSgprs: 18
; NumVgprs: 18
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 18
; 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
	.protected	dt                      ; @dt
	.type	dt,@object
	.data
	.globl	dt
	.p2align	2, 0x0
dt:
	.long	0x3a03126f                      ; float 5.00000024E-4
	.size	dt, 4

	.protected	A                       ; @A
	.type	A,@object
	.section	.bss,"aw",@nobits
	.globl	A
	.p2align	2, 0x0
A:
	.long	0x00000000                      ; float 0
	.size	A, 4

	.protected	k                       ; @k
	.type	k,@object
	.globl	k
	.p2align	2, 0x0
k:
	.long	0x00000000                      ; float 0
	.size	k, 4

	.protected	w                       ; @w
	.type	w,@object
	.globl	w
	.p2align	2, 0x0
w:
	.long	0x00000000                      ; float 0
	.size	w, 4

	.protected	c                       ; @c
	.type	c,@object
	.globl	c
	.p2align	2, 0x0
c:
	.long	0x00000000                      ; float 0
	.size	c, 4

	.protected	dk                      ; @dk
	.type	dk,@object
	.globl	dk
	.p2align	2, 0x0
dk:
	.long	0x00000000                      ; float 0
	.size	dk, 4

	.protected	t                       ; @t
	.type	t,@object
	.globl	t
	.p2align	2, 0x0
t:
	.long	0x00000000                      ; float 0
	.size	t, 4

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.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 dt
	.addrsig_sym A
	.addrsig_sym k
	.addrsig_sym w
	.addrsig_sym c
	.addrsig_sym dk
	.addrsig_sym t
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14incrementPointP5pointi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z14incrementPointP5pointi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     18
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
